From e4291734d55fa17b6e4f524669b5a0b5f7011427 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Sat, 9 Jul 2022 16:19:43 -0500 Subject: [PATCH 01/32] Proof of mathquill extension --- public/firefox_manifest.json | 7 +- src/background/firefox/background.ts | 13 + src/contentscript.ts | 11 + src/extend_mathquill.ts | 8861 +++++++++++++++++++++++++ src/preload_content.ts | 10 + src/preload_inject.ts | 8928 ++++++++++++++++++++++++++ webpack/webpack.common.js | 3 + 7 files changed, 17832 insertions(+), 1 deletion(-) create mode 100644 src/extend_mathquill.ts create mode 100644 src/preload_content.ts create mode 100644 src/preload_inject.ts diff --git a/public/firefox_manifest.json b/public/firefox_manifest.json index 818c565..232d8c9 100644 --- a/public/firefox_manifest.json +++ b/public/firefox_manifest.json @@ -2,7 +2,7 @@ "name": "Desmos Unlocked", "version": "1.0.3", "description": "Browser extension for better user control of the Desmos graphing calculator configuration", - "permissions": ["storage"], + "permissions": ["https://*.desmos.com/*", "storage", "webRequest", "webRequestBlocking"], "manifest_version": 2, "background": { "scripts": ["background.js"], @@ -13,6 +13,11 @@ "js": ["contentscript.js"], "matches": ["https://www.desmos.com/calculator*"], "run_at": "document_idle" + }, + { + "js": ["preload_content.js"], + "matches": ["https://www.desmos.com/calculator*"], + "run_at": "document_start" } ], "browser_action": { diff --git a/src/background/firefox/background.ts b/src/background/firefox/background.ts index 74692c0..b757252 100644 --- a/src/background/firefox/background.ts +++ b/src/background/firefox/background.ts @@ -8,3 +8,16 @@ browser.runtime.onInstalled.addListener(function () { 'keepmeKEEPME alpha beta sqrt theta Theta phi Phi pi Pi tau nthroot cbrt sum prod int ans percent infinity infty gamma Gamma delta Delta epsilon epsiv zeta eta kappa lambda Lambda mu xi Xi rho sigma Sigma chi Psi omega Omega digamma iota nu upsilon Upsilon Psi square mid parallel nparallel perp to times div approx', }); }); + +browser.webRequest.onBeforeRequest.addListener( + ({ url }) => ({ + cancel: url.endsWith('.js') || url.endsWith('.js?'), + }), + { + urls: [ + 'https://www.desmos.com/assets/build/calculator_desktop-*.js', + 'https://www.desmos.com/assets/build/calculator_desktop-*.js?', + ], + }, + ['blocking'] +); diff --git a/src/contentscript.ts b/src/contentscript.ts index f017e4a..9294494 100644 --- a/src/contentscript.ts +++ b/src/contentscript.ts @@ -14,3 +14,14 @@ async function updateAutoCommands() { updateAutoCommands(); browser.storage.onChanged.addListener(updateAutoCommands); + +//function extendMathquill() { + //const script = document.createElement('script'); + //script.src = browser.runtime.getURL('extend_mathquill.js'); + //script.onload = function() { + //script.remove(); + //}; + //(document.head || document.documentElement).appendChild(script); +//} + +//extendMathquill(); diff --git a/src/extend_mathquill.ts b/src/extend_mathquill.ts new file mode 100644 index 0000000..5102ae0 --- /dev/null +++ b/src/extend_mathquill.ts @@ -0,0 +1,8861 @@ +// // @ts-nocheck +// /* eslint-disable */ +// export default function extendMathQuill() { +// var __extends = +// (this && this.__extends) || +// (function () { +// var t = function (e, n) { +// return (t = +// Object.setPrototypeOf || +// ({ __proto__: [] } instanceof Array && +// function (t, e) { +// t.__proto__ = e; +// }) || +// function (t, e) { +// for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); +// })(e, n); +// }; +// return function (e, n) { +// if ('function' != typeof n && null !== n) +// throw new TypeError('Class extends value ' + String(n) + ' is not a constructor or null'); +// function r() { +// this.constructor = e; +// } +// t(e, n), (e.prototype = null === n ? Object.create(n) : ((r.prototype = n.prototype), new r())); +// }; +// })(), +// __assign = +// (this && this.__assign) || +// function () { +// return (__assign = +// Object.assign || +// function (t) { +// for (var e, n = 1, r = arguments.length; n < r; n++) +// for (var i in (e = arguments[n])) +// Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); +// return t; +// }).apply(this, arguments); +// }; +// (function () { +// var L = -1; +// var R = 1; +// var min = Math.min; +// var max = Math.max; +// function noop() {} +// /** +// * a development-only debug method. This definition and all +// * calls to `pray` will be stripped from the minified +// * build of mathquill. +// * +// * This function must be called by name to be removed +// * at compile time. Do not define another function +// * with the same name, and only call this function by +// * name. +// */ +// function pray(message, cond) { +// if (!cond) throw new Error('prayer failed: ' + message); +// } +// function prayDirection(dir) { +// pray('a direction was passed', dir === L || dir === R); +// } +// var urlParams = new URLSearchParams(window.location.search); +// function parseHTML(s) { +// // https://youmightnotneedjquery.com/#parse_html +// var tmp = document.implementation.createHTMLDocument(''); +// tmp.body.innerHTML = s; +// if (tmp.body.children.length === 1) return tmp.body.children[0]; +// var frag = document.createDocumentFragment(); +// while (tmp.body.firstChild) { +// frag.appendChild(tmp.body.firstChild); +// } +// return frag; +// } +// var h = function h(type, attributes, children) { +// var el; +// switch (type) { +// case 'svg': +// case 'path': +// el = document.createElementNS('http://www.w3.org/2000/svg', type); +// break; +// default: +// el = document.createElement(type); +// } +// for (var key_1 in attributes) { +// var value = attributes[key_1]; +// if (value === undefined) continue; +// el.setAttribute(key_1, typeof value === 'string' ? value : String(value)); +// } +// if (children) { +// for (var i = 0; i < children.length; i++) { +// el.appendChild(children[i]); +// } +// } +// return el; +// }; +// h.text = function (s) { +// return document.createTextNode(s); +// }; +// h.block = function (type, attributes, block) { +// var out = h(type, attributes, [block.html()]); +// block.setDOM(out); +// NodeBase.linkElementByBlockNode(out, block); +// return out; +// }; +// h.entityText = function (s) { +// // TODO: replace with h.text(U_BLAHBLAH) or maybe a named entity->unicode lookup +// var val = parseHTML(s); +// pray( +// 'entity parses to a single text node', +// val instanceof DocumentFragment && val.childNodes.length === 1 && val.childNodes[0] instanceof Text +// ); +// return val.childNodes[0]; +// }; +// function closest(el, s) { +// var _a, _b, _c; +// if (typeof ((_a = el) === null || _a === void 0 ? void 0 : _a.closest) === 'function') { +// return el.closest(s); +// } +// if (!(el instanceof HTMLElement)) return null; +// // https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#polyfill +// var matches = +// Element.prototype.matches || +// Element.prototype.msMatchesSelector || +// Element.prototype.webkitMatchesSelector; +// var match = el; +// do { +// if (matches.call(match, s)) return match; +// match = +// (_c = +// (_b = match === null || match === void 0 ? void 0 : match.parentElement) !== null && +// _b !== void 0 +// ? _b +// : match === null || match === void 0 +// ? void 0 +// : match.parentNode) !== null && _c !== void 0 +// ? _c +// : null; +// } while (match !== null && match.nodeType === 1); +// return null; +// } +// var U_NO_BREAK_SPACE = '\u00A0'; +// var U_ZERO_WIDTH_SPACE = '\u200B'; +// var U_DOT_ABOVE = '\u02D9'; +// var U_NARY_SUMMATION = '\u2211'; +// var U_NARY_PRODUCT = '\u220F'; +// var U_NARY_COPRODUCT = '\u2210'; +// var U_INTEGRAL = '\u222B'; +// /** +// * Like `el.getBoundingClientRect()` but avoids throwing for +// * disconnected and hidden elements in IE <= 11. +// * */ +// function getBoundingClientRect(el) { +// // Return zeros for disconnected and hidden (display: none) elements +// // Running getBoundingClientRect on a disconnected node in IE <=11 throws an error +// // https://github.com/jquery/jquery/blob/a684e6ba836f7c553968d7d026ed7941e1a612d8/src/offset.js#L83-L86 +// if (!el.getClientRects().length) { +// return { +// top: 0, +// left: 0, +// height: 0, +// width: 0, +// x: 0, +// y: 0, +// bottom: 0, +// right: 0, +// }; +// } +// return el.getBoundingClientRect(); +// } +// /** +// * Returns the number of pixels that the document is currently scrolled +// * horizontally -- `window.scrollX` in modern browsers. +// * */ +// function getScrollX() { +// // In IE9, scrollX was called pageXOffset +// // Previous versions of IE had neither property and use scrollLeft instead +// // +// // https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX#notes +// return window.pageXOffset !== undefined +// ? window.pageXOffset +// : (document.documentElement || document.body.parentNode || document.body).scrollLeft; +// } +// /** +// * Returns the number of pixels that the document is currently scrolled +// * vertically -- `window.scrollY` in modern browsers. +// * */ +// function getScrollY() { +// // In IE9, scrollY was called pageYOffset +// // Previous versions of IE had neither property and use scrollTop instead +// // +// // https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX#notes +// return window.pageYOffset !== undefined +// ? window.pageYOffset +// : (document.documentElement || document.body.parentNode || document.body).scrollTop; +// } +// /** +// * Given `duration` in ms and callback `cb`, immediately calls `cb(progress, scheduleNext, cancel)` with: +// * - `progress` set to `0` if duration > 0, or 1 if duration <= 0 +// * - `scheduleNext` a function that schedules a future call to `cb` +// * - `cancel` a function that cancels any pending `scheduleNext` call. +// * +// * `scheduleNext` schedules a call to `cb` with `progress` set to the +// * ratio of currently elapsed time and `duration`. +// * +// * To continue running the animation, `cb` should call `scheduleNext`. +// * +// * To stop the animation, it is the responsibility of `cb` to check +// * whether progress is greater than or equal to 1, in which case `cb` +// * should not call `scheduleNext`. +// * +// * `scheduleNext` uses `requestAnimationFrame` if available and falls +// * back to `setTimeout(..., 13)` otherwise. Times are always based on +// * `Date.now()` for compatibility between `requestAnimationFrame` and +// * the `setTimeout` fallback. `cb` will only be called with strictly +// * monotonic `progress` values. +// * +// * Note: `animate` purposely puts a lot of responsibility on the caller +// * to keep its implementation simple because it isn't used very widely +// * in the project. +// */ +// var animate = (function () { +// // IIFE exists just to hang on to configured rafShim and cancelShim +// // functions +// var rafShim, cancelShim; +// if (typeof requestAnimationFrame === 'function' && typeof cancelAnimationFrame === 'function') { +// rafShim = requestAnimationFrame; +// cancelShim = cancelAnimationFrame; +// } else { +// rafShim = function (cb) { +// return setTimeout(cb, 13); +// }; +// cancelShim = clearTimeout; +// } +// return function (duration, cb) { +// var start = Date.now(); +// var cancelToken; +// var progress = 0; +// function step() { +// var proposedProgress = (Date.now() - start) / duration; +// // Enforce that progress is strictly monotonic +// if (proposedProgress <= progress) { +// scheduleNext(); +// } else { +// progress = proposedProgress; +// } +// cb(progress, scheduleNext, cancel); +// } +// function cancel() { +// if (cancelToken !== undefined) cancelShim(cancelToken); +// cancelToken = undefined; +// } +// function scheduleNext() { +// // Calling cancel here ensures that there are never multiple +// // concurrent callbacks scheduled for a single animation, even if +// // the caller calls `scheduleNext` multiple times in a single +// // event loop (which is always a mistake) +// cancel(); +// cancelToken = rafShim(step); +// } +// cb(duration <= 0 ? 1 : 0, scheduleNext, cancel); +// }; +// })(); +// var Aria = /** @class */ (function () { +// function Aria(controller) { +// this.span = h('span', { +// class: 'dcg-mq-aria-alert', +// 'aria-live': 'assertive', +// 'aria-atomic': 'true', +// }); +// this.msg = ''; +// this.items = []; +// this.controller = controller; +// } +// Aria.prototype.attach = function () { +// var container = this.controller.container; +// if (this.span.parentNode !== container) { +// domFrag(container).prepend(domFrag(this.span)); +// } +// }; +// Aria.prototype.queue = function (item, shouldDescribe) { +// if (shouldDescribe === void 0) { +// shouldDescribe = false; +// } +// var output = ''; +// if (item instanceof MQNode) { +// // Some constructs include verbal shorthand (such as simple fractions and exponents). +// // Since ARIA alerts relate to moving through interactive content, we don't want to use that shorthand if it exists +// // since doing so may be ambiguous or confusing. +// var itemMathspeak = item.mathspeak({ ignoreShorthand: true }); +// if (shouldDescribe) { +// // used to ensure item is described when cursor reaches block boundaries +// if (item.parent && item.parent.ariaLabel && item.ariaLabel === 'block') { +// output = item.parent.ariaLabel + ' ' + itemMathspeak; +// } else if (item.ariaLabel) { +// output = item.ariaLabel + ' ' + itemMathspeak; +// } +// } +// if (output === '') { +// output = itemMathspeak; +// } +// } else { +// output = item || ''; +// } +// this.items.push(output); +// return this; +// }; +// Aria.prototype.queueDirOf = function (dir) { +// prayDirection(dir); +// return this.queue(dir === L ? 'before' : 'after'); +// }; +// Aria.prototype.queueDirEndOf = function (dir) { +// prayDirection(dir); +// return this.queue(dir === L ? 'beginning of' : 'end of'); +// }; +// Aria.prototype.alert = function (t) { +// this.attach(); +// if (t) this.queue(t); +// if (this.items.length) { +// // To cut down on potential verbiage from multiple Mathquills firing near-simultaneous ARIA alerts, +// // update the text of this instance if its container also has keyboard focus. +// // If it does not, leave the DOM unchanged but flush the queue regardless. +// // Note: updating the msg variable regardless of focus for unit tests. +// this.msg = this.items +// .join(' ') +// .replace(/ +(?= )/g, '') +// .trim(); +// if (this.controller.containerHasFocus()) { +// this.span.textContent = this.msg; +// } +// } +// return this.clear(); +// }; +// Aria.prototype.clear = function () { +// this.items.length = 0; +// return this; +// }; +// return Aria; +// })(); +// /** +// * A `DOMFragment` represents a contiguous span of sibling DOM Nodes, +// * which may include both Element nodes and other nodes like Text and +// * Comment nodes. A `DOMFragment` may represent zero or more nodes. +// * +// * `DOMFragments` are created using the `DOMFragment.create` factory +// * function, which is also aliased as `domFrag` for convenience. +// * +// * A `DOMFragment` simply holds references to nodes. It doesn't move or +// * mutate them in the way that the native `DocumentFragment` does. +// * +// * `DOMFragment` implements many of the same methods for manipulating a +// * collection of DOM elements that jQuery does, but it has some notable +// * differences: +// * +// * 1. A jQuery collection can hold an arbitrary ordered set of DOM +// * elements, but a `DOMFragment` can only hold a contiguous span of +// * sibling nodes. +// * 2. Some jQuery DOM manipulation methods like `insert{Before,After}`, +// * `append`, `prepend`, `appendTo`, `prependTo`, etc. may insert +// * several clones of a collection into different places in the DOM. +// * `DOMFragment` never makes clones of DOM nodes--instead, when +// * targeting multi-element fragments, it moves source nodes before +// * or after the targeted fragment as appropriate without ever making +// * more copies. +// * 3. For methods like `.children()`, where it's likely to be a mistake +// * to call the method on a fragment that doesn't contain exactly one +// * node or element, `DOMFragment` will throw whereas jQuery will +// * silently do something possibly unintended. Methods that assert +// * are commented with the properties that they assert. +// * +// * Internally, `DOMFragment` holds immutable references to the left and +// * right end nodes (if the fragment is not empty). The other nodes are +// * represented implicitly through the sibling pointers of the DOM nodes +// * themselves. This means that it is possible to invalidate a +// * `DOMFragment` by moving one of its ends without moving the other in +// * such a way that they are no longer siblings. It is also possible to +// * change the contents of a `DOMFragment` by adding or removing DOM +// * nodes between its ends. +// */ +// var DOMFragment = /** @class */ (function () { +// /** +// * Constructor is private to enforce that the invariant checks in +// * `create` are applied to outside callers. Internal methods are +// * allowed to use this constructor when they can guarantee they're +// * passing sibling nodes (such as children of a parent node). +// */ +// function DOMFragment(first, last) { +// var _a; +// if (arguments.length === 1) last = first; +// if (!first || !last) return; +// this.ends = ((_a = {}), (_a[L] = first), (_a[R] = last), _a); +// } +// /** +// * Returns a `DOMFragment` representing the contiguous span of sibling +// * DOM nodes betewen `first` and `last`. If only one element is +// * passed, creates a `DOMFragment` representing that single element. +// * If no elements are passed, creates and empty `DOMFragment`. +// * +// * If two elements are passed, asserts that the second element is a +// * forward sibling of the first element. Checking this invariant is +// * O(n) in the total number of nodes in the fragment +// */ +// DOMFragment.create = function (first, last) { +// if (arguments.length === 1) last = first; +// pray('No half-empty DOMFragments', !!first === !!last); +// var out = new DOMFragment(first, last); +// pray('last is a forward sibling of first', out.isValid()); +// return out; +// }; +// DOMFragment.prototype.isEmpty = function () { +// return this.ends === undefined; +// }; +// DOMFragment.prototype.isOneNode = function () { +// return !!(this.ends && this.ends[L] === this.ends[R]); +// }; +// /** +// * Returns true if the fragment is empty or if its last node is equal +// * to its first node or is a forward sibling of its first node. +// * +// * DOMFragments may be invalidated if any of the nodes they contain +// * are moved or removed independently of the other nodes they contain. +// * +// * Note that this check visits each node in the fragment, so it is +// * O(n). +// */ +// DOMFragment.prototype.isValid = function () { +// if (!this.ends) return true; +// if (this.ends[L] === this.ends[R]) return true; +// var maybeLast; +// this.eachNode(function (el) { +// return (maybeLast = el); +// }); +// return maybeLast === this.ends[R]; +// }; +// /** +// * Return the first Node of this fragment. May be a a Node that is not +// * an Element such as a Text or Comment node. +// * +// * Asserts fragment is not empty. +// */ +// DOMFragment.prototype.firstNode = function () { +// pray('Fragment is not empty', this.ends); +// return this.ends[L]; +// }; +// /** +// * Return the last Node of this fragment. May be a a Node that is not +// * an Element such as a Text or Comment node. +// * +// * Asserts fragment is not empty. +// */ +// DOMFragment.prototype.lastNode = function () { +// pray('Fragment is not empty', this.ends); +// return this.ends[R]; +// }; +// /** +// * Return a fragment representing the children (including Text and +// * Comment nodes) of the node represented by this fragment. +// * +// * Asserts that this fragment contains exactly one Node. +// * +// * Note, because this includes text and comment nodes, this is more +// * like jQuery's .contents() than jQuery's .children() +// */ +// DOMFragment.prototype.children = function () { +// var el = this.oneNode(); +// var first = el.firstChild; +// var last = el.lastChild; +// return first && last ? new DOMFragment(first, last) : new DOMFragment(); +// }; +// /** +// * Return a new `DOMFragment` spanning this fragment and `sibling` +// * fragment. Does not perform any DOM operations. +// * +// * Asserts that `sibling` is either empty or a forward sibling of +// * this fragment that may share its first node with the last node of +// * this fragment +// */ +// DOMFragment.prototype.join = function (sibling) { +// if (!this.ends) return sibling; +// if (!sibling.ends) return this; +// // Check if sibling is actually a sibling of this span +// var found = false; +// var current = this.ends[R].nextSibling; +// while (current) { +// if (current === sibling.ends[L]) { +// found = true; +// break; +// } +// current = current.nextSibling; +// } +// pray('sibling must be a forward DOM sibling of this fragment', found); +// return new DOMFragment(this.ends[L], sibling.ends[R]); +// }; +// /** +// * Return the single DOM Node represented by this fragment. +// * +// * Asserts that this fragment contains exactly one Node. +// */ +// DOMFragment.prototype.oneNode = function () { +// pray('Fragment has a single node', this.ends && this.ends[L] === this.ends[R]); +// return this.ends[L]; +// }; +// /** +// * Return the single DOM Element represented by this fragment. +// * +// * Asserts that this fragment contains exactly one Node, and that node +// * is an Element node. +// */ +// DOMFragment.prototype.oneElement = function () { +// var el = this.oneNode(); +// pray('Node is an Element', el.nodeType === Node.ELEMENT_NODE); +// return el; +// }; +// /** +// * Return the single DOM Text node represented by this fragment. +// * +// * Asserts that this fragment contains exactly one Node, and that node +// * is a Text node. +// */ +// DOMFragment.prototype.oneText = function () { +// var el = this.oneNode(); +// pray('Node is Text', el.nodeType === Node.TEXT_NODE); +// return el; +// }; +// /** +// * Calls callback sequentially with each node in this fragment. +// * Includes nodes that are not Elements, such as Text and Comment +// * nodes. +// */ +// DOMFragment.prototype.eachNode = function (cb) { +// if (!this.ends) return this; +// var stop = this.ends[R]; +// for (var node = this.ends[L], next = void 0; node; node = next) { +// // Note, this loop is organized in a slightly tricky way in order +// // cache "next" before calling the callback. This is done because +// // the callback could mutate node.nextSibling (e.g. by moving the +// // node to a documentFragment, like toDocumentFragment does). +// // +// // It's still possible to break this iteration by messing with +// // forward siblings of node in the callback, although it's +// // probably rare to want to do that. Perhaps this means "each" is +// // too dangerous to have as a public method. +// next = node.nextSibling; +// cb(node); +// if (node === stop) break; +// } +// return this; +// }; +// /** +// * Calls callback sequentially with each Element node in this +// * fragment. Skips nodes that are not Elements, such as Text and +// * Comment nodes. +// */ +// DOMFragment.prototype.eachElement = function (cb) { +// this.eachNode(function (el) { +// if (el.nodeType === Node.ELEMENT_NODE) cb(el); +// }); +// return this; +// }; +// /** +// * Returns the concatenated text content of all of the nodes in the +// * fragment. +// */ +// DOMFragment.prototype.text = function () { +// var accum = ''; +// this.eachNode(function (node) { +// accum += node.textContent || ''; +// }); +// return accum; +// }; +// /** +// * Returns an array of all the Nodes in this fragment, including nodes +// * that are not Element nodes such as Text and Comment nodes; +// */ +// DOMFragment.prototype.toNodeArray = function () { +// var accum = []; +// this.eachNode(function (el) { +// return accum.push(el); +// }); +// return accum; +// }; +// /** +// * Returns an array of all the Element nodes in this fragment. The +// * result does not include nodes that are not Elements, such as Text +// * and Comment nodes. +// */ +// DOMFragment.prototype.toElementArray = function () { +// var accum = []; +// this.eachElement(function (el) { +// return accum.push(el); +// }); +// return accum; +// }; +// /** +// * Moves all of the nodes in this fragment into a new DocumentFragment +// * and returns it. This includes Nodes that are not Elements such as +// * Text and Comment nodes. +// */ +// DOMFragment.prototype.toDocumentFragment = function () { +// var frag = document.createDocumentFragment(); +// this.eachNode(function (el) { +// return frag.appendChild(el); +// }); +// return frag; +// }; +// /** +// * Insert all the nodes in this fragment into the DOM directly before +// * the first node of `sibling` fragment. If `sibling` is empty or does +// * not have a parent node, detaches this fragment from the document. +// * +// * Note that this behavior differs from jQuery if `sibling` is a +// * collection with multiple nodes. In that case, jQuery inserts this +// * collection before the first node in `sibling`, and then inserts a +// * clone of this collection before each additional node in the +// * `sibling` collection. DOMFragment only ever inserts this collection +// * before the first node of the sibling fragment, and never inserts +// * additional clones. +// */ +// DOMFragment.prototype.insertBefore = function (sibling) { +// return this.insDirOf(L, sibling); +// }; +// /** +// * Insert all the nodes in this fragment into the DOM directly after +// * the last node of `sibling` fragment. If `sibling` is empty or does +// * not have a parent node, detaches this fragment from the document. +// * +// * Note that this behavior differs from jQuery if `sibling` is a +// * collection with multiple nodes. In that case, jQuery inserts this +// * collection before the first node in `sibling`, and then inserts a +// * clone of this collection before each additional node in the +// * `sibling` collection. DOMFragment only ever inserts this collection +// * before the first node of the sibling fragment, and never inserts +// * additional clones. +// */ +// DOMFragment.prototype.insertAfter = function (sibling) { +// return this.insDirOf(R, sibling); +// }; +// /** +// * Append children to the node represented by this fragment. +// * +// * Asserts that this fragment contains exactly one Element. +// */ +// DOMFragment.prototype.append = function (children) { +// children.appendTo(this.oneElement()); +// return this; +// }; +// /** +// * Prepend children to the node represented by this fragment. +// * +// * Asserts that this fragment contains exactly one Element. +// */ +// DOMFragment.prototype.prepend = function (children) { +// children.prependTo(this.oneElement()); +// return this; +// }; +// /** +// * Append all the nodes in this fragment to the children of `el`. +// */ +// DOMFragment.prototype.appendTo = function (el) { +// return this.insAtDirEnd(R, el); +// }; +// /** +// * Prepend all the nodes in this fragment to the children of `el`. +// */ +// DOMFragment.prototype.prependTo = function (el) { +// return this.insAtDirEnd(L, el); +// }; +// /** +// * Return a fragment containing the parent node of the nodes in this +// * fragment. Returns an empty fragment if this fragment is empty or +// * does not have a parent node. +// */ +// DOMFragment.prototype.parent = function () { +// if (!this.ends) return this; +// var parent = this.ends[L].parentNode; +// if (!parent) return new DOMFragment(); +// return new DOMFragment(parent); +// }; +// /** +// * Replace the children of `el` with the contents of this fragment, +// * and place `el` into the DOM at the previous location of this +// * fragment. +// */ +// DOMFragment.prototype.wrapAll = function (el) { +// el.textContent = ''; // First empty the wrapping element +// if (!this.ends) return this; +// var parent = this.ends[L].parentNode; +// var next = this.ends[R].nextSibling; +// this.appendTo(el); +// if (parent) { +// parent.insertBefore(el, next); +// } +// return this; +// }; +// /** +// * Replace this fragment with the fragment given by `children`. If +// * this fragment is empty or does not have a parent node, detaches +// * `children` from the document. +// * +// * Note that this behavior differs from jQuery if this is a collection +// * with multiple nodes. In that case, jQuery replaces the first +// * element of this collection with `children`, and then replaces each +// * additional element in this collection with a clone of `children`. +// * DOMFragment replaces this entire fragment with `children` and never +// * makes additional clones of `children`. +// */ +// DOMFragment.prototype.replaceWith = function (children) { +// var _a; +// var rightEnd = (_a = this.ends) === null || _a === void 0 ? void 0 : _a[R]; +// // Note: important to cache parent and nextSibling (if they exist) +// // before detaching this fragment from the document (which will +// // mutate its parent and sibling references) +// var parent = rightEnd === null || rightEnd === void 0 ? void 0 : rightEnd.parentNode; +// var nextSibling = rightEnd === null || rightEnd === void 0 ? void 0 : rightEnd.nextSibling; +// this.detach(); +// // Note, this purposely detaches children from the document, even if +// // they can't be reinserted because this fragment is empty or has no +// // parent +// var childDocumentFragment = children.toDocumentFragment(); +// if (!rightEnd || !parent) return this; +// parent.insertBefore(childDocumentFragment, nextSibling || null); +// return this; +// }; +// /** +// * Return the nth Element node of this collection, or undefined if +// * there is no nth Element. Skips Nodes that are not Elements (e.g. +// * Text and Comment nodes). +// * +// * Analogous to jQuery's array indexing syntax, or jQuery's .get() +// * with positive arguments. +// */ +// DOMFragment.prototype.nthElement = function (n) { +// if (!this.ends) return undefined; +// if (n < 0 || n !== Math.floor(n)) return undefined; +// var current = this.ends[L]; +// while (current) { +// // Only count element nodes +// if (current.nodeType === Node.ELEMENT_NODE) { +// if (n <= 0) return current; +// n -= 1; +// } +// if (current === this.ends[R]) return undefined; +// current = current.nextSibling; +// } +// return undefined; +// }; +// /** +// * Return the first Element node of this fragment, or undefined if +// * the fragment is empty. Skips Nodes that are not Elements (e.g. +// * Text and Comment nodes). +// */ +// DOMFragment.prototype.firstElement = function () { +// return this.nthElement(0); +// }; +// /** +// * Return the first Element node of this fragment, or undefined if +// * the fragment is empty. Skips Nodes that are not Elements (e.g. +// * Text and Comment nodes). +// */ +// DOMFragment.prototype.lastElement = function () { +// if (!this.ends) return undefined; +// var current = this.ends[R]; +// while (current) { +// // Only count element nodes +// if (current.nodeType === Node.ELEMENT_NODE) { +// return current; +// } +// if (current === this.ends[L]) return undefined; +// current = current.previousSibling; +// } +// return undefined; +// }; +// /** +// * Return a new fragment holding the first Element node of this +// * fragment, or an empty fragment if this fragment is empty. Skips +// * Nodes that are not Elements (e.g. Text and Comment nodes). +// */ +// DOMFragment.prototype.first = function () { +// return new DOMFragment(this.firstElement()); +// }; +// /** +// * Return a new fragment holding the last Element node of this +// * fragment, or an empty fragment if this fragment is empty. Skips +// * Nodes that are not Elements (e.g. Text and Comment nodes). +// */ +// DOMFragment.prototype.last = function () { +// return new DOMFragment(this.lastElement()); +// }; +// /** +// * Return a new fragment holding the nth Element node of this +// * fragment, or an empty fragment if there is no nth node of this +// * fragment. Skips Nodes that are not Elements (e.g. Text and Comment +// * nodes). +// */ +// DOMFragment.prototype.eq = function (n) { +// return new DOMFragment(this.nthElement(n)); +// }; +// /** +// * Return a new fragment beginning with the nth Element node of this +// * fragment, and ending with the same end as this fragment, or an +// * empty fragment if there is no nth node in this fragment. Skips +// * Nodes that are not Elements (e.g. Text and Comment nodes). +// */ +// DOMFragment.prototype.slice = function (n) { +// // Note, would be reasonable to extend this to take a second +// // argument if we ever find we need this +// if (!this.ends) return this; +// var el = this.nthElement(n); +// if (!el) return new DOMFragment(); +// return new DOMFragment(el, this.ends[R]); +// }; +// /** +// * Return a new fragment containing the next Element after the Node +// * represented by this fragment, or an empty fragment if there is no +// * next Element. Skips Nodes that are not Elements (e.g. Text and +// * Comment nodes). +// * +// * Asserts that this fragment contains exactly one Node. +// */ +// DOMFragment.prototype.next = function () { +// var current = this.oneNode(); +// while (current) { +// current = current.nextSibling; +// if (current && current.nodeType === Node.ELEMENT_NODE) return new DOMFragment(current); +// } +// return new DOMFragment(); +// }; +// /** +// * Return a new fragment containing the previousElement after the Node +// * represented by this fragment, or an empty fragment if there is no +// * previous Element. Skips Nodes that are not Elements (e.g. Text and +// * Comment nodes). +// * +// * Asserts that this fragment contains exactly one Node. +// */ +// DOMFragment.prototype.prev = function () { +// var current = this.oneNode(); +// while (current) { +// current = current.previousSibling; +// if (current && current.nodeType === Node.ELEMENT_NODE) return new DOMFragment(current); +// } +// return new DOMFragment(); +// }; +// /** +// * Remove all children of every Element Node in the fragment. Skips +// * Nodes that are not Elements (e.g. Text and Comment nodes). +// */ +// DOMFragment.prototype.empty = function () { +// // TODO the corresponding jQuery methods clean up some internal +// // references before removing elements from the DOM. That won't +// // matter once jQuery is totally gone, but until then, this may +// // introduce memory leaks +// this.eachElement(function (el) { +// el.textContent = ''; +// }); +// return this; +// }; +// /** +// * Remove every node in the fragment from the DOM. +// * +// * Implemented by moving every node in the fragment into a new +// * document fragment in order to preserve the sibling relationships +// * of the removed element. If you want to get access to this document +// * fragment, use `.toDocumentFragment()` instead. +// */ +// DOMFragment.prototype.remove = function () { +// // TODO the corresponding jQuery methods clean up some internal +// // references before removing elements from the DOM. That won't +// // matter once jQuery is totally gone, but until then, this may +// // introduce memory leaks +// // Note, removing the elements by moving them to a document fragment +// // because this way their sibling references stay intact. This is +// // important if we want to reattach them somewhere else later +// this.toDocumentFragment(); +// return this; +// }; +// /** +// * Remove every node in the fragment from the DOM. Alias of remove. +// * +// * Implemented by moving every node in the fragment into a new +// * document fragment in order to preserve the sibling relationships +// * of the removed element. If you want to get access to this document +// * fragment, use `.toDocumentFragment()` instead. +// * +// * Note: jQuery makes a distinction between detach() and remove(). +// * remove() cleans up internal references, and detach() does not. +// */ +// DOMFragment.prototype.detach = function () { +// // In jQuery, detach() is similar to remove() but it does not clean +// // up internal references. Here they're aliases, but I'm leaving +// // this as a separate method for the moment to keep track of where +// // mathquill did one vs the other. +// return this.remove(); +// }; +// /** +// * Insert this fragment either just before or just after `sibling` +// * fragment according to the direction specified by `dir`. If +// * `sibling` is empty or does not have a parent node, detaches this +// * fragment from the document. +// */ +// DOMFragment.prototype.insDirOf = function (dir, sibling) { +// var _a; +// if (!this.ends) return this; +// var el = (_a = sibling.ends) === null || _a === void 0 ? void 0 : _a[dir]; +// if (!el || !el.parentNode) return this.detach(); +// _insDirOf(dir, el.parentNode, this.toDocumentFragment(), el); +// return this; +// }; +// /** +// * Insert this fragment into `el` either at the beginning or end of +// * its children, according to the direction specified by `dir`. +// */ +// DOMFragment.prototype.insAtDirEnd = function (dir, el) { +// if (!this.ends) return this; +// _insAtDirEnd(dir, this.toDocumentFragment(), el); +// return this; +// }; +// /** +// * Return true if any element in this fragment has class `className` +// * and false otherwise. +// */ +// DOMFragment.prototype.hasClass = function (className) { +// var out = false; +// this.eachElement(function (el) { +// if (el.classList.contains(className)) out = true; +// }); +// return out; +// }; +// /** +// * Add each class in space separated list of classes given by +// * `classNames` to each element in this fragment. +// */ +// DOMFragment.prototype.addClass = function (classNames) { +// var _loop_1 = function (className) { +// if (!className) return 'continue'; +// this_1.eachElement(function (el) { +// el.classList.add(className); +// }); +// }; +// var this_1 = this; +// for (var _i = 0, _a = classNames.split(/\s+/); _i < _a.length; _i++) { +// var className = _a[_i]; +// _loop_1(className); +// } +// return this; +// }; +// /** +// * Remove each class in space separated list of classes given by +// * `classNames` from each element in this fragment. +// */ +// DOMFragment.prototype.removeClass = function (classNames) { +// var _loop_2 = function (className) { +// if (!className) return 'continue'; +// this_2.eachElement(function (el) { +// el.classList.remove(className); +// }); +// }; +// var this_2 = this; +// for (var _i = 0, _a = classNames.split(/\s+/); _i < _a.length; _i++) { +// var className = _a[_i]; +// _loop_2(className); +// } +// return this; +// }; +// /** +// * Toggle each class in space separated list of classes given by +// * `classNames` on each element in this fragment. +// * +// * If second arg `on` is given as `true`, always toggle classes on. +// * If second arg `on` is passed as `false`, always toggle classes off. +// */ +// DOMFragment.prototype.toggleClass = function (classNames, on) { +// if (on === true) return this.addClass(classNames); +// if (on === false) return this.removeClass(classNames); +// var _loop_3 = function (className) { +// if (!className) return 'continue'; +// this_3.eachElement(function (el) { +// el.classList.toggle(className); +// }); +// }; +// var this_3 = this; +// for (var _i = 0, _a = classNames.split(/\s+/); _i < _a.length; _i++) { +// var className = _a[_i]; +// _loop_3(className); +// } +// return this; +// }; +// return DOMFragment; +// })(); +// var domFrag = DOMFragment.create; +// /** +// * Insert `source` before or after `target` child of `parent` denending +// * on `dir`. Only intended to be used internally as a helper in this module +// */ +// function _insDirOf(dir, parent, source, target) { +// parent.insertBefore(source, dir === L ? target : target.nextSibling); +// } +// /** +// * Insert `source` before or after `target` child of `parent` denending +// * on `dir`. Only intended to be used internally as a helper in this module +// */ +// function _insAtDirEnd(dir, source, parent) { +// if (dir === L) { +// parent.insertBefore(source, parent.firstChild); +// } else { +// parent.appendChild(source); +// } +// } +// /************************************************* +// * Base classes of edit tree-related objects +// * +// * Only doing tree node manipulation via these +// * adopt/ disown methods guarantees well-formedness +// * of the tree. +// ************************************************/ +// /** A cursor-like location in an mq node tree. */ +// var Point = /** @class */ (function () { +// function Point(parent, leftward, rightward) { +// this.init(parent, leftward, rightward); +// } +// // keeping init around only for tests +// Point.prototype.init = function (parent, leftward, rightward) { +// this.parent = parent; +// this[L] = leftward; +// this[R] = rightward; +// }; +// Point.copy = function (pt) { +// return new Point(pt.parent, pt[L], pt[R]); +// }; +// return Point; +// })(); +// function eachNode(ends, yield_) { +// var el = ends[L]; +// if (!el) return; +// var stop = ends[R]; +// if (!stop) return; //shouldn't happen because ends[L] is defined; +// stop = stop[R]; +// // TODO - this cast as MQNode is actually important to keep tests passing. I went to +// // fix this code to gracefully handle an undefined el and there are tests that actually +// // verify that this will throw an error. So I'm keeping the behavior but ignoring the +// // type error. +// for (; el !== stop; el = el[R]) { +// var result = yield_(el); // TODO - might be passing in 0 intead of a MQNode, but tests want this +// if (result === false) break; +// } +// } +// function foldNodes(ends, fold, yield_) { +// var el = ends[L]; +// if (!el) return fold; +// var stop = ends[R]; +// if (!stop) return fold; //shouldn't happen because ends[L] is defined; +// stop = stop[R]; +// // TODO - this cast as MQNode is actually important to keep tests passing. I went to +// // fix this code to gracefully handle an undefined el and there are tests that actually +// // verify that this will throw an error. So I'm keeping the behavior but ignoring the +// // type error. +// for (; el !== stop; el = el[R]) { +// fold = yield_(fold, el); // TODO - might be passing in 0 intead of a MQNode, but tests want this +// } +// return fold; +// } +// var NodeBase = /** @class */ (function () { +// function NodeBase() { +// var _c; +// // TODO - life would be so much better in typescript of these were undefined instead of +// // 0. The ! would save us in cases where we know a node is defined. +// this[_a] = 0; +// this[_b] = 0; +// // TODO - can this ever actually stay 0? if so we need to add null checks +// this.parent = 0; +// /** +// * The (doubly-linked) list of this node's children. +// * +// * NOTE child classes may specify a narrower type for ends e.g. to +// * enforce that children are not empty, or that they have a certain +// * type. In those cases, this initializer may still run at +// * construction time, but this is expected to be followed by a call +// * to adopt that sets non-empty ends of the necessary types. +// * +// * Similarly, `Fragment::disown` may temporarily break non-empty +// * invariants, which are expected to be restored by a subsequent call +// * to `Fragment::adopt`. +// * */ +// this.ends = ((_c = {}), (_c[L] = 0), (_c[R] = 0), _c); +// this.id = NodeBase.uniqueNodeId(); +// } +// NodeBase.uniqueNodeId = function () { +// return (NodeBase.idCounter += 1); +// }; +// // The mqBlockNode and mqCmdNode custom properties link back from the +// // DOM nodes generated by MathQuill to the MQNodes that generated +// // them. This is useful for looking up MQNodes in event handlers and +// // in the mq(elt) public API method +// NodeBase.getNodeOfElement = function (el) { +// if (!el) return; +// if (!el.nodeType) throw new Error('must pass an Element to NodeBase.getNodeOfElement'); +// var elTrackingNode = el; +// return elTrackingNode.mqBlockNode || elTrackingNode.mqCmdNode; +// }; +// NodeBase.linkElementByBlockNode = function (elm, blockNode) { +// elm.mqBlockNode = blockNode; +// }; +// NodeBase.linkElementByCmdNode = function (elm, cmdNode) { +// elm.mqCmdNode = cmdNode; +// }; +// NodeBase.prototype.setEnds = function (ends) { +// this.ends = ends; +// pray('No half-empty node ends', !!this.ends[L] === !!this.ends[R]); +// }; +// NodeBase.prototype.getEnd = function (dir) { +// return this.ends[dir]; +// }; +// NodeBase.prototype.toString = function () { +// return '{{ MathQuill Node #' + this.id + ' }}'; +// }; +// NodeBase.prototype.setDOM = function (el) { +// if (el) { +// pray( +// 'DOM is an element or a text node', +// el.nodeType === Node.ELEMENT_NODE || el.nodeType === Node.TEXT_NODE +// ); +// } +// this._el = el; +// return this; +// }; +// NodeBase.prototype.domFrag = function () { +// return domFrag(this._el); +// }; +// NodeBase.prototype.createDir = function (dir, cursor) { +// prayDirection(dir); +// var node = this; +// node.html(); +// node.domFrag().insDirOf(dir, cursor.domFrag()); +// cursor[dir] = node.adopt(cursor.parent, cursor[L], cursor[R]); // TODO - assuming not undefined, could be 0 +// return node; +// }; +// NodeBase.prototype.createLeftOf = function (cursor) { +// this.createDir(L, cursor); +// }; +// NodeBase.prototype.selectChildren = function (leftEnd, rightEnd) { +// return new MQSelection(leftEnd, rightEnd); +// }; +// NodeBase.prototype.bubble = function (yield_) { +// var self = this.getSelfNode(); +// for (var ancestor = self; ancestor; ancestor = ancestor.parent) { +// var result = yield_(ancestor); +// if (result === false) break; +// } +// return this; +// }; +// NodeBase.prototype.postOrder = function (yield_) { +// var self = this.getSelfNode(); +// (function recurse(descendant) { +// if (!descendant) return false; +// descendant.eachChild(recurse); +// yield_(descendant); +// return true; +// })(self); +// return self; +// }; +// NodeBase.prototype.isEmpty = function () { +// return this.ends[L] === 0 && this.ends[R] === 0; +// }; +// NodeBase.prototype.isQuietEmptyDelimiter = function (dlms) { +// if (!this.isEmpty()) return false; +// if (!dlms) return false; +// if (!this.parent || this.parent.ctrlSeq === undefined) return false; +// // Remove any leading \left or \right from the ctrl sequence before looking it up. +// var key = this.parent.ctrlSeq.replace(/^\\(left|right)?/, ''); +// return dlms.hasOwnProperty(key); +// }; +// NodeBase.prototype.isStyleBlock = function () { +// return false; +// }; +// NodeBase.prototype.isTextBlock = function () { +// return false; +// }; +// NodeBase.prototype.children = function () { +// return new Fragment(this.getEnd(L), this.getEnd(R)); +// }; +// NodeBase.prototype.eachChild = function (yield_) { +// eachNode(this.ends, yield_); +// return this; +// }; +// NodeBase.prototype.foldChildren = function (fold, yield_) { +// return foldNodes(this.ends, fold, yield_); +// }; +// NodeBase.prototype.withDirAdopt = function (dir, parent, withDir, oppDir) { +// var self = this.getSelfNode(); +// new Fragment(self, self).withDirAdopt(dir, parent, withDir, oppDir); +// return this; +// }; +// /** +// * Add this node to the given parent node's children, at the position between the adjacent +// * children `leftward` (or the beginning if omitted) and `rightward` (or the end if omitted). +// * See `Fragment#adopt()` +// */ +// NodeBase.prototype.adopt = function (parent, leftward, rightward) { +// var self = this.getSelfNode(); +// new Fragment(self, self).adopt(parent, leftward, rightward); +// return this.getSelfNode(); +// }; +// NodeBase.prototype.disown = function () { +// var self = this.getSelfNode(); +// new Fragment(self, self).disown(); +// return this; +// }; +// NodeBase.prototype.remove = function () { +// this.domFrag().remove(); +// return this.disown(); +// }; +// NodeBase.prototype.shouldIgnoreSubstitutionInSimpleSubscript = function (options) { +// if (!options.disableAutoSubstitutionInSubscripts) return false; +// if (!this.parent) return false; +// if (!(this.parent.parent instanceof SupSub)) return false; +// // Mathquill is gross. There are many different paths that +// // create subscripts and sometimes we don't even construct +// // true instances of `LatexCmds._`. Another problem is that +// // the relationship between the sub and the SupSub isn't +// // completely setup during a paste at the time we check +// // this. I wanted to use: `this.parent.parent.sub !== this.parent` +// // but that check doesn't always work. This seems to be the only +// // check that always works. I'd rather live with this than try +// // to change the init order of things. +// if (!this.parent.domFrag().hasClass('dcg-mq-sub')) return false; +// return true; +// }; +// NodeBase.prototype.getSelfNode = function () { +// // dumb dance to tell typescript that we eventually become a MQNode +// return this; +// }; +// // Overridden by child classes +// NodeBase.prototype.parser = function () { +// pray('Abstract parser() method is never called', false); +// }; +// /** Render this node to DOM */ +// NodeBase.prototype.html = function () { +// throw new Error('html() unimplemented in NodeBase'); +// }; +// NodeBase.prototype.text = function () { +// return ''; +// }; +// NodeBase.prototype.latex = function () { +// var ctx = { latex: '', startIndex: -1, endIndex: -1 }; +// this.latexRecursive(ctx); +// return ctx.latex; +// }; +// NodeBase.prototype.latexRecursive = function (_ctx) {}; +// NodeBase.prototype.checkCursorContextOpen = function (ctx) { +// if (ctx.startSelectionBefore === this) { +// ctx.startIndex = ctx.latex.length; +// } +// if (ctx.endSelectionBefore === this) { +// ctx.endIndex = ctx.latex.length; +// } +// }; +// NodeBase.prototype.checkCursorContextClose = function (ctx) { +// if (ctx.startSelectionAfter === this) { +// ctx.startIndex = ctx.latex.length; +// } +// if (ctx.endSelectionAfter === this) { +// ctx.endIndex = ctx.latex.length; +// } +// }; +// NodeBase.prototype.finalizeTree = function (_options, _dir) {}; +// NodeBase.prototype.contactWeld = function (_cursor, _dir) {}; +// NodeBase.prototype.blur = function (_cursor) {}; +// NodeBase.prototype.focus = function () {}; +// NodeBase.prototype.intentionalBlur = function () {}; +// NodeBase.prototype.reflow = function () {}; +// NodeBase.prototype.registerInnerField = function (_innerFields, _mathField) {}; +// NodeBase.prototype.chToCmd = function (_ch, _options) { +// pray('Abstract chToCmd() method is never called', false); +// }; +// NodeBase.prototype.mathspeak = function (_options) { +// return ''; +// }; +// NodeBase.prototype.seek = function (_clientX, _cursor) {}; +// NodeBase.prototype.siblingDeleted = function (_options, _dir) {}; +// NodeBase.prototype.siblingCreated = function (_options, _dir) {}; +// NodeBase.prototype.finalizeInsert = function (_options, _cursor) {}; +// NodeBase.prototype.fixDigitGrouping = function (_opts) {}; +// NodeBase.prototype.writeLatex = function (_cursor, _latex) {}; +// NodeBase.prototype.write = function (_cursor, _ch) {}; +// var _a, _b; +// (_a = L), (_b = R); +// NodeBase.idCounter = 0; +// return NodeBase; +// })(); +// function prayWellFormed(parent, leftward, rightward) { +// pray('a parent is always present', parent); +// pray( +// 'leftward is properly set up', +// (function () { +// // either it's empty and `rightward` is the left end child (possibly empty) +// if (!leftward) return parent.getEnd(L) === rightward; +// // or it's there and its [R] and .parent are properly set up +// return leftward[R] === rightward && leftward.parent === parent; +// })() +// ); +// pray( +// 'rightward is properly set up', +// (function () { +// // either it's empty and `leftward` is the right end child (possibly empty) +// if (!rightward) return parent.getEnd(R) === leftward; +// // or it's there and its [L] and .parent are properly set up +// return rightward[L] === leftward && rightward.parent === parent; +// })() +// ); +// } +// /** +// * An entity outside the virtual tree with one-way pointers (so it's only a +// * "view" of part of the tree, not an actual node/entity in the tree) that +// * delimits a doubly-linked list of sibling nodes. +// * It's like a fanfic love-child between HTML DOM DocumentFragment and the Range +// * classes: like DocumentFragment, its contents must be sibling nodes +// * (unlike Range, whose contents are arbitrary contiguous pieces of subtrees), +// * but like Range, it has only one-way pointers to its contents, its contents +// * have no reference to it and in fact may still be in the visible tree (unlike +// * DocumentFragment, whose contents must be detached from the visible tree +// * and have their 'parent' pointers set to the DocumentFragment). +// */ +// var Fragment = /** @class */ (function () { +// function Fragment(withDir, oppDir, dir) { +// var _c, _d; +// this.disowned = false; +// if (dir === undefined) dir = L; +// prayDirection(dir); +// pray('no half-empty fragments', !withDir === !oppDir); +// if (!withDir || !oppDir) { +// this.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); +// return; +// } +// pray('withDir is passed to Fragment', withDir instanceof MQNode); +// pray('oppDir is passed to Fragment', oppDir instanceof MQNode); +// pray('withDir and oppDir have the same parent', withDir.parent === oppDir.parent); +// var ends = ((_d = {}), (_d[dir] = withDir), (_d[-dir] = oppDir), _d); +// this.setEnds(ends); +// var maybeRightEnd = 0; +// this.each(function (el) { +// maybeRightEnd = el; +// }); +// pray('following direction siblings from start reaches end', maybeRightEnd === ends[R]); +// } +// Fragment.prototype.getDOMFragFromEnds = function () { +// var left = this.ends[L]; +// var right = this.ends[R]; +// if (left === 0 || right === 0) { +// return domFrag(); +// } else if (left === right) { +// // Note, joining a DOMFragment to itself is not allowed, so +// // don't attempt to join the end fragments if the ends are equal +// return left.domFrag(); +// } else { +// return left.domFrag().join(right.domFrag()); +// } +// }; +// /** +// * Note, children may override this to enforce extra invariants, +// * (e.g. that ends are always defined). Ends should only be set +// * through this function. +// */ +// Fragment.prototype.setEnds = function (ends) { +// this.ends = ends; +// }; +// Fragment.prototype.getEnd = function (dir) { +// return this.ends ? this.ends[dir] : 0; +// }; +// Fragment.prototype.domFrag = function () { +// return this.getDOMFragFromEnds(); +// }; +// // like Cursor::withDirInsertAt(dir, parent, withDir, oppDir) +// Fragment.prototype.withDirAdopt = function (dir, parent, withDir, oppDir) { +// return dir === L ? this.adopt(parent, withDir, oppDir) : this.adopt(parent, oppDir, withDir); +// }; +// /** +// * Splice this fragment into the given parent node's children, at the position between the adjacent +// * children `leftward` (or the beginning if omitted) and `rightward` (or the end if omitted). +// * +// * TODO: why do we need both leftward and rightward? It seems to me that `rightward` is always expected to be `leftward ? leftward[R] : parent.ends[L]`. +// */ +// Fragment.prototype.adopt = function (parent, leftward, rightward) { +// var _c; +// prayWellFormed(parent, leftward, rightward); +// var self = this; +// this.disowned = false; +// var leftEnd = self.ends[L]; +// if (!leftEnd) return this; +// var rightEnd = self.ends[R]; +// if (!rightEnd) return this; +// var ends = ((_c = {}), (_c[L] = parent.getEnd(L)), (_c[R] = parent.getEnd(R)), _c); +// if (leftward) { +// // NB: this is handled in the ::each() block +// // leftward[R] = leftEnd +// } else { +// ends[L] = leftEnd; +// } +// if (rightward) { +// rightward[L] = rightEnd; +// } else { +// ends[R] = rightEnd; +// } +// parent.setEnds(ends); +// rightEnd[R] = rightward; +// self.each(function (el) { +// el[L] = leftward; +// el.parent = parent; +// if (leftward) leftward[R] = el; +// leftward = el; +// return true; +// }); +// return self; +// }; +// /** +// * Remove the nodes in this fragment from their parent. +// */ +// Fragment.prototype.disown = function () { +// var _c; +// var self = this; +// var leftEnd = self.ends[L]; +// // guard for empty and already-disowned fragments +// if (!leftEnd || self.disowned) return self; +// this.disowned = true; +// var rightEnd = self.ends[R]; +// if (!rightEnd) return self; +// var parent = leftEnd.parent; +// prayWellFormed(parent, leftEnd[L], leftEnd); +// prayWellFormed(parent, rightEnd, rightEnd[R]); +// var ends = ((_c = {}), (_c[L] = parent.getEnd(L)), (_c[R] = parent.getEnd(R)), _c); +// if (leftEnd[L]) { +// var leftLeftEnd = leftEnd[L]; +// leftLeftEnd[R] = rightEnd[R]; +// } else { +// ends[L] = rightEnd[R]; +// } +// if (rightEnd[R]) { +// var rightRightEnd = rightEnd[R]; +// rightRightEnd[L] = leftEnd[L]; +// } else { +// ends[R] = leftEnd[L]; +// } +// if (ends[L] && ends[R]) { +// parent.setEnds(ends); +// } else { +// // some child classes of MQNode try to enforce that their ends +// // are never empty through the type system. However, disown may +// // temporarily break this invariant in which case it's expected +// // that adopt will later be called to fix the invariant. +// // +// // Cast away the protected status of the ends property and write +// // to it directly to get around runtime assertions in setEnds that +// // enforce non-emptyness. +// parent.ends = ends; +// } +// return self; +// }; +// Fragment.prototype.remove = function () { +// this.domFrag().remove(); +// return this.disown(); +// }; +// Fragment.prototype.each = function (yield_) { +// eachNode(this.ends, yield_); +// return this; +// }; +// Fragment.prototype.fold = function (fold, yield_) { +// return foldNodes(this.ends, fold, yield_); +// }; +// return Fragment; +// })(); +// /** +// * Registry of LaTeX commands and commands created when typing +// * a single character. +// * +// * (Commands are all subclasses of Node.) +// */ +// var LatexCmds = {}; +// var CharCmds = {}; +// function isMQNodeClass(cmd) { +// return cmd && cmd.prototype instanceof MQNode; +// } +// /******************************************** +// * Cursor and Selection "singleton" classes +// *******************************************/ +// /* The main thing that manipulates the Math DOM. Makes sure to manipulate the +// HTML DOM to match. */ +// /* Sort of singletons, since there should only be one per editable math +// textbox, but any one HTML document can contain many such textboxes, so any one +// JS environment could actually contain many instances. */ +// //A fake cursor in the fake textbox that the math is rendered in. +// var Anticursor = /** @class */ (function (_super) { +// __extends(Anticursor, _super); +// function Anticursor(parent, leftward, rightward) { +// var _this_1 = _super.call(this, parent, leftward, rightward) || this; +// _this_1.ancestors = {}; +// return _this_1; +// } +// Anticursor.fromCursor = function (cursor) { +// return new Anticursor(cursor.parent, cursor[L], cursor[R]); +// }; +// return Anticursor; +// })(Point); +// var Cursor = /** @class */ (function (_super) { +// __extends(Cursor, _super); +// function Cursor(initParent, options, controller) { +// var _this_1 = _super.call(this, initParent, 0, 0) || this; +// /** Slightly more than just a "cache", this remembers the cursor's position in each block node, so that we can return to the right +// * point in that node when moving up and down among blocks. +// */ +// _this_1.upDownCache = {}; +// _this_1.cursorElement = h('span', { class: 'dcg-mq-cursor' }, [h.text(U_ZERO_WIDTH_SPACE)]); +// _this_1._domFrag = domFrag(); +// _this_1.controller = controller; +// _this_1.options = options; +// _this_1.setDOMFrag(domFrag(_this_1.cursorElement)); +// //closured for setInterval +// _this_1.blink = function () { +// domFrag(_this_1.cursorElement).toggleClass('dcg-mq-blink'); +// }; +// return _this_1; +// } +// Cursor.prototype.setDOMFrag = function (frag) { +// this._domFrag = frag; +// return this; +// }; +// Cursor.prototype.domFrag = function () { +// return this._domFrag; +// }; +// Cursor.prototype.show = function () { +// domFrag(this.cursorElement).removeClass('dcg-mq-blink'); +// this.setDOMFrag(domFrag(this.cursorElement)); +// if (this.intervalId) +// //already was shown, just restart interval +// clearInterval(this.intervalId); +// else { +// //was hidden and detached, insert this.jQ back into HTML DOM +// var right = this[R]; +// if (right) { +// var selection = this.selection; +// if (selection && selection.getEnd(L)[L] === this[L]) +// this.domFrag().insertBefore(selection.domFrag()); +// else this.domFrag().insertBefore(right.domFrag()); +// } else this.domFrag().appendTo(this.parent.domFrag().oneElement()); +// this.parent.focus(); +// } +// this.intervalId = setInterval(this.blink, 500); +// return this; +// }; +// Cursor.prototype.hide = function () { +// if (this.intervalId) clearInterval(this.intervalId); +// this.intervalId = 0; +// this.domFrag().detach(); +// this.setDOMFrag(domFrag()); +// return this; +// }; +// Cursor.prototype.withDirInsertAt = function (dir, parent, withDir, oppDir) { +// var oldParent = this.parent; +// this.parent = parent; +// this[dir] = withDir; +// this[-dir] = oppDir; +// // by contract, .blur() is called after all has been said and done +// // and the cursor has actually been moved +// // FIXME pass cursor to .blur() so text can fix cursor pointers when removing itself +// if (oldParent !== parent && oldParent.blur) oldParent.blur(this); +// }; +// /** Place the cursor before or after `el`, according the side specified by `dir`. */ +// Cursor.prototype.insDirOf = function (dir, el) { +// prayDirection(dir); +// this.domFrag().insDirOf(dir, el.domFrag()); +// this.withDirInsertAt(dir, el.parent, el[dir], el); +// this.parent.domFrag().addClass('dcg-mq-hasCursor'); +// return this; +// }; +// Cursor.prototype.insLeftOf = function (el) { +// return this.insDirOf(L, el); +// }; +// Cursor.prototype.insRightOf = function (el) { +// return this.insDirOf(R, el); +// }; +// /** Place the cursor inside `el` at either the left or right end, according the side specified by `dir`. */ +// Cursor.prototype.insAtDirEnd = function (dir, el) { +// prayDirection(dir); +// this.domFrag().insAtDirEnd(dir, el.domFrag().oneElement()); +// this.withDirInsertAt(dir, el, 0, el.getEnd(dir)); +// el.focus(); +// return this; +// }; +// Cursor.prototype.insAtLeftEnd = function (el) { +// return this.insAtDirEnd(L, el); +// }; +// Cursor.prototype.insAtRightEnd = function (el) { +// return this.insAtDirEnd(R, el); +// }; +// /** +// * jump up or down from one block Node to another: +// * - cache the current Point in the node we're jumping from +// * - check if there's a Point in it cached for the node we're jumping to +// * + if so put the cursor there, +// * + if not seek a position in the node that is horizontally closest to +// * the cursor's current position +// */ +// Cursor.prototype.jumpUpDown = function (from, to) { +// var self = this; +// self.upDownCache[from.id] = Point.copy(self); +// var cached = self.upDownCache[to.id]; +// if (cached) { +// var cachedR = cached[R]; +// if (cachedR) { +// self.insLeftOf(cachedR); +// } else { +// self.insAtRightEnd(cached.parent); +// } +// } else { +// var clientX = self.getBoundingClientRectWithoutMargin().left; +// to.seek(clientX, self); +// } +// self.controller.aria.queue(to, true); +// }; +// Cursor.prototype.getBoundingClientRectWithoutMargin = function () { +// //in Opera 11.62, .getBoundingClientRect() and hence jQuery::offset() +// //returns all 0's on inline elements with negative margin-right (like +// //the cursor) at the end of their parent, so temporarily remove the +// //negative margin-right when calling jQuery::offset() +// //Opera bug DSK-360043 +// //http://bugs.jquery.com/ticket/11523 +// //https://github.com/jquery/jquery/pull/717 +// var frag = this.domFrag(); +// frag.removeClass('dcg-mq-cursor'); +// var _c = getBoundingClientRect(frag.oneElement()), +// left = _c.left, +// right = _c.right; +// frag.addClass('dcg-mq-cursor'); +// return { +// left: left, +// right: right, +// }; +// }; +// Cursor.prototype.unwrapGramp = function () { +// var gramp = this.parent.parent; +// var greatgramp = gramp.parent; +// var rightward = gramp[R]; +// var cursor = this; +// var leftward = gramp[L]; +// gramp.disown().eachChild(function (uncle) { +// if (uncle.isEmpty()) return true; +// uncle +// .children() +// .adopt(greatgramp, leftward, rightward) +// .each(function (cousin) { +// cousin.domFrag().insertBefore(gramp.domFrag()); +// return true; +// }); +// leftward = uncle.getEnd(R); +// return true; +// }); +// if (!this[R]) { +// //then find something to be rightward to insLeftOf +// var thisL = this[L]; +// if (thisL) this[R] = thisL[R]; +// else { +// while (!this[R]) { +// var newParent = this.parent[R]; +// if (newParent) { +// this.parent = newParent; +// this[R] = newParent.getEnd(L); +// } else { +// this[R] = gramp[R]; +// this.parent = greatgramp; +// break; +// } +// } +// } +// } +// var thisR = this[R]; +// if (thisR) this.insLeftOf(thisR); +// else this.insAtRightEnd(greatgramp); +// gramp.domFrag().remove(); +// var grampL = gramp[L]; +// var grampR = gramp[R]; +// if (grampL) grampL.siblingDeleted(cursor.options, R); +// if (grampR) grampR.siblingDeleted(cursor.options, L); +// }; +// Cursor.prototype.startSelection = function () { +// var anticursor = (this.anticursor = Anticursor.fromCursor(this)); +// var ancestors = anticursor.ancestors; +// for (var ancestor = anticursor; ancestor.parent; ancestor = ancestor.parent) { +// ancestors[ancestor.parent.id] = ancestor; +// } +// }; +// Cursor.prototype.endSelection = function () { +// delete this.anticursor; +// }; +// Cursor.prototype.select = function () { +// var _lca; +// var anticursor = this.anticursor; +// if (this[L] === anticursor[L] && this.parent === anticursor.parent) return false; +// // Find the lowest common ancestor (`lca`), and the ancestor of the cursor +// // whose parent is the LCA (which'll be an end of the selection fragment). +// for (var ancestor = this; ancestor.parent; ancestor = ancestor.parent) { +// if (ancestor.parent.id in anticursor.ancestors) { +// _lca = ancestor.parent; +// break; +// } +// } +// pray('cursor and anticursor in the same tree', _lca); +// var lca = _lca; +// // The cursor and the anticursor should be in the same tree, because the +// // mousemove handler attached to the document, unlike the one attached to +// // the root HTML DOM element, doesn't try to get the math tree node of the +// // mousemove target, and Cursor::seek() based solely on coordinates stays +// // within the tree of `this` cursor's root. +// // The other end of the selection fragment, the ancestor of the anticursor +// // whose parent is the LCA. +// var antiAncestor = anticursor.ancestors[lca.id]; +// // Now we have two either Nodes or Points, guaranteed to have a common +// // parent and guaranteed that if both are Points, they are not the same, +// // and we have to figure out which is the left end and which the right end +// // of the selection. +// var leftEnd, +// rightEnd, +// dir = R; +// // This is an extremely subtle algorithm. +// // As a special case, `ancestor` could be a Point and `antiAncestor` a Node +// // immediately to `ancestor`'s left. +// // In all other cases, +// // - both Nodes +// // - `ancestor` a Point and `antiAncestor` a Node +// // - `ancestor` a Node and `antiAncestor` a Point +// // `antiAncestor[R] === rightward[R]` for some `rightward` that is +// // `ancestor` or to its right, if and only if `antiAncestor` is to +// // the right of `ancestor`. +// if (ancestor[L] !== antiAncestor) { +// for (var rightward = ancestor; rightward; rightward = rightward[R]) { +// if (rightward[R] === antiAncestor[R]) { +// dir = L; +// leftEnd = ancestor; +// rightEnd = antiAncestor; +// break; +// } +// } +// } +// if (dir === R) { +// leftEnd = antiAncestor; +// rightEnd = ancestor; +// } +// // only want to select Nodes up to Points, can't select Points themselves +// if (leftEnd instanceof Point) leftEnd = leftEnd[R]; +// if (rightEnd instanceof Point) rightEnd = rightEnd[L]; +// this.hide().selection = lca.selectChildren(leftEnd, rightEnd); +// var insEl = this.selection.getEnd(dir); +// this.insDirOf(dir, insEl); +// this.selectionChanged(); +// return true; +// }; +// Cursor.prototype.resetToEnd = function (controller) { +// this.clearSelection(); +// var root = controller.root; +// this[R] = 0; +// this[L] = root.getEnd(R); +// this.parent = root; +// }; +// Cursor.prototype.clearSelection = function () { +// if (this.selection) { +// this.selection.clear(); +// delete this.selection; +// this.selectionChanged(); +// } +// return this; +// }; +// Cursor.prototype.deleteSelection = function () { +// var selection = this.selection; +// if (!selection) return; +// this[L] = selection.getEnd(L)[L]; +// this[R] = selection.getEnd(R)[R]; +// selection.remove(); +// this.selectionChanged(); +// delete this.selection; +// }; +// Cursor.prototype.replaceSelection = function () { +// var seln = this.selection; +// if (seln) { +// this[L] = seln.getEnd(L)[L]; +// this[R] = seln.getEnd(R)[R]; +// delete this.selection; +// } +// return seln; +// }; +// Cursor.prototype.depth = function () { +// var node = this; +// var depth = 0; +// while ((node = node.parent)) { +// depth += node instanceof MathBlock ? 1 : 0; +// } +// return depth; +// }; +// Cursor.prototype.isTooDeep = function (offset) { +// if (this.options.maxDepth !== undefined) { +// return this.depth() + (offset || 0) > this.options.maxDepth; +// } else { +// return false; +// } +// }; +// // can be overridden +// Cursor.prototype.selectionChanged = function () {}; +// return Cursor; +// })(Point); +// var MQSelection = /** @class */ (function (_super) { +// __extends(MQSelection, _super); +// function MQSelection(withDir, oppDir, dir) { +// var _this_1 = _super.call(this, withDir, oppDir, dir) || this; +// _this_1._el = h('span', { class: 'dcg-mq-selection' }); +// _this_1.getDOMFragFromEnds().wrapAll(_this_1._el); +// return _this_1; +// } +// MQSelection.prototype.isCleared = function () { +// return this._el === undefined; +// }; +// MQSelection.prototype.domFrag = function () { +// return this.isCleared() ? this.getDOMFragFromEnds() : domFrag(this._el); +// }; +// MQSelection.prototype.setEnds = function (ends) { +// pray('Selection ends are never empty', ends[L] && ends[R]); +// this.ends = ends; +// }; +// MQSelection.prototype.getEnd = function (dir) { +// return this.ends[dir]; +// }; +// MQSelection.prototype.adopt = function (parent, leftward, rightward) { +// this.clear(); +// return _super.prototype.adopt.call(this, parent, leftward, rightward); +// }; +// MQSelection.prototype.clear = function () { +// // NOTE it's important here that DOMFragment::children includes all +// // child nodes (including Text nodes), and not just Element nodes. +// // This makes it more similar to the native DOM childNodes property +// // and jQuery's .collection() method than jQuery's .children() method +// var childFrag = this.getDOMFragFromEnds(); +// this.domFrag().replaceWith(childFrag); +// this._el = undefined; +// return this; +// }; +// MQSelection.prototype.join = function (methodName, separator) { +// if (separator === void 0) { +// separator = ''; +// } +// return this.fold('', function (fold, child) { +// return fold + separator + child[methodName](); +// }); +// }; +// return MQSelection; +// })(Fragment); +// var ControllerBase = /** @class */ (function () { +// function ControllerBase(root, container, options) { +// this.textareaEventListeners = {}; +// this.id = root.id; +// this.data = {}; +// this.root = root; +// this.container = container; +// this.options = options; +// this.aria = new Aria(this.getControllerSelf()); +// this.ariaLabel = 'Math Input'; +// this.ariaPostLabel = ''; +// root.controller = this.getControllerSelf(); +// this.cursor = root.cursor = new Cursor(root, options, this.getControllerSelf()); +// // TODO: stop depending on root.cursor, and rm it +// } +// ControllerBase.prototype.getControllerSelf = function () { +// // dance we have to do to tell this thing it's a full controller +// return this; +// }; +// ControllerBase.prototype.handle = function (name, dir) { +// var _c; +// var handlers = this.options.handlers; +// var handler = (_c = this.options.handlers) === null || _c === void 0 ? void 0 : _c.fns[name]; +// if (handler) { +// var APIClass = +// handlers === null || handlers === void 0 ? void 0 : handlers.APIClasses[this.KIND_OF_MQ]; +// pray('APIClass is defined', APIClass); +// var mq = new APIClass(this); // cast to any bedcause APIClass needs the final Controller subclass. +// if (dir === L || dir === R) handler(dir, mq); +// else handler(mq); +// } +// }; +// ControllerBase.onNotify = function (f) { +// ControllerBase.notifyees.push(f); +// }; +// ControllerBase.prototype.notify = function (e) { +// for (var i = 0; i < ControllerBase.notifyees.length; i += 1) { +// ControllerBase.notifyees[i](this.cursor, e); +// } +// return this; +// }; +// ControllerBase.prototype.setAriaLabel = function (ariaLabel) { +// var oldAriaLabel = this.getAriaLabel(); +// if (ariaLabel && typeof ariaLabel === 'string' && ariaLabel !== '') { +// this.ariaLabel = ariaLabel; +// } else if (this.editable) { +// this.ariaLabel = 'Math Input'; +// } else { +// this.ariaLabel = ''; +// } +// // If this field doesn't have focus, update its computed mathspeak value. +// // We check for focus because updating the aria-label attribute of a focused element will cause most screen readers to announce the new value (in our case, label along with the expression's mathspeak). +// // If the field does have focus at the time, it will be updated once a blur event occurs. +// // Unless we stop using fake text inputs and emulating screen reader behavior, this is going to remain a problem. +// if (this.ariaLabel !== oldAriaLabel && !this.containerHasFocus()) { +// this.updateMathspeak(); +// } +// return this; +// }; +// ControllerBase.prototype.getAriaLabel = function () { +// if (this.ariaLabel !== 'Math Input') { +// return this.ariaLabel; +// } else if (this.editable) { +// return 'Math Input'; +// } else { +// return ''; +// } +// }; +// ControllerBase.prototype.setAriaPostLabel = function (ariaPostLabel, timeout) { +// var _this_1 = this; +// if (ariaPostLabel && typeof ariaPostLabel === 'string' && ariaPostLabel !== '') { +// if (ariaPostLabel !== this.ariaPostLabel && typeof timeout === 'number') { +// if (this._ariaAlertTimeout) clearTimeout(this._ariaAlertTimeout); +// this._ariaAlertTimeout = setTimeout(function () { +// if (_this_1.containerHasFocus()) { +// // Voice the new label, but do not update content mathspeak to prevent double-speech. +// _this_1.aria.alert(_this_1.root.mathspeak().trim() + ' ' + ariaPostLabel.trim()); +// } else { +// // This mathquill does not have focus, so update its mathspeak. +// _this_1.updateMathspeak(); +// } +// }, timeout); +// } +// this.ariaPostLabel = ariaPostLabel; +// } else { +// if (this._ariaAlertTimeout) clearTimeout(this._ariaAlertTimeout); +// this.ariaPostLabel = ''; +// } +// return this; +// }; +// ControllerBase.prototype.getAriaPostLabel = function () { +// return this.ariaPostLabel || ''; +// }; +// ControllerBase.prototype.containerHasFocus = function () { +// return document.activeElement && this.container.contains(document.activeElement); +// }; +// ControllerBase.prototype.getTextareaOrThrow = function () { +// var textarea = this.textarea; +// if (!textarea) throw new Error('expected a textarea'); +// return textarea; +// }; +// ControllerBase.prototype.getTextareaSpanOrThrow = function () { +// var textareaSpan = this.textareaSpan; +// if (!textareaSpan) throw new Error('expected a textareaSpan'); +// return textareaSpan; +// }; +// /** Add the given event listeners on this.textarea, replacing the existing listener for that event if it exists. */ +// ControllerBase.prototype.addTextareaEventListeners = function (listeners) { +// if (!this.textarea) return; +// for (var key_2 in listeners) { +// var event = key_2; +// this.removeTextareaEventListener(event); +// this.textarea.addEventListener(event, listeners[event]); +// } +// }; +// ControllerBase.prototype.removeTextareaEventListener = function (event) { +// if (!this.textarea) return; +// var listener = this.textareaEventListeners[event]; +// if (!listener) return; +// this.textarea.removeEventListener(event, listener); +// }; +// // based on http://www.gh-mathspeak.com/examples/quick-tutorial/ +// // and http://www.gh-mathspeak.com/examples/grammar-rules/ +// ControllerBase.prototype.exportMathSpeak = function () { +// return this.root.mathspeak(); +// }; +// // overridden +// ControllerBase.prototype.updateMathspeak = function () {}; +// ControllerBase.prototype.scrollHoriz = function () {}; +// ControllerBase.prototype.selectionChanged = function () {}; +// ControllerBase.prototype.setOverflowClasses = function () {}; +// ControllerBase.notifyees = []; +// return ControllerBase; +// })(); +// var API = {}; +// var EMBEDS = {}; +// var processedOptions = { +// handlers: true, +// autoCommands: true, +// quietEmptyDelimiters: true, +// autoParenthesizedFunctions: true, +// autoOperatorNames: true, +// leftRightIntoCmdGoes: true, +// maxDepth: true, +// interpretTildeAsSim: true, +// }; +// var baseOptionProcessors = {}; +// var Options = /** @class */ (function () { +// function Options(version) { +// this.version = version; +// } +// Options.prototype.assertJquery = function () { +// pray('Interface versions > 2 do not depend on JQuery', this.version <= 2); +// pray('JQuery is set for interface v < 3', this.jQuery); +// return this.jQuery; +// }; +// return Options; +// })(); +// var Progenote = /** @class */ (function () { +// function Progenote() {} +// return Progenote; +// })(); +// /** +// * Interface Versioning (#459, #495) to allow us to virtually guarantee +// * backcompat. v0.10.x introduces it, so for now, don't completely break the +// * API for people who don't know about it, just complain with console.warn(). +// * +// * The methods are shimmed in outro.js so that MQ.MathField.prototype etc can +// * be accessed. +// */ +// var insistOnInterVer = function () { +// if (window.console) +// console.warn( +// 'You are using the MathQuill API without specifying an interface version, ' + +// 'which will fail in v1.0.0. Easiest fix is to do the following before ' + +// 'doing anything else:\n' + +// '\n' + +// ' MathQuill = MathQuill.getInterface(1);\n' + +// ' // now MathQuill.MathField() works like it used to\n' + +// '\n' + +// 'See also the "`dev` branch (2014\u20132015) \u2192 v0.10.0 Migration Guide" at\n' + +// ' https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide' +// ); +// }; +// // globally exported API object +// var MQ1; +// function MathQuill(el) { +// insistOnInterVer(); +// if (!MQ1) { +// MQ1 = getInterface(1); +// } +// return MQ1(el); +// } +// MathQuill.prototype = Progenote.prototype; +// MathQuill.VERSION = 'v0.10.1'; +// MathQuill.interfaceVersion = function (v) { +// // shim for #459-era interface versioning (ended with #495) +// if (v !== 1) throw 'Only interface version 1 supported. You specified: ' + v; +// insistOnInterVer = function () { +// if (window.console) +// console.warn( +// 'You called MathQuill.interfaceVersion(1); to specify the interface ' + +// 'version, which will fail in v1.0.0. You can fix this easily by doing ' + +// 'this before doing anything else:\n' + +// '\n' + +// ' MathQuill = MathQuill.getInterface(1);\n' + +// ' // now MathQuill.MathField() works like it used to\n' + +// '\n' + +// 'See also the "`dev` branch (2014\u20132015) \u2192 v0.10.0 Migration Guide" at\n' + +// ' https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide' +// ); +// }; +// insistOnInterVer(); +// return MathQuill; +// }; +// MathQuill.getInterface = getInterface; +// var MIN = (getInterface.MIN = 1), +// MAX = (getInterface.MAX = 3); +// function getInterface(v) { +// if (v !== 1 && v !== 2 && v !== 3) +// throw 'Only interface versions between ' + MIN + ' and ' + MAX + ' supported. You specified: ' + v; +// var version = v; +// if (version < 3) { +// var jQuery = window.jQuery; +// if (!jQuery) +// throw 'MathQuill interface version '.concat(version, ' requires jQuery 1.5.2+ to be loaded first'); +// Options.prototype.jQuery = jQuery; +// } +// var optionProcessors = __assign(__assign({}, baseOptionProcessors), { +// handlers: function (handlers) { +// return { +// // casting to the v3 version of this type +// fns: handlers || {}, +// APIClasses: APIClasses, +// }; +// }, +// }); +// function config(currentOptions, newOptions) { +// for (var name in newOptions) { +// if (newOptions.hasOwnProperty(name)) { +// if (name === 'substituteKeyboardEvents' && version >= 3) { +// throw new Error( +// [ +// "As of interface version 3, the 'substituteKeyboardEvents'", +// "option is no longer supported. Use 'overrideTypedText' and", +// "'overrideKeystroke' instead.", +// ].join(' ') +// ); +// } +// var value = newOptions[name]; // TODO - think about typing this better +// var processor = optionProcessors[name]; // TODO - validate option processors better +// currentOptions[name] = processor ? processor(value) : value; // TODO - think about typing better +// } +// } +// } +// var BaseOptions = +// version < 3 +// ? Options +// : /** @class */ (function (_super) { +// __extends(BaseOptions, _super); +// function BaseOptions() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// return BaseOptions; +// })(Options); +// var AbstractMathQuill = /** @class */ (function (_super) { +// __extends(AbstractMathQuill, _super); +// function AbstractMathQuill(ctrlr) { +// var _this_1 = _super.call(this) || this; +// _this_1.__controller = ctrlr; +// _this_1.__options = ctrlr.options; +// _this_1.id = ctrlr.id; +// _this_1.data = ctrlr.data; +// return _this_1; +// } +// AbstractMathQuill.prototype.mathquillify = function (classNames) { +// var ctrlr = this.__controller, +// root = ctrlr.root, +// el = ctrlr.container; +// ctrlr.createTextarea(); +// var contents = domFrag(el).addClass(classNames).children().detach(); +// root.setDOM( +// domFrag(h('span', { class: 'dcg-mq-root-block', 'aria-hidden': true })) +// .appendTo(el) +// .oneElement() +// ); +// NodeBase.linkElementByBlockNode(root.domFrag().oneElement(), root); +// this.latex(contents.text()); +// this.revert = function () { +// ctrlr.removeMouseEventListener(); +// domFrag(el) +// .removeClass('dcg-mq-editable-field dcg-mq-math-mode dcg-mq-text-mode') +// .empty() +// .append(contents); +// return version < 3 ? this.__options.assertJquery()(el) : el; +// }; +// }; +// AbstractMathQuill.prototype.setAriaLabel = function (ariaLabel) { +// this.__controller.setAriaLabel(ariaLabel); +// return this; +// }; +// AbstractMathQuill.prototype.getAriaLabel = function () { +// return this.__controller.getAriaLabel(); +// }; +// AbstractMathQuill.prototype.config = function (opts) { +// config(this.__options, opts); +// return this; +// }; +// AbstractMathQuill.prototype.el = function () { +// return this.__controller.container; +// }; +// AbstractMathQuill.prototype.text = function () { +// return this.__controller.exportText(); +// }; +// AbstractMathQuill.prototype.mathspeak = function () { +// return this.__controller.exportMathSpeak(); +// }; +// AbstractMathQuill.prototype.latex = function (latex) { +// if (arguments.length > 0) { +// this.__controller.renderLatexMath(latex); +// var cursor = this.__controller.cursor; +// if (this.__controller.blurred) cursor.hide().parent.blur(cursor); +// return this; +// } +// return this.__controller.exportLatex(); +// }; +// AbstractMathQuill.prototype.selection = function () { +// return this.__controller.exportLatexSelection(); +// }; +// AbstractMathQuill.prototype.html = function () { +// return this.__controller.root +// .domFrag() +// .oneElement() +// .innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, '') // TODO remove when jQuery is completely gone +// .replace(/ mathquill-(?:command|block)-id="?\d+"?/g, '') +// .replace(/.?<\/span>/i, '') +// .replace(/ dcg-mq-hasCursor|dcg-mq-hasCursor ?/, '') +// .replace(/ class=(""|(?= |>))/g, ''); +// }; +// AbstractMathQuill.prototype.reflow = function () { +// this.__controller.root.postOrder(function (node) { +// node.reflow(); +// }); +// return this; +// }; +// return AbstractMathQuill; +// })(Progenote); +// var EditableField = /** @class */ (function (_super) { +// __extends(EditableField, _super); +// function EditableField() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// EditableField.prototype.mathquillify = function (classNames) { +// _super.prototype.mathquillify.call(this, classNames); +// this.__controller.editable = true; +// this.__controller.addMouseEventListener(); +// this.__controller.editablesTextareaEvents(); +// return this; +// }; +// EditableField.prototype.focus = function () { +// this.__controller.getTextareaOrThrow().focus(); +// this.__controller.scrollHoriz(); +// return this; +// }; +// EditableField.prototype.blur = function () { +// this.__controller.getTextareaOrThrow().blur(); +// return this; +// }; +// EditableField.prototype.write = function (latex) { +// this.__controller.writeLatex(latex); +// this.__controller.scrollHoriz(); +// var cursor = this.__controller.cursor; +// if (this.__controller.blurred) cursor.hide().parent.blur(cursor); +// return this; +// }; +// EditableField.prototype.empty = function () { +// var _c; +// var root = this.__controller.root, +// cursor = this.__controller.cursor; +// root.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); +// root.domFrag().empty(); +// delete cursor.selection; +// cursor.insAtRightEnd(root); +// return this; +// }; +// EditableField.prototype.cmd = function (cmd) { +// var ctrlr = this.__controller.notify(undefined), +// cursor = ctrlr.cursor; +// if (/^\\[a-z]+$/i.test(cmd) && !cursor.isTooDeep()) { +// cmd = cmd.slice(1); +// var klass = LatexCmds[cmd]; +// var node; +// if (klass) { +// if (klass.constructor) { +// node = new klass(cmd); +// } else { +// node = klass(cmd); +// } +// if (cursor.selection) node.replaces(cursor.replaceSelection()); +// node.createLeftOf(cursor.show()); +// } /* TODO: API needs better error reporting */ else; +// } else cursor.parent.write(cursor, cmd); +// ctrlr.scrollHoriz(); +// if (ctrlr.blurred) cursor.hide().parent.blur(cursor); +// return this; +// }; +// EditableField.prototype.select = function () { +// this.__controller.selectAll(); +// return this; +// }; +// EditableField.prototype.clearSelection = function () { +// this.__controller.cursor.clearSelection(); +// return this; +// }; +// EditableField.prototype.moveToDirEnd = function (dir) { +// this.__controller.notify('move').cursor.insAtDirEnd(dir, this.__controller.root); +// return this; +// }; +// EditableField.prototype.moveToLeftEnd = function () { +// return this.moveToDirEnd(L); +// }; +// EditableField.prototype.moveToRightEnd = function () { +// return this.moveToDirEnd(R); +// }; +// EditableField.prototype.keystroke = function (keysString, evt) { +// var keys = keysString.replace(/^\s+|\s+$/g, '').split(/\s+/); +// for (var i = 0; i < keys.length; i += 1) { +// this.__controller.keystroke(keys[i], evt); +// } +// return this; +// }; +// EditableField.prototype.typedText = function (text) { +// for (var i = 0; i < text.length; i += 1) this.__controller.typedText(text.charAt(i)); +// return this; +// }; +// EditableField.prototype.dropEmbedded = function (pageX, pageY, options) { +// var clientX = pageX - getScrollX(); +// var clientY = pageY - getScrollY(); +// var el = document.elementFromPoint(clientX, clientY); +// this.__controller.seek(el, clientX, clientY); +// var cmd = new EmbedNode().setOptions(options); +// cmd.createLeftOf(this.__controller.cursor); +// }; +// EditableField.prototype.setAriaPostLabel = function (ariaPostLabel, timeout) { +// this.__controller.setAriaPostLabel(ariaPostLabel, timeout); +// return this; +// }; +// EditableField.prototype.getAriaPostLabel = function () { +// return this.__controller.getAriaPostLabel(); +// }; +// EditableField.prototype.clickAt = function (clientX, clientY, target) { +// target = target || document.elementFromPoint(clientX, clientY); +// var ctrlr = this.__controller, +// root = ctrlr.root; +// var rootElement = root.domFrag().oneElement(); +// if (!rootElement.contains(target)) target = rootElement; +// ctrlr.seek(target, clientX, clientY); +// if (ctrlr.blurred) this.focus(); +// return this; +// }; +// EditableField.prototype.ignoreNextMousedown = function (fn) { +// this.__controller.cursor.options.ignoreNextMousedown = fn; +// return this; +// }; +// return EditableField; +// })(AbstractMathQuill); +// var APIClasses = { +// AbstractMathQuill: AbstractMathQuill, +// EditableField: EditableField, +// }; +// pray('API.StaticMath defined', API.StaticMath); +// APIClasses.StaticMath = API.StaticMath(APIClasses); +// pray('API.MathField defined', API.MathField); +// APIClasses.MathField = API.MathField(APIClasses); +// pray('API.InnerMathField defined', API.InnerMathField); +// APIClasses.InnerMathField = API.InnerMathField(APIClasses); +// if (API.TextField) { +// APIClasses.TextField = API.TextField(APIClasses); +// } +// /** +// * Function that takes an HTML element and, if it's the root HTML element of a +// * static math or math or text field, returns an API object for it (else, null). +// * +// * var mathfield = MQ.MathField(mathFieldSpan); +// * assert(MQ(mathFieldSpan).id === mathfield.id); +// * assert(MQ(mathFieldSpan).id === MQ(mathFieldSpan).id); +// * +// */ +// var MQ = function (el) { +// if (!el || !el.nodeType) return null; // check that `el` is a HTML element, using the +// // same technique as jQuery: https://github.com/jquery/jquery/blob/679536ee4b7a92ae64a5f58d90e9cc38c001e807/src/core/init.js#L92 +// var blockElement; +// var childArray = domFrag(el).children().toElementArray(); +// for (var _i = 0, childArray_1 = childArray; _i < childArray_1.length; _i++) { +// var child = childArray_1[_i]; +// if (child.classList.contains('dcg-mq-root-block')) { +// blockElement = child; +// break; +// } +// } +// var blockNode = NodeBase.getNodeOfElement(blockElement); // TODO - assumng it's a MathBlock +// var ctrlr = blockNode && blockNode.controller; +// var APIClass = ctrlr && APIClasses[ctrlr.KIND_OF_MQ]; +// return ctrlr && APIClass ? new APIClass(ctrlr) : null; +// }; +// MQ.L = L; +// MQ.R = R; +// MQ.config = function (opts) { +// config(BaseOptions.prototype, opts); +// return this; +// }; +// MQ.registerEmbed = function (name, options) { +// if (!/^[a-z][a-z0-9]*$/i.test(name)) { +// throw 'Embed name must start with letter and be only letters and digits'; +// } +// EMBEDS[name] = options; +// }; +// /* +// * Export the API functions that MathQuill-ify an HTML element into API objects +// * of each class. If the element had already been MathQuill-ified but into a +// * different kind (or it's not an HTML element), return null. +// */ +// MQ.StaticMath = createEntrypoint('StaticMath', APIClasses.StaticMath); +// MQ.MathField = createEntrypoint('MathField', APIClasses.MathField); +// MQ.InnerMathField = createEntrypoint('InnerMathField', APIClasses.InnerMathField); +// if (APIClasses.TextField) { +// MQ.TextField = createEntrypoint('TextField', APIClasses.TextField); +// } +// MQ.prototype = AbstractMathQuill.prototype; +// MQ.EditableField = function () { +// throw "wtf don't call me, I'm 'abstract'"; +// }; +// MQ.EditableField.prototype = EditableField.prototype; +// if (version < 3) { +// MQ.saneKeyboardEvents = defaultSubstituteKeyboardEvents; +// } +// function createEntrypoint(kind, APIClass) { +// pray(kind + ' is defined', APIClass); +// function mqEntrypoint(el, opts) { +// if (!el || !el.nodeType) return null; +// var mq = MQ(el); +// if (mq instanceof APIClass) return mq; +// var ctrlr = new Controller(new APIClass.RootBlock(), el, new BaseOptions(version)); +// ctrlr.KIND_OF_MQ = kind; +// return new APIClass(ctrlr).__mathquillify(opts || {}, version); +// } +// mqEntrypoint.prototype = APIClass.prototype; +// return mqEntrypoint; +// } +// return MQ; +// } +// MathQuill.noConflict = function () { +// window.MathQuill = origMathQuill; +// return MathQuill; +// }; +// var origMathQuill = window.MathQuill; +// window.MathQuill = MathQuill; +// function RootBlockMixin(_) { +// _.moveOutOf = function (dir) { +// pray('controller is defined', this.controller); +// this.controller.handle('moveOutOf', dir); +// }; +// _.deleteOutOf = function (dir) { +// pray('controller is defined', this.controller); +// this.controller.handle('deleteOutOf', dir); +// }; +// _.selectOutOf = function (dir) { +// pray('controller is defined', this.controller); +// this.controller.handle('selectOutOf', dir); +// }; +// _.upOutOf = function () { +// pray('controller is defined', this.controller); +// this.controller.handle('upOutOf'); +// return undefined; +// }; +// _.downOutOf = function () { +// pray('controller is defined', this.controller); +// this.controller.handle('downOutOf'); +// return undefined; +// }; +// _.reflow = function () { +// pray('controller is defined', this.controller); +// this.controller.handle('reflow'); +// this.controller.handle('edited'); +// this.controller.handle('edit'); +// }; +// } +// function parseError(stream, message) { +// if (stream) { +// stream = "'" + stream + "'"; +// } else { +// stream = 'EOF'; +// } +// throw 'Parse Error: ' + message + ' at ' + stream; +// } +// var Parser = /** @class */ (function () { +// // The Parser object is a wrapper for a parser function. +// // Externally, you use one to parse a string by calling +// // var result = SomeParser.parse('Me Me Me! Parse Me!'); +// // You should never call the constructor, rather you should +// // construct your Parser from the base parsers and the +// // parser combinator methods. +// function Parser(body) { +// this._ = body; +// } +// Parser.prototype.parse = function (stream) { +// return this.skip(Parser.eof)._('' + stream, success, parseError); +// function success(_stream, result) { +// return result; +// } +// }; +// // -*- primitive combinators -*- // +// Parser.prototype.or = function (alternative) { +// pray('or is passed a parser', alternative instanceof Parser); +// var self = this; +// return new Parser(function (stream, onSuccess, onFailure) { +// return self._(stream, onSuccess, failure); +// function failure(_newStream) { +// return alternative._(stream, onSuccess, onFailure); +// } +// }); +// }; +// Parser.prototype.then = function (next) { +// var self = this; +// return new Parser(function (stream, onSuccess, onFailure) { +// return self._(stream, success, onFailure); +// function success(newStream, result) { +// var nextParser = next instanceof Parser ? next : next(result); +// pray('a parser is returned', nextParser instanceof Parser); +// return nextParser._(newStream, onSuccess, onFailure); +// } +// }); +// }; +// // -*- optimized iterative combinators -*- // +// Parser.prototype.many = function () { +// var self = this; +// return new Parser(function (stream, onSuccess, _onFailure) { +// var xs = []; +// while (self._(stream, success, failure)); +// return onSuccess(stream, xs); +// function success(newStream, x) { +// stream = newStream; +// xs.push(x); +// return true; +// } +// function failure() { +// return false; +// } +// }); +// }; +// Parser.prototype.times = function (min, max) { +// if (arguments.length < 2) max = min; +// var self = this; +// return new Parser(function (stream, onSuccess, onFailure) { +// var xs = []; +// var result = true; +// var failure; +// for (var i = 0; i < min; i += 1) { +// // TODO, this may be incorrect for parsers that return boolean +// // (or generally, falsey) values +// result = !!self._(stream, success, firstFailure); +// if (!result) return onFailure(stream, failure); +// } +// for (; i < max && result; i += 1) { +// self._(stream, success, secondFailure); +// } +// return onSuccess(stream, xs); +// function success(newStream, x) { +// xs.push(x); +// stream = newStream; +// return true; +// } +// function firstFailure(newStream, msg) { +// failure = msg; +// stream = newStream; +// return false; +// } +// function secondFailure(_newStream, _msg) { +// return false; +// } +// }); +// }; +// // -*- higher-level combinators -*- // +// Parser.prototype.result = function (res) { +// return this.then(Parser.succeed(res)); +// }; +// Parser.prototype.atMost = function (n) { +// return this.times(0, n); +// }; +// Parser.prototype.atLeast = function (n) { +// var self = this; +// return self.times(n).then(function (start) { +// return self.many().map(function (end) { +// return start.concat(end); +// }); +// }); +// }; +// Parser.prototype.map = function (fn) { +// return this.then(function (result) { +// return Parser.succeed(fn(result)); +// }); +// }; +// Parser.prototype.skip = function (two) { +// return this.then(function (result) { +// return two.result(result); +// }); +// }; +// // -*- primitive parsers -*- // +// Parser.string = function (str) { +// var len = str.length; +// var expected = "expected '" + str + "'"; +// return new Parser(function (stream, onSuccess, onFailure) { +// var head = stream.slice(0, len); +// if (head === str) { +// return onSuccess(stream.slice(len), head); +// } else { +// return onFailure(stream, expected); +// } +// }); +// }; +// Parser.regex = function (re) { +// pray('regexp parser is anchored', re.toString().charAt(1) === '^'); +// var expected = 'expected ' + re; +// return new Parser(function (stream, onSuccess, onFailure) { +// var match = re.exec(stream); +// if (match) { +// var result = match[0]; +// return onSuccess(stream.slice(result.length), result); +// } else { +// return onFailure(stream, expected); +// } +// }); +// }; +// Parser.succeed = function (result) { +// return new Parser(function (stream, onSuccess) { +// return onSuccess(stream, result); +// }); +// }; +// Parser.fail = function (msg) { +// return new Parser(function (stream, _, onFailure) { +// return onFailure(stream, msg); +// }); +// }; +// Parser.letter = Parser.regex(/^[a-z]/i); +// Parser.letters = Parser.regex(/^[a-z]*/i); +// Parser.digit = Parser.regex(/^[0-9]/); +// Parser.digits = Parser.regex(/^[0-9]*/); +// Parser.whitespace = Parser.regex(/^\s+/); +// Parser.optWhitespace = Parser.regex(/^\s*/); +// Parser.any = new Parser(function (stream, onSuccess, onFailure) { +// if (!stream) return onFailure(stream, 'expected any character'); +// return onSuccess(stream.slice(1), stream.charAt(0)); +// }); +// Parser.all = new Parser(function (stream, onSuccess, _onFailure) { +// return onSuccess('', stream); +// }); +// Parser.eof = new Parser(function (stream, onSuccess, onFailure) { +// if (stream) return onFailure(stream, 'expected EOF'); +// return onSuccess(stream, stream); +// }); +// return Parser; +// })(); +// /** Poller that fires once every tick. */ +// var EveryTick = /** @class */ (function () { +// function EveryTick() { +// this.fn = noop; +// } +// EveryTick.prototype.listen = function (fn) { +// this.fn = fn; +// clearTimeout(this.timeoutId); +// this.timeoutId = setTimeout(this.fn); +// }; +// EveryTick.prototype.listenOnce = function (fn) { +// var _this_1 = this; +// this.listen(function () { +// var args = []; +// for (var _i = 0; _i < arguments.length; _i++) { +// args[_i] = arguments[_i]; +// } +// _this_1.clearListener(); +// fn.apply(void 0, args); +// }); +// }; +// EveryTick.prototype.clearListener = function () { +// this.fn = noop; +// clearTimeout(this.timeoutId); +// }; +// EveryTick.prototype.trigger = function () { +// var args = []; +// for (var _i = 0; _i < arguments.length; _i++) { +// args[_i] = arguments[_i]; +// } +// this.fn.apply(this, args); +// }; +// return EveryTick; +// })(); +// /************************************************* +// * Sane Keyboard Events Shim +// * +// * An abstraction layer over the raw browser browser events +// * on the textarea that hides all the nasty cross- +// * browser incompatibilities behind a uniform API. +// * +// * Design goal: This is a *HARD* internal +// * abstraction barrier. Cross-browser +// * inconsistencies are not allowed to leak through +// * and be dealt with by event handlers. All future +// * cross-browser issues that arise must be dealt +// * with here, and if necessary, the API updated. +// ************************************************/ +// var saneKeyboardEvents = (function () { +// // The following [key values][1] map was compiled from the +// // [DOM3 Events appendix section on key codes][2] and +// // [a widely cited report on cross-browser tests of key codes][3], +// // except for 10: 'Enter', which I've empirically observed in Safari on iOS +// // and doesn't appear to conflict with any other known key codes. +// // +// // [1]: http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120614/#keys-keyvalues +// // [2]: http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120614/#fixed-virtual-key-codes +// // [3]: http://unixpapa.com/js/key.html +// var WHICH_TO_MQ_KEY_STEM = { +// 8: 'Backspace', +// 9: 'Tab', +// 10: 'Enter', +// 13: 'Enter', +// 16: 'Shift', +// 17: 'Control', +// 18: 'Alt', +// 20: 'CapsLock', +// 27: 'Esc', +// 32: 'Spacebar', +// 33: 'PageUp', +// 34: 'PageDown', +// 35: 'End', +// 36: 'Home', +// 37: 'Left', +// 38: 'Up', +// 39: 'Right', +// 40: 'Down', +// 45: 'Insert', +// 46: 'Del', +// 144: 'NumLock', +// }; +// var KEY_TO_MQ_KEY_STEM = { +// ArrowRight: 'Right', +// ArrowLeft: 'Left', +// ArrowDown: 'Down', +// ArrowUp: 'Up', +// Delete: 'Del', +// Escape: 'Esc', +// ' ': 'Spacebar', +// }; +// function isArrowKey(e) { +// // The keyPress event in FF reports which=0 for some reason. The new +// // .key property seems to report reasonable results, so we're using that +// switch (getMQKeyStem(e)) { +// case 'Right': +// case 'Left': +// case 'Down': +// case 'Up': +// return true; +// } +// return false; +// } +// function isLowercaseAlphaCharacter(s) { +// return s.length === 1 && s >= 'a' && s <= 'z'; +// } +// function getMQKeyStem(evt) { +// var _c; +// // Translate browser key names to MQ's internal naming system +// // +// // Ref: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values +// if (evt.key === undefined) { +// var which = evt.which || evt.keyCode; +// return WHICH_TO_MQ_KEY_STEM[which] || String.fromCharCode(which); +// } +// if (isLowercaseAlphaCharacter(evt.key)) return evt.key.toUpperCase(); +// return (_c = KEY_TO_MQ_KEY_STEM[evt.key]) !== null && _c !== void 0 ? _c : evt.key; +// } +// /** To the extent possible, create a normalized string representation +// * of the key combo (i.e., key code and modifier keys). */ +// function getMQKeyName(evt) { +// var key = getMQKeyStem(evt); +// var modifiers = []; +// if (evt.ctrlKey) modifiers.push('Ctrl'); +// if (evt.metaKey) modifiers.push('Meta'); +// if (evt.altKey) modifiers.push('Alt'); +// if (evt.shiftKey) modifiers.push('Shift'); +// if (!modifiers.length) return key; +// modifiers.push(key); +// return modifiers.join('-'); +// } +// return function saneKeyboardEvents( +// /** Usually the textarea associated with a MQ instance, but can be another kind of element if `substituteTextarea` was used to replace it with something else. */ +// textarea, +// controller +// ) { +// var keydown = null; +// var keypress = null; +// // everyTick.listen() is called after key or clipboard events to +// // say "Hey, I think something was just typed" or "pasted" etc, +// // so that at all subsequent opportune times (next event or timeout), +// // will check for expected typed or pasted text. +// // Need to check repeatedly because #135: in Safari 5.1 (at least), +// // after selecting something and then typing, the textarea is +// // incorrectly reported as selected during the input event (but not +// // subsequently). +// var everyTick = new EveryTick(); +// function guardedTextareaSelect() { +// try { +// // IE can throw an 'Incorrect Function' error if you +// // try to select a textarea that is hidden. It seems +// // likely that we don't really care if the selection +// // fails to happen in this case. Why would the textarea +// // be hidden? And who would even be able to tell? +// if (textarea instanceof HTMLTextAreaElement) textarea.select(); +// } catch (e) {} +// } +// // -*- public methods -*- // +// function select(text) { +// // check textarea at least once/one last time before munging (so +// // no race condition if selection happens after keypress/paste but +// // before checkTextarea), then never again ('cos it's been munged) +// everyTick.trigger(); +// everyTick.clearListener(); +// if (textarea instanceof HTMLTextAreaElement) textarea.value = text; +// if (text) guardedTextareaSelect(); +// shouldBeSelected = !!text; +// } +// var shouldBeSelected = false; +// // -*- helper subroutines -*- // +// // Determine whether there's a selection in the textarea. +// // This will always return false in IE < 9, which don't support +// // HTMLTextareaElement::selection{Start,End}. +// function hasSelection() { +// if (!('selectionStart' in textarea)) return false; +// if (!(textarea instanceof HTMLTextAreaElement)) return false; +// return textarea.selectionStart !== textarea.selectionEnd; +// } +// function handleKey() { +// if (controller.options && controller.options.overrideKeystroke) { +// controller.options.overrideKeystroke(getMQKeyName(keydown), keydown); +// } else { +// controller.keystroke(getMQKeyName(keydown), keydown); +// } +// } +// // -*- event handlers -*- // +// function onKeydown(e) { +// everyTick.trigger(e); +// if (e.target !== textarea) return; +// keydown = e; +// keypress = null; +// if (shouldBeSelected) +// everyTick.listenOnce(function (e) { +// if (!(e && e.type === 'focusout')) { +// // re-select textarea in case it's an unrecognized key that clears +// // the selection, then never again, 'cos next thing might be blur +// guardedTextareaSelect(); +// } +// }); +// handleKey(); +// } +// function onKeypress(e) { +// everyTick.trigger(e); +// if (e.target !== textarea) return; +// // call the key handler for repeated keypresses. +// // This excludes keypresses that happen directly +// // after keydown. In that case, there will be +// // no previous keypress, so we skip it here +// if (keydown && keypress) handleKey(); +// keypress = e; +// // only check for typed text if this key can type text. Otherwise +// // you can end up with mathquill thinking text was typed if you +// // use the mq.keystroke('Right') command while a single character +// // is selected. Only detected in FF. +// if (!isArrowKey(e)) { +// everyTick.listen(typedText); +// } else { +// everyTick.listenOnce(maybeReselect); +// } +// } +// function onKeyup(e) { +// everyTick.trigger(e); +// if (e.target !== textarea) return; +// // Handle case of no keypress event being sent +// if (!!keydown && !keypress) { +// // only check for typed text if this key can type text. Otherwise +// // you can end up with mathquill thinking text was typed if you +// // use the mq.keystroke('Right') command while a single character +// // is selected. Only detected in FF. +// if (!isArrowKey(e)) { +// everyTick.listen(typedText); +// } else { +// everyTick.listenOnce(maybeReselect); +// } +// } +// } +// function typedText() { +// // If there is a selection, the contents of the textarea couldn't +// // possibly have just been typed in. +// // This happens in browsers like Firefox and Opera that fire +// // keypress for keystrokes that are not text entry and leave the +// // selection in the textarea alone, such as Ctrl-C. +// // Note: we assume that browsers that don't support hasSelection() +// // also never fire keypress on keystrokes that are not text entry. +// // This seems reasonably safe because: +// // - all modern browsers including IE 9+ support hasSelection(), +// // making it extremely unlikely any browser besides IE < 9 won't +// // - as far as we know IE < 9 never fires keypress on keystrokes +// // that aren't text entry, which is only as reliable as our +// // tests are comprehensive, but the IE < 9 way to do +// // hasSelection() is poorly documented and is also only as +// // reliable as our tests are comprehensive +// // If anything like #40 or #71 is reported in IE < 9, see +// // b1318e5349160b665003e36d4eedd64101ceacd8 +// if (hasSelection()) return; +// if (!(textarea instanceof HTMLTextAreaElement)) return; +// var text = textarea.value; +// if (text.length === 1) { +// textarea.value = ''; +// if (controller.options && controller.options.overrideTypedText) { +// controller.options.overrideTypedText(text); +// } else { +// controller.typedText(text); +// } +// } // in Firefox, keys that don't type text, just clear seln, fire keypress +// // https://github.com/mathquill/mathquill/issues/293#issuecomment-40997668 +// else maybeReselect(); // re-select if that's why we're here +// } +// function maybeReselect() { +// if (!(textarea instanceof HTMLTextAreaElement)) return; +// if (textarea.value.length > 1) { +// guardedTextareaSelect(); +// } +// } +// function onBlur() { +// keydown = null; +// keypress = null; +// everyTick.clearListener(); +// if (textarea instanceof HTMLTextAreaElement) textarea.value = ''; +// } +// function onPaste(e) { +// everyTick.trigger(); +// if (e.target !== textarea) return; +// // browsers are dumb. +// // +// // In Linux, middle-click pasting causes onPaste to be called, +// // when the textarea is not necessarily focused. We focus it +// // here to ensure that the pasted text actually ends up in the +// // textarea. +// // +// // It's pretty nifty that by changing focus in this handler, +// // we can change the target of the default action. (This works +// // on keydown too, FWIW). +// // +// // And by nifty, we mean dumb (but useful sometimes). +// if (document.activeElement !== textarea) { +// textarea.focus(); +// } +// everyTick.listen(function pastedText() { +// if (!(textarea instanceof HTMLTextAreaElement)) return; +// var text = textarea.value; +// textarea.value = ''; +// if (text) controller.paste(text); +// }); +// } +// function onInput(e) { +// everyTick.trigger(e); +// } +// if (controller.options && controller.options.disableCopyPaste) { +// controller.addTextareaEventListeners({ +// keydown: onKeydown, +// keypress: onKeypress, +// keyup: onKeyup, +// focusout: onBlur, +// copy: function (e) { +// e.preventDefault(); +// }, +// cut: function (e) { +// e.preventDefault(); +// }, +// paste: function (e) { +// everyTick.trigger(); +// e.preventDefault(); +// }, +// input: onInput, +// }); +// } else { +// controller.addTextareaEventListeners({ +// keydown: onKeydown, +// keypress: onKeypress, +// keyup: onKeyup, +// focusout: onBlur, +// cut: function () { +// everyTick.listenOnce(function () { +// controller.cut(); +// }); +// }, +// copy: function () { +// everyTick.listenOnce(function () { +// controller.copy(); +// }); +// }, +// paste: onPaste, +// input: onInput, +// }); +// } +// // -*- export public methods -*- // +// return { select: select }; +// }; +// })(); +// /*********************************************** +// * Export math in a human-readable text format +// * As you can see, only half-baked so far. +// **********************************************/ +// var Controller_exportText = /** @class */ (function (_super) { +// __extends(Controller_exportText, _super); +// function Controller_exportText() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// Controller_exportText.prototype.exportText = function () { +// return this.root.foldChildren('', function (text, child) { +// return text + child.text(); +// }); +// }; +// return Controller_exportText; +// })(ControllerBase); +// ControllerBase.onNotify(function (cursor, e) { +// // these try to cover all ways that mathquill can be modified +// if (e === 'edit' || e === 'replace' || e === undefined) { +// var controller = cursor.controller; +// if (!controller) return; +// if (!controller.options.enableDigitGrouping) return; +// // TODO - maybe reconsider these 3 states and drop down to only 2 +// // +// // blurred === false means we are focused. blurred === true or +// // blurred === undefined means we are not focused. +// if (controller.blurred !== false) return; +// controller.disableGroupingForSeconds(1); +// } +// }); +// var Controller_focusBlur = /** @class */ (function (_super) { +// __extends(Controller_focusBlur, _super); +// function Controller_focusBlur() { +// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; +// _this_1.handleTextareaFocusEditable = function () { +// var cursor = _this_1.cursor; +// _this_1.updateMathspeak(); +// _this_1.blurred = false; +// clearTimeout(_this_1.blurTimeout); +// domFrag(_this_1.container).addClass('dcg-mq-focused'); +// if (!cursor.parent) cursor.insAtRightEnd(_this_1.root); +// if (cursor.selection) { +// cursor.selection.domFrag().removeClass('dcg-mq-blur'); +// _this_1.selectionChanged(); //re-select textarea contents after tabbing away and back +// } else { +// cursor.show(); +// } +// _this_1.setOverflowClasses(); +// }; +// _this_1.handleTextareaBlurEditable = function () { +// if (_this_1.textareaSelectionTimeout) { +// clearTimeout(_this_1.textareaSelectionTimeout); +// _this_1.textareaSelectionTimeout = 0; +// } +// _this_1.disableGroupingForSeconds(0); +// _this_1.blurred = true; +// _this_1.blurTimeout = setTimeout(function () { +// // wait for blur on window; if +// _this_1.root.postOrder(function (node) { +// node.intentionalBlur(); +// }); // none, intentional blur: #264 +// _this_1.cursor.clearSelection().endSelection(); +// _this_1.blur(); +// _this_1.updateMathspeak(); +// _this_1.scrollHoriz(); +// }); +// window.addEventListener('blur', _this_1.handleWindowBlur); +// }; +// _this_1.handleTextareaFocusStatic = function () { +// _this_1.blurred = false; +// }; +// _this_1.handleTextareaBlurStatic = function () { +// if (_this_1.cursor.selection) { +// _this_1.cursor.selection.clear(); +// } +// //detaching during blur explodes in WebKit +// setTimeout(function () { +// domFrag(_this_1.getTextareaSpanOrThrow()).detach(); +// _this_1.blurred = true; +// }); +// }; +// _this_1.handleWindowBlur = function () { +// // blur event also fired on window, just switching +// clearTimeout(_this_1.blurTimeout); // tabs/windows, not intentional blur +// if (_this_1.cursor.selection) _this_1.cursor.selection.domFrag().addClass('dcg-mq-blur'); +// _this_1.blur(); +// _this_1.updateMathspeak(); +// }; +// return _this_1; +// } +// Controller_focusBlur.prototype.disableGroupingForSeconds = function (seconds) { +// var _this_1 = this; +// clearTimeout(this.__disableGroupingTimeout); +// if (seconds === 0) { +// this.root.domFrag().removeClass('dcg-mq-suppress-grouping'); +// } else { +// this.root.domFrag().addClass('dcg-mq-suppress-grouping'); +// this.__disableGroupingTimeout = setTimeout(function () { +// _this_1.root.domFrag().removeClass('dcg-mq-suppress-grouping'); +// }, seconds * 1000); +// } +// }; +// Controller_focusBlur.prototype.blur = function () { +// // not directly in the textarea blur handler so as to be +// this.cursor.hide().parent.blur(this.cursor); // synchronous with/in the same frame as +// domFrag(this.container).removeClass('dcg-mq-focused'); // clearing/blurring selection +// window.removeEventListener('blur', this.handleWindowBlur); +// if (this.options && this.options.resetCursorOnBlur) { +// this.cursor.resetToEnd(this); +// } +// }; +// Controller_focusBlur.prototype.addEditableFocusBlurListeners = function () { +// var ctrlr = this, +// cursor = ctrlr.cursor; +// this.addTextareaEventListeners({ +// focus: this.handleTextareaFocusEditable, +// blur: this.handleTextareaBlurEditable, +// }); +// ctrlr.blurred = true; +// cursor.hide().parent.blur(cursor); +// }; +// Controller_focusBlur.prototype.addStaticFocusBlurListeners = function () { +// this.addTextareaEventListeners({ +// focus: this.handleTextareaFocusStatic, +// blur: this.handleTextareaBlurStatic, +// }); +// }; +// return Controller_focusBlur; +// })(Controller_exportText); +// /** +// * TODO: I wanted to move MathBlock::focus and blur here, it would clean +// * up lots of stuff like, TextBlock::focus is set to MathBlock::focus +// * and TextBlock::blur calls MathBlock::blur, when instead they could +// * use inheritance and super_. +// * +// * Problem is, there's lots of calls to .focus()/.blur() on nodes +// * outside Controller::focusBlurEvents(), such as .postOrder('blur') on +// * insertion, which if MathBlock::blur becomes MQNode::blur, would add the +// * 'blur' CSS class to all MQSymbol's (because .isEmpty() is true for all +// * of them). +// * +// * I'm not even sure there aren't other troublesome calls to .focus() or +// * .blur(), so this is TODO for now. +// */ +// /***************************************** +// * Deals with the browser DOM events from +// * interaction with the typist. +// ****************************************/ +// /** +// * Only one incremental selection may be open at a time. Track whether +// * an incremental selection is open to help enforce this invariant. +// */ +// var INCREMENTAL_SELECTION_OPEN = false; +// var MQNode = /** @class */ (function (_super) { +// __extends(MQNode, _super); +// function MQNode() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// MQNode.prototype.keystroke = function (key, e, ctrlr) { +// var cursor = ctrlr.cursor; +// switch (key) { +// case 'Ctrl-Shift-Backspace': +// case 'Ctrl-Backspace': +// ctrlr.ctrlDeleteDir(L); +// break; +// case 'Shift-Backspace': +// case 'Backspace': +// ctrlr.backspace(); +// break; +// // Tab or Esc -> go one block right if it exists, else escape right. +// case 'Esc': +// case 'Tab': +// ctrlr.escapeDir(R, key, e); +// return; +// // Shift-Tab -> go one block left if it exists, else escape left. +// case 'Shift-Tab': +// case 'Shift-Esc': +// ctrlr.escapeDir(L, key, e); +// return; +// // End -> move to the end of the current block. +// case 'End': +// ctrlr.notify('move').cursor.insAtRightEnd(cursor.parent); +// ctrlr.aria.queue('end of').queue(cursor.parent, true); +// break; +// // Ctrl-End -> move all the way to the end of the root block. +// case 'Ctrl-End': +// ctrlr.notify('move').cursor.insAtRightEnd(ctrlr.root); +// ctrlr.aria.queue('end of').queue(ctrlr.ariaLabel).queue(ctrlr.root).queue(ctrlr.ariaPostLabel); +// break; +// // Shift-End -> select to the end of the current block. +// case 'Shift-End': +// ctrlr.selectToBlockEndInDir(R); +// break; +// // Ctrl-Shift-End -> select all the way to the end of the root block. +// case 'Ctrl-Shift-End': +// ctrlr.selectToRootEndInDir(R); +// break; +// // Home -> move to the start of the current block. +// case 'Home': +// ctrlr.notify('move').cursor.insAtLeftEnd(cursor.parent); +// ctrlr.aria.queue('beginning of').queue(cursor.parent, true); +// break; +// // Ctrl-Home -> move all the way to the start of the root block. +// case 'Ctrl-Home': +// ctrlr.notify('move').cursor.insAtLeftEnd(ctrlr.root); +// ctrlr.aria +// .queue('beginning of') +// .queue(ctrlr.ariaLabel) +// .queue(ctrlr.root) +// .queue(ctrlr.ariaPostLabel); +// break; +// // Shift-Home -> select to the start of the current block. +// case 'Shift-Home': +// ctrlr.selectToBlockEndInDir(L); +// break; +// // Ctrl-Shift-Home -> select all the way to the start of the root block. +// case 'Ctrl-Shift-Home': +// ctrlr.selectToRootEndInDir(L); +// break; +// case 'Left': +// ctrlr.moveLeft(); +// break; +// case 'Shift-Left': +// ctrlr.selectLeft(); +// break; +// case 'Ctrl-Left': +// break; +// case 'Right': +// ctrlr.moveRight(); +// break; +// case 'Shift-Right': +// ctrlr.selectRight(); +// break; +// case 'Ctrl-Right': +// break; +// case 'Up': +// ctrlr.moveUp(); +// break; +// case 'Down': +// ctrlr.moveDown(); +// break; +// case 'Shift-Up': +// ctrlr.withIncrementalSelection(function (selectDir) { +// if (cursor[L]) { +// while (cursor[L]) selectDir(L); +// } else { +// selectDir(L); +// } +// }); +// break; +// case 'Shift-Down': +// ctrlr.withIncrementalSelection(function (selectDir) { +// if (cursor[R]) { +// while (cursor[R]) selectDir(R); +// } else { +// selectDir(R); +// } +// }); +// break; +// case 'Ctrl-Up': +// break; +// case 'Ctrl-Down': +// break; +// case 'Ctrl-Shift-Del': +// case 'Ctrl-Del': +// ctrlr.ctrlDeleteDir(R); +// break; +// case 'Shift-Del': +// case 'Del': +// ctrlr.deleteForward(); +// break; +// case 'Meta-A': +// case 'Ctrl-A': +// ctrlr.selectAll(); +// break; +// // These remaining hotkeys are only of benefit to people running screen readers. +// case 'Ctrl-Alt-Up': // speak parent block that has focus +// if (cursor.parent.parent && cursor.parent.parent instanceof MQNode) +// ctrlr.aria.queue(cursor.parent.parent); +// else ctrlr.aria.queue('nothing above'); +// break; +// case 'Ctrl-Alt-Down': // speak current block that has focus +// if (cursor.parent && cursor.parent instanceof MQNode) ctrlr.aria.queue(cursor.parent); +// else ctrlr.aria.queue('block is empty'); +// break; +// case 'Ctrl-Alt-Left': // speak left-adjacent block +// if (cursor.parent.parent && cursor.parent.parent.getEnd(L)) { +// ctrlr.aria.queue(cursor.parent.parent.getEnd(L)); +// } else { +// ctrlr.aria.queue('nothing to the left'); +// } +// break; +// case 'Ctrl-Alt-Right': // speak right-adjacent block +// if (cursor.parent.parent && cursor.parent.parent.getEnd(R)) { +// ctrlr.aria.queue(cursor.parent.parent.getEnd(R)); +// } else { +// ctrlr.aria.queue('nothing to the right'); +// } +// break; +// case 'Ctrl-Alt-Shift-Down': // speak selection +// if (cursor.selection) +// ctrlr.aria.queue(cursor.selection.join('mathspeak', ' ').trim() + ' selected'); +// else ctrlr.aria.queue('nothing selected'); +// break; +// case 'Ctrl-Alt-=': +// case 'Ctrl-Alt-Shift-Right': // speak ARIA post label (evaluation or error) +// if (ctrlr.ariaPostLabel.length) ctrlr.aria.queue(ctrlr.ariaPostLabel); +// else ctrlr.aria.queue('no answer'); +// break; +// default: +// return; +// } +// ctrlr.aria.alert(); +// e === null || e === void 0 ? void 0 : e.preventDefault(); +// ctrlr.scrollHoriz(); +// }; +// MQNode.prototype.moveOutOf = function (_dir, _cursor, _updown) { +// pray('overridden or never called on this node', false); +// }; // called by Controller::escapeDir, moveDir +// MQNode.prototype.moveTowards = function (_dir, _cursor, _updown) { +// pray('overridden or never called on this node', false); +// }; // called by Controller::moveDir +// MQNode.prototype.deleteOutOf = function (_dir, _cursor) { +// pray('overridden or never called on this node', false); +// }; // called by Controller::deleteDir +// MQNode.prototype.deleteTowards = function (_dir, _cursor) { +// pray('overridden or never called on this node', false); +// }; // called by Controller::deleteDir +// MQNode.prototype.unselectInto = function (_dir, _cursor) { +// pray('overridden or never called on this node', false); +// }; // called by Controller::selectDir +// MQNode.prototype.selectOutOf = function (_dir, _cursor) { +// pray('overridden or never called on this node', false); +// }; // called by Controller::selectDir +// MQNode.prototype.selectTowards = function (_dir, _cursor) { +// pray('overridden or never called on this node', false); +// }; // called by Controller::selectDir +// return MQNode; +// })(NodeBase); +// ControllerBase.onNotify(function (cursor, e) { +// if (e === 'move' || e === 'upDown') cursor.show().clearSelection(); +// }); +// baseOptionProcessors.leftRightIntoCmdGoes = function (updown) { +// if (updown && updown !== 'up' && updown !== 'down') { +// throw '"up" or "down" required for leftRightIntoCmdGoes option, ' + 'got "' + updown + '"'; +// } +// return updown; +// }; +// ControllerBase.onNotify(function (cursor, e) { +// if (e !== 'upDown') cursor.upDownCache = {}; +// }); +// ControllerBase.onNotify(function (cursor, e) { +// if (e === 'edit') cursor.show().deleteSelection(); +// }); +// ControllerBase.onNotify(function (cursor, e) { +// if (e !== 'select') cursor.endSelection(); +// }); +// var Controller_keystroke = /** @class */ (function (_super) { +// __extends(Controller_keystroke, _super); +// function Controller_keystroke() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// Controller_keystroke.prototype.keystroke = function (key, evt) { +// this.cursor.parent.keystroke(key, evt, this.getControllerSelf()); +// }; +// Controller_keystroke.prototype.escapeDir = function (dir, _key, e) { +// prayDirection(dir); +// var cursor = this.cursor; +// // only prevent default of Tab if not in the root editable +// if (cursor.parent !== this.root) e === null || e === void 0 ? void 0 : e.preventDefault(); +// // want to be a noop if in the root editable (in fact, Tab has an unrelated +// // default browser action if so) +// if (cursor.parent === this.root) return; +// cursor.clearSelection(); +// cursor.parent.moveOutOf(dir, cursor); +// cursor.controller.aria.alert(); +// return this.notify('move'); +// }; +// Controller_keystroke.prototype.moveDir = function (dir) { +// prayDirection(dir); +// var cursor = this.cursor, +// updown = cursor.options.leftRightIntoCmdGoes; +// var cursorDir = cursor[dir]; +// if (cursor.selection) { +// cursor.insDirOf(dir, cursor.selection.getEnd(dir)); +// } else if (cursorDir) cursorDir.moveTowards(dir, cursor, updown); +// else cursor.parent.moveOutOf(dir, cursor, updown); +// return this.notify('move'); +// }; +// Controller_keystroke.prototype.moveLeft = function () { +// return this.moveDir(L); +// }; +// Controller_keystroke.prototype.moveRight = function () { +// return this.moveDir(R); +// }; +// /** +// * moveUp and moveDown have almost identical algorithms: +// * - first check left and right, if so insAtLeft/RightEnd of them +// * - else check the parent's 'upOutOf'/'downOutOf' property: +// * + if it's a function, call it with the cursor as the sole argument and +// * use the return value as if it were the value of the property +// * + if it's a Node, jump up or down into it: +// * - if there is a cached Point in the block, insert there +// * - else, seekHoriz within the block to the current x-coordinate (to be +// * as close to directly above/below the current position as possible) +// * + unless it's exactly `true`, stop bubbling +// */ +// Controller_keystroke.prototype.moveUp = function () { +// return this.moveUpDown('up'); +// }; +// Controller_keystroke.prototype.moveDown = function () { +// return this.moveUpDown('down'); +// }; +// Controller_keystroke.prototype.moveUpDown = function (dir) { +// var self = this; +// var cursor = self.notify('upDown').cursor; +// var dirInto; +// var dirOutOf; +// if (dir === 'up') { +// dirInto = 'upInto'; +// dirOutOf = 'upOutOf'; +// } else { +// dirInto = 'downInto'; +// dirOutOf = 'downOutOf'; +// } +// var cursorL = cursor[L]; +// var cursorR = cursor[R]; +// var cursorR_dirInto = cursorR && cursorR[dirInto]; +// var cursorL_dirInto = cursorL && cursorL[dirInto]; +// if (cursorR_dirInto) cursor.insAtLeftEnd(cursorR_dirInto); +// else if (cursorL_dirInto) cursor.insAtRightEnd(cursorL_dirInto); +// else { +// cursor.parent.bubble(function (ancestor) { +// // TODO - revist this +// var prop = ancestor[dirOutOf]; +// if (prop) { +// if (typeof prop === 'function') prop = prop.call(ancestor, cursor); // TODO - figure out if we need to assign to prop +// if (prop instanceof MQNode) cursor.jumpUpDown(ancestor, prop); +// if (prop !== true) return false; // TODO - figure out how this can return true +// } +// return undefined; +// }); +// } +// return self; +// }; +// Controller_keystroke.prototype.deleteDir = function (dir) { +// prayDirection(dir); +// var cursor = this.cursor; +// var cursorEl = cursor[dir]; +// var cursorElParent = cursor.parent.parent; +// var ctrlr = cursor.controller; +// if (cursorEl && cursorEl instanceof MQNode) { +// if (cursorEl.sides) { +// ctrlr.aria.queue( +// cursorEl.parent.chToCmd(cursorEl.sides[-dir].ch).mathspeak({ createdLeftOf: cursor }) +// ); +// // generally, speak the current element if it has no blocks, +// // but don't for text block commands as the deleteTowards method +// // in the TextCommand class is responsible for speaking the new character under the cursor. +// } else if (!cursorEl.blocks && cursorEl.parent.ctrlSeq !== '\\text') { +// ctrlr.aria.queue(cursorEl); +// } +// } else if (cursorElParent && cursorElParent instanceof MQNode) { +// if (cursorElParent.sides) { +// ctrlr.aria.queue( +// cursorElParent.parent +// .chToCmd(cursorElParent.sides[dir].ch) +// .mathspeak({ createdLeftOf: cursor }) +// ); +// } else if (cursorElParent.blocks && cursorElParent.mathspeakTemplate) { +// if (cursorElParent.upInto && cursorElParent.downInto) { +// // likely a fraction, and we just backspaced over the slash +// ctrlr.aria.queue(cursorElParent.mathspeakTemplate[1]); +// } else { +// var mst = cursorElParent.mathspeakTemplate; +// var textToQueue = dir === L ? mst[0] : mst[mst.length - 1]; +// ctrlr.aria.queue(textToQueue); +// } +// } else { +// ctrlr.aria.queue(cursorElParent); +// } +// } +// var hadSelection = cursor.selection; +// this.notify('edit'); // deletes selection if present +// if (!hadSelection) { +// var cursorDir = cursor[dir]; +// if (cursorDir) cursorDir.deleteTowards(dir, cursor); +// else cursor.parent.deleteOutOf(dir, cursor); +// } +// var cursorL = cursor[L]; +// var cursorR = cursor[R]; +// if (cursorL.siblingDeleted) cursorL.siblingDeleted(cursor.options, R); +// if (cursorR.siblingDeleted) cursorR.siblingDeleted(cursor.options, L); +// cursor.parent.bubble(function (node) { +// node.reflow(); +// return undefined; +// }); +// return this; +// }; +// Controller_keystroke.prototype.ctrlDeleteDir = function (dir) { +// prayDirection(dir); +// var cursor = this.cursor; +// if (!cursor[dir] || cursor.selection) return this.deleteDir(dir); +// this.notify('edit'); +// var fragRemoved; +// if (dir === L) { +// fragRemoved = new Fragment(cursor.parent.getEnd(L), cursor[L]); +// } else { +// fragRemoved = new Fragment(cursor[R], cursor.parent.getEnd(R)); +// } +// cursor.controller.aria.queue(fragRemoved); +// fragRemoved.remove(); +// cursor.insAtDirEnd(dir, cursor.parent); +// var cursorL = cursor[L]; +// var cursorR = cursor[R]; +// if (cursorL) cursorL.siblingDeleted(cursor.options, R); +// if (cursorR) cursorR.siblingDeleted(cursor.options, L); +// cursor.parent.bubble(function (node) { +// node.reflow(); +// return undefined; +// }); +// return this; +// }; +// Controller_keystroke.prototype.backspace = function () { +// return this.deleteDir(L); +// }; +// Controller_keystroke.prototype.deleteForward = function () { +// return this.deleteDir(R); +// }; +// /** +// * startIncrementalSelection, selectDirIncremental, and finishIncrementalSelection +// * should only be called by withIncrementalSelection because they must +// * be called in sequence. +// */ +// Controller_keystroke.prototype.startIncrementalSelection = function () { +// pray("Multiple selections can't be simultaneously open", !INCREMENTAL_SELECTION_OPEN); +// INCREMENTAL_SELECTION_OPEN = true; +// this.notify('select'); +// var cursor = this.cursor; +// if (!cursor.anticursor) cursor.startSelection(); +// }; +// /** +// * Update the selection model, stored in cursor, without modifying +// * selection DOM. +// * +// * startIncrementalSelection, selectDirIncremental, and finishIncrementalSelection +// * should only be called by withIncrementalSelection because they must +// * be called in sequence. +// */ +// Controller_keystroke.prototype.selectDirIncremental = function (dir) { +// pray('A selection is open', INCREMENTAL_SELECTION_OPEN); +// INCREMENTAL_SELECTION_OPEN = true; +// var cursor = this.cursor, +// seln = cursor.selection; +// prayDirection(dir); +// var node = cursor[dir]; +// if (node) { +// // "if node we're selecting towards is inside selection (hence retracting) +// // and is on the *far side* of the selection (hence is only node selected) +// // and the anticursor is *inside* that node, not just on the other side" +// if (seln && seln.getEnd(dir) === node && cursor.anticursor[-dir] !== node) { +// node.unselectInto(dir, cursor); +// } else node.selectTowards(dir, cursor); +// } else cursor.parent.selectOutOf(dir, cursor); +// }; +// /** +// * Update selection DOM to match cursor model +// * +// * startIncrementalSelection, selectDirIncremental, and finishIncrementalSelection +// * should only be called by withIncrementalSelection because they must +// * be called in sequence. +// */ +// Controller_keystroke.prototype.finishIncrementalSelection = function () { +// pray('A selection is open', INCREMENTAL_SELECTION_OPEN); +// var cursor = this.cursor; +// cursor.clearSelection(); +// cursor.select() || cursor.show(); +// var selection = cursor.selection; +// if (selection) { +// cursor.controller.aria.clear().queue(selection.join('mathspeak', ' ').trim() + ' selected'); // clearing first because selection fires several times, and we don't want repeated speech. +// } +// INCREMENTAL_SELECTION_OPEN = false; +// }; +// /** +// * Used to build a selection incrementally in a loop. Calls the passed +// * callback with a selectDir function that may be called many times, +// * and defers updating the view until the incremental selection is +// * complete +// * +// * Wraps up calling +// * +// * this.startSelection() +// * this.selectDirIncremental(dir) // possibly many times +// * this.finishSelection() +// * +// * with extra error handling and invariant enforcement +// */ +// Controller_keystroke.prototype.withIncrementalSelection = function (cb) { +// var _this_1 = this; +// try { +// this.startIncrementalSelection(); +// try { +// cb(function (dir) { +// return _this_1.selectDirIncremental(dir); +// }); +// } finally { +// // Since we have started a selection, attempt to finish it even +// // if the callback throws an error +// this.finishIncrementalSelection(); +// } +// } finally { +// // Mark selection as closed even if finishSelection throws an +// // error. Makes a possible error in finishSelection more +// // recoverable +// INCREMENTAL_SELECTION_OPEN = false; +// } +// }; +// /** +// * Grow selection one unit in the given direction +// * +// * Note, this should not be called in a loop. To incrementally grow a +// * selection, use withIncrementalSelection +// */ +// Controller_keystroke.prototype.selectDir = function (dir) { +// this.withIncrementalSelection(function (selectDir) { +// return selectDir(dir); +// }); +// }; +// Controller_keystroke.prototype.selectLeft = function () { +// return this.selectDir(L); +// }; +// Controller_keystroke.prototype.selectRight = function () { +// return this.selectDir(R); +// }; +// Controller_keystroke.prototype.selectAll = function () { +// this.notify('move'); +// var cursor = this.cursor; +// cursor.insAtRightEnd(this.root); +// this.withIncrementalSelection(function (selectDir) { +// while (cursor[L]) selectDir(L); +// }); +// }; +// Controller_keystroke.prototype.selectToBlockEndInDir = function (dir) { +// var cursor = this.cursor; +// this.withIncrementalSelection(function (selectDir) { +// while (cursor[dir]) selectDir(dir); +// }); +// }; +// Controller_keystroke.prototype.selectToRootEndInDir = function (dir) { +// var _this_1 = this; +// var cursor = this.cursor; +// this.withIncrementalSelection(function (selectDir) { +// while (cursor[dir] || cursor.parent !== _this_1.root) { +// selectDir(dir); +// } +// }); +// }; +// return Controller_keystroke; +// })(Controller_focusBlur); +// var TempSingleCharNode = /** @class */ (function (_super) { +// __extends(TempSingleCharNode, _super); +// function TempSingleCharNode(_char) { +// return _super.call(this) || this; +// } +// return TempSingleCharNode; +// })(MQNode); +// // Parser MathBlock +// var latexMathParser = (function () { +// function commandToBlock(cmd) { +// // can also take in a Fragment +// var block = new MathBlock(); +// cmd.adopt(block, 0, 0); +// return block; +// } +// function joinBlocks(blocks) { +// var firstBlock = blocks[0] || new MathBlock(); +// for (var i = 1; i < blocks.length; i += 1) { +// blocks[i].children().adopt(firstBlock, firstBlock.getEnd(R), 0); +// } +// return firstBlock; +// } +// var string = Parser.string; +// var regex = Parser.regex; +// var letter = Parser.letter; +// var digit = Parser.digit; +// var any = Parser.any; +// var optWhitespace = Parser.optWhitespace; +// var succeed = Parser.succeed; +// var fail = Parser.fail; +// // Parsers yielding either MathCommands, or Fragments of MathCommands +// // (either way, something that can be adopted by a MathBlock) +// var variable = letter.map(function (c) { +// return new Letter(c); +// }); +// var number = digit.map(function (c) { +// return new Digit(c); +// }); +// var symbol = regex(/^[^${}\\_^]/).map(function (c) { +// return new VanillaSymbol(c); +// }); +// var controlSequence = regex(/^[^\\a-eg-zA-Z]/) // hotfix #164; match MathBlock::write +// .or( +// string('\\').then( +// regex(/^[a-z]+/i) +// .or(regex(/^\s+/).result(' ')) +// .or(any) +// ) +// ) +// .then(function (ctrlSeq) { +// // TODO - is Parser correct? +// var cmdKlass = LatexCmds[ctrlSeq]; +// if (cmdKlass) { +// if (cmdKlass.constructor) { +// var actualClass = cmdKlass; // TODO - figure out how to know the difference +// return new actualClass(ctrlSeq).parser(); +// } else { +// var builder = cmdKlass; // TODO - figure out how to know the difference +// return builder(ctrlSeq).parser(); +// } +// } else { +// return fail('unknown command: \\' + ctrlSeq); +// } +// }); +// var command = controlSequence.or(variable).or(number).or(symbol); +// // Parsers yielding MathBlocks +// var mathGroup = string('{') +// .then(function () { +// return mathSequence; +// }) +// .skip(string('}')); +// var mathBlock = optWhitespace.then(mathGroup.or(command.map(commandToBlock))); +// var mathSequence = mathBlock.many().map(joinBlocks).skip(optWhitespace); +// var optMathBlock = string('[') +// .then( +// mathBlock +// .then(function (block) { +// return block.join('latex') !== ']' ? succeed(block) : fail(''); +// }) +// .many() +// .map(joinBlocks) +// .skip(optWhitespace) +// ) +// .skip(string(']')); +// var latexMath = mathSequence; +// latexMath.block = mathBlock; +// latexMath.optBlock = optMathBlock; +// return latexMath; +// })(); +// baseOptionProcessors.maxDepth = function (depth) { +// return typeof depth === 'number' ? depth : undefined; +// }; +// var Controller_latex = /** @class */ (function (_super) { +// __extends(Controller_latex, _super); +// function Controller_latex() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// Controller_latex.prototype.cleanLatex = function (latex) { +// //prune unnecessary spaces +// return latex.replace(/(\\[a-z]+) (?![a-z])/gi, '$1'); +// }; +// Controller_latex.prototype.exportLatex = function () { +// return this.cleanLatex(this.root.latex()); +// }; +// Controller_latex.prototype.writeLatex = function (latex) { +// var cursor = this.notify('edit').cursor; +// cursor.parent.writeLatex(cursor, latex); +// return this; +// }; +// Controller_latex.prototype.exportLatexSelection = function () { +// var ctx = { +// latex: '', +// startIndex: -1, +// endIndex: -1, +// }; +// var selection = this.cursor.selection; +// if (selection) { +// ctx.startSelectionBefore = selection.getEnd(L); +// ctx.endSelectionAfter = selection.getEnd(R); +// } else { +// var cursorL = this.cursor[L]; +// if (cursorL) { +// ctx.startSelectionAfter = cursorL; +// } else { +// ctx.startSelectionBefore = this.cursor.parent; +// } +// var cursorR = this.cursor[R]; +// if (cursorR) { +// ctx.endSelectionBefore = cursorR; +// } else { +// ctx.endSelectionAfter = this.cursor.parent; +// } +// } +// this.root.latexRecursive(ctx); +// // need to clean the latex +// var originalLatex = ctx.latex; +// var cleanLatex = this.cleanLatex(originalLatex); +// var startIndex = ctx.startIndex; +// var endIndex = ctx.endIndex; +// // assumes that the cleaning process will only remove characters. We +// // run through the originalLatex and cleanLatex to find differences. +// // when we find differences we see how many characters are dropped until +// // we sync back up. While detecting missing characters we decrement the +// // startIndex and endIndex if appropriate. +// var j = 0; +// for (var i = 0; i < ctx.endIndex; i++) { +// if (originalLatex[i] !== cleanLatex[j]) { +// if (i < ctx.startIndex) { +// startIndex -= 1; +// } +// endIndex -= 1; +// // do not increment j. We wan to keep looking at this same +// // cleanLatex character until we find it in the originalLatex +// } else { +// j += 1; //move to next cleanLatex character +// } +// } +// return { +// latex: cleanLatex, +// startIndex: startIndex, +// endIndex: endIndex, +// }; +// }; +// Controller_latex.prototype.classifyLatexForEfficientUpdate = function (latex) { +// if (typeof latex !== 'string') return; +// var matches = latex.match(/-?[0-9.]+$/g); +// if (matches && matches.length === 1) { +// return { +// latex: latex, +// prefix: latex.substr(0, latex.length - matches[0].length), +// digits: matches[0], +// }; +// } +// return; +// }; +// Controller_latex.prototype.updateLatexMathEfficiently = function (latex, oldLatex) { +// var _c, _d, _e, _f; +// // Note, benchmark/update.html is useful for measuring the +// // performance of renderLatexMathEfficiently +// var root = this.root; +// var oldClassification; +// var classification = this.classifyLatexForEfficientUpdate(latex); +// if (classification) { +// oldClassification = this.classifyLatexForEfficientUpdate(oldLatex); +// if (!oldClassification || oldClassification.prefix !== classification.prefix) { +// return false; +// } +// } else { +// return false; +// } +// // check if minus sign is changing +// var oldDigits = oldClassification.digits; +// var newDigits = classification.digits; +// var oldMinusSign = false; +// var newMinusSign = false; +// if (oldDigits[0] === '-') { +// oldMinusSign = true; +// oldDigits = oldDigits.substr(1); +// } +// if (newDigits[0] === '-') { +// newMinusSign = true; +// newDigits = newDigits.substr(1); +// } +// // start at the very end +// var charNode = this.root.getEnd(R); +// var oldCharNodes = []; +// for (var i = oldDigits.length - 1; i >= 0; i--) { +// // the tree does not match what we expect +// if (!charNode || charNode.ctrlSeq !== oldDigits[i]) { +// return false; +// } +// // the trailing digits are not just under the root. We require the root +// // to be the parent so that we can be sure we do not need a reflow to +// // grow parens. +// if (charNode.parent !== root) { +// return false; +// } +// // push to the start. We're traversing backwards +// oldCharNodes.unshift(charNode); +// // move left one character +// charNode = charNode[L]; +// } +// // remove the minus sign +// if (oldMinusSign && !newMinusSign) { +// var oldMinusNode = charNode; +// if (!oldMinusNode) return false; +// if (oldMinusNode.ctrlSeq !== '-') return false; +// if (oldMinusNode[R] !== oldCharNodes[0]) return false; +// if (oldMinusNode.parent !== root) return false; +// var oldMinusNodeL = oldMinusNode[L]; +// if (oldMinusNodeL && oldMinusNodeL.parent !== root) return false; +// oldCharNodes[0][L] = oldMinusNode[L]; +// if (root.getEnd(L) === oldMinusNode) { +// root.setEnds(((_c = {}), (_c[L] = oldCharNodes[0]), (_c[R] = root.getEnd(R)), _c)); +// } +// if (oldMinusNodeL) oldMinusNodeL[R] = oldCharNodes[0]; +// oldMinusNode.domFrag().remove(); +// } +// // add a minus sign +// if (!oldMinusSign && newMinusSign) { +// var newMinusNode = new PlusMinus('-'); +// var minusSpan = document.createElement('span'); +// minusSpan.textContent = '-'; +// newMinusNode.setDOM(minusSpan); +// var oldCharNodes0L = oldCharNodes[0][L]; +// if (oldCharNodes0L) oldCharNodes0L[R] = newMinusNode; +// if (root.getEnd(L) === oldCharNodes[0]) { +// root.setEnds(((_d = {}), (_d[L] = newMinusNode), (_d[R] = root.getEnd(R)), _d)); +// } +// newMinusNode.parent = root; +// newMinusNode[L] = oldCharNodes[0][L]; +// newMinusNode[R] = oldCharNodes[0]; +// oldCharNodes[0][L] = newMinusNode; +// newMinusNode.contactWeld(this.cursor); // decide if binary operator +// newMinusNode.domFrag().insertBefore(oldCharNodes[0].domFrag()); +// } +// // update the text of the current nodes +// var commonLength = Math.min(oldDigits.length, newDigits.length); +// for (i = 0; i < commonLength; i++) { +// var newText = newDigits[i]; +// charNode = oldCharNodes[i]; +// if (charNode.ctrlSeq !== newText) { +// charNode.ctrlSeq = newText; +// charNode.domFrag().oneElement().textContent = newText; +// charNode.mathspeakName = newText; +// } +// } +// // remove the extra digits at the end +// if (oldDigits.length > newDigits.length) { +// charNode = oldCharNodes[newDigits.length - 1]; +// root.setEnds(((_e = {}), (_e[L] = root.getEnd(L)), (_e[R] = charNode), _e)); +// charNode[R] = 0; +// for (i = oldDigits.length - 1; i >= commonLength; i--) { +// oldCharNodes[i].domFrag().remove(); +// } +// } +// // add new digits after the existing ones +// if (newDigits.length > oldDigits.length) { +// var frag = document.createDocumentFragment(); +// for (i = commonLength; i < newDigits.length; i++) { +// var span = document.createElement('span'); +// span.className = 'dcg-mq-digit'; +// span.textContent = newDigits[i]; +// var newNode = new Digit(newDigits[i]); +// newNode.parent = root; +// newNode.setDOM(span); +// frag.appendChild(span); +// // splice this node in +// newNode[L] = root.getEnd(R); +// newNode[R] = 0; +// var newNodeL = newNode[L]; +// newNodeL[R] = newNode; +// root.setEnds(((_f = {}), (_f[L] = root.getEnd(L)), (_f[R] = newNode), _f)); +// } +// root.domFrag().oneElement().appendChild(frag); +// } +// var currentLatex = this.exportLatex(); +// if (currentLatex !== latex) { +// console.warn( +// 'tried updating latex efficiently but did not work. Attempted: ' + +// latex + +// ' but wrote: ' + +// currentLatex +// ); +// return false; +// } +// var rightMost = root.getEnd(R); +// if (rightMost) { +// rightMost.fixDigitGrouping(this.cursor.options); +// } +// return true; +// }; +// Controller_latex.prototype.renderLatexMathFromScratch = function (latex) { +// var _c; +// var root = this.root, +// cursor = this.cursor; +// var all = Parser.all; +// var eof = Parser.eof; +// var block = latexMathParser.skip(eof).or(all.result(false)).parse(latex); +// root.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); +// if (block) { +// block.children().adopt(root, 0, 0); +// } +// if (block) { +// var frag = root.domFrag(); +// frag.children().remove(); +// frag.oneElement().appendChild(block.html()); +// root.finalizeInsert(cursor.options, cursor); +// } else { +// root.domFrag().empty(); +// } +// }; +// Controller_latex.prototype.renderLatexMath = function (latex) { +// var cursor = this.cursor; +// var root = this.root; +// this.notify('replace'); +// cursor.clearSelection(); +// var oldLatex = this.exportLatex(); +// if (!root.getEnd(L) || !root.getEnd(R) || oldLatex !== latex) { +// this.updateLatexMathEfficiently(latex, oldLatex) || this.renderLatexMathFromScratch(latex); +// this.updateMathspeak(); +// } +// cursor.insAtRightEnd(root); +// }; +// Controller_latex.prototype.renderLatexText = function (latex) { +// var _c; +// var root = this.root, +// cursor = this.cursor; +// root.domFrag().children().slice(1).remove(); +// root.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); +// delete cursor.selection; +// cursor.show().insAtRightEnd(root); +// var regex = Parser.regex; +// var string = Parser.string; +// var eof = Parser.eof; +// var all = Parser.all; +// // Parser RootMathCommand +// var mathMode = string('$') +// .then(latexMathParser) +// // because TeX is insane, math mode doesn't necessarily +// // have to end. So we allow for the case that math mode +// // continues to the end of the stream. +// .skip(string('$').or(eof)) +// .map(function (block) { +// // HACK FIXME: this shouldn't have to have access to cursor +// var rootMathCommand = new RootMathCommand(cursor); +// rootMathCommand.createBlocks(); +// var rootMathBlock = rootMathCommand.getEnd(L); +// block.children().adopt(rootMathBlock, 0, 0); +// return rootMathCommand; +// }); +// var escapedDollar = string('\\$').result('$'); +// var textChar = escapedDollar.or(regex(/^[^$]/)).map(function (ch) { +// return new VanillaSymbol(ch); +// }); +// var latexText = mathMode.or(textChar).many(); +// var commands = latexText.skip(eof).or(all.result(false)).parse(latex); +// if (commands) { +// for (var i = 0; i < commands.length; i += 1) { +// commands[i].adopt(root, root.getEnd(R), 0); +// } +// domFrag(root.html()).appendTo(root.domFrag().oneElement()); +// root.finalizeInsert(cursor.options, cursor); +// } +// }; +// return Controller_latex; +// })(Controller_keystroke); +// /******************************************************** +// * Deals with mouse events for clicking, drag-to-select +// *******************************************************/ +// var ignoreNextMouseDownNoop = function (_el) { +// return false; +// }; +// Options.prototype.ignoreNextMousedown = ignoreNextMouseDownNoop; +// // Whenever edits to the tree occur, in-progress selection events +// // must be invalidated and selection changes must not be applied to +// // the edited tree. cancelSelectionOnEdit takes care of this. +// var cancelSelectionOnEdit; +// (function () { +// ControllerBase.onNotify(function (cursor, e) { +// if (e === 'edit' || e === 'replace') { +// // this will be called any time ANY mathquill is edited. We only want +// // to cancel selection if the selection is happening within the mathquill +// // that dispatched the notify. Otherwise you won't be able to select any +// // mathquills while a slider is playing. +// if (cancelSelectionOnEdit && cancelSelectionOnEdit.cursor === cursor) { +// cancelSelectionOnEdit.cb(); +// } +// } +// }); +// })(); +// var Controller_mouse = /** @class */ (function (_super) { +// __extends(Controller_mouse, _super); +// function Controller_mouse() { +// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; +// _this_1.handleMouseDown = function (e) { +// var rootElement = closest(e.target, '.dcg-mq-root-block'); +// var root = +// (rootElement && NodeBase.getNodeOfElement(rootElement)) || +// NodeBase.getNodeOfElement(_this_1.root.domFrag().oneElement()); +// var ownerDocument = root.domFrag().firstNode().ownerDocument; +// var ctrlr = root.controller, +// cursor = ctrlr.cursor, +// blink = cursor.blink; +// var textareaSpan = ctrlr.getTextareaSpanOrThrow(); +// var textarea = ctrlr.getTextareaOrThrow(); +// e.preventDefault(); // doesn't work in IE\u22648, but it's a one-line fix: +// e.target.unselectable = true; // http://jsbin.com/yagekiji/1 // TODO - no idea what this unselectable property is +// if (cursor.options.ignoreNextMousedown(e)) return; +// else cursor.options.ignoreNextMousedown = ignoreNextMouseDownNoop; +// var lastMousemoveTarget = null; +// function mousemove(e) { +// lastMousemoveTarget = e.target; +// } +// function onDocumentMouseMove(e) { +// if (!cursor.anticursor) cursor.startSelection(); +// ctrlr.seek(lastMousemoveTarget, e.clientX, e.clientY).cursor.select(); +// if (cursor.selection) +// cursor.controller.aria +// .clear() +// .queue(cursor.selection.join('mathspeak') + ' selected') +// .alert(); +// lastMousemoveTarget = null; +// } +// // outside rootElement, the MathQuill node corresponding to the target (if any) +// // won't be inside this root, so don't mislead Controller::seek with it +// function unbindListeners() { +// // delete the mouse handlers now that we're not dragging anymore +// rootElement === null || rootElement === void 0 +// ? void 0 +// : rootElement.removeEventListener('mousemove', mousemove); +// ownerDocument === null || ownerDocument === void 0 +// ? void 0 +// : ownerDocument.removeEventListener('mousemove', onDocumentMouseMove); +// ownerDocument === null || ownerDocument === void 0 +// ? void 0 +// : ownerDocument.removeEventListener('mouseup', onDocumentMouseUp); +// cancelSelectionOnEdit = undefined; +// } +// function updateCursor() { +// if (ctrlr.editable) { +// cursor.show(); +// cursor.controller.aria.queue(cursor.parent).alert(); +// } else { +// domFrag(textareaSpan).detach(); +// } +// } +// function onDocumentMouseUp() { +// cursor.blink = blink; +// if (!cursor.selection) updateCursor(); +// unbindListeners(); +// } +// var wasEdited; +// cancelSelectionOnEdit = { +// cursor: cursor, +// cb: function () { +// // If an edit happens while the mouse is down, the existing +// // selection is no longer valid. Clear it and unbind listeners, +// // similar to what happens on mouseup. +// wasEdited = true; +// cursor.blink = blink; +// cursor.clearSelection(); +// updateCursor(); +// unbindListeners(); +// }, +// }; +// if (ctrlr.blurred) { +// if (rootElement && !ctrlr.editable) { +// domFrag(rootElement).prepend(domFrag(textareaSpan)); +// } +// textarea.focus(); +// // focus call may bubble to clients, who may then write to +// // mathquill, triggering cancelSelectionOnEdit. If that happens, we +// // don't want to stop the cursor blink or bind listeners, +// // so return early. +// if (wasEdited) return; +// } +// cursor.blink = noop; +// ctrlr.seek(e.target, e.clientX, e.clientY).cursor.startSelection(); +// rootElement === null || rootElement === void 0 +// ? void 0 +// : rootElement.addEventListener('mousemove', mousemove); +// ownerDocument === null || ownerDocument === void 0 +// ? void 0 +// : ownerDocument.addEventListener('mousemove', onDocumentMouseMove); +// ownerDocument === null || ownerDocument === void 0 +// ? void 0 +// : ownerDocument.addEventListener('mouseup', onDocumentMouseUp); +// // listen on document not just body to not only hear about mousemove and +// // mouseup on page outside field, but even outside page, except iframes: https://github.com/mathquill/mathquill/commit/8c50028afcffcace655d8ae2049f6e02482346c5#commitcomment-6175800 +// }; +// return _this_1; +// } +// Controller_mouse.prototype.addMouseEventListener = function () { +// //drag-to-select event handling +// this.container.addEventListener('mousedown', this.handleMouseDown); +// }; +// Controller_mouse.prototype.removeMouseEventListener = function () { +// this.container.removeEventListener('mousedown', this.handleMouseDown); +// }; +// Controller_mouse.prototype.seek = function (targetElm, clientX, _clientY) { +// var cursor = this.notify('select').cursor; +// var node; +// // we can click on an element that is deeply nested past the point +// // that mathquill knows about. We need to traverse up to the first +// // node that mathquill is aware of +// while (targetElm) { +// // try to find the MQ Node associated with the DOM Element +// node = NodeBase.getNodeOfElement(targetElm); +// if (node) break; +// // must be too deep, traverse up to the parent DOM Element +// targetElm = targetElm.parentElement; +// } +// // Could not find any nodes, just use the root +// if (!node) { +// node = this.root; +// } +// // don't clear selection until after getting node from target, in case +// // target was selection span, otherwise target will have no parent and will +// // seek from root, which is less accurate (e.g. fraction) +// cursor.clearSelection().show(); +// node.seek(clientX, cursor); +// this.scrollHoriz(); // before .selectFrom when mouse-selecting, so +// // always hits no-selection case in scrollHoriz and scrolls slower +// return this; +// }; +// return Controller_mouse; +// })(Controller_latex); +// /*********************************************** +// * Horizontal panning for editable fields that +// * overflow their width +// **********************************************/ +// var Controller_scrollHoriz = /** @class */ (function (_super) { +// __extends(Controller_scrollHoriz, _super); +// function Controller_scrollHoriz() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// Controller_scrollHoriz.prototype.setOverflowClasses = function () { +// var root = this.root.domFrag().oneElement(); +// var shouldHaveOverflowRight = false; +// var shouldHaveOverflowLeft = false; +// if (!this.blurred) { +// var width = getBoundingClientRect(root).width; +// var scrollWidth = root.scrollWidth; +// var scroll = root.scrollLeft; +// shouldHaveOverflowRight = scrollWidth > width + scroll; +// shouldHaveOverflowLeft = scroll > 0; +// } +// if (root.classList.contains('dcg-mq-editing-overflow-right') !== shouldHaveOverflowRight) +// root.classList.toggle('dcg-mq-editing-overflow-right'); +// if (root.classList.contains('dcg-mq-editing-overflow-left') !== shouldHaveOverflowLeft) +// root.classList.toggle('dcg-mq-editing-overflow-left'); +// }; +// Controller_scrollHoriz.prototype.scrollHoriz = function () { +// var _this_1 = this; +// var cursor = this.cursor, +// seln = cursor.selection; +// var rootRect = getBoundingClientRect(this.root.domFrag().oneElement()); +// if (cursor.domFrag().isEmpty() && !seln) { +// if (this.cancelScrollHoriz) { +// this.cancelScrollHoriz(); +// this.cancelScrollHoriz = undefined; +// } +// var rootElt_1 = this.root.domFrag().oneElement(); +// var start_1 = rootElt_1.scrollLeft; +// animate(this.getScrollAnimationDuration(), function (progress, scheduleNext, cancel) { +// if (progress >= 1) { +// _this_1.cancelScrollHoriz = undefined; +// rootElt_1.scrollLeft = 0; +// _this_1.setOverflowClasses(); +// } else { +// _this_1.cancelScrollHoriz = cancel; +// scheduleNext(); +// rootElt_1.scrollLeft = Math.round((1 - progress) * start_1); +// } +// }); +// return; +// } else if (!seln) { +// var x = getBoundingClientRect(cursor.domFrag().oneElement()).left; +// if (x > rootRect.right - 20) var scrollBy = x - (rootRect.right - 20); +// else if (x < rootRect.left + 20) var scrollBy = x - (rootRect.left + 20); +// else return; +// } else { +// var rect = getBoundingClientRect(seln.domFrag().oneElement()); +// var overLeft = rect.left - (rootRect.left + 20); +// var overRight = rect.right - (rootRect.right - 20); +// if (seln.getEnd(L) === cursor[R]) { +// if (overLeft < 0) var scrollBy = overLeft; +// else if (overRight > 0) { +// if (rect.left - overRight < rootRect.left + 20) var scrollBy = overLeft; +// else var scrollBy = overRight; +// } else return; +// } else { +// if (overRight > 0) var scrollBy = overRight; +// else if (overLeft < 0) { +// if (rect.right - overLeft > rootRect.right - 20) var scrollBy = overRight; +// else var scrollBy = overLeft; +// } else return; +// } +// } +// var root = this.root.domFrag().oneElement(); +// if (scrollBy < 0 && root.scrollLeft === 0) return; +// if (scrollBy > 0 && root.scrollWidth <= root.scrollLeft + rootRect.width) return; +// if (this.cancelScrollHoriz) { +// this.cancelScrollHoriz(); +// this.cancelScrollHoriz = undefined; +// } +// var rootElt = this.root.domFrag().oneElement(); +// var start = rootElt.scrollLeft; +// animate(this.getScrollAnimationDuration(), function (progress, scheduleNext, cancel) { +// if (progress >= 1) { +// _this_1.cancelScrollHoriz = undefined; +// rootElt.scrollLeft = Math.round(start + scrollBy); +// _this_1.setOverflowClasses(); +// } else { +// _this_1.cancelScrollHoriz = cancel; +// scheduleNext(); +// rootElt.scrollLeft = Math.round(start + progress * scrollBy); +// } +// }); +// }; +// Controller_scrollHoriz.prototype.getScrollAnimationDuration = function () { +// var _c; +// return (_c = this.options.scrollAnimationDuration) !== null && _c !== void 0 ? _c : 100; +// }; +// return Controller_scrollHoriz; +// })(Controller_mouse); +// /********************************************* +// * Manage the MathQuill instance's textarea +// * (as owned by the Controller) +// ********************************************/ +// Options.prototype.substituteTextarea = function () { +// return h('textarea', { +// autocapitalize: 'off', +// autocomplete: 'off', +// autocorrect: 'off', +// spellcheck: false, +// 'x-palm-disable-ste-all': true, +// }); +// }; +// function defaultSubstituteKeyboardEvents(jq, controller) { +// return saneKeyboardEvents(jq[0], controller); +// } +// Options.prototype.substituteKeyboardEvents = defaultSubstituteKeyboardEvents; +// var Controller = /** @class */ (function (_super) { +// __extends(Controller, _super); +// function Controller() { +// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; +// _this_1.selectFn = noop; +// return _this_1; +// } +// Controller.prototype.createTextarea = function () { +// this.textareaSpan = h('span', { class: 'dcg-mq-textarea' }); +// var textarea = this.options.substituteTextarea(); +// if (!textarea.nodeType) { +// throw 'substituteTextarea() must return a DOM element, got ' + textarea; +// } +// this.textarea = domFrag(textarea).appendTo(this.textareaSpan).oneElement(); +// var ctrlr = this; +// ctrlr.cursor.selectionChanged = function () { +// ctrlr.selectionChanged(); +// }; +// }; +// Controller.prototype.selectionChanged = function () { +// var ctrlr = this; +// // throttle calls to setTextareaSelection(), because setting textarea.value +// // and/or calling textarea.select() can have anomalously bad performance: +// // https://github.com/mathquill/mathquill/issues/43#issuecomment-1399080 +// // +// // Note, this timeout may be cleared by the blur handler in focusBlur.js +// if (!ctrlr.textareaSelectionTimeout) { +// ctrlr.textareaSelectionTimeout = setTimeout(function () { +// ctrlr.setTextareaSelection(); +// }); +// } +// }; +// Controller.prototype.setTextareaSelection = function () { +// this.textareaSelectionTimeout = 0; +// var latex = ''; +// if (this.cursor.selection) { +// //cleanLatex prunes unnecessary spaces. defined in latex.js +// latex = this.cleanLatex(this.cursor.selection.join('latex')); +// if (this.options.statelessClipboard) { +// // FIXME: like paste, only this works for math fields; should ask parent +// latex = '$' + latex + '$'; +// } +// } +// this.selectFn(latex); +// }; +// Controller.prototype.staticMathTextareaEvents = function () { +// var ctrlr = this; +// this.removeTextareaEventListener('cut'); +// this.removeTextareaEventListener('paste'); +// if (ctrlr.options.disableCopyPaste) { +// this.removeTextareaEventListener('copy'); +// } else { +// this.addTextareaEventListeners({ +// copy: function () { +// ctrlr.setTextareaSelection(); +// }, +// }); +// } +// this.addStaticFocusBlurListeners(); +// ctrlr.selectFn = function (text) { +// var textarea = ctrlr.getTextareaOrThrow(); +// if (!(textarea instanceof HTMLTextAreaElement)) return; +// textarea.value = text; +// if (text) textarea.select(); +// }; +// }; +// Controller.prototype.editablesTextareaEvents = function () { +// var ctrlr = this; +// var textarea = ctrlr.getTextareaOrThrow(); +// var textareaSpan = ctrlr.getTextareaSpanOrThrow(); +// if (this.options.version < 3) { +// var $ = this.options.assertJquery(); +// var keyboardEventsShim = this.options.substituteKeyboardEvents($(textarea), this); +// this.selectFn = function (text) { +// keyboardEventsShim.select(text); +// }; +// } else { +// var select = saneKeyboardEvents(textarea, this).select; +// this.selectFn = select; +// } +// domFrag(this.container).prepend(domFrag(textareaSpan)); +// this.addEditableFocusBlurListeners(); +// this.updateMathspeak(); +// }; +// Controller.prototype.unbindEditablesEvents = function () { +// var ctrlr = this; +// var textarea = ctrlr.getTextareaOrThrow(); +// var textareaSpan = ctrlr.getTextareaSpanOrThrow(); +// this.selectFn = function (text) { +// if (!(textarea instanceof HTMLTextAreaElement)) return; +// textarea.value = text; +// if (text) textarea.select(); +// }; +// domFrag(textareaSpan).remove(); +// this.removeTextareaEventListener('focus'); +// this.removeTextareaEventListener('blur'); +// ctrlr.blurred = true; +// this.removeTextareaEventListener('cut'); +// this.removeTextareaEventListener('paste'); +// }; +// Controller.prototype.typedText = function (ch) { +// if (ch === '\n') return this.handle('enter'); +// var cursor = this.notify(undefined).cursor; +// cursor.parent.write(cursor, ch); +// this.scrollHoriz(); +// }; +// Controller.prototype.cut = function () { +// var ctrlr = this, +// cursor = ctrlr.cursor; +// if (cursor.selection) { +// setTimeout(function () { +// ctrlr.notify('edit'); // deletes selection if present +// cursor.parent.bubble(function (node) { +// node.reflow(); +// return undefined; +// }); +// if (ctrlr.options && ctrlr.options.onCut) { +// ctrlr.options.onCut(); +// } +// }); +// } +// }; +// Controller.prototype.copy = function () { +// this.setTextareaSelection(); +// }; +// Controller.prototype.paste = function (text) { +// // TODO: document `statelessClipboard` config option in README, after +// // making it work like it should, that is, in both text and math mode +// // (currently only works in math fields, so worse than pointless, it +// // only gets in the way by \text{}-ifying pasted stuff and $-ifying +// // cut/copied LaTeX) +// if (this.options.statelessClipboard) { +// if (text.slice(0, 1) === '$' && text.slice(-1) === '$') { +// text = text.slice(1, -1); +// } else { +// text = '\\text{' + text + '}'; +// } +// } +// // FIXME: this always inserts math or a TextBlock, even in a RootTextBlock +// this.writeLatex(text).cursor.show(); +// this.scrollHoriz(); +// if (this.options && this.options.onPaste) { +// this.options.onPaste(); +// } +// }; +// /** Set up for a static MQ field (i.e., create and attach the mathspeak element and initialize the focus state to blurred) */ +// Controller.prototype.setupStaticField = function () { +// this.mathspeakSpan = h('span', { class: 'dcg-mq-mathspeak' }); +// domFrag(this.container).prepend(domFrag(this.mathspeakSpan)); +// this.updateMathspeak(); +// this.blurred = true; +// this.cursor.hide().parent.blur(this.cursor); +// }; +// Controller.prototype.updateMathspeak = function () { +// var ctrlr = this; +// // If the controller's ARIA label doesn't end with a punctuation mark, add a colon by default to better separate it from mathspeak. +// var ariaLabel = ctrlr.getAriaLabel(); +// var labelWithSuffix = /[A-Za-z0-9]$/.test(ariaLabel) ? ariaLabel + ':' : ariaLabel; +// var mathspeak = ctrlr.root.mathspeak().trim(); +// this.aria.clear(); +// var textarea = ctrlr.getTextareaOrThrow(); +// // For static math, provide mathspeak in a visually hidden span to allow screen readers and other AT to traverse the content. +// // For editable math, assign the mathspeak to the textarea's ARIA label (AT can use text navigation to interrogate the content). +// // Be certain to include the mathspeak for only one of these, though, as we don't want to include outdated labels if a field's editable state changes. +// // By design, also take careful note that the ariaPostLabel is meant to exist only for editable math (e.g. to serve as an evaluation or error message) +// // so it is not included for static math mathspeak calculations. +// // The mathspeakSpan should exist only for static math, so we use its presence to decide which approach to take. +// if (!!ctrlr.mathspeakSpan) { +// textarea.setAttribute('aria-label', ''); +// ctrlr.mathspeakSpan.textContent = (labelWithSuffix + ' ' + mathspeak).trim(); +// } else { +// textarea.setAttribute( +// 'aria-label', +// (labelWithSuffix + ' ' + mathspeak + ' ' + ctrlr.ariaPostLabel).trim() +// ); +// } +// }; +// return Controller; +// })(Controller_scrollHoriz); +// /************************************************* +// * Abstract classes of math blocks and commands. +// ************************************************/ +// /** +// * Math tree node base class. +// * Some math-tree-specific extensions to MQNode. +// * Both MathBlock's and MathCommand's descend from it. +// */ +// var MathElement = /** @class */ (function (_super) { +// __extends(MathElement, _super); +// function MathElement() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// MathElement.prototype.finalizeInsert = function (options, cursor) { +// var self = this; +// self.postOrder(function (node) { +// node.finalizeTree(options); +// }); +// self.postOrder(function (node) { +// node.contactWeld(cursor); +// }); +// // note: this order is important. +// // empty elements need the empty box provided by blur to +// // be present in order for their dimensions to be measured +// // correctly by 'reflow' handlers. +// self.postOrder(function (node) { +// node.blur(cursor); +// }); +// self.postOrder(function (node) { +// node.reflow(); +// }); +// var selfR = self[R]; +// var selfL = self[L]; +// if (selfR) selfR.siblingCreated(options, L); +// if (selfL) selfL.siblingCreated(options, R); +// self.bubble(function (node) { +// node.reflow(); +// return undefined; +// }); +// }; +// // If the maxDepth option is set, make sure +// // deeply nested content is truncated. Just return +// // false if the cursor is already too deep. +// MathElement.prototype.prepareInsertionAt = function (cursor) { +// var maxDepth = cursor.options.maxDepth; +// if (maxDepth !== undefined) { +// var cursorDepth = cursor.depth(); +// if (cursorDepth > maxDepth) { +// return false; +// } +// this.removeNodesDeeperThan(maxDepth - cursorDepth); +// } +// return true; +// }; +// // Remove nodes that are more than `cutoff` +// // blocks deep from this node. +// MathElement.prototype.removeNodesDeeperThan = function (cutoff) { +// var depth = 0; +// var queue = [[this, depth]]; +// var current; +// // Do a breadth-first search of this node's descendants +// // down to cutoff, removing anything deeper. +// while ((current = queue.shift())) { +// var c = current; +// c[0].children().each(function (child) { +// var i = child instanceof MathBlock ? 1 : 0; +// depth = c[1] + i; +// if (depth <= cutoff) { +// queue.push([child, depth]); +// } else { +// (i ? child.children() : child).remove(); +// } +// return undefined; +// }); +// } +// }; +// return MathElement; +// })(MQNode); +// var DOMView = /** @class */ (function () { +// function DOMView(childCount, render) { +// this.childCount = childCount; +// this.render = render; +// } +// return DOMView; +// })(); +// /** +// * Commands and operators, like subscripts, exponents, or fractions. +// * Descendant commands are organized into blocks. +// */ +// var MathCommand = /** @class */ (function (_super) { +// __extends(MathCommand, _super); +// function MathCommand(ctrlSeq, domView, textTemplate) { +// var _this_1 = _super.call(this) || this; +// _this_1.textTemplate = ['']; +// _this_1.mathspeakTemplate = ['']; +// _this_1.setCtrlSeqHtmlAndText(ctrlSeq, domView, textTemplate); +// return _this_1; +// } +// MathCommand.prototype.setEnds = function (ends) { +// pray('MathCommand ends are never empty', ends[L] && ends[R]); +// this.ends = ends; +// }; +// MathCommand.prototype.getEnd = function (dir) { +// return this.ends[dir]; +// }; +// MathCommand.prototype.setCtrlSeqHtmlAndText = function (ctrlSeq, domView, textTemplate) { +// if (!this.ctrlSeq) this.ctrlSeq = ctrlSeq; +// if (domView) this.domView = domView; +// if (textTemplate) this.textTemplate = textTemplate; +// }; +// // obvious methods +// MathCommand.prototype.replaces = function (replacedFragment) { +// replacedFragment.disown(); +// this.replacedFragment = replacedFragment; +// }; +// MathCommand.prototype.isEmpty = function () { +// return this.foldChildren(true, function (isEmpty, child) { +// return isEmpty && child.isEmpty(); +// }); +// }; +// MathCommand.prototype.parser = function () { +// var _this_1 = this; +// var block = latexMathParser.block; +// return block.times(this.numBlocks()).map(function (blocks) { +// _this_1.blocks = blocks; +// for (var i = 0; i < blocks.length; i += 1) { +// blocks[i].adopt(_this_1, _this_1.getEnd(R), 0); +// } +// return _this_1; +// }); +// }; +// // createLeftOf(cursor) and the methods it calls +// MathCommand.prototype.createLeftOf = function (cursor) { +// var cmd = this; +// var replacedFragment = cmd.replacedFragment; +// cmd.createBlocks(); +// _super.prototype.createLeftOf.call(this, cursor); +// if (replacedFragment) { +// var cmdEndsL = cmd.getEnd(L); +// replacedFragment.adopt(cmdEndsL, 0, 0); +// replacedFragment.domFrag().appendTo(cmdEndsL.domFrag().oneElement()); +// cmd.placeCursor(cursor); +// cmd.prepareInsertionAt(cursor); +// } +// cmd.finalizeInsert(cursor.options, cursor); +// cmd.placeCursor(cursor); +// }; +// MathCommand.prototype.createBlocks = function () { +// var cmd = this, +// numBlocks = cmd.numBlocks(), +// blocks = (cmd.blocks = Array(numBlocks)); +// for (var i = 0; i < numBlocks; i += 1) { +// var newBlock = (blocks[i] = new MathBlock()); +// newBlock.adopt(cmd, cmd.getEnd(R), 0); +// } +// }; +// MathCommand.prototype.placeCursor = function (cursor) { +// //insert the cursor at the right end of the first empty child, searching +// //left-to-right, or if none empty, the right end child +// cursor.insAtRightEnd( +// this.foldChildren(this.getEnd(L), function (leftward, child) { +// return leftward.isEmpty() ? leftward : child; +// }) +// ); +// }; +// // editability methods: called by the cursor for editing, cursor movements, +// // and selection of the MathQuill tree, these all take in a direction and +// // the cursor +// MathCommand.prototype.moveTowards = function (dir, cursor, updown) { +// var updownInto; +// if (updown === 'up') { +// updownInto = this.upInto; +// } else if (updown === 'down') { +// updownInto = this.downInto; +// } +// var el = updownInto || this.getEnd(-dir); +// cursor.insAtDirEnd(-dir, el); +// cursor.controller.aria.queueDirEndOf(-dir).queue(cursor.parent, true); +// }; +// MathCommand.prototype.deleteTowards = function (dir, cursor) { +// if (this.isEmpty()) cursor[dir] = this.remove()[dir]; +// else this.moveTowards(dir, cursor); +// }; +// MathCommand.prototype.selectTowards = function (dir, cursor) { +// cursor[-dir] = this; +// cursor[dir] = this[dir]; +// }; +// MathCommand.prototype.selectChildren = function () { +// return new MQSelection(this, this); +// }; +// MathCommand.prototype.unselectInto = function (dir, cursor) { +// var antiCursor = cursor.anticursor; +// var ancestor = antiCursor.ancestors[this.id]; +// cursor.insAtDirEnd(-dir, ancestor); +// }; +// MathCommand.prototype.seek = function (clientX, cursor) { +// function getBounds(node) { +// var _c; +// var el = node.domFrag().oneElement(); +// var l = getBoundingClientRect(el).left; +// var r = l + el.offsetWidth; +// return (_c = {}), (_c[L] = l), (_c[R] = r), _c; +// } +// var cmd = this; +// var cmdBounds = getBounds(cmd); +// if (clientX < cmdBounds[L]) return cursor.insLeftOf(cmd); +// if (clientX > cmdBounds[R]) return cursor.insRightOf(cmd); +// var leftLeftBound = cmdBounds[L]; +// cmd.eachChild(function (block) { +// var blockBounds = getBounds(block); +// if (clientX < blockBounds[L]) { +// // closer to this block's left bound, or the bound left of that? +// if (clientX - leftLeftBound < blockBounds[L] - clientX) { +// if (block[L]) cursor.insAtRightEnd(block[L]); +// else cursor.insLeftOf(cmd); +// } else cursor.insAtLeftEnd(block); +// return false; +// } else if (clientX > blockBounds[R]) { +// if (block[R]) leftLeftBound = blockBounds[R]; +// // continue to next block +// else { +// // last (rightmost) block +// // closer to this block's right bound, or the cmd's right bound? +// if (cmdBounds[R] - clientX < clientX - blockBounds[R]) { +// cursor.insRightOf(cmd); +// } else cursor.insAtRightEnd(block); +// } +// return undefined; +// } else { +// block.seek(clientX, cursor); +// return false; +// } +// }); +// return undefined; +// }; +// MathCommand.prototype.numBlocks = function () { +// return this.domView.childCount; +// }; +// /** +// * Render the entire math subtree rooted at this command to a DOM node. Assumes `this.domView` is defined. +// * +// * See dom.test.js for example templates and intended outputs. +// */ +// MathCommand.prototype.html = function () { +// var blocks = this.blocks; +// pray('domView is defined', this.domView); +// var template = this.domView; +// var dom = template.render(blocks || []); +// this.setDOM(dom); +// NodeBase.linkElementByCmdNode(dom, this); +// return dom; +// }; +// // methods to export a string representation of the math tree +// MathCommand.prototype.latexRecursive = function (ctx) { +// this.checkCursorContextOpen(ctx); +// ctx.latex += this.ctrlSeq || ''; +// this.eachChild(function (child) { +// ctx.latex += '{'; +// var beforeLength = ctx.latex.length; +// child.latexRecursive(ctx); +// var afterLength = ctx.latex.length; +// if (beforeLength === afterLength) { +// // nothing was written so we write a space +// ctx.latex += ' '; +// } +// ctx.latex += '}'; +// }); +// this.checkCursorContextClose(ctx); +// }; +// MathCommand.prototype.text = function () { +// var cmd = this, +// i = 0; +// return cmd.foldChildren(cmd.textTemplate[i], function (text, child) { +// i += 1; +// var child_text = child.text(); +// if (text && cmd.textTemplate[i] === '(' && child_text[0] === '(' && child_text.slice(-1) === ')') +// return text + child_text.slice(1, -1) + cmd.textTemplate[i]; +// return text + child_text + (cmd.textTemplate[i] || ''); +// }); +// }; +// MathCommand.prototype.mathspeak = function () { +// var cmd = this, +// i = 0; +// return cmd.foldChildren( +// cmd.mathspeakTemplate[i] || 'Start' + cmd.ctrlSeq + ' ', +// function (speech, block) { +// i += 1; +// return ( +// speech + +// ' ' + +// block.mathspeak() + +// ' ' + +// (cmd.mathspeakTemplate[i] + ' ' || 'End' + cmd.ctrlSeq + ' ') +// ); +// } +// ); +// }; +// return MathCommand; +// })(MathElement); +// /** +// * Lightweight command without blocks or children. +// */ +// var MQSymbol = /** @class */ (function (_super) { +// __extends(MQSymbol, _super); +// function MQSymbol(ctrlSeq, html, text, mathspeak) { +// var _this_1 = _super.call(this) || this; +// _this_1.setCtrlSeqHtmlTextAndMathspeak( +// ctrlSeq, +// html +// ? new DOMView(0, function () { +// return html.cloneNode(true); +// }) +// : undefined, +// text, +// mathspeak +// ); +// return _this_1; +// } +// MQSymbol.prototype.setCtrlSeqHtmlTextAndMathspeak = function (ctrlSeq, html, text, mathspeak) { +// if (!text && !!ctrlSeq) { +// text = ctrlSeq.replace(/^\\/, ''); +// } +// this.mathspeakName = mathspeak || text; +// _super.prototype.setCtrlSeqHtmlAndText.call(this, ctrlSeq, html, [text || '']); +// }; +// MQSymbol.prototype.parser = function () { +// return Parser.succeed(this); +// }; +// MQSymbol.prototype.numBlocks = function () { +// return 0; +// }; +// MQSymbol.prototype.replaces = function (replacedFragment) { +// replacedFragment.remove(); +// }; +// MQSymbol.prototype.createBlocks = function () {}; +// MQSymbol.prototype.moveTowards = function (dir, cursor) { +// cursor.domFrag().insDirOf(dir, this.domFrag()); +// cursor[-dir] = this; +// cursor[dir] = this[dir]; +// cursor.controller.aria.queue(this); +// }; +// MQSymbol.prototype.deleteTowards = function (dir, cursor) { +// cursor[dir] = this.remove()[dir]; +// }; +// MQSymbol.prototype.seek = function (clientX, cursor) { +// // insert at whichever side the click was closer to +// var el = this.domFrag().oneElement(); +// var left = getBoundingClientRect(el).left; +// if (clientX - left < el.offsetWidth / 2) cursor.insLeftOf(this); +// else cursor.insRightOf(this); +// return cursor; +// }; +// MQSymbol.prototype.latexRecursive = function (ctx) { +// this.checkCursorContextOpen(ctx); +// ctx.latex += this.ctrlSeq || ''; +// this.checkCursorContextClose(ctx); +// }; +// MQSymbol.prototype.text = function () { +// return this.textTemplate.join(''); +// }; +// MQSymbol.prototype.mathspeak = function (_opts) { +// return this.mathspeakName || ''; +// }; +// MQSymbol.prototype.placeCursor = function () {}; +// MQSymbol.prototype.isEmpty = function () { +// return true; +// }; +// return MQSymbol; +// })(MathCommand); +// var VanillaSymbol = /** @class */ (function (_super) { +// __extends(VanillaSymbol, _super); +// function VanillaSymbol(ch, html, mathspeak) { +// return _super.call(this, ch, h('span', {}, [html || h.text(ch)]), undefined, mathspeak) || this; +// } +// return VanillaSymbol; +// })(MQSymbol); +// function bindVanillaSymbol(ch, htmlEntity, mathspeak) { +// return function () { +// return new VanillaSymbol(ch, htmlEntity ? h.entityText(htmlEntity) : undefined, mathspeak); +// }; +// } +// var BinaryOperator = /** @class */ (function (_super) { +// __extends(BinaryOperator, _super); +// function BinaryOperator(ctrlSeq, html, text, mathspeak, treatLikeSymbol) { +// var _this_1 = this; +// if (treatLikeSymbol) { +// _this_1 = +// _super.call( +// this, +// ctrlSeq, +// h('span', {}, [html || h.text(ctrlSeq || '')]), +// undefined, +// mathspeak +// ) || this; +// } else { +// _this_1 = +// _super.call( +// this, +// ctrlSeq, +// h('span', { class: 'dcg-mq-binary-operator' }, html ? [html] : []), +// text, +// mathspeak +// ) || this; +// } +// return _this_1; +// } +// return BinaryOperator; +// })(MQSymbol); +// function bindBinaryOperator(ctrlSeq, htmlEntity, text, mathspeak) { +// return function () { +// return new BinaryOperator(ctrlSeq, htmlEntity ? h.entityText(htmlEntity) : undefined, text, mathspeak); +// }; +// } +// /** +// * Children and parent of MathCommand's. Basically partitions all the +// * symbols and operators that descend (in the Math DOM tree) from +// * ancestor operators. +// */ +// var MathBlock = /** @class */ (function (_super) { +// __extends(MathBlock, _super); +// function MathBlock() { +// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; +// _this_1.ariaLabel = 'block'; +// return _this_1; +// } +// MathBlock.prototype.join = function (methodName) { +// return this.foldChildren('', function (fold, child) { +// return fold + child[methodName](); +// }); +// }; +// MathBlock.prototype.html = function () { +// var fragment = document.createDocumentFragment(); +// this.eachChild(function (el) { +// var childHtml = el.html(); +// fragment.appendChild(childHtml); +// return undefined; +// }); +// return fragment; +// }; +// MathBlock.prototype.latexRecursive = function (ctx) { +// this.checkCursorContextOpen(ctx); +// this.eachChild(function (child) { +// return child.latexRecursive(ctx); +// }); +// this.checkCursorContextClose(ctx); +// }; +// MathBlock.prototype.text = function () { +// var endsL = this.getEnd(L); +// var endsR = this.getEnd(R); +// return endsL === endsR && endsL !== 0 ? endsL.text() : this.join('text'); +// }; +// MathBlock.prototype.mathspeak = function () { +// var tempOp = ''; +// var autoOps = {}; +// if (this.controller) autoOps = this.controller.options.autoOperatorNames; +// return ( +// this.foldChildren([], function (speechArray, cmd) { +// if (cmd.isPartOfOperator) { +// tempOp += cmd.mathspeak(); +// } else { +// if (tempOp !== '') { +// if (autoOps._maxLength > 0) { +// var x = autoOps[tempOp.toLowerCase()]; +// if (typeof x === 'string') tempOp = x; +// } +// speechArray.push(tempOp + ' '); +// tempOp = ''; +// } +// var mathspeakText = cmd.mathspeak(); +// var cmdText = cmd.ctrlSeq; +// if ( +// isNaN(cmdText) && // TODO - revisit this to improve the isNumber() check +// cmdText !== '.' && +// (!cmd.parent || !cmd.parent.parent || !cmd.parent.parent.isTextBlock()) +// ) { +// mathspeakText = ' ' + mathspeakText + ' '; +// } +// speechArray.push(mathspeakText); +// } +// return speechArray; +// }) +// .join('') +// .replace(/ +(?= )/g, '') +// // For Apple devices in particular, split out digits after a decimal point so they aren't read aloud as whole words. +// // Not doing so makes 123.456 potentially spoken as "one hundred twenty-three point four hundred fifty-six." +// // Instead, add spaces so it is spoken as "one hundred twenty-three point four five six." +// .replace(/(\.)([0-9]+)/g, function (_match, p1, p2) { +// return p1 + p2.split('').join(' ').trim(); +// }) +// ); +// }; +// MathBlock.prototype.keystroke = function (key, e, ctrlr) { +// if (ctrlr.options.spaceBehavesLikeTab && (key === 'Spacebar' || key === 'Shift-Spacebar')) { +// e === null || e === void 0 ? void 0 : e.preventDefault(); +// ctrlr.escapeDir(key === 'Shift-Spacebar' ? L : R, key, e); +// return; +// } +// return _super.prototype.keystroke.call(this, key, e, ctrlr); +// }; +// // editability methods: called by the cursor for editing, cursor movements, +// // and selection of the MathQuill tree, these all take in a direction and +// // the cursor +// MathBlock.prototype.moveOutOf = function (dir, cursor, updown) { +// var updownInto; +// if (updown === 'up') { +// updownInto = this.parent.upInto; +// } else if (updown === 'down') { +// updownInto = this.parent.downInto; +// } +// if (!updownInto && this[dir]) { +// var otherDir = -dir; +// cursor.insAtDirEnd(otherDir, this[dir]); +// cursor.controller.aria.queueDirEndOf(otherDir).queue(cursor.parent, true); +// } else { +// cursor.insDirOf(dir, this.parent); +// cursor.controller.aria.queueDirOf(dir).queue(this.parent); +// } +// }; +// MathBlock.prototype.selectOutOf = function (dir, cursor) { +// cursor.insDirOf(dir, this.parent); +// }; +// MathBlock.prototype.deleteOutOf = function (_dir, cursor) { +// cursor.unwrapGramp(); +// }; +// MathBlock.prototype.seek = function (clientX, cursor) { +// var node = this.getEnd(R); +// if (!node) return cursor.insAtRightEnd(this); +// var el = node.domFrag().oneElement(); +// var left = getBoundingClientRect(el).left; +// if (left + el.offsetWidth < clientX) { +// return cursor.insAtRightEnd(this); +// } +// var endsL = this.getEnd(L); +// if (clientX < getBoundingClientRect(endsL.domFrag().oneElement()).left) +// return cursor.insAtLeftEnd(this); +// while (clientX < getBoundingClientRect(node.domFrag().oneElement()).left) node = node[L]; +// return node.seek(clientX, cursor); +// }; +// MathBlock.prototype.chToCmd = function (ch, options) { +// var cons; +// // exclude f because it gets a dedicated command with more spacing +// if (ch.match(/^[a-eg-zA-Z]$/)) return new Letter(ch); +// else if (/^\d$/.test(ch)) return new Digit(ch); +// else if (options && options.typingSlashWritesDivisionSymbol && ch === '/') +// return LatexCmds['\u00f7'](ch); +// else if (options && options.typingAsteriskWritesTimesSymbol && ch === '*') +// return LatexCmds['\u00d7'](ch); +// else if (options && options.typingPercentWritesPercentOf && ch === '%') return LatexCmds.percentof(ch); +// else if ((cons = CharCmds[ch] || LatexCmds[ch])) { +// if (cons.constructor) { +// return new cons(ch); +// } else { +// return cons(ch); +// } +// } else return new VanillaSymbol(ch); +// }; +// MathBlock.prototype.write = function (cursor, ch) { +// var cmd = this.chToCmd(ch, cursor.options); +// if (cursor.selection) cmd.replaces(cursor.replaceSelection()); +// if (!cursor.isTooDeep()) { +// cmd.createLeftOf(cursor.show()); +// // special-case the slash so that fractions are voiced while typing +// if (ch === '/') { +// cursor.controller.aria.alert('over'); +// } else { +// cursor.controller.aria.alert(cmd.mathspeak({ createdLeftOf: cursor })); +// } +// } +// }; +// MathBlock.prototype.writeLatex = function (cursor, latex) { +// var all = Parser.all; +// var eof = Parser.eof; +// var block = latexMathParser.skip(eof).or(all.result(false)).parse(latex); +// if (block && !block.isEmpty() && block.prepareInsertionAt(cursor)) { +// block.children().adopt(cursor.parent, cursor[L], cursor[R]); // TODO - masking undefined. should be 0 +// domFrag(block.html()).insertBefore(cursor.domFrag()); +// cursor[L] = block.getEnd(R); +// block.finalizeInsert(cursor.options, cursor); +// var blockEndsR = block.getEnd(R); +// var blockEndsL = block.getEnd(L); +// var blockEndsRR = blockEndsR[R]; +// var blockEndsLL = blockEndsL[L]; +// if (blockEndsRR) blockEndsRR.siblingCreated(cursor.options, L); +// if (blockEndsLL) blockEndsLL.siblingCreated(cursor.options, R); +// cursor.parent.bubble(function (node) { +// node.reflow(); +// return undefined; +// }); +// } +// }; +// MathBlock.prototype.focus = function () { +// this.domFrag().addClass('dcg-mq-hasCursor'); +// this.domFrag().removeClass('dcg-mq-empty'); +// return this; +// }; +// MathBlock.prototype.blur = function (cursor) { +// this.domFrag().removeClass('dcg-mq-hasCursor'); +// if (this.isEmpty()) { +// this.domFrag().addClass('dcg-mq-empty'); +// if (cursor && this.isQuietEmptyDelimiter(cursor.options.quietEmptyDelimiters)) { +// this.domFrag().addClass('dcg-mq-quiet-delimiter'); +// } +// } +// return this; +// }; +// return MathBlock; +// })(MathElement); +// Options.prototype.mouseEvents = true; +// API.StaticMath = function (APIClasses) { +// var _c; +// return ( +// (_c = /** @class */ (function (_super) { +// __extends(StaticMath, _super); +// function StaticMath(el) { +// var _this_1 = _super.call(this, el) || this; +// var innerFields = (_this_1.innerFields = []); +// _this_1.__controller.root.postOrder(function (node) { +// node.registerInnerField(innerFields, APIClasses.InnerMathField); +// }); +// return _this_1; +// } +// StaticMath.prototype.__mathquillify = function (opts, _interfaceVersion) { +// this.config(opts); +// _super.prototype.mathquillify.call(this, 'dcg-mq-math-mode'); +// this.__controller.setupStaticField(); +// if (this.__options.mouseEvents) { +// this.__controller.addMouseEventListener(); +// this.__controller.staticMathTextareaEvents(); +// } +// return this; +// }; +// StaticMath.prototype.latex = function (_latex) { +// var returned = _super.prototype.latex.apply(this, arguments); +// if (arguments.length > 0) { +// var innerFields = (this.innerFields = []); +// this.__controller.root.postOrder(function (node) { +// node.registerInnerField(innerFields, APIClasses.InnerMathField); +// }); +// // Force an ARIA label update to remain in sync with the new LaTeX value. +// this.__controller.updateMathspeak(); +// } +// return returned; +// }; +// StaticMath.prototype.setAriaLabel = function (ariaLabel) { +// this.__controller.setAriaLabel(ariaLabel); +// return this; +// }; +// StaticMath.prototype.getAriaLabel = function () { +// return this.__controller.getAriaLabel(); +// }; +// return StaticMath; +// })(APIClasses.AbstractMathQuill)), +// (_c.RootBlock = MathBlock), +// _c +// ); +// }; +// var RootMathBlock = /** @class */ (function (_super) { +// __extends(RootMathBlock, _super); +// function RootMathBlock() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// return RootMathBlock; +// })(MathBlock); +// RootBlockMixin(RootMathBlock.prototype); // adds methods to RootMathBlock +// API.MathField = function (APIClasses) { +// var _c; +// return ( +// (_c = /** @class */ (function (_super) { +// __extends(MathField, _super); +// function MathField() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// MathField.prototype.__mathquillify = function (opts, interfaceVersion) { +// this.config(opts); +// if (interfaceVersion > 1) this.__controller.root.reflow = noop; +// _super.prototype.mathquillify.call(this, 'dcg-mq-editable-field dcg-mq-math-mode'); +// // TODO: Why does this need to be deleted (contrary to the type definition)? Could we set it to `noop` instead? +// delete this.__controller.root.reflow; +// return this; +// }; +// return MathField; +// })(APIClasses.EditableField)), +// (_c.RootBlock = RootMathBlock), +// _c +// ); +// }; +// API.InnerMathField = function (APIClasses) { +// pray('MathField class is defined', APIClasses.MathField); +// return /** @class */ (function (_super) { +// __extends(class_1, _super); +// function class_1() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// class_1.prototype.makeStatic = function () { +// this.__controller.editable = false; +// this.__controller.root.blur(); +// this.__controller.unbindEditablesEvents(); +// domFrag(this.__controller.container).removeClass('dcg-mq-editable-field'); +// }; +// class_1.prototype.makeEditable = function () { +// this.__controller.editable = true; +// this.__controller.editablesTextareaEvents(); +// this.__controller.cursor.insAtRightEnd(this.__controller.root); +// domFrag(this.__controller.container).addClass('dcg-mq-editable-field'); +// }; +// return class_1; +// })(APIClasses.MathField); +// }; +// /************************************************* +// * Abstract classes of text blocks +// ************************************************/ +// /** +// * Blocks of plain text, with one or two TextPiece's as children. +// * Represents flat strings of typically serif-font Roman characters, as +// * opposed to hierchical, nested, tree-structured math. +// * Wraps a single HTMLSpanElement. +// */ +// var TextBlock = /** @class */ (function (_super) { +// __extends(TextBlock, _super); +// function TextBlock() { +// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; +// _this_1.ctrlSeq = '\\text'; +// _this_1.ariaLabel = 'Text'; +// _this_1.mathspeakTemplate = ['StartText', 'EndText']; +// return _this_1; +// } +// TextBlock.prototype.replaces = function (replacedText) { +// if (replacedText instanceof Fragment) { +// this.replacedText = replacedText.remove().domFrag().text(); +// } else if (typeof replacedText === 'string') this.replacedText = replacedText; +// }; +// TextBlock.prototype.setDOMFrag = function (el) { +// _super.prototype.setDOM.call(this, el); +// var endsL = this.getEnd(L); +// if (endsL) { +// var children = this.domFrag().children(); +// if (!children.isEmpty()) { +// endsL.setDOM(children.oneText()); +// } +// } +// return this; +// }; +// TextBlock.prototype.createLeftOf = function (cursor) { +// var textBlock = this; +// _super.prototype.createLeftOf.call(this, cursor); +// cursor.insAtRightEnd(textBlock); +// if (textBlock.replacedText) +// for (var i = 0; i < textBlock.replacedText.length; i += 1) +// textBlock.write(cursor, textBlock.replacedText.charAt(i)); +// var textBlockR = textBlock[R]; +// if (textBlockR) textBlockR.siblingCreated(cursor.options, L); +// var textBlockL = textBlock[L]; +// if (textBlockL) textBlockL.siblingCreated(cursor.options, R); +// textBlock.bubble(function (node) { +// node.reflow(); +// return undefined; +// }); +// }; +// TextBlock.prototype.parser = function () { +// var textBlock = this; +// // TODO: correctly parse text mode +// var string = Parser.string; +// var regex = Parser.regex; +// var optWhitespace = Parser.optWhitespace; +// return optWhitespace +// .then(string('{')) +// .then(regex(/^[^}]*/)) +// .skip(string('}')) +// .map(function (text) { +// if (text.length === 0) return new Fragment(0, 0); +// new TextPiece(text).adopt(textBlock, 0, 0); +// return textBlock; +// }); +// }; +// TextBlock.prototype.textContents = function () { +// return this.foldChildren('', function (text, child) { +// return text + child.textStr; +// }); +// }; +// TextBlock.prototype.text = function () { +// return '"' + this.textContents() + '"'; +// }; +// TextBlock.prototype.latexRecursive = function (ctx) { +// this.checkCursorContextOpen(ctx); +// var contents = this.textContents(); +// if (contents.length > 0) { +// ctx.latex += this.ctrlSeq + '{'; +// ctx.latex += contents.replace(/\\/g, '\\backslash ').replace(/[{}]/g, '\\$&'); +// ctx.latex += '}'; +// } +// this.checkCursorContextClose(ctx); +// }; +// TextBlock.prototype.html = function () { +// var out = h('span', { class: 'dcg-mq-text-mode' }, [h.text(this.textContents())]); +// this.setDOM(out); +// NodeBase.linkElementByCmdNode(out, this); +// return out; +// }; +// TextBlock.prototype.mathspeak = function (opts) { +// if (opts && opts.ignoreShorthand) { +// return this.mathspeakTemplate[0] + ', ' + this.textContents() + ', ' + this.mathspeakTemplate[1]; +// } else { +// return this.textContents(); +// } +// }; +// TextBlock.prototype.isTextBlock = function () { +// return true; +// }; +// // editability methods: called by the cursor for editing, cursor movements, +// // and selection of the MathQuill tree, these all take in a direction and +// // the cursor +// TextBlock.prototype.moveTowards = function (dir, cursor) { +// cursor.insAtDirEnd(-dir, this); +// cursor.controller.aria.queueDirEndOf(-dir).queue(cursor.parent, true); +// }; +// TextBlock.prototype.moveOutOf = function (dir, cursor) { +// cursor.insDirOf(dir, this); +// cursor.controller.aria.queueDirOf(dir).queue(this); +// }; +// TextBlock.prototype.unselectInto = function (dir, cursor) { +// this.moveTowards(dir, cursor); +// }; +// // TODO: make these methods part of a shared mixin or something. +// TextBlock.prototype.selectTowards = function (dir, cursor) { +// MathCommand.prototype.selectTowards.call(this, dir, cursor); +// }; +// TextBlock.prototype.deleteTowards = function (dir, cursor) { +// MathCommand.prototype.deleteTowards.call(this, dir, cursor); +// }; +// TextBlock.prototype.selectOutOf = function (dir, cursor) { +// cursor.insDirOf(dir, this); +// }; +// TextBlock.prototype.deleteOutOf = function (_dir, cursor) { +// // backspace and delete at ends of block don't unwrap +// if (this.isEmpty()) cursor.insRightOf(this); +// }; +// TextBlock.prototype.write = function (cursor, ch) { +// cursor.show().deleteSelection(); +// if (ch !== '$') { +// var cursorL = cursor[L]; +// if (!cursorL) new TextPiece(ch).createLeftOf(cursor); +// else if (cursorL instanceof TextPiece) cursorL.appendText(ch); +// } else if (this.isEmpty()) { +// cursor.insRightOf(this); +// new VanillaSymbol('\\$', h.text('$')).createLeftOf(cursor); +// } else if (!cursor[R]) cursor.insRightOf(this); +// else if (!cursor[L]) cursor.insLeftOf(this); +// else { +// // split apart +// var leftBlock = new TextBlock(); +// var leftPc = this.getEnd(L); +// if (leftPc) { +// leftPc.disown().domFrag().detach(); +// leftPc.adopt(leftBlock, 0, 0); +// } +// cursor.insLeftOf(this); +// _super.prototype.createLeftOf.call(leftBlock, cursor); // micro-optimization, not for correctness +// } +// this.bubble(function (node) { +// node.reflow(); +// return undefined; +// }); +// // TODO needs tests +// cursor.controller.aria.alert(ch); +// }; +// TextBlock.prototype.writeLatex = function (cursor, latex) { +// var cursorL = cursor[L]; +// if (!cursorL) new TextPiece(latex).createLeftOf(cursor); +// else if (cursorL instanceof TextPiece) cursorL.appendText(latex); +// this.bubble(function (node) { +// node.reflow(); +// return undefined; +// }); +// }; +// TextBlock.prototype.seek = function (clientX, cursor) { +// cursor.hide(); +// var textPc = TextBlockFuseChildren(this); +// if (!textPc) return; +// // insert cursor at approx position in DOMTextNode +// var textNode = this.domFrag().children().oneText(); +// var range = document.createRange(); +// range.selectNodeContents(textNode); +// var rects = range.getClientRects(); +// if (rects.length === 1) { +// var _c = rects[0], +// width = _c.width, +// left = _c.left; +// var avgChWidth = width / this.textContents().length; +// var approxPosition = Math.round((clientX - left) / avgChWidth); +// if (approxPosition <= 0) { +// cursor.insAtLeftEnd(this); +// } else if (approxPosition >= textPc.textStr.length) { +// cursor.insAtRightEnd(this); +// } else { +// cursor.insLeftOf(textPc.splitRight(approxPosition)); +// } +// } else { +// cursor.insAtLeftEnd(this); +// } +// // move towards mousedown (clientX) +// var displ = clientX - cursor.show().getBoundingClientRectWithoutMargin().left; // displacement +// var dir = displ && displ < 0 ? L : R; +// var prevDispl = dir; +// // displ * prevDispl > 0 iff displacement direction === previous direction +// while (cursor[dir] && displ * prevDispl > 0) { +// cursor[dir].moveTowards(dir, cursor); +// prevDispl = displ; +// displ = clientX - cursor.getBoundingClientRectWithoutMargin().left; +// } +// if (dir * displ < -dir * prevDispl) cursor[-dir].moveTowards(-dir, cursor); +// if (!cursor.anticursor) { +// // about to start mouse-selecting, the anticursor is gonna get put here +// var cursorL = cursor[L]; +// this.anticursorPosition = cursorL && cursorL.textStr.length; +// // ^ get it? 'cos if there's no cursor[L], it's 0... I'm a terrible person. +// } else if (cursor.anticursor.parent === this) { +// // mouse-selecting within this TextBlock, re-insert the anticursor +// var cursorL = cursor[L]; +// var cursorPosition = cursorL && cursorL.textStr.length; +// if (this.anticursorPosition === cursorPosition) { +// cursor.anticursor = Anticursor.fromCursor(cursor); +// } else { +// if (this.anticursorPosition < cursorPosition) { +// var newTextPc = cursorL.splitRight(this.anticursorPosition); +// cursor[L] = newTextPc; +// } else { +// var cursorR = cursor[R]; +// var newTextPc = cursorR.splitRight(this.anticursorPosition - cursorPosition); +// } +// cursor.anticursor = new Anticursor(this, newTextPc[L], newTextPc); +// } +// } +// }; +// TextBlock.prototype.blur = function (cursor) { +// MathBlock.prototype.blur.call(this, cursor); +// if (!cursor) return; +// if (this.textContents() === '') { +// this.remove(); +// if (cursor[L] === this) cursor[L] = this[L]; +// else if (cursor[R] === this) cursor[R] = this[R]; +// } else TextBlockFuseChildren(this); +// }; +// TextBlock.prototype.focus = function () { +// MathBlock.prototype.focus.call(this); +// }; +// return TextBlock; +// })(MQNode); +// function TextBlockFuseChildren(self) { +// self.domFrag().oneElement().normalize(); +// var children = self.domFrag().children(); +// if (children.isEmpty()) return; +// var textPcDom = children.oneText(); +// pray('only node in TextBlock span is Text node', textPcDom.nodeType === 3); +// // nodeType === 3 has meant a Text node since ancient times: +// // http://reference.sitepoint.com/javascript/Node/nodeType +// var textPc = new TextPiece(textPcDom.data); +// textPc.setDOM(textPcDom); +// self.children().disown(); +// textPc.adopt(self, 0, 0); +// return textPc; +// } +// /** +// * Piece of plain text, with a TextBlock as a parent and no children. +// * Wraps a single DOMTextNode. +// * For convenience, has a .textStr property that's just a JavaScript string +// * mirroring the text contents of the DOMTextNode. +// * Text contents must always be nonempty. +// */ +// var TextPiece = /** @class */ (function (_super) { +// __extends(TextPiece, _super); +// function TextPiece(text) { +// var _this_1 = _super.call(this) || this; +// _this_1.textStr = text; +// return _this_1; +// } +// TextPiece.prototype.html = function () { +// var out = h.text(this.textStr); +// this.setDOM(out); +// return out; +// }; +// TextPiece.prototype.appendText = function (text) { +// this.textStr += text; +// this.domFrag().oneText().appendData(text); +// }; +// TextPiece.prototype.prependText = function (text) { +// this.textStr = text + this.textStr; +// this.domFrag().oneText().insertData(0, text); +// }; +// TextPiece.prototype.insTextAtDirEnd = function (text, dir) { +// prayDirection(dir); +// if (dir === R) this.appendText(text); +// else this.prependText(text); +// }; +// TextPiece.prototype.splitRight = function (i) { +// var newPc = new TextPiece(this.textStr.slice(i)).adopt(this.parent, this, this[R]); +// newPc.setDOM(this.domFrag().oneText().splitText(i)); +// this.textStr = this.textStr.slice(0, i); +// return newPc; +// }; +// TextPiece.prototype.endChar = function (dir, text) { +// return text.charAt(dir === L ? 0 : -1 + text.length); +// }; +// TextPiece.prototype.moveTowards = function (dir, cursor) { +// prayDirection(dir); +// var ch = this.endChar(-dir, this.textStr); +// var from = this[-dir]; +// if (from instanceof TextPiece) from.insTextAtDirEnd(ch, dir); +// else new TextPiece(ch).createDir(-dir, cursor); +// return this.deleteTowards(dir, cursor); +// }; +// TextPiece.prototype.mathspeak = function () { +// return this.textStr; +// }; +// TextPiece.prototype.latexRecursive = function (ctx) { +// this.checkCursorContextOpen(ctx); +// ctx.latex += this.textStr; +// this.checkCursorContextClose(ctx); +// }; +// TextPiece.prototype.deleteTowards = function (dir, cursor) { +// if (this.textStr.length > 1) { +// var deletedChar; +// if (dir === R) { +// this.domFrag().oneText().deleteData(0, 1); +// deletedChar = this.textStr[0]; +// this.textStr = this.textStr.slice(1); +// } else { +// // note that the order of these 2 lines is annoyingly important +// // (the second line mutates this.textStr.length) +// this.domFrag() +// .oneText() +// .deleteData(-1 + this.textStr.length, 1); +// deletedChar = this.textStr[this.textStr.length - 1]; +// this.textStr = this.textStr.slice(0, -1); +// } +// cursor.controller.aria.queue(deletedChar); +// } else { +// this.remove(); +// cursor[dir] = this[dir]; +// cursor.controller.aria.queue(this.textStr); +// } +// }; +// TextPiece.prototype.selectTowards = function (dir, cursor) { +// prayDirection(dir); +// var anticursor = cursor.anticursor; +// if (!anticursor) return; +// var ch = this.endChar(-dir, this.textStr); +// if (anticursor[dir] === this) { +// var newPc = new TextPiece(ch).createDir(dir, cursor); +// anticursor[dir] = newPc; +// cursor.insDirOf(dir, newPc); +// } else { +// var from = this[-dir]; +// if (from instanceof TextPiece) from.insTextAtDirEnd(ch, dir); +// else { +// var newPc = new TextPiece(ch).createDir(-dir, cursor); +// var selection = cursor.selection; +// if (selection) { +// newPc.domFrag().insDirOf(-dir, selection.domFrag()); +// } +// } +// if (this.textStr.length === 1 && anticursor[-dir] === this) { +// anticursor[-dir] = this[-dir]; // `this` will be removed in deleteTowards +// } +// } +// return this.deleteTowards(dir, cursor); +// }; +// return TextPiece; +// })(MQNode); +// LatexCmds.text = LatexCmds.textnormal = LatexCmds.textrm = LatexCmds.textup = LatexCmds.textmd = TextBlock; +// function makeTextBlock(latex, ariaLabel, tagName, attrs) { +// return /** @class */ (function (_super) { +// __extends(class_2, _super); +// function class_2() { +// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; +// _this_1.ctrlSeq = latex; +// _this_1.mathspeakTemplate = ['Start' + ariaLabel, 'End' + ariaLabel]; +// _this_1.ariaLabel = ariaLabel; +// return _this_1; +// } +// class_2.prototype.html = function () { +// var out = h(tagName, attrs, [h.text(this.textContents())]); +// this.setDOM(out); +// NodeBase.linkElementByCmdNode(out, this); +// return out; +// }; +// return class_2; +// })(TextBlock); +// } +// LatexCmds.em = LatexCmds.italic = LatexCmds.italics = LatexCmds.emph = LatexCmds.textit = LatexCmds.textsl = makeTextBlock( +// '\\textit', +// 'Italic', +// 'i', +// { class: 'dcg-mq-text-mode' } +// ); +// LatexCmds.strong = LatexCmds.bold = LatexCmds.textbf = makeTextBlock('\\textbf', 'Bold', 'b', { +// class: 'dcg-mq-text-mode', +// }); +// LatexCmds.sf = LatexCmds.textsf = makeTextBlock('\\textsf', 'Sans serif font', 'span', { +// class: 'dcg-mq-sans-serif dcg-mq-text-mode', +// }); +// LatexCmds.tt = LatexCmds.texttt = makeTextBlock('\\texttt', 'Mono space font', 'span', { +// class: 'dcg-mq-monospace dcg-mq-text-mode', +// }); +// LatexCmds.textsc = makeTextBlock('\\textsc', 'Variable font', 'span', { +// style: 'font-variant:small-caps', +// class: 'dcg-mq-text-mode', +// }); +// LatexCmds.uppercase = makeTextBlock('\\uppercase', 'Uppercase', 'span', { +// style: 'text-transform:uppercase', +// class: 'dcg-mq-text-mode', +// }); +// LatexCmds.lowercase = makeTextBlock('\\lowercase', 'Lowercase', 'span', { +// style: 'text-transform:lowercase', +// class: 'dcg-mq-text-mode', +// }); +// var RootMathCommand = /** @class */ (function (_super) { +// __extends(RootMathCommand, _super); +// function RootMathCommand(cursor) { +// var _this_1 = _super.call(this, '$') || this; +// _this_1.domView = new DOMView(1, function (blocks) { +// return h.block('span', { class: 'dcg-mq-math-mode' }, blocks[0]); +// }); +// _this_1.cursor = cursor; +// return _this_1; +// } +// RootMathCommand.prototype.createBlocks = function () { +// _super.prototype.createBlocks.call(this); +// var endsL = this.getEnd(L); // TODO - how do we know this is a RootMathCommand? +// endsL.cursor = this.cursor; +// endsL.write = function (cursor, ch) { +// if (ch !== '$') MathBlock.prototype.write.call(this, cursor, ch); +// else if (this.isEmpty()) { +// cursor.insRightOf(this.parent); +// this.parent.deleteTowards(undefined, cursor); +// new VanillaSymbol('\\$', h.text('$')).createLeftOf(cursor.show()); +// } else if (!cursor[R]) cursor.insRightOf(this.parent); +// else if (!cursor[L]) cursor.insLeftOf(this.parent); +// else MathBlock.prototype.write.call(this, cursor, ch); +// }; +// }; +// RootMathCommand.prototype.latexRecursive = function (ctx) { +// this.checkCursorContextOpen(ctx); +// ctx.latex += '$'; +// this.getEnd(L).latexRecursive(ctx); +// ctx.latex += '$'; +// this.checkCursorContextClose(ctx); +// }; +// return RootMathCommand; +// })(MathCommand); +// var RootTextBlock = /** @class */ (function (_super) { +// __extends(RootTextBlock, _super); +// function RootTextBlock() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// RootTextBlock.prototype.keystroke = function (key, e, ctrlr) { +// if (key === 'Spacebar' || key === 'Shift-Spacebar') return; +// return _super.prototype.keystroke.call(this, key, e, ctrlr); +// }; +// RootTextBlock.prototype.write = function (cursor, ch) { +// cursor.show().deleteSelection(); +// if (ch === '$') new RootMathCommand(cursor).createLeftOf(cursor); +// else { +// var html; +// if (ch === '<') html = h.entityText('<'); +// else if (ch === '>') html = h.entityText('>'); +// new VanillaSymbol(ch, html).createLeftOf(cursor); +// } +// }; +// return RootTextBlock; +// })(RootMathBlock); +// API.TextField = function (APIClasses) { +// var _c; +// return ( +// (_c = /** @class */ (function (_super) { +// __extends(TextField, _super); +// function TextField() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// TextField.prototype.__mathquillify = function () { +// _super.prototype.mathquillify.call(this, 'dcg-mq-editable-field dcg-mq-text-mode'); +// return this; +// }; +// TextField.prototype.latex = function (latex) { +// if (latex) { +// this.__controller.renderLatexText(latex); +// if (this.__controller.blurred) this.__controller.cursor.hide().parent.blur(); +// var _this = this; // just to help help TS out +// return _this; +// } +// return this.__controller.exportLatex(); +// }; +// return TextField; +// })(APIClasses.EditableField)), +// (_c.RootBlock = RootTextBlock), +// _c +// ); +// }; +// /************************************ +// * Symbols for Advanced Mathematics +// ***********************************/ +// LatexCmds.notin = LatexCmds.cong = LatexCmds.equiv = LatexCmds.oplus = LatexCmds.otimes = function (latex) { +// return new BinaryOperator('\\' + latex + ' ', h.entityText('&' + latex + ';')); +// }; +// LatexCmds['\u2217'] = LatexCmds.ast = LatexCmds.star = LatexCmds.loast = LatexCmds.lowast = bindBinaryOperator( +// '\\ast ', +// '∗', +// 'low asterisk' +// ); +// LatexCmds.therefor = LatexCmds.therefore = bindBinaryOperator('\\therefore ', '∴', 'therefore'); +// LatexCmds.cuz = LatexCmds.because = bindBinaryOperator( +// // l33t +// '\\because ', +// '∵', +// 'because' +// ); +// LatexCmds.prop = LatexCmds.propto = bindBinaryOperator('\\propto ', '∝', 'proportional to'); +// LatexCmds['\u2248'] = LatexCmds.asymp = LatexCmds.approx = bindBinaryOperator( +// '\\approx ', +// '≈', +// 'approximately equal to' +// ); +// LatexCmds.isin = LatexCmds['in'] = bindBinaryOperator('\\in ', '∈', 'is in'); +// LatexCmds.ni = LatexCmds.contains = bindBinaryOperator('\\ni ', '∋', 'is not in'); +// LatexCmds.notni = LatexCmds.niton = LatexCmds.notcontains = LatexCmds.doesnotcontain = bindBinaryOperator( +// '\\not\\ni ', +// '∌', +// 'does not contain' +// ); +// LatexCmds.sub = LatexCmds.subset = bindBinaryOperator('\\subset ', '⊂', 'subset'); +// LatexCmds.sup = LatexCmds.supset = LatexCmds.superset = bindBinaryOperator('\\supset ', '⊃', 'superset'); +// LatexCmds.nsub = LatexCmds.notsub = LatexCmds.nsubset = LatexCmds.notsubset = bindBinaryOperator( +// '\\not\\subset ', +// '⊄', +// 'not a subset' +// ); +// LatexCmds.nsup = LatexCmds.notsup = LatexCmds.nsupset = LatexCmds.notsupset = LatexCmds.nsuperset = LatexCmds.notsuperset = bindBinaryOperator( +// '\\not\\supset ', +// '⊅', +// 'not a superset' +// ); +// LatexCmds.sube = LatexCmds.subeq = LatexCmds.subsete = LatexCmds.subseteq = bindBinaryOperator( +// '\\subseteq ', +// '⊆', +// 'subset or equal to' +// ); +// LatexCmds.supe = LatexCmds.supeq = LatexCmds.supsete = LatexCmds.supseteq = LatexCmds.supersete = LatexCmds.superseteq = bindBinaryOperator( +// '\\supseteq ', +// '⊇', +// 'superset or equal to' +// ); +// LatexCmds.nsube = LatexCmds.nsubeq = LatexCmds.notsube = LatexCmds.notsubeq = LatexCmds.nsubsete = LatexCmds.nsubseteq = LatexCmds.notsubsete = LatexCmds.notsubseteq = bindBinaryOperator( +// '\\not\\subseteq ', +// '⊈', +// 'not subset or equal to' +// ); +// LatexCmds.nsupe = LatexCmds.nsupeq = LatexCmds.notsupe = LatexCmds.notsupeq = LatexCmds.nsupsete = LatexCmds.nsupseteq = LatexCmds.notsupsete = LatexCmds.notsupseteq = LatexCmds.nsupersete = LatexCmds.nsuperseteq = LatexCmds.notsupersete = LatexCmds.notsuperseteq = bindBinaryOperator( +// '\\not\\supseteq ', +// '⊉', +// 'not superset or equal to' +// ); +// //the canonical sets of numbers +// LatexCmds.mathbb = /** @class */ (function (_super) { +// __extends(class_3, _super); +// function class_3() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// class_3.prototype.createLeftOf = function (_cursor) {}; +// class_3.prototype.numBlocks = function () { +// return 1; +// }; +// class_3.prototype.parser = function () { +// var string = Parser.string; +// var regex = Parser.regex; +// var optWhitespace = Parser.optWhitespace; +// return optWhitespace +// .then(string('{')) +// .then(optWhitespace) +// .then(regex(/^[NPZQRCH]/)) +// .skip(optWhitespace) +// .skip(string('}')) +// .map(function (c) { +// // instantiate the class for the matching char +// var cmd = LatexCmds[c]; +// if (isMQNodeClass(cmd)) { +// return new cmd(); +// } else { +// return cmd(); +// } +// }); +// }; +// return class_3; +// })(MathCommand); +// LatexCmds.N = LatexCmds.naturals = LatexCmds.Naturals = bindVanillaSymbol('\\mathbb{N}', 'ℕ', 'naturals'); +// LatexCmds.P = LatexCmds.primes = LatexCmds.Primes = LatexCmds.projective = LatexCmds.Projective = LatexCmds.probability = LatexCmds.Probability = bindVanillaSymbol( +// '\\mathbb{P}', +// 'ℙ', +// 'P' +// ); +// LatexCmds.Z = LatexCmds.integers = LatexCmds.Integers = bindVanillaSymbol('\\mathbb{Z}', 'ℤ', 'integers'); +// LatexCmds.Q = LatexCmds.rationals = LatexCmds.Rationals = bindVanillaSymbol( +// '\\mathbb{Q}', +// 'ℚ', +// 'rationals' +// ); +// LatexCmds.R = LatexCmds.reals = LatexCmds.Reals = bindVanillaSymbol('\\mathbb{R}', 'ℝ', 'reals'); +// LatexCmds.C = LatexCmds.complex = LatexCmds.Complex = LatexCmds.complexes = LatexCmds.Complexes = LatexCmds.complexplane = LatexCmds.Complexplane = LatexCmds.ComplexPlane = bindVanillaSymbol( +// '\\mathbb{C}', +// 'ℂ', +// 'complexes' +// ); +// LatexCmds.H = LatexCmds.Hamiltonian = LatexCmds.quaternions = LatexCmds.Quaternions = bindVanillaSymbol( +// '\\mathbb{H}', +// 'ℍ', +// 'quaternions' +// ); +// //spacing +// LatexCmds.quad = LatexCmds.emsp = bindVanillaSymbol('\\quad ', ' ', '4 spaces'); +// LatexCmds.qquad = bindVanillaSymbol('\\qquad ', ' ', '8 spaces'); +// /* spacing special characters, gonna have to implement this in LatexCommandInput::onText somehow +// case ',': +// return VanillaSymbol('\\, ',' ', 'comma'); +// case ':': +// return VanillaSymbol('\\: ',' ', 'colon'); +// case ';': +// return VanillaSymbol('\\; ',' ', 'semicolon'); +// case '!': +// return MQSymbol('\\! ','', 'exclamation point'); +// */ +// //binary operators +// LatexCmds.diamond = bindVanillaSymbol('\\diamond ', '◇', 'diamond'); +// LatexCmds.bigtriangleup = bindVanillaSymbol('\\bigtriangleup ', '△', 'triangle up'); +// LatexCmds.ominus = bindVanillaSymbol('\\ominus ', '⊖', 'o minus'); +// LatexCmds.uplus = bindVanillaSymbol('\\uplus ', '⊎', 'disjoint union'); +// LatexCmds.bigtriangledown = bindVanillaSymbol('\\bigtriangledown ', '▽', 'triangle down'); +// LatexCmds.sqcap = bindVanillaSymbol('\\sqcap ', '⊓', 'greatest lower bound'); +// LatexCmds.triangleleft = bindVanillaSymbol('\\triangleleft ', '⊲', 'triangle left'); +// LatexCmds.sqcup = bindVanillaSymbol('\\sqcup ', '⊔', 'least upper bound'); +// LatexCmds.triangleright = bindVanillaSymbol('\\triangleright ', '⊳', 'triangle right'); +// //circledot is not a not real LaTex command see https://github.com/mathquill/mathquill/pull/552 for more details +// LatexCmds.odot = LatexCmds.circledot = bindVanillaSymbol('\\odot ', '⊙', 'circle dot'); +// LatexCmds.bigcirc = bindVanillaSymbol('\\bigcirc ', '◯', 'circle'); +// LatexCmds.dagger = bindVanillaSymbol('\\dagger ', '†', 'dagger'); +// LatexCmds.ddagger = bindVanillaSymbol('\\ddagger ', '‡', 'big dagger'); +// LatexCmds.wr = bindVanillaSymbol('\\wr ', '≀', 'wreath'); +// LatexCmds.amalg = bindVanillaSymbol('\\amalg ', '∐', 'amalgam'); +// //relationship symbols +// LatexCmds.models = bindVanillaSymbol('\\models ', '⊨', 'models'); +// LatexCmds.prec = bindVanillaSymbol('\\prec ', '≺', 'precedes'); +// LatexCmds.succ = bindVanillaSymbol('\\succ ', '≻', 'succeeds'); +// LatexCmds.preceq = bindVanillaSymbol('\\preceq ', '≼', 'precedes or equals'); +// LatexCmds.succeq = bindVanillaSymbol('\\succeq ', '≽', 'succeeds or equals'); +// LatexCmds.simeq = bindVanillaSymbol('\\simeq ', '≃', 'similar or equal to'); +// LatexCmds.mid = bindVanillaSymbol('\\mid ', '∣', 'divides'); +// LatexCmds.ll = bindVanillaSymbol('\\ll ', '≪', 'll'); +// LatexCmds.gg = bindVanillaSymbol('\\gg ', '≫', 'gg'); +// LatexCmds.parallel = bindVanillaSymbol('\\parallel ', '∥', 'parallel with'); +// LatexCmds.nparallel = bindVanillaSymbol('\\nparallel ', '∦', 'not parallel with'); +// LatexCmds.bowtie = bindVanillaSymbol('\\bowtie ', '⋈', 'bowtie'); +// LatexCmds.sqsubset = bindVanillaSymbol('\\sqsubset ', '⊏', 'square subset'); +// LatexCmds.sqsupset = bindVanillaSymbol('\\sqsupset ', '⊐', 'square superset'); +// LatexCmds.smile = bindVanillaSymbol('\\smile ', '⌣', 'smile'); +// LatexCmds.sqsubseteq = bindVanillaSymbol('\\sqsubseteq ', '⊑', 'square subset or equal to'); +// LatexCmds.sqsupseteq = bindVanillaSymbol('\\sqsupseteq ', '⊒', 'square superset or equal to'); +// LatexCmds.doteq = bindVanillaSymbol('\\doteq ', '≐', 'dotted equals'); +// LatexCmds.frown = bindVanillaSymbol('\\frown ', '⌢', 'frown'); +// LatexCmds.vdash = bindVanillaSymbol('\\vdash ', '⊦', 'v dash'); +// LatexCmds.dashv = bindVanillaSymbol('\\dashv ', '⊣', 'dash v'); +// LatexCmds.nless = bindVanillaSymbol('\\nless ', '≮', 'not less than'); +// LatexCmds.ngtr = bindVanillaSymbol('\\ngtr ', '≯', 'not greater than'); +// //arrows +// LatexCmds.longleftarrow = bindVanillaSymbol('\\longleftarrow ', '←', 'left arrow'); +// LatexCmds.longrightarrow = bindVanillaSymbol('\\longrightarrow ', '→', 'right arrow'); +// LatexCmds.Longleftarrow = bindVanillaSymbol('\\Longleftarrow ', '⇐', 'left arrow'); +// LatexCmds.Longrightarrow = bindVanillaSymbol('\\Longrightarrow ', '⇒', 'right arrow'); +// LatexCmds.longleftrightarrow = bindVanillaSymbol('\\longleftrightarrow ', '↔', 'left and right arrow'); +// LatexCmds.updownarrow = bindVanillaSymbol('\\updownarrow ', '↕', 'up and down arrow'); +// LatexCmds.Longleftrightarrow = bindVanillaSymbol('\\Longleftrightarrow ', '⇔', 'left and right arrow'); +// LatexCmds.Updownarrow = bindVanillaSymbol('\\Updownarrow ', '⇕', 'up and down arrow'); +// LatexCmds.mapsto = bindVanillaSymbol('\\mapsto ', '↦', 'maps to'); +// LatexCmds.nearrow = bindVanillaSymbol('\\nearrow ', '↗', 'northeast arrow'); +// LatexCmds.hookleftarrow = bindVanillaSymbol('\\hookleftarrow ', '↩', 'hook left arrow'); +// LatexCmds.hookrightarrow = bindVanillaSymbol('\\hookrightarrow ', '↪', 'hook right arrow'); +// LatexCmds.searrow = bindVanillaSymbol('\\searrow ', '↘', 'southeast arrow'); +// LatexCmds.leftharpoonup = bindVanillaSymbol('\\leftharpoonup ', '↼', 'left harpoon up'); +// LatexCmds.rightharpoonup = bindVanillaSymbol('\\rightharpoonup ', '⇀', 'right harpoon up'); +// LatexCmds.swarrow = bindVanillaSymbol('\\swarrow ', '↙', 'southwest arrow'); +// LatexCmds.leftharpoondown = bindVanillaSymbol('\\leftharpoondown ', '↽', 'left harpoon down'); +// LatexCmds.rightharpoondown = bindVanillaSymbol('\\rightharpoondown ', '⇁', 'right harpoon down'); +// LatexCmds.nwarrow = bindVanillaSymbol('\\nwarrow ', '↖', 'northwest arrow'); +// //Misc +// LatexCmds.ldots = bindVanillaSymbol('\\ldots ', '…', 'l dots'); +// LatexCmds.cdots = bindVanillaSymbol('\\cdots ', '⋯', 'c dots'); +// LatexCmds.vdots = bindVanillaSymbol('\\vdots ', '⋮', 'v dots'); +// LatexCmds.ddots = bindVanillaSymbol('\\ddots ', '⋱', 'd dots'); +// LatexCmds.surd = bindVanillaSymbol('\\surd ', '√', 'unresolved root'); +// LatexCmds.triangle = bindVanillaSymbol('\\triangle ', '△', 'triangle'); +// LatexCmds.ell = bindVanillaSymbol('\\ell ', 'ℓ', 'ell'); +// LatexCmds.top = bindVanillaSymbol('\\top ', '⊤', 'top'); +// LatexCmds.flat = bindVanillaSymbol('\\flat ', '♭', 'flat'); +// LatexCmds.natural = bindVanillaSymbol('\\natural ', '♮', 'natural'); +// LatexCmds.sharp = bindVanillaSymbol('\\sharp ', '♯', 'sharp'); +// LatexCmds.wp = bindVanillaSymbol('\\wp ', '℘', 'wp'); +// LatexCmds.bot = bindVanillaSymbol('\\bot ', '⊥', 'bot'); +// LatexCmds.clubsuit = bindVanillaSymbol('\\clubsuit ', '♣', 'club suit'); +// LatexCmds.diamondsuit = bindVanillaSymbol('\\diamondsuit ', '♢', 'diamond suit'); +// LatexCmds.heartsuit = bindVanillaSymbol('\\heartsuit ', '♡', 'heart suit'); +// LatexCmds.spadesuit = bindVanillaSymbol('\\spadesuit ', '♠', 'spade suit'); +// //not real LaTex command see https://github.com/mathquill/mathquill/pull/552 for more details +// LatexCmds.parallelogram = bindVanillaSymbol('\\parallelogram ', '▱', 'parallelogram'); +// LatexCmds.square = bindVanillaSymbol('\\square ', '⬜', 'square'); +// //variable-sized +// LatexCmds.oint = bindVanillaSymbol('\\oint ', '∮', 'o int'); +// LatexCmds.bigcap = bindVanillaSymbol('\\bigcap ', '∩', 'big cap'); +// LatexCmds.bigcup = bindVanillaSymbol('\\bigcup ', '∪', 'big cup'); +// LatexCmds.bigsqcup = bindVanillaSymbol('\\bigsqcup ', '⊔', 'big square cup'); +// LatexCmds.bigvee = bindVanillaSymbol('\\bigvee ', '∨', 'big vee'); +// LatexCmds.bigwedge = bindVanillaSymbol('\\bigwedge ', '∧', 'big wedge'); +// LatexCmds.bigodot = bindVanillaSymbol('\\bigodot ', '⊙', 'big o dot'); +// LatexCmds.bigotimes = bindVanillaSymbol('\\bigotimes ', '⊗', 'big o times'); +// LatexCmds.bigoplus = bindVanillaSymbol('\\bigoplus ', '⊕', 'big o plus'); +// LatexCmds.biguplus = bindVanillaSymbol('\\biguplus ', '⊎', 'big u plus'); +// //delimiters +// LatexCmds.lfloor = bindVanillaSymbol('\\lfloor ', '⌊', 'left floor'); +// LatexCmds.rfloor = bindVanillaSymbol('\\rfloor ', '⌋', 'right floor'); +// LatexCmds.lceil = bindVanillaSymbol('\\lceil ', '⌈', 'left ceiling'); +// LatexCmds.rceil = bindVanillaSymbol('\\rceil ', '⌉', 'right ceiling'); +// LatexCmds.opencurlybrace = LatexCmds.lbrace = bindVanillaSymbol('\\lbrace ', '{', 'left brace'); +// LatexCmds.closecurlybrace = LatexCmds.rbrace = bindVanillaSymbol('\\rbrace ', '}', 'right brace'); +// LatexCmds.lbrack = bindVanillaSymbol('[', 'left bracket'); +// LatexCmds.rbrack = bindVanillaSymbol(']', 'right bracket'); +// //various symbols +// LatexCmds.slash = bindVanillaSymbol('/', 'slash'); +// LatexCmds.vert = bindVanillaSymbol('|', 'vertical bar'); +// LatexCmds.perp = LatexCmds.perpendicular = bindVanillaSymbol('\\perp ', '⊥', 'perpendicular'); +// LatexCmds.nabla = LatexCmds.del = bindVanillaSymbol('\\nabla ', '∇'); +// LatexCmds.hbar = bindVanillaSymbol('\\hbar ', 'ℏ', 'horizontal bar'); +// LatexCmds.AA = LatexCmds.Angstrom = LatexCmds.angstrom = bindVanillaSymbol('\\text\\AA ', 'Å', 'AA'); +// LatexCmds.ring = LatexCmds.circ = LatexCmds.circle = bindVanillaSymbol('\\circ ', '∘', 'circle'); +// LatexCmds.bull = LatexCmds.bullet = bindVanillaSymbol('\\bullet ', '•', 'bullet'); +// LatexCmds.setminus = LatexCmds.smallsetminus = bindVanillaSymbol('\\setminus ', '∖', 'set minus'); +// LatexCmds.not = LatexCmds['\u00ac'] = LatexCmds.neg = bindVanillaSymbol('\\neg ', '¬', 'not'); //bind(MQSymbol,'\\not ','/', 'not'); +// LatexCmds[ +// '\u2026' +// ] = LatexCmds.dots = LatexCmds.ellip = LatexCmds.hellip = LatexCmds.ellipsis = LatexCmds.hellipsis = bindVanillaSymbol( +// '\\dots ', +// '…', +// 'ellipsis' +// ); +// LatexCmds.converges = LatexCmds.darr = LatexCmds.dnarr = LatexCmds.dnarrow = LatexCmds.downarrow = bindVanillaSymbol( +// '\\downarrow ', +// '↓', +// 'converges with' +// ); +// LatexCmds.dArr = LatexCmds.dnArr = LatexCmds.dnArrow = LatexCmds.Downarrow = bindVanillaSymbol( +// '\\Downarrow ', +// '⇓', +// 'down arrow' +// ); +// LatexCmds.diverges = LatexCmds.uarr = LatexCmds.uparrow = bindVanillaSymbol( +// '\\uparrow ', +// '↑', +// 'diverges from' +// ); +// LatexCmds.uArr = LatexCmds.Uparrow = bindVanillaSymbol('\\Uparrow ', '⇑', 'up arrow'); +// LatexCmds.rarr = LatexCmds.rightarrow = bindVanillaSymbol('\\rightarrow ', '→', 'right arrow'); +// LatexCmds.implies = bindBinaryOperator('\\Rightarrow ', '⇒', 'implies'); +// LatexCmds.rArr = LatexCmds.Rightarrow = bindVanillaSymbol('\\Rightarrow ', '⇒', 'right arrow'); +// LatexCmds.gets = bindBinaryOperator('\\gets ', '←', 'gets'); +// LatexCmds.larr = LatexCmds.leftarrow = bindVanillaSymbol('\\leftarrow ', '←', 'left arrow'); +// LatexCmds.impliedby = bindBinaryOperator('\\Leftarrow ', '⇐', 'implied by'); +// LatexCmds.lArr = LatexCmds.Leftarrow = bindVanillaSymbol('\\Leftarrow ', '⇐', 'left arrow'); +// LatexCmds.harr = LatexCmds.lrarr = LatexCmds.leftrightarrow = bindVanillaSymbol( +// '\\leftrightarrow ', +// '↔', +// 'left and right arrow' +// ); +// LatexCmds.iff = bindBinaryOperator('\\Leftrightarrow ', '⇔', 'if and only if'); +// LatexCmds.hArr = LatexCmds.lrArr = LatexCmds.Leftrightarrow = bindVanillaSymbol( +// '\\Leftrightarrow ', +// '⇔', +// 'left and right arrow' +// ); +// LatexCmds.Re = LatexCmds.Real = LatexCmds.real = bindVanillaSymbol('\\Re ', 'ℜ', 'real'); +// LatexCmds.Im = LatexCmds.imag = LatexCmds.image = LatexCmds.imagin = LatexCmds.imaginary = LatexCmds.Imaginary = bindVanillaSymbol( +// '\\Im ', +// 'ℑ', +// 'imaginary' +// ); +// LatexCmds.part = LatexCmds.partial = bindVanillaSymbol('\\partial ', '∂', 'partial'); +// LatexCmds.pounds = bindVanillaSymbol('\\pounds ', '£'); +// LatexCmds.alef = LatexCmds.alefsym = LatexCmds.aleph = LatexCmds.alephsym = bindVanillaSymbol( +// '\\aleph ', +// 'ℵ', +// 'alef sym' +// ); +// LatexCmds.xist = LatexCmds.xists = LatexCmds.exist = LatexCmds.exists = bindVanillaSymbol( //LOL +// '\\exists ', +// '∃', +// 'there exists at least 1' +// ); +// LatexCmds.nexists = LatexCmds.nexist = bindVanillaSymbol('\\nexists ', '∄', 'there is no'); +// LatexCmds.and = LatexCmds.land = LatexCmds.wedge = bindBinaryOperator('\\wedge ', '∧', 'and'); +// LatexCmds.or = LatexCmds.lor = LatexCmds.vee = bindBinaryOperator('\\vee ', '∨', 'or'); +// LatexCmds.o = LatexCmds.O = LatexCmds.empty = LatexCmds.emptyset = LatexCmds.oslash = LatexCmds.Oslash = LatexCmds.nothing = LatexCmds.varnothing = bindBinaryOperator( +// '\\varnothing ', +// '∅', +// 'nothing' +// ); +// LatexCmds.cup = LatexCmds.union = bindBinaryOperator('\\cup ', '∪', 'union'); +// LatexCmds.cap = LatexCmds.intersect = LatexCmds.intersection = bindBinaryOperator( +// '\\cap ', +// '∩', +// 'intersection' +// ); +// // FIXME: the correct LaTeX would be ^\circ but we can't parse that +// LatexCmds.deg = LatexCmds.degree = bindVanillaSymbol('\\degree ', '°', 'degrees'); +// LatexCmds.ang = LatexCmds.angle = bindVanillaSymbol('\\angle ', '∠', 'angle'); +// LatexCmds.measuredangle = bindVanillaSymbol('\\measuredangle ', '∡', 'measured angle'); +// /********************************* +// * Symbols for Basic Mathematics +// ********************************/ +// var DigitGroupingChar = /** @class */ (function (_super) { +// __extends(DigitGroupingChar, _super); +// function DigitGroupingChar() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// DigitGroupingChar.prototype.finalizeTree = function (opts, dir) { +// this.sharedSiblingMethod(opts, dir); +// }; +// DigitGroupingChar.prototype.siblingDeleted = function (opts, dir) { +// this.sharedSiblingMethod(opts, dir); +// }; +// DigitGroupingChar.prototype.siblingCreated = function (opts, dir) { +// this.sharedSiblingMethod(opts, dir); +// }; +// DigitGroupingChar.prototype.sharedSiblingMethod = function (opts, dir) { +// // don't try to fix digit grouping if the sibling to my right changed (dir === R or +// // undefined) and it's now a DigitGroupingChar, it will try to fix grouping +// if (dir !== L && this[R] instanceof DigitGroupingChar) return; +// this.fixDigitGrouping(opts); +// }; +// DigitGroupingChar.prototype.fixDigitGrouping = function (opts) { +// if (!opts.enableDigitGrouping) return; +// var left = this; +// var right = this; +// var spacesFound = 0; +// var dots = []; +// var SPACE = '\\ '; +// var DOT = '.'; +// // traverse left as far as possible (starting at this char) +// var node = left; +// do { +// if (/^[0-9]$/.test(node.ctrlSeq)) { +// left = node; +// } else if (node.ctrlSeq === SPACE) { +// left = node; +// spacesFound += 1; +// } else if (node.ctrlSeq === DOT) { +// left = node; +// dots.push(node); +// } else { +// break; +// } +// } while ((node = left[L])); +// // traverse right as far as possible (starting to right of this char) +// while ((node = right[R])) { +// if (/^[0-9]$/.test(node.ctrlSeq)) { +// right = node; +// } else if (node.ctrlSeq === SPACE) { +// right = node; +// spacesFound += 1; +// } else if (node.ctrlSeq === DOT) { +// right = node; +// dots.push(node); +// } else { +// break; +// } +// } +// // trim the leading spaces +// while (right !== left && left && left.ctrlSeq === SPACE) { +// left = left[R]; +// spacesFound -= 1; +// } +// // trim the trailing spaces +// while (right !== left && right && right.ctrlSeq === SPACE) { +// right = right[L]; +// spacesFound -= 1; +// } +// // happens when you only have a space +// if (left === right && left && left.ctrlSeq === SPACE) return; +// var disableFormatting = spacesFound > 0 || dots.length > 1; +// if (disableFormatting) { +// this.removeGroupingBetween(left, right); +// } else if (dots[0]) { +// if (dots[0] !== left) { +// this.addGroupingBetween(dots[0][L], left); +// } +// if (dots[0] !== right) { +// // we do not show grouping to the right of a decimal place #yet +// this.removeGroupingBetween(dots[0][R], right); +// } +// } else { +// this.addGroupingBetween(right, left); +// } +// }; +// DigitGroupingChar.prototype.removeGroupingBetween = function (left, right) { +// var node = left; +// do { +// if (node instanceof DigitGroupingChar) { +// node.setGroupingClass(undefined); +// } +// if (!node || node === right) break; +// } while ((node = node[R])); +// }; +// DigitGroupingChar.prototype.addGroupingBetween = function (start, end) { +// var node = start; +// var count = 0; +// var totalDigits = 0; +// var node = start; +// while (node) { +// totalDigits += 1; +// if (node === end) break; +// node = node[L]; +// } +// var numDigitsInFirstGroup = totalDigits % 3; +// if (numDigitsInFirstGroup === 0) numDigitsInFirstGroup = 3; +// var node = start; +// while (node) { +// count += 1; +// var cls = undefined; +// // only do grouping if we have at least 4 numbers +// if (totalDigits >= 4) { +// if (count === totalDigits) { +// cls = 'dcg-mq-group-leading-' + numDigitsInFirstGroup; +// } else if (count % 3 === 0) { +// if (count !== totalDigits) { +// cls = 'dcg-mq-group-start'; +// } +// } +// if (!cls) { +// cls = 'dcg-mq-group-other'; +// } +// } +// if (node instanceof DigitGroupingChar) { +// node.setGroupingClass(cls); +// } +// if (node === end) break; +// node = node[L]; +// } +// }; +// DigitGroupingChar.prototype.setGroupingClass = function (cls) { +// // nothing changed (either class is the same or it's still undefined) +// if (this._groupingClass === cls) return; +// // remove existing class +// if (this._groupingClass) this.domFrag().removeClass(this._groupingClass); +// // add new class +// if (cls) this.domFrag().addClass(cls); +// // cache the groupingClass +// this._groupingClass = cls; +// }; +// return DigitGroupingChar; +// })(MQSymbol); +// var Digit = /** @class */ (function (_super) { +// __extends(Digit, _super); +// function Digit(ch, mathspeak) { +// return ( +// _super.call(this, ch, h('span', { class: 'dcg-mq-digit' }, [h.text(ch)]), undefined, mathspeak) || +// this +// ); +// } +// Digit.prototype.createLeftOf = function (cursor) { +// var cursorL = cursor[L]; +// var cursorLL = cursorL && cursorL[L]; +// var cursorParentParentSub = +// cursor.parent.parent instanceof SupSub ? cursor.parent.parent.sub : undefined; +// if ( +// cursor.options.autoSubscriptNumerals && +// cursor.parent !== cursorParentParentSub && +// ((cursorL instanceof Variable && cursorL.isItalic !== false) || +// (cursorL instanceof SupSub && cursorLL instanceof Variable && cursorLL.isItalic !== false)) +// ) { +// new SubscriptCommand().createLeftOf(cursor); +// _super.prototype.createLeftOf.call(this, cursor); +// cursor.insRightOf(cursor.parent.parent); +// } else _super.prototype.createLeftOf.call(this, cursor); +// }; +// Digit.prototype.mathspeak = function (opts) { +// if (opts && opts.createdLeftOf) { +// var cursor = opts.createdLeftOf; +// var cursorL = cursor[L]; +// var cursorLL = cursorL && cursorL[L]; +// var cursorParentParentSub = +// cursor.parent.parent instanceof SupSub ? cursor.parent.parent.sub : undefined; +// if ( +// cursor.options.autoSubscriptNumerals && +// cursor.parent !== cursorParentParentSub && +// ((cursorL instanceof Variable && cursorL.isItalic !== false) || +// (cursor[L] instanceof SupSub && +// cursorLL instanceof Variable && +// cursorLL.isItalic !== false)) +// ) { +// return 'Subscript ' + _super.prototype.mathspeak.call(this) + ' Baseline'; +// } +// } +// return _super.prototype.mathspeak.call(this); +// }; +// return Digit; +// })(DigitGroupingChar); +// var Variable = /** @class */ (function (_super) { +// __extends(Variable, _super); +// function Variable(chOrCtrlSeq, html) { +// return _super.call(this, chOrCtrlSeq, h('var', {}, [html || h.text(chOrCtrlSeq)])) || this; +// } +// Variable.prototype.text = function () { +// var text = this.ctrlSeq || ''; +// if (this.isPartOfOperator) { +// if (text[0] == '\\') { +// text = text.slice(1, text.length); +// } else if (text[text.length - 1] == ' ') { +// text = text.slice(0, -1); +// } +// } else { +// if ( +// this[L] && +// !(this[L] instanceof Variable) && +// !(this[L] instanceof BinaryOperator) && +// this[L].ctrlSeq !== '\\ ' +// ) +// text = '*' + text; +// if (this[R] && !(this[R] instanceof BinaryOperator) && !(this[R] instanceof SupSub)) text += '*'; +// } +// return text; +// }; +// Variable.prototype.mathspeak = function () { +// var text = this.ctrlSeq || ''; +// if ( +// this.isPartOfOperator || +// text.length > 1 || +// (this.parent && this.parent.parent && this.parent.parent.isTextBlock()) +// ) { +// return _super.prototype.mathspeak.call(this); +// } else { +// // Apple voices in VoiceOver (such as Alex, Bruce, and Victoria) do +// // some strange pronunciation given certain expressions, +// // e.g. "y-2" is spoken as "ee minus 2" (as if the y is short). +// // Not an ideal solution, but surrounding non-numeric text blocks with quotation marks works. +// // This bug has been acknowledged by Apple. +// return '"' + text + '"'; +// } +// }; +// return Variable; +// })(MQSymbol); +// function bindVariable(ch, htmlEntity, _unusedMathspeak) { +// return function () { +// return new Variable(ch, h.entityText(htmlEntity)); +// }; +// } +// Options.prototype.autoCommands = { +// _maxLength: 0, +// }; +// baseOptionProcessors.autoCommands = function (cmds) { +// if (typeof cmds !== 'string' || !/^[a-z]+(?: [a-z]+)*$/i.test(cmds)) { +// throw '"' + cmds + '" not a space-delimited list of only letters'; +// } +// var list = cmds.split(' '); +// var dict = {}; +// var maxLength = 0; +// for (var i = 0; i < list.length; i += 1) { +// var cmd = list[i]; +// if (cmd.length < 2) { +// throw 'autocommand "' + cmd + '" not minimum length of 2'; +// } +// if (LatexCmds[cmd] === OperatorName) { +// throw '"' + cmd + '" is a built-in operator name'; +// } +// dict[cmd] = 1; +// maxLength = max(maxLength, cmd.length); +// } +// dict._maxLength = maxLength; +// return dict; +// }; +// Options.prototype.quietEmptyDelimiters = {}; +// baseOptionProcessors.quietEmptyDelimiters = function (dlms) { +// if (dlms === void 0) { +// dlms = ''; +// } +// var list = dlms.split(' '); +// var dict = {}; +// for (var i = 0; i < list.length; i += 1) { +// var dlm = list[i]; +// dict[dlm] = 1; +// } +// return dict; +// }; +// Options.prototype.autoParenthesizedFunctions = { _maxLength: 0 }; +// baseOptionProcessors.autoParenthesizedFunctions = function (cmds) { +// if (typeof cmds !== 'string' || !/^[a-z]+(?: [a-z]+)*$/i.test(cmds)) { +// throw '"' + cmds + '" not a space-delimited list of only letters'; +// } +// var list = cmds.split(' '); +// var dict = {}; +// var maxLength = 0; +// for (var i = 0; i < list.length; i += 1) { +// var cmd = list[i]; +// if (cmd.length < 2) { +// throw 'autocommand "' + cmd + '" not minimum length of 2'; +// } +// dict[cmd] = 1; +// maxLength = max(maxLength, cmd.length); +// } +// dict._maxLength = maxLength; +// return dict; +// }; +// var Letter = /** @class */ (function (_super) { +// __extends(Letter, _super); +// function Letter(ch) { +// var _this_1 = _super.call(this, ch) || this; +// _this_1.letter = ch; +// return _this_1; +// } +// Letter.prototype.checkAutoCmds = function (cursor) { +// //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. +// if (this.shouldIgnoreSubstitutionInSimpleSubscript(cursor.options)) { +// return; +// } +// //handle autoCommands +// var autoCmds = cursor.options.autoCommands; +// var maxLength = autoCmds._maxLength || 0; +// if (maxLength > 0) { +// // want longest possible autocommand, so join together longest +// // sequence of letters +// var str = ''; +// var l = this; +// var i = 0; +// // FIXME: l.ctrlSeq === l.letter checks if first or last in an operator name +// while (l instanceof Letter && l.ctrlSeq === l.letter && i < maxLength) { +// str = l.letter + str; +// l = l[L]; +// i += 1; +// } +// // check for an autocommand, going thru substrings longest to shortest +// while (str.length) { +// if (autoCmds.hasOwnProperty(str)) { +// l = this; +// for (i = 1; l && i < str.length; i += 1, l = l[L]); +// new Fragment(l, this).remove(); +// cursor[L] = l[L]; +// var cmd = LatexCmds[str]; +// var node; +// if (isMQNodeClass(cmd)) { +// node = new cmd(str); // TODO - How do we know that this class expects a single str input? +// } else { +// node = cmd(str); +// } +// return node.createLeftOf(cursor); +// } +// str = str.slice(1); +// } +// } +// }; +// Letter.prototype.autoParenthesize = function (cursor) { +// //exit early if already parenthesized +// var right = cursor.parent.getEnd(R); +// if (right && right instanceof Bracket && right.ctrlSeq === '\\left(') { +// return; +// } +// //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. +// if (this.shouldIgnoreSubstitutionInSimpleSubscript(cursor.options)) { +// return; +// } +// //handle autoParenthesized functions +// var str = ''; +// var l = this; +// var i = 0; +// var autoParenthesizedFunctions = cursor.options.autoParenthesizedFunctions; +// var maxLength = autoParenthesizedFunctions._maxLength || 0; +// var autoOperatorNames = cursor.options.autoOperatorNames; +// while (l instanceof Letter && i < maxLength) { +// (str = l.letter + str), (l = l[L]), (i += 1); +// } +// // check for an autoParenthesized functions, going thru substrings longest to shortest +// // only allow autoParenthesized functions that are also autoOperatorNames +// while (str.length) { +// if (autoParenthesizedFunctions.hasOwnProperty(str) && autoOperatorNames.hasOwnProperty(str)) { +// return cursor.parent.write(cursor, '('); +// } +// str = str.slice(1); +// } +// }; +// Letter.prototype.createLeftOf = function (cursor) { +// _super.prototype.createLeftOf.call(this, cursor); +// this.checkAutoCmds(cursor); +// this.autoParenthesize(cursor); +// }; +// Letter.prototype.italicize = function (bool) { +// this.isItalic = bool; +// this.isPartOfOperator = !bool; +// this.domFrag().toggleClass('dcg-mq-operator-name', !bool); +// return this; +// }; +// Letter.prototype.finalizeTree = function (opts, dir) { +// this.sharedSiblingMethod(opts, dir); +// }; +// Letter.prototype.siblingDeleted = function (opts, dir) { +// this.sharedSiblingMethod(opts, dir); +// }; +// Letter.prototype.siblingCreated = function (opts, dir) { +// this.sharedSiblingMethod(opts, dir); +// }; +// Letter.prototype.sharedSiblingMethod = function (opts, dir) { +// // don't auto-un-italicize if the sibling to my right changed (dir === R or +// // undefined) and it's now a Letter, it will un-italicize everyone +// if (dir !== L && this[R] instanceof Letter) return; +// this.autoUnItalicize(opts); +// }; +// Letter.prototype.autoUnItalicize = function (opts) { +// var autoOps = opts.autoOperatorNames; +// if (autoOps._maxLength === 0) return; +// //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. +// if (this.shouldIgnoreSubstitutionInSimpleSubscript(opts)) { +// return; +// } +// // want longest possible operator names, so join together entire contiguous +// // sequence of letters +// var str = this.letter; +// for (var l = this[L]; l instanceof Letter; l = l[L]) str = l.letter + str; +// for (var r = this[R]; r instanceof Letter; r = r[R]) str += r.letter; +// // removeClass and delete flags from all letters before figuring out +// // which, if any, are part of an operator name +// var lR = l && l[R]; +// var rL = r && r[L]; +// new Fragment(lR || this.parent.getEnd(L), rL || this.parent.getEnd(R)).each(function (el) { +// if (el instanceof Letter) { +// el.italicize(true).domFrag().removeClass('dcg-mq-first dcg-mq-last dcg-mq-followed-by-supsub'); +// el.ctrlSeq = el.letter; +// } +// return undefined; +// }); +// var autoOpsLength = autoOps._maxLength || 0; +// // check for operator names: at each position from left to right, check +// // substrings from longest to shortest +// outer: for ( +// var i = 0, first = l[R] || this.parent.getEnd(L); +// first && i < str.length; +// i += 1, first = first[R] +// ) { +// for (var len = min(autoOpsLength, str.length - i); len > 0; len -= 1) { +// var word = str.slice(i, i + len); +// var last = undefined; // TODO - TS complaining that we use last before assigning to it +// if (autoOps.hasOwnProperty(word)) { +// for (var j = 0, letter = first; j < len; j += 1, letter = letter[R]) { +// if (letter instanceof Letter) { +// letter.italicize(false); +// last = letter; +// } +// } +// var isBuiltIn = BuiltInOpNames.hasOwnProperty(word); +// first.ctrlSeq = (isBuiltIn ? '\\' : '\\operatorname{') + first.ctrlSeq; +// last.ctrlSeq += isBuiltIn ? ' ' : '}'; +// if (TwoWordOpNames.hasOwnProperty(word)) { +// var lastL = last[L]; +// var lastLL = lastL && lastL[L]; +// var lastLLL = lastLL && lastLL[L]; +// lastLLL.domFrag().addClass('dcg-mq-last'); +// } +// if (!this.shouldOmitPadding(first[L])) first.domFrag().addClass('dcg-mq-first'); +// if (!this.shouldOmitPadding(last[R])) { +// if (last[R] instanceof SupSub) { +// var supsub = last[R]; // XXX monkey-patching, but what's the right thing here? +// // Have operatorname-specific code in SupSub? A CSS-like language to style the +// // math tree, but which ignores cursor and selection (which CSS can't)? +// var respace = (supsub.siblingCreated = supsub.siblingDeleted = function () { +// supsub +// .domFrag() +// .toggleClass('dcg-mq-after-operator-name', !(supsub[R] instanceof Bracket)); +// }); +// respace(); +// } else { +// last.domFrag().toggleClass('dcg-mq-last', !(last[R] instanceof Bracket)); +// } +// } +// i += len - 1; +// first = last; +// continue outer; +// } +// } +// } +// }; +// Letter.prototype.shouldOmitPadding = function (node) { +// // omit padding if no node +// if (!node) return true; +// // do not add padding between letter and '.' +// if (node.ctrlSeq === '.') return true; +// // do not add padding between letter and binary operator. The +// // binary operator already has padding +// if (node instanceof BinaryOperator) return true; +// if (node instanceof SummationNotation) return true; +// return false; +// }; +// return Letter; +// })(Variable); +// var BuiltInOpNames = {}; // the set of operator names like \sin, \cos, etc that +// // are built-into LaTeX, see Section 3.17 of the Short Math Guide: http://tinyurl.com/jm9okjc +// // MathQuill auto-unitalicizes some operator names not in that set, like 'hcf' +// // and 'arsinh', which must be exported as \operatorname{hcf} and +// // \operatorname{arsinh}. Note: over/under line/arrow \lim variants like +// // \varlimsup are not supported +// // the set of operator names that MathQuill auto-unitalicizes by default; overridable +// Options.prototype.autoOperatorNames = defaultAutoOpNames(); +// var TwoWordOpNames = { limsup: 1, liminf: 1, projlim: 1, injlim: 1 }; +// function defaultAutoOpNames() { +// var AutoOpNames = { +// _maxLength: 9, +// }; +// var mostOps = ( +// 'arg deg det dim exp gcd hom inf ker lg lim ln log max min sup' + ' limsup liminf injlim projlim Pr' +// ).split(' '); +// for (var i = 0; i < mostOps.length; i += 1) { +// BuiltInOpNames[mostOps[i]] = AutoOpNames[mostOps[i]] = 1; +// } +// var builtInTrigs = 'sin cos tan arcsin arccos arctan sinh cosh tanh sec csc cot coth'.split( +// // why coth but not sech and csch, LaTeX? +// ' ' +// ); +// for (var i = 0; i < builtInTrigs.length; i += 1) { +// BuiltInOpNames[builtInTrigs[i]] = 1; +// } +// var autoTrigs = 'sin cos tan sec cosec csc cotan cot ctg'.split(' '); +// for (var i = 0; i < autoTrigs.length; i += 1) { +// AutoOpNames[autoTrigs[i]] = AutoOpNames['arc' + autoTrigs[i]] = AutoOpNames[ +// autoTrigs[i] + 'h' +// ] = AutoOpNames['ar' + autoTrigs[i] + 'h'] = AutoOpNames['arc' + autoTrigs[i] + 'h'] = 1; +// } +// // compat with some of the nonstandard LaTeX exported by MathQuill +// // before #247. None of these are real LaTeX commands so, seems safe +// var moreNonstandardOps = 'gcf hcf lcm proj span'.split(' '); +// for (var i = 0; i < moreNonstandardOps.length; i += 1) { +// AutoOpNames[moreNonstandardOps[i]] = 1; +// } +// return AutoOpNames; +// } +// baseOptionProcessors.autoOperatorNames = function (cmds) { +// if (typeof cmds !== 'string') { +// throw '"' + cmds + '" not a space-delimited list'; +// } +// if (!/^[a-z\|\-]+(?: [a-z\|\-]+)*$/i.test(cmds)) { +// throw '"' + cmds + '" not a space-delimited list of letters or "|"'; +// } +// var list = cmds.split(' '); +// var dict = {}; +// var maxLength = 0; +// for (var i = 0; i < list.length; i += 1) { +// var cmd = list[i]; +// if (cmd.length < 2) { +// throw '"' + cmd + '" not minimum length of 2'; +// } +// if (cmd.indexOf('|') < 0) { +// // normal auto operator +// dict[cmd] = cmd; +// maxLength = max(maxLength, cmd.length); +// } else { +// // this item has a speech-friendly alternative +// var cmdArray = cmd.split('|'); +// if (cmdArray.length > 2) { +// throw '"' + cmd + '" has more than 1 mathspeak delimiter'; +// } +// if (cmdArray[0].length < 2) { +// throw '"' + cmd[0] + '" not minimum length of 2'; +// } +// dict[cmdArray[0]] = cmdArray[1].replace(/-/g, ' '); // convert dashes to spaces for the sake of speech +// maxLength = max(maxLength, cmdArray[0].length); +// } +// } +// dict._maxLength = maxLength; +// return dict; +// }; +// var OperatorName = /** @class */ (function (_super) { +// __extends(OperatorName, _super); +// function OperatorName(fn) { +// return _super.call(this, fn || '') || this; +// } +// OperatorName.prototype.createLeftOf = function (cursor) { +// var fn = this.ctrlSeq; +// for (var i = 0; i < fn.length; i += 1) { +// new Letter(fn.charAt(i)).createLeftOf(cursor); +// } +// }; +// OperatorName.prototype.parser = function () { +// var fn = this.ctrlSeq; +// var block = new MathBlock(); +// for (var i = 0; i < fn.length; i += 1) { +// new Letter(fn.charAt(i)).adopt(block, block.getEnd(R), 0); +// } +// return Parser.succeed(block.children()); +// }; +// return OperatorName; +// })(MQSymbol); +// for (var fn in Options.prototype.autoOperatorNames) +// if (Options.prototype.autoOperatorNames.hasOwnProperty(fn)) { +// LatexCmds[fn] = OperatorName; +// } +// LatexCmds.operatorname = /** @class */ (function (_super) { +// __extends(class_4, _super); +// function class_4() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// class_4.prototype.createLeftOf = function () {}; +// class_4.prototype.numBlocks = function () { +// return 1; +// }; +// class_4.prototype.parser = function () { +// return latexMathParser.block.map(function (b) { +// // Check for the special case of \operatorname{ans}, which has +// // a special html representation +// var isAllLetters = true; +// var str = ''; +// var children = b.children(); +// children.each(function (child) { +// if (child instanceof Letter) { +// str += child.letter; +// } else { +// isAllLetters = false; +// } +// return undefined; +// }); +// if (isAllLetters && str === 'ans') { +// return AnsBuilder(); +// } +// // In cases other than `ans`, just return the children directly +// return children; +// }); +// }; +// return class_4; +// })(MathCommand); +// LatexCmds.f = /** @class */ (function (_super) { +// __extends(class_5, _super); +// function class_5() { +// var _this_1 = this; +// var letter = 'f'; +// _this_1 = _super.call(this, letter) || this; +// _this_1.letter = letter; +// _this_1.domView = new DOMView(0, function () { +// return h('var', { class: 'dcg-mq-f' }, [h.text('f')]); +// }); +// return _this_1; +// } +// class_5.prototype.italicize = function (bool) { +// // Why is this necesssary? Does someone replace the `f` at some +// // point? +// this.domFrag().eachElement(function (el) { +// return (el.textContent = 'f'); +// }); +// this.domFrag().toggleClass('dcg-mq-f', bool); +// return _super.prototype.italicize.call(this, bool); +// }; +// return class_5; +// })(Letter); +// // VanillaSymbol's +// LatexCmds[' '] = LatexCmds.space = function () { +// return new DigitGroupingChar('\\ ', h('span', {}, [h.text(U_NO_BREAK_SPACE)]), ' '); +// }; +// LatexCmds['.'] = function () { +// return new DigitGroupingChar('.', h('span', { class: 'dcg-mq-digit' }, [h.text('.')]), '.'); +// }; +// LatexCmds["'"] = LatexCmds.prime = bindVanillaSymbol("'", '′', 'prime'); +// LatexCmds['\u2033'] = LatexCmds.dprime = bindVanillaSymbol('\u2033', '″', 'double prime'); +// LatexCmds.backslash = bindVanillaSymbol('\\backslash ', '\\', 'backslash'); +// if (!CharCmds['\\']) CharCmds['\\'] = LatexCmds.backslash; +// LatexCmds.$ = bindVanillaSymbol('\\$', '$', 'dollar'); +// LatexCmds.square = bindVanillaSymbol('\\square ', '\u25A1', 'square'); +// LatexCmds.mid = bindVanillaSymbol('\\mid ', '\u2223', 'mid'); +// // does not use Symbola font +// var NonSymbolaSymbol = /** @class */ (function (_super) { +// __extends(NonSymbolaSymbol, _super); +// function NonSymbolaSymbol(ch, html, _unusedMathspeak) { +// return _super.call(this, ch, h('span', { class: 'dcg-mq-nonSymbola' }, [html || h.text(ch)])) || this; +// } +// return NonSymbolaSymbol; +// })(MQSymbol); +// LatexCmds['@'] = function () { +// return new NonSymbolaSymbol('@'); +// }; +// LatexCmds['&'] = function () { +// return new NonSymbolaSymbol('\\&', h.entityText('&'), 'and'); +// }; +// LatexCmds['%'] = /** @class */ (function (_super) { +// __extends(class_6, _super); +// function class_6() { +// return _super.call(this, '\\%', h.text('%'), 'percent') || this; +// } +// class_6.prototype.parser = function () { +// var optWhitespace = Parser.optWhitespace; +// var string = Parser.string; +// // Parse `\%\operatorname{of}` as special `percentof` node so that +// // it will be serialized properly and deleted as a unit. +// return optWhitespace +// .then( +// string('\\operatorname{of}').map(function () { +// return PercentOfBuilder(); +// }) +// ) +// .or(_super.prototype.parser.call(this)); +// }; +// return class_6; +// })(NonSymbolaSymbol); +// LatexCmds['\u2225'] = LatexCmds.parallel = bindVanillaSymbol('\\parallel ', '∥', 'parallel'); +// LatexCmds['\u2226'] = LatexCmds.nparallel = bindVanillaSymbol('\\nparallel ', '∦', 'not parallel'); +// LatexCmds['\u27c2'] = LatexCmds.perp = bindVanillaSymbol('\\perp ', '⟂', 'perpendicular'); +// //the following are all Greek to me, but this helped a lot: http://www.ams.org/STIX/ion/stixsig03.html +// //lowercase Greek letter variables +// LatexCmds.alpha = LatexCmds.beta = LatexCmds.gamma = LatexCmds.delta = LatexCmds.zeta = LatexCmds.eta = LatexCmds.theta = LatexCmds.iota = LatexCmds.kappa = LatexCmds.mu = LatexCmds.nu = LatexCmds.xi = LatexCmds.rho = LatexCmds.sigma = LatexCmds.tau = LatexCmds.chi = LatexCmds.psi = LatexCmds.omega = function ( +// latex +// ) { +// return new Variable('\\' + latex + ' ', h.entityText('&' + latex + ';')); +// }; +// //why can't anybody FUCKING agree on these +// LatexCmds.phi = bindVariable('\\phi ', 'ϕ', 'phi'); //W3C or Unicode? +// LatexCmds.phiv = LatexCmds.varphi = bindVariable('\\varphi ', 'φ', 'phi'); //Elsevier and 9573-13 //AMS and LaTeX +// LatexCmds.epsilon = bindVariable('\\epsilon ', 'ϵ', 'epsilon'); //W3C or Unicode? +// LatexCmds.epsiv = LatexCmds.varepsilon = bindVariable( +// //Elsevier and 9573-13 //AMS and LaTeX +// '\\varepsilon ', +// 'ε', +// 'epsilon' +// ); +// LatexCmds.piv = LatexCmds.varpi = bindVariable('\\varpi ', 'ϖ', 'piv'); //W3C/Unicode and Elsevier and 9573-13 //AMS and LaTeX +// LatexCmds.sigmaf = LatexCmds.sigmav = LatexCmds.varsigma = bindVariable('\\varsigma ', 'ς', 'sigma'); //W3C/Unicode //Elsevier //LaTeX +// LatexCmds.thetav = LatexCmds.vartheta = LatexCmds.thetasym = bindVariable('\\vartheta ', 'ϑ', 'theta'); //Elsevier and 9573-13 //AMS and LaTeX //W3C/Unicode +// LatexCmds.upsilon = LatexCmds.upsi = bindVariable( +// //AMS and LaTeX and W3C/Unicode //Elsevier and 9573-13 +// '\\upsilon ', +// 'υ', +// 'upsilon' +// ); +// //these aren't even mentioned in the HTML character entity references +// LatexCmds.gammad = LatexCmds.Gammad = LatexCmds.digamma = bindVariable('\\digamma ', 'ϝ', 'gamma'); //Elsevier //9573-13 -- WTF, right? I dunno if this was a typo in the reference (see above) //LaTeX +// LatexCmds.kappav = LatexCmds.varkappa = bindVariable( +// //Elsevier //AMS and LaTeX +// '\\varkappa ', +// 'ϰ', +// 'kappa' +// ); +// LatexCmds.rhov = LatexCmds.varrho = bindVariable('\\varrho ', 'ϱ', 'rho'); //Elsevier and 9573-13 //AMS and LaTeX +// //Greek constants, look best in non-italicized Times New Roman +// LatexCmds.pi = LatexCmds['\u03c0'] = function () { +// return new NonSymbolaSymbol('\\pi ', h.entityText('π'), 'pi'); +// }; +// LatexCmds.lambda = function () { +// return new NonSymbolaSymbol('\\lambda ', h.entityText('λ'), 'lambda'); +// }; +// //uppercase greek letters +// LatexCmds.Upsilon = LatexCmds.Upsi = LatexCmds.upsih = LatexCmds.Upsih = function () { //LaTeX //Elsevier and 9573-13 //W3C/Unicode "upsilon with hook" //'cos it makes sense to me +// return new MQSymbol( +// '\\Upsilon ', +// h('var', { style: 'font-family: serif' }, [h.entityText('ϒ')]), +// 'capital upsilon' +// ); +// }; //Symbola's 'upsilon with a hook' is a capital Y without hooks :( +// //other symbols with the same LaTeX command and HTML character entity reference +// LatexCmds.Gamma = LatexCmds.Delta = LatexCmds.Theta = LatexCmds.Lambda = LatexCmds.Xi = LatexCmds.Pi = LatexCmds.Sigma = LatexCmds.Phi = LatexCmds.Psi = LatexCmds.Omega = LatexCmds.forall = function ( +// latex +// ) { +// return new VanillaSymbol('\\' + latex + ' ', h.entityText('&' + latex + ';')); +// }; +// // symbols that aren't a single MathCommand, but are instead a whole +// // Fragment. Creates the Fragment from a LaTeX string +// var LatexFragment = /** @class */ (function (_super) { +// __extends(LatexFragment, _super); +// function LatexFragment(latex) { +// var _this_1 = _super.call(this) || this; +// _this_1.latexStr = latex; +// return _this_1; +// } +// LatexFragment.prototype.createLeftOf = function (cursor) { +// var block = latexMathParser.parse(this.latexStr); +// block.children().adopt(cursor.parent, cursor[L], cursor[R]); +// cursor[L] = block.getEnd(R); +// domFrag(block.html()).insertBefore(cursor.domFrag()); +// block.finalizeInsert(cursor.options, cursor); +// var blockEndsR = block.getEnd(R); +// var blockEndsRR = blockEndsR && blockEndsR[R]; +// if (blockEndsRR) blockEndsRR.siblingCreated(cursor.options, L); +// var blockEndsL = block.getEnd(L); +// var blockEndsLL = blockEndsL && blockEndsL[L]; +// if (blockEndsLL) blockEndsLL.siblingCreated(cursor.options, R); +// cursor.parent.bubble(function (node) { +// node.reflow(); +// return undefined; +// }); +// }; +// LatexFragment.prototype.mathspeak = function () { +// return latexMathParser.parse(this.latexStr).mathspeak(); +// }; +// LatexFragment.prototype.parser = function () { +// var frag = latexMathParser.parse(this.latexStr).children(); +// return Parser.succeed(frag); +// }; +// return LatexFragment; +// })(MathCommand); +// // for what seems to me like [stupid reasons][1], Unicode provides +// // subscripted and superscripted versions of all ten Arabic numerals, +// // as well as [so-called "vulgar fractions"][2]. +// // Nobody really cares about most of them, but some of them actually +// // predate Unicode, dating back to [ISO-8859-1][3], apparently also +// // known as "Latin-1", which among other things [Windows-1252][4] +// // largely coincides with, so Microsoft Word sometimes inserts them +// // and they get copy-pasted into MathQuill. +// // +// // (Irrelevant but funny story: though not a superset of Latin-1 aka +// // ISO-8859-1, Windows-1252 **is** a strict superset of the "closely +// // related but distinct"[3] "ISO 8859-1" -- see the lack of a dash +// // after "ISO"? Completely different character set, like elephants vs +// // elephant seals, or "Zombies" vs "Zombie Redneck Torture Family". +// // What kind of idiot would get them confused. +// // People in fact got them confused so much, it was so common to +// // mislabel Windows-1252 text as ISO-8859-1, that most modern web +// // browsers and email clients treat the MIME charset of ISO-8859-1 +// // as actually Windows-1252, behavior now standard in the HTML5 spec.) +// // +// // [1]: http://en.wikipedia.org/wiki/Unicode_subscripts_andsuper_scripts +// // [2]: http://en.wikipedia.org/wiki/Number_Forms +// // [3]: http://en.wikipedia.org/wiki/ISO/IEC_8859-1 +// // [4]: http://en.wikipedia.org/wiki/Windows-1252 +// LatexCmds['\u2070'] = function () { +// return new LatexFragment('^0'); +// }; +// LatexCmds['\u00b9'] = function () { +// return new LatexFragment('^1'); +// }; +// LatexCmds['\u00b2'] = function () { +// return new LatexFragment('^2'); +// }; +// LatexCmds['\u00b3'] = function () { +// return new LatexFragment('^3'); +// }; +// LatexCmds['\u2074'] = function () { +// return new LatexFragment('^4'); +// }; +// LatexCmds['\u2075'] = function () { +// return new LatexFragment('^5'); +// }; +// LatexCmds['\u2076'] = function () { +// return new LatexFragment('^6'); +// }; +// LatexCmds['\u2077'] = function () { +// return new LatexFragment('^7'); +// }; +// LatexCmds['\u2078'] = function () { +// return new LatexFragment('^8'); +// }; +// LatexCmds['\u2079'] = function () { +// return new LatexFragment('^9'); +// }; +// LatexCmds['\u00bc'] = function () { +// return new LatexFragment('\\frac14'); +// }; +// LatexCmds['\u00bd'] = function () { +// return new LatexFragment('\\frac12'); +// }; +// LatexCmds['\u00be'] = function () { +// return new LatexFragment('\\frac34'); +// }; +// // this is a hack to make pasting the \u221a symbol +// // actually insert a sqrt command. This isn't ideal, +// // but it's way better than what we have now. I think +// // before we invest any more time into this single character +// // we should consider how to make the pipe (|) automatically +// // insert absolute value. We also will want the percent (%) +// // to expand to '% of'. I've always just thought mathquill's +// // ability to handle pasted latex magical until I started actually +// // testing it. It's a lot more buggy that I previously thought. +// // +// // KNOWN ISSUES: +// // 1) pasting \u221a does not put focus in side the sqrt symbol +// // 2) pasting \u221a2 puts the 2 outside of the sqrt symbol. +// // +// // The first issue seems like we could invest more time into this to +// // fix it, but doesn't feel worth special casing. I think we'd want +// // to address it by addressing ALL pasting issues. +// // +// // The second issue seems like it might go away too if you fix paste to +// // act more like simply typing the characters out. I'd be scared to try +// // to make that change because I'm fairly confident I'd break something +// // around handling valid latex as latex rather than treating it as keystrokes. +// LatexCmds['\u221a'] = function () { +// return new LatexFragment('\\sqrt{}'); +// }; +// // Binary operator determination is used in several contexts for PlusMinus nodes and their descendants. +// // For instance, we set the item's class name based on this factor, and also assign different mathspeak values (plus vs positive, negative vs minus). +// function isBinaryOperator(node) { +// if (!node) return false; +// var nodeL = node[L]; +// if (nodeL) { +// // If the left sibling is a binary operator or a separator (comma, semicolon, colon, space) +// // or an open bracket (open parenthesis, open square bracket) +// // consider the operator to be unary +// if (nodeL instanceof BinaryOperator || /^(\\ )|[,;:\(\[]$/.test(nodeL.ctrlSeq)) { +// return false; +// } +// } else if (node.parent && node.parent.parent && node.parent.parent.isStyleBlock()) { +// //if we are in a style block at the leftmost edge, determine unary/binary based on +// //the style block +// //this allows style blocks to be transparent for unary/binary purposes +// return isBinaryOperator(node.parent.parent); +// } else { +// return false; +// } +// return true; +// } +// var PlusMinus = /** @class */ (function (_super) { +// __extends(class_7, _super); +// function class_7(ch, html, mathspeak) { +// return _super.call(this, ch, html, undefined, mathspeak, true) || this; +// } +// class_7.prototype.contactWeld = function (cursor, dir) { +// this.sharedSiblingMethod(cursor.options, dir); +// }; +// class_7.prototype.siblingCreated = function (opts, dir) { +// this.sharedSiblingMethod(opts, dir); +// }; +// class_7.prototype.siblingDeleted = function (opts, dir) { +// this.sharedSiblingMethod(opts, dir); +// }; +// class_7.prototype.sharedSiblingMethod = function (_opts, dir) { +// if (dir === R) return; // ignore if sibling only changed on the right +// this.domFrag().oneElement().className = isBinaryOperator(this) ? 'dcg-mq-binary-operator' : ''; +// return this; +// }; +// return class_7; +// })(BinaryOperator); +// LatexCmds['+'] = /** @class */ (function (_super) { +// __extends(class_8, _super); +// function class_8() { +// return _super.call(this, '+', h.text('+')) || this; +// } +// class_8.prototype.mathspeak = function () { +// return isBinaryOperator(this) ? 'plus' : 'positive'; +// }; +// return class_8; +// })(PlusMinus); +// //yes, these are different dashes, en-dash, em-dash, unicode minus, actual dash +// var MinusNode = /** @class */ (function (_super) { +// __extends(MinusNode, _super); +// function MinusNode() { +// return _super.call(this, '-', h.entityText('−')) || this; +// } +// MinusNode.prototype.mathspeak = function () { +// return isBinaryOperator(this) ? 'minus' : 'negative'; +// }; +// return MinusNode; +// })(PlusMinus); +// LatexCmds['\u2212'] = LatexCmds['\u2014'] = LatexCmds['\u2013'] = LatexCmds['-'] = MinusNode; +// LatexCmds['\u00b1'] = LatexCmds.pm = LatexCmds.plusmn = LatexCmds.plusminus = function () { +// return new PlusMinus('\\pm ', h.entityText('±'), 'plus-or-minus'); +// }; +// LatexCmds.mp = LatexCmds.mnplus = LatexCmds.minusplus = function () { +// return new PlusMinus('\\mp ', h.entityText('∓'), 'minus-or-plus'); +// }; +// CharCmds['*'] = LatexCmds.sdot = LatexCmds.cdot = bindBinaryOperator('\\cdot ', '·', '*', 'times'); //semantically should be ⋅, but · looks better +// var To = /** @class */ (function (_super) { +// __extends(To, _super); +// function To() { +// return _super.call(this, '\\to ', h.entityText('→'), 'to') || this; +// } +// To.prototype.deleteTowards = function (dir, cursor) { +// if (dir === L) { +// var l = cursor[L]; +// new Fragment(l, this).remove(); +// cursor[L] = l[L]; +// new MinusNode().createLeftOf(cursor); +// cursor[L].bubble(function (node) { +// node.reflow(); +// return undefined; +// }); +// return; +// } +// _super.prototype.deleteTowards.call(this, dir, cursor); +// }; +// return To; +// })(BinaryOperator); +// LatexCmds['\u2192'] = LatexCmds.to = To; +// var Inequality = /** @class */ (function (_super) { +// __extends(Inequality, _super); +// function Inequality(data, strict) { +// var _this_1 = this; +// var strictness = strict ? 'Strict' : ''; +// _this_1 = +// _super.call( +// this, +// data['ctrlSeq'.concat(strictness)], +// h.entityText(data['htmlEntity'.concat(strictness)]), +// data['text'.concat(strictness)], +// data['mathspeak'.concat(strictness)] +// ) || this; +// _this_1.data = data; +// _this_1.strict = strict; +// return _this_1; +// } +// Inequality.prototype.swap = function (strict) { +// this.strict = strict; +// var strictness = strict ? 'Strict' : ''; +// this.ctrlSeq = this.data['ctrlSeq'.concat(strictness)]; +// this.domFrag() +// .children() +// .replaceWith(domFrag(h.entityText(this.data['htmlEntity'.concat(strictness)]))); +// this.textTemplate = [this.data['text'.concat(strictness)]]; +// this.mathspeakName = this.data['mathspeak'.concat(strictness)]; +// }; +// Inequality.prototype.deleteTowards = function (dir, cursor) { +// if (dir === L && !this.strict) { +// this.swap(true); +// this.bubble(function (node) { +// node.reflow(); +// return undefined; +// }); +// return; +// } +// _super.prototype.deleteTowards.call(this, dir, cursor); +// }; +// return Inequality; +// })(BinaryOperator); +// var less = { +// ctrlSeq: '\\le ', +// htmlEntity: '≤', +// text: '\u2264', +// mathspeak: 'less than or equal to', +// ctrlSeqStrict: '<', +// htmlEntityStrict: '<', +// textStrict: '<', +// mathspeakStrict: 'less than', +// }; +// var greater = { +// ctrlSeq: '\\ge ', +// htmlEntity: '≥', +// text: '\u2265', +// mathspeak: 'greater than or equal to', +// ctrlSeqStrict: '>', +// htmlEntityStrict: '>', +// textStrict: '>', +// mathspeakStrict: 'greater than', +// }; +// var Greater = /** @class */ (function (_super) { +// __extends(Greater, _super); +// function Greater() { +// return _super.call(this, greater, true) || this; +// } +// Greater.prototype.createLeftOf = function (cursor) { +// var cursorL = cursor[L]; +// if (cursorL instanceof BinaryOperator && cursorL.ctrlSeq === '-') { +// var l = cursorL; +// cursor[L] = l[L]; +// l.remove(); +// new To().createLeftOf(cursor); +// cursor[L].bubble(function (node) { +// node.reflow(); +// return undefined; +// }); +// return; +// } +// _super.prototype.createLeftOf.call(this, cursor); +// }; +// return Greater; +// })(Inequality); +// LatexCmds['<'] = LatexCmds.lt = function () { +// return new Inequality(less, true); +// }; +// LatexCmds['>'] = LatexCmds.gt = Greater; +// LatexCmds['\u2264'] = LatexCmds.le = LatexCmds.leq = function () { +// return new Inequality(less, false); +// }; +// LatexCmds['\u2265'] = LatexCmds.ge = LatexCmds.geq = function () { +// return new Inequality(greater, false); +// }; +// LatexCmds.infty = LatexCmds.infin = LatexCmds.infinity = bindVanillaSymbol('\\infty ', '∞', 'infinity'); +// LatexCmds['\u2260'] = LatexCmds.ne = LatexCmds.neq = bindBinaryOperator('\\ne ', '≠', 'not equal'); +// var Equality = /** @class */ (function (_super) { +// __extends(Equality, _super); +// function Equality() { +// return _super.call(this, '=', h.text('='), '=', 'equals') || this; +// } +// Equality.prototype.createLeftOf = function (cursor) { +// var cursorL = cursor[L]; +// if (cursorL instanceof Inequality && cursorL.strict) { +// cursorL.swap(false); +// cursorL.bubble(function (node) { +// node.reflow(); +// return undefined; +// }); +// return; +// } +// _super.prototype.createLeftOf.call(this, cursor); +// }; +// return Equality; +// })(BinaryOperator); +// LatexCmds['='] = Equality; +// LatexCmds['\u00d7'] = LatexCmds.times = bindBinaryOperator('\\times ', '×', '[x]', 'times'); +// LatexCmds['\u00f7'] = LatexCmds.div = LatexCmds.divide = LatexCmds.divides = bindBinaryOperator( +// '\\div ', +// '÷', +// '[/]', +// 'over' +// ); +// var Sim = /** @class */ (function (_super) { +// __extends(Sim, _super); +// function Sim() { +// return _super.call(this, '\\sim ', h.text('~'), '~', 'tilde') || this; +// } +// Sim.prototype.createLeftOf = function (cursor) { +// if (cursor[L] instanceof Sim) { +// var l = cursor[L]; +// cursor[L] = l[L]; +// l.remove(); +// new Approx().createLeftOf(cursor); +// cursor[L].bubble(function (node) { +// node.reflow(); +// return undefined; +// }); +// return; +// } +// _super.prototype.createLeftOf.call(this, cursor); +// }; +// return Sim; +// })(BinaryOperator); +// var Approx = /** @class */ (function (_super) { +// __extends(Approx, _super); +// function Approx() { +// return ( +// _super.call(this, '\\approx ', h.entityText('≈'), '\u2248', 'approximately equal') || this +// ); +// } +// Approx.prototype.deleteTowards = function (dir, cursor) { +// if (dir === L) { +// var l = cursor[L]; +// new Fragment(l, this).remove(); +// cursor[L] = l[L]; +// new Sim().createLeftOf(cursor); +// cursor[L].bubble(function (node) { +// node.reflow(); +// return undefined; +// }); +// return; +// } +// _super.prototype.deleteTowards.call(this, dir, cursor); +// }; +// return Approx; +// })(BinaryOperator); +// LatexCmds.tildeNbsp = bindVanillaSymbol('~', U_NO_BREAK_SPACE, ' '); +// LatexCmds.sim = Sim; +// LatexCmds['\u2248'] = LatexCmds.approx = Approx; +// // When interpreting raw LaTeX, we can either evaluate the tilde as its standard nonbreaking space +// // or transform it to the \sim operator depending on whether the "interpretTildeAsSim" configuration option is set. +// // Tilde symbols input from a keyboard will always be transformed to \sim. +// CharCmds['~'] = LatexCmds.sim; +// LatexCmds['~'] = LatexCmds.tildeNbsp; +// baseOptionProcessors.interpretTildeAsSim = function (val) { +// var interpretAsSim = !!val; +// if (interpretAsSim) { +// LatexCmds['~'] = LatexCmds.sim; +// } else { +// LatexCmds['~'] = LatexCmds.tildeNbsp; +// } +// return interpretAsSim; +// }; +// /*************************** +// * Commands and Operators. +// **************************/ +// var SVG_SYMBOLS = { +// sqrt: { +// width: '', +// html: function () { +// return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 32 54' }, [ +// h('path', { +// d: 'M0 33 L7 27 L12.5 47 L13 47 L30 0 L32 0 L13 54 L11 54 L4.5 31 L0 33', +// }), +// ]); +// }, +// }, +// '|': { +// width: '.4em', +// html: function () { +// return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ +// h('path', { d: 'M4.4 0 L4.4 54 L5.6 54 L5.6 0' }), +// ]); +// }, +// }, +// '[': { +// width: '.55em', +// html: function () { +// return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 11 24' }, [ +// h('path', { d: 'M8 0 L3 0 L3 24 L8 24 L8 23 L4 23 L4 1 L8 1' }), +// ]); +// }, +// }, +// ']': { +// width: '.55em', +// html: function () { +// return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 11 24' }, [ +// h('path', { d: 'M3 0 L8 0 L8 24 L3 24 L3 23 L7 23 L7 1 L3 1' }), +// ]); +// }, +// }, +// '(': { +// width: '.55em', +// html: function () { +// return h('svg', { preserveAspectRatio: 'none', viewBox: '3 0 106 186' }, [ +// h('path', { +// d: 'M85 0 A61 101 0 0 0 85 186 L75 186 A75 101 0 0 1 75 0', +// }), +// ]); +// }, +// }, +// ')': { +// width: '.55em', +// html: function () { +// return h('svg', { preserveAspectRatio: 'none', viewBox: '3 0 106 186' }, [ +// h('path', { +// d: 'M24 0 A61 101 0 0 1 24 186 L34 186 A75 101 0 0 0 34 0', +// }), +// ]); +// }, +// }, +// '{': { +// width: '.7em', +// html: function () { +// return h('svg', { preserveAspectRatio: 'none', viewBox: '10 0 210 350' }, [ +// h('path', { +// d: +// 'M170 0 L170 6 A47 52 0 0 0 123 60 L123 127 A35 48 0 0 1 88 175 A35 48 0 0 1 123 223 L123 290 A47 52 0 0 0 170 344 L170 350 L160 350 A58 49 0 0 1 102 301 L103 220 A45 40 0 0 0 58 180 L58 170 A45 40 0 0 0 103 130 L103 49 A58 49 0 0 1 161 0', +// }), +// ]); +// }, +// }, +// '}': { +// width: '.7em', +// html: function () { +// return h('svg', { preserveAspectRatio: 'none', viewBox: '10 0 210 350' }, [ +// h('path', { +// d: +// 'M60 0 L60 6 A47 52 0 0 1 107 60 L107 127 A35 48 0 0 0 142 175 A35 48 0 0 0 107 223 L107 290 A47 52 0 0 1 60 344 L60 350 L70 350 A58 49 0 0 0 128 301 L127 220 A45 40 0 0 1 172 180 L172 170 A45 40 0 0 1 127 130 L127 49 A58 49 0 0 0 70 0', +// }), +// ]); +// }, +// }, +// '∥': { +// width: '.7em', +// html: function () { +// return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ +// h('path', { d: 'M3.2 0 L3.2 54 L4 54 L4 0 M6.8 0 L6.8 54 L6 54 L6 0' }), +// ]); +// }, +// }, +// '⟨': { +// width: '.55em', +// html: function () { +// return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ +// h('path', { d: 'M6.8 0 L3.2 27 L6.8 54 L7.8 54 L4.2 27 L7.8 0' }), +// ]); +// }, +// }, +// '⟩': { +// width: '.55em', +// html: function () { +// return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ +// h('path', { d: 'M3.2 0 L6.8 27 L3.2 54 L2.2 54 L5.8 27 L2.2 0' }), +// ]); +// }, +// }, +// }; +// var Style = /** @class */ (function (_super) { +// __extends(Style, _super); +// function Style(ctrlSeq, tagName, attrs, ariaLabel, opts) { +// var _this_1 = +// _super.call( +// this, +// ctrlSeq, +// new DOMView(1, function (blocks) { +// return h.block(tagName, attrs, blocks[0]); +// }) +// ) || this; +// _this_1.ariaLabel = ariaLabel || ctrlSeq.replace(/^\\/, ''); +// _this_1.mathspeakTemplate = ['Start' + _this_1.ariaLabel + ',', 'End' + _this_1.ariaLabel]; +// // In most cases, mathspeak should announce the start and end of style blocks. +// // There is one exception currently (mathrm). +// _this_1.shouldNotSpeakDelimiters = opts && opts.shouldNotSpeakDelimiters; +// return _this_1; +// } +// Style.prototype.mathspeak = function (opts) { +// if (!this.shouldNotSpeakDelimiters || (opts && opts.ignoreShorthand)) { +// return _super.prototype.mathspeak.call(this); +// } +// return this.foldChildren('', function (speech, block) { +// return speech + ' ' + block.mathspeak(opts); +// }).trim(); +// }; +// return Style; +// })(MathCommand); +// //fonts +// LatexCmds.mathrm = /** @class */ (function (_super) { +// __extends(mathrm, _super); +// function mathrm() { +// return ( +// _super.call(this, '\\mathrm', 'span', { class: 'dcg-mq-roman dcg-mq-font' }, 'Roman Font', { +// shouldNotSpeakDelimiters: true, +// }) || this +// ); +// } +// mathrm.prototype.isTextBlock = function () { +// return true; +// }; +// return mathrm; +// })(Style); +// LatexCmds.mathit = function () { +// return new Style('\\mathit', 'i', { class: 'dcg-mq-font' }, 'Italic Font'); +// }; +// LatexCmds.mathbf = function () { +// return new Style('\\mathbf', 'b', { class: 'dcg-mq-font' }, 'Bold Font'); +// }; +// LatexCmds.mathsf = function () { +// return new Style('\\mathsf', 'span', { class: 'dcg-mq-sans-serif dcg-mq-font' }, 'Serif Font'); +// }; +// LatexCmds.mathtt = function () { +// return new Style('\\mathtt', 'span', { class: 'dcg-mq-monospace dcg-mq-font' }, 'Math Text'); +// }; +// //text-decoration +// LatexCmds.underline = function () { +// return new Style('\\underline', 'span', { class: 'dcg-mq-non-leaf dcg-mq-underline' }, 'Underline'); +// }; +// LatexCmds.overline = LatexCmds.bar = function () { +// return new Style('\\overline', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overline' }, 'Overline'); +// }; +// LatexCmds.overrightarrow = function () { +// return new Style( +// '\\overrightarrow', +// 'span', +// { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-right' }, +// 'Over Right Arrow' +// ); +// }; +// LatexCmds.overleftarrow = function () { +// return new Style( +// '\\overleftarrow', +// 'span', +// { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-left' }, +// 'Over Left Arrow' +// ); +// }; +// LatexCmds.overleftrightarrow = function () { +// return new Style( +// '\\overleftrightarrow ', +// 'span', +// { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-leftright' }, +// 'Over Left and Right Arrow' +// ); +// }; +// LatexCmds.overarc = function () { +// return new Style('\\overarc', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overarc' }, 'Over Arc'); +// }; +// LatexCmds.dot = function () { +// return new MathCommand( +// '\\dot', +// new DOMView(1, function (blocks) { +// return h('span', { class: 'dcg-mq-non-leaf' }, [ +// h('span', { class: 'dcg-mq-dot-recurring-inner' }, [ +// h('span', { class: 'dcg-mq-dot-recurring' }, [h.text(U_DOT_ABOVE)]), +// h.block('span', { class: 'dcg-mq-empty-box' }, blocks[0]), +// ]), +// ]); +// }) +// ); +// }; +// // `\textcolor{color}{math}` will apply a color to the given math content, where +// // `color` is any valid CSS Color Value (see [SitePoint docs][] (recommended), +// // [Mozilla docs][], or [W3C spec][]). +// // +// // [SitePoint docs]: http://reference.sitepoint.com/css/colorvalues +// // [Mozilla docs]: https://developer.mozilla.org/en-US/docs/CSS/color_value#Values +// // [W3C spec]: http://dev.w3.org/csswg/css3-color/#colorunits +// LatexCmds.textcolor = /** @class */ (function (_super) { +// __extends(class_9, _super); +// function class_9() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// class_9.prototype.setColor = function (color) { +// this.color = color; +// this.domView = new DOMView(1, function (blocks) { +// return h.block('span', { class: 'dcg-mq-textcolor', style: 'color:' + color }, blocks[0]); +// }); +// this.ariaLabel = color.replace(/^\\/, ''); +// this.mathspeakTemplate = ['Start ' + this.ariaLabel + ',', 'End ' + this.ariaLabel]; +// }; +// class_9.prototype.latexRecursive = function (ctx) { +// this.checkCursorContextOpen(ctx); +// var blocks0 = this.blocks[0]; +// ctx.latex += '\\textcolor{' + this.color + '}{'; +// blocks0.latexRecursive(ctx); +// ctx.latex += '}'; +// this.checkCursorContextClose(ctx); +// }; +// class_9.prototype.parser = function () { +// var _this_1 = this; +// var optWhitespace = Parser.optWhitespace; +// var string = Parser.string; +// var regex = Parser.regex; +// return optWhitespace +// .then(string('{')) +// .then(regex(/^[#\w\s.,()%-]*/)) +// .skip(string('}')) +// .then(function (color) { +// _this_1.setColor(color); +// return _super.prototype.parser.call(_this_1); +// }); +// }; +// class_9.prototype.isStyleBlock = function () { +// return true; +// }; +// return class_9; +// })(MathCommand); +// // Very similar to the \textcolor command, but will add the given CSS class. +// // Usage: \class{classname}{math} +// // Note regex that whitelists valid CSS classname characters: +// // https://github.com/mathquill/mathquill/pull/191#discussion_r4327442 +// var Class = (LatexCmds['class'] = /** @class */ (function (_super) { +// __extends(class_10, _super); +// function class_10() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// class_10.prototype.parser = function () { +// var _this_1 = this; +// var string = Parser.string, +// regex = Parser.regex; +// return Parser.optWhitespace +// .then(string('{')) +// .then(regex(/^[-\w\s\\\xA0-\xFF]*/)) +// .skip(string('}')) +// .then(function (cls) { +// _this_1.cls = cls || ''; +// _this_1.domView = new DOMView(1, function (blocks) { +// return h.block('span', { class: 'dcg-mq-class '.concat(cls) }, blocks[0]); +// }); +// _this_1.ariaLabel = cls + ' class'; +// _this_1.mathspeakTemplate = ['Start ' + _this_1.ariaLabel + ',', 'End ' + _this_1.ariaLabel]; +// return _super.prototype.parser.call(_this_1); +// }); +// }; +// class_10.prototype.latexRecursive = function (ctx) { +// this.checkCursorContextOpen(ctx); +// var blocks0 = this.blocks[0]; +// ctx.latex += '\\class{' + this.cls + '}{'; +// blocks0.latexRecursive(ctx); +// ctx.latex += '}'; +// this.checkCursorContextClose(ctx); +// }; +// class_10.prototype.isStyleBlock = function () { +// return true; +// }; +// return class_10; +// })(MathCommand)); +// // This test is used to determine whether an item may be treated as a whole number +// // for shortening the verbalized (mathspeak) forms of some fractions and superscripts. +// var intRgx = /^[\+\-]?[\d]+$/; +// // Traverses the top level of the passed block's children and returns the concatenation of their ctrlSeq properties. +// // Used in shortened mathspeak computations as a block's .text() method can be potentially expensive. +// // +// function getCtrlSeqsFromBlock(block) { +// if (!block) return ''; +// var chars = ''; +// block.eachChild(function (child) { +// if (child.ctrlSeq !== undefined) chars += child.ctrlSeq; +// }); +// return chars; +// } +// Options.prototype.charsThatBreakOutOfSupSub = ''; +// var SupSub = /** @class */ (function (_super) { +// __extends(SupSub, _super); +// function SupSub() { +// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; +// _this_1.ctrlSeq = '_{...}^{...}'; +// return _this_1; +// } +// SupSub.prototype.setEnds = function (ends) { +// pray('SupSub ends must be MathBlocks', ends[L] instanceof MathBlock && ends[R] instanceof MathBlock); +// this.ends = ends; +// }; +// SupSub.prototype.getEnd = function (dir) { +// return this.ends[dir]; +// }; +// SupSub.prototype.createLeftOf = function (cursor) { +// if (!this.replacedFragment && !cursor[L] && cursor.options.supSubsRequireOperand) return; +// return _super.prototype.createLeftOf.call(this, cursor); +// }; +// SupSub.prototype.contactWeld = function (cursor) { +// // Look on either side for a SupSub, if one is found compare my +// // .sub, .sup with its .sub, .sup. If I have one that it doesn't, +// // then call .addBlock() on it with my block; if I have one that +// // it also has, then insert my block's children into its block, +// // unless my block has none, in which case insert the cursor into +// // its block (and not mine, I'm about to remove myself) in the case +// // I was just typed. +// // TODO: simplify +// // equiv. to [L, R].forEach(function(dir) { ... }); +// for (var dir = L; dir; dir = dir === L ? R : false) { +// var thisDir = this[dir]; +// var pt = void 0; +// if (thisDir instanceof SupSub) { +// // equiv. to 'sub sup'.split(' ').forEach(function(supsub) { ... }); +// for (var supsub = 'sub'; supsub; supsub = supsub === 'sub' ? 'sup' : false) { +// var src = this[supsub], +// dest = thisDir[supsub]; +// if (!src) continue; +// if (!dest) thisDir.addBlock(src.disown()); +// else if (!src.isEmpty()) { +// // ins src children at -dir end of dest +// src.domFrag().children().insAtDirEnd(-dir, dest.domFrag().oneElement()); +// var children = src.children().disown(); +// pt = new Point(dest, children.getEnd(R), dest.getEnd(L)); +// if (dir === L) children.adopt(dest, dest.getEnd(R), 0); +// else children.adopt(dest, 0, dest.getEnd(L)); +// } else { +// pt = new Point(dest, 0, dest.getEnd(L)); +// } +// this.placeCursor = (function (dest, src) { +// // TODO: don't monkey-patch +// return function (cursor) { +// cursor.insAtDirEnd(-dir, dest || src); +// }; +// })(dest, src); +// } +// this.remove(); +// if (cursor && cursor[L] === this) { +// if (dir === R && pt) { +// if (pt[L]) { +// cursor.insRightOf(pt[L]); +// } else { +// cursor.insAtLeftEnd(pt.parent); +// } +// } else cursor.insRightOf(thisDir); +// } +// break; +// } +// } +// }; +// SupSub.prototype.finalizeTree = function () { +// var endsL = this.getEnd(L); +// endsL.write = function (cursor, ch) { +// if (cursor.options.autoSubscriptNumerals && this === this.parent.sub) { +// if (ch === '_') return; +// var cmd = this.chToCmd(ch, cursor.options); +// if (cmd instanceof MQSymbol) cursor.deleteSelection(); +// else cursor.clearSelection().insRightOf(this.parent); +// cmd.createLeftOf(cursor.show()); +// cursor.controller.aria.queue('Baseline').alert(cmd.mathspeak({ createdLeftOf: cursor })); +// return; +// } +// if ( +// cursor[L] && +// !cursor[R] && +// !cursor.selection && +// cursor.options.charsThatBreakOutOfSupSub.indexOf(ch) > -1 +// ) { +// cursor.insRightOf(this.parent); +// cursor.controller.aria.queue('Baseline'); +// } +// MathBlock.prototype.write.call(this, cursor, ch); +// }; +// }; +// SupSub.prototype.moveTowards = function (dir, cursor, updown) { +// if (cursor.options.autoSubscriptNumerals && !this.sup) { +// cursor.insDirOf(dir, this); +// } else _super.prototype.moveTowards.call(this, dir, cursor, updown); +// }; +// SupSub.prototype.deleteTowards = function (dir, cursor) { +// if (cursor.options.autoSubscriptNumerals && this.sub) { +// var cmd = this.sub.getEnd(-dir); +// if (cmd instanceof MQSymbol) cmd.remove(); +// else if (cmd) cmd.deleteTowards(dir, cursor.insAtDirEnd(-dir, this.sub)); +// // TODO: factor out a .removeBlock() or something +// if (this.sub.isEmpty()) { +// this.sub.deleteOutOf(L, cursor.insAtLeftEnd(this.sub)); +// if (this.sup) cursor.insDirOf(-dir, this); +// // Note `-dir` because in e.g. x_1^2| want backspacing (leftward) +// // to delete the 1 but to end up rightward of x^2; with non-negated +// // `dir` (try it), the cursor appears to have gone "through" the ^2. +// } +// } else _super.prototype.deleteTowards.call(this, dir, cursor); +// }; +// SupSub.prototype.latexRecursive = function (ctx) { +// this.checkCursorContextOpen(ctx); +// if (this.sub) { +// ctx.latex += '_{'; +// var beforeLength = ctx.latex.length; +// this.sub.latexRecursive(ctx); +// var afterLength = ctx.latex.length; +// if (beforeLength === afterLength) { +// // nothing was written. so we write a space +// ctx.latex += ' '; +// } +// ctx.latex += '}'; +// } +// if (this.sup) { +// ctx.latex += '^{'; +// var beforeLength = ctx.latex.length; +// this.sup.latexRecursive(ctx); +// var afterLength = ctx.latex.length; +// if (beforeLength === afterLength) { +// // nothing was written. so we write a space +// ctx.latex += ' '; +// } +// ctx.latex += '}'; +// } +// this.checkCursorContextClose(ctx); +// }; +// SupSub.prototype.text = function () { +// function text(prefix, block) { +// var l = (block && block.text()) || ''; +// return block ? prefix + (l.length === 1 ? l : '(' + (l || ' ') + ')') : ''; +// } +// return text('_', this.sub) + text('^', this.sup); +// }; +// SupSub.prototype.addBlock = function (block) { +// if (this.supsub === 'sub') { +// this.sup = this.upInto = this.sub.upOutOf = block; +// block.adopt(this, this.sub, 0).downOutOf = this.sub; +// block.setDOM( +// domFrag(h('span', { class: 'dcg-mq-sup' })) +// .append(block.domFrag().children()) +// .prependTo(this.domFrag().oneElement()) +// .oneElement() +// ); +// NodeBase.linkElementByBlockNode(block.domFrag().oneElement(), block); +// } else { +// this.sub = this.downInto = this.sup.downOutOf = block; +// block.adopt(this, 0, this.sup).upOutOf = this.sup; +// this.domFrag().removeClass('dcg-mq-sup-only'); +// block.setDOM( +// domFrag(h('span', { class: 'dcg-mq-sub' })) +// .append(block.domFrag().children()) +// .appendTo(this.domFrag().oneElement()) +// .oneElement() +// ); +// NodeBase.linkElementByBlockNode(block.domFrag().oneElement(), block); +// this.domFrag().append( +// domFrag(h('span', { style: 'display:inline-block;width:0' }, [h.text(U_ZERO_WIDTH_SPACE)])) +// ); +// } +// // like 'sub sup'.split(' ').forEach(function(supsub) { ... }); +// for (var i = 0; i < 2; i += 1) +// (function (cmd, supsub, oppositeSupsub, updown) { +// var cmdSubSub = cmd[supsub]; +// cmdSubSub.deleteOutOf = function (dir, cursor) { +// cursor.insDirOf(this[dir] ? -dir : dir, this.parent); +// if (!this.isEmpty()) { +// var end = this.getEnd(dir); +// this.children() +// .disown() +// .withDirAdopt(dir, cursor.parent, cursor[dir], cursor[-dir]) +// .domFrag() +// .insDirOf(-dir, cursor.domFrag()); +// cursor[-dir] = end; +// } +// cmd.supsub = oppositeSupsub; +// delete cmd[supsub]; +// delete cmd[''.concat(updown, 'Into')]; +// var cmdOppositeSupsub = cmd[oppositeSupsub]; +// cmdOppositeSupsub[''.concat(updown, 'OutOf')] = insLeftOfMeUnlessAtEnd; +// delete cmdOppositeSupsub.deleteOutOf; // TODO - refactor so this method can be optional +// if (supsub === 'sub') { +// cmd.domFrag().addClass('dcg-mq-sup-only').children().last().remove(); +// } +// this.remove(); +// }; +// })(this, 'sub sup'.split(' ')[i], 'sup sub'.split(' ')[i], 'down up'.split(' ')[i]); +// }; +// return SupSub; +// })(MathCommand); +// function insLeftOfMeUnlessAtEnd(cursor) { +// // cursor.insLeftOf(cmd), unless cursor at the end of block, and every +// // ancestor cmd is at the end of every ancestor block +// var cmd = this.parent; +// var ancestorCmd = cursor; +// do { +// if (ancestorCmd[R]) return cursor.insLeftOf(cmd); +// ancestorCmd = ancestorCmd.parent.parent; +// } while (ancestorCmd !== cmd); +// cursor.insRightOf(cmd); +// return undefined; +// } +// var SubscriptCommand = /** @class */ (function (_super) { +// __extends(SubscriptCommand, _super); +// function SubscriptCommand() { +// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; +// _this_1.supsub = 'sub'; +// _this_1.domView = new DOMView(1, function (blocks) { +// return h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf' }, [ +// h.block('span', { class: 'dcg-mq-sub' }, blocks[0]), +// h('span', { style: 'display:inline-block;width:0' }, [h.text(U_ZERO_WIDTH_SPACE)]), +// ]); +// }); +// _this_1.textTemplate = ['_']; +// _this_1.mathspeakTemplate = ['Subscript,', ', Baseline']; +// _this_1.ariaLabel = 'subscript'; +// return _this_1; +// } +// SubscriptCommand.prototype.finalizeTree = function () { +// this.downInto = this.sub = this.getEnd(L); +// this.sub.upOutOf = insLeftOfMeUnlessAtEnd; +// _super.prototype.finalizeTree.call(this); +// }; +// return SubscriptCommand; +// })(SupSub); +// LatexCmds.subscript = LatexCmds._ = SubscriptCommand; +// LatexCmds.superscript = LatexCmds.supscript = LatexCmds['^'] = /** @class */ (function (_super) { +// __extends(SuperscriptCommand, _super); +// function SuperscriptCommand() { +// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; +// _this_1.supsub = 'sup'; +// _this_1.domView = new DOMView(1, function (blocks) { +// return h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf dcg-mq-sup-only' }, [ +// h.block('span', { class: 'dcg-mq-sup' }, blocks[0]), +// ]); +// }); +// _this_1.textTemplate = ['^(', ')']; +// _this_1.ariaLabel = 'superscript'; +// _this_1.mathspeakTemplate = ['Superscript,', ', Baseline']; +// return _this_1; +// } +// SuperscriptCommand.prototype.mathspeak = function (opts) { +// // Simplify basic exponent speech for common whole numbers. +// var child = this.upInto; +// if (child !== undefined) { +// // Calculate this item's inner text to determine whether to shorten the returned speech. +// // Do not calculate its inner mathspeak now until we know that the speech is to be truncated. +// // Since the mathspeak computation is recursive, we want to call it only once in this function to avoid performance bottlenecks. +// var innerText = getCtrlSeqsFromBlock(child); +// // If the superscript is a whole number, shorten the speech that is returned. +// if ((!opts || !opts.ignoreShorthand) && intRgx.test(innerText)) { +// // Simple cases +// if (innerText === '0') { +// return 'to the 0 power'; +// } else if (innerText === '2') { +// return 'squared'; +// } else if (innerText === '3') { +// return 'cubed'; +// } +// // More complex cases. +// var suffix = ''; +// // Limit suffix addition to exponents < 1000. +// if (/^[+-]?\d{1,3}$/.test(innerText)) { +// if (/(11|12|13|4|5|6|7|8|9|0)$/.test(innerText)) { +// suffix = 'th'; +// } else if (/1$/.test(innerText)) { +// suffix = 'st'; +// } else if (/2$/.test(innerText)) { +// suffix = 'nd'; +// } else if (/3$/.test(innerText)) { +// suffix = 'rd'; +// } +// } +// var innerMathspeak = typeof child === 'object' ? child.mathspeak() : innerText; +// return 'to the ' + innerMathspeak + suffix + ' power'; +// } +// } +// return _super.prototype.mathspeak.call(this); +// }; +// SuperscriptCommand.prototype.finalizeTree = function () { +// this.upInto = this.sup = this.getEnd(R); +// this.sup.downOutOf = insLeftOfMeUnlessAtEnd; +// _super.prototype.finalizeTree.call(this); +// }; +// return SuperscriptCommand; +// })(SupSub); +// var SummationNotation = /** @class */ (function (_super) { +// __extends(SummationNotation, _super); +// function SummationNotation(ch, symbol, ariaLabel) { +// var _this_1 = _super.call(this) || this; +// _this_1.ariaLabel = ariaLabel || ch.replace(/^\\/, ''); +// var domView = new DOMView(2, function (blocks) { +// return h('span', { class: 'dcg-mq-large-operator dcg-mq-non-leaf' }, [ +// h('span', { class: 'dcg-mq-to' }, [h.block('span', {}, blocks[1])]), +// h('big', {}, [h.text(symbol)]), +// h('span', { class: 'dcg-mq-from' }, [h.block('span', {}, blocks[0])]), +// ]); +// }); +// MQSymbol.prototype.setCtrlSeqHtmlTextAndMathspeak.call(_this_1, ch, domView); +// return _this_1; +// } +// SummationNotation.prototype.createLeftOf = function (cursor) { +// _super.prototype.createLeftOf.call(this, cursor); +// if (cursor.options.sumStartsWithNEquals) { +// new Letter('n').createLeftOf(cursor); +// new Equality().createLeftOf(cursor); +// } +// }; +// SummationNotation.prototype.latexRecursive = function (ctx) { +// this.checkCursorContextOpen(ctx); +// ctx.latex += this.ctrlSeq + '_{'; +// var beforeLength = ctx.latex.length; +// this.getEnd(L).latexRecursive(ctx); +// var afterLength = ctx.latex.length; +// if (afterLength === beforeLength) { +// // nothing was written so we write a space +// ctx.latex += ' '; +// } +// ctx.latex += '}^{'; +// beforeLength = ctx.latex.length; +// this.getEnd(R).latexRecursive(ctx); +// afterLength = ctx.latex.length; +// if (beforeLength === afterLength) { +// // nothing was written so we write a space +// ctx.latex += ' '; +// } +// ctx.latex += '}'; +// this.checkCursorContextClose(ctx); +// }; +// SummationNotation.prototype.mathspeak = function () { +// return ( +// 'Start ' + +// this.ariaLabel + +// ' from ' + +// this.getEnd(L).mathspeak() + +// ' to ' + +// this.getEnd(R).mathspeak() + +// ', end ' + +// this.ariaLabel + +// ', ' +// ); +// }; +// SummationNotation.prototype.parser = function () { +// var string = Parser.string; +// var optWhitespace = Parser.optWhitespace; +// var succeed = Parser.succeed; +// var block = latexMathParser.block; +// var self = this; +// var blocks = (self.blocks = [new MathBlock(), new MathBlock()]); +// for (var i = 0; i < blocks.length; i += 1) { +// blocks[i].adopt(self, self.getEnd(R), 0); +// } +// return optWhitespace +// .then(string('_').or(string('^'))) +// .then(function (supOrSub) { +// var child = blocks[supOrSub === '_' ? 0 : 1]; +// return block.then(function (block) { +// block.children().adopt(child, child.getEnd(R), 0); +// return succeed(self); +// }); +// }) +// .many() +// .result(self); +// }; +// SummationNotation.prototype.finalizeTree = function () { +// var endsL = this.getEnd(L); +// var endsR = this.getEnd(R); +// endsL.ariaLabel = 'lower bound'; +// endsR.ariaLabel = 'upper bound'; +// this.downInto = endsL; +// this.upInto = endsR; +// endsL.upOutOf = endsR; +// endsR.downOutOf = endsL; +// }; +// return SummationNotation; +// })(MathCommand); +// LatexCmds['\u2211'] = LatexCmds.sum = LatexCmds.summation = function () { +// return new SummationNotation('\\sum ', U_NARY_SUMMATION, 'sum'); +// }; +// LatexCmds['\u220f'] = LatexCmds.prod = LatexCmds.product = function () { +// return new SummationNotation('\\prod ', U_NARY_PRODUCT, 'product'); +// }; +// LatexCmds.coprod = LatexCmds.coproduct = function () { +// return new SummationNotation('\\coprod ', U_NARY_COPRODUCT, 'co product'); +// }; +// LatexCmds['\u222b'] = LatexCmds['int'] = LatexCmds.integral = /** @class */ (function (_super) { +// __extends(class_11, _super); +// function class_11() { +// var _this_1 = _super.call(this, '\\int ', '', 'integral') || this; +// _this_1.ariaLabel = 'integral'; +// _this_1.domView = new DOMView(2, function (blocks) { +// return h('span', { class: 'dcg-mq-int dcg-mq-non-leaf' }, [ +// h('big', {}, [h.text(U_INTEGRAL)]), +// h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf' }, [ +// h('span', { class: 'dcg-mq-sup' }, [ +// h.block('span', { class: 'dcg-mq-sup-inner' }, blocks[1]), +// ]), +// h.block('span', { class: 'dcg-mq-sub' }, blocks[0]), +// h('span', { style: 'display:inline-block;width:0' }, [h.text(U_ZERO_WIDTH_SPACE)]), +// ]), +// ]); +// }); +// return _this_1; +// } +// class_11.prototype.createLeftOf = function (cursor) { +// // FIXME: refactor rather than overriding +// MathCommand.prototype.createLeftOf.call(this, cursor); +// }; +// return class_11; +// })(SummationNotation); +// //window.LatexCmds = LatexCmds; +// //console.log(LatexCmds); +// //console.log(window); +// var Fraction = (LatexCmds.frac = LatexCmds.dfrac = LatexCmds.cfrac = LatexCmds.fraction = /** @class */ (function ( +// _super +// ) { +// __extends(FracNode, _super); +// function FracNode() { +// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; +// _this_1.ctrlSeq = '\\frac'; +// _this_1.domView = new DOMView(2, function (blocks) { +// return h('span', { class: 'dcg-mq-fraction dcg-mq-non-leaf' }, [ +// h.block('span', { class: 'dcg-mq-numerator' }, blocks[0]), +// h.block('span', { class: 'dcg-mq-denominator' }, blocks[1]), +// h('span', { style: 'display:inline-block;width:0' }, [h.text(U_ZERO_WIDTH_SPACE)]), +// ]); +// }); +// _this_1.textTemplate = ['(', ')/(', ')']; +// return _this_1; +// } +// FracNode.prototype.finalizeTree = function () { +// var endsL = this.getEnd(L); +// var endsR = this.getEnd(R); +// this.upInto = endsR.upOutOf = endsL; +// this.downInto = endsL.downOutOf = endsR; +// endsL.ariaLabel = 'numerator'; +// endsR.ariaLabel = 'denominator'; +// if (this.getFracDepth() > 1) { +// this.mathspeakTemplate = ['StartNestedFraction,', 'NestedOver', ', EndNestedFraction']; +// } else { +// this.mathspeakTemplate = ['StartFraction,', 'Over', ', EndFraction']; +// } +// }; +// FracNode.prototype.mathspeak = function (opts) { +// if (opts && opts.createdLeftOf) { +// var cursor = opts.createdLeftOf; +// return cursor.parent.mathspeak(); +// } +// var numText = getCtrlSeqsFromBlock(this.getEnd(L)); +// var denText = getCtrlSeqsFromBlock(this.getEnd(R)); +// // Shorten mathspeak value for whole number fractions whose denominator is less than 10. +// if ((!opts || !opts.ignoreShorthand) && intRgx.test(numText) && intRgx.test(denText)) { +// var isSingular = numText === '1' || numText === '-1'; +// var newDenSpeech = ''; +// if (denText === '2') { +// newDenSpeech = isSingular ? 'half' : 'halves'; +// } else if (denText === '3') { +// newDenSpeech = isSingular ? 'third' : 'thirds'; +// } else if (denText === '4') { +// newDenSpeech = isSingular ? 'quarter' : 'quarters'; +// } else if (denText === '5') { +// newDenSpeech = isSingular ? 'fifth' : 'fifths'; +// } else if (denText === '6') { +// newDenSpeech = isSingular ? 'sixth' : 'sixths'; +// } else if (denText === '7') { +// newDenSpeech = isSingular ? 'seventh' : 'sevenths'; +// } else if (denText === '8') { +// newDenSpeech = isSingular ? 'eighth' : 'eighths'; +// } else if (denText === '9') { +// newDenSpeech = isSingular ? 'ninth' : 'ninths'; +// } +// if (newDenSpeech !== '') { +// var output = ''; +// // Handle the case of an integer followed by a simplified fraction such as 1\frac{1}{2}. +// // Such combinations should be spoken aloud as "1 and 1 half." +// // Start at the left sibling of the fraction and continue leftward until something other than a digit or whitespace is found. +// var precededByInteger = false; +// for (var sibling = this[L]; sibling && sibling[L] !== undefined; sibling = sibling[L]) { +// // Ignore whitespace +// if (sibling.ctrlSeq === '\\ ') { +// continue; +// } else if (intRgx.test(sibling.ctrlSeq || '')) { +// precededByInteger = true; +// } else { +// precededByInteger = false; +// break; +// } +// } +// if (precededByInteger) { +// output += 'and '; +// } +// output += this.getEnd(L).mathspeak() + ' ' + newDenSpeech; +// return output; +// } +// } +// return _super.prototype.mathspeak.call(this); +// }; +// FracNode.prototype.getFracDepth = function () { +// var level = 0; +// var walkUp = function (item, level) { +// if (item instanceof MQNode && item.ctrlSeq && item.ctrlSeq.toLowerCase().search('frac') >= 0) +// level += 1; +// if (item && item.parent) return walkUp(item.parent, level); +// else return level; +// }; +// return walkUp(this, level); +// }; +// return FracNode; +// })(MathCommand)); +// var LiveFraction = (LatexCmds.over = CharCmds['/'] = /** @class */ (function (_super) { +// __extends(class_12, _super); +// function class_12() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// class_12.prototype.createLeftOf = function (cursor) { +// if (!this.replacedFragment) { +// var leftward = cursor[L]; +// if (!cursor.options.typingSlashCreatesNewFraction) { +// while ( +// leftward && +// !( +// leftward instanceof BinaryOperator || +// leftward instanceof (LatexCmds.text || noop) || +// leftward instanceof SummationNotation || +// leftward.ctrlSeq === '\\ ' || +// /^[,;:]$/.test(leftward.ctrlSeq) +// ) //lookbehind for operator +// ) +// leftward = leftward[L]; +// } +// if (leftward instanceof SummationNotation && leftward[R] instanceof SupSub) { +// leftward = leftward[R]; +// var leftwardR = leftward[R]; +// if (leftwardR instanceof SupSub && leftwardR.ctrlSeq != leftward.ctrlSeq) +// leftward = leftward[R]; +// } +// if (leftward !== cursor[L] && !cursor.isTooDeep(1)) { +// var leftwardR = leftward[R]; +// var cursorL = cursor[L]; +// this.replaces(new Fragment(leftwardR || cursor.parent.getEnd(L), cursorL)); +// cursor[L] = leftward; +// } +// } +// _super.prototype.createLeftOf.call(this, cursor); +// }; +// return class_12; +// })(Fraction)); +// var AnsBuilder = function () { +// return new MQSymbol('\\operatorname{ans}', h('span', { class: 'dcg-mq-ans' }, [h.text('ans')]), 'ans'); +// }; +// LatexCmds.ans = AnsBuilder; +// var PercentOfBuilder = function () { +// return new MQSymbol( +// '\\%\\operatorname{of}', +// h('span', { class: 'dcg-mq-nonSymbola dcg-mq-operator-name' }, [h.text('% of ')]), +// 'percent of' +// ); +// }; +// LatexCmds.percent = LatexCmds.percentof = PercentOfBuilder; +// var SquareRoot = /** @class */ (function (_super) { +// __extends(SquareRoot, _super); +// function SquareRoot() { +// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; +// _this_1.ctrlSeq = '\\sqrt'; +// _this_1.domView = new DOMView(1, function (blocks) { +// return h('span', { class: 'dcg-mq-non-leaf dcg-mq-sqrt-container' }, [ +// h('span', { class: 'dcg-mq-scaled dcg-mq-sqrt-prefix' }, [SVG_SYMBOLS.sqrt.html()]), +// h.block('span', { class: 'dcg-mq-non-leaf dcg-mq-sqrt-stem' }, blocks[0]), +// ]); +// }); +// _this_1.textTemplate = ['sqrt(', ')']; +// _this_1.mathspeakTemplate = ['StartRoot,', ', EndRoot']; +// _this_1.ariaLabel = 'root'; +// return _this_1; +// } +// SquareRoot.prototype.parser = function () { +// return latexMathParser.optBlock +// .then(function (optBlock) { +// return latexMathParser.block.map(function (block) { +// var nthroot = new NthRoot(); +// nthroot.blocks = [optBlock, block]; +// optBlock.adopt(nthroot, 0, 0); +// block.adopt(nthroot, optBlock, 0); +// return nthroot; +// }); +// }) +// .or(_super.prototype.parser.call(this)); +// }; +// return SquareRoot; +// })(MathCommand); +// LatexCmds.sqrt = SquareRoot; +// LatexCmds.hat = /** @class */ (function (_super) { +// __extends(Hat, _super); +// function Hat() { +// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; +// _this_1.ctrlSeq = '\\hat'; +// _this_1.domView = new DOMView(1, function (blocks) { +// return h('span', { class: 'dcg-mq-non-leaf' }, [ +// h('span', { class: 'dcg-mq-hat-prefix' }, [h.text('^')]), +// h.block('span', { class: 'dcg-mq-hat-stem' }, blocks[0]), +// ]); +// }); +// _this_1.textTemplate = ['hat(', ')']; +// return _this_1; +// } +// return Hat; +// })(MathCommand); +// var NthRoot = /** @class */ (function (_super) { +// __extends(NthRoot, _super); +// function NthRoot() { +// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; +// _this_1.domView = new DOMView(2, function (blocks) { +// return h('span', { class: 'dcg-mq-nthroot-container dcg-mq-non-leaf' }, [ +// h.block('sup', { class: 'dcg-mq-nthroot dcg-mq-non-leaf' }, blocks[0]), +// h('span', { class: 'dcg-mq-scaled dcg-mq-sqrt-container' }, [ +// h('span', { class: 'dcg-mq-sqrt-prefix dcg-mq-scaled' }, [SVG_SYMBOLS.sqrt.html()]), +// h.block('span', { class: 'dcg-mq-sqrt-stem dcg-mq-non-leaf' }, blocks[1]), +// ]), +// ]); +// }); +// _this_1.textTemplate = ['sqrt[', '](', ')']; +// return _this_1; +// } +// NthRoot.prototype.latexRecursive = function (ctx) { +// this.checkCursorContextOpen(ctx); +// ctx.latex += '\\sqrt['; +// this.getEnd(L).latexRecursive(ctx); +// ctx.latex += ']{'; +// this.getEnd(R).latexRecursive(ctx); +// ctx.latex += '}'; +// this.checkCursorContextClose(ctx); +// }; +// NthRoot.prototype.mathspeak = function () { +// var indexMathspeak = this.getEnd(L).mathspeak(); +// var radicandMathspeak = this.getEnd(R).mathspeak(); +// this.getEnd(L).ariaLabel = 'Index'; +// this.getEnd(R).ariaLabel = 'Radicand'; +// if (indexMathspeak === '3') { +// // cube root +// return 'Start Cube Root, ' + radicandMathspeak + ', End Cube Root'; +// } else { +// return 'Root Index ' + indexMathspeak + ', Start Root, ' + radicandMathspeak + ', End Root'; +// } +// }; +// return NthRoot; +// })(SquareRoot); +// LatexCmds.nthroot = NthRoot; +// LatexCmds.cbrt = /** @class */ (function (_super) { +// __extends(class_13, _super); +// function class_13() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// class_13.prototype.createLeftOf = function (cursor) { +// _super.prototype.createLeftOf.call(this, cursor); +// new Digit('3').createLeftOf(cursor); +// cursor.controller.moveRight(); +// }; +// return class_13; +// })(NthRoot); +// var DiacriticAbove = /** @class */ (function (_super) { +// __extends(DiacriticAbove, _super); +// function DiacriticAbove(ctrlSeq, html, textTemplate) { +// var _this_1 = this; +// var domView = new DOMView(1, function (blocks) { +// return h('span', { class: 'dcg-mq-non-leaf' }, [ +// h('span', { class: 'dcg-mq-diacritic-above' }, [html]), +// h.block('span', { class: 'dcg-mq-diacritic-stem' }, blocks[0]), +// ]); +// }); +// _this_1 = _super.call(this, ctrlSeq, domView, textTemplate) || this; +// return _this_1; +// } +// return DiacriticAbove; +// })(MathCommand); +// LatexCmds.vec = function () { +// return new DiacriticAbove('\\vec', h.entityText('→'), ['vec(', ')']); +// }; +// LatexCmds.tilde = function () { +// return new DiacriticAbove('\\tilde', h.text('~'), ['tilde(', ')']); +// }; +// var DelimsNode = /** @class */ (function (_super) { +// __extends(DelimsNode, _super); +// function DelimsNode() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// DelimsNode.prototype.setDOM = function (el) { +// var _c; +// _super.prototype.setDOM.call(this, el); +// var children = this.domFrag().children(); +// if (!children.isEmpty()) { +// this.delimFrags = ((_c = {}), (_c[L] = children.first()), (_c[R] = children.last()), _c); +// } +// return this; +// }; +// return DelimsNode; +// })(MathCommand); +// // Round/Square/Curly/Angle Brackets (aka Parens/Brackets/Braces) +// // first typed as one-sided bracket with matching "ghost" bracket at +// // far end of current block, until you type an opposing one +// var Bracket = /** @class */ (function (_super) { +// __extends(Bracket, _super); +// function Bracket(side, open, close, ctrlSeq, end) { +// var _c; +// var _this_1 = _super.call(this, '\\left' + ctrlSeq, undefined, [open, close]) || this; +// _this_1.side = side; +// _this_1.sides = +// ((_c = {}), (_c[L] = { ch: open, ctrlSeq: ctrlSeq }), (_c[R] = { ch: close, ctrlSeq: end }), _c); +// return _this_1; +// } +// Bracket.prototype.numBlocks = function () { +// return 1; +// }; +// Bracket.prototype.html = function () { +// var _this_1 = this; +// var leftSymbol = this.getSymbol(L); +// var rightSymbol = this.getSymbol(R); +// // wait until now so that .side may +// this.domView = new DOMView(1, function (blocks) { +// return h( +// // be set by createLeftOf or parser +// 'span', +// { class: 'dcg-mq-non-leaf dcg-mq-bracket-container' }, +// [ +// h( +// 'span', +// { +// style: 'width:' + leftSymbol.width, +// class: +// 'dcg-mq-scaled dcg-mq-bracket-l dcg-mq-paren' + +// (_this_1.side === R ? ' dcg-mq-ghost' : ''), +// }, +// [leftSymbol.html()] +// ), +// h.block( +// 'span', +// { +// style: 'margin-left:' + leftSymbol.width + ';margin-right:' + rightSymbol.width, +// class: 'dcg-mq-bracket-middle dcg-mq-non-leaf', +// }, +// blocks[0] +// ), +// h( +// 'span', +// { +// style: 'width:' + rightSymbol.width, +// class: +// 'dcg-mq-scaled dcg-mq-bracket-r dcg-mq-paren' + +// (_this_1.side === L ? ' dcg-mq-ghost' : ''), +// }, +// [rightSymbol.html()] +// ), +// ] +// ); +// }); +// return _super.prototype.html.call(this); +// }; +// Bracket.prototype.getSymbol = function (side) { +// var ch = this.sides[side || R].ch; +// return SVG_SYMBOLS[ch] || { width: '0', html: '' }; +// }; +// Bracket.prototype.latexRecursive = function (ctx) { +// this.checkCursorContextOpen(ctx); +// ctx.latex += '\\left' + this.sides[L].ctrlSeq; +// this.getEnd(L).latexRecursive(ctx); +// ctx.latex += '\\right' + this.sides[R].ctrlSeq; +// this.checkCursorContextClose(ctx); +// }; +// Bracket.prototype.mathspeak = function (opts) { +// var open = this.sides[L].ch, +// close = this.sides[R].ch; +// if (open === '|' && close === '|') { +// this.mathspeakTemplate = ['StartAbsoluteValue,', ', EndAbsoluteValue']; +// this.ariaLabel = 'absolute value'; +// } else if (opts && opts.createdLeftOf && this.side) { +// var ch = ''; +// if (this.side === L) ch = this.textTemplate[0]; +// else if (this.side === R) ch = this.textTemplate[1]; +// return (this.side === L ? 'left ' : 'right ') + BRACKET_NAMES[ch]; +// } else { +// this.mathspeakTemplate = ['left ' + BRACKET_NAMES[open] + ',', ', right ' + BRACKET_NAMES[close]]; +// this.ariaLabel = BRACKET_NAMES[open] + ' block'; +// } +// return _super.prototype.mathspeak.call(this); +// }; +// Bracket.prototype.matchBrack = function (opts, expectedSide, node) { +// // return node iff it's a matching 1-sided bracket of expected side (if any) +// return ( +// node instanceof Bracket && +// node.side && +// node.side !== -expectedSide && +// (!opts.restrictMismatchedBrackets || +// OPP_BRACKS[this.sides[this.side].ch] === node.sides[node.side].ch || +// { '(': ']', '[': ')' }[this.sides[L].ch] === node.sides[R].ch) && +// node +// ); +// }; +// Bracket.prototype.closeOpposing = function (brack) { +// brack.side = 0; +// brack.sides[this.side] = this.sides[this.side]; // copy over my info (may be +// var brackFrag = brack.delimFrags[this.side === L ? L : R] // mismatched, like [a, b)) +// .removeClass('dcg-mq-ghost'); +// this.replaceBracket(brackFrag, this.side); +// }; +// Bracket.prototype.createLeftOf = function (cursor) { +// var brack; +// if (!this.replacedFragment) { +// // unless wrapping seln in brackets, +// // check if next to or inside an opposing one-sided bracket +// var opts = cursor.options; +// if (this.sides[L].ch === '|') { +// // check both sides if I'm a pipe +// brack = +// this.matchBrack(opts, R, cursor[R]) || +// this.matchBrack(opts, L, cursor[L]) || +// this.matchBrack(opts, 0, cursor.parent.parent); +// } else { +// brack = +// this.matchBrack(opts, -this.side, cursor[-this.side]) || +// this.matchBrack(opts, -this.side, cursor.parent.parent); +// } +// } +// if (brack) { +// var side = (this.side = -brack.side); // may be pipe with .side not yet set +// this.closeOpposing(brack); +// if (brack === cursor.parent.parent && cursor[side]) { +// // move the stuff between +// new Fragment(cursor[side], cursor.parent.getEnd(side), -side) // me and ghost outside +// .disown() +// .withDirAdopt(-side, brack.parent, brack, brack[side]) +// .domFrag() +// .insDirOf(side, brack.domFrag()); +// } +// brack.bubble(function (node) { +// node.reflow(); +// return undefined; +// }); +// } else { +// (brack = this), (side = brack.side); +// if (brack.replacedFragment) brack.side = 0; +// // wrapping seln, don't be one-sided +// else if (cursor[-side]) { +// // elsewise, auto-expand so ghost is at far end +// brack.replaces(new Fragment(cursor[-side], cursor.parent.getEnd(-side), side)); +// cursor[-side] = 0; +// } +// _super.prototype.createLeftOf.call(this, cursor); +// } +// if (side === L) cursor.insAtLeftEnd(brack.getEnd(L)); +// else cursor.insRightOf(brack); +// }; +// Bracket.prototype.placeCursor = function () {}; +// Bracket.prototype.unwrap = function () { +// this.getEnd(L) +// .children() +// .disown() +// .adopt(this.parent, this, this[R]) +// .domFrag() +// .insertAfter(this.domFrag()); +// this.remove(); +// }; +// Bracket.prototype.deleteSide = function (side, outward, cursor) { +// var parent = this.parent, +// sib = this[side], +// farEnd = parent.getEnd(side); +// if (side === this.side) { +// // deleting non-ghost of one-sided bracket, unwrap +// this.unwrap(); +// sib ? cursor.insDirOf(-side, sib) : cursor.insAtDirEnd(side, parent); +// return; +// } +// var opts = cursor.options, +// wasSolid = !this.side; +// this.side = -side; +// // if deleting like, outer close-brace of [(1+2)+3} where inner open-paren +// if (this.matchBrack(opts, side, this.getEnd(L).getEnd(this.side))) { +// // is ghost, +// this.closeOpposing(this.getEnd(L).getEnd(this.side)); // then become [1+2)+3 +// var origEnd = this.getEnd(L).getEnd(side); +// this.unwrap(); +// if (origEnd) origEnd.siblingCreated(cursor.options, side); +// if (sib) { +// cursor.insDirOf(-side, sib); +// } else { +// cursor.insAtDirEnd(side, parent); +// } +// } else { +// // if deleting like, inner close-brace of ([1+2}+3) where outer +// if (this.matchBrack(opts, side, this.parent.parent)) { +// // open-paren is +// this.parent.parent.closeOpposing(this); // ghost, then become [1+2+3) +// this.parent.parent.unwrap(); +// } // else if deleting outward from a solid pair, unwrap +// else if (outward && wasSolid) { +// this.unwrap(); +// sib ? cursor.insDirOf(-side, sib) : cursor.insAtDirEnd(side, parent); +// return; +// } else { +// // else deleting just one of a pair of brackets, become one-sided +// this.sides[side] = getOppBracketSide(this); +// this.delimFrags[L].removeClass('dcg-mq-ghost'); +// this.delimFrags[R].removeClass('dcg-mq-ghost'); +// var brackFrag = this.delimFrags[side].addClass('dcg-mq-ghost'); +// this.replaceBracket(brackFrag, side); +// } +// if (sib) { +// // auto-expand so ghost is at far end +// var leftEnd = this.getEnd(L); +// var origEnd = leftEnd.getEnd(side); +// leftEnd.domFrag().removeClass('dcg-mq-empty'); +// new Fragment(sib, farEnd, -side) +// .disown() +// .withDirAdopt(-side, leftEnd, origEnd, 0) +// .domFrag() +// .insAtDirEnd(side, leftEnd.domFrag().oneElement()); +// if (origEnd) origEnd.siblingCreated(cursor.options, side); +// cursor.insDirOf(-side, sib); +// } // didn't auto-expand, cursor goes just outside or just inside parens +// else outward ? cursor.insDirOf(side, this) : cursor.insAtDirEnd(side, this.getEnd(L)); +// } +// }; +// Bracket.prototype.replaceBracket = function (brackFrag, side) { +// var symbol = this.getSymbol(side); +// brackFrag.children().replaceWith(domFrag(symbol.html())); +// brackFrag.oneElement().style.width = symbol.width; +// if (side === L) { +// var next = brackFrag.next(); +// if (!next.isEmpty()) { +// next.oneElement().style.marginLeft = symbol.width; +// } +// } else { +// var prev = brackFrag.prev(); +// if (!prev.isEmpty()) { +// prev.oneElement().style.marginRight = symbol.width; +// } +// } +// }; +// Bracket.prototype.deleteTowards = function (dir, cursor) { +// this.deleteSide(-dir, false, cursor); +// }; +// Bracket.prototype.finalizeTree = function () { +// this.getEnd(L).deleteOutOf = function (dir, cursor) { +// this.parent.deleteSide(dir, true, cursor); +// }; +// // FIXME HACK: after initial creation/insertion, finalizeTree would only be +// // called if the paren is selected and replaced, e.g. by LiveFraction +// this.finalizeTree = this.intentionalBlur = function () { +// this.delimFrags[this.side === L ? R : L].removeClass('dcg-mq-ghost'); +// this.side = 0; +// }; +// }; +// Bracket.prototype.siblingCreated = function (_opts, dir) { +// // if something typed between ghost and far +// if (dir === -this.side) this.finalizeTree(); // end of its block, solidify +// }; +// return Bracket; +// })(DelimsNode); +// function getOppBracketSide(bracket) { +// var side = bracket.side; +// var data = bracket.sides[side]; +// return { +// ch: OPP_BRACKS[data.ch], +// ctrlSeq: OPP_BRACKS[data.ctrlSeq], +// }; +// } +// var OPP_BRACKS = { +// '(': ')', +// ')': '(', +// '[': ']', +// ']': '[', +// '{': '}', +// '}': '{', +// '\\{': '\\}', +// '\\}': '\\{', +// '⟨': '⟩', +// '⟩': '⟨', +// '\\langle ': '\\rangle ', +// '\\rangle ': '\\langle ', +// '|': '|', +// '\\lVert ': '\\rVert ', +// '\\rVert ': '\\lVert ', +// }; +// var BRACKET_NAMES = { +// '⟨': 'angle-bracket', +// '⟩': 'angle-bracket', +// '|': 'pipe', +// }; +// function bindCharBracketPair(open, ctrlSeq, name) { +// var ctrlSeq = ctrlSeq || open; +// var close = OPP_BRACKS[open]; +// var end = OPP_BRACKS[ctrlSeq]; +// CharCmds[open] = function () { +// return new Bracket(L, open, close, ctrlSeq, end); +// }; +// CharCmds[close] = function () { +// return new Bracket(R, open, close, ctrlSeq, end); +// }; +// BRACKET_NAMES[open] = BRACKET_NAMES[close] = name; +// } +// bindCharBracketPair('(', '', 'parenthesis'); +// bindCharBracketPair('[', '', 'bracket'); +// bindCharBracketPair('{', '\\{', 'brace'); +// LatexCmds.langle = function () { +// return new Bracket(L, '⟨', '⟩', '\\langle ', '\\rangle '); +// }; +// LatexCmds.rangle = function () { +// return new Bracket(R, '⟨', '⟩', '\\langle ', '\\rangle '); +// }; +// CharCmds['|'] = function () { +// return new Bracket(L, '|', '|', '|', '|'); +// }; +// LatexCmds.lVert = function () { +// return new Bracket(L, '∥', '∥', '\\lVert ', '\\rVert '); +// }; +// LatexCmds.rVert = function () { +// return new Bracket(R, '∥', '∥', '\\lVert ', '\\rVert '); +// }; +// LatexCmds.left = /** @class */ (function (_super) { +// __extends(left, _super); +// function left() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// left.prototype.parser = function () { +// var regex = Parser.regex; +// var string = Parser.string; +// var optWhitespace = Parser.optWhitespace; +// return optWhitespace +// .then(regex(/^(?:[([|]|\\\{|\\langle(?![a-zA-Z])|\\lVert(?![a-zA-Z]))/)) +// .then(function (ctrlSeq) { +// var open = ctrlSeq.replace(/^\\/, ''); +// if (ctrlSeq == '\\langle') { +// open = '⟨'; +// ctrlSeq = ctrlSeq + ' '; +// } +// if (ctrlSeq == '\\lVert') { +// open = '∥'; +// ctrlSeq = ctrlSeq + ' '; +// } +// return latexMathParser.then(function (block) { +// return string('\\right') +// .skip(optWhitespace) +// .then(regex(/^(?:[\])|]|\\\}|\\rangle(?![a-zA-Z])|\\rVert(?![a-zA-Z]))/)) +// .map(function (end) { +// var close = end.replace(/^\\/, ''); +// if (end == '\\rangle') { +// close = '⟩'; +// end = end + ' '; +// } +// if (end == '\\rVert') { +// close = '∥'; +// end = end + ' '; +// } +// var cmd = new Bracket(0, open, close, ctrlSeq, end); +// cmd.blocks = [block]; +// block.adopt(cmd, 0, 0); +// return cmd; +// }); +// }); +// }); +// }; +// return left; +// })(MathCommand); +// LatexCmds.right = /** @class */ (function (_super) { +// __extends(right, _super); +// function right() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// right.prototype.parser = function () { +// return Parser.fail('unmatched \\right'); +// }; +// return right; +// })(MathCommand); +// var leftBinomialSymbol = SVG_SYMBOLS['(']; +// var rightBinomialSymbol = SVG_SYMBOLS[')']; +// var Binomial = /** @class */ (function (_super) { +// __extends(Binomial, _super); +// function Binomial() { +// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; +// _this_1.ctrlSeq = '\\binom'; +// _this_1.domView = new DOMView(2, function (blocks) { +// return h('span', { class: 'dcg-mq-non-leaf dcg-mq-bracket-container' }, [ +// h( +// 'span', +// { +// style: 'width:' + leftBinomialSymbol.width, +// class: 'dcg-mq-paren dcg-mq-bracket-l dcg-mq-scaled', +// }, +// [leftBinomialSymbol.html()] +// ), +// h( +// 'span', +// { +// style: +// 'margin-left:' + +// leftBinomialSymbol.width + +// '; margin-right:' + +// rightBinomialSymbol.width, +// class: 'dcg-mq-non-leaf dcg-mq-bracket-middle', +// }, +// [ +// h('span', { class: 'dcg-mq-array dcg-mq-non-leaf' }, [ +// h.block('span', {}, blocks[0]), +// h.block('span', {}, blocks[1]), +// ]), +// ] +// ), +// h( +// 'span', +// { +// style: 'width:' + rightBinomialSymbol.width, +// class: 'dcg-mq-paren dcg-mq-bracket-r dcg-mq-scaled', +// }, +// [rightBinomialSymbol.html()] +// ), +// ]); +// }); +// _this_1.textTemplate = ['choose(', ',', ')']; +// _this_1.mathspeakTemplate = ['StartBinomial,', 'Choose', ', EndBinomial']; +// _this_1.ariaLabel = 'binomial'; +// return _this_1; +// } +// return Binomial; +// })(DelimsNode); +// LatexCmds.binom = LatexCmds.binomial = Binomial; +// LatexCmds.choose = /** @class */ (function (_super) { +// __extends(class_14, _super); +// function class_14() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// class_14.prototype.createLeftOf = function (cursor) { +// LiveFraction.prototype.createLeftOf(cursor); +// }; +// return class_14; +// })(Binomial); +// var MathFieldNode = /** @class */ (function (_super) { +// __extends(MathFieldNode, _super); +// function MathFieldNode() { +// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; +// _this_1.ctrlSeq = '\\MathQuillMathField'; +// _this_1.domView = new DOMView(1, function (blocks) { +// return h('span', { class: 'dcg-mq-editable-field' }, [ +// h.block('span', { class: 'dcg-mq-root-block', 'aria-hidden': 'true' }, blocks[0]), +// ]); +// }); +// return _this_1; +// } +// MathFieldNode.prototype.parser = function () { +// var self = this, +// string = Parser.string, +// regex = Parser.regex, +// succeed = Parser.succeed; +// return string('[') +// .then(regex(/^[a-z][a-z0-9]*/i)) +// .skip(string(']')) +// .map(function (name) { +// self.name = name; +// }) +// .or(succeed(undefined)) +// .then(_super.prototype.parser.call(this)); +// }; +// MathFieldNode.prototype.finalizeTree = function (options) { +// var ctrlr = new Controller(this.getEnd(L), this.domFrag().oneElement(), options); +// ctrlr.KIND_OF_MQ = 'MathField'; +// ctrlr.editable = true; +// ctrlr.createTextarea(); +// ctrlr.editablesTextareaEvents(); +// ctrlr.cursor.insAtRightEnd(ctrlr.root); +// RootBlockMixin(ctrlr.root); +// // MathQuill applies aria-hidden to .dcg-mq-root-block containers +// // because these contain math notation that screen readers can't +// // interpret directly. MathQuill use an aria-live region as a +// // sibling of these block containers to provide an alternative +// // representation for screen readers +// // +// // MathFieldNodes have their own focusable text aria and aria live +// // region, so it is incorrect for any parent of the editable field +// // to have an aria-hidden property +// // +// // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden +// // +// // Handle this by recursively walking the parents of this element +// // until we hit a root block, and if we hit any parent with +// // aria-hidden="true", removing the property from the parent and +// // pushing it down to each of the parents children. This should +// // result in no parent of this node having aria-hidden="true", but +// // should keep as much of what was previously hidden hidden as +// // possible while obeying this constraint +// function pushDownAriaHidden(node) { +// if (node.parentNode && !domFrag(node).hasClass('dcg-mq-root-block')) { +// pushDownAriaHidden(node.parentNode); +// } +// if (node.nodeType === Node.ELEMENT_NODE) { +// var element = node; +// if (element.getAttribute('aria-hidden') === 'true') { +// element.removeAttribute('aria-hidden'); +// domFrag(node) +// .children() +// .eachElement(function (child) { +// child.setAttribute('aria-hidden', 'true'); +// }); +// } +// } +// } +// pushDownAriaHidden(this.domFrag().parent().oneElement()); +// this.domFrag().oneElement().removeAttribute('aria-hidden'); +// }; +// MathFieldNode.prototype.registerInnerField = function (innerFields, MathField) { +// var controller = this.getEnd(L).controller; +// var newField = new MathField(controller); +// innerFields[this.name] = newField; +// innerFields.push(newField); +// }; +// MathFieldNode.prototype.latexRecursive = function (ctx) { +// this.checkCursorContextOpen(ctx); +// this.getEnd(L).latexRecursive(ctx); +// this.checkCursorContextClose(ctx); +// }; +// MathFieldNode.prototype.text = function () { +// return this.getEnd(L).text(); +// }; +// return MathFieldNode; +// })(MathCommand); +// LatexCmds.editable = LatexCmds.MathQuillMathField = MathFieldNode; // backcompat with before cfd3620 on #233 +// // Embed arbitrary things +// // Probably the closest DOM analogue would be an iframe? +// // From MathQuill's perspective, it's a MQSymbol, it can be +// // anywhere and the cursor can go around it but never in it. +// // Create by calling public API method .dropEmbedded(), +// // or by calling the global public API method .registerEmbed() +// // and rendering LaTeX like \embed{registeredName} (see test). +// var EmbedNode = /** @class */ (function (_super) { +// __extends(EmbedNode, _super); +// function EmbedNode() { +// return (_super !== null && _super.apply(this, arguments)) || this; +// } +// EmbedNode.prototype.setOptions = function (options) { +// function noop() { +// return ''; +// } +// this.text = options.text || noop; +// this.domView = new DOMView(0, function () { +// return h('span', {}, [parseHTML(options.htmlString || '')]); +// }); +// this.latex = options.latex || noop; +// return this; +// }; +// EmbedNode.prototype.latexRecursive = function (ctx) { +// this.checkCursorContextOpen(ctx); +// ctx.latex += this.latex(); +// this.checkCursorContextClose(ctx); +// }; +// EmbedNode.prototype.parser = function () { +// var self = this, +// string = Parser.string, +// regex = Parser.regex, +// succeed = Parser.succeed; +// return string('{') +// .then(regex(/^[a-z][a-z0-9]*/i)) +// .skip(string('}')) +// .then(function (name) { +// // the chars allowed in the optional data block are arbitrary other than +// // excluding curly braces and square brackets (which'd be too confusing) +// return string('[') +// .then(regex(/^[-\w\s]*/)) +// .skip(string(']')) +// .or(succeed(undefined)) +// .map(function (data) { +// return self.setOptions(EMBEDS[name](data)); +// }); +// }); +// }; +// return EmbedNode; +// })(MQSymbol); +// LatexCmds.embed = EmbedNode; +// /**************************************** +// * Input box to type backslash commands +// ***************************************/ +// CharCmds['\\'] = /** @class */ (function (_super) { +// __extends(LatexCommandInput, _super); +// function LatexCommandInput() { +// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; +// _this_1.ctrlSeq = '\\'; +// _this_1.domView = new DOMView(1, function (blocks) { +// return h('span', { class: 'dcg-mq-latex-command-input-wrapper dcg-mq-non-leaf' }, [ +// h('span', { class: 'dcg-mq-latex-command-input dcg-mq-non-leaf' }, [ +// h.text('\\'), +// h.block('span', {}, blocks[0]), +// ]), +// ]); +// }); +// _this_1.textTemplate = ['\\']; +// return _this_1; +// } +// LatexCommandInput.prototype.replaces = function (replacedFragment) { +// this._replacedFragment = replacedFragment.disown(); +// this.isEmpty = function () { +// return false; +// }; +// }; +// LatexCommandInput.prototype.createBlocks = function () { +// _super.prototype.createBlocks.call(this); +// var endsL = this.getEnd(L); +// endsL.focus = function () { +// this.parent.domFrag().addClass('dcg-mq-hasCursor'); +// if (this.isEmpty()) this.parent.domFrag().removeClass('dcg-mq-empty'); +// return this; +// }; +// endsL.blur = function () { +// this.parent.domFrag().removeClass('dcg-mq-hasCursor'); +// if (this.isEmpty()) this.parent.domFrag().addClass('dcg-mq-empty'); +// return this; +// }; +// endsL.write = function (cursor, ch) { +// cursor.show().deleteSelection(); +// if (ch.match(/[a-z]/i)) { +// new VanillaSymbol(ch).createLeftOf(cursor); +// // TODO needs tests +// cursor.controller.aria.alert(ch); +// } else { +// var cmd = this.parent.renderCommand(cursor); +// // TODO needs tests +// cursor.controller.aria.queue(cmd.mathspeak({ createdLeftOf: cursor })); +// if (ch !== '\\' || !this.isEmpty()) cursor.parent.write(cursor, ch); +// else cursor.controller.aria.alert(); +// } +// }; +// var originalKeystroke = endsL.keystroke; +// endsL.keystroke = function (key, e, ctrlr) { +// if (key === 'Tab' || key === 'Enter' || key === 'Spacebar') { +// var cmd = this.parent.renderCommand(ctrlr.cursor); +// // TODO needs tests +// ctrlr.aria.alert(cmd.mathspeak({ createdLeftOf: ctrlr.cursor })); +// e === null || e === void 0 ? void 0 : e.preventDefault(); +// return; +// } +// return originalKeystroke.call(this, key, e, ctrlr); +// }; +// }; +// LatexCommandInput.prototype.createLeftOf = function (cursor) { +// _super.prototype.createLeftOf.call(this, cursor); +// if (this._replacedFragment) { +// var frag = this.domFrag(); +// var el_1 = frag.oneElement(); +// this._replacedFragment.domFrag().addClass('dcg-mq-blur'); +// //FIXME: is monkey-patching the mousedown and mousemove handlers the right way to do this? +// var rewriteMousedownEventTarget = function (e) { +// { +// // TODO - overwritting e.target +// e.target = el_1; +// el_1.dispatchEvent(e); +// return false; +// } +// }; +// el_1.addEventListener('mousedown', rewriteMousedownEventTarget); +// el_1.addEventListener('mouseup', rewriteMousedownEventTarget); +// this._replacedFragment.domFrag().insertBefore(frag.children().first()); +// } +// }; +// LatexCommandInput.prototype.latexRecursive = function (ctx) { +// this.checkCursorContextOpen(ctx); +// ctx.latex += '\\'; +// this.getEnd(L).latexRecursive(ctx); +// ctx.latex += ' '; +// this.checkCursorContextClose(ctx); +// }; +// LatexCommandInput.prototype.renderCommand = function (cursor) { +// this.setDOM(this.domFrag().children().lastElement()); +// this.remove(); +// if (this[R]) { +// cursor.insLeftOf(this[R]); +// } else { +// cursor.insAtRightEnd(this.parent); +// } +// var latex = this.getEnd(L).latex(); +// if (!latex) latex = ' '; +// var cmd = LatexCmds[latex]; +// if (cmd) { +// //console.log(cmd); +// var node = void 0; +// if (isMQNodeClass(cmd)) { +// node = new cmd(latex); +// } else { +// node = cmd(latex); +// } +// if (this._replacedFragment) node.replaces(this._replacedFragment); +// node.createLeftOf(cursor); +// return node; +// } else { +// var node = new TextBlock(); +// node.replaces(latex); +// node.createLeftOf(cursor); +// cursor.insRightOf(node); +// if (this._replacedFragment) { +// this._replacedFragment.remove(); +// } +// return node; +// } +// }; +// return LatexCommandInput; +// })(MathCommand); +// // For backwards compatibility, set up the global MathQuill object as an instance of API interface v1 +// if (window.jQuery) { +// MQ1 = getInterface(1); +// for (var key in MQ1) +// (function (key, val) { +// if (typeof val === 'function') { +// MathQuill[key] = function () { +// insistOnInterVer(); +// return val.apply(this, arguments); +// }; +// MathQuill[key].prototype = val.prototype; +// } else MathQuill[key] = val; +// })(key, MQ1[key]); +// } +// //console.log(MathQuill); +// })(); +// } diff --git a/src/preload_content.ts b/src/preload_content.ts new file mode 100644 index 0000000..cddfaa2 --- /dev/null +++ b/src/preload_content.ts @@ -0,0 +1,10 @@ +console.log('Preload running...'); + +const script = document.createElement('script'); +script.src = browser.runtime.getURL('preload_inject.js'); +script.onload = function () { + (this as any).remove(); +}; +(document.head || document.documentElement).appendChild(script); + + diff --git a/src/preload_inject.ts b/src/preload_inject.ts new file mode 100644 index 0000000..e64cda5 --- /dev/null +++ b/src/preload_inject.ts @@ -0,0 +1,8928 @@ +// @ts-nocheck +//import extendMathQuill from './extend_mathquill'; + +console.log('Preload injected'); + +let oldDefine!: any; +function newDefine(moduleName: string, dependencies: any, definition: any) { + if (moduleName === 'mathquill_src') { + // override should either be `{dependencies, definition}` or just `definition` + dependencies = extendMathQuill; + console.log(dependencies); + } + return oldDefine(moduleName, dependencies, definition); +} + +// without this, you get Error: touchtracking missing jquery +newDefine.amd = { + jQuery: true, +}; + +// trick to override `define`s +(window as any).ALMOND_OVERRIDES = new Proxy( + {}, + { + get(target, prop, receiver) { + if (prop === 'define') { + oldDefine = (window as any).define; + return newDefine; + } else { + return Reflect.get(target, prop, receiver); + } + }, + } +); + +function runCalculator() { + /* The following script should have failed earlier because we blocked calculator_desktop.js. + We copy it verbatim here to actually load the calculator. */ + + (window as any).require( + ['toplevel/calculator_desktop', 'testbridge', 'jquery'], + function (calcPromise: any, TestBridge: any, $: any) { + $('.dcg-loading-div-container').hide(); + if (calcPromise === undefined) { + console.error('No calc promise'); + } + calcPromise.then(function (calc: any) { + if (calc === undefined) { + console.error('No calc'); + } + (window as any).Calc = calc; + TestBridge.ready(); + }); + } + ); +} + +async function pollForValue(func: any) { + return await _pollForValue(func); +} + +function _pollForValue(func: () => T) { + return new Promise((resolve) => { + const interval = setInterval(() => { + const val = func(); + if (val !== null && val !== undefined) { + clearInterval(interval); + resolve(val); + } + }, 50); + }); +} + + + +pollForValue( + () => + ( + document.querySelector( + 'script[src^=\'/assets/build/calculator_desktop\']' + ) as HTMLScriptElement + )?.src +).then((src) => { + /* we blocked calculator_desktop.js earlier to ensure that the preload/override script runs first. + Now we load it, but with '?' appended to prevent the web request rules from blocking it */ + const script = document.createElement('script'); + script.src = src + '??'; + script.async = false; + script.onload = () => { + // remove from DOM + script.remove(); + runCalculator(); + }; + script.onerror = () => { + console.error('Injected script onerror'); + }; + document.body.appendChild(script); +}); + + +// @ts-nocheck +/* eslint-disable */ +function extendMathQuill() { + console.log("Running extend"); + (function () { + var L = -1; + var R = 1; + var min = Math.min; + var max = Math.max; + function noop() {} + /** + * a development-only debug method. This definition and all + * calls to `pray` will be stripped from the minified + * build of mathquill. + * + * This function must be called by name to be removed + * at compile time. Do not define another function + * with the same name, and only call this function by + * name. + */ + function pray(message, cond) { + if (!cond) throw new Error('prayer failed: ' + message); + } + function prayDirection(dir) { + pray('a direction was passed', dir === L || dir === R); + } + var urlParams = new URLSearchParams(window.location.search); + function parseHTML(s) { + // https://youmightnotneedjquery.com/#parse_html + var tmp = document.implementation.createHTMLDocument(''); + tmp.body.innerHTML = s; + if (tmp.body.children.length === 1) return tmp.body.children[0]; + var frag = document.createDocumentFragment(); + while (tmp.body.firstChild) { + frag.appendChild(tmp.body.firstChild); + } + return frag; + } + var h = function h(type, attributes, children) { + var el; + switch (type) { + case 'svg': + case 'path': + el = document.createElementNS('http://www.w3.org/2000/svg', type); + break; + default: + el = document.createElement(type); + } + for (var key_1 in attributes) { + var value = attributes[key_1]; + if (value === undefined) continue; + el.setAttribute(key_1, typeof value === 'string' ? value : String(value)); + } + if (children) { + for (var i = 0; i < children.length; i++) { + el.appendChild(children[i]); + } + } + return el; + }; + h.text = function (s) { + return document.createTextNode(s); + }; + h.block = function (type, attributes, block) { + var out = h(type, attributes, [block.html()]); + block.setDOM(out); + NodeBase.linkElementByBlockNode(out, block); + return out; + }; + h.entityText = function (s) { + // TODO: replace with h.text(U_BLAHBLAH) or maybe a named entity->unicode lookup + var val = parseHTML(s); + pray( + 'entity parses to a single text node', + val instanceof DocumentFragment && val.childNodes.length === 1 && val.childNodes[0] instanceof Text + ); + return val.childNodes[0]; + }; + function closest(el, s) { + var _a, _b, _c; + if (typeof ((_a = el) === null || _a === void 0 ? void 0 : _a.closest) === 'function') { + return el.closest(s); + } + if (!(el instanceof HTMLElement)) return null; + // https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#polyfill + var matches = + Element.prototype.matches || + Element.prototype.msMatchesSelector || + Element.prototype.webkitMatchesSelector; + var match = el; + do { + if (matches.call(match, s)) return match; + match = + (_c = + (_b = match === null || match === void 0 ? void 0 : match.parentElement) !== null && + _b !== void 0 + ? _b + : match === null || match === void 0 + ? void 0 + : match.parentNode) !== null && _c !== void 0 + ? _c + : null; + } while (match !== null && match.nodeType === 1); + return null; + } + var U_NO_BREAK_SPACE = '\u00A0'; + var U_ZERO_WIDTH_SPACE = '\u200B'; + var U_DOT_ABOVE = '\u02D9'; + var U_NARY_SUMMATION = '\u2211'; + var U_NARY_PRODUCT = '\u220F'; + var U_NARY_COPRODUCT = '\u2210'; + var U_INTEGRAL = '\u222B'; + /** + * Like `el.getBoundingClientRect()` but avoids throwing for + * disconnected and hidden elements in IE <= 11. + * */ + function getBoundingClientRect(el) { + // Return zeros for disconnected and hidden (display: none) elements + // Running getBoundingClientRect on a disconnected node in IE <=11 throws an error + // https://github.com/jquery/jquery/blob/a684e6ba836f7c553968d7d026ed7941e1a612d8/src/offset.js#L83-L86 + if (!el.getClientRects().length) { + return { + top: 0, + left: 0, + height: 0, + width: 0, + x: 0, + y: 0, + bottom: 0, + right: 0, + }; + } + return el.getBoundingClientRect(); + } + /** + * Returns the number of pixels that the document is currently scrolled + * horizontally -- `window.scrollX` in modern browsers. + * */ + function getScrollX() { + // In IE9, scrollX was called pageXOffset + // Previous versions of IE had neither property and use scrollLeft instead + // + // https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX#notes + return window.pageXOffset !== undefined + ? window.pageXOffset + : (document.documentElement || document.body.parentNode || document.body).scrollLeft; + } + /** + * Returns the number of pixels that the document is currently scrolled + * vertically -- `window.scrollY` in modern browsers. + * */ + function getScrollY() { + // In IE9, scrollY was called pageYOffset + // Previous versions of IE had neither property and use scrollTop instead + // + // https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX#notes + return window.pageYOffset !== undefined + ? window.pageYOffset + : (document.documentElement || document.body.parentNode || document.body).scrollTop; + } + /** + * Given `duration` in ms and callback `cb`, immediately calls `cb(progress, scheduleNext, cancel)` with: + * - `progress` set to `0` if duration > 0, or 1 if duration <= 0 + * - `scheduleNext` a function that schedules a future call to `cb` + * - `cancel` a function that cancels any pending `scheduleNext` call. + * + * `scheduleNext` schedules a call to `cb` with `progress` set to the + * ratio of currently elapsed time and `duration`. + * + * To continue running the animation, `cb` should call `scheduleNext`. + * + * To stop the animation, it is the responsibility of `cb` to check + * whether progress is greater than or equal to 1, in which case `cb` + * should not call `scheduleNext`. + * + * `scheduleNext` uses `requestAnimationFrame` if available and falls + * back to `setTimeout(..., 13)` otherwise. Times are always based on + * `Date.now()` for compatibility between `requestAnimationFrame` and + * the `setTimeout` fallback. `cb` will only be called with strictly + * monotonic `progress` values. + * + * Note: `animate` purposely puts a lot of responsibility on the caller + * to keep its implementation simple because it isn't used very widely + * in the project. + */ + var animate = (function () { + // IIFE exists just to hang on to configured rafShim and cancelShim + // functions + var rafShim, cancelShim; + if (typeof requestAnimationFrame === 'function' && typeof cancelAnimationFrame === 'function') { + rafShim = requestAnimationFrame; + cancelShim = cancelAnimationFrame; + } else { + rafShim = function (cb) { + return setTimeout(cb, 13); + }; + cancelShim = clearTimeout; + } + return function (duration, cb) { + var start = Date.now(); + var cancelToken; + var progress = 0; + function step() { + var proposedProgress = (Date.now() - start) / duration; + // Enforce that progress is strictly monotonic + if (proposedProgress <= progress) { + scheduleNext(); + } else { + progress = proposedProgress; + } + cb(progress, scheduleNext, cancel); + } + function cancel() { + if (cancelToken !== undefined) cancelShim(cancelToken); + cancelToken = undefined; + } + function scheduleNext() { + // Calling cancel here ensures that there are never multiple + // concurrent callbacks scheduled for a single animation, even if + // the caller calls `scheduleNext` multiple times in a single + // event loop (which is always a mistake) + cancel(); + cancelToken = rafShim(step); + } + cb(duration <= 0 ? 1 : 0, scheduleNext, cancel); + }; + })(); + var Aria = /** @class */ (function () { + function Aria(controller) { + this.span = h('span', { + class: 'dcg-mq-aria-alert', + 'aria-live': 'assertive', + 'aria-atomic': 'true', + }); + this.msg = ''; + this.items = []; + this.controller = controller; + } + Aria.prototype.attach = function () { + var container = this.controller.container; + if (this.span.parentNode !== container) { + domFrag(container).prepend(domFrag(this.span)); + } + }; + Aria.prototype.queue = function (item, shouldDescribe) { + if (shouldDescribe === void 0) { + shouldDescribe = false; + } + var output = ''; + if (item instanceof MQNode) { + // Some constructs include verbal shorthand (such as simple fractions and exponents). + // Since ARIA alerts relate to moving through interactive content, we don't want to use that shorthand if it exists + // since doing so may be ambiguous or confusing. + var itemMathspeak = item.mathspeak({ ignoreShorthand: true }); + if (shouldDescribe) { + // used to ensure item is described when cursor reaches block boundaries + if (item.parent && item.parent.ariaLabel && item.ariaLabel === 'block') { + output = item.parent.ariaLabel + ' ' + itemMathspeak; + } else if (item.ariaLabel) { + output = item.ariaLabel + ' ' + itemMathspeak; + } + } + if (output === '') { + output = itemMathspeak; + } + } else { + output = item || ''; + } + this.items.push(output); + return this; + }; + Aria.prototype.queueDirOf = function (dir) { + prayDirection(dir); + return this.queue(dir === L ? 'before' : 'after'); + }; + Aria.prototype.queueDirEndOf = function (dir) { + prayDirection(dir); + return this.queue(dir === L ? 'beginning of' : 'end of'); + }; + Aria.prototype.alert = function (t) { + this.attach(); + if (t) this.queue(t); + if (this.items.length) { + // To cut down on potential verbiage from multiple Mathquills firing near-simultaneous ARIA alerts, + // update the text of this instance if its container also has keyboard focus. + // If it does not, leave the DOM unchanged but flush the queue regardless. + // Note: updating the msg variable regardless of focus for unit tests. + this.msg = this.items + .join(' ') + .replace(/ +(?= )/g, '') + .trim(); + if (this.controller.containerHasFocus()) { + this.span.textContent = this.msg; + } + } + return this.clear(); + }; + Aria.prototype.clear = function () { + this.items.length = 0; + return this; + }; + return Aria; + })(); + /** + * A `DOMFragment` represents a contiguous span of sibling DOM Nodes, + * which may include both Element nodes and other nodes like Text and + * Comment nodes. A `DOMFragment` may represent zero or more nodes. + * + * `DOMFragments` are created using the `DOMFragment.create` factory + * function, which is also aliased as `domFrag` for convenience. + * + * A `DOMFragment` simply holds references to nodes. It doesn't move or + * mutate them in the way that the native `DocumentFragment` does. + * + * `DOMFragment` implements many of the same methods for manipulating a + * collection of DOM elements that jQuery does, but it has some notable + * differences: + * + * 1. A jQuery collection can hold an arbitrary ordered set of DOM + * elements, but a `DOMFragment` can only hold a contiguous span of + * sibling nodes. + * 2. Some jQuery DOM manipulation methods like `insert{Before,After}`, + * `append`, `prepend`, `appendTo`, `prependTo`, etc. may insert + * several clones of a collection into different places in the DOM. + * `DOMFragment` never makes clones of DOM nodes--instead, when + * targeting multi-element fragments, it moves source nodes before + * or after the targeted fragment as appropriate without ever making + * more copies. + * 3. For methods like `.children()`, where it's likely to be a mistake + * to call the method on a fragment that doesn't contain exactly one + * node or element, `DOMFragment` will throw whereas jQuery will + * silently do something possibly unintended. Methods that assert + * are commented with the properties that they assert. + * + * Internally, `DOMFragment` holds immutable references to the left and + * right end nodes (if the fragment is not empty). The other nodes are + * represented implicitly through the sibling pointers of the DOM nodes + * themselves. This means that it is possible to invalidate a + * `DOMFragment` by moving one of its ends without moving the other in + * such a way that they are no longer siblings. It is also possible to + * change the contents of a `DOMFragment` by adding or removing DOM + * nodes between its ends. + */ + var DOMFragment = /** @class */ (function () { + /** + * Constructor is private to enforce that the invariant checks in + * `create` are applied to outside callers. Internal methods are + * allowed to use this constructor when they can guarantee they're + * passing sibling nodes (such as children of a parent node). + */ + function DOMFragment(first, last) { + var _a; + if (arguments.length === 1) last = first; + if (!first || !last) return; + this.ends = ((_a = {}), (_a[L] = first), (_a[R] = last), _a); + } + /** + * Returns a `DOMFragment` representing the contiguous span of sibling + * DOM nodes betewen `first` and `last`. If only one element is + * passed, creates a `DOMFragment` representing that single element. + * If no elements are passed, creates and empty `DOMFragment`. + * + * If two elements are passed, asserts that the second element is a + * forward sibling of the first element. Checking this invariant is + * O(n) in the total number of nodes in the fragment + */ + DOMFragment.create = function (first, last) { + if (arguments.length === 1) last = first; + pray('No half-empty DOMFragments', !!first === !!last); + var out = new DOMFragment(first, last); + pray('last is a forward sibling of first', out.isValid()); + return out; + }; + DOMFragment.prototype.isEmpty = function () { + return this.ends === undefined; + }; + DOMFragment.prototype.isOneNode = function () { + return !!(this.ends && this.ends[L] === this.ends[R]); + }; + /** + * Returns true if the fragment is empty or if its last node is equal + * to its first node or is a forward sibling of its first node. + * + * DOMFragments may be invalidated if any of the nodes they contain + * are moved or removed independently of the other nodes they contain. + * + * Note that this check visits each node in the fragment, so it is + * O(n). + */ + DOMFragment.prototype.isValid = function () { + if (!this.ends) return true; + if (this.ends[L] === this.ends[R]) return true; + var maybeLast; + this.eachNode(function (el) { + return (maybeLast = el); + }); + return maybeLast === this.ends[R]; + }; + /** + * Return the first Node of this fragment. May be a a Node that is not + * an Element such as a Text or Comment node. + * + * Asserts fragment is not empty. + */ + DOMFragment.prototype.firstNode = function () { + pray('Fragment is not empty', this.ends); + return this.ends[L]; + }; + /** + * Return the last Node of this fragment. May be a a Node that is not + * an Element such as a Text or Comment node. + * + * Asserts fragment is not empty. + */ + DOMFragment.prototype.lastNode = function () { + pray('Fragment is not empty', this.ends); + return this.ends[R]; + }; + /** + * Return a fragment representing the children (including Text and + * Comment nodes) of the node represented by this fragment. + * + * Asserts that this fragment contains exactly one Node. + * + * Note, because this includes text and comment nodes, this is more + * like jQuery's .contents() than jQuery's .children() + */ + DOMFragment.prototype.children = function () { + var el = this.oneNode(); + var first = el.firstChild; + var last = el.lastChild; + return first && last ? new DOMFragment(first, last) : new DOMFragment(); + }; + /** + * Return a new `DOMFragment` spanning this fragment and `sibling` + * fragment. Does not perform any DOM operations. + * + * Asserts that `sibling` is either empty or a forward sibling of + * this fragment that may share its first node with the last node of + * this fragment + */ + DOMFragment.prototype.join = function (sibling) { + if (!this.ends) return sibling; + if (!sibling.ends) return this; + // Check if sibling is actually a sibling of this span + var found = false; + var current = this.ends[R].nextSibling; + while (current) { + if (current === sibling.ends[L]) { + found = true; + break; + } + current = current.nextSibling; + } + pray('sibling must be a forward DOM sibling of this fragment', found); + return new DOMFragment(this.ends[L], sibling.ends[R]); + }; + /** + * Return the single DOM Node represented by this fragment. + * + * Asserts that this fragment contains exactly one Node. + */ + DOMFragment.prototype.oneNode = function () { + pray('Fragment has a single node', this.ends && this.ends[L] === this.ends[R]); + return this.ends[L]; + }; + /** + * Return the single DOM Element represented by this fragment. + * + * Asserts that this fragment contains exactly one Node, and that node + * is an Element node. + */ + DOMFragment.prototype.oneElement = function () { + var el = this.oneNode(); + pray('Node is an Element', el.nodeType === Node.ELEMENT_NODE); + return el; + }; + /** + * Return the single DOM Text node represented by this fragment. + * + * Asserts that this fragment contains exactly one Node, and that node + * is a Text node. + */ + DOMFragment.prototype.oneText = function () { + var el = this.oneNode(); + pray('Node is Text', el.nodeType === Node.TEXT_NODE); + return el; + }; + /** + * Calls callback sequentially with each node in this fragment. + * Includes nodes that are not Elements, such as Text and Comment + * nodes. + */ + DOMFragment.prototype.eachNode = function (cb) { + if (!this.ends) return this; + var stop = this.ends[R]; + for (var node = this.ends[L], next = void 0; node; node = next) { + // Note, this loop is organized in a slightly tricky way in order + // cache "next" before calling the callback. This is done because + // the callback could mutate node.nextSibling (e.g. by moving the + // node to a documentFragment, like toDocumentFragment does). + // + // It's still possible to break this iteration by messing with + // forward siblings of node in the callback, although it's + // probably rare to want to do that. Perhaps this means "each" is + // too dangerous to have as a public method. + next = node.nextSibling; + cb(node); + if (node === stop) break; + } + return this; + }; + /** + * Calls callback sequentially with each Element node in this + * fragment. Skips nodes that are not Elements, such as Text and + * Comment nodes. + */ + DOMFragment.prototype.eachElement = function (cb) { + this.eachNode(function (el) { + if (el.nodeType === Node.ELEMENT_NODE) cb(el); + }); + return this; + }; + /** + * Returns the concatenated text content of all of the nodes in the + * fragment. + */ + DOMFragment.prototype.text = function () { + var accum = ''; + this.eachNode(function (node) { + accum += node.textContent || ''; + }); + return accum; + }; + /** + * Returns an array of all the Nodes in this fragment, including nodes + * that are not Element nodes such as Text and Comment nodes; + */ + DOMFragment.prototype.toNodeArray = function () { + var accum = []; + this.eachNode(function (el) { + return accum.push(el); + }); + return accum; + }; + /** + * Returns an array of all the Element nodes in this fragment. The + * result does not include nodes that are not Elements, such as Text + * and Comment nodes. + */ + DOMFragment.prototype.toElementArray = function () { + var accum = []; + this.eachElement(function (el) { + return accum.push(el); + }); + return accum; + }; + /** + * Moves all of the nodes in this fragment into a new DocumentFragment + * and returns it. This includes Nodes that are not Elements such as + * Text and Comment nodes. + */ + DOMFragment.prototype.toDocumentFragment = function () { + var frag = document.createDocumentFragment(); + this.eachNode(function (el) { + return frag.appendChild(el); + }); + return frag; + }; + /** + * Insert all the nodes in this fragment into the DOM directly before + * the first node of `sibling` fragment. If `sibling` is empty or does + * not have a parent node, detaches this fragment from the document. + * + * Note that this behavior differs from jQuery if `sibling` is a + * collection with multiple nodes. In that case, jQuery inserts this + * collection before the first node in `sibling`, and then inserts a + * clone of this collection before each additional node in the + * `sibling` collection. DOMFragment only ever inserts this collection + * before the first node of the sibling fragment, and never inserts + * additional clones. + */ + DOMFragment.prototype.insertBefore = function (sibling) { + return this.insDirOf(L, sibling); + }; + /** + * Insert all the nodes in this fragment into the DOM directly after + * the last node of `sibling` fragment. If `sibling` is empty or does + * not have a parent node, detaches this fragment from the document. + * + * Note that this behavior differs from jQuery if `sibling` is a + * collection with multiple nodes. In that case, jQuery inserts this + * collection before the first node in `sibling`, and then inserts a + * clone of this collection before each additional node in the + * `sibling` collection. DOMFragment only ever inserts this collection + * before the first node of the sibling fragment, and never inserts + * additional clones. + */ + DOMFragment.prototype.insertAfter = function (sibling) { + return this.insDirOf(R, sibling); + }; + /** + * Append children to the node represented by this fragment. + * + * Asserts that this fragment contains exactly one Element. + */ + DOMFragment.prototype.append = function (children) { + children.appendTo(this.oneElement()); + return this; + }; + /** + * Prepend children to the node represented by this fragment. + * + * Asserts that this fragment contains exactly one Element. + */ + DOMFragment.prototype.prepend = function (children) { + children.prependTo(this.oneElement()); + return this; + }; + /** + * Append all the nodes in this fragment to the children of `el`. + */ + DOMFragment.prototype.appendTo = function (el) { + return this.insAtDirEnd(R, el); + }; + /** + * Prepend all the nodes in this fragment to the children of `el`. + */ + DOMFragment.prototype.prependTo = function (el) { + return this.insAtDirEnd(L, el); + }; + /** + * Return a fragment containing the parent node of the nodes in this + * fragment. Returns an empty fragment if this fragment is empty or + * does not have a parent node. + */ + DOMFragment.prototype.parent = function () { + if (!this.ends) return this; + var parent = this.ends[L].parentNode; + if (!parent) return new DOMFragment(); + return new DOMFragment(parent); + }; + /** + * Replace the children of `el` with the contents of this fragment, + * and place `el` into the DOM at the previous location of this + * fragment. + */ + DOMFragment.prototype.wrapAll = function (el) { + el.textContent = ''; // First empty the wrapping element + if (!this.ends) return this; + var parent = this.ends[L].parentNode; + var next = this.ends[R].nextSibling; + this.appendTo(el); + if (parent) { + parent.insertBefore(el, next); + } + return this; + }; + /** + * Replace this fragment with the fragment given by `children`. If + * this fragment is empty or does not have a parent node, detaches + * `children` from the document. + * + * Note that this behavior differs from jQuery if this is a collection + * with multiple nodes. In that case, jQuery replaces the first + * element of this collection with `children`, and then replaces each + * additional element in this collection with a clone of `children`. + * DOMFragment replaces this entire fragment with `children` and never + * makes additional clones of `children`. + */ + DOMFragment.prototype.replaceWith = function (children) { + var _a; + var rightEnd = (_a = this.ends) === null || _a === void 0 ? void 0 : _a[R]; + // Note: important to cache parent and nextSibling (if they exist) + // before detaching this fragment from the document (which will + // mutate its parent and sibling references) + var parent = rightEnd === null || rightEnd === void 0 ? void 0 : rightEnd.parentNode; + var nextSibling = rightEnd === null || rightEnd === void 0 ? void 0 : rightEnd.nextSibling; + this.detach(); + // Note, this purposely detaches children from the document, even if + // they can't be reinserted because this fragment is empty or has no + // parent + var childDocumentFragment = children.toDocumentFragment(); + if (!rightEnd || !parent) return this; + parent.insertBefore(childDocumentFragment, nextSibling || null); + return this; + }; + /** + * Return the nth Element node of this collection, or undefined if + * there is no nth Element. Skips Nodes that are not Elements (e.g. + * Text and Comment nodes). + * + * Analogous to jQuery's array indexing syntax, or jQuery's .get() + * with positive arguments. + */ + DOMFragment.prototype.nthElement = function (n) { + if (!this.ends) return undefined; + if (n < 0 || n !== Math.floor(n)) return undefined; + var current = this.ends[L]; + while (current) { + // Only count element nodes + if (current.nodeType === Node.ELEMENT_NODE) { + if (n <= 0) return current; + n -= 1; + } + if (current === this.ends[R]) return undefined; + current = current.nextSibling; + } + return undefined; + }; + /** + * Return the first Element node of this fragment, or undefined if + * the fragment is empty. Skips Nodes that are not Elements (e.g. + * Text and Comment nodes). + */ + DOMFragment.prototype.firstElement = function () { + return this.nthElement(0); + }; + /** + * Return the first Element node of this fragment, or undefined if + * the fragment is empty. Skips Nodes that are not Elements (e.g. + * Text and Comment nodes). + */ + DOMFragment.prototype.lastElement = function () { + if (!this.ends) return undefined; + var current = this.ends[R]; + while (current) { + // Only count element nodes + if (current.nodeType === Node.ELEMENT_NODE) { + return current; + } + if (current === this.ends[L]) return undefined; + current = current.previousSibling; + } + return undefined; + }; + /** + * Return a new fragment holding the first Element node of this + * fragment, or an empty fragment if this fragment is empty. Skips + * Nodes that are not Elements (e.g. Text and Comment nodes). + */ + DOMFragment.prototype.first = function () { + return new DOMFragment(this.firstElement()); + }; + /** + * Return a new fragment holding the last Element node of this + * fragment, or an empty fragment if this fragment is empty. Skips + * Nodes that are not Elements (e.g. Text and Comment nodes). + */ + DOMFragment.prototype.last = function () { + return new DOMFragment(this.lastElement()); + }; + /** + * Return a new fragment holding the nth Element node of this + * fragment, or an empty fragment if there is no nth node of this + * fragment. Skips Nodes that are not Elements (e.g. Text and Comment + * nodes). + */ + DOMFragment.prototype.eq = function (n) { + return new DOMFragment(this.nthElement(n)); + }; + /** + * Return a new fragment beginning with the nth Element node of this + * fragment, and ending with the same end as this fragment, or an + * empty fragment if there is no nth node in this fragment. Skips + * Nodes that are not Elements (e.g. Text and Comment nodes). + */ + DOMFragment.prototype.slice = function (n) { + // Note, would be reasonable to extend this to take a second + // argument if we ever find we need this + if (!this.ends) return this; + var el = this.nthElement(n); + if (!el) return new DOMFragment(); + return new DOMFragment(el, this.ends[R]); + }; + /** + * Return a new fragment containing the next Element after the Node + * represented by this fragment, or an empty fragment if there is no + * next Element. Skips Nodes that are not Elements (e.g. Text and + * Comment nodes). + * + * Asserts that this fragment contains exactly one Node. + */ + DOMFragment.prototype.next = function () { + var current = this.oneNode(); + while (current) { + current = current.nextSibling; + if (current && current.nodeType === Node.ELEMENT_NODE) return new DOMFragment(current); + } + return new DOMFragment(); + }; + /** + * Return a new fragment containing the previousElement after the Node + * represented by this fragment, or an empty fragment if there is no + * previous Element. Skips Nodes that are not Elements (e.g. Text and + * Comment nodes). + * + * Asserts that this fragment contains exactly one Node. + */ + DOMFragment.prototype.prev = function () { + var current = this.oneNode(); + while (current) { + current = current.previousSibling; + if (current && current.nodeType === Node.ELEMENT_NODE) return new DOMFragment(current); + } + return new DOMFragment(); + }; + /** + * Remove all children of every Element Node in the fragment. Skips + * Nodes that are not Elements (e.g. Text and Comment nodes). + */ + DOMFragment.prototype.empty = function () { + // TODO the corresponding jQuery methods clean up some internal + // references before removing elements from the DOM. That won't + // matter once jQuery is totally gone, but until then, this may + // introduce memory leaks + this.eachElement(function (el) { + el.textContent = ''; + }); + return this; + }; + /** + * Remove every node in the fragment from the DOM. + * + * Implemented by moving every node in the fragment into a new + * document fragment in order to preserve the sibling relationships + * of the removed element. If you want to get access to this document + * fragment, use `.toDocumentFragment()` instead. + */ + DOMFragment.prototype.remove = function () { + // TODO the corresponding jQuery methods clean up some internal + // references before removing elements from the DOM. That won't + // matter once jQuery is totally gone, but until then, this may + // introduce memory leaks + // Note, removing the elements by moving them to a document fragment + // because this way their sibling references stay intact. This is + // important if we want to reattach them somewhere else later + this.toDocumentFragment(); + return this; + }; + /** + * Remove every node in the fragment from the DOM. Alias of remove. + * + * Implemented by moving every node in the fragment into a new + * document fragment in order to preserve the sibling relationships + * of the removed element. If you want to get access to this document + * fragment, use `.toDocumentFragment()` instead. + * + * Note: jQuery makes a distinction between detach() and remove(). + * remove() cleans up internal references, and detach() does not. + */ + DOMFragment.prototype.detach = function () { + // In jQuery, detach() is similar to remove() but it does not clean + // up internal references. Here they're aliases, but I'm leaving + // this as a separate method for the moment to keep track of where + // mathquill did one vs the other. + return this.remove(); + }; + /** + * Insert this fragment either just before or just after `sibling` + * fragment according to the direction specified by `dir`. If + * `sibling` is empty or does not have a parent node, detaches this + * fragment from the document. + */ + DOMFragment.prototype.insDirOf = function (dir, sibling) { + var _a; + if (!this.ends) return this; + var el = (_a = sibling.ends) === null || _a === void 0 ? void 0 : _a[dir]; + if (!el || !el.parentNode) return this.detach(); + _insDirOf(dir, el.parentNode, this.toDocumentFragment(), el); + return this; + }; + /** + * Insert this fragment into `el` either at the beginning or end of + * its children, according to the direction specified by `dir`. + */ + DOMFragment.prototype.insAtDirEnd = function (dir, el) { + if (!this.ends) return this; + _insAtDirEnd(dir, this.toDocumentFragment(), el); + return this; + }; + /** + * Return true if any element in this fragment has class `className` + * and false otherwise. + */ + DOMFragment.prototype.hasClass = function (className) { + var out = false; + this.eachElement(function (el) { + if (el.classList.contains(className)) out = true; + }); + return out; + }; + /** + * Add each class in space separated list of classes given by + * `classNames` to each element in this fragment. + */ + DOMFragment.prototype.addClass = function (classNames) { + var _loop_1 = function (className) { + if (!className) return 'continue'; + this_1.eachElement(function (el) { + el.classList.add(className); + }); + }; + var this_1 = this; + for (var _i = 0, _a = classNames.split(/\s+/); _i < _a.length; _i++) { + var className = _a[_i]; + _loop_1(className); + } + return this; + }; + /** + * Remove each class in space separated list of classes given by + * `classNames` from each element in this fragment. + */ + DOMFragment.prototype.removeClass = function (classNames) { + var _loop_2 = function (className) { + if (!className) return 'continue'; + this_2.eachElement(function (el) { + el.classList.remove(className); + }); + }; + var this_2 = this; + for (var _i = 0, _a = classNames.split(/\s+/); _i < _a.length; _i++) { + var className = _a[_i]; + _loop_2(className); + } + return this; + }; + /** + * Toggle each class in space separated list of classes given by + * `classNames` on each element in this fragment. + * + * If second arg `on` is given as `true`, always toggle classes on. + * If second arg `on` is passed as `false`, always toggle classes off. + */ + DOMFragment.prototype.toggleClass = function (classNames, on) { + if (on === true) return this.addClass(classNames); + if (on === false) return this.removeClass(classNames); + var _loop_3 = function (className) { + if (!className) return 'continue'; + this_3.eachElement(function (el) { + el.classList.toggle(className); + }); + }; + var this_3 = this; + for (var _i = 0, _a = classNames.split(/\s+/); _i < _a.length; _i++) { + var className = _a[_i]; + _loop_3(className); + } + return this; + }; + return DOMFragment; + })(); + var domFrag = DOMFragment.create; + /** + * Insert `source` before or after `target` child of `parent` denending + * on `dir`. Only intended to be used internally as a helper in this module + */ + function _insDirOf(dir, parent, source, target) { + parent.insertBefore(source, dir === L ? target : target.nextSibling); + } + /** + * Insert `source` before or after `target` child of `parent` denending + * on `dir`. Only intended to be used internally as a helper in this module + */ + function _insAtDirEnd(dir, source, parent) { + if (dir === L) { + parent.insertBefore(source, parent.firstChild); + } else { + parent.appendChild(source); + } + } + /************************************************* + * Base classes of edit tree-related objects + * + * Only doing tree node manipulation via these + * adopt/ disown methods guarantees well-formedness + * of the tree. + ************************************************/ + /** A cursor-like location in an mq node tree. */ + var Point = /** @class */ (function () { + function Point(parent, leftward, rightward) { + this.init(parent, leftward, rightward); + } + // keeping init around only for tests + Point.prototype.init = function (parent, leftward, rightward) { + this.parent = parent; + this[L] = leftward; + this[R] = rightward; + }; + Point.copy = function (pt) { + return new Point(pt.parent, pt[L], pt[R]); + }; + return Point; + })(); + function eachNode(ends, yield_) { + var el = ends[L]; + if (!el) return; + var stop = ends[R]; + if (!stop) return; //shouldn't happen because ends[L] is defined; + stop = stop[R]; + // TODO - this cast as MQNode is actually important to keep tests passing. I went to + // fix this code to gracefully handle an undefined el and there are tests that actually + // verify that this will throw an error. So I'm keeping the behavior but ignoring the + // type error. + for (; el !== stop; el = el[R]) { + var result = yield_(el); // TODO - might be passing in 0 intead of a MQNode, but tests want this + if (result === false) break; + } + } + function foldNodes(ends, fold, yield_) { + var el = ends[L]; + if (!el) return fold; + var stop = ends[R]; + if (!stop) return fold; //shouldn't happen because ends[L] is defined; + stop = stop[R]; + // TODO - this cast as MQNode is actually important to keep tests passing. I went to + // fix this code to gracefully handle an undefined el and there are tests that actually + // verify that this will throw an error. So I'm keeping the behavior but ignoring the + // type error. + for (; el !== stop; el = el[R]) { + fold = yield_(fold, el); // TODO - might be passing in 0 intead of a MQNode, but tests want this + } + return fold; + } + var NodeBase = /** @class */ (function () { + function NodeBase() { + var _c; + // TODO - life would be so much better in typescript of these were undefined instead of + // 0. The ! would save us in cases where we know a node is defined. + this[_a] = 0; + this[_b] = 0; + // TODO - can this ever actually stay 0? if so we need to add null checks + this.parent = 0; + /** + * The (doubly-linked) list of this node's children. + * + * NOTE child classes may specify a narrower type for ends e.g. to + * enforce that children are not empty, or that they have a certain + * type. In those cases, this initializer may still run at + * construction time, but this is expected to be followed by a call + * to adopt that sets non-empty ends of the necessary types. + * + * Similarly, `Fragment::disown` may temporarily break non-empty + * invariants, which are expected to be restored by a subsequent call + * to `Fragment::adopt`. + * */ + this.ends = ((_c = {}), (_c[L] = 0), (_c[R] = 0), _c); + this.id = NodeBase.uniqueNodeId(); + } + NodeBase.uniqueNodeId = function () { + return (NodeBase.idCounter += 1); + }; + // The mqBlockNode and mqCmdNode custom properties link back from the + // DOM nodes generated by MathQuill to the MQNodes that generated + // them. This is useful for looking up MQNodes in event handlers and + // in the mq(elt) public API method + NodeBase.getNodeOfElement = function (el) { + if (!el) return; + if (!el.nodeType) throw new Error('must pass an Element to NodeBase.getNodeOfElement'); + var elTrackingNode = el; + return elTrackingNode.mqBlockNode || elTrackingNode.mqCmdNode; + }; + NodeBase.linkElementByBlockNode = function (elm, blockNode) { + elm.mqBlockNode = blockNode; + }; + NodeBase.linkElementByCmdNode = function (elm, cmdNode) { + elm.mqCmdNode = cmdNode; + }; + NodeBase.prototype.setEnds = function (ends) { + this.ends = ends; + pray('No half-empty node ends', !!this.ends[L] === !!this.ends[R]); + }; + NodeBase.prototype.getEnd = function (dir) { + return this.ends[dir]; + }; + NodeBase.prototype.toString = function () { + return '{{ MathQuill Node #' + this.id + ' }}'; + }; + NodeBase.prototype.setDOM = function (el) { + if (el) { + pray( + 'DOM is an element or a text node', + el.nodeType === Node.ELEMENT_NODE || el.nodeType === Node.TEXT_NODE + ); + } + this._el = el; + return this; + }; + NodeBase.prototype.domFrag = function () { + return domFrag(this._el); + }; + NodeBase.prototype.createDir = function (dir, cursor) { + prayDirection(dir); + var node = this; + node.html(); + node.domFrag().insDirOf(dir, cursor.domFrag()); + cursor[dir] = node.adopt(cursor.parent, cursor[L], cursor[R]); // TODO - assuming not undefined, could be 0 + return node; + }; + NodeBase.prototype.createLeftOf = function (cursor) { + this.createDir(L, cursor); + }; + NodeBase.prototype.selectChildren = function (leftEnd, rightEnd) { + return new MQSelection(leftEnd, rightEnd); + }; + NodeBase.prototype.bubble = function (yield_) { + var self = this.getSelfNode(); + for (var ancestor = self; ancestor; ancestor = ancestor.parent) { + var result = yield_(ancestor); + if (result === false) break; + } + return this; + }; + NodeBase.prototype.postOrder = function (yield_) { + var self = this.getSelfNode(); + (function recurse(descendant) { + if (!descendant) return false; + descendant.eachChild(recurse); + yield_(descendant); + return true; + })(self); + return self; + }; + NodeBase.prototype.isEmpty = function () { + return this.ends[L] === 0 && this.ends[R] === 0; + }; + NodeBase.prototype.isQuietEmptyDelimiter = function (dlms) { + if (!this.isEmpty()) return false; + if (!dlms) return false; + if (!this.parent || this.parent.ctrlSeq === undefined) return false; + // Remove any leading \left or \right from the ctrl sequence before looking it up. + var key = this.parent.ctrlSeq.replace(/^\\(left|right)?/, ''); + return dlms.hasOwnProperty(key); + }; + NodeBase.prototype.isStyleBlock = function () { + return false; + }; + NodeBase.prototype.isTextBlock = function () { + return false; + }; + NodeBase.prototype.children = function () { + return new Fragment(this.getEnd(L), this.getEnd(R)); + }; + NodeBase.prototype.eachChild = function (yield_) { + eachNode(this.ends, yield_); + return this; + }; + NodeBase.prototype.foldChildren = function (fold, yield_) { + return foldNodes(this.ends, fold, yield_); + }; + NodeBase.prototype.withDirAdopt = function (dir, parent, withDir, oppDir) { + var self = this.getSelfNode(); + new Fragment(self, self).withDirAdopt(dir, parent, withDir, oppDir); + return this; + }; + /** + * Add this node to the given parent node's children, at the position between the adjacent + * children `leftward` (or the beginning if omitted) and `rightward` (or the end if omitted). + * See `Fragment#adopt()` + */ + NodeBase.prototype.adopt = function (parent, leftward, rightward) { + var self = this.getSelfNode(); + new Fragment(self, self).adopt(parent, leftward, rightward); + return this.getSelfNode(); + }; + NodeBase.prototype.disown = function () { + var self = this.getSelfNode(); + new Fragment(self, self).disown(); + return this; + }; + NodeBase.prototype.remove = function () { + this.domFrag().remove(); + return this.disown(); + }; + NodeBase.prototype.shouldIgnoreSubstitutionInSimpleSubscript = function (options) { + if (!options.disableAutoSubstitutionInSubscripts) return false; + if (!this.parent) return false; + if (!(this.parent.parent instanceof SupSub)) return false; + // Mathquill is gross. There are many different paths that + // create subscripts and sometimes we don't even construct + // true instances of `LatexCmds._`. Another problem is that + // the relationship between the sub and the SupSub isn't + // completely setup during a paste at the time we check + // this. I wanted to use: `this.parent.parent.sub !== this.parent` + // but that check doesn't always work. This seems to be the only + // check that always works. I'd rather live with this than try + // to change the init order of things. + if (!this.parent.domFrag().hasClass('dcg-mq-sub')) return false; + return true; + }; + NodeBase.prototype.getSelfNode = function () { + // dumb dance to tell typescript that we eventually become a MQNode + return this; + }; + // Overridden by child classes + NodeBase.prototype.parser = function () { + pray('Abstract parser() method is never called', false); + }; + /** Render this node to DOM */ + NodeBase.prototype.html = function () { + throw new Error('html() unimplemented in NodeBase'); + }; + NodeBase.prototype.text = function () { + return ''; + }; + NodeBase.prototype.latex = function () { + var ctx = { latex: '', startIndex: -1, endIndex: -1 }; + this.latexRecursive(ctx); + return ctx.latex; + }; + NodeBase.prototype.latexRecursive = function (_ctx) {}; + NodeBase.prototype.checkCursorContextOpen = function (ctx) { + if (ctx.startSelectionBefore === this) { + ctx.startIndex = ctx.latex.length; + } + if (ctx.endSelectionBefore === this) { + ctx.endIndex = ctx.latex.length; + } + }; + NodeBase.prototype.checkCursorContextClose = function (ctx) { + if (ctx.startSelectionAfter === this) { + ctx.startIndex = ctx.latex.length; + } + if (ctx.endSelectionAfter === this) { + ctx.endIndex = ctx.latex.length; + } + }; + NodeBase.prototype.finalizeTree = function (_options, _dir) {}; + NodeBase.prototype.contactWeld = function (_cursor, _dir) {}; + NodeBase.prototype.blur = function (_cursor) {}; + NodeBase.prototype.focus = function () {}; + NodeBase.prototype.intentionalBlur = function () {}; + NodeBase.prototype.reflow = function () {}; + NodeBase.prototype.registerInnerField = function (_innerFields, _mathField) {}; + NodeBase.prototype.chToCmd = function (_ch, _options) { + pray('Abstract chToCmd() method is never called', false); + }; + NodeBase.prototype.mathspeak = function (_options) { + return ''; + }; + NodeBase.prototype.seek = function (_clientX, _cursor) {}; + NodeBase.prototype.siblingDeleted = function (_options, _dir) {}; + NodeBase.prototype.siblingCreated = function (_options, _dir) {}; + NodeBase.prototype.finalizeInsert = function (_options, _cursor) {}; + NodeBase.prototype.fixDigitGrouping = function (_opts) {}; + NodeBase.prototype.writeLatex = function (_cursor, _latex) {}; + NodeBase.prototype.write = function (_cursor, _ch) {}; + var _a, _b; + (_a = L), (_b = R); + NodeBase.idCounter = 0; + return NodeBase; + })(); + function prayWellFormed(parent, leftward, rightward) { + pray('a parent is always present', parent); + pray( + 'leftward is properly set up', + (function () { + // either it's empty and `rightward` is the left end child (possibly empty) + if (!leftward) return parent.getEnd(L) === rightward; + // or it's there and its [R] and .parent are properly set up + return leftward[R] === rightward && leftward.parent === parent; + })() + ); + pray( + 'rightward is properly set up', + (function () { + // either it's empty and `leftward` is the right end child (possibly empty) + if (!rightward) return parent.getEnd(R) === leftward; + // or it's there and its [L] and .parent are properly set up + return rightward[L] === leftward && rightward.parent === parent; + })() + ); + } + /** + * An entity outside the virtual tree with one-way pointers (so it's only a + * "view" of part of the tree, not an actual node/entity in the tree) that + * delimits a doubly-linked list of sibling nodes. + * It's like a fanfic love-child between HTML DOM DocumentFragment and the Range + * classes: like DocumentFragment, its contents must be sibling nodes + * (unlike Range, whose contents are arbitrary contiguous pieces of subtrees), + * but like Range, it has only one-way pointers to its contents, its contents + * have no reference to it and in fact may still be in the visible tree (unlike + * DocumentFragment, whose contents must be detached from the visible tree + * and have their 'parent' pointers set to the DocumentFragment). + */ + var Fragment = /** @class */ (function () { + function Fragment(withDir, oppDir, dir) { + var _c, _d; + this.disowned = false; + if (dir === undefined) dir = L; + prayDirection(dir); + pray('no half-empty fragments', !withDir === !oppDir); + if (!withDir || !oppDir) { + this.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); + return; + } + pray('withDir is passed to Fragment', withDir instanceof MQNode); + pray('oppDir is passed to Fragment', oppDir instanceof MQNode); + pray('withDir and oppDir have the same parent', withDir.parent === oppDir.parent); + var ends = ((_d = {}), (_d[dir] = withDir), (_d[-dir] = oppDir), _d); + this.setEnds(ends); + var maybeRightEnd = 0; + this.each(function (el) { + maybeRightEnd = el; + }); + pray('following direction siblings from start reaches end', maybeRightEnd === ends[R]); + } + Fragment.prototype.getDOMFragFromEnds = function () { + var left = this.ends[L]; + var right = this.ends[R]; + if (left === 0 || right === 0) { + return domFrag(); + } else if (left === right) { + // Note, joining a DOMFragment to itself is not allowed, so + // don't attempt to join the end fragments if the ends are equal + return left.domFrag(); + } else { + return left.domFrag().join(right.domFrag()); + } + }; + /** + * Note, children may override this to enforce extra invariants, + * (e.g. that ends are always defined). Ends should only be set + * through this function. + */ + Fragment.prototype.setEnds = function (ends) { + this.ends = ends; + }; + Fragment.prototype.getEnd = function (dir) { + return this.ends ? this.ends[dir] : 0; + }; + Fragment.prototype.domFrag = function () { + return this.getDOMFragFromEnds(); + }; + // like Cursor::withDirInsertAt(dir, parent, withDir, oppDir) + Fragment.prototype.withDirAdopt = function (dir, parent, withDir, oppDir) { + return dir === L ? this.adopt(parent, withDir, oppDir) : this.adopt(parent, oppDir, withDir); + }; + /** + * Splice this fragment into the given parent node's children, at the position between the adjacent + * children `leftward` (or the beginning if omitted) and `rightward` (or the end if omitted). + * + * TODO: why do we need both leftward and rightward? It seems to me that `rightward` is always expected to be `leftward ? leftward[R] : parent.ends[L]`. + */ + Fragment.prototype.adopt = function (parent, leftward, rightward) { + var _c; + prayWellFormed(parent, leftward, rightward); + var self = this; + this.disowned = false; + var leftEnd = self.ends[L]; + if (!leftEnd) return this; + var rightEnd = self.ends[R]; + if (!rightEnd) return this; + var ends = ((_c = {}), (_c[L] = parent.getEnd(L)), (_c[R] = parent.getEnd(R)), _c); + if (leftward) { + // NB: this is handled in the ::each() block + // leftward[R] = leftEnd + } else { + ends[L] = leftEnd; + } + if (rightward) { + rightward[L] = rightEnd; + } else { + ends[R] = rightEnd; + } + parent.setEnds(ends); + rightEnd[R] = rightward; + self.each(function (el) { + el[L] = leftward; + el.parent = parent; + if (leftward) leftward[R] = el; + leftward = el; + return true; + }); + return self; + }; + /** + * Remove the nodes in this fragment from their parent. + */ + Fragment.prototype.disown = function () { + var _c; + var self = this; + var leftEnd = self.ends[L]; + // guard for empty and already-disowned fragments + if (!leftEnd || self.disowned) return self; + this.disowned = true; + var rightEnd = self.ends[R]; + if (!rightEnd) return self; + var parent = leftEnd.parent; + prayWellFormed(parent, leftEnd[L], leftEnd); + prayWellFormed(parent, rightEnd, rightEnd[R]); + var ends = ((_c = {}), (_c[L] = parent.getEnd(L)), (_c[R] = parent.getEnd(R)), _c); + if (leftEnd[L]) { + var leftLeftEnd = leftEnd[L]; + leftLeftEnd[R] = rightEnd[R]; + } else { + ends[L] = rightEnd[R]; + } + if (rightEnd[R]) { + var rightRightEnd = rightEnd[R]; + rightRightEnd[L] = leftEnd[L]; + } else { + ends[R] = leftEnd[L]; + } + if (ends[L] && ends[R]) { + parent.setEnds(ends); + } else { + // some child classes of MQNode try to enforce that their ends + // are never empty through the type system. However, disown may + // temporarily break this invariant in which case it's expected + // that adopt will later be called to fix the invariant. + // + // Cast away the protected status of the ends property and write + // to it directly to get around runtime assertions in setEnds that + // enforce non-emptyness. + parent.ends = ends; + } + return self; + }; + Fragment.prototype.remove = function () { + this.domFrag().remove(); + return this.disown(); + }; + Fragment.prototype.each = function (yield_) { + eachNode(this.ends, yield_); + return this; + }; + Fragment.prototype.fold = function (fold, yield_) { + return foldNodes(this.ends, fold, yield_); + }; + return Fragment; + })(); + /** + * Registry of LaTeX commands and commands created when typing + * a single character. + * + * (Commands are all subclasses of Node.) + */ + var LatexCmds = {}; + var CharCmds = {}; + function isMQNodeClass(cmd) { + return cmd && cmd.prototype instanceof MQNode; + } + /******************************************** + * Cursor and Selection "singleton" classes + *******************************************/ + /* The main thing that manipulates the Math DOM. Makes sure to manipulate the + HTML DOM to match. */ + /* Sort of singletons, since there should only be one per editable math + textbox, but any one HTML document can contain many such textboxes, so any one + JS environment could actually contain many instances. */ + //A fake cursor in the fake textbox that the math is rendered in. + var Anticursor = /** @class */ (function (_super) { + __extends(Anticursor, _super); + function Anticursor(parent, leftward, rightward) { + var _this_1 = _super.call(this, parent, leftward, rightward) || this; + _this_1.ancestors = {}; + return _this_1; + } + Anticursor.fromCursor = function (cursor) { + return new Anticursor(cursor.parent, cursor[L], cursor[R]); + }; + return Anticursor; + })(Point); + var Cursor = /** @class */ (function (_super) { + __extends(Cursor, _super); + function Cursor(initParent, options, controller) { + var _this_1 = _super.call(this, initParent, 0, 0) || this; + /** Slightly more than just a "cache", this remembers the cursor's position in each block node, so that we can return to the right + * point in that node when moving up and down among blocks. + */ + _this_1.upDownCache = {}; + _this_1.cursorElement = h('span', { class: 'dcg-mq-cursor' }, [h.text(U_ZERO_WIDTH_SPACE)]); + _this_1._domFrag = domFrag(); + _this_1.controller = controller; + _this_1.options = options; + _this_1.setDOMFrag(domFrag(_this_1.cursorElement)); + //closured for setInterval + _this_1.blink = function () { + domFrag(_this_1.cursorElement).toggleClass('dcg-mq-blink'); + }; + return _this_1; + } + Cursor.prototype.setDOMFrag = function (frag) { + this._domFrag = frag; + return this; + }; + Cursor.prototype.domFrag = function () { + return this._domFrag; + }; + Cursor.prototype.show = function () { + domFrag(this.cursorElement).removeClass('dcg-mq-blink'); + this.setDOMFrag(domFrag(this.cursorElement)); + if (this.intervalId) + //already was shown, just restart interval + clearInterval(this.intervalId); + else { + //was hidden and detached, insert this.jQ back into HTML DOM + var right = this[R]; + if (right) { + var selection = this.selection; + if (selection && selection.getEnd(L)[L] === this[L]) + this.domFrag().insertBefore(selection.domFrag()); + else this.domFrag().insertBefore(right.domFrag()); + } else this.domFrag().appendTo(this.parent.domFrag().oneElement()); + this.parent.focus(); + } + this.intervalId = setInterval(this.blink, 500); + return this; + }; + Cursor.prototype.hide = function () { + if (this.intervalId) clearInterval(this.intervalId); + this.intervalId = 0; + this.domFrag().detach(); + this.setDOMFrag(domFrag()); + return this; + }; + Cursor.prototype.withDirInsertAt = function (dir, parent, withDir, oppDir) { + var oldParent = this.parent; + this.parent = parent; + this[dir] = withDir; + this[-dir] = oppDir; + // by contract, .blur() is called after all has been said and done + // and the cursor has actually been moved + // FIXME pass cursor to .blur() so text can fix cursor pointers when removing itself + if (oldParent !== parent && oldParent.blur) oldParent.blur(this); + }; + /** Place the cursor before or after `el`, according the side specified by `dir`. */ + Cursor.prototype.insDirOf = function (dir, el) { + prayDirection(dir); + this.domFrag().insDirOf(dir, el.domFrag()); + this.withDirInsertAt(dir, el.parent, el[dir], el); + this.parent.domFrag().addClass('dcg-mq-hasCursor'); + return this; + }; + Cursor.prototype.insLeftOf = function (el) { + return this.insDirOf(L, el); + }; + Cursor.prototype.insRightOf = function (el) { + return this.insDirOf(R, el); + }; + /** Place the cursor inside `el` at either the left or right end, according the side specified by `dir`. */ + Cursor.prototype.insAtDirEnd = function (dir, el) { + prayDirection(dir); + this.domFrag().insAtDirEnd(dir, el.domFrag().oneElement()); + this.withDirInsertAt(dir, el, 0, el.getEnd(dir)); + el.focus(); + return this; + }; + Cursor.prototype.insAtLeftEnd = function (el) { + return this.insAtDirEnd(L, el); + }; + Cursor.prototype.insAtRightEnd = function (el) { + return this.insAtDirEnd(R, el); + }; + /** + * jump up or down from one block Node to another: + * - cache the current Point in the node we're jumping from + * - check if there's a Point in it cached for the node we're jumping to + * + if so put the cursor there, + * + if not seek a position in the node that is horizontally closest to + * the cursor's current position + */ + Cursor.prototype.jumpUpDown = function (from, to) { + var self = this; + self.upDownCache[from.id] = Point.copy(self); + var cached = self.upDownCache[to.id]; + if (cached) { + var cachedR = cached[R]; + if (cachedR) { + self.insLeftOf(cachedR); + } else { + self.insAtRightEnd(cached.parent); + } + } else { + var clientX = self.getBoundingClientRectWithoutMargin().left; + to.seek(clientX, self); + } + self.controller.aria.queue(to, true); + }; + Cursor.prototype.getBoundingClientRectWithoutMargin = function () { + //in Opera 11.62, .getBoundingClientRect() and hence jQuery::offset() + //returns all 0's on inline elements with negative margin-right (like + //the cursor) at the end of their parent, so temporarily remove the + //negative margin-right when calling jQuery::offset() + //Opera bug DSK-360043 + //http://bugs.jquery.com/ticket/11523 + //https://github.com/jquery/jquery/pull/717 + var frag = this.domFrag(); + frag.removeClass('dcg-mq-cursor'); + var _c = getBoundingClientRect(frag.oneElement()), + left = _c.left, + right = _c.right; + frag.addClass('dcg-mq-cursor'); + return { + left: left, + right: right, + }; + }; + Cursor.prototype.unwrapGramp = function () { + var gramp = this.parent.parent; + var greatgramp = gramp.parent; + var rightward = gramp[R]; + var cursor = this; + var leftward = gramp[L]; + gramp.disown().eachChild(function (uncle) { + if (uncle.isEmpty()) return true; + uncle + .children() + .adopt(greatgramp, leftward, rightward) + .each(function (cousin) { + cousin.domFrag().insertBefore(gramp.domFrag()); + return true; + }); + leftward = uncle.getEnd(R); + return true; + }); + if (!this[R]) { + //then find something to be rightward to insLeftOf + var thisL = this[L]; + if (thisL) this[R] = thisL[R]; + else { + while (!this[R]) { + var newParent = this.parent[R]; + if (newParent) { + this.parent = newParent; + this[R] = newParent.getEnd(L); + } else { + this[R] = gramp[R]; + this.parent = greatgramp; + break; + } + } + } + } + var thisR = this[R]; + if (thisR) this.insLeftOf(thisR); + else this.insAtRightEnd(greatgramp); + gramp.domFrag().remove(); + var grampL = gramp[L]; + var grampR = gramp[R]; + if (grampL) grampL.siblingDeleted(cursor.options, R); + if (grampR) grampR.siblingDeleted(cursor.options, L); + }; + Cursor.prototype.startSelection = function () { + var anticursor = (this.anticursor = Anticursor.fromCursor(this)); + var ancestors = anticursor.ancestors; + for (var ancestor = anticursor; ancestor.parent; ancestor = ancestor.parent) { + ancestors[ancestor.parent.id] = ancestor; + } + }; + Cursor.prototype.endSelection = function () { + delete this.anticursor; + }; + Cursor.prototype.select = function () { + var _lca; + var anticursor = this.anticursor; + if (this[L] === anticursor[L] && this.parent === anticursor.parent) return false; + // Find the lowest common ancestor (`lca`), and the ancestor of the cursor + // whose parent is the LCA (which'll be an end of the selection fragment). + for (var ancestor = this; ancestor.parent; ancestor = ancestor.parent) { + if (ancestor.parent.id in anticursor.ancestors) { + _lca = ancestor.parent; + break; + } + } + pray('cursor and anticursor in the same tree', _lca); + var lca = _lca; + // The cursor and the anticursor should be in the same tree, because the + // mousemove handler attached to the document, unlike the one attached to + // the root HTML DOM element, doesn't try to get the math tree node of the + // mousemove target, and Cursor::seek() based solely on coordinates stays + // within the tree of `this` cursor's root. + // The other end of the selection fragment, the ancestor of the anticursor + // whose parent is the LCA. + var antiAncestor = anticursor.ancestors[lca.id]; + // Now we have two either Nodes or Points, guaranteed to have a common + // parent and guaranteed that if both are Points, they are not the same, + // and we have to figure out which is the left end and which the right end + // of the selection. + var leftEnd, + rightEnd, + dir = R; + // This is an extremely subtle algorithm. + // As a special case, `ancestor` could be a Point and `antiAncestor` a Node + // immediately to `ancestor`'s left. + // In all other cases, + // - both Nodes + // - `ancestor` a Point and `antiAncestor` a Node + // - `ancestor` a Node and `antiAncestor` a Point + // `antiAncestor[R] === rightward[R]` for some `rightward` that is + // `ancestor` or to its right, if and only if `antiAncestor` is to + // the right of `ancestor`. + if (ancestor[L] !== antiAncestor) { + for (var rightward = ancestor; rightward; rightward = rightward[R]) { + if (rightward[R] === antiAncestor[R]) { + dir = L; + leftEnd = ancestor; + rightEnd = antiAncestor; + break; + } + } + } + if (dir === R) { + leftEnd = antiAncestor; + rightEnd = ancestor; + } + // only want to select Nodes up to Points, can't select Points themselves + if (leftEnd instanceof Point) leftEnd = leftEnd[R]; + if (rightEnd instanceof Point) rightEnd = rightEnd[L]; + this.hide().selection = lca.selectChildren(leftEnd, rightEnd); + var insEl = this.selection.getEnd(dir); + this.insDirOf(dir, insEl); + this.selectionChanged(); + return true; + }; + Cursor.prototype.resetToEnd = function (controller) { + this.clearSelection(); + var root = controller.root; + this[R] = 0; + this[L] = root.getEnd(R); + this.parent = root; + }; + Cursor.prototype.clearSelection = function () { + if (this.selection) { + this.selection.clear(); + delete this.selection; + this.selectionChanged(); + } + return this; + }; + Cursor.prototype.deleteSelection = function () { + var selection = this.selection; + if (!selection) return; + this[L] = selection.getEnd(L)[L]; + this[R] = selection.getEnd(R)[R]; + selection.remove(); + this.selectionChanged(); + delete this.selection; + }; + Cursor.prototype.replaceSelection = function () { + var seln = this.selection; + if (seln) { + this[L] = seln.getEnd(L)[L]; + this[R] = seln.getEnd(R)[R]; + delete this.selection; + } + return seln; + }; + Cursor.prototype.depth = function () { + var node = this; + var depth = 0; + while ((node = node.parent)) { + depth += node instanceof MathBlock ? 1 : 0; + } + return depth; + }; + Cursor.prototype.isTooDeep = function (offset) { + if (this.options.maxDepth !== undefined) { + return this.depth() + (offset || 0) > this.options.maxDepth; + } else { + return false; + } + }; + // can be overridden + Cursor.prototype.selectionChanged = function () {}; + return Cursor; + })(Point); + var MQSelection = /** @class */ (function (_super) { + __extends(MQSelection, _super); + function MQSelection(withDir, oppDir, dir) { + var _this_1 = _super.call(this, withDir, oppDir, dir) || this; + _this_1._el = h('span', { class: 'dcg-mq-selection' }); + _this_1.getDOMFragFromEnds().wrapAll(_this_1._el); + return _this_1; + } + MQSelection.prototype.isCleared = function () { + return this._el === undefined; + }; + MQSelection.prototype.domFrag = function () { + return this.isCleared() ? this.getDOMFragFromEnds() : domFrag(this._el); + }; + MQSelection.prototype.setEnds = function (ends) { + pray('Selection ends are never empty', ends[L] && ends[R]); + this.ends = ends; + }; + MQSelection.prototype.getEnd = function (dir) { + return this.ends[dir]; + }; + MQSelection.prototype.adopt = function (parent, leftward, rightward) { + this.clear(); + return _super.prototype.adopt.call(this, parent, leftward, rightward); + }; + MQSelection.prototype.clear = function () { + // NOTE it's important here that DOMFragment::children includes all + // child nodes (including Text nodes), and not just Element nodes. + // This makes it more similar to the native DOM childNodes property + // and jQuery's .collection() method than jQuery's .children() method + var childFrag = this.getDOMFragFromEnds(); + this.domFrag().replaceWith(childFrag); + this._el = undefined; + return this; + }; + MQSelection.prototype.join = function (methodName, separator) { + if (separator === void 0) { + separator = ''; + } + return this.fold('', function (fold, child) { + return fold + separator + child[methodName](); + }); + }; + return MQSelection; + })(Fragment); + var ControllerBase = /** @class */ (function () { + function ControllerBase(root, container, options) { + this.textareaEventListeners = {}; + this.id = root.id; + this.data = {}; + this.root = root; + this.container = container; + this.options = options; + this.aria = new Aria(this.getControllerSelf()); + this.ariaLabel = 'Math Input'; + this.ariaPostLabel = ''; + root.controller = this.getControllerSelf(); + this.cursor = root.cursor = new Cursor(root, options, this.getControllerSelf()); + // TODO: stop depending on root.cursor, and rm it + } + ControllerBase.prototype.getControllerSelf = function () { + // dance we have to do to tell this thing it's a full controller + return this; + }; + ControllerBase.prototype.handle = function (name, dir) { + var _c; + var handlers = this.options.handlers; + var handler = (_c = this.options.handlers) === null || _c === void 0 ? void 0 : _c.fns[name]; + if (handler) { + var APIClass = + handlers === null || handlers === void 0 ? void 0 : handlers.APIClasses[this.KIND_OF_MQ]; + pray('APIClass is defined', APIClass); + var mq = new APIClass(this); // cast to any bedcause APIClass needs the final Controller subclass. + if (dir === L || dir === R) handler(dir, mq); + else handler(mq); + } + }; + ControllerBase.onNotify = function (f) { + ControllerBase.notifyees.push(f); + }; + ControllerBase.prototype.notify = function (e) { + for (var i = 0; i < ControllerBase.notifyees.length; i += 1) { + ControllerBase.notifyees[i](this.cursor, e); + } + return this; + }; + ControllerBase.prototype.setAriaLabel = function (ariaLabel) { + var oldAriaLabel = this.getAriaLabel(); + if (ariaLabel && typeof ariaLabel === 'string' && ariaLabel !== '') { + this.ariaLabel = ariaLabel; + } else if (this.editable) { + this.ariaLabel = 'Math Input'; + } else { + this.ariaLabel = ''; + } + // If this field doesn't have focus, update its computed mathspeak value. + // We check for focus because updating the aria-label attribute of a focused element will cause most screen readers to announce the new value (in our case, label along with the expression's mathspeak). + // If the field does have focus at the time, it will be updated once a blur event occurs. + // Unless we stop using fake text inputs and emulating screen reader behavior, this is going to remain a problem. + if (this.ariaLabel !== oldAriaLabel && !this.containerHasFocus()) { + this.updateMathspeak(); + } + return this; + }; + ControllerBase.prototype.getAriaLabel = function () { + if (this.ariaLabel !== 'Math Input') { + return this.ariaLabel; + } else if (this.editable) { + return 'Math Input'; + } else { + return ''; + } + }; + ControllerBase.prototype.setAriaPostLabel = function (ariaPostLabel, timeout) { + var _this_1 = this; + if (ariaPostLabel && typeof ariaPostLabel === 'string' && ariaPostLabel !== '') { + if (ariaPostLabel !== this.ariaPostLabel && typeof timeout === 'number') { + if (this._ariaAlertTimeout) clearTimeout(this._ariaAlertTimeout); + this._ariaAlertTimeout = setTimeout(function () { + if (_this_1.containerHasFocus()) { + // Voice the new label, but do not update content mathspeak to prevent double-speech. + _this_1.aria.alert(_this_1.root.mathspeak().trim() + ' ' + ariaPostLabel.trim()); + } else { + // This mathquill does not have focus, so update its mathspeak. + _this_1.updateMathspeak(); + } + }, timeout); + } + this.ariaPostLabel = ariaPostLabel; + } else { + if (this._ariaAlertTimeout) clearTimeout(this._ariaAlertTimeout); + this.ariaPostLabel = ''; + } + return this; + }; + ControllerBase.prototype.getAriaPostLabel = function () { + return this.ariaPostLabel || ''; + }; + ControllerBase.prototype.containerHasFocus = function () { + return document.activeElement && this.container.contains(document.activeElement); + }; + ControllerBase.prototype.getTextareaOrThrow = function () { + var textarea = this.textarea; + if (!textarea) throw new Error('expected a textarea'); + return textarea; + }; + ControllerBase.prototype.getTextareaSpanOrThrow = function () { + var textareaSpan = this.textareaSpan; + if (!textareaSpan) throw new Error('expected a textareaSpan'); + return textareaSpan; + }; + /** Add the given event listeners on this.textarea, replacing the existing listener for that event if it exists. */ + ControllerBase.prototype.addTextareaEventListeners = function (listeners) { + if (!this.textarea) return; + for (var key_2 in listeners) { + var event = key_2; + this.removeTextareaEventListener(event); + this.textarea.addEventListener(event, listeners[event]); + } + }; + ControllerBase.prototype.removeTextareaEventListener = function (event) { + if (!this.textarea) return; + var listener = this.textareaEventListeners[event]; + if (!listener) return; + this.textarea.removeEventListener(event, listener); + }; + // based on http://www.gh-mathspeak.com/examples/quick-tutorial/ + // and http://www.gh-mathspeak.com/examples/grammar-rules/ + ControllerBase.prototype.exportMathSpeak = function () { + return this.root.mathspeak(); + }; + // overridden + ControllerBase.prototype.updateMathspeak = function () {}; + ControllerBase.prototype.scrollHoriz = function () {}; + ControllerBase.prototype.selectionChanged = function () {}; + ControllerBase.prototype.setOverflowClasses = function () {}; + ControllerBase.notifyees = []; + return ControllerBase; + })(); + var API = {}; + var EMBEDS = {}; + var processedOptions = { + handlers: true, + autoCommands: true, + quietEmptyDelimiters: true, + autoParenthesizedFunctions: true, + autoOperatorNames: true, + leftRightIntoCmdGoes: true, + maxDepth: true, + interpretTildeAsSim: true, + }; + var baseOptionProcessors = {}; + var Options = /** @class */ (function () { + function Options(version) { + this.version = version; + } + Options.prototype.assertJquery = function () { + pray('Interface versions > 2 do not depend on JQuery', this.version <= 2); + pray('JQuery is set for interface v < 3', this.jQuery); + return this.jQuery; + }; + return Options; + })(); + var Progenote = /** @class */ (function () { + function Progenote() {} + return Progenote; + })(); + /** + * Interface Versioning (#459, #495) to allow us to virtually guarantee + * backcompat. v0.10.x introduces it, so for now, don't completely break the + * API for people who don't know about it, just complain with console.warn(). + * + * The methods are shimmed in outro.js so that MQ.MathField.prototype etc can + * be accessed. + */ + var insistOnInterVer = function () { + if (window.console) + console.warn( + 'You are using the MathQuill API without specifying an interface version, ' + + 'which will fail in v1.0.0. Easiest fix is to do the following before ' + + 'doing anything else:\n' + + '\n' + + ' MathQuill = MathQuill.getInterface(1);\n' + + ' // now MathQuill.MathField() works like it used to\n' + + '\n' + + 'See also the "`dev` branch (2014\u20132015) \u2192 v0.10.0 Migration Guide" at\n' + + ' https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide' + ); + }; + // globally exported API object + var MQ1; + function MathQuill(el) { + insistOnInterVer(); + if (!MQ1) { + MQ1 = getInterface(1); + } + return MQ1(el); + } + MathQuill.prototype = Progenote.prototype; + MathQuill.VERSION = 'v0.10.1'; + MathQuill.interfaceVersion = function (v) { + // shim for #459-era interface versioning (ended with #495) + if (v !== 1) throw 'Only interface version 1 supported. You specified: ' + v; + insistOnInterVer = function () { + if (window.console) + console.warn( + 'You called MathQuill.interfaceVersion(1); to specify the interface ' + + 'version, which will fail in v1.0.0. You can fix this easily by doing ' + + 'this before doing anything else:\n' + + '\n' + + ' MathQuill = MathQuill.getInterface(1);\n' + + ' // now MathQuill.MathField() works like it used to\n' + + '\n' + + 'See also the "`dev` branch (2014\u20132015) \u2192 v0.10.0 Migration Guide" at\n' + + ' https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide' + ); + }; + insistOnInterVer(); + return MathQuill; + }; + MathQuill.getInterface = getInterface; + var MIN = (getInterface.MIN = 1), + MAX = (getInterface.MAX = 3); + function getInterface(v) { + if (v !== 1 && v !== 2 && v !== 3) + throw 'Only interface versions between ' + MIN + ' and ' + MAX + ' supported. You specified: ' + v; + var version = v; + if (version < 3) { + var jQuery = window.jQuery; + if (!jQuery) + throw 'MathQuill interface version '.concat(version, ' requires jQuery 1.5.2+ to be loaded first'); + Options.prototype.jQuery = jQuery; + } + var optionProcessors = __assign(__assign({}, baseOptionProcessors), { + handlers: function (handlers) { + return { + // casting to the v3 version of this type + fns: handlers || {}, + APIClasses: APIClasses, + }; + }, + }); + function config(currentOptions, newOptions) { + for (var name in newOptions) { + if (newOptions.hasOwnProperty(name)) { + if (name === 'substituteKeyboardEvents' && version >= 3) { + throw new Error( + [ + "As of interface version 3, the 'substituteKeyboardEvents'", + "option is no longer supported. Use 'overrideTypedText' and", + "'overrideKeystroke' instead.", + ].join(' ') + ); + } + var value = newOptions[name]; // TODO - think about typing this better + var processor = optionProcessors[name]; // TODO - validate option processors better + currentOptions[name] = processor ? processor(value) : value; // TODO - think about typing better + } + } + } + var BaseOptions = + version < 3 + ? Options + : /** @class */ (function (_super) { + __extends(BaseOptions, _super); + function BaseOptions() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + return BaseOptions; + })(Options); + var AbstractMathQuill = /** @class */ (function (_super) { + __extends(AbstractMathQuill, _super); + function AbstractMathQuill(ctrlr) { + var _this_1 = _super.call(this) || this; + _this_1.__controller = ctrlr; + _this_1.__options = ctrlr.options; + _this_1.id = ctrlr.id; + _this_1.data = ctrlr.data; + return _this_1; + } + AbstractMathQuill.prototype.mathquillify = function (classNames) { + var ctrlr = this.__controller, + root = ctrlr.root, + el = ctrlr.container; + ctrlr.createTextarea(); + var contents = domFrag(el).addClass(classNames).children().detach(); + root.setDOM( + domFrag(h('span', { class: 'dcg-mq-root-block', 'aria-hidden': true })) + .appendTo(el) + .oneElement() + ); + NodeBase.linkElementByBlockNode(root.domFrag().oneElement(), root); + this.latex(contents.text()); + this.revert = function () { + ctrlr.removeMouseEventListener(); + domFrag(el) + .removeClass('dcg-mq-editable-field dcg-mq-math-mode dcg-mq-text-mode') + .empty() + .append(contents); + return version < 3 ? this.__options.assertJquery()(el) : el; + }; + }; + AbstractMathQuill.prototype.setAriaLabel = function (ariaLabel) { + this.__controller.setAriaLabel(ariaLabel); + return this; + }; + AbstractMathQuill.prototype.getAriaLabel = function () { + return this.__controller.getAriaLabel(); + }; + AbstractMathQuill.prototype.config = function (opts) { + config(this.__options, opts); + return this; + }; + AbstractMathQuill.prototype.el = function () { + return this.__controller.container; + }; + AbstractMathQuill.prototype.text = function () { + return this.__controller.exportText(); + }; + AbstractMathQuill.prototype.mathspeak = function () { + return this.__controller.exportMathSpeak(); + }; + AbstractMathQuill.prototype.latex = function (latex) { + if (arguments.length > 0) { + this.__controller.renderLatexMath(latex); + var cursor = this.__controller.cursor; + if (this.__controller.blurred) cursor.hide().parent.blur(cursor); + return this; + } + return this.__controller.exportLatex(); + }; + AbstractMathQuill.prototype.selection = function () { + return this.__controller.exportLatexSelection(); + }; + AbstractMathQuill.prototype.html = function () { + return this.__controller.root + .domFrag() + .oneElement() + .innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, '') // TODO remove when jQuery is completely gone + .replace(/ mathquill-(?:command|block)-id="?\d+"?/g, '') + .replace(/.?<\/span>/i, '') + .replace(/ dcg-mq-hasCursor|dcg-mq-hasCursor ?/, '') + .replace(/ class=(""|(?= |>))/g, ''); + }; + AbstractMathQuill.prototype.reflow = function () { + this.__controller.root.postOrder(function (node) { + node.reflow(); + }); + return this; + }; + return AbstractMathQuill; + })(Progenote); + var EditableField = /** @class */ (function (_super) { + __extends(EditableField, _super); + function EditableField() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + EditableField.prototype.mathquillify = function (classNames) { + _super.prototype.mathquillify.call(this, classNames); + this.__controller.editable = true; + this.__controller.addMouseEventListener(); + this.__controller.editablesTextareaEvents(); + return this; + }; + EditableField.prototype.focus = function () { + this.__controller.getTextareaOrThrow().focus(); + this.__controller.scrollHoriz(); + return this; + }; + EditableField.prototype.blur = function () { + this.__controller.getTextareaOrThrow().blur(); + return this; + }; + EditableField.prototype.write = function (latex) { + this.__controller.writeLatex(latex); + this.__controller.scrollHoriz(); + var cursor = this.__controller.cursor; + if (this.__controller.blurred) cursor.hide().parent.blur(cursor); + return this; + }; + EditableField.prototype.empty = function () { + var _c; + var root = this.__controller.root, + cursor = this.__controller.cursor; + root.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); + root.domFrag().empty(); + delete cursor.selection; + cursor.insAtRightEnd(root); + return this; + }; + EditableField.prototype.cmd = function (cmd) { + var ctrlr = this.__controller.notify(undefined), + cursor = ctrlr.cursor; + if (/^\\[a-z]+$/i.test(cmd) && !cursor.isTooDeep()) { + cmd = cmd.slice(1); + var klass = LatexCmds[cmd]; + var node; + if (klass) { + if (klass.constructor) { + node = new klass(cmd); + } else { + node = klass(cmd); + } + if (cursor.selection) node.replaces(cursor.replaceSelection()); + node.createLeftOf(cursor.show()); + } /* TODO: API needs better error reporting */ else; + } else cursor.parent.write(cursor, cmd); + ctrlr.scrollHoriz(); + if (ctrlr.blurred) cursor.hide().parent.blur(cursor); + return this; + }; + EditableField.prototype.select = function () { + this.__controller.selectAll(); + return this; + }; + EditableField.prototype.clearSelection = function () { + this.__controller.cursor.clearSelection(); + return this; + }; + EditableField.prototype.moveToDirEnd = function (dir) { + this.__controller.notify('move').cursor.insAtDirEnd(dir, this.__controller.root); + return this; + }; + EditableField.prototype.moveToLeftEnd = function () { + return this.moveToDirEnd(L); + }; + EditableField.prototype.moveToRightEnd = function () { + return this.moveToDirEnd(R); + }; + EditableField.prototype.keystroke = function (keysString, evt) { + var keys = keysString.replace(/^\s+|\s+$/g, '').split(/\s+/); + for (var i = 0; i < keys.length; i += 1) { + this.__controller.keystroke(keys[i], evt); + } + return this; + }; + EditableField.prototype.typedText = function (text) { + for (var i = 0; i < text.length; i += 1) this.__controller.typedText(text.charAt(i)); + return this; + }; + EditableField.prototype.dropEmbedded = function (pageX, pageY, options) { + var clientX = pageX - getScrollX(); + var clientY = pageY - getScrollY(); + var el = document.elementFromPoint(clientX, clientY); + this.__controller.seek(el, clientX, clientY); + var cmd = new EmbedNode().setOptions(options); + cmd.createLeftOf(this.__controller.cursor); + }; + EditableField.prototype.setAriaPostLabel = function (ariaPostLabel, timeout) { + this.__controller.setAriaPostLabel(ariaPostLabel, timeout); + return this; + }; + EditableField.prototype.getAriaPostLabel = function () { + return this.__controller.getAriaPostLabel(); + }; + EditableField.prototype.clickAt = function (clientX, clientY, target) { + target = target || document.elementFromPoint(clientX, clientY); + var ctrlr = this.__controller, + root = ctrlr.root; + var rootElement = root.domFrag().oneElement(); + if (!rootElement.contains(target)) target = rootElement; + ctrlr.seek(target, clientX, clientY); + if (ctrlr.blurred) this.focus(); + return this; + }; + EditableField.prototype.ignoreNextMousedown = function (fn) { + this.__controller.cursor.options.ignoreNextMousedown = fn; + return this; + }; + return EditableField; + })(AbstractMathQuill); + var APIClasses = { + AbstractMathQuill: AbstractMathQuill, + EditableField: EditableField, + }; + pray('API.StaticMath defined', API.StaticMath); + APIClasses.StaticMath = API.StaticMath(APIClasses); + pray('API.MathField defined', API.MathField); + APIClasses.MathField = API.MathField(APIClasses); + pray('API.InnerMathField defined', API.InnerMathField); + APIClasses.InnerMathField = API.InnerMathField(APIClasses); + if (API.TextField) { + APIClasses.TextField = API.TextField(APIClasses); + } + /** + * Function that takes an HTML element and, if it's the root HTML element of a + * static math or math or text field, returns an API object for it (else, null). + * + * var mathfield = MQ.MathField(mathFieldSpan); + * assert(MQ(mathFieldSpan).id === mathfield.id); + * assert(MQ(mathFieldSpan).id === MQ(mathFieldSpan).id); + * + */ + var MQ = function (el) { + if (!el || !el.nodeType) return null; // check that `el` is a HTML element, using the + // same technique as jQuery: https://github.com/jquery/jquery/blob/679536ee4b7a92ae64a5f58d90e9cc38c001e807/src/core/init.js#L92 + var blockElement; + var childArray = domFrag(el).children().toElementArray(); + for (var _i = 0, childArray_1 = childArray; _i < childArray_1.length; _i++) { + var child = childArray_1[_i]; + if (child.classList.contains('dcg-mq-root-block')) { + blockElement = child; + break; + } + } + var blockNode = NodeBase.getNodeOfElement(blockElement); // TODO - assumng it's a MathBlock + var ctrlr = blockNode && blockNode.controller; + var APIClass = ctrlr && APIClasses[ctrlr.KIND_OF_MQ]; + return ctrlr && APIClass ? new APIClass(ctrlr) : null; + }; + MQ.L = L; + MQ.R = R; + MQ.config = function (opts) { + config(BaseOptions.prototype, opts); + return this; + }; + MQ.registerEmbed = function (name, options) { + if (!/^[a-z][a-z0-9]*$/i.test(name)) { + throw 'Embed name must start with letter and be only letters and digits'; + } + EMBEDS[name] = options; + }; + /* + * Export the API functions that MathQuill-ify an HTML element into API objects + * of each class. If the element had already been MathQuill-ified but into a + * different kind (or it's not an HTML element), return null. + */ + MQ.StaticMath = createEntrypoint('StaticMath', APIClasses.StaticMath); + MQ.MathField = createEntrypoint('MathField', APIClasses.MathField); + MQ.InnerMathField = createEntrypoint('InnerMathField', APIClasses.InnerMathField); + if (APIClasses.TextField) { + MQ.TextField = createEntrypoint('TextField', APIClasses.TextField); + } + MQ.prototype = AbstractMathQuill.prototype; + MQ.EditableField = function () { + throw "wtf don't call me, I'm 'abstract'"; + }; + MQ.EditableField.prototype = EditableField.prototype; + if (version < 3) { + MQ.saneKeyboardEvents = defaultSubstituteKeyboardEvents; + } + function createEntrypoint(kind, APIClass) { + pray(kind + ' is defined', APIClass); + function mqEntrypoint(el, opts) { + if (!el || !el.nodeType) return null; + var mq = MQ(el); + if (mq instanceof APIClass) return mq; + var ctrlr = new Controller(new APIClass.RootBlock(), el, new BaseOptions(version)); + ctrlr.KIND_OF_MQ = kind; + return new APIClass(ctrlr).__mathquillify(opts || {}, version); + } + mqEntrypoint.prototype = APIClass.prototype; + return mqEntrypoint; + } + return MQ; + } + MathQuill.noConflict = function () { + window.MathQuill = origMathQuill; + return MathQuill; + }; + var origMathQuill = window.MathQuill; + window.MathQuill = MathQuill; + function RootBlockMixin(_) { + _.moveOutOf = function (dir) { + pray('controller is defined', this.controller); + this.controller.handle('moveOutOf', dir); + }; + _.deleteOutOf = function (dir) { + pray('controller is defined', this.controller); + this.controller.handle('deleteOutOf', dir); + }; + _.selectOutOf = function (dir) { + pray('controller is defined', this.controller); + this.controller.handle('selectOutOf', dir); + }; + _.upOutOf = function () { + pray('controller is defined', this.controller); + this.controller.handle('upOutOf'); + return undefined; + }; + _.downOutOf = function () { + pray('controller is defined', this.controller); + this.controller.handle('downOutOf'); + return undefined; + }; + _.reflow = function () { + pray('controller is defined', this.controller); + this.controller.handle('reflow'); + this.controller.handle('edited'); + this.controller.handle('edit'); + }; + } + function parseError(stream, message) { + if (stream) { + stream = "'" + stream + "'"; + } else { + stream = 'EOF'; + } + throw 'Parse Error: ' + message + ' at ' + stream; + } + var Parser = /** @class */ (function () { + // The Parser object is a wrapper for a parser function. + // Externally, you use one to parse a string by calling + // var result = SomeParser.parse('Me Me Me! Parse Me!'); + // You should never call the constructor, rather you should + // construct your Parser from the base parsers and the + // parser combinator methods. + function Parser(body) { + this._ = body; + } + Parser.prototype.parse = function (stream) { + return this.skip(Parser.eof)._('' + stream, success, parseError); + function success(_stream, result) { + return result; + } + }; + // -*- primitive combinators -*- // + Parser.prototype.or = function (alternative) { + pray('or is passed a parser', alternative instanceof Parser); + var self = this; + return new Parser(function (stream, onSuccess, onFailure) { + return self._(stream, onSuccess, failure); + function failure(_newStream) { + return alternative._(stream, onSuccess, onFailure); + } + }); + }; + Parser.prototype.then = function (next) { + var self = this; + return new Parser(function (stream, onSuccess, onFailure) { + return self._(stream, success, onFailure); + function success(newStream, result) { + var nextParser = next instanceof Parser ? next : next(result); + pray('a parser is returned', nextParser instanceof Parser); + return nextParser._(newStream, onSuccess, onFailure); + } + }); + }; + // -*- optimized iterative combinators -*- // + Parser.prototype.many = function () { + var self = this; + return new Parser(function (stream, onSuccess, _onFailure) { + var xs = []; + while (self._(stream, success, failure)); + return onSuccess(stream, xs); + function success(newStream, x) { + stream = newStream; + xs.push(x); + return true; + } + function failure() { + return false; + } + }); + }; + Parser.prototype.times = function (min, max) { + if (arguments.length < 2) max = min; + var self = this; + return new Parser(function (stream, onSuccess, onFailure) { + var xs = []; + var result = true; + var failure; + for (var i = 0; i < min; i += 1) { + // TODO, this may be incorrect for parsers that return boolean + // (or generally, falsey) values + result = !!self._(stream, success, firstFailure); + if (!result) return onFailure(stream, failure); + } + for (; i < max && result; i += 1) { + self._(stream, success, secondFailure); + } + return onSuccess(stream, xs); + function success(newStream, x) { + xs.push(x); + stream = newStream; + return true; + } + function firstFailure(newStream, msg) { + failure = msg; + stream = newStream; + return false; + } + function secondFailure(_newStream, _msg) { + return false; + } + }); + }; + // -*- higher-level combinators -*- // + Parser.prototype.result = function (res) { + return this.then(Parser.succeed(res)); + }; + Parser.prototype.atMost = function (n) { + return this.times(0, n); + }; + Parser.prototype.atLeast = function (n) { + var self = this; + return self.times(n).then(function (start) { + return self.many().map(function (end) { + return start.concat(end); + }); + }); + }; + Parser.prototype.map = function (fn) { + return this.then(function (result) { + return Parser.succeed(fn(result)); + }); + }; + Parser.prototype.skip = function (two) { + return this.then(function (result) { + return two.result(result); + }); + }; + // -*- primitive parsers -*- // + Parser.string = function (str) { + var len = str.length; + var expected = "expected '" + str + "'"; + return new Parser(function (stream, onSuccess, onFailure) { + var head = stream.slice(0, len); + if (head === str) { + return onSuccess(stream.slice(len), head); + } else { + return onFailure(stream, expected); + } + }); + }; + Parser.regex = function (re) { + pray('regexp parser is anchored', re.toString().charAt(1) === '^'); + var expected = 'expected ' + re; + return new Parser(function (stream, onSuccess, onFailure) { + var match = re.exec(stream); + if (match) { + var result = match[0]; + return onSuccess(stream.slice(result.length), result); + } else { + return onFailure(stream, expected); + } + }); + }; + Parser.succeed = function (result) { + return new Parser(function (stream, onSuccess) { + return onSuccess(stream, result); + }); + }; + Parser.fail = function (msg) { + return new Parser(function (stream, _, onFailure) { + return onFailure(stream, msg); + }); + }; + Parser.letter = Parser.regex(/^[a-z]/i); + Parser.letters = Parser.regex(/^[a-z]*/i); + Parser.digit = Parser.regex(/^[0-9]/); + Parser.digits = Parser.regex(/^[0-9]*/); + Parser.whitespace = Parser.regex(/^\s+/); + Parser.optWhitespace = Parser.regex(/^\s*/); + Parser.any = new Parser(function (stream, onSuccess, onFailure) { + if (!stream) return onFailure(stream, 'expected any character'); + return onSuccess(stream.slice(1), stream.charAt(0)); + }); + Parser.all = new Parser(function (stream, onSuccess, _onFailure) { + return onSuccess('', stream); + }); + Parser.eof = new Parser(function (stream, onSuccess, onFailure) { + if (stream) return onFailure(stream, 'expected EOF'); + return onSuccess(stream, stream); + }); + return Parser; + })(); + /** Poller that fires once every tick. */ + var EveryTick = /** @class */ (function () { + function EveryTick() { + this.fn = noop; + } + EveryTick.prototype.listen = function (fn) { + this.fn = fn; + clearTimeout(this.timeoutId); + this.timeoutId = setTimeout(this.fn); + }; + EveryTick.prototype.listenOnce = function (fn) { + var _this_1 = this; + this.listen(function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + _this_1.clearListener(); + fn.apply(void 0, args); + }); + }; + EveryTick.prototype.clearListener = function () { + this.fn = noop; + clearTimeout(this.timeoutId); + }; + EveryTick.prototype.trigger = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + this.fn.apply(this, args); + }; + return EveryTick; + })(); + /************************************************* + * Sane Keyboard Events Shim + * + * An abstraction layer over the raw browser browser events + * on the textarea that hides all the nasty cross- + * browser incompatibilities behind a uniform API. + * + * Design goal: This is a *HARD* internal + * abstraction barrier. Cross-browser + * inconsistencies are not allowed to leak through + * and be dealt with by event handlers. All future + * cross-browser issues that arise must be dealt + * with here, and if necessary, the API updated. + ************************************************/ + var saneKeyboardEvents = (function () { + // The following [key values][1] map was compiled from the + // [DOM3 Events appendix section on key codes][2] and + // [a widely cited report on cross-browser tests of key codes][3], + // except for 10: 'Enter', which I've empirically observed in Safari on iOS + // and doesn't appear to conflict with any other known key codes. + // + // [1]: http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120614/#keys-keyvalues + // [2]: http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120614/#fixed-virtual-key-codes + // [3]: http://unixpapa.com/js/key.html + var WHICH_TO_MQ_KEY_STEM = { + 8: 'Backspace', + 9: 'Tab', + 10: 'Enter', + 13: 'Enter', + 16: 'Shift', + 17: 'Control', + 18: 'Alt', + 20: 'CapsLock', + 27: 'Esc', + 32: 'Spacebar', + 33: 'PageUp', + 34: 'PageDown', + 35: 'End', + 36: 'Home', + 37: 'Left', + 38: 'Up', + 39: 'Right', + 40: 'Down', + 45: 'Insert', + 46: 'Del', + 144: 'NumLock', + }; + var KEY_TO_MQ_KEY_STEM = { + ArrowRight: 'Right', + ArrowLeft: 'Left', + ArrowDown: 'Down', + ArrowUp: 'Up', + Delete: 'Del', + Escape: 'Esc', + ' ': 'Spacebar', + }; + function isArrowKey(e) { + // The keyPress event in FF reports which=0 for some reason. The new + // .key property seems to report reasonable results, so we're using that + switch (getMQKeyStem(e)) { + case 'Right': + case 'Left': + case 'Down': + case 'Up': + return true; + } + return false; + } + function isLowercaseAlphaCharacter(s) { + return s.length === 1 && s >= 'a' && s <= 'z'; + } + function getMQKeyStem(evt) { + var _c; + // Translate browser key names to MQ's internal naming system + // + // Ref: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values + if (evt.key === undefined) { + var which = evt.which || evt.keyCode; + return WHICH_TO_MQ_KEY_STEM[which] || String.fromCharCode(which); + } + if (isLowercaseAlphaCharacter(evt.key)) return evt.key.toUpperCase(); + return (_c = KEY_TO_MQ_KEY_STEM[evt.key]) !== null && _c !== void 0 ? _c : evt.key; + } + /** To the extent possible, create a normalized string representation + * of the key combo (i.e., key code and modifier keys). */ + function getMQKeyName(evt) { + var key = getMQKeyStem(evt); + var modifiers = []; + if (evt.ctrlKey) modifiers.push('Ctrl'); + if (evt.metaKey) modifiers.push('Meta'); + if (evt.altKey) modifiers.push('Alt'); + if (evt.shiftKey) modifiers.push('Shift'); + if (!modifiers.length) return key; + modifiers.push(key); + return modifiers.join('-'); + } + return function saneKeyboardEvents( + /** Usually the textarea associated with a MQ instance, but can be another kind of element if `substituteTextarea` was used to replace it with something else. */ + textarea, + controller + ) { + var keydown = null; + var keypress = null; + // everyTick.listen() is called after key or clipboard events to + // say "Hey, I think something was just typed" or "pasted" etc, + // so that at all subsequent opportune times (next event or timeout), + // will check for expected typed or pasted text. + // Need to check repeatedly because #135: in Safari 5.1 (at least), + // after selecting something and then typing, the textarea is + // incorrectly reported as selected during the input event (but not + // subsequently). + var everyTick = new EveryTick(); + function guardedTextareaSelect() { + try { + // IE can throw an 'Incorrect Function' error if you + // try to select a textarea that is hidden. It seems + // likely that we don't really care if the selection + // fails to happen in this case. Why would the textarea + // be hidden? And who would even be able to tell? + if (textarea instanceof HTMLTextAreaElement) textarea.select(); + } catch (e) {} + } + // -*- public methods -*- // + function select(text) { + // check textarea at least once/one last time before munging (so + // no race condition if selection happens after keypress/paste but + // before checkTextarea), then never again ('cos it's been munged) + everyTick.trigger(); + everyTick.clearListener(); + if (textarea instanceof HTMLTextAreaElement) textarea.value = text; + if (text) guardedTextareaSelect(); + shouldBeSelected = !!text; + } + var shouldBeSelected = false; + // -*- helper subroutines -*- // + // Determine whether there's a selection in the textarea. + // This will always return false in IE < 9, which don't support + // HTMLTextareaElement::selection{Start,End}. + function hasSelection() { + if (!('selectionStart' in textarea)) return false; + if (!(textarea instanceof HTMLTextAreaElement)) return false; + return textarea.selectionStart !== textarea.selectionEnd; + } + function handleKey() { + if (controller.options && controller.options.overrideKeystroke) { + controller.options.overrideKeystroke(getMQKeyName(keydown), keydown); + } else { + controller.keystroke(getMQKeyName(keydown), keydown); + } + } + // -*- event handlers -*- // + function onKeydown(e) { + everyTick.trigger(e); + if (e.target !== textarea) return; + keydown = e; + keypress = null; + if (shouldBeSelected) + everyTick.listenOnce(function (e) { + if (!(e && e.type === 'focusout')) { + // re-select textarea in case it's an unrecognized key that clears + // the selection, then never again, 'cos next thing might be blur + guardedTextareaSelect(); + } + }); + handleKey(); + } + function onKeypress(e) { + everyTick.trigger(e); + if (e.target !== textarea) return; + // call the key handler for repeated keypresses. + // This excludes keypresses that happen directly + // after keydown. In that case, there will be + // no previous keypress, so we skip it here + if (keydown && keypress) handleKey(); + keypress = e; + // only check for typed text if this key can type text. Otherwise + // you can end up with mathquill thinking text was typed if you + // use the mq.keystroke('Right') command while a single character + // is selected. Only detected in FF. + if (!isArrowKey(e)) { + everyTick.listen(typedText); + } else { + everyTick.listenOnce(maybeReselect); + } + } + function onKeyup(e) { + everyTick.trigger(e); + if (e.target !== textarea) return; + // Handle case of no keypress event being sent + if (!!keydown && !keypress) { + // only check for typed text if this key can type text. Otherwise + // you can end up with mathquill thinking text was typed if you + // use the mq.keystroke('Right') command while a single character + // is selected. Only detected in FF. + if (!isArrowKey(e)) { + everyTick.listen(typedText); + } else { + everyTick.listenOnce(maybeReselect); + } + } + } + function typedText() { + // If there is a selection, the contents of the textarea couldn't + // possibly have just been typed in. + // This happens in browsers like Firefox and Opera that fire + // keypress for keystrokes that are not text entry and leave the + // selection in the textarea alone, such as Ctrl-C. + // Note: we assume that browsers that don't support hasSelection() + // also never fire keypress on keystrokes that are not text entry. + // This seems reasonably safe because: + // - all modern browsers including IE 9+ support hasSelection(), + // making it extremely unlikely any browser besides IE < 9 won't + // - as far as we know IE < 9 never fires keypress on keystrokes + // that aren't text entry, which is only as reliable as our + // tests are comprehensive, but the IE < 9 way to do + // hasSelection() is poorly documented and is also only as + // reliable as our tests are comprehensive + // If anything like #40 or #71 is reported in IE < 9, see + // b1318e5349160b665003e36d4eedd64101ceacd8 + if (hasSelection()) return; + if (!(textarea instanceof HTMLTextAreaElement)) return; + var text = textarea.value; + if (text.length === 1) { + textarea.value = ''; + if (controller.options && controller.options.overrideTypedText) { + controller.options.overrideTypedText(text); + } else { + controller.typedText(text); + } + } // in Firefox, keys that don't type text, just clear seln, fire keypress + // https://github.com/mathquill/mathquill/issues/293#issuecomment-40997668 + else maybeReselect(); // re-select if that's why we're here + } + function maybeReselect() { + if (!(textarea instanceof HTMLTextAreaElement)) return; + if (textarea.value.length > 1) { + guardedTextareaSelect(); + } + } + function onBlur() { + keydown = null; + keypress = null; + everyTick.clearListener(); + if (textarea instanceof HTMLTextAreaElement) textarea.value = ''; + } + function onPaste(e) { + everyTick.trigger(); + if (e.target !== textarea) return; + // browsers are dumb. + // + // In Linux, middle-click pasting causes onPaste to be called, + // when the textarea is not necessarily focused. We focus it + // here to ensure that the pasted text actually ends up in the + // textarea. + // + // It's pretty nifty that by changing focus in this handler, + // we can change the target of the default action. (This works + // on keydown too, FWIW). + // + // And by nifty, we mean dumb (but useful sometimes). + if (document.activeElement !== textarea) { + textarea.focus(); + } + everyTick.listen(function pastedText() { + if (!(textarea instanceof HTMLTextAreaElement)) return; + var text = textarea.value; + textarea.value = ''; + if (text) controller.paste(text); + }); + } + function onInput(e) { + everyTick.trigger(e); + } + if (controller.options && controller.options.disableCopyPaste) { + controller.addTextareaEventListeners({ + keydown: onKeydown, + keypress: onKeypress, + keyup: onKeyup, + focusout: onBlur, + copy: function (e) { + e.preventDefault(); + }, + cut: function (e) { + e.preventDefault(); + }, + paste: function (e) { + everyTick.trigger(); + e.preventDefault(); + }, + input: onInput, + }); + } else { + controller.addTextareaEventListeners({ + keydown: onKeydown, + keypress: onKeypress, + keyup: onKeyup, + focusout: onBlur, + cut: function () { + everyTick.listenOnce(function () { + controller.cut(); + }); + }, + copy: function () { + everyTick.listenOnce(function () { + controller.copy(); + }); + }, + paste: onPaste, + input: onInput, + }); + } + // -*- export public methods -*- // + return { select: select }; + }; + })(); + /*********************************************** + * Export math in a human-readable text format + * As you can see, only half-baked so far. + **********************************************/ + var Controller_exportText = /** @class */ (function (_super) { + __extends(Controller_exportText, _super); + function Controller_exportText() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + Controller_exportText.prototype.exportText = function () { + return this.root.foldChildren('', function (text, child) { + return text + child.text(); + }); + }; + return Controller_exportText; + })(ControllerBase); + ControllerBase.onNotify(function (cursor, e) { + // these try to cover all ways that mathquill can be modified + if (e === 'edit' || e === 'replace' || e === undefined) { + var controller = cursor.controller; + if (!controller) return; + if (!controller.options.enableDigitGrouping) return; + // TODO - maybe reconsider these 3 states and drop down to only 2 + // + // blurred === false means we are focused. blurred === true or + // blurred === undefined means we are not focused. + if (controller.blurred !== false) return; + controller.disableGroupingForSeconds(1); + } + }); + var Controller_focusBlur = /** @class */ (function (_super) { + __extends(Controller_focusBlur, _super); + function Controller_focusBlur() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.handleTextareaFocusEditable = function () { + var cursor = _this_1.cursor; + _this_1.updateMathspeak(); + _this_1.blurred = false; + clearTimeout(_this_1.blurTimeout); + domFrag(_this_1.container).addClass('dcg-mq-focused'); + if (!cursor.parent) cursor.insAtRightEnd(_this_1.root); + if (cursor.selection) { + cursor.selection.domFrag().removeClass('dcg-mq-blur'); + _this_1.selectionChanged(); //re-select textarea contents after tabbing away and back + } else { + cursor.show(); + } + _this_1.setOverflowClasses(); + }; + _this_1.handleTextareaBlurEditable = function () { + if (_this_1.textareaSelectionTimeout) { + clearTimeout(_this_1.textareaSelectionTimeout); + _this_1.textareaSelectionTimeout = 0; + } + _this_1.disableGroupingForSeconds(0); + _this_1.blurred = true; + _this_1.blurTimeout = setTimeout(function () { + // wait for blur on window; if + _this_1.root.postOrder(function (node) { + node.intentionalBlur(); + }); // none, intentional blur: #264 + _this_1.cursor.clearSelection().endSelection(); + _this_1.blur(); + _this_1.updateMathspeak(); + _this_1.scrollHoriz(); + }); + window.addEventListener('blur', _this_1.handleWindowBlur); + }; + _this_1.handleTextareaFocusStatic = function () { + _this_1.blurred = false; + }; + _this_1.handleTextareaBlurStatic = function () { + if (_this_1.cursor.selection) { + _this_1.cursor.selection.clear(); + } + //detaching during blur explodes in WebKit + setTimeout(function () { + domFrag(_this_1.getTextareaSpanOrThrow()).detach(); + _this_1.blurred = true; + }); + }; + _this_1.handleWindowBlur = function () { + // blur event also fired on window, just switching + clearTimeout(_this_1.blurTimeout); // tabs/windows, not intentional blur + if (_this_1.cursor.selection) _this_1.cursor.selection.domFrag().addClass('dcg-mq-blur'); + _this_1.blur(); + _this_1.updateMathspeak(); + }; + return _this_1; + } + Controller_focusBlur.prototype.disableGroupingForSeconds = function (seconds) { + var _this_1 = this; + clearTimeout(this.__disableGroupingTimeout); + if (seconds === 0) { + this.root.domFrag().removeClass('dcg-mq-suppress-grouping'); + } else { + this.root.domFrag().addClass('dcg-mq-suppress-grouping'); + this.__disableGroupingTimeout = setTimeout(function () { + _this_1.root.domFrag().removeClass('dcg-mq-suppress-grouping'); + }, seconds * 1000); + } + }; + Controller_focusBlur.prototype.blur = function () { + // not directly in the textarea blur handler so as to be + this.cursor.hide().parent.blur(this.cursor); // synchronous with/in the same frame as + domFrag(this.container).removeClass('dcg-mq-focused'); // clearing/blurring selection + window.removeEventListener('blur', this.handleWindowBlur); + if (this.options && this.options.resetCursorOnBlur) { + this.cursor.resetToEnd(this); + } + }; + Controller_focusBlur.prototype.addEditableFocusBlurListeners = function () { + var ctrlr = this, + cursor = ctrlr.cursor; + this.addTextareaEventListeners({ + focus: this.handleTextareaFocusEditable, + blur: this.handleTextareaBlurEditable, + }); + ctrlr.blurred = true; + cursor.hide().parent.blur(cursor); + }; + Controller_focusBlur.prototype.addStaticFocusBlurListeners = function () { + this.addTextareaEventListeners({ + focus: this.handleTextareaFocusStatic, + blur: this.handleTextareaBlurStatic, + }); + }; + return Controller_focusBlur; + })(Controller_exportText); + /** + * TODO: I wanted to move MathBlock::focus and blur here, it would clean + * up lots of stuff like, TextBlock::focus is set to MathBlock::focus + * and TextBlock::blur calls MathBlock::blur, when instead they could + * use inheritance and super_. + * + * Problem is, there's lots of calls to .focus()/.blur() on nodes + * outside Controller::focusBlurEvents(), such as .postOrder('blur') on + * insertion, which if MathBlock::blur becomes MQNode::blur, would add the + * 'blur' CSS class to all MQSymbol's (because .isEmpty() is true for all + * of them). + * + * I'm not even sure there aren't other troublesome calls to .focus() or + * .blur(), so this is TODO for now. + */ + /***************************************** + * Deals with the browser DOM events from + * interaction with the typist. + ****************************************/ + /** + * Only one incremental selection may be open at a time. Track whether + * an incremental selection is open to help enforce this invariant. + */ + var INCREMENTAL_SELECTION_OPEN = false; + var MQNode = /** @class */ (function (_super) { + __extends(MQNode, _super); + function MQNode() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + MQNode.prototype.keystroke = function (key, e, ctrlr) { + var cursor = ctrlr.cursor; + switch (key) { + case 'Ctrl-Shift-Backspace': + case 'Ctrl-Backspace': + ctrlr.ctrlDeleteDir(L); + break; + case 'Shift-Backspace': + case 'Backspace': + ctrlr.backspace(); + break; + // Tab or Esc -> go one block right if it exists, else escape right. + case 'Esc': + case 'Tab': + ctrlr.escapeDir(R, key, e); + return; + // Shift-Tab -> go one block left if it exists, else escape left. + case 'Shift-Tab': + case 'Shift-Esc': + ctrlr.escapeDir(L, key, e); + return; + // End -> move to the end of the current block. + case 'End': + ctrlr.notify('move').cursor.insAtRightEnd(cursor.parent); + ctrlr.aria.queue('end of').queue(cursor.parent, true); + break; + // Ctrl-End -> move all the way to the end of the root block. + case 'Ctrl-End': + ctrlr.notify('move').cursor.insAtRightEnd(ctrlr.root); + ctrlr.aria.queue('end of').queue(ctrlr.ariaLabel).queue(ctrlr.root).queue(ctrlr.ariaPostLabel); + break; + // Shift-End -> select to the end of the current block. + case 'Shift-End': + ctrlr.selectToBlockEndInDir(R); + break; + // Ctrl-Shift-End -> select all the way to the end of the root block. + case 'Ctrl-Shift-End': + ctrlr.selectToRootEndInDir(R); + break; + // Home -> move to the start of the current block. + case 'Home': + ctrlr.notify('move').cursor.insAtLeftEnd(cursor.parent); + ctrlr.aria.queue('beginning of').queue(cursor.parent, true); + break; + // Ctrl-Home -> move all the way to the start of the root block. + case 'Ctrl-Home': + ctrlr.notify('move').cursor.insAtLeftEnd(ctrlr.root); + ctrlr.aria + .queue('beginning of') + .queue(ctrlr.ariaLabel) + .queue(ctrlr.root) + .queue(ctrlr.ariaPostLabel); + break; + // Shift-Home -> select to the start of the current block. + case 'Shift-Home': + ctrlr.selectToBlockEndInDir(L); + break; + // Ctrl-Shift-Home -> select all the way to the start of the root block. + case 'Ctrl-Shift-Home': + ctrlr.selectToRootEndInDir(L); + break; + case 'Left': + ctrlr.moveLeft(); + break; + case 'Shift-Left': + ctrlr.selectLeft(); + break; + case 'Ctrl-Left': + break; + case 'Right': + ctrlr.moveRight(); + break; + case 'Shift-Right': + ctrlr.selectRight(); + break; + case 'Ctrl-Right': + break; + case 'Up': + ctrlr.moveUp(); + break; + case 'Down': + ctrlr.moveDown(); + break; + case 'Shift-Up': + ctrlr.withIncrementalSelection(function (selectDir) { + if (cursor[L]) { + while (cursor[L]) selectDir(L); + } else { + selectDir(L); + } + }); + break; + case 'Shift-Down': + ctrlr.withIncrementalSelection(function (selectDir) { + if (cursor[R]) { + while (cursor[R]) selectDir(R); + } else { + selectDir(R); + } + }); + break; + case 'Ctrl-Up': + break; + case 'Ctrl-Down': + break; + case 'Ctrl-Shift-Del': + case 'Ctrl-Del': + ctrlr.ctrlDeleteDir(R); + break; + case 'Shift-Del': + case 'Del': + ctrlr.deleteForward(); + break; + case 'Meta-A': + case 'Ctrl-A': + ctrlr.selectAll(); + break; + // These remaining hotkeys are only of benefit to people running screen readers. + case 'Ctrl-Alt-Up': // speak parent block that has focus + if (cursor.parent.parent && cursor.parent.parent instanceof MQNode) + ctrlr.aria.queue(cursor.parent.parent); + else ctrlr.aria.queue('nothing above'); + break; + case 'Ctrl-Alt-Down': // speak current block that has focus + if (cursor.parent && cursor.parent instanceof MQNode) ctrlr.aria.queue(cursor.parent); + else ctrlr.aria.queue('block is empty'); + break; + case 'Ctrl-Alt-Left': // speak left-adjacent block + if (cursor.parent.parent && cursor.parent.parent.getEnd(L)) { + ctrlr.aria.queue(cursor.parent.parent.getEnd(L)); + } else { + ctrlr.aria.queue('nothing to the left'); + } + break; + case 'Ctrl-Alt-Right': // speak right-adjacent block + if (cursor.parent.parent && cursor.parent.parent.getEnd(R)) { + ctrlr.aria.queue(cursor.parent.parent.getEnd(R)); + } else { + ctrlr.aria.queue('nothing to the right'); + } + break; + case 'Ctrl-Alt-Shift-Down': // speak selection + if (cursor.selection) + ctrlr.aria.queue(cursor.selection.join('mathspeak', ' ').trim() + ' selected'); + else ctrlr.aria.queue('nothing selected'); + break; + case 'Ctrl-Alt-=': + case 'Ctrl-Alt-Shift-Right': // speak ARIA post label (evaluation or error) + if (ctrlr.ariaPostLabel.length) ctrlr.aria.queue(ctrlr.ariaPostLabel); + else ctrlr.aria.queue('no answer'); + break; + default: + return; + } + ctrlr.aria.alert(); + e === null || e === void 0 ? void 0 : e.preventDefault(); + ctrlr.scrollHoriz(); + }; + MQNode.prototype.moveOutOf = function (_dir, _cursor, _updown) { + pray('overridden or never called on this node', false); + }; // called by Controller::escapeDir, moveDir + MQNode.prototype.moveTowards = function (_dir, _cursor, _updown) { + pray('overridden or never called on this node', false); + }; // called by Controller::moveDir + MQNode.prototype.deleteOutOf = function (_dir, _cursor) { + pray('overridden or never called on this node', false); + }; // called by Controller::deleteDir + MQNode.prototype.deleteTowards = function (_dir, _cursor) { + pray('overridden or never called on this node', false); + }; // called by Controller::deleteDir + MQNode.prototype.unselectInto = function (_dir, _cursor) { + pray('overridden or never called on this node', false); + }; // called by Controller::selectDir + MQNode.prototype.selectOutOf = function (_dir, _cursor) { + pray('overridden or never called on this node', false); + }; // called by Controller::selectDir + MQNode.prototype.selectTowards = function (_dir, _cursor) { + pray('overridden or never called on this node', false); + }; // called by Controller::selectDir + return MQNode; + })(NodeBase); + ControllerBase.onNotify(function (cursor, e) { + if (e === 'move' || e === 'upDown') cursor.show().clearSelection(); + }); + baseOptionProcessors.leftRightIntoCmdGoes = function (updown) { + if (updown && updown !== 'up' && updown !== 'down') { + throw '"up" or "down" required for leftRightIntoCmdGoes option, ' + 'got "' + updown + '"'; + } + return updown; + }; + ControllerBase.onNotify(function (cursor, e) { + if (e !== 'upDown') cursor.upDownCache = {}; + }); + ControllerBase.onNotify(function (cursor, e) { + if (e === 'edit') cursor.show().deleteSelection(); + }); + ControllerBase.onNotify(function (cursor, e) { + if (e !== 'select') cursor.endSelection(); + }); + var Controller_keystroke = /** @class */ (function (_super) { + __extends(Controller_keystroke, _super); + function Controller_keystroke() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + Controller_keystroke.prototype.keystroke = function (key, evt) { + this.cursor.parent.keystroke(key, evt, this.getControllerSelf()); + }; + Controller_keystroke.prototype.escapeDir = function (dir, _key, e) { + prayDirection(dir); + var cursor = this.cursor; + // only prevent default of Tab if not in the root editable + if (cursor.parent !== this.root) e === null || e === void 0 ? void 0 : e.preventDefault(); + // want to be a noop if in the root editable (in fact, Tab has an unrelated + // default browser action if so) + if (cursor.parent === this.root) return; + cursor.clearSelection(); + cursor.parent.moveOutOf(dir, cursor); + cursor.controller.aria.alert(); + return this.notify('move'); + }; + Controller_keystroke.prototype.moveDir = function (dir) { + prayDirection(dir); + var cursor = this.cursor, + updown = cursor.options.leftRightIntoCmdGoes; + var cursorDir = cursor[dir]; + if (cursor.selection) { + cursor.insDirOf(dir, cursor.selection.getEnd(dir)); + } else if (cursorDir) cursorDir.moveTowards(dir, cursor, updown); + else cursor.parent.moveOutOf(dir, cursor, updown); + return this.notify('move'); + }; + Controller_keystroke.prototype.moveLeft = function () { + return this.moveDir(L); + }; + Controller_keystroke.prototype.moveRight = function () { + return this.moveDir(R); + }; + /** + * moveUp and moveDown have almost identical algorithms: + * - first check left and right, if so insAtLeft/RightEnd of them + * - else check the parent's 'upOutOf'/'downOutOf' property: + * + if it's a function, call it with the cursor as the sole argument and + * use the return value as if it were the value of the property + * + if it's a Node, jump up or down into it: + * - if there is a cached Point in the block, insert there + * - else, seekHoriz within the block to the current x-coordinate (to be + * as close to directly above/below the current position as possible) + * + unless it's exactly `true`, stop bubbling + */ + Controller_keystroke.prototype.moveUp = function () { + return this.moveUpDown('up'); + }; + Controller_keystroke.prototype.moveDown = function () { + return this.moveUpDown('down'); + }; + Controller_keystroke.prototype.moveUpDown = function (dir) { + var self = this; + var cursor = self.notify('upDown').cursor; + var dirInto; + var dirOutOf; + if (dir === 'up') { + dirInto = 'upInto'; + dirOutOf = 'upOutOf'; + } else { + dirInto = 'downInto'; + dirOutOf = 'downOutOf'; + } + var cursorL = cursor[L]; + var cursorR = cursor[R]; + var cursorR_dirInto = cursorR && cursorR[dirInto]; + var cursorL_dirInto = cursorL && cursorL[dirInto]; + if (cursorR_dirInto) cursor.insAtLeftEnd(cursorR_dirInto); + else if (cursorL_dirInto) cursor.insAtRightEnd(cursorL_dirInto); + else { + cursor.parent.bubble(function (ancestor) { + // TODO - revist this + var prop = ancestor[dirOutOf]; + if (prop) { + if (typeof prop === 'function') prop = prop.call(ancestor, cursor); // TODO - figure out if we need to assign to prop + if (prop instanceof MQNode) cursor.jumpUpDown(ancestor, prop); + if (prop !== true) return false; // TODO - figure out how this can return true + } + return undefined; + }); + } + return self; + }; + Controller_keystroke.prototype.deleteDir = function (dir) { + prayDirection(dir); + var cursor = this.cursor; + var cursorEl = cursor[dir]; + var cursorElParent = cursor.parent.parent; + var ctrlr = cursor.controller; + if (cursorEl && cursorEl instanceof MQNode) { + if (cursorEl.sides) { + ctrlr.aria.queue( + cursorEl.parent.chToCmd(cursorEl.sides[-dir].ch).mathspeak({ createdLeftOf: cursor }) + ); + // generally, speak the current element if it has no blocks, + // but don't for text block commands as the deleteTowards method + // in the TextCommand class is responsible for speaking the new character under the cursor. + } else if (!cursorEl.blocks && cursorEl.parent.ctrlSeq !== '\\text') { + ctrlr.aria.queue(cursorEl); + } + } else if (cursorElParent && cursorElParent instanceof MQNode) { + if (cursorElParent.sides) { + ctrlr.aria.queue( + cursorElParent.parent + .chToCmd(cursorElParent.sides[dir].ch) + .mathspeak({ createdLeftOf: cursor }) + ); + } else if (cursorElParent.blocks && cursorElParent.mathspeakTemplate) { + if (cursorElParent.upInto && cursorElParent.downInto) { + // likely a fraction, and we just backspaced over the slash + ctrlr.aria.queue(cursorElParent.mathspeakTemplate[1]); + } else { + var mst = cursorElParent.mathspeakTemplate; + var textToQueue = dir === L ? mst[0] : mst[mst.length - 1]; + ctrlr.aria.queue(textToQueue); + } + } else { + ctrlr.aria.queue(cursorElParent); + } + } + var hadSelection = cursor.selection; + this.notify('edit'); // deletes selection if present + if (!hadSelection) { + var cursorDir = cursor[dir]; + if (cursorDir) cursorDir.deleteTowards(dir, cursor); + else cursor.parent.deleteOutOf(dir, cursor); + } + var cursorL = cursor[L]; + var cursorR = cursor[R]; + if (cursorL.siblingDeleted) cursorL.siblingDeleted(cursor.options, R); + if (cursorR.siblingDeleted) cursorR.siblingDeleted(cursor.options, L); + cursor.parent.bubble(function (node) { + node.reflow(); + return undefined; + }); + return this; + }; + Controller_keystroke.prototype.ctrlDeleteDir = function (dir) { + prayDirection(dir); + var cursor = this.cursor; + if (!cursor[dir] || cursor.selection) return this.deleteDir(dir); + this.notify('edit'); + var fragRemoved; + if (dir === L) { + fragRemoved = new Fragment(cursor.parent.getEnd(L), cursor[L]); + } else { + fragRemoved = new Fragment(cursor[R], cursor.parent.getEnd(R)); + } + cursor.controller.aria.queue(fragRemoved); + fragRemoved.remove(); + cursor.insAtDirEnd(dir, cursor.parent); + var cursorL = cursor[L]; + var cursorR = cursor[R]; + if (cursorL) cursorL.siblingDeleted(cursor.options, R); + if (cursorR) cursorR.siblingDeleted(cursor.options, L); + cursor.parent.bubble(function (node) { + node.reflow(); + return undefined; + }); + return this; + }; + Controller_keystroke.prototype.backspace = function () { + return this.deleteDir(L); + }; + Controller_keystroke.prototype.deleteForward = function () { + return this.deleteDir(R); + }; + /** + * startIncrementalSelection, selectDirIncremental, and finishIncrementalSelection + * should only be called by withIncrementalSelection because they must + * be called in sequence. + */ + Controller_keystroke.prototype.startIncrementalSelection = function () { + pray("Multiple selections can't be simultaneously open", !INCREMENTAL_SELECTION_OPEN); + INCREMENTAL_SELECTION_OPEN = true; + this.notify('select'); + var cursor = this.cursor; + if (!cursor.anticursor) cursor.startSelection(); + }; + /** + * Update the selection model, stored in cursor, without modifying + * selection DOM. + * + * startIncrementalSelection, selectDirIncremental, and finishIncrementalSelection + * should only be called by withIncrementalSelection because they must + * be called in sequence. + */ + Controller_keystroke.prototype.selectDirIncremental = function (dir) { + pray('A selection is open', INCREMENTAL_SELECTION_OPEN); + INCREMENTAL_SELECTION_OPEN = true; + var cursor = this.cursor, + seln = cursor.selection; + prayDirection(dir); + var node = cursor[dir]; + if (node) { + // "if node we're selecting towards is inside selection (hence retracting) + // and is on the *far side* of the selection (hence is only node selected) + // and the anticursor is *inside* that node, not just on the other side" + if (seln && seln.getEnd(dir) === node && cursor.anticursor[-dir] !== node) { + node.unselectInto(dir, cursor); + } else node.selectTowards(dir, cursor); + } else cursor.parent.selectOutOf(dir, cursor); + }; + /** + * Update selection DOM to match cursor model + * + * startIncrementalSelection, selectDirIncremental, and finishIncrementalSelection + * should only be called by withIncrementalSelection because they must + * be called in sequence. + */ + Controller_keystroke.prototype.finishIncrementalSelection = function () { + pray('A selection is open', INCREMENTAL_SELECTION_OPEN); + var cursor = this.cursor; + cursor.clearSelection(); + cursor.select() || cursor.show(); + var selection = cursor.selection; + if (selection) { + cursor.controller.aria.clear().queue(selection.join('mathspeak', ' ').trim() + ' selected'); // clearing first because selection fires several times, and we don't want repeated speech. + } + INCREMENTAL_SELECTION_OPEN = false; + }; + /** + * Used to build a selection incrementally in a loop. Calls the passed + * callback with a selectDir function that may be called many times, + * and defers updating the view until the incremental selection is + * complete + * + * Wraps up calling + * + * this.startSelection() + * this.selectDirIncremental(dir) // possibly many times + * this.finishSelection() + * + * with extra error handling and invariant enforcement + */ + Controller_keystroke.prototype.withIncrementalSelection = function (cb) { + var _this_1 = this; + try { + this.startIncrementalSelection(); + try { + cb(function (dir) { + return _this_1.selectDirIncremental(dir); + }); + } finally { + // Since we have started a selection, attempt to finish it even + // if the callback throws an error + this.finishIncrementalSelection(); + } + } finally { + // Mark selection as closed even if finishSelection throws an + // error. Makes a possible error in finishSelection more + // recoverable + INCREMENTAL_SELECTION_OPEN = false; + } + }; + /** + * Grow selection one unit in the given direction + * + * Note, this should not be called in a loop. To incrementally grow a + * selection, use withIncrementalSelection + */ + Controller_keystroke.prototype.selectDir = function (dir) { + this.withIncrementalSelection(function (selectDir) { + return selectDir(dir); + }); + }; + Controller_keystroke.prototype.selectLeft = function () { + return this.selectDir(L); + }; + Controller_keystroke.prototype.selectRight = function () { + return this.selectDir(R); + }; + Controller_keystroke.prototype.selectAll = function () { + this.notify('move'); + var cursor = this.cursor; + cursor.insAtRightEnd(this.root); + this.withIncrementalSelection(function (selectDir) { + while (cursor[L]) selectDir(L); + }); + }; + Controller_keystroke.prototype.selectToBlockEndInDir = function (dir) { + var cursor = this.cursor; + this.withIncrementalSelection(function (selectDir) { + while (cursor[dir]) selectDir(dir); + }); + }; + Controller_keystroke.prototype.selectToRootEndInDir = function (dir) { + var _this_1 = this; + var cursor = this.cursor; + this.withIncrementalSelection(function (selectDir) { + while (cursor[dir] || cursor.parent !== _this_1.root) { + selectDir(dir); + } + }); + }; + return Controller_keystroke; + })(Controller_focusBlur); + var TempSingleCharNode = /** @class */ (function (_super) { + __extends(TempSingleCharNode, _super); + function TempSingleCharNode(_char) { + return _super.call(this) || this; + } + return TempSingleCharNode; + })(MQNode); + // Parser MathBlock + var latexMathParser = (function () { + function commandToBlock(cmd) { + // can also take in a Fragment + var block = new MathBlock(); + cmd.adopt(block, 0, 0); + return block; + } + function joinBlocks(blocks) { + var firstBlock = blocks[0] || new MathBlock(); + for (var i = 1; i < blocks.length; i += 1) { + blocks[i].children().adopt(firstBlock, firstBlock.getEnd(R), 0); + } + return firstBlock; + } + var string = Parser.string; + var regex = Parser.regex; + var letter = Parser.letter; + var digit = Parser.digit; + var any = Parser.any; + var optWhitespace = Parser.optWhitespace; + var succeed = Parser.succeed; + var fail = Parser.fail; + // Parsers yielding either MathCommands, or Fragments of MathCommands + // (either way, something that can be adopted by a MathBlock) + var variable = letter.map(function (c) { + return new Letter(c); + }); + var number = digit.map(function (c) { + return new Digit(c); + }); + var symbol = regex(/^[^${}\\_^]/).map(function (c) { + return new VanillaSymbol(c); + }); + var controlSequence = regex(/^[^\\a-eg-zA-Z]/) // hotfix #164; match MathBlock::write + .or( + string('\\').then( + regex(/^[a-z]+/i) + .or(regex(/^\s+/).result(' ')) + .or(any) + ) + ) + .then(function (ctrlSeq) { + // TODO - is Parser correct? + var cmdKlass = LatexCmds[ctrlSeq]; + if (cmdKlass) { + if (cmdKlass.constructor) { + var actualClass = cmdKlass; // TODO - figure out how to know the difference + return new actualClass(ctrlSeq).parser(); + } else { + var builder = cmdKlass; // TODO - figure out how to know the difference + return builder(ctrlSeq).parser(); + } + } else { + return fail('unknown command: \\' + ctrlSeq); + } + }); + var command = controlSequence.or(variable).or(number).or(symbol); + // Parsers yielding MathBlocks + var mathGroup = string('{') + .then(function () { + return mathSequence; + }) + .skip(string('}')); + var mathBlock = optWhitespace.then(mathGroup.or(command.map(commandToBlock))); + var mathSequence = mathBlock.many().map(joinBlocks).skip(optWhitespace); + var optMathBlock = string('[') + .then( + mathBlock + .then(function (block) { + return block.join('latex') !== ']' ? succeed(block) : fail(''); + }) + .many() + .map(joinBlocks) + .skip(optWhitespace) + ) + .skip(string(']')); + var latexMath = mathSequence; + latexMath.block = mathBlock; + latexMath.optBlock = optMathBlock; + return latexMath; + })(); + baseOptionProcessors.maxDepth = function (depth) { + return typeof depth === 'number' ? depth : undefined; + }; + var Controller_latex = /** @class */ (function (_super) { + __extends(Controller_latex, _super); + function Controller_latex() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + Controller_latex.prototype.cleanLatex = function (latex) { + //prune unnecessary spaces + return latex.replace(/(\\[a-z]+) (?![a-z])/gi, '$1'); + }; + Controller_latex.prototype.exportLatex = function () { + return this.cleanLatex(this.root.latex()); + }; + Controller_latex.prototype.writeLatex = function (latex) { + var cursor = this.notify('edit').cursor; + cursor.parent.writeLatex(cursor, latex); + return this; + }; + Controller_latex.prototype.exportLatexSelection = function () { + var ctx = { + latex: '', + startIndex: -1, + endIndex: -1, + }; + var selection = this.cursor.selection; + if (selection) { + ctx.startSelectionBefore = selection.getEnd(L); + ctx.endSelectionAfter = selection.getEnd(R); + } else { + var cursorL = this.cursor[L]; + if (cursorL) { + ctx.startSelectionAfter = cursorL; + } else { + ctx.startSelectionBefore = this.cursor.parent; + } + var cursorR = this.cursor[R]; + if (cursorR) { + ctx.endSelectionBefore = cursorR; + } else { + ctx.endSelectionAfter = this.cursor.parent; + } + } + this.root.latexRecursive(ctx); + // need to clean the latex + var originalLatex = ctx.latex; + var cleanLatex = this.cleanLatex(originalLatex); + var startIndex = ctx.startIndex; + var endIndex = ctx.endIndex; + // assumes that the cleaning process will only remove characters. We + // run through the originalLatex and cleanLatex to find differences. + // when we find differences we see how many characters are dropped until + // we sync back up. While detecting missing characters we decrement the + // startIndex and endIndex if appropriate. + var j = 0; + for (var i = 0; i < ctx.endIndex; i++) { + if (originalLatex[i] !== cleanLatex[j]) { + if (i < ctx.startIndex) { + startIndex -= 1; + } + endIndex -= 1; + // do not increment j. We wan to keep looking at this same + // cleanLatex character until we find it in the originalLatex + } else { + j += 1; //move to next cleanLatex character + } + } + return { + latex: cleanLatex, + startIndex: startIndex, + endIndex: endIndex, + }; + }; + Controller_latex.prototype.classifyLatexForEfficientUpdate = function (latex) { + if (typeof latex !== 'string') return; + var matches = latex.match(/-?[0-9.]+$/g); + if (matches && matches.length === 1) { + return { + latex: latex, + prefix: latex.substr(0, latex.length - matches[0].length), + digits: matches[0], + }; + } + return; + }; + Controller_latex.prototype.updateLatexMathEfficiently = function (latex, oldLatex) { + var _c, _d, _e, _f; + // Note, benchmark/update.html is useful for measuring the + // performance of renderLatexMathEfficiently + var root = this.root; + var oldClassification; + var classification = this.classifyLatexForEfficientUpdate(latex); + if (classification) { + oldClassification = this.classifyLatexForEfficientUpdate(oldLatex); + if (!oldClassification || oldClassification.prefix !== classification.prefix) { + return false; + } + } else { + return false; + } + // check if minus sign is changing + var oldDigits = oldClassification.digits; + var newDigits = classification.digits; + var oldMinusSign = false; + var newMinusSign = false; + if (oldDigits[0] === '-') { + oldMinusSign = true; + oldDigits = oldDigits.substr(1); + } + if (newDigits[0] === '-') { + newMinusSign = true; + newDigits = newDigits.substr(1); + } + // start at the very end + var charNode = this.root.getEnd(R); + var oldCharNodes = []; + for (var i = oldDigits.length - 1; i >= 0; i--) { + // the tree does not match what we expect + if (!charNode || charNode.ctrlSeq !== oldDigits[i]) { + return false; + } + // the trailing digits are not just under the root. We require the root + // to be the parent so that we can be sure we do not need a reflow to + // grow parens. + if (charNode.parent !== root) { + return false; + } + // push to the start. We're traversing backwards + oldCharNodes.unshift(charNode); + // move left one character + charNode = charNode[L]; + } + // remove the minus sign + if (oldMinusSign && !newMinusSign) { + var oldMinusNode = charNode; + if (!oldMinusNode) return false; + if (oldMinusNode.ctrlSeq !== '-') return false; + if (oldMinusNode[R] !== oldCharNodes[0]) return false; + if (oldMinusNode.parent !== root) return false; + var oldMinusNodeL = oldMinusNode[L]; + if (oldMinusNodeL && oldMinusNodeL.parent !== root) return false; + oldCharNodes[0][L] = oldMinusNode[L]; + if (root.getEnd(L) === oldMinusNode) { + root.setEnds(((_c = {}), (_c[L] = oldCharNodes[0]), (_c[R] = root.getEnd(R)), _c)); + } + if (oldMinusNodeL) oldMinusNodeL[R] = oldCharNodes[0]; + oldMinusNode.domFrag().remove(); + } + // add a minus sign + if (!oldMinusSign && newMinusSign) { + var newMinusNode = new PlusMinus('-'); + var minusSpan = document.createElement('span'); + minusSpan.textContent = '-'; + newMinusNode.setDOM(minusSpan); + var oldCharNodes0L = oldCharNodes[0][L]; + if (oldCharNodes0L) oldCharNodes0L[R] = newMinusNode; + if (root.getEnd(L) === oldCharNodes[0]) { + root.setEnds(((_d = {}), (_d[L] = newMinusNode), (_d[R] = root.getEnd(R)), _d)); + } + newMinusNode.parent = root; + newMinusNode[L] = oldCharNodes[0][L]; + newMinusNode[R] = oldCharNodes[0]; + oldCharNodes[0][L] = newMinusNode; + newMinusNode.contactWeld(this.cursor); // decide if binary operator + newMinusNode.domFrag().insertBefore(oldCharNodes[0].domFrag()); + } + // update the text of the current nodes + var commonLength = Math.min(oldDigits.length, newDigits.length); + for (i = 0; i < commonLength; i++) { + var newText = newDigits[i]; + charNode = oldCharNodes[i]; + if (charNode.ctrlSeq !== newText) { + charNode.ctrlSeq = newText; + charNode.domFrag().oneElement().textContent = newText; + charNode.mathspeakName = newText; + } + } + // remove the extra digits at the end + if (oldDigits.length > newDigits.length) { + charNode = oldCharNodes[newDigits.length - 1]; + root.setEnds(((_e = {}), (_e[L] = root.getEnd(L)), (_e[R] = charNode), _e)); + charNode[R] = 0; + for (i = oldDigits.length - 1; i >= commonLength; i--) { + oldCharNodes[i].domFrag().remove(); + } + } + // add new digits after the existing ones + if (newDigits.length > oldDigits.length) { + var frag = document.createDocumentFragment(); + for (i = commonLength; i < newDigits.length; i++) { + var span = document.createElement('span'); + span.className = 'dcg-mq-digit'; + span.textContent = newDigits[i]; + var newNode = new Digit(newDigits[i]); + newNode.parent = root; + newNode.setDOM(span); + frag.appendChild(span); + // splice this node in + newNode[L] = root.getEnd(R); + newNode[R] = 0; + var newNodeL = newNode[L]; + newNodeL[R] = newNode; + root.setEnds(((_f = {}), (_f[L] = root.getEnd(L)), (_f[R] = newNode), _f)); + } + root.domFrag().oneElement().appendChild(frag); + } + var currentLatex = this.exportLatex(); + if (currentLatex !== latex) { + console.warn( + 'tried updating latex efficiently but did not work. Attempted: ' + + latex + + ' but wrote: ' + + currentLatex + ); + return false; + } + var rightMost = root.getEnd(R); + if (rightMost) { + rightMost.fixDigitGrouping(this.cursor.options); + } + return true; + }; + Controller_latex.prototype.renderLatexMathFromScratch = function (latex) { + var _c; + var root = this.root, + cursor = this.cursor; + var all = Parser.all; + var eof = Parser.eof; + var block = latexMathParser.skip(eof).or(all.result(false)).parse(latex); + root.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); + if (block) { + block.children().adopt(root, 0, 0); + } + if (block) { + var frag = root.domFrag(); + frag.children().remove(); + frag.oneElement().appendChild(block.html()); + root.finalizeInsert(cursor.options, cursor); + } else { + root.domFrag().empty(); + } + }; + Controller_latex.prototype.renderLatexMath = function (latex) { + var cursor = this.cursor; + var root = this.root; + this.notify('replace'); + cursor.clearSelection(); + var oldLatex = this.exportLatex(); + if (!root.getEnd(L) || !root.getEnd(R) || oldLatex !== latex) { + this.updateLatexMathEfficiently(latex, oldLatex) || this.renderLatexMathFromScratch(latex); + this.updateMathspeak(); + } + cursor.insAtRightEnd(root); + }; + Controller_latex.prototype.renderLatexText = function (latex) { + var _c; + var root = this.root, + cursor = this.cursor; + root.domFrag().children().slice(1).remove(); + root.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); + delete cursor.selection; + cursor.show().insAtRightEnd(root); + var regex = Parser.regex; + var string = Parser.string; + var eof = Parser.eof; + var all = Parser.all; + // Parser RootMathCommand + var mathMode = string('$') + .then(latexMathParser) + // because TeX is insane, math mode doesn't necessarily + // have to end. So we allow for the case that math mode + // continues to the end of the stream. + .skip(string('$').or(eof)) + .map(function (block) { + // HACK FIXME: this shouldn't have to have access to cursor + var rootMathCommand = new RootMathCommand(cursor); + rootMathCommand.createBlocks(); + var rootMathBlock = rootMathCommand.getEnd(L); + block.children().adopt(rootMathBlock, 0, 0); + return rootMathCommand; + }); + var escapedDollar = string('\\$').result('$'); + var textChar = escapedDollar.or(regex(/^[^$]/)).map(function (ch) { + return new VanillaSymbol(ch); + }); + var latexText = mathMode.or(textChar).many(); + var commands = latexText.skip(eof).or(all.result(false)).parse(latex); + if (commands) { + for (var i = 0; i < commands.length; i += 1) { + commands[i].adopt(root, root.getEnd(R), 0); + } + domFrag(root.html()).appendTo(root.domFrag().oneElement()); + root.finalizeInsert(cursor.options, cursor); + } + }; + return Controller_latex; + })(Controller_keystroke); + /******************************************************** + * Deals with mouse events for clicking, drag-to-select + *******************************************************/ + var ignoreNextMouseDownNoop = function (_el) { + return false; + }; + Options.prototype.ignoreNextMousedown = ignoreNextMouseDownNoop; + // Whenever edits to the tree occur, in-progress selection events + // must be invalidated and selection changes must not be applied to + // the edited tree. cancelSelectionOnEdit takes care of this. + var cancelSelectionOnEdit; + (function () { + ControllerBase.onNotify(function (cursor, e) { + if (e === 'edit' || e === 'replace') { + // this will be called any time ANY mathquill is edited. We only want + // to cancel selection if the selection is happening within the mathquill + // that dispatched the notify. Otherwise you won't be able to select any + // mathquills while a slider is playing. + if (cancelSelectionOnEdit && cancelSelectionOnEdit.cursor === cursor) { + cancelSelectionOnEdit.cb(); + } + } + }); + })(); + var Controller_mouse = /** @class */ (function (_super) { + __extends(Controller_mouse, _super); + function Controller_mouse() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.handleMouseDown = function (e) { + var rootElement = closest(e.target, '.dcg-mq-root-block'); + var root = + (rootElement && NodeBase.getNodeOfElement(rootElement)) || + NodeBase.getNodeOfElement(_this_1.root.domFrag().oneElement()); + var ownerDocument = root.domFrag().firstNode().ownerDocument; + var ctrlr = root.controller, + cursor = ctrlr.cursor, + blink = cursor.blink; + var textareaSpan = ctrlr.getTextareaSpanOrThrow(); + var textarea = ctrlr.getTextareaOrThrow(); + e.preventDefault(); // doesn't work in IE\u22648, but it's a one-line fix: + e.target.unselectable = true; // http://jsbin.com/yagekiji/1 // TODO - no idea what this unselectable property is + if (cursor.options.ignoreNextMousedown(e)) return; + else cursor.options.ignoreNextMousedown = ignoreNextMouseDownNoop; + var lastMousemoveTarget = null; + function mousemove(e) { + lastMousemoveTarget = e.target; + } + function onDocumentMouseMove(e) { + if (!cursor.anticursor) cursor.startSelection(); + ctrlr.seek(lastMousemoveTarget, e.clientX, e.clientY).cursor.select(); + if (cursor.selection) + cursor.controller.aria + .clear() + .queue(cursor.selection.join('mathspeak') + ' selected') + .alert(); + lastMousemoveTarget = null; + } + // outside rootElement, the MathQuill node corresponding to the target (if any) + // won't be inside this root, so don't mislead Controller::seek with it + function unbindListeners() { + // delete the mouse handlers now that we're not dragging anymore + rootElement === null || rootElement === void 0 + ? void 0 + : rootElement.removeEventListener('mousemove', mousemove); + ownerDocument === null || ownerDocument === void 0 + ? void 0 + : ownerDocument.removeEventListener('mousemove', onDocumentMouseMove); + ownerDocument === null || ownerDocument === void 0 + ? void 0 + : ownerDocument.removeEventListener('mouseup', onDocumentMouseUp); + cancelSelectionOnEdit = undefined; + } + function updateCursor() { + if (ctrlr.editable) { + cursor.show(); + cursor.controller.aria.queue(cursor.parent).alert(); + } else { + domFrag(textareaSpan).detach(); + } + } + function onDocumentMouseUp() { + cursor.blink = blink; + if (!cursor.selection) updateCursor(); + unbindListeners(); + } + var wasEdited; + cancelSelectionOnEdit = { + cursor: cursor, + cb: function () { + // If an edit happens while the mouse is down, the existing + // selection is no longer valid. Clear it and unbind listeners, + // similar to what happens on mouseup. + wasEdited = true; + cursor.blink = blink; + cursor.clearSelection(); + updateCursor(); + unbindListeners(); + }, + }; + if (ctrlr.blurred) { + if (rootElement && !ctrlr.editable) { + domFrag(rootElement).prepend(domFrag(textareaSpan)); + } + textarea.focus(); + // focus call may bubble to clients, who may then write to + // mathquill, triggering cancelSelectionOnEdit. If that happens, we + // don't want to stop the cursor blink or bind listeners, + // so return early. + if (wasEdited) return; + } + cursor.blink = noop; + ctrlr.seek(e.target, e.clientX, e.clientY).cursor.startSelection(); + rootElement === null || rootElement === void 0 + ? void 0 + : rootElement.addEventListener('mousemove', mousemove); + ownerDocument === null || ownerDocument === void 0 + ? void 0 + : ownerDocument.addEventListener('mousemove', onDocumentMouseMove); + ownerDocument === null || ownerDocument === void 0 + ? void 0 + : ownerDocument.addEventListener('mouseup', onDocumentMouseUp); + // listen on document not just body to not only hear about mousemove and + // mouseup on page outside field, but even outside page, except iframes: https://github.com/mathquill/mathquill/commit/8c50028afcffcace655d8ae2049f6e02482346c5#commitcomment-6175800 + }; + return _this_1; + } + Controller_mouse.prototype.addMouseEventListener = function () { + //drag-to-select event handling + this.container.addEventListener('mousedown', this.handleMouseDown); + }; + Controller_mouse.prototype.removeMouseEventListener = function () { + this.container.removeEventListener('mousedown', this.handleMouseDown); + }; + Controller_mouse.prototype.seek = function (targetElm, clientX, _clientY) { + var cursor = this.notify('select').cursor; + var node; + // we can click on an element that is deeply nested past the point + // that mathquill knows about. We need to traverse up to the first + // node that mathquill is aware of + while (targetElm) { + // try to find the MQ Node associated with the DOM Element + node = NodeBase.getNodeOfElement(targetElm); + if (node) break; + // must be too deep, traverse up to the parent DOM Element + targetElm = targetElm.parentElement; + } + // Could not find any nodes, just use the root + if (!node) { + node = this.root; + } + // don't clear selection until after getting node from target, in case + // target was selection span, otherwise target will have no parent and will + // seek from root, which is less accurate (e.g. fraction) + cursor.clearSelection().show(); + node.seek(clientX, cursor); + this.scrollHoriz(); // before .selectFrom when mouse-selecting, so + // always hits no-selection case in scrollHoriz and scrolls slower + return this; + }; + return Controller_mouse; + })(Controller_latex); + /*********************************************** + * Horizontal panning for editable fields that + * overflow their width + **********************************************/ + var Controller_scrollHoriz = /** @class */ (function (_super) { + __extends(Controller_scrollHoriz, _super); + function Controller_scrollHoriz() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + Controller_scrollHoriz.prototype.setOverflowClasses = function () { + var root = this.root.domFrag().oneElement(); + var shouldHaveOverflowRight = false; + var shouldHaveOverflowLeft = false; + if (!this.blurred) { + var width = getBoundingClientRect(root).width; + var scrollWidth = root.scrollWidth; + var scroll = root.scrollLeft; + shouldHaveOverflowRight = scrollWidth > width + scroll; + shouldHaveOverflowLeft = scroll > 0; + } + if (root.classList.contains('dcg-mq-editing-overflow-right') !== shouldHaveOverflowRight) + root.classList.toggle('dcg-mq-editing-overflow-right'); + if (root.classList.contains('dcg-mq-editing-overflow-left') !== shouldHaveOverflowLeft) + root.classList.toggle('dcg-mq-editing-overflow-left'); + }; + Controller_scrollHoriz.prototype.scrollHoriz = function () { + var _this_1 = this; + var cursor = this.cursor, + seln = cursor.selection; + var rootRect = getBoundingClientRect(this.root.domFrag().oneElement()); + if (cursor.domFrag().isEmpty() && !seln) { + if (this.cancelScrollHoriz) { + this.cancelScrollHoriz(); + this.cancelScrollHoriz = undefined; + } + var rootElt_1 = this.root.domFrag().oneElement(); + var start_1 = rootElt_1.scrollLeft; + animate(this.getScrollAnimationDuration(), function (progress, scheduleNext, cancel) { + if (progress >= 1) { + _this_1.cancelScrollHoriz = undefined; + rootElt_1.scrollLeft = 0; + _this_1.setOverflowClasses(); + } else { + _this_1.cancelScrollHoriz = cancel; + scheduleNext(); + rootElt_1.scrollLeft = Math.round((1 - progress) * start_1); + } + }); + return; + } else if (!seln) { + var x = getBoundingClientRect(cursor.domFrag().oneElement()).left; + if (x > rootRect.right - 20) var scrollBy = x - (rootRect.right - 20); + else if (x < rootRect.left + 20) var scrollBy = x - (rootRect.left + 20); + else return; + } else { + var rect = getBoundingClientRect(seln.domFrag().oneElement()); + var overLeft = rect.left - (rootRect.left + 20); + var overRight = rect.right - (rootRect.right - 20); + if (seln.getEnd(L) === cursor[R]) { + if (overLeft < 0) var scrollBy = overLeft; + else if (overRight > 0) { + if (rect.left - overRight < rootRect.left + 20) var scrollBy = overLeft; + else var scrollBy = overRight; + } else return; + } else { + if (overRight > 0) var scrollBy = overRight; + else if (overLeft < 0) { + if (rect.right - overLeft > rootRect.right - 20) var scrollBy = overRight; + else var scrollBy = overLeft; + } else return; + } + } + var root = this.root.domFrag().oneElement(); + if (scrollBy < 0 && root.scrollLeft === 0) return; + if (scrollBy > 0 && root.scrollWidth <= root.scrollLeft + rootRect.width) return; + if (this.cancelScrollHoriz) { + this.cancelScrollHoriz(); + this.cancelScrollHoriz = undefined; + } + var rootElt = this.root.domFrag().oneElement(); + var start = rootElt.scrollLeft; + animate(this.getScrollAnimationDuration(), function (progress, scheduleNext, cancel) { + if (progress >= 1) { + _this_1.cancelScrollHoriz = undefined; + rootElt.scrollLeft = Math.round(start + scrollBy); + _this_1.setOverflowClasses(); + } else { + _this_1.cancelScrollHoriz = cancel; + scheduleNext(); + rootElt.scrollLeft = Math.round(start + progress * scrollBy); + } + }); + }; + Controller_scrollHoriz.prototype.getScrollAnimationDuration = function () { + var _c; + return (_c = this.options.scrollAnimationDuration) !== null && _c !== void 0 ? _c : 100; + }; + return Controller_scrollHoriz; + })(Controller_mouse); + /********************************************* + * Manage the MathQuill instance's textarea + * (as owned by the Controller) + ********************************************/ + Options.prototype.substituteTextarea = function () { + return h('textarea', { + autocapitalize: 'off', + autocomplete: 'off', + autocorrect: 'off', + spellcheck: false, + 'x-palm-disable-ste-all': true, + }); + }; + function defaultSubstituteKeyboardEvents(jq, controller) { + return saneKeyboardEvents(jq[0], controller); + } + Options.prototype.substituteKeyboardEvents = defaultSubstituteKeyboardEvents; + var Controller = /** @class */ (function (_super) { + __extends(Controller, _super); + function Controller() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.selectFn = noop; + return _this_1; + } + Controller.prototype.createTextarea = function () { + this.textareaSpan = h('span', { class: 'dcg-mq-textarea' }); + var textarea = this.options.substituteTextarea(); + if (!textarea.nodeType) { + throw 'substituteTextarea() must return a DOM element, got ' + textarea; + } + this.textarea = domFrag(textarea).appendTo(this.textareaSpan).oneElement(); + var ctrlr = this; + ctrlr.cursor.selectionChanged = function () { + ctrlr.selectionChanged(); + }; + }; + Controller.prototype.selectionChanged = function () { + var ctrlr = this; + // throttle calls to setTextareaSelection(), because setting textarea.value + // and/or calling textarea.select() can have anomalously bad performance: + // https://github.com/mathquill/mathquill/issues/43#issuecomment-1399080 + // + // Note, this timeout may be cleared by the blur handler in focusBlur.js + if (!ctrlr.textareaSelectionTimeout) { + ctrlr.textareaSelectionTimeout = setTimeout(function () { + ctrlr.setTextareaSelection(); + }); + } + }; + Controller.prototype.setTextareaSelection = function () { + this.textareaSelectionTimeout = 0; + var latex = ''; + if (this.cursor.selection) { + //cleanLatex prunes unnecessary spaces. defined in latex.js + latex = this.cleanLatex(this.cursor.selection.join('latex')); + if (this.options.statelessClipboard) { + // FIXME: like paste, only this works for math fields; should ask parent + latex = '$' + latex + '$'; + } + } + this.selectFn(latex); + }; + Controller.prototype.staticMathTextareaEvents = function () { + var ctrlr = this; + this.removeTextareaEventListener('cut'); + this.removeTextareaEventListener('paste'); + if (ctrlr.options.disableCopyPaste) { + this.removeTextareaEventListener('copy'); + } else { + this.addTextareaEventListeners({ + copy: function () { + ctrlr.setTextareaSelection(); + }, + }); + } + this.addStaticFocusBlurListeners(); + ctrlr.selectFn = function (text) { + var textarea = ctrlr.getTextareaOrThrow(); + if (!(textarea instanceof HTMLTextAreaElement)) return; + textarea.value = text; + if (text) textarea.select(); + }; + }; + Controller.prototype.editablesTextareaEvents = function () { + var ctrlr = this; + var textarea = ctrlr.getTextareaOrThrow(); + var textareaSpan = ctrlr.getTextareaSpanOrThrow(); + if (this.options.version < 3) { + var $ = this.options.assertJquery(); + var keyboardEventsShim = this.options.substituteKeyboardEvents($(textarea), this); + this.selectFn = function (text) { + keyboardEventsShim.select(text); + }; + } else { + var select = saneKeyboardEvents(textarea, this).select; + this.selectFn = select; + } + domFrag(this.container).prepend(domFrag(textareaSpan)); + this.addEditableFocusBlurListeners(); + this.updateMathspeak(); + }; + Controller.prototype.unbindEditablesEvents = function () { + var ctrlr = this; + var textarea = ctrlr.getTextareaOrThrow(); + var textareaSpan = ctrlr.getTextareaSpanOrThrow(); + this.selectFn = function (text) { + if (!(textarea instanceof HTMLTextAreaElement)) return; + textarea.value = text; + if (text) textarea.select(); + }; + domFrag(textareaSpan).remove(); + this.removeTextareaEventListener('focus'); + this.removeTextareaEventListener('blur'); + ctrlr.blurred = true; + this.removeTextareaEventListener('cut'); + this.removeTextareaEventListener('paste'); + }; + Controller.prototype.typedText = function (ch) { + if (ch === '\n') return this.handle('enter'); + var cursor = this.notify(undefined).cursor; + cursor.parent.write(cursor, ch); + this.scrollHoriz(); + }; + Controller.prototype.cut = function () { + var ctrlr = this, + cursor = ctrlr.cursor; + if (cursor.selection) { + setTimeout(function () { + ctrlr.notify('edit'); // deletes selection if present + cursor.parent.bubble(function (node) { + node.reflow(); + return undefined; + }); + if (ctrlr.options && ctrlr.options.onCut) { + ctrlr.options.onCut(); + } + }); + } + }; + Controller.prototype.copy = function () { + this.setTextareaSelection(); + }; + Controller.prototype.paste = function (text) { + // TODO: document `statelessClipboard` config option in README, after + // making it work like it should, that is, in both text and math mode + // (currently only works in math fields, so worse than pointless, it + // only gets in the way by \text{}-ifying pasted stuff and $-ifying + // cut/copied LaTeX) + if (this.options.statelessClipboard) { + if (text.slice(0, 1) === '$' && text.slice(-1) === '$') { + text = text.slice(1, -1); + } else { + text = '\\text{' + text + '}'; + } + } + // FIXME: this always inserts math or a TextBlock, even in a RootTextBlock + this.writeLatex(text).cursor.show(); + this.scrollHoriz(); + if (this.options && this.options.onPaste) { + this.options.onPaste(); + } + }; + /** Set up for a static MQ field (i.e., create and attach the mathspeak element and initialize the focus state to blurred) */ + Controller.prototype.setupStaticField = function () { + this.mathspeakSpan = h('span', { class: 'dcg-mq-mathspeak' }); + domFrag(this.container).prepend(domFrag(this.mathspeakSpan)); + this.updateMathspeak(); + this.blurred = true; + this.cursor.hide().parent.blur(this.cursor); + }; + Controller.prototype.updateMathspeak = function () { + var ctrlr = this; + // If the controller's ARIA label doesn't end with a punctuation mark, add a colon by default to better separate it from mathspeak. + var ariaLabel = ctrlr.getAriaLabel(); + var labelWithSuffix = /[A-Za-z0-9]$/.test(ariaLabel) ? ariaLabel + ':' : ariaLabel; + var mathspeak = ctrlr.root.mathspeak().trim(); + this.aria.clear(); + var textarea = ctrlr.getTextareaOrThrow(); + // For static math, provide mathspeak in a visually hidden span to allow screen readers and other AT to traverse the content. + // For editable math, assign the mathspeak to the textarea's ARIA label (AT can use text navigation to interrogate the content). + // Be certain to include the mathspeak for only one of these, though, as we don't want to include outdated labels if a field's editable state changes. + // By design, also take careful note that the ariaPostLabel is meant to exist only for editable math (e.g. to serve as an evaluation or error message) + // so it is not included for static math mathspeak calculations. + // The mathspeakSpan should exist only for static math, so we use its presence to decide which approach to take. + if (!!ctrlr.mathspeakSpan) { + textarea.setAttribute('aria-label', ''); + ctrlr.mathspeakSpan.textContent = (labelWithSuffix + ' ' + mathspeak).trim(); + } else { + textarea.setAttribute( + 'aria-label', + (labelWithSuffix + ' ' + mathspeak + ' ' + ctrlr.ariaPostLabel).trim() + ); + } + }; + return Controller; + })(Controller_scrollHoriz); + /************************************************* + * Abstract classes of math blocks and commands. + ************************************************/ + /** + * Math tree node base class. + * Some math-tree-specific extensions to MQNode. + * Both MathBlock's and MathCommand's descend from it. + */ + var MathElement = /** @class */ (function (_super) { + __extends(MathElement, _super); + function MathElement() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + MathElement.prototype.finalizeInsert = function (options, cursor) { + var self = this; + self.postOrder(function (node) { + node.finalizeTree(options); + }); + self.postOrder(function (node) { + node.contactWeld(cursor); + }); + // note: this order is important. + // empty elements need the empty box provided by blur to + // be present in order for their dimensions to be measured + // correctly by 'reflow' handlers. + self.postOrder(function (node) { + node.blur(cursor); + }); + self.postOrder(function (node) { + node.reflow(); + }); + var selfR = self[R]; + var selfL = self[L]; + if (selfR) selfR.siblingCreated(options, L); + if (selfL) selfL.siblingCreated(options, R); + self.bubble(function (node) { + node.reflow(); + return undefined; + }); + }; + // If the maxDepth option is set, make sure + // deeply nested content is truncated. Just return + // false if the cursor is already too deep. + MathElement.prototype.prepareInsertionAt = function (cursor) { + var maxDepth = cursor.options.maxDepth; + if (maxDepth !== undefined) { + var cursorDepth = cursor.depth(); + if (cursorDepth > maxDepth) { + return false; + } + this.removeNodesDeeperThan(maxDepth - cursorDepth); + } + return true; + }; + // Remove nodes that are more than `cutoff` + // blocks deep from this node. + MathElement.prototype.removeNodesDeeperThan = function (cutoff) { + var depth = 0; + var queue = [[this, depth]]; + var current; + // Do a breadth-first search of this node's descendants + // down to cutoff, removing anything deeper. + while ((current = queue.shift())) { + var c = current; + c[0].children().each(function (child) { + var i = child instanceof MathBlock ? 1 : 0; + depth = c[1] + i; + if (depth <= cutoff) { + queue.push([child, depth]); + } else { + (i ? child.children() : child).remove(); + } + return undefined; + }); + } + }; + return MathElement; + })(MQNode); + var DOMView = /** @class */ (function () { + function DOMView(childCount, render) { + this.childCount = childCount; + this.render = render; + } + return DOMView; + })(); + /** + * Commands and operators, like subscripts, exponents, or fractions. + * Descendant commands are organized into blocks. + */ + var MathCommand = /** @class */ (function (_super) { + __extends(MathCommand, _super); + function MathCommand(ctrlSeq, domView, textTemplate) { + var _this_1 = _super.call(this) || this; + _this_1.textTemplate = ['']; + _this_1.mathspeakTemplate = ['']; + _this_1.setCtrlSeqHtmlAndText(ctrlSeq, domView, textTemplate); + return _this_1; + } + MathCommand.prototype.setEnds = function (ends) { + pray('MathCommand ends are never empty', ends[L] && ends[R]); + this.ends = ends; + }; + MathCommand.prototype.getEnd = function (dir) { + return this.ends[dir]; + }; + MathCommand.prototype.setCtrlSeqHtmlAndText = function (ctrlSeq, domView, textTemplate) { + if (!this.ctrlSeq) this.ctrlSeq = ctrlSeq; + if (domView) this.domView = domView; + if (textTemplate) this.textTemplate = textTemplate; + }; + // obvious methods + MathCommand.prototype.replaces = function (replacedFragment) { + replacedFragment.disown(); + this.replacedFragment = replacedFragment; + }; + MathCommand.prototype.isEmpty = function () { + return this.foldChildren(true, function (isEmpty, child) { + return isEmpty && child.isEmpty(); + }); + }; + MathCommand.prototype.parser = function () { + var _this_1 = this; + var block = latexMathParser.block; + return block.times(this.numBlocks()).map(function (blocks) { + _this_1.blocks = blocks; + for (var i = 0; i < blocks.length; i += 1) { + blocks[i].adopt(_this_1, _this_1.getEnd(R), 0); + } + return _this_1; + }); + }; + // createLeftOf(cursor) and the methods it calls + MathCommand.prototype.createLeftOf = function (cursor) { + var cmd = this; + var replacedFragment = cmd.replacedFragment; + cmd.createBlocks(); + _super.prototype.createLeftOf.call(this, cursor); + if (replacedFragment) { + var cmdEndsL = cmd.getEnd(L); + replacedFragment.adopt(cmdEndsL, 0, 0); + replacedFragment.domFrag().appendTo(cmdEndsL.domFrag().oneElement()); + cmd.placeCursor(cursor); + cmd.prepareInsertionAt(cursor); + } + cmd.finalizeInsert(cursor.options, cursor); + cmd.placeCursor(cursor); + }; + MathCommand.prototype.createBlocks = function () { + var cmd = this, + numBlocks = cmd.numBlocks(), + blocks = (cmd.blocks = Array(numBlocks)); + for (var i = 0; i < numBlocks; i += 1) { + var newBlock = (blocks[i] = new MathBlock()); + newBlock.adopt(cmd, cmd.getEnd(R), 0); + } + }; + MathCommand.prototype.placeCursor = function (cursor) { + //insert the cursor at the right end of the first empty child, searching + //left-to-right, or if none empty, the right end child + cursor.insAtRightEnd( + this.foldChildren(this.getEnd(L), function (leftward, child) { + return leftward.isEmpty() ? leftward : child; + }) + ); + }; + // editability methods: called by the cursor for editing, cursor movements, + // and selection of the MathQuill tree, these all take in a direction and + // the cursor + MathCommand.prototype.moveTowards = function (dir, cursor, updown) { + var updownInto; + if (updown === 'up') { + updownInto = this.upInto; + } else if (updown === 'down') { + updownInto = this.downInto; + } + var el = updownInto || this.getEnd(-dir); + cursor.insAtDirEnd(-dir, el); + cursor.controller.aria.queueDirEndOf(-dir).queue(cursor.parent, true); + }; + MathCommand.prototype.deleteTowards = function (dir, cursor) { + if (this.isEmpty()) cursor[dir] = this.remove()[dir]; + else this.moveTowards(dir, cursor); + }; + MathCommand.prototype.selectTowards = function (dir, cursor) { + cursor[-dir] = this; + cursor[dir] = this[dir]; + }; + MathCommand.prototype.selectChildren = function () { + return new MQSelection(this, this); + }; + MathCommand.prototype.unselectInto = function (dir, cursor) { + var antiCursor = cursor.anticursor; + var ancestor = antiCursor.ancestors[this.id]; + cursor.insAtDirEnd(-dir, ancestor); + }; + MathCommand.prototype.seek = function (clientX, cursor) { + function getBounds(node) { + var _c; + var el = node.domFrag().oneElement(); + var l = getBoundingClientRect(el).left; + var r = l + el.offsetWidth; + return (_c = {}), (_c[L] = l), (_c[R] = r), _c; + } + var cmd = this; + var cmdBounds = getBounds(cmd); + if (clientX < cmdBounds[L]) return cursor.insLeftOf(cmd); + if (clientX > cmdBounds[R]) return cursor.insRightOf(cmd); + var leftLeftBound = cmdBounds[L]; + cmd.eachChild(function (block) { + var blockBounds = getBounds(block); + if (clientX < blockBounds[L]) { + // closer to this block's left bound, or the bound left of that? + if (clientX - leftLeftBound < blockBounds[L] - clientX) { + if (block[L]) cursor.insAtRightEnd(block[L]); + else cursor.insLeftOf(cmd); + } else cursor.insAtLeftEnd(block); + return false; + } else if (clientX > blockBounds[R]) { + if (block[R]) leftLeftBound = blockBounds[R]; + // continue to next block + else { + // last (rightmost) block + // closer to this block's right bound, or the cmd's right bound? + if (cmdBounds[R] - clientX < clientX - blockBounds[R]) { + cursor.insRightOf(cmd); + } else cursor.insAtRightEnd(block); + } + return undefined; + } else { + block.seek(clientX, cursor); + return false; + } + }); + return undefined; + }; + MathCommand.prototype.numBlocks = function () { + return this.domView.childCount; + }; + /** + * Render the entire math subtree rooted at this command to a DOM node. Assumes `this.domView` is defined. + * + * See dom.test.js for example templates and intended outputs. + */ + MathCommand.prototype.html = function () { + var blocks = this.blocks; + pray('domView is defined', this.domView); + var template = this.domView; + var dom = template.render(blocks || []); + this.setDOM(dom); + NodeBase.linkElementByCmdNode(dom, this); + return dom; + }; + // methods to export a string representation of the math tree + MathCommand.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += this.ctrlSeq || ''; + this.eachChild(function (child) { + ctx.latex += '{'; + var beforeLength = ctx.latex.length; + child.latexRecursive(ctx); + var afterLength = ctx.latex.length; + if (beforeLength === afterLength) { + // nothing was written so we write a space + ctx.latex += ' '; + } + ctx.latex += '}'; + }); + this.checkCursorContextClose(ctx); + }; + MathCommand.prototype.text = function () { + var cmd = this, + i = 0; + return cmd.foldChildren(cmd.textTemplate[i], function (text, child) { + i += 1; + var child_text = child.text(); + if (text && cmd.textTemplate[i] === '(' && child_text[0] === '(' && child_text.slice(-1) === ')') + return text + child_text.slice(1, -1) + cmd.textTemplate[i]; + return text + child_text + (cmd.textTemplate[i] || ''); + }); + }; + MathCommand.prototype.mathspeak = function () { + var cmd = this, + i = 0; + return cmd.foldChildren( + cmd.mathspeakTemplate[i] || 'Start' + cmd.ctrlSeq + ' ', + function (speech, block) { + i += 1; + return ( + speech + + ' ' + + block.mathspeak() + + ' ' + + (cmd.mathspeakTemplate[i] + ' ' || 'End' + cmd.ctrlSeq + ' ') + ); + } + ); + }; + return MathCommand; + })(MathElement); + /** + * Lightweight command without blocks or children. + */ + var MQSymbol = /** @class */ (function (_super) { + __extends(MQSymbol, _super); + function MQSymbol(ctrlSeq, html, text, mathspeak) { + var _this_1 = _super.call(this) || this; + _this_1.setCtrlSeqHtmlTextAndMathspeak( + ctrlSeq, + html + ? new DOMView(0, function () { + return html.cloneNode(true); + }) + : undefined, + text, + mathspeak + ); + return _this_1; + } + MQSymbol.prototype.setCtrlSeqHtmlTextAndMathspeak = function (ctrlSeq, html, text, mathspeak) { + if (!text && !!ctrlSeq) { + text = ctrlSeq.replace(/^\\/, ''); + } + this.mathspeakName = mathspeak || text; + _super.prototype.setCtrlSeqHtmlAndText.call(this, ctrlSeq, html, [text || '']); + }; + MQSymbol.prototype.parser = function () { + return Parser.succeed(this); + }; + MQSymbol.prototype.numBlocks = function () { + return 0; + }; + MQSymbol.prototype.replaces = function (replacedFragment) { + replacedFragment.remove(); + }; + MQSymbol.prototype.createBlocks = function () {}; + MQSymbol.prototype.moveTowards = function (dir, cursor) { + cursor.domFrag().insDirOf(dir, this.domFrag()); + cursor[-dir] = this; + cursor[dir] = this[dir]; + cursor.controller.aria.queue(this); + }; + MQSymbol.prototype.deleteTowards = function (dir, cursor) { + cursor[dir] = this.remove()[dir]; + }; + MQSymbol.prototype.seek = function (clientX, cursor) { + // insert at whichever side the click was closer to + var el = this.domFrag().oneElement(); + var left = getBoundingClientRect(el).left; + if (clientX - left < el.offsetWidth / 2) cursor.insLeftOf(this); + else cursor.insRightOf(this); + return cursor; + }; + MQSymbol.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += this.ctrlSeq || ''; + this.checkCursorContextClose(ctx); + }; + MQSymbol.prototype.text = function () { + return this.textTemplate.join(''); + }; + MQSymbol.prototype.mathspeak = function (_opts) { + return this.mathspeakName || ''; + }; + MQSymbol.prototype.placeCursor = function () {}; + MQSymbol.prototype.isEmpty = function () { + return true; + }; + return MQSymbol; + })(MathCommand); + var VanillaSymbol = /** @class */ (function (_super) { + __extends(VanillaSymbol, _super); + function VanillaSymbol(ch, html, mathspeak) { + return _super.call(this, ch, h('span', {}, [html || h.text(ch)]), undefined, mathspeak) || this; + } + return VanillaSymbol; + })(MQSymbol); + function bindVanillaSymbol(ch, htmlEntity, mathspeak) { + return function () { + return new VanillaSymbol(ch, htmlEntity ? h.entityText(htmlEntity) : undefined, mathspeak); + }; + } + var BinaryOperator = /** @class */ (function (_super) { + __extends(BinaryOperator, _super); + function BinaryOperator(ctrlSeq, html, text, mathspeak, treatLikeSymbol) { + var _this_1 = this; + if (treatLikeSymbol) { + _this_1 = + _super.call( + this, + ctrlSeq, + h('span', {}, [html || h.text(ctrlSeq || '')]), + undefined, + mathspeak + ) || this; + } else { + _this_1 = + _super.call( + this, + ctrlSeq, + h('span', { class: 'dcg-mq-binary-operator' }, html ? [html] : []), + text, + mathspeak + ) || this; + } + return _this_1; + } + return BinaryOperator; + })(MQSymbol); + function bindBinaryOperator(ctrlSeq, htmlEntity, text, mathspeak) { + return function () { + return new BinaryOperator(ctrlSeq, htmlEntity ? h.entityText(htmlEntity) : undefined, text, mathspeak); + }; + } + /** + * Children and parent of MathCommand's. Basically partitions all the + * symbols and operators that descend (in the Math DOM tree) from + * ancestor operators. + */ + var MathBlock = /** @class */ (function (_super) { + __extends(MathBlock, _super); + function MathBlock() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ariaLabel = 'block'; + return _this_1; + } + MathBlock.prototype.join = function (methodName) { + return this.foldChildren('', function (fold, child) { + return fold + child[methodName](); + }); + }; + MathBlock.prototype.html = function () { + var fragment = document.createDocumentFragment(); + this.eachChild(function (el) { + var childHtml = el.html(); + fragment.appendChild(childHtml); + return undefined; + }); + return fragment; + }; + MathBlock.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + this.eachChild(function (child) { + return child.latexRecursive(ctx); + }); + this.checkCursorContextClose(ctx); + }; + MathBlock.prototype.text = function () { + var endsL = this.getEnd(L); + var endsR = this.getEnd(R); + return endsL === endsR && endsL !== 0 ? endsL.text() : this.join('text'); + }; + MathBlock.prototype.mathspeak = function () { + var tempOp = ''; + var autoOps = {}; + if (this.controller) autoOps = this.controller.options.autoOperatorNames; + return ( + this.foldChildren([], function (speechArray, cmd) { + if (cmd.isPartOfOperator) { + tempOp += cmd.mathspeak(); + } else { + if (tempOp !== '') { + if (autoOps._maxLength > 0) { + var x = autoOps[tempOp.toLowerCase()]; + if (typeof x === 'string') tempOp = x; + } + speechArray.push(tempOp + ' '); + tempOp = ''; + } + var mathspeakText = cmd.mathspeak(); + var cmdText = cmd.ctrlSeq; + if ( + isNaN(cmdText) && // TODO - revisit this to improve the isNumber() check + cmdText !== '.' && + (!cmd.parent || !cmd.parent.parent || !cmd.parent.parent.isTextBlock()) + ) { + mathspeakText = ' ' + mathspeakText + ' '; + } + speechArray.push(mathspeakText); + } + return speechArray; + }) + .join('') + .replace(/ +(?= )/g, '') + // For Apple devices in particular, split out digits after a decimal point so they aren't read aloud as whole words. + // Not doing so makes 123.456 potentially spoken as "one hundred twenty-three point four hundred fifty-six." + // Instead, add spaces so it is spoken as "one hundred twenty-three point four five six." + .replace(/(\.)([0-9]+)/g, function (_match, p1, p2) { + return p1 + p2.split('').join(' ').trim(); + }) + ); + }; + MathBlock.prototype.keystroke = function (key, e, ctrlr) { + if (ctrlr.options.spaceBehavesLikeTab && (key === 'Spacebar' || key === 'Shift-Spacebar')) { + e === null || e === void 0 ? void 0 : e.preventDefault(); + ctrlr.escapeDir(key === 'Shift-Spacebar' ? L : R, key, e); + return; + } + return _super.prototype.keystroke.call(this, key, e, ctrlr); + }; + // editability methods: called by the cursor for editing, cursor movements, + // and selection of the MathQuill tree, these all take in a direction and + // the cursor + MathBlock.prototype.moveOutOf = function (dir, cursor, updown) { + var updownInto; + if (updown === 'up') { + updownInto = this.parent.upInto; + } else if (updown === 'down') { + updownInto = this.parent.downInto; + } + if (!updownInto && this[dir]) { + var otherDir = -dir; + cursor.insAtDirEnd(otherDir, this[dir]); + cursor.controller.aria.queueDirEndOf(otherDir).queue(cursor.parent, true); + } else { + cursor.insDirOf(dir, this.parent); + cursor.controller.aria.queueDirOf(dir).queue(this.parent); + } + }; + MathBlock.prototype.selectOutOf = function (dir, cursor) { + cursor.insDirOf(dir, this.parent); + }; + MathBlock.prototype.deleteOutOf = function (_dir, cursor) { + cursor.unwrapGramp(); + }; + MathBlock.prototype.seek = function (clientX, cursor) { + var node = this.getEnd(R); + if (!node) return cursor.insAtRightEnd(this); + var el = node.domFrag().oneElement(); + var left = getBoundingClientRect(el).left; + if (left + el.offsetWidth < clientX) { + return cursor.insAtRightEnd(this); + } + var endsL = this.getEnd(L); + if (clientX < getBoundingClientRect(endsL.domFrag().oneElement()).left) + return cursor.insAtLeftEnd(this); + while (clientX < getBoundingClientRect(node.domFrag().oneElement()).left) node = node[L]; + return node.seek(clientX, cursor); + }; + MathBlock.prototype.chToCmd = function (ch, options) { + var cons; + // exclude f because it gets a dedicated command with more spacing + if (ch.match(/^[a-eg-zA-Z]$/)) return new Letter(ch); + else if (/^\d$/.test(ch)) return new Digit(ch); + else if (options && options.typingSlashWritesDivisionSymbol && ch === '/') + return LatexCmds['\u00f7'](ch); + else if (options && options.typingAsteriskWritesTimesSymbol && ch === '*') + return LatexCmds['\u00d7'](ch); + else if (options && options.typingPercentWritesPercentOf && ch === '%') return LatexCmds.percentof(ch); + else if ((cons = CharCmds[ch] || LatexCmds[ch])) { + if (cons.constructor) { + return new cons(ch); + } else { + return cons(ch); + } + } else return new VanillaSymbol(ch); + }; + MathBlock.prototype.write = function (cursor, ch) { + var cmd = this.chToCmd(ch, cursor.options); + if (cursor.selection) cmd.replaces(cursor.replaceSelection()); + if (!cursor.isTooDeep()) { + cmd.createLeftOf(cursor.show()); + // special-case the slash so that fractions are voiced while typing + if (ch === '/') { + cursor.controller.aria.alert('over'); + } else { + cursor.controller.aria.alert(cmd.mathspeak({ createdLeftOf: cursor })); + } + } + }; + MathBlock.prototype.writeLatex = function (cursor, latex) { + var all = Parser.all; + var eof = Parser.eof; + var block = latexMathParser.skip(eof).or(all.result(false)).parse(latex); + if (block && !block.isEmpty() && block.prepareInsertionAt(cursor)) { + block.children().adopt(cursor.parent, cursor[L], cursor[R]); // TODO - masking undefined. should be 0 + domFrag(block.html()).insertBefore(cursor.domFrag()); + cursor[L] = block.getEnd(R); + block.finalizeInsert(cursor.options, cursor); + var blockEndsR = block.getEnd(R); + var blockEndsL = block.getEnd(L); + var blockEndsRR = blockEndsR[R]; + var blockEndsLL = blockEndsL[L]; + if (blockEndsRR) blockEndsRR.siblingCreated(cursor.options, L); + if (blockEndsLL) blockEndsLL.siblingCreated(cursor.options, R); + cursor.parent.bubble(function (node) { + node.reflow(); + return undefined; + }); + } + }; + MathBlock.prototype.focus = function () { + this.domFrag().addClass('dcg-mq-hasCursor'); + this.domFrag().removeClass('dcg-mq-empty'); + return this; + }; + MathBlock.prototype.blur = function (cursor) { + this.domFrag().removeClass('dcg-mq-hasCursor'); + if (this.isEmpty()) { + this.domFrag().addClass('dcg-mq-empty'); + if (cursor && this.isQuietEmptyDelimiter(cursor.options.quietEmptyDelimiters)) { + this.domFrag().addClass('dcg-mq-quiet-delimiter'); + } + } + return this; + }; + return MathBlock; + })(MathElement); + Options.prototype.mouseEvents = true; + API.StaticMath = function (APIClasses) { + var _c; + return ( + (_c = /** @class */ (function (_super) { + __extends(StaticMath, _super); + function StaticMath(el) { + var _this_1 = _super.call(this, el) || this; + var innerFields = (_this_1.innerFields = []); + _this_1.__controller.root.postOrder(function (node) { + node.registerInnerField(innerFields, APIClasses.InnerMathField); + }); + return _this_1; + } + StaticMath.prototype.__mathquillify = function (opts, _interfaceVersion) { + this.config(opts); + _super.prototype.mathquillify.call(this, 'dcg-mq-math-mode'); + this.__controller.setupStaticField(); + if (this.__options.mouseEvents) { + this.__controller.addMouseEventListener(); + this.__controller.staticMathTextareaEvents(); + } + return this; + }; + StaticMath.prototype.latex = function (_latex) { + var returned = _super.prototype.latex.apply(this, arguments); + if (arguments.length > 0) { + var innerFields = (this.innerFields = []); + this.__controller.root.postOrder(function (node) { + node.registerInnerField(innerFields, APIClasses.InnerMathField); + }); + // Force an ARIA label update to remain in sync with the new LaTeX value. + this.__controller.updateMathspeak(); + } + return returned; + }; + StaticMath.prototype.setAriaLabel = function (ariaLabel) { + this.__controller.setAriaLabel(ariaLabel); + return this; + }; + StaticMath.prototype.getAriaLabel = function () { + return this.__controller.getAriaLabel(); + }; + return StaticMath; + })(APIClasses.AbstractMathQuill)), + (_c.RootBlock = MathBlock), + _c + ); + }; + var RootMathBlock = /** @class */ (function (_super) { + __extends(RootMathBlock, _super); + function RootMathBlock() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + return RootMathBlock; + })(MathBlock); + RootBlockMixin(RootMathBlock.prototype); // adds methods to RootMathBlock + API.MathField = function (APIClasses) { + var _c; + return ( + (_c = /** @class */ (function (_super) { + __extends(MathField, _super); + function MathField() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + MathField.prototype.__mathquillify = function (opts, interfaceVersion) { + this.config(opts); + if (interfaceVersion > 1) this.__controller.root.reflow = noop; + _super.prototype.mathquillify.call(this, 'dcg-mq-editable-field dcg-mq-math-mode'); + // TODO: Why does this need to be deleted (contrary to the type definition)? Could we set it to `noop` instead? + delete this.__controller.root.reflow; + return this; + }; + return MathField; + })(APIClasses.EditableField)), + (_c.RootBlock = RootMathBlock), + _c + ); + }; + API.InnerMathField = function (APIClasses) { + pray('MathField class is defined', APIClasses.MathField); + return /** @class */ (function (_super) { + __extends(class_1, _super); + function class_1() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + class_1.prototype.makeStatic = function () { + this.__controller.editable = false; + this.__controller.root.blur(); + this.__controller.unbindEditablesEvents(); + domFrag(this.__controller.container).removeClass('dcg-mq-editable-field'); + }; + class_1.prototype.makeEditable = function () { + this.__controller.editable = true; + this.__controller.editablesTextareaEvents(); + this.__controller.cursor.insAtRightEnd(this.__controller.root); + domFrag(this.__controller.container).addClass('dcg-mq-editable-field'); + }; + return class_1; + })(APIClasses.MathField); + }; + /************************************************* + * Abstract classes of text blocks + ************************************************/ + /** + * Blocks of plain text, with one or two TextPiece's as children. + * Represents flat strings of typically serif-font Roman characters, as + * opposed to hierchical, nested, tree-structured math. + * Wraps a single HTMLSpanElement. + */ + var TextBlock = /** @class */ (function (_super) { + __extends(TextBlock, _super); + function TextBlock() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = '\\text'; + _this_1.ariaLabel = 'Text'; + _this_1.mathspeakTemplate = ['StartText', 'EndText']; + return _this_1; + } + TextBlock.prototype.replaces = function (replacedText) { + if (replacedText instanceof Fragment) { + this.replacedText = replacedText.remove().domFrag().text(); + } else if (typeof replacedText === 'string') this.replacedText = replacedText; + }; + TextBlock.prototype.setDOMFrag = function (el) { + _super.prototype.setDOM.call(this, el); + var endsL = this.getEnd(L); + if (endsL) { + var children = this.domFrag().children(); + if (!children.isEmpty()) { + endsL.setDOM(children.oneText()); + } + } + return this; + }; + TextBlock.prototype.createLeftOf = function (cursor) { + var textBlock = this; + _super.prototype.createLeftOf.call(this, cursor); + cursor.insAtRightEnd(textBlock); + if (textBlock.replacedText) + for (var i = 0; i < textBlock.replacedText.length; i += 1) + textBlock.write(cursor, textBlock.replacedText.charAt(i)); + var textBlockR = textBlock[R]; + if (textBlockR) textBlockR.siblingCreated(cursor.options, L); + var textBlockL = textBlock[L]; + if (textBlockL) textBlockL.siblingCreated(cursor.options, R); + textBlock.bubble(function (node) { + node.reflow(); + return undefined; + }); + }; + TextBlock.prototype.parser = function () { + var textBlock = this; + // TODO: correctly parse text mode + var string = Parser.string; + var regex = Parser.regex; + var optWhitespace = Parser.optWhitespace; + return optWhitespace + .then(string('{')) + .then(regex(/^[^}]*/)) + .skip(string('}')) + .map(function (text) { + if (text.length === 0) return new Fragment(0, 0); + new TextPiece(text).adopt(textBlock, 0, 0); + return textBlock; + }); + }; + TextBlock.prototype.textContents = function () { + return this.foldChildren('', function (text, child) { + return text + child.textStr; + }); + }; + TextBlock.prototype.text = function () { + return '"' + this.textContents() + '"'; + }; + TextBlock.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + var contents = this.textContents(); + if (contents.length > 0) { + ctx.latex += this.ctrlSeq + '{'; + ctx.latex += contents.replace(/\\/g, '\\backslash ').replace(/[{}]/g, '\\$&'); + ctx.latex += '}'; + } + this.checkCursorContextClose(ctx); + }; + TextBlock.prototype.html = function () { + var out = h('span', { class: 'dcg-mq-text-mode' }, [h.text(this.textContents())]); + this.setDOM(out); + NodeBase.linkElementByCmdNode(out, this); + return out; + }; + TextBlock.prototype.mathspeak = function (opts) { + if (opts && opts.ignoreShorthand) { + return this.mathspeakTemplate[0] + ', ' + this.textContents() + ', ' + this.mathspeakTemplate[1]; + } else { + return this.textContents(); + } + }; + TextBlock.prototype.isTextBlock = function () { + return true; + }; + // editability methods: called by the cursor for editing, cursor movements, + // and selection of the MathQuill tree, these all take in a direction and + // the cursor + TextBlock.prototype.moveTowards = function (dir, cursor) { + cursor.insAtDirEnd(-dir, this); + cursor.controller.aria.queueDirEndOf(-dir).queue(cursor.parent, true); + }; + TextBlock.prototype.moveOutOf = function (dir, cursor) { + cursor.insDirOf(dir, this); + cursor.controller.aria.queueDirOf(dir).queue(this); + }; + TextBlock.prototype.unselectInto = function (dir, cursor) { + this.moveTowards(dir, cursor); + }; + // TODO: make these methods part of a shared mixin or something. + TextBlock.prototype.selectTowards = function (dir, cursor) { + MathCommand.prototype.selectTowards.call(this, dir, cursor); + }; + TextBlock.prototype.deleteTowards = function (dir, cursor) { + MathCommand.prototype.deleteTowards.call(this, dir, cursor); + }; + TextBlock.prototype.selectOutOf = function (dir, cursor) { + cursor.insDirOf(dir, this); + }; + TextBlock.prototype.deleteOutOf = function (_dir, cursor) { + // backspace and delete at ends of block don't unwrap + if (this.isEmpty()) cursor.insRightOf(this); + }; + TextBlock.prototype.write = function (cursor, ch) { + cursor.show().deleteSelection(); + if (ch !== '$') { + var cursorL = cursor[L]; + if (!cursorL) new TextPiece(ch).createLeftOf(cursor); + else if (cursorL instanceof TextPiece) cursorL.appendText(ch); + } else if (this.isEmpty()) { + cursor.insRightOf(this); + new VanillaSymbol('\\$', h.text('$')).createLeftOf(cursor); + } else if (!cursor[R]) cursor.insRightOf(this); + else if (!cursor[L]) cursor.insLeftOf(this); + else { + // split apart + var leftBlock = new TextBlock(); + var leftPc = this.getEnd(L); + if (leftPc) { + leftPc.disown().domFrag().detach(); + leftPc.adopt(leftBlock, 0, 0); + } + cursor.insLeftOf(this); + _super.prototype.createLeftOf.call(leftBlock, cursor); // micro-optimization, not for correctness + } + this.bubble(function (node) { + node.reflow(); + return undefined; + }); + // TODO needs tests + cursor.controller.aria.alert(ch); + }; + TextBlock.prototype.writeLatex = function (cursor, latex) { + var cursorL = cursor[L]; + if (!cursorL) new TextPiece(latex).createLeftOf(cursor); + else if (cursorL instanceof TextPiece) cursorL.appendText(latex); + this.bubble(function (node) { + node.reflow(); + return undefined; + }); + }; + TextBlock.prototype.seek = function (clientX, cursor) { + cursor.hide(); + var textPc = TextBlockFuseChildren(this); + if (!textPc) return; + // insert cursor at approx position in DOMTextNode + var textNode = this.domFrag().children().oneText(); + var range = document.createRange(); + range.selectNodeContents(textNode); + var rects = range.getClientRects(); + if (rects.length === 1) { + var _c = rects[0], + width = _c.width, + left = _c.left; + var avgChWidth = width / this.textContents().length; + var approxPosition = Math.round((clientX - left) / avgChWidth); + if (approxPosition <= 0) { + cursor.insAtLeftEnd(this); + } else if (approxPosition >= textPc.textStr.length) { + cursor.insAtRightEnd(this); + } else { + cursor.insLeftOf(textPc.splitRight(approxPosition)); + } + } else { + cursor.insAtLeftEnd(this); + } + // move towards mousedown (clientX) + var displ = clientX - cursor.show().getBoundingClientRectWithoutMargin().left; // displacement + var dir = displ && displ < 0 ? L : R; + var prevDispl = dir; + // displ * prevDispl > 0 iff displacement direction === previous direction + while (cursor[dir] && displ * prevDispl > 0) { + cursor[dir].moveTowards(dir, cursor); + prevDispl = displ; + displ = clientX - cursor.getBoundingClientRectWithoutMargin().left; + } + if (dir * displ < -dir * prevDispl) cursor[-dir].moveTowards(-dir, cursor); + if (!cursor.anticursor) { + // about to start mouse-selecting, the anticursor is gonna get put here + var cursorL = cursor[L]; + this.anticursorPosition = cursorL && cursorL.textStr.length; + // ^ get it? 'cos if there's no cursor[L], it's 0... I'm a terrible person. + } else if (cursor.anticursor.parent === this) { + // mouse-selecting within this TextBlock, re-insert the anticursor + var cursorL = cursor[L]; + var cursorPosition = cursorL && cursorL.textStr.length; + if (this.anticursorPosition === cursorPosition) { + cursor.anticursor = Anticursor.fromCursor(cursor); + } else { + if (this.anticursorPosition < cursorPosition) { + var newTextPc = cursorL.splitRight(this.anticursorPosition); + cursor[L] = newTextPc; + } else { + var cursorR = cursor[R]; + var newTextPc = cursorR.splitRight(this.anticursorPosition - cursorPosition); + } + cursor.anticursor = new Anticursor(this, newTextPc[L], newTextPc); + } + } + }; + TextBlock.prototype.blur = function (cursor) { + MathBlock.prototype.blur.call(this, cursor); + if (!cursor) return; + if (this.textContents() === '') { + this.remove(); + if (cursor[L] === this) cursor[L] = this[L]; + else if (cursor[R] === this) cursor[R] = this[R]; + } else TextBlockFuseChildren(this); + }; + TextBlock.prototype.focus = function () { + MathBlock.prototype.focus.call(this); + }; + return TextBlock; + })(MQNode); + function TextBlockFuseChildren(self) { + self.domFrag().oneElement().normalize(); + var children = self.domFrag().children(); + if (children.isEmpty()) return; + var textPcDom = children.oneText(); + pray('only node in TextBlock span is Text node', textPcDom.nodeType === 3); + // nodeType === 3 has meant a Text node since ancient times: + // http://reference.sitepoint.com/javascript/Node/nodeType + var textPc = new TextPiece(textPcDom.data); + textPc.setDOM(textPcDom); + self.children().disown(); + textPc.adopt(self, 0, 0); + return textPc; + } + /** + * Piece of plain text, with a TextBlock as a parent and no children. + * Wraps a single DOMTextNode. + * For convenience, has a .textStr property that's just a JavaScript string + * mirroring the text contents of the DOMTextNode. + * Text contents must always be nonempty. + */ + var TextPiece = /** @class */ (function (_super) { + __extends(TextPiece, _super); + function TextPiece(text) { + var _this_1 = _super.call(this) || this; + _this_1.textStr = text; + return _this_1; + } + TextPiece.prototype.html = function () { + var out = h.text(this.textStr); + this.setDOM(out); + return out; + }; + TextPiece.prototype.appendText = function (text) { + this.textStr += text; + this.domFrag().oneText().appendData(text); + }; + TextPiece.prototype.prependText = function (text) { + this.textStr = text + this.textStr; + this.domFrag().oneText().insertData(0, text); + }; + TextPiece.prototype.insTextAtDirEnd = function (text, dir) { + prayDirection(dir); + if (dir === R) this.appendText(text); + else this.prependText(text); + }; + TextPiece.prototype.splitRight = function (i) { + var newPc = new TextPiece(this.textStr.slice(i)).adopt(this.parent, this, this[R]); + newPc.setDOM(this.domFrag().oneText().splitText(i)); + this.textStr = this.textStr.slice(0, i); + return newPc; + }; + TextPiece.prototype.endChar = function (dir, text) { + return text.charAt(dir === L ? 0 : -1 + text.length); + }; + TextPiece.prototype.moveTowards = function (dir, cursor) { + prayDirection(dir); + var ch = this.endChar(-dir, this.textStr); + var from = this[-dir]; + if (from instanceof TextPiece) from.insTextAtDirEnd(ch, dir); + else new TextPiece(ch).createDir(-dir, cursor); + return this.deleteTowards(dir, cursor); + }; + TextPiece.prototype.mathspeak = function () { + return this.textStr; + }; + TextPiece.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += this.textStr; + this.checkCursorContextClose(ctx); + }; + TextPiece.prototype.deleteTowards = function (dir, cursor) { + if (this.textStr.length > 1) { + var deletedChar; + if (dir === R) { + this.domFrag().oneText().deleteData(0, 1); + deletedChar = this.textStr[0]; + this.textStr = this.textStr.slice(1); + } else { + // note that the order of these 2 lines is annoyingly important + // (the second line mutates this.textStr.length) + this.domFrag() + .oneText() + .deleteData(-1 + this.textStr.length, 1); + deletedChar = this.textStr[this.textStr.length - 1]; + this.textStr = this.textStr.slice(0, -1); + } + cursor.controller.aria.queue(deletedChar); + } else { + this.remove(); + cursor[dir] = this[dir]; + cursor.controller.aria.queue(this.textStr); + } + }; + TextPiece.prototype.selectTowards = function (dir, cursor) { + prayDirection(dir); + var anticursor = cursor.anticursor; + if (!anticursor) return; + var ch = this.endChar(-dir, this.textStr); + if (anticursor[dir] === this) { + var newPc = new TextPiece(ch).createDir(dir, cursor); + anticursor[dir] = newPc; + cursor.insDirOf(dir, newPc); + } else { + var from = this[-dir]; + if (from instanceof TextPiece) from.insTextAtDirEnd(ch, dir); + else { + var newPc = new TextPiece(ch).createDir(-dir, cursor); + var selection = cursor.selection; + if (selection) { + newPc.domFrag().insDirOf(-dir, selection.domFrag()); + } + } + if (this.textStr.length === 1 && anticursor[-dir] === this) { + anticursor[-dir] = this[-dir]; // `this` will be removed in deleteTowards + } + } + return this.deleteTowards(dir, cursor); + }; + return TextPiece; + })(MQNode); + LatexCmds.text = LatexCmds.textnormal = LatexCmds.textrm = LatexCmds.textup = LatexCmds.textmd = TextBlock; + function makeTextBlock(latex, ariaLabel, tagName, attrs) { + return /** @class */ (function (_super) { + __extends(class_2, _super); + function class_2() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = latex; + _this_1.mathspeakTemplate = ['Start' + ariaLabel, 'End' + ariaLabel]; + _this_1.ariaLabel = ariaLabel; + return _this_1; + } + class_2.prototype.html = function () { + var out = h(tagName, attrs, [h.text(this.textContents())]); + this.setDOM(out); + NodeBase.linkElementByCmdNode(out, this); + return out; + }; + return class_2; + })(TextBlock); + } + LatexCmds.em = LatexCmds.italic = LatexCmds.italics = LatexCmds.emph = LatexCmds.textit = LatexCmds.textsl = makeTextBlock( + '\\textit', + 'Italic', + 'i', + { class: 'dcg-mq-text-mode' } + ); + LatexCmds.strong = LatexCmds.bold = LatexCmds.textbf = makeTextBlock('\\textbf', 'Bold', 'b', { + class: 'dcg-mq-text-mode', + }); + LatexCmds.sf = LatexCmds.textsf = makeTextBlock('\\textsf', 'Sans serif font', 'span', { + class: 'dcg-mq-sans-serif dcg-mq-text-mode', + }); + LatexCmds.tt = LatexCmds.texttt = makeTextBlock('\\texttt', 'Mono space font', 'span', { + class: 'dcg-mq-monospace dcg-mq-text-mode', + }); + LatexCmds.textsc = makeTextBlock('\\textsc', 'Variable font', 'span', { + style: 'font-variant:small-caps', + class: 'dcg-mq-text-mode', + }); + LatexCmds.uppercase = makeTextBlock('\\uppercase', 'Uppercase', 'span', { + style: 'text-transform:uppercase', + class: 'dcg-mq-text-mode', + }); + LatexCmds.lowercase = makeTextBlock('\\lowercase', 'Lowercase', 'span', { + style: 'text-transform:lowercase', + class: 'dcg-mq-text-mode', + }); + var RootMathCommand = /** @class */ (function (_super) { + __extends(RootMathCommand, _super); + function RootMathCommand(cursor) { + var _this_1 = _super.call(this, '$') || this; + _this_1.domView = new DOMView(1, function (blocks) { + return h.block('span', { class: 'dcg-mq-math-mode' }, blocks[0]); + }); + _this_1.cursor = cursor; + return _this_1; + } + RootMathCommand.prototype.createBlocks = function () { + _super.prototype.createBlocks.call(this); + var endsL = this.getEnd(L); // TODO - how do we know this is a RootMathCommand? + endsL.cursor = this.cursor; + endsL.write = function (cursor, ch) { + if (ch !== '$') MathBlock.prototype.write.call(this, cursor, ch); + else if (this.isEmpty()) { + cursor.insRightOf(this.parent); + this.parent.deleteTowards(undefined, cursor); + new VanillaSymbol('\\$', h.text('$')).createLeftOf(cursor.show()); + } else if (!cursor[R]) cursor.insRightOf(this.parent); + else if (!cursor[L]) cursor.insLeftOf(this.parent); + else MathBlock.prototype.write.call(this, cursor, ch); + }; + }; + RootMathCommand.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += '$'; + this.getEnd(L).latexRecursive(ctx); + ctx.latex += '$'; + this.checkCursorContextClose(ctx); + }; + return RootMathCommand; + })(MathCommand); + var RootTextBlock = /** @class */ (function (_super) { + __extends(RootTextBlock, _super); + function RootTextBlock() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + RootTextBlock.prototype.keystroke = function (key, e, ctrlr) { + if (key === 'Spacebar' || key === 'Shift-Spacebar') return; + return _super.prototype.keystroke.call(this, key, e, ctrlr); + }; + RootTextBlock.prototype.write = function (cursor, ch) { + cursor.show().deleteSelection(); + if (ch === '$') new RootMathCommand(cursor).createLeftOf(cursor); + else { + var html; + if (ch === '<') html = h.entityText('<'); + else if (ch === '>') html = h.entityText('>'); + new VanillaSymbol(ch, html).createLeftOf(cursor); + } + }; + return RootTextBlock; + })(RootMathBlock); + API.TextField = function (APIClasses) { + var _c; + return ( + (_c = /** @class */ (function (_super) { + __extends(TextField, _super); + function TextField() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + TextField.prototype.__mathquillify = function () { + _super.prototype.mathquillify.call(this, 'dcg-mq-editable-field dcg-mq-text-mode'); + return this; + }; + TextField.prototype.latex = function (latex) { + if (latex) { + this.__controller.renderLatexText(latex); + if (this.__controller.blurred) this.__controller.cursor.hide().parent.blur(); + var _this = this; // just to help help TS out + return _this; + } + return this.__controller.exportLatex(); + }; + return TextField; + })(APIClasses.EditableField)), + (_c.RootBlock = RootTextBlock), + _c + ); + }; + /************************************ + * Symbols for Advanced Mathematics + ***********************************/ + LatexCmds.notin = LatexCmds.cong = LatexCmds.equiv = LatexCmds.oplus = LatexCmds.otimes = function (latex) { + return new BinaryOperator('\\' + latex + ' ', h.entityText('&' + latex + ';')); + }; + LatexCmds['\u2217'] = LatexCmds.ast = LatexCmds.star = LatexCmds.loast = LatexCmds.lowast = bindBinaryOperator( + '\\ast ', + '∗', + 'low asterisk' + ); + LatexCmds.therefor = LatexCmds.therefore = bindBinaryOperator('\\therefore ', '∴', 'therefore'); + LatexCmds.cuz = LatexCmds.because = bindBinaryOperator( + // l33t + '\\because ', + '∵', + 'because' + ); + LatexCmds.prop = LatexCmds.propto = bindBinaryOperator('\\propto ', '∝', 'proportional to'); + LatexCmds['\u2248'] = LatexCmds.asymp = LatexCmds.approx = bindBinaryOperator( + '\\approx ', + '≈', + 'approximately equal to' + ); + LatexCmds.isin = LatexCmds['in'] = bindBinaryOperator('\\in ', '∈', 'is in'); + LatexCmds.ni = LatexCmds.contains = bindBinaryOperator('\\ni ', '∋', 'is not in'); + LatexCmds.notni = LatexCmds.niton = LatexCmds.notcontains = LatexCmds.doesnotcontain = bindBinaryOperator( + '\\not\\ni ', + '∌', + 'does not contain' + ); + LatexCmds.sub = LatexCmds.subset = bindBinaryOperator('\\subset ', '⊂', 'subset'); + LatexCmds.sup = LatexCmds.supset = LatexCmds.superset = bindBinaryOperator('\\supset ', '⊃', 'superset'); + LatexCmds.nsub = LatexCmds.notsub = LatexCmds.nsubset = LatexCmds.notsubset = bindBinaryOperator( + '\\not\\subset ', + '⊄', + 'not a subset' + ); + LatexCmds.nsup = LatexCmds.notsup = LatexCmds.nsupset = LatexCmds.notsupset = LatexCmds.nsuperset = LatexCmds.notsuperset = bindBinaryOperator( + '\\not\\supset ', + '⊅', + 'not a superset' + ); + LatexCmds.sube = LatexCmds.subeq = LatexCmds.subsete = LatexCmds.subseteq = bindBinaryOperator( + '\\subseteq ', + '⊆', + 'subset or equal to' + ); + LatexCmds.supe = LatexCmds.supeq = LatexCmds.supsete = LatexCmds.supseteq = LatexCmds.supersete = LatexCmds.superseteq = bindBinaryOperator( + '\\supseteq ', + '⊇', + 'superset or equal to' + ); + LatexCmds.nsube = LatexCmds.nsubeq = LatexCmds.notsube = LatexCmds.notsubeq = LatexCmds.nsubsete = LatexCmds.nsubseteq = LatexCmds.notsubsete = LatexCmds.notsubseteq = bindBinaryOperator( + '\\not\\subseteq ', + '⊈', + 'not subset or equal to' + ); + LatexCmds.nsupe = LatexCmds.nsupeq = LatexCmds.notsupe = LatexCmds.notsupeq = LatexCmds.nsupsete = LatexCmds.nsupseteq = LatexCmds.notsupsete = LatexCmds.notsupseteq = LatexCmds.nsupersete = LatexCmds.nsuperseteq = LatexCmds.notsupersete = LatexCmds.notsuperseteq = bindBinaryOperator( + '\\not\\supseteq ', + '⊉', + 'not superset or equal to' + ); + //the canonical sets of numbers + LatexCmds.mathbb = /** @class */ (function (_super) { + __extends(class_3, _super); + function class_3() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + class_3.prototype.createLeftOf = function (_cursor) {}; + class_3.prototype.numBlocks = function () { + return 1; + }; + class_3.prototype.parser = function () { + var string = Parser.string; + var regex = Parser.regex; + var optWhitespace = Parser.optWhitespace; + return optWhitespace + .then(string('{')) + .then(optWhitespace) + .then(regex(/^[NPZQRCH]/)) + .skip(optWhitespace) + .skip(string('}')) + .map(function (c) { + // instantiate the class for the matching char + var cmd = LatexCmds[c]; + if (isMQNodeClass(cmd)) { + return new cmd(); + } else { + return cmd(); + } + }); + }; + return class_3; + })(MathCommand); + LatexCmds.N = LatexCmds.naturals = LatexCmds.Naturals = bindVanillaSymbol('\\mathbb{N}', 'ℕ', 'naturals'); + LatexCmds.P = LatexCmds.primes = LatexCmds.Primes = LatexCmds.projective = LatexCmds.Projective = LatexCmds.probability = LatexCmds.Probability = bindVanillaSymbol( + '\\mathbb{P}', + 'ℙ', + 'P' + ); + LatexCmds.Z = LatexCmds.integers = LatexCmds.Integers = bindVanillaSymbol('\\mathbb{Z}', 'ℤ', 'integers'); + LatexCmds.Q = LatexCmds.rationals = LatexCmds.Rationals = bindVanillaSymbol( + '\\mathbb{Q}', + 'ℚ', + 'rationals' + ); + LatexCmds.R = LatexCmds.reals = LatexCmds.Reals = bindVanillaSymbol('\\mathbb{R}', 'ℝ', 'reals'); + LatexCmds.C = LatexCmds.complex = LatexCmds.Complex = LatexCmds.complexes = LatexCmds.Complexes = LatexCmds.complexplane = LatexCmds.Complexplane = LatexCmds.ComplexPlane = bindVanillaSymbol( + '\\mathbb{C}', + 'ℂ', + 'complexes' + ); + LatexCmds.H = LatexCmds.Hamiltonian = LatexCmds.quaternions = LatexCmds.Quaternions = bindVanillaSymbol( + '\\mathbb{H}', + 'ℍ', + 'quaternions' + ); + //spacing + LatexCmds.quad = LatexCmds.emsp = bindVanillaSymbol('\\quad ', ' ', '4 spaces'); + LatexCmds.qquad = bindVanillaSymbol('\\qquad ', ' ', '8 spaces'); + /* spacing special characters, gonna have to implement this in LatexCommandInput::onText somehow + case ',': + return VanillaSymbol('\\, ',' ', 'comma'); + case ':': + return VanillaSymbol('\\: ',' ', 'colon'); + case ';': + return VanillaSymbol('\\; ',' ', 'semicolon'); + case '!': + return MQSymbol('\\! ','', 'exclamation point'); + */ + //binary operators + LatexCmds.diamond = bindVanillaSymbol('\\diamond ', '◇', 'diamond'); + LatexCmds.bigtriangleup = bindVanillaSymbol('\\bigtriangleup ', '△', 'triangle up'); + LatexCmds.ominus = bindVanillaSymbol('\\ominus ', '⊖', 'o minus'); + LatexCmds.uplus = bindVanillaSymbol('\\uplus ', '⊎', 'disjoint union'); + LatexCmds.bigtriangledown = bindVanillaSymbol('\\bigtriangledown ', '▽', 'triangle down'); + LatexCmds.sqcap = bindVanillaSymbol('\\sqcap ', '⊓', 'greatest lower bound'); + LatexCmds.triangleleft = bindVanillaSymbol('\\triangleleft ', '⊲', 'triangle left'); + LatexCmds.sqcup = bindVanillaSymbol('\\sqcup ', '⊔', 'least upper bound'); + LatexCmds.triangleright = bindVanillaSymbol('\\triangleright ', '⊳', 'triangle right'); + //circledot is not a not real LaTex command see https://github.com/mathquill/mathquill/pull/552 for more details + LatexCmds.odot = LatexCmds.circledot = bindVanillaSymbol('\\odot ', '⊙', 'circle dot'); + LatexCmds.bigcirc = bindVanillaSymbol('\\bigcirc ', '◯', 'circle'); + LatexCmds.dagger = bindVanillaSymbol('\\dagger ', '†', 'dagger'); + LatexCmds.ddagger = bindVanillaSymbol('\\ddagger ', '‡', 'big dagger'); + LatexCmds.wr = bindVanillaSymbol('\\wr ', '≀', 'wreath'); + LatexCmds.amalg = bindVanillaSymbol('\\amalg ', '∐', 'amalgam'); + //relationship symbols + LatexCmds.models = bindVanillaSymbol('\\models ', '⊨', 'models'); + LatexCmds.prec = bindVanillaSymbol('\\prec ', '≺', 'precedes'); + LatexCmds.succ = bindVanillaSymbol('\\succ ', '≻', 'succeeds'); + LatexCmds.preceq = bindVanillaSymbol('\\preceq ', '≼', 'precedes or equals'); + LatexCmds.succeq = bindVanillaSymbol('\\succeq ', '≽', 'succeeds or equals'); + LatexCmds.simeq = bindVanillaSymbol('\\simeq ', '≃', 'similar or equal to'); + LatexCmds.mid = bindVanillaSymbol('\\mid ', '∣', 'divides'); + LatexCmds.ll = bindVanillaSymbol('\\ll ', '≪', 'll'); + LatexCmds.gg = bindVanillaSymbol('\\gg ', '≫', 'gg'); + LatexCmds.parallel = bindVanillaSymbol('\\parallel ', '∥', 'parallel with'); + LatexCmds.nparallel = bindVanillaSymbol('\\nparallel ', '∦', 'not parallel with'); + LatexCmds.bowtie = bindVanillaSymbol('\\bowtie ', '⋈', 'bowtie'); + LatexCmds.sqsubset = bindVanillaSymbol('\\sqsubset ', '⊏', 'square subset'); + LatexCmds.sqsupset = bindVanillaSymbol('\\sqsupset ', '⊐', 'square superset'); + LatexCmds.smile = bindVanillaSymbol('\\smile ', '⌣', 'smile'); + LatexCmds.sqsubseteq = bindVanillaSymbol('\\sqsubseteq ', '⊑', 'square subset or equal to'); + LatexCmds.sqsupseteq = bindVanillaSymbol('\\sqsupseteq ', '⊒', 'square superset or equal to'); + LatexCmds.doteq = bindVanillaSymbol('\\doteq ', '≐', 'dotted equals'); + LatexCmds.frown = bindVanillaSymbol('\\frown ', '⌢', 'frown'); + LatexCmds.vdash = bindVanillaSymbol('\\vdash ', '⊦', 'v dash'); + LatexCmds.dashv = bindVanillaSymbol('\\dashv ', '⊣', 'dash v'); + LatexCmds.nless = bindVanillaSymbol('\\nless ', '≮', 'not less than'); + LatexCmds.ngtr = bindVanillaSymbol('\\ngtr ', '≯', 'not greater than'); + //arrows + LatexCmds.longleftarrow = bindVanillaSymbol('\\longleftarrow ', '←', 'left arrow'); + LatexCmds.longrightarrow = bindVanillaSymbol('\\longrightarrow ', '→', 'right arrow'); + LatexCmds.Longleftarrow = bindVanillaSymbol('\\Longleftarrow ', '⇐', 'left arrow'); + LatexCmds.Longrightarrow = bindVanillaSymbol('\\Longrightarrow ', '⇒', 'right arrow'); + LatexCmds.longleftrightarrow = bindVanillaSymbol('\\longleftrightarrow ', '↔', 'left and right arrow'); + LatexCmds.updownarrow = bindVanillaSymbol('\\updownarrow ', '↕', 'up and down arrow'); + LatexCmds.Longleftrightarrow = bindVanillaSymbol('\\Longleftrightarrow ', '⇔', 'left and right arrow'); + LatexCmds.Updownarrow = bindVanillaSymbol('\\Updownarrow ', '⇕', 'up and down arrow'); + LatexCmds.mapsto = bindVanillaSymbol('\\mapsto ', '↦', 'maps to'); + LatexCmds.nearrow = bindVanillaSymbol('\\nearrow ', '↗', 'northeast arrow'); + LatexCmds.hookleftarrow = bindVanillaSymbol('\\hookleftarrow ', '↩', 'hook left arrow'); + LatexCmds.hookrightarrow = bindVanillaSymbol('\\hookrightarrow ', '↪', 'hook right arrow'); + LatexCmds.searrow = bindVanillaSymbol('\\searrow ', '↘', 'southeast arrow'); + LatexCmds.leftharpoonup = bindVanillaSymbol('\\leftharpoonup ', '↼', 'left harpoon up'); + LatexCmds.rightharpoonup = bindVanillaSymbol('\\rightharpoonup ', '⇀', 'right harpoon up'); + LatexCmds.swarrow = bindVanillaSymbol('\\swarrow ', '↙', 'southwest arrow'); + LatexCmds.leftharpoondown = bindVanillaSymbol('\\leftharpoondown ', '↽', 'left harpoon down'); + LatexCmds.rightharpoondown = bindVanillaSymbol('\\rightharpoondown ', '⇁', 'right harpoon down'); + LatexCmds.nwarrow = bindVanillaSymbol('\\nwarrow ', '↖', 'northwest arrow'); + //Misc + LatexCmds.ldots = bindVanillaSymbol('\\ldots ', '…', 'l dots'); + LatexCmds.cdots = bindVanillaSymbol('\\cdots ', '⋯', 'c dots'); + LatexCmds.vdots = bindVanillaSymbol('\\vdots ', '⋮', 'v dots'); + LatexCmds.ddots = bindVanillaSymbol('\\ddots ', '⋱', 'd dots'); + LatexCmds.surd = bindVanillaSymbol('\\surd ', '√', 'unresolved root'); + LatexCmds.triangle = bindVanillaSymbol('\\triangle ', '△', 'triangle'); + LatexCmds.ell = bindVanillaSymbol('\\ell ', 'ℓ', 'ell'); + LatexCmds.top = bindVanillaSymbol('\\top ', '⊤', 'top'); + LatexCmds.flat = bindVanillaSymbol('\\flat ', '♭', 'flat'); + LatexCmds.natural = bindVanillaSymbol('\\natural ', '♮', 'natural'); + LatexCmds.sharp = bindVanillaSymbol('\\sharp ', '♯', 'sharp'); + LatexCmds.wp = bindVanillaSymbol('\\wp ', '℘', 'wp'); + LatexCmds.bot = bindVanillaSymbol('\\bot ', '⊥', 'bot'); + LatexCmds.clubsuit = bindVanillaSymbol('\\clubsuit ', '♣', 'club suit'); + LatexCmds.diamondsuit = bindVanillaSymbol('\\diamondsuit ', '♢', 'diamond suit'); + LatexCmds.heartsuit = bindVanillaSymbol('\\heartsuit ', '♡', 'heart suit'); + LatexCmds.spadesuit = bindVanillaSymbol('\\spadesuit ', '♠', 'spade suit'); + //not real LaTex command see https://github.com/mathquill/mathquill/pull/552 for more details + LatexCmds.parallelogram = bindVanillaSymbol('\\parallelogram ', '▱', 'parallelogram'); + LatexCmds.square = bindVanillaSymbol('\\square ', '⬜', 'square'); + //variable-sized + LatexCmds.oint = bindVanillaSymbol('\\oint ', '∮', 'o int'); + LatexCmds.bigcap = bindVanillaSymbol('\\bigcap ', '∩', 'big cap'); + LatexCmds.bigcup = bindVanillaSymbol('\\bigcup ', '∪', 'big cup'); + LatexCmds.bigsqcup = bindVanillaSymbol('\\bigsqcup ', '⊔', 'big square cup'); + LatexCmds.bigvee = bindVanillaSymbol('\\bigvee ', '∨', 'big vee'); + LatexCmds.bigwedge = bindVanillaSymbol('\\bigwedge ', '∧', 'big wedge'); + LatexCmds.bigodot = bindVanillaSymbol('\\bigodot ', '⊙', 'big o dot'); + LatexCmds.bigotimes = bindVanillaSymbol('\\bigotimes ', '⊗', 'big o times'); + LatexCmds.bigoplus = bindVanillaSymbol('\\bigoplus ', '⊕', 'big o plus'); + LatexCmds.biguplus = bindVanillaSymbol('\\biguplus ', '⊎', 'big u plus'); + //delimiters + LatexCmds.lfloor = bindVanillaSymbol('\\lfloor ', '⌊', 'left floor'); + LatexCmds.rfloor = bindVanillaSymbol('\\rfloor ', '⌋', 'right floor'); + LatexCmds.lceil = bindVanillaSymbol('\\lceil ', '⌈', 'left ceiling'); + LatexCmds.rceil = bindVanillaSymbol('\\rceil ', '⌉', 'right ceiling'); + LatexCmds.opencurlybrace = LatexCmds.lbrace = bindVanillaSymbol('\\lbrace ', '{', 'left brace'); + LatexCmds.closecurlybrace = LatexCmds.rbrace = bindVanillaSymbol('\\rbrace ', '}', 'right brace'); + LatexCmds.lbrack = bindVanillaSymbol('[', 'left bracket'); + LatexCmds.rbrack = bindVanillaSymbol(']', 'right bracket'); + //various symbols + LatexCmds.slash = bindVanillaSymbol('/', 'slash'); + LatexCmds.vert = bindVanillaSymbol('|', 'vertical bar'); + LatexCmds.perp = LatexCmds.perpendicular = bindVanillaSymbol('\\perp ', '⊥', 'perpendicular'); + LatexCmds.nabla = LatexCmds.del = bindVanillaSymbol('\\nabla ', '∇'); + LatexCmds.hbar = bindVanillaSymbol('\\hbar ', 'ℏ', 'horizontal bar'); + LatexCmds.AA = LatexCmds.Angstrom = LatexCmds.angstrom = bindVanillaSymbol('\\text\\AA ', 'Å', 'AA'); + LatexCmds.ring = LatexCmds.circ = LatexCmds.circle = bindVanillaSymbol('\\circ ', '∘', 'circle'); + LatexCmds.bull = LatexCmds.bullet = bindVanillaSymbol('\\bullet ', '•', 'bullet'); + LatexCmds.setminus = LatexCmds.smallsetminus = bindVanillaSymbol('\\setminus ', '∖', 'set minus'); + LatexCmds.not = LatexCmds['\u00ac'] = LatexCmds.neg = bindVanillaSymbol('\\neg ', '¬', 'not'); //bind(MQSymbol,'\\not ','/', 'not'); + LatexCmds[ + '\u2026' + ] = LatexCmds.dots = LatexCmds.ellip = LatexCmds.hellip = LatexCmds.ellipsis = LatexCmds.hellipsis = bindVanillaSymbol( + '\\dots ', + '…', + 'ellipsis' + ); + LatexCmds.converges = LatexCmds.darr = LatexCmds.dnarr = LatexCmds.dnarrow = LatexCmds.downarrow = bindVanillaSymbol( + '\\downarrow ', + '↓', + 'converges with' + ); + LatexCmds.dArr = LatexCmds.dnArr = LatexCmds.dnArrow = LatexCmds.Downarrow = bindVanillaSymbol( + '\\Downarrow ', + '⇓', + 'down arrow' + ); + LatexCmds.diverges = LatexCmds.uarr = LatexCmds.uparrow = bindVanillaSymbol( + '\\uparrow ', + '↑', + 'diverges from' + ); + LatexCmds.uArr = LatexCmds.Uparrow = bindVanillaSymbol('\\Uparrow ', '⇑', 'up arrow'); + LatexCmds.rarr = LatexCmds.rightarrow = bindVanillaSymbol('\\rightarrow ', '→', 'right arrow'); + LatexCmds.implies = bindBinaryOperator('\\Rightarrow ', '⇒', 'implies'); + LatexCmds.rArr = LatexCmds.Rightarrow = bindVanillaSymbol('\\Rightarrow ', '⇒', 'right arrow'); + LatexCmds.gets = bindBinaryOperator('\\gets ', '←', 'gets'); + LatexCmds.larr = LatexCmds.leftarrow = bindVanillaSymbol('\\leftarrow ', '←', 'left arrow'); + LatexCmds.impliedby = bindBinaryOperator('\\Leftarrow ', '⇐', 'implied by'); + LatexCmds.lArr = LatexCmds.Leftarrow = bindVanillaSymbol('\\Leftarrow ', '⇐', 'left arrow'); + LatexCmds.harr = LatexCmds.lrarr = LatexCmds.leftrightarrow = bindVanillaSymbol( + '\\leftrightarrow ', + '↔', + 'left and right arrow' + ); + LatexCmds.iff = bindBinaryOperator('\\Leftrightarrow ', '⇔', 'if and only if'); + LatexCmds.hArr = LatexCmds.lrArr = LatexCmds.Leftrightarrow = bindVanillaSymbol( + '\\Leftrightarrow ', + '⇔', + 'left and right arrow' + ); + LatexCmds.Re = LatexCmds.Real = LatexCmds.real = bindVanillaSymbol('\\Re ', 'ℜ', 'real'); + LatexCmds.Im = LatexCmds.imag = LatexCmds.image = LatexCmds.imagin = LatexCmds.imaginary = LatexCmds.Imaginary = bindVanillaSymbol( + '\\Im ', + 'ℑ', + 'imaginary' + ); + LatexCmds.part = LatexCmds.partial = bindVanillaSymbol('\\partial ', '∂', 'partial'); + LatexCmds.pounds = bindVanillaSymbol('\\pounds ', '£'); + LatexCmds.alef = LatexCmds.alefsym = LatexCmds.aleph = LatexCmds.alephsym = bindVanillaSymbol( + '\\aleph ', + 'ℵ', + 'alef sym' + ); + LatexCmds.xist = LatexCmds.xists = LatexCmds.exist = LatexCmds.exists = bindVanillaSymbol( //LOL + '\\exists ', + '∃', + 'there exists at least 1' + ); + LatexCmds.nexists = LatexCmds.nexist = bindVanillaSymbol('\\nexists ', '∄', 'there is no'); + LatexCmds.and = LatexCmds.land = LatexCmds.wedge = bindBinaryOperator('\\wedge ', '∧', 'and'); + LatexCmds.or = LatexCmds.lor = LatexCmds.vee = bindBinaryOperator('\\vee ', '∨', 'or'); + LatexCmds.o = LatexCmds.O = LatexCmds.empty = LatexCmds.emptyset = LatexCmds.oslash = LatexCmds.Oslash = LatexCmds.nothing = LatexCmds.varnothing = bindBinaryOperator( + '\\varnothing ', + '∅', + 'nothing' + ); + LatexCmds.cup = LatexCmds.union = bindBinaryOperator('\\cup ', '∪', 'union'); + LatexCmds.cap = LatexCmds.intersect = LatexCmds.intersection = bindBinaryOperator( + '\\cap ', + '∩', + 'intersection' + ); + // FIXME: the correct LaTeX would be ^\circ but we can't parse that + LatexCmds.deg = LatexCmds.degree = bindVanillaSymbol('\\degree ', '°', 'degrees'); + LatexCmds.ang = LatexCmds.angle = bindVanillaSymbol('\\angle ', '∠', 'angle'); + LatexCmds.measuredangle = bindVanillaSymbol('\\measuredangle ', '∡', 'measured angle'); + /********************************* + * Symbols for Basic Mathematics + ********************************/ + var DigitGroupingChar = /** @class */ (function (_super) { + __extends(DigitGroupingChar, _super); + function DigitGroupingChar() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + DigitGroupingChar.prototype.finalizeTree = function (opts, dir) { + this.sharedSiblingMethod(opts, dir); + }; + DigitGroupingChar.prototype.siblingDeleted = function (opts, dir) { + this.sharedSiblingMethod(opts, dir); + }; + DigitGroupingChar.prototype.siblingCreated = function (opts, dir) { + this.sharedSiblingMethod(opts, dir); + }; + DigitGroupingChar.prototype.sharedSiblingMethod = function (opts, dir) { + // don't try to fix digit grouping if the sibling to my right changed (dir === R or + // undefined) and it's now a DigitGroupingChar, it will try to fix grouping + if (dir !== L && this[R] instanceof DigitGroupingChar) return; + this.fixDigitGrouping(opts); + }; + DigitGroupingChar.prototype.fixDigitGrouping = function (opts) { + if (!opts.enableDigitGrouping) return; + var left = this; + var right = this; + var spacesFound = 0; + var dots = []; + var SPACE = '\\ '; + var DOT = '.'; + // traverse left as far as possible (starting at this char) + var node = left; + do { + if (/^[0-9]$/.test(node.ctrlSeq)) { + left = node; + } else if (node.ctrlSeq === SPACE) { + left = node; + spacesFound += 1; + } else if (node.ctrlSeq === DOT) { + left = node; + dots.push(node); + } else { + break; + } + } while ((node = left[L])); + // traverse right as far as possible (starting to right of this char) + while ((node = right[R])) { + if (/^[0-9]$/.test(node.ctrlSeq)) { + right = node; + } else if (node.ctrlSeq === SPACE) { + right = node; + spacesFound += 1; + } else if (node.ctrlSeq === DOT) { + right = node; + dots.push(node); + } else { + break; + } + } + // trim the leading spaces + while (right !== left && left && left.ctrlSeq === SPACE) { + left = left[R]; + spacesFound -= 1; + } + // trim the trailing spaces + while (right !== left && right && right.ctrlSeq === SPACE) { + right = right[L]; + spacesFound -= 1; + } + // happens when you only have a space + if (left === right && left && left.ctrlSeq === SPACE) return; + var disableFormatting = spacesFound > 0 || dots.length > 1; + if (disableFormatting) { + this.removeGroupingBetween(left, right); + } else if (dots[0]) { + if (dots[0] !== left) { + this.addGroupingBetween(dots[0][L], left); + } + if (dots[0] !== right) { + // we do not show grouping to the right of a decimal place #yet + this.removeGroupingBetween(dots[0][R], right); + } + } else { + this.addGroupingBetween(right, left); + } + }; + DigitGroupingChar.prototype.removeGroupingBetween = function (left, right) { + var node = left; + do { + if (node instanceof DigitGroupingChar) { + node.setGroupingClass(undefined); + } + if (!node || node === right) break; + } while ((node = node[R])); + }; + DigitGroupingChar.prototype.addGroupingBetween = function (start, end) { + var node = start; + var count = 0; + var totalDigits = 0; + var node = start; + while (node) { + totalDigits += 1; + if (node === end) break; + node = node[L]; + } + var numDigitsInFirstGroup = totalDigits % 3; + if (numDigitsInFirstGroup === 0) numDigitsInFirstGroup = 3; + var node = start; + while (node) { + count += 1; + var cls = undefined; + // only do grouping if we have at least 4 numbers + if (totalDigits >= 4) { + if (count === totalDigits) { + cls = 'dcg-mq-group-leading-' + numDigitsInFirstGroup; + } else if (count % 3 === 0) { + if (count !== totalDigits) { + cls = 'dcg-mq-group-start'; + } + } + if (!cls) { + cls = 'dcg-mq-group-other'; + } + } + if (node instanceof DigitGroupingChar) { + node.setGroupingClass(cls); + } + if (node === end) break; + node = node[L]; + } + }; + DigitGroupingChar.prototype.setGroupingClass = function (cls) { + // nothing changed (either class is the same or it's still undefined) + if (this._groupingClass === cls) return; + // remove existing class + if (this._groupingClass) this.domFrag().removeClass(this._groupingClass); + // add new class + if (cls) this.domFrag().addClass(cls); + // cache the groupingClass + this._groupingClass = cls; + }; + return DigitGroupingChar; + })(MQSymbol); + var Digit = /** @class */ (function (_super) { + __extends(Digit, _super); + function Digit(ch, mathspeak) { + return ( + _super.call(this, ch, h('span', { class: 'dcg-mq-digit' }, [h.text(ch)]), undefined, mathspeak) || + this + ); + } + Digit.prototype.createLeftOf = function (cursor) { + var cursorL = cursor[L]; + var cursorLL = cursorL && cursorL[L]; + var cursorParentParentSub = + cursor.parent.parent instanceof SupSub ? cursor.parent.parent.sub : undefined; + if ( + cursor.options.autoSubscriptNumerals && + cursor.parent !== cursorParentParentSub && + ((cursorL instanceof Variable && cursorL.isItalic !== false) || + (cursorL instanceof SupSub && cursorLL instanceof Variable && cursorLL.isItalic !== false)) + ) { + new SubscriptCommand().createLeftOf(cursor); + _super.prototype.createLeftOf.call(this, cursor); + cursor.insRightOf(cursor.parent.parent); + } else _super.prototype.createLeftOf.call(this, cursor); + }; + Digit.prototype.mathspeak = function (opts) { + if (opts && opts.createdLeftOf) { + var cursor = opts.createdLeftOf; + var cursorL = cursor[L]; + var cursorLL = cursorL && cursorL[L]; + var cursorParentParentSub = + cursor.parent.parent instanceof SupSub ? cursor.parent.parent.sub : undefined; + if ( + cursor.options.autoSubscriptNumerals && + cursor.parent !== cursorParentParentSub && + ((cursorL instanceof Variable && cursorL.isItalic !== false) || + (cursor[L] instanceof SupSub && + cursorLL instanceof Variable && + cursorLL.isItalic !== false)) + ) { + return 'Subscript ' + _super.prototype.mathspeak.call(this) + ' Baseline'; + } + } + return _super.prototype.mathspeak.call(this); + }; + return Digit; + })(DigitGroupingChar); + var Variable = /** @class */ (function (_super) { + __extends(Variable, _super); + function Variable(chOrCtrlSeq, html) { + return _super.call(this, chOrCtrlSeq, h('var', {}, [html || h.text(chOrCtrlSeq)])) || this; + } + Variable.prototype.text = function () { + var text = this.ctrlSeq || ''; + if (this.isPartOfOperator) { + if (text[0] == '\\') { + text = text.slice(1, text.length); + } else if (text[text.length - 1] == ' ') { + text = text.slice(0, -1); + } + } else { + if ( + this[L] && + !(this[L] instanceof Variable) && + !(this[L] instanceof BinaryOperator) && + this[L].ctrlSeq !== '\\ ' + ) + text = '*' + text; + if (this[R] && !(this[R] instanceof BinaryOperator) && !(this[R] instanceof SupSub)) text += '*'; + } + return text; + }; + Variable.prototype.mathspeak = function () { + var text = this.ctrlSeq || ''; + if ( + this.isPartOfOperator || + text.length > 1 || + (this.parent && this.parent.parent && this.parent.parent.isTextBlock()) + ) { + return _super.prototype.mathspeak.call(this); + } else { + // Apple voices in VoiceOver (such as Alex, Bruce, and Victoria) do + // some strange pronunciation given certain expressions, + // e.g. "y-2" is spoken as "ee minus 2" (as if the y is short). + // Not an ideal solution, but surrounding non-numeric text blocks with quotation marks works. + // This bug has been acknowledged by Apple. + return '"' + text + '"'; + } + }; + return Variable; + })(MQSymbol); + function bindVariable(ch, htmlEntity, _unusedMathspeak) { + return function () { + return new Variable(ch, h.entityText(htmlEntity)); + }; + } + Options.prototype.autoCommands = { + _maxLength: 0, + }; + baseOptionProcessors.autoCommands = function (cmds) { + if (typeof cmds !== 'string' || !/^[a-z]+(?: [a-z]+)*$/i.test(cmds)) { + throw '"' + cmds + '" not a space-delimited list of only letters'; + } + var list = cmds.split(' '); + var dict = {}; + var maxLength = 0; + for (var i = 0; i < list.length; i += 1) { + var cmd = list[i]; + if (cmd.length < 2) { + throw 'autocommand "' + cmd + '" not minimum length of 2'; + } + if (LatexCmds[cmd] === OperatorName) { + throw '"' + cmd + '" is a built-in operator name'; + } + dict[cmd] = 1; + maxLength = max(maxLength, cmd.length); + } + dict._maxLength = maxLength; + return dict; + }; + Options.prototype.quietEmptyDelimiters = {}; + baseOptionProcessors.quietEmptyDelimiters = function (dlms) { + if (dlms === void 0) { + dlms = ''; + } + var list = dlms.split(' '); + var dict = {}; + for (var i = 0; i < list.length; i += 1) { + var dlm = list[i]; + dict[dlm] = 1; + } + return dict; + }; + Options.prototype.autoParenthesizedFunctions = { _maxLength: 0 }; + baseOptionProcessors.autoParenthesizedFunctions = function (cmds) { + if (typeof cmds !== 'string' || !/^[a-z]+(?: [a-z]+)*$/i.test(cmds)) { + throw '"' + cmds + '" not a space-delimited list of only letters'; + } + var list = cmds.split(' '); + var dict = {}; + var maxLength = 0; + for (var i = 0; i < list.length; i += 1) { + var cmd = list[i]; + if (cmd.length < 2) { + throw 'autocommand "' + cmd + '" not minimum length of 2'; + } + dict[cmd] = 1; + maxLength = max(maxLength, cmd.length); + } + dict._maxLength = maxLength; + return dict; + }; + var Letter = /** @class */ (function (_super) { + __extends(Letter, _super); + function Letter(ch) { + var _this_1 = _super.call(this, ch) || this; + _this_1.letter = ch; + return _this_1; + } + Letter.prototype.checkAutoCmds = function (cursor) { + //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. + if (this.shouldIgnoreSubstitutionInSimpleSubscript(cursor.options)) { + return; + } + //handle autoCommands + var autoCmds = cursor.options.autoCommands; + var maxLength = autoCmds._maxLength || 0; + if (maxLength > 0) { + // want longest possible autocommand, so join together longest + // sequence of letters + var str = ''; + var l = this; + var i = 0; + // FIXME: l.ctrlSeq === l.letter checks if first or last in an operator name + while (l instanceof Letter && l.ctrlSeq === l.letter && i < maxLength) { + str = l.letter + str; + l = l[L]; + i += 1; + } + // check for an autocommand, going thru substrings longest to shortest + while (str.length) { + if (autoCmds.hasOwnProperty(str)) { + l = this; + for (i = 1; l && i < str.length; i += 1, l = l[L]); + new Fragment(l, this).remove(); + cursor[L] = l[L]; + var cmd = LatexCmds[str]; + var node; + if (isMQNodeClass(cmd)) { + node = new cmd(str); // TODO - How do we know that this class expects a single str input? + } else { + node = cmd(str); + } + return node.createLeftOf(cursor); + } + str = str.slice(1); + } + } + }; + Letter.prototype.autoParenthesize = function (cursor) { + //exit early if already parenthesized + var right = cursor.parent.getEnd(R); + if (right && right instanceof Bracket && right.ctrlSeq === '\\left(') { + return; + } + //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. + if (this.shouldIgnoreSubstitutionInSimpleSubscript(cursor.options)) { + return; + } + //handle autoParenthesized functions + var str = ''; + var l = this; + var i = 0; + var autoParenthesizedFunctions = cursor.options.autoParenthesizedFunctions; + var maxLength = autoParenthesizedFunctions._maxLength || 0; + var autoOperatorNames = cursor.options.autoOperatorNames; + while (l instanceof Letter && i < maxLength) { + (str = l.letter + str), (l = l[L]), (i += 1); + } + // check for an autoParenthesized functions, going thru substrings longest to shortest + // only allow autoParenthesized functions that are also autoOperatorNames + while (str.length) { + if (autoParenthesizedFunctions.hasOwnProperty(str) && autoOperatorNames.hasOwnProperty(str)) { + return cursor.parent.write(cursor, '('); + } + str = str.slice(1); + } + }; + Letter.prototype.createLeftOf = function (cursor) { + _super.prototype.createLeftOf.call(this, cursor); + this.checkAutoCmds(cursor); + this.autoParenthesize(cursor); + }; + Letter.prototype.italicize = function (bool) { + this.isItalic = bool; + this.isPartOfOperator = !bool; + this.domFrag().toggleClass('dcg-mq-operator-name', !bool); + return this; + }; + Letter.prototype.finalizeTree = function (opts, dir) { + this.sharedSiblingMethod(opts, dir); + }; + Letter.prototype.siblingDeleted = function (opts, dir) { + this.sharedSiblingMethod(opts, dir); + }; + Letter.prototype.siblingCreated = function (opts, dir) { + this.sharedSiblingMethod(opts, dir); + }; + Letter.prototype.sharedSiblingMethod = function (opts, dir) { + // don't auto-un-italicize if the sibling to my right changed (dir === R or + // undefined) and it's now a Letter, it will un-italicize everyone + if (dir !== L && this[R] instanceof Letter) return; + this.autoUnItalicize(opts); + }; + Letter.prototype.autoUnItalicize = function (opts) { + var autoOps = opts.autoOperatorNames; + if (autoOps._maxLength === 0) return; + //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. + if (this.shouldIgnoreSubstitutionInSimpleSubscript(opts)) { + return; + } + // want longest possible operator names, so join together entire contiguous + // sequence of letters + var str = this.letter; + for (var l = this[L]; l instanceof Letter; l = l[L]) str = l.letter + str; + for (var r = this[R]; r instanceof Letter; r = r[R]) str += r.letter; + // removeClass and delete flags from all letters before figuring out + // which, if any, are part of an operator name + var lR = l && l[R]; + var rL = r && r[L]; + new Fragment(lR || this.parent.getEnd(L), rL || this.parent.getEnd(R)).each(function (el) { + if (el instanceof Letter) { + el.italicize(true).domFrag().removeClass('dcg-mq-first dcg-mq-last dcg-mq-followed-by-supsub'); + el.ctrlSeq = el.letter; + } + return undefined; + }); + var autoOpsLength = autoOps._maxLength || 0; + // check for operator names: at each position from left to right, check + // substrings from longest to shortest + outer: for ( + var i = 0, first = l[R] || this.parent.getEnd(L); + first && i < str.length; + i += 1, first = first[R] + ) { + for (var len = min(autoOpsLength, str.length - i); len > 0; len -= 1) { + var word = str.slice(i, i + len); + var last = undefined; // TODO - TS complaining that we use last before assigning to it + if (autoOps.hasOwnProperty(word)) { + for (var j = 0, letter = first; j < len; j += 1, letter = letter[R]) { + if (letter instanceof Letter) { + letter.italicize(false); + last = letter; + } + } + var isBuiltIn = BuiltInOpNames.hasOwnProperty(word); + first.ctrlSeq = (isBuiltIn ? '\\' : '\\operatorname{') + first.ctrlSeq; + last.ctrlSeq += isBuiltIn ? ' ' : '}'; + if (TwoWordOpNames.hasOwnProperty(word)) { + var lastL = last[L]; + var lastLL = lastL && lastL[L]; + var lastLLL = lastLL && lastLL[L]; + lastLLL.domFrag().addClass('dcg-mq-last'); + } + if (!this.shouldOmitPadding(first[L])) first.domFrag().addClass('dcg-mq-first'); + if (!this.shouldOmitPadding(last[R])) { + if (last[R] instanceof SupSub) { + var supsub = last[R]; // XXX monkey-patching, but what's the right thing here? + // Have operatorname-specific code in SupSub? A CSS-like language to style the + // math tree, but which ignores cursor and selection (which CSS can't)? + var respace = (supsub.siblingCreated = supsub.siblingDeleted = function () { + supsub + .domFrag() + .toggleClass('dcg-mq-after-operator-name', !(supsub[R] instanceof Bracket)); + }); + respace(); + } else { + last.domFrag().toggleClass('dcg-mq-last', !(last[R] instanceof Bracket)); + } + } + i += len - 1; + first = last; + continue outer; + } + } + } + }; + Letter.prototype.shouldOmitPadding = function (node) { + // omit padding if no node + if (!node) return true; + // do not add padding between letter and '.' + if (node.ctrlSeq === '.') return true; + // do not add padding between letter and binary operator. The + // binary operator already has padding + if (node instanceof BinaryOperator) return true; + if (node instanceof SummationNotation) return true; + return false; + }; + return Letter; + })(Variable); + var BuiltInOpNames = {}; // the set of operator names like \sin, \cos, etc that + // are built-into LaTeX, see Section 3.17 of the Short Math Guide: http://tinyurl.com/jm9okjc + // MathQuill auto-unitalicizes some operator names not in that set, like 'hcf' + // and 'arsinh', which must be exported as \operatorname{hcf} and + // \operatorname{arsinh}. Note: over/under line/arrow \lim variants like + // \varlimsup are not supported + // the set of operator names that MathQuill auto-unitalicizes by default; overridable + Options.prototype.autoOperatorNames = defaultAutoOpNames(); + var TwoWordOpNames = { limsup: 1, liminf: 1, projlim: 1, injlim: 1 }; + function defaultAutoOpNames() { + var AutoOpNames = { + _maxLength: 9, + }; + var mostOps = ( + 'arg deg det dim exp gcd hom inf ker lg lim ln log max min sup' + ' limsup liminf injlim projlim Pr' + ).split(' '); + for (var i = 0; i < mostOps.length; i += 1) { + BuiltInOpNames[mostOps[i]] = AutoOpNames[mostOps[i]] = 1; + } + var builtInTrigs = 'sin cos tan arcsin arccos arctan sinh cosh tanh sec csc cot coth'.split( + // why coth but not sech and csch, LaTeX? + ' ' + ); + for (var i = 0; i < builtInTrigs.length; i += 1) { + BuiltInOpNames[builtInTrigs[i]] = 1; + } + var autoTrigs = 'sin cos tan sec cosec csc cotan cot ctg'.split(' '); + for (var i = 0; i < autoTrigs.length; i += 1) { + AutoOpNames[autoTrigs[i]] = AutoOpNames['arc' + autoTrigs[i]] = AutoOpNames[ + autoTrigs[i] + 'h' + ] = AutoOpNames['ar' + autoTrigs[i] + 'h'] = AutoOpNames['arc' + autoTrigs[i] + 'h'] = 1; + } + // compat with some of the nonstandard LaTeX exported by MathQuill + // before #247. None of these are real LaTeX commands so, seems safe + var moreNonstandardOps = 'gcf hcf lcm proj span'.split(' '); + for (var i = 0; i < moreNonstandardOps.length; i += 1) { + AutoOpNames[moreNonstandardOps[i]] = 1; + } + return AutoOpNames; + } + baseOptionProcessors.autoOperatorNames = function (cmds) { + if (typeof cmds !== 'string') { + throw '"' + cmds + '" not a space-delimited list'; + } + if (!/^[a-z\|\-]+(?: [a-z\|\-]+)*$/i.test(cmds)) { + throw '"' + cmds + '" not a space-delimited list of letters or "|"'; + } + var list = cmds.split(' '); + var dict = {}; + var maxLength = 0; + for (var i = 0; i < list.length; i += 1) { + var cmd = list[i]; + if (cmd.length < 2) { + throw '"' + cmd + '" not minimum length of 2'; + } + if (cmd.indexOf('|') < 0) { + // normal auto operator + dict[cmd] = cmd; + maxLength = max(maxLength, cmd.length); + } else { + // this item has a speech-friendly alternative + var cmdArray = cmd.split('|'); + if (cmdArray.length > 2) { + throw '"' + cmd + '" has more than 1 mathspeak delimiter'; + } + if (cmdArray[0].length < 2) { + throw '"' + cmd[0] + '" not minimum length of 2'; + } + dict[cmdArray[0]] = cmdArray[1].replace(/-/g, ' '); // convert dashes to spaces for the sake of speech + maxLength = max(maxLength, cmdArray[0].length); + } + } + dict._maxLength = maxLength; + return dict; + }; + var OperatorName = /** @class */ (function (_super) { + __extends(OperatorName, _super); + function OperatorName(fn) { + return _super.call(this, fn || '') || this; + } + OperatorName.prototype.createLeftOf = function (cursor) { + var fn = this.ctrlSeq; + for (var i = 0; i < fn.length; i += 1) { + new Letter(fn.charAt(i)).createLeftOf(cursor); + } + }; + OperatorName.prototype.parser = function () { + var fn = this.ctrlSeq; + var block = new MathBlock(); + for (var i = 0; i < fn.length; i += 1) { + new Letter(fn.charAt(i)).adopt(block, block.getEnd(R), 0); + } + return Parser.succeed(block.children()); + }; + return OperatorName; + })(MQSymbol); + for (var fn in Options.prototype.autoOperatorNames) + if (Options.prototype.autoOperatorNames.hasOwnProperty(fn)) { + LatexCmds[fn] = OperatorName; + } + LatexCmds.operatorname = /** @class */ (function (_super) { + __extends(class_4, _super); + function class_4() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + class_4.prototype.createLeftOf = function () {}; + class_4.prototype.numBlocks = function () { + return 1; + }; + class_4.prototype.parser = function () { + return latexMathParser.block.map(function (b) { + // Check for the special case of \operatorname{ans}, which has + // a special html representation + var isAllLetters = true; + var str = ''; + var children = b.children(); + children.each(function (child) { + if (child instanceof Letter) { + str += child.letter; + } else { + isAllLetters = false; + } + return undefined; + }); + if (isAllLetters && str === 'ans') { + return AnsBuilder(); + } + // In cases other than `ans`, just return the children directly + return children; + }); + }; + return class_4; + })(MathCommand); + LatexCmds.f = /** @class */ (function (_super) { + __extends(class_5, _super); + function class_5() { + var _this_1 = this; + var letter = 'f'; + _this_1 = _super.call(this, letter) || this; + _this_1.letter = letter; + _this_1.domView = new DOMView(0, function () { + return h('var', { class: 'dcg-mq-f' }, [h.text('f')]); + }); + return _this_1; + } + class_5.prototype.italicize = function (bool) { + // Why is this necesssary? Does someone replace the `f` at some + // point? + this.domFrag().eachElement(function (el) { + return (el.textContent = 'f'); + }); + this.domFrag().toggleClass('dcg-mq-f', bool); + return _super.prototype.italicize.call(this, bool); + }; + return class_5; + })(Letter); + // VanillaSymbol's + LatexCmds[' '] = LatexCmds.space = function () { + return new DigitGroupingChar('\\ ', h('span', {}, [h.text(U_NO_BREAK_SPACE)]), ' '); + }; + LatexCmds['.'] = function () { + return new DigitGroupingChar('.', h('span', { class: 'dcg-mq-digit' }, [h.text('.')]), '.'); + }; + LatexCmds["'"] = LatexCmds.prime = bindVanillaSymbol("'", '′', 'prime'); + LatexCmds['\u2033'] = LatexCmds.dprime = bindVanillaSymbol('\u2033', '″', 'double prime'); + LatexCmds.backslash = bindVanillaSymbol('\\backslash ', '\\', 'backslash'); + if (!CharCmds['\\']) CharCmds['\\'] = LatexCmds.backslash; + LatexCmds.$ = bindVanillaSymbol('\\$', '$', 'dollar'); + LatexCmds.square = bindVanillaSymbol('\\square ', '\u25A1', 'square'); + LatexCmds.mid = bindVanillaSymbol('\\mid ', '\u2223', 'mid'); + // does not use Symbola font + var NonSymbolaSymbol = /** @class */ (function (_super) { + __extends(NonSymbolaSymbol, _super); + function NonSymbolaSymbol(ch, html, _unusedMathspeak) { + return _super.call(this, ch, h('span', { class: 'dcg-mq-nonSymbola' }, [html || h.text(ch)])) || this; + } + return NonSymbolaSymbol; + })(MQSymbol); + LatexCmds['@'] = function () { + return new NonSymbolaSymbol('@'); + }; + LatexCmds['&'] = function () { + return new NonSymbolaSymbol('\\&', h.entityText('&'), 'and'); + }; + LatexCmds['%'] = /** @class */ (function (_super) { + __extends(class_6, _super); + function class_6() { + return _super.call(this, '\\%', h.text('%'), 'percent') || this; + } + class_6.prototype.parser = function () { + var optWhitespace = Parser.optWhitespace; + var string = Parser.string; + // Parse `\%\operatorname{of}` as special `percentof` node so that + // it will be serialized properly and deleted as a unit. + return optWhitespace + .then( + string('\\operatorname{of}').map(function () { + return PercentOfBuilder(); + }) + ) + .or(_super.prototype.parser.call(this)); + }; + return class_6; + })(NonSymbolaSymbol); + LatexCmds['\u2225'] = LatexCmds.parallel = bindVanillaSymbol('\\parallel ', '∥', 'parallel'); + LatexCmds['\u2226'] = LatexCmds.nparallel = bindVanillaSymbol('\\nparallel ', '∦', 'not parallel'); + LatexCmds['\u27c2'] = LatexCmds.perp = bindVanillaSymbol('\\perp ', '⟂', 'perpendicular'); + //the following are all Greek to me, but this helped a lot: http://www.ams.org/STIX/ion/stixsig03.html + //lowercase Greek letter variables + LatexCmds.alpha = LatexCmds.beta = LatexCmds.gamma = LatexCmds.delta = LatexCmds.zeta = LatexCmds.eta = LatexCmds.theta = LatexCmds.iota = LatexCmds.kappa = LatexCmds.mu = LatexCmds.nu = LatexCmds.xi = LatexCmds.rho = LatexCmds.sigma = LatexCmds.tau = LatexCmds.chi = LatexCmds.psi = LatexCmds.omega = function ( + latex + ) { + return new Variable('\\' + latex + ' ', h.entityText('&' + latex + ';')); + }; + //why can't anybody FUCKING agree on these + LatexCmds.phi = bindVariable('\\phi ', 'ϕ', 'phi'); //W3C or Unicode? + LatexCmds.phiv = LatexCmds.varphi = bindVariable('\\varphi ', 'φ', 'phi'); //Elsevier and 9573-13 //AMS and LaTeX + LatexCmds.epsilon = bindVariable('\\epsilon ', 'ϵ', 'epsilon'); //W3C or Unicode? + LatexCmds.epsiv = LatexCmds.varepsilon = bindVariable( + //Elsevier and 9573-13 //AMS and LaTeX + '\\varepsilon ', + 'ε', + 'epsilon' + ); + LatexCmds.piv = LatexCmds.varpi = bindVariable('\\varpi ', 'ϖ', 'piv'); //W3C/Unicode and Elsevier and 9573-13 //AMS and LaTeX + LatexCmds.sigmaf = LatexCmds.sigmav = LatexCmds.varsigma = bindVariable('\\varsigma ', 'ς', 'sigma'); //W3C/Unicode //Elsevier //LaTeX + LatexCmds.thetav = LatexCmds.vartheta = LatexCmds.thetasym = bindVariable('\\vartheta ', 'ϑ', 'theta'); //Elsevier and 9573-13 //AMS and LaTeX //W3C/Unicode + LatexCmds.upsilon = LatexCmds.upsi = bindVariable( + //AMS and LaTeX and W3C/Unicode //Elsevier and 9573-13 + '\\upsilon ', + 'υ', + 'upsilon' + ); + //these aren't even mentioned in the HTML character entity references + LatexCmds.gammad = LatexCmds.Gammad = LatexCmds.digamma = bindVariable('\\digamma ', 'ϝ', 'gamma'); //Elsevier //9573-13 -- WTF, right? I dunno if this was a typo in the reference (see above) //LaTeX + LatexCmds.kappav = LatexCmds.varkappa = bindVariable( + //Elsevier //AMS and LaTeX + '\\varkappa ', + 'ϰ', + 'kappa' + ); + LatexCmds.rhov = LatexCmds.varrho = bindVariable('\\varrho ', 'ϱ', 'rho'); //Elsevier and 9573-13 //AMS and LaTeX + //Greek constants, look best in non-italicized Times New Roman + LatexCmds.pi = LatexCmds['\u03c0'] = function () { + return new NonSymbolaSymbol('\\pi ', h.entityText('π'), 'pi'); + }; + LatexCmds.lambda = function () { + return new NonSymbolaSymbol('\\lambda ', h.entityText('λ'), 'lambda'); + }; + //uppercase greek letters + LatexCmds.Upsilon = LatexCmds.Upsi = LatexCmds.upsih = LatexCmds.Upsih = function () { //LaTeX //Elsevier and 9573-13 //W3C/Unicode "upsilon with hook" //'cos it makes sense to me + return new MQSymbol( + '\\Upsilon ', + h('var', { style: 'font-family: serif' }, [h.entityText('ϒ')]), + 'capital upsilon' + ); + }; //Symbola's 'upsilon with a hook' is a capital Y without hooks :( + //other symbols with the same LaTeX command and HTML character entity reference + LatexCmds.Gamma = LatexCmds.Delta = LatexCmds.Theta = LatexCmds.Lambda = LatexCmds.Xi = LatexCmds.Pi = LatexCmds.Sigma = LatexCmds.Phi = LatexCmds.Psi = LatexCmds.Omega = LatexCmds.forall = function ( + latex + ) { + return new VanillaSymbol('\\' + latex + ' ', h.entityText('&' + latex + ';')); + }; + // symbols that aren't a single MathCommand, but are instead a whole + // Fragment. Creates the Fragment from a LaTeX string + var LatexFragment = /** @class */ (function (_super) { + __extends(LatexFragment, _super); + function LatexFragment(latex) { + var _this_1 = _super.call(this) || this; + _this_1.latexStr = latex; + return _this_1; + } + LatexFragment.prototype.createLeftOf = function (cursor) { + var block = latexMathParser.parse(this.latexStr); + block.children().adopt(cursor.parent, cursor[L], cursor[R]); + cursor[L] = block.getEnd(R); + domFrag(block.html()).insertBefore(cursor.domFrag()); + block.finalizeInsert(cursor.options, cursor); + var blockEndsR = block.getEnd(R); + var blockEndsRR = blockEndsR && blockEndsR[R]; + if (blockEndsRR) blockEndsRR.siblingCreated(cursor.options, L); + var blockEndsL = block.getEnd(L); + var blockEndsLL = blockEndsL && blockEndsL[L]; + if (blockEndsLL) blockEndsLL.siblingCreated(cursor.options, R); + cursor.parent.bubble(function (node) { + node.reflow(); + return undefined; + }); + }; + LatexFragment.prototype.mathspeak = function () { + return latexMathParser.parse(this.latexStr).mathspeak(); + }; + LatexFragment.prototype.parser = function () { + var frag = latexMathParser.parse(this.latexStr).children(); + return Parser.succeed(frag); + }; + return LatexFragment; + })(MathCommand); + // for what seems to me like [stupid reasons][1], Unicode provides + // subscripted and superscripted versions of all ten Arabic numerals, + // as well as [so-called "vulgar fractions"][2]. + // Nobody really cares about most of them, but some of them actually + // predate Unicode, dating back to [ISO-8859-1][3], apparently also + // known as "Latin-1", which among other things [Windows-1252][4] + // largely coincides with, so Microsoft Word sometimes inserts them + // and they get copy-pasted into MathQuill. + // + // (Irrelevant but funny story: though not a superset of Latin-1 aka + // ISO-8859-1, Windows-1252 **is** a strict superset of the "closely + // related but distinct"[3] "ISO 8859-1" -- see the lack of a dash + // after "ISO"? Completely different character set, like elephants vs + // elephant seals, or "Zombies" vs "Zombie Redneck Torture Family". + // What kind of idiot would get them confused. + // People in fact got them confused so much, it was so common to + // mislabel Windows-1252 text as ISO-8859-1, that most modern web + // browsers and email clients treat the MIME charset of ISO-8859-1 + // as actually Windows-1252, behavior now standard in the HTML5 spec.) + // + // [1]: http://en.wikipedia.org/wiki/Unicode_subscripts_andsuper_scripts + // [2]: http://en.wikipedia.org/wiki/Number_Forms + // [3]: http://en.wikipedia.org/wiki/ISO/IEC_8859-1 + // [4]: http://en.wikipedia.org/wiki/Windows-1252 + LatexCmds['\u2070'] = function () { + return new LatexFragment('^0'); + }; + LatexCmds['\u00b9'] = function () { + return new LatexFragment('^1'); + }; + LatexCmds['\u00b2'] = function () { + return new LatexFragment('^2'); + }; + LatexCmds['\u00b3'] = function () { + return new LatexFragment('^3'); + }; + LatexCmds['\u2074'] = function () { + return new LatexFragment('^4'); + }; + LatexCmds['\u2075'] = function () { + return new LatexFragment('^5'); + }; + LatexCmds['\u2076'] = function () { + return new LatexFragment('^6'); + }; + LatexCmds['\u2077'] = function () { + return new LatexFragment('^7'); + }; + LatexCmds['\u2078'] = function () { + return new LatexFragment('^8'); + }; + LatexCmds['\u2079'] = function () { + return new LatexFragment('^9'); + }; + LatexCmds['\u00bc'] = function () { + return new LatexFragment('\\frac14'); + }; + LatexCmds['\u00bd'] = function () { + return new LatexFragment('\\frac12'); + }; + LatexCmds['\u00be'] = function () { + return new LatexFragment('\\frac34'); + }; + // this is a hack to make pasting the \u221a symbol + // actually insert a sqrt command. This isn't ideal, + // but it's way better than what we have now. I think + // before we invest any more time into this single character + // we should consider how to make the pipe (|) automatically + // insert absolute value. We also will want the percent (%) + // to expand to '% of'. I've always just thought mathquill's + // ability to handle pasted latex magical until I started actually + // testing it. It's a lot more buggy that I previously thought. + // + // KNOWN ISSUES: + // 1) pasting \u221a does not put focus in side the sqrt symbol + // 2) pasting \u221a2 puts the 2 outside of the sqrt symbol. + // + // The first issue seems like we could invest more time into this to + // fix it, but doesn't feel worth special casing. I think we'd want + // to address it by addressing ALL pasting issues. + // + // The second issue seems like it might go away too if you fix paste to + // act more like simply typing the characters out. I'd be scared to try + // to make that change because I'm fairly confident I'd break something + // around handling valid latex as latex rather than treating it as keystrokes. + LatexCmds['\u221a'] = function () { + return new LatexFragment('\\sqrt{}'); + }; + // Binary operator determination is used in several contexts for PlusMinus nodes and their descendants. + // For instance, we set the item's class name based on this factor, and also assign different mathspeak values (plus vs positive, negative vs minus). + function isBinaryOperator(node) { + if (!node) return false; + var nodeL = node[L]; + if (nodeL) { + // If the left sibling is a binary operator or a separator (comma, semicolon, colon, space) + // or an open bracket (open parenthesis, open square bracket) + // consider the operator to be unary + if (nodeL instanceof BinaryOperator || /^(\\ )|[,;:\(\[]$/.test(nodeL.ctrlSeq)) { + return false; + } + } else if (node.parent && node.parent.parent && node.parent.parent.isStyleBlock()) { + //if we are in a style block at the leftmost edge, determine unary/binary based on + //the style block + //this allows style blocks to be transparent for unary/binary purposes + return isBinaryOperator(node.parent.parent); + } else { + return false; + } + return true; + } + var PlusMinus = /** @class */ (function (_super) { + __extends(class_7, _super); + function class_7(ch, html, mathspeak) { + return _super.call(this, ch, html, undefined, mathspeak, true) || this; + } + class_7.prototype.contactWeld = function (cursor, dir) { + this.sharedSiblingMethod(cursor.options, dir); + }; + class_7.prototype.siblingCreated = function (opts, dir) { + this.sharedSiblingMethod(opts, dir); + }; + class_7.prototype.siblingDeleted = function (opts, dir) { + this.sharedSiblingMethod(opts, dir); + }; + class_7.prototype.sharedSiblingMethod = function (_opts, dir) { + if (dir === R) return; // ignore if sibling only changed on the right + this.domFrag().oneElement().className = isBinaryOperator(this) ? 'dcg-mq-binary-operator' : ''; + return this; + }; + return class_7; + })(BinaryOperator); + LatexCmds['+'] = /** @class */ (function (_super) { + __extends(class_8, _super); + function class_8() { + return _super.call(this, '+', h.text('+')) || this; + } + class_8.prototype.mathspeak = function () { + return isBinaryOperator(this) ? 'plus' : 'positive'; + }; + return class_8; + })(PlusMinus); + //yes, these are different dashes, en-dash, em-dash, unicode minus, actual dash + var MinusNode = /** @class */ (function (_super) { + __extends(MinusNode, _super); + function MinusNode() { + return _super.call(this, '-', h.entityText('−')) || this; + } + MinusNode.prototype.mathspeak = function () { + return isBinaryOperator(this) ? 'minus' : 'negative'; + }; + return MinusNode; + })(PlusMinus); + LatexCmds['\u2212'] = LatexCmds['\u2014'] = LatexCmds['\u2013'] = LatexCmds['-'] = MinusNode; + LatexCmds['\u00b1'] = LatexCmds.pm = LatexCmds.plusmn = LatexCmds.plusminus = function () { + return new PlusMinus('\\pm ', h.entityText('±'), 'plus-or-minus'); + }; + LatexCmds.mp = LatexCmds.mnplus = LatexCmds.minusplus = function () { + return new PlusMinus('\\mp ', h.entityText('∓'), 'minus-or-plus'); + }; + CharCmds['*'] = LatexCmds.sdot = LatexCmds.cdot = bindBinaryOperator('\\cdot ', '·', '*', 'times'); //semantically should be ⋅, but · looks better + var To = /** @class */ (function (_super) { + __extends(To, _super); + function To() { + return _super.call(this, '\\to ', h.entityText('→'), 'to') || this; + } + To.prototype.deleteTowards = function (dir, cursor) { + if (dir === L) { + var l = cursor[L]; + new Fragment(l, this).remove(); + cursor[L] = l[L]; + new MinusNode().createLeftOf(cursor); + cursor[L].bubble(function (node) { + node.reflow(); + return undefined; + }); + return; + } + _super.prototype.deleteTowards.call(this, dir, cursor); + }; + return To; + })(BinaryOperator); + LatexCmds['\u2192'] = LatexCmds.to = To; + var Inequality = /** @class */ (function (_super) { + __extends(Inequality, _super); + function Inequality(data, strict) { + var _this_1 = this; + var strictness = strict ? 'Strict' : ''; + _this_1 = + _super.call( + this, + data['ctrlSeq'.concat(strictness)], + h.entityText(data['htmlEntity'.concat(strictness)]), + data['text'.concat(strictness)], + data['mathspeak'.concat(strictness)] + ) || this; + _this_1.data = data; + _this_1.strict = strict; + return _this_1; + } + Inequality.prototype.swap = function (strict) { + this.strict = strict; + var strictness = strict ? 'Strict' : ''; + this.ctrlSeq = this.data['ctrlSeq'.concat(strictness)]; + this.domFrag() + .children() + .replaceWith(domFrag(h.entityText(this.data['htmlEntity'.concat(strictness)]))); + this.textTemplate = [this.data['text'.concat(strictness)]]; + this.mathspeakName = this.data['mathspeak'.concat(strictness)]; + }; + Inequality.prototype.deleteTowards = function (dir, cursor) { + if (dir === L && !this.strict) { + this.swap(true); + this.bubble(function (node) { + node.reflow(); + return undefined; + }); + return; + } + _super.prototype.deleteTowards.call(this, dir, cursor); + }; + return Inequality; + })(BinaryOperator); + var less = { + ctrlSeq: '\\le ', + htmlEntity: '≤', + text: '\u2264', + mathspeak: 'less than or equal to', + ctrlSeqStrict: '<', + htmlEntityStrict: '<', + textStrict: '<', + mathspeakStrict: 'less than', + }; + var greater = { + ctrlSeq: '\\ge ', + htmlEntity: '≥', + text: '\u2265', + mathspeak: 'greater than or equal to', + ctrlSeqStrict: '>', + htmlEntityStrict: '>', + textStrict: '>', + mathspeakStrict: 'greater than', + }; + var Greater = /** @class */ (function (_super) { + __extends(Greater, _super); + function Greater() { + return _super.call(this, greater, true) || this; + } + Greater.prototype.createLeftOf = function (cursor) { + var cursorL = cursor[L]; + if (cursorL instanceof BinaryOperator && cursorL.ctrlSeq === '-') { + var l = cursorL; + cursor[L] = l[L]; + l.remove(); + new To().createLeftOf(cursor); + cursor[L].bubble(function (node) { + node.reflow(); + return undefined; + }); + return; + } + _super.prototype.createLeftOf.call(this, cursor); + }; + return Greater; + })(Inequality); + LatexCmds['<'] = LatexCmds.lt = function () { + return new Inequality(less, true); + }; + LatexCmds['>'] = LatexCmds.gt = Greater; + LatexCmds['\u2264'] = LatexCmds.le = LatexCmds.leq = function () { + return new Inequality(less, false); + }; + LatexCmds['\u2265'] = LatexCmds.ge = LatexCmds.geq = function () { + return new Inequality(greater, false); + }; + LatexCmds.infty = LatexCmds.infin = LatexCmds.infinity = bindVanillaSymbol('\\infty ', '∞', 'infinity'); + LatexCmds['\u2260'] = LatexCmds.ne = LatexCmds.neq = bindBinaryOperator('\\ne ', '≠', 'not equal'); + var Equality = /** @class */ (function (_super) { + __extends(Equality, _super); + function Equality() { + return _super.call(this, '=', h.text('='), '=', 'equals') || this; + } + Equality.prototype.createLeftOf = function (cursor) { + var cursorL = cursor[L]; + if (cursorL instanceof Inequality && cursorL.strict) { + cursorL.swap(false); + cursorL.bubble(function (node) { + node.reflow(); + return undefined; + }); + return; + } + _super.prototype.createLeftOf.call(this, cursor); + }; + return Equality; + })(BinaryOperator); + LatexCmds['='] = Equality; + LatexCmds['\u00d7'] = LatexCmds.times = bindBinaryOperator('\\times ', '×', '[x]', 'times'); + LatexCmds['\u00f7'] = LatexCmds.div = LatexCmds.divide = LatexCmds.divides = bindBinaryOperator( + '\\div ', + '÷', + '[/]', + 'over' + ); + var Sim = /** @class */ (function (_super) { + __extends(Sim, _super); + function Sim() { + return _super.call(this, '\\sim ', h.text('~'), '~', 'tilde') || this; + } + Sim.prototype.createLeftOf = function (cursor) { + if (cursor[L] instanceof Sim) { + var l = cursor[L]; + cursor[L] = l[L]; + l.remove(); + new Approx().createLeftOf(cursor); + cursor[L].bubble(function (node) { + node.reflow(); + return undefined; + }); + return; + } + _super.prototype.createLeftOf.call(this, cursor); + }; + return Sim; + })(BinaryOperator); + var Approx = /** @class */ (function (_super) { + __extends(Approx, _super); + function Approx() { + return ( + _super.call(this, '\\approx ', h.entityText('≈'), '\u2248', 'approximately equal') || this + ); + } + Approx.prototype.deleteTowards = function (dir, cursor) { + if (dir === L) { + var l = cursor[L]; + new Fragment(l, this).remove(); + cursor[L] = l[L]; + new Sim().createLeftOf(cursor); + cursor[L].bubble(function (node) { + node.reflow(); + return undefined; + }); + return; + } + _super.prototype.deleteTowards.call(this, dir, cursor); + }; + return Approx; + })(BinaryOperator); + LatexCmds.tildeNbsp = bindVanillaSymbol('~', U_NO_BREAK_SPACE, ' '); + LatexCmds.sim = Sim; + LatexCmds['\u2248'] = LatexCmds.approx = Approx; + // When interpreting raw LaTeX, we can either evaluate the tilde as its standard nonbreaking space + // or transform it to the \sim operator depending on whether the "interpretTildeAsSim" configuration option is set. + // Tilde symbols input from a keyboard will always be transformed to \sim. + CharCmds['~'] = LatexCmds.sim; + LatexCmds['~'] = LatexCmds.tildeNbsp; + baseOptionProcessors.interpretTildeAsSim = function (val) { + var interpretAsSim = !!val; + if (interpretAsSim) { + LatexCmds['~'] = LatexCmds.sim; + } else { + LatexCmds['~'] = LatexCmds.tildeNbsp; + } + return interpretAsSim; + }; + /*************************** + * Commands and Operators. + **************************/ + var SVG_SYMBOLS = { + sqrt: { + width: '', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 32 54' }, [ + h('path', { + d: 'M0 33 L7 27 L12.5 47 L13 47 L30 0 L32 0 L13 54 L11 54 L4.5 31 L0 33', + }), + ]); + }, + }, + '|': { + width: '.4em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ + h('path', { d: 'M4.4 0 L4.4 54 L5.6 54 L5.6 0' }), + ]); + }, + }, + '[': { + width: '.55em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 11 24' }, [ + h('path', { d: 'M8 0 L3 0 L3 24 L8 24 L8 23 L4 23 L4 1 L8 1' }), + ]); + }, + }, + ']': { + width: '.55em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 11 24' }, [ + h('path', { d: 'M3 0 L8 0 L8 24 L3 24 L3 23 L7 23 L7 1 L3 1' }), + ]); + }, + }, + '(': { + width: '.55em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '3 0 106 186' }, [ + h('path', { + d: 'M85 0 A61 101 0 0 0 85 186 L75 186 A75 101 0 0 1 75 0', + }), + ]); + }, + }, + ')': { + width: '.55em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '3 0 106 186' }, [ + h('path', { + d: 'M24 0 A61 101 0 0 1 24 186 L34 186 A75 101 0 0 0 34 0', + }), + ]); + }, + }, + '{': { + width: '.7em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '10 0 210 350' }, [ + h('path', { + d: + 'M170 0 L170 6 A47 52 0 0 0 123 60 L123 127 A35 48 0 0 1 88 175 A35 48 0 0 1 123 223 L123 290 A47 52 0 0 0 170 344 L170 350 L160 350 A58 49 0 0 1 102 301 L103 220 A45 40 0 0 0 58 180 L58 170 A45 40 0 0 0 103 130 L103 49 A58 49 0 0 1 161 0', + }), + ]); + }, + }, + '}': { + width: '.7em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '10 0 210 350' }, [ + h('path', { + d: + 'M60 0 L60 6 A47 52 0 0 1 107 60 L107 127 A35 48 0 0 0 142 175 A35 48 0 0 0 107 223 L107 290 A47 52 0 0 1 60 344 L60 350 L70 350 A58 49 0 0 0 128 301 L127 220 A45 40 0 0 1 172 180 L172 170 A45 40 0 0 1 127 130 L127 49 A58 49 0 0 0 70 0', + }), + ]); + }, + }, + '∥': { + width: '.7em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ + h('path', { d: 'M3.2 0 L3.2 54 L4 54 L4 0 M6.8 0 L6.8 54 L6 54 L6 0' }), + ]); + }, + }, + '⟨': { + width: '.55em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ + h('path', { d: 'M6.8 0 L3.2 27 L6.8 54 L7.8 54 L4.2 27 L7.8 0' }), + ]); + }, + }, + '⟩': { + width: '.55em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ + h('path', { d: 'M3.2 0 L6.8 27 L3.2 54 L2.2 54 L5.8 27 L2.2 0' }), + ]); + }, + }, + }; + var Style = /** @class */ (function (_super) { + __extends(Style, _super); + function Style(ctrlSeq, tagName, attrs, ariaLabel, opts) { + var _this_1 = + _super.call( + this, + ctrlSeq, + new DOMView(1, function (blocks) { + return h.block(tagName, attrs, blocks[0]); + }) + ) || this; + _this_1.ariaLabel = ariaLabel || ctrlSeq.replace(/^\\/, ''); + _this_1.mathspeakTemplate = ['Start' + _this_1.ariaLabel + ',', 'End' + _this_1.ariaLabel]; + // In most cases, mathspeak should announce the start and end of style blocks. + // There is one exception currently (mathrm). + _this_1.shouldNotSpeakDelimiters = opts && opts.shouldNotSpeakDelimiters; + return _this_1; + } + Style.prototype.mathspeak = function (opts) { + if (!this.shouldNotSpeakDelimiters || (opts && opts.ignoreShorthand)) { + return _super.prototype.mathspeak.call(this); + } + return this.foldChildren('', function (speech, block) { + return speech + ' ' + block.mathspeak(opts); + }).trim(); + }; + return Style; + })(MathCommand); + //fonts + LatexCmds.mathrm = /** @class */ (function (_super) { + __extends(mathrm, _super); + function mathrm() { + return ( + _super.call(this, '\\mathrm', 'span', { class: 'dcg-mq-roman dcg-mq-font' }, 'Roman Font', { + shouldNotSpeakDelimiters: true, + }) || this + ); + } + mathrm.prototype.isTextBlock = function () { + return true; + }; + return mathrm; + })(Style); + LatexCmds.mathit = function () { + return new Style('\\mathit', 'i', { class: 'dcg-mq-font' }, 'Italic Font'); + }; + LatexCmds.mathbf = function () { + return new Style('\\mathbf', 'b', { class: 'dcg-mq-font' }, 'Bold Font'); + }; + LatexCmds.mathsf = function () { + return new Style('\\mathsf', 'span', { class: 'dcg-mq-sans-serif dcg-mq-font' }, 'Serif Font'); + }; + LatexCmds.mathtt = function () { + return new Style('\\mathtt', 'span', { class: 'dcg-mq-monospace dcg-mq-font' }, 'Math Text'); + }; + //text-decoration + LatexCmds.underline = function () { + return new Style('\\underline', 'span', { class: 'dcg-mq-non-leaf dcg-mq-underline' }, 'Underline'); + }; + LatexCmds.overline = LatexCmds.bar = function () { + return new Style('\\overline', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overline' }, 'Overline'); + }; + LatexCmds.overrightarrow = function () { + return new Style( + '\\overrightarrow', + 'span', + { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-right' }, + 'Over Right Arrow' + ); + }; + LatexCmds.overleftarrow = function () { + return new Style( + '\\overleftarrow', + 'span', + { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-left' }, + 'Over Left Arrow' + ); + }; + LatexCmds.overleftrightarrow = function () { + return new Style( + '\\overleftrightarrow ', + 'span', + { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-leftright' }, + 'Over Left and Right Arrow' + ); + }; + LatexCmds.overarc = function () { + return new Style('\\overarc', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overarc' }, 'Over Arc'); + }; + LatexCmds.dot = function () { + return new MathCommand( + '\\dot', + new DOMView(1, function (blocks) { + return h('span', { class: 'dcg-mq-non-leaf' }, [ + h('span', { class: 'dcg-mq-dot-recurring-inner' }, [ + h('span', { class: 'dcg-mq-dot-recurring' }, [h.text(U_DOT_ABOVE)]), + h.block('span', { class: 'dcg-mq-empty-box' }, blocks[0]), + ]), + ]); + }) + ); + }; + // `\textcolor{color}{math}` will apply a color to the given math content, where + // `color` is any valid CSS Color Value (see [SitePoint docs][] (recommended), + // [Mozilla docs][], or [W3C spec][]). + // + // [SitePoint docs]: http://reference.sitepoint.com/css/colorvalues + // [Mozilla docs]: https://developer.mozilla.org/en-US/docs/CSS/color_value#Values + // [W3C spec]: http://dev.w3.org/csswg/css3-color/#colorunits + LatexCmds.textcolor = /** @class */ (function (_super) { + __extends(class_9, _super); + function class_9() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + class_9.prototype.setColor = function (color) { + this.color = color; + this.domView = new DOMView(1, function (blocks) { + return h.block('span', { class: 'dcg-mq-textcolor', style: 'color:' + color }, blocks[0]); + }); + this.ariaLabel = color.replace(/^\\/, ''); + this.mathspeakTemplate = ['Start ' + this.ariaLabel + ',', 'End ' + this.ariaLabel]; + }; + class_9.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + var blocks0 = this.blocks[0]; + ctx.latex += '\\textcolor{' + this.color + '}{'; + blocks0.latexRecursive(ctx); + ctx.latex += '}'; + this.checkCursorContextClose(ctx); + }; + class_9.prototype.parser = function () { + var _this_1 = this; + var optWhitespace = Parser.optWhitespace; + var string = Parser.string; + var regex = Parser.regex; + return optWhitespace + .then(string('{')) + .then(regex(/^[#\w\s.,()%-]*/)) + .skip(string('}')) + .then(function (color) { + _this_1.setColor(color); + return _super.prototype.parser.call(_this_1); + }); + }; + class_9.prototype.isStyleBlock = function () { + return true; + }; + return class_9; + })(MathCommand); + // Very similar to the \textcolor command, but will add the given CSS class. + // Usage: \class{classname}{math} + // Note regex that whitelists valid CSS classname characters: + // https://github.com/mathquill/mathquill/pull/191#discussion_r4327442 + var Class = (LatexCmds['class'] = /** @class */ (function (_super) { + __extends(class_10, _super); + function class_10() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + class_10.prototype.parser = function () { + var _this_1 = this; + var string = Parser.string, + regex = Parser.regex; + return Parser.optWhitespace + .then(string('{')) + .then(regex(/^[-\w\s\\\xA0-\xFF]*/)) + .skip(string('}')) + .then(function (cls) { + _this_1.cls = cls || ''; + _this_1.domView = new DOMView(1, function (blocks) { + return h.block('span', { class: 'dcg-mq-class '.concat(cls) }, blocks[0]); + }); + _this_1.ariaLabel = cls + ' class'; + _this_1.mathspeakTemplate = ['Start ' + _this_1.ariaLabel + ',', 'End ' + _this_1.ariaLabel]; + return _super.prototype.parser.call(_this_1); + }); + }; + class_10.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + var blocks0 = this.blocks[0]; + ctx.latex += '\\class{' + this.cls + '}{'; + blocks0.latexRecursive(ctx); + ctx.latex += '}'; + this.checkCursorContextClose(ctx); + }; + class_10.prototype.isStyleBlock = function () { + return true; + }; + return class_10; + })(MathCommand)); + // This test is used to determine whether an item may be treated as a whole number + // for shortening the verbalized (mathspeak) forms of some fractions and superscripts. + var intRgx = /^[\+\-]?[\d]+$/; + // Traverses the top level of the passed block's children and returns the concatenation of their ctrlSeq properties. + // Used in shortened mathspeak computations as a block's .text() method can be potentially expensive. + // + function getCtrlSeqsFromBlock(block) { + if (!block) return ''; + var chars = ''; + block.eachChild(function (child) { + if (child.ctrlSeq !== undefined) chars += child.ctrlSeq; + }); + return chars; + } + Options.prototype.charsThatBreakOutOfSupSub = ''; + var SupSub = /** @class */ (function (_super) { + __extends(SupSub, _super); + function SupSub() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = '_{...}^{...}'; + return _this_1; + } + SupSub.prototype.setEnds = function (ends) { + pray('SupSub ends must be MathBlocks', ends[L] instanceof MathBlock && ends[R] instanceof MathBlock); + this.ends = ends; + }; + SupSub.prototype.getEnd = function (dir) { + return this.ends[dir]; + }; + SupSub.prototype.createLeftOf = function (cursor) { + if (!this.replacedFragment && !cursor[L] && cursor.options.supSubsRequireOperand) return; + return _super.prototype.createLeftOf.call(this, cursor); + }; + SupSub.prototype.contactWeld = function (cursor) { + // Look on either side for a SupSub, if one is found compare my + // .sub, .sup with its .sub, .sup. If I have one that it doesn't, + // then call .addBlock() on it with my block; if I have one that + // it also has, then insert my block's children into its block, + // unless my block has none, in which case insert the cursor into + // its block (and not mine, I'm about to remove myself) in the case + // I was just typed. + // TODO: simplify + // equiv. to [L, R].forEach(function(dir) { ... }); + for (var dir = L; dir; dir = dir === L ? R : false) { + var thisDir = this[dir]; + var pt = void 0; + if (thisDir instanceof SupSub) { + // equiv. to 'sub sup'.split(' ').forEach(function(supsub) { ... }); + for (var supsub = 'sub'; supsub; supsub = supsub === 'sub' ? 'sup' : false) { + var src = this[supsub], + dest = thisDir[supsub]; + if (!src) continue; + if (!dest) thisDir.addBlock(src.disown()); + else if (!src.isEmpty()) { + // ins src children at -dir end of dest + src.domFrag().children().insAtDirEnd(-dir, dest.domFrag().oneElement()); + var children = src.children().disown(); + pt = new Point(dest, children.getEnd(R), dest.getEnd(L)); + if (dir === L) children.adopt(dest, dest.getEnd(R), 0); + else children.adopt(dest, 0, dest.getEnd(L)); + } else { + pt = new Point(dest, 0, dest.getEnd(L)); + } + this.placeCursor = (function (dest, src) { + // TODO: don't monkey-patch + return function (cursor) { + cursor.insAtDirEnd(-dir, dest || src); + }; + })(dest, src); + } + this.remove(); + if (cursor && cursor[L] === this) { + if (dir === R && pt) { + if (pt[L]) { + cursor.insRightOf(pt[L]); + } else { + cursor.insAtLeftEnd(pt.parent); + } + } else cursor.insRightOf(thisDir); + } + break; + } + } + }; + SupSub.prototype.finalizeTree = function () { + var endsL = this.getEnd(L); + endsL.write = function (cursor, ch) { + if (cursor.options.autoSubscriptNumerals && this === this.parent.sub) { + if (ch === '_') return; + var cmd = this.chToCmd(ch, cursor.options); + if (cmd instanceof MQSymbol) cursor.deleteSelection(); + else cursor.clearSelection().insRightOf(this.parent); + cmd.createLeftOf(cursor.show()); + cursor.controller.aria.queue('Baseline').alert(cmd.mathspeak({ createdLeftOf: cursor })); + return; + } + if ( + cursor[L] && + !cursor[R] && + !cursor.selection && + cursor.options.charsThatBreakOutOfSupSub.indexOf(ch) > -1 + ) { + cursor.insRightOf(this.parent); + cursor.controller.aria.queue('Baseline'); + } + MathBlock.prototype.write.call(this, cursor, ch); + }; + }; + SupSub.prototype.moveTowards = function (dir, cursor, updown) { + if (cursor.options.autoSubscriptNumerals && !this.sup) { + cursor.insDirOf(dir, this); + } else _super.prototype.moveTowards.call(this, dir, cursor, updown); + }; + SupSub.prototype.deleteTowards = function (dir, cursor) { + if (cursor.options.autoSubscriptNumerals && this.sub) { + var cmd = this.sub.getEnd(-dir); + if (cmd instanceof MQSymbol) cmd.remove(); + else if (cmd) cmd.deleteTowards(dir, cursor.insAtDirEnd(-dir, this.sub)); + // TODO: factor out a .removeBlock() or something + if (this.sub.isEmpty()) { + this.sub.deleteOutOf(L, cursor.insAtLeftEnd(this.sub)); + if (this.sup) cursor.insDirOf(-dir, this); + // Note `-dir` because in e.g. x_1^2| want backspacing (leftward) + // to delete the 1 but to end up rightward of x^2; with non-negated + // `dir` (try it), the cursor appears to have gone "through" the ^2. + } + } else _super.prototype.deleteTowards.call(this, dir, cursor); + }; + SupSub.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + if (this.sub) { + ctx.latex += '_{'; + var beforeLength = ctx.latex.length; + this.sub.latexRecursive(ctx); + var afterLength = ctx.latex.length; + if (beforeLength === afterLength) { + // nothing was written. so we write a space + ctx.latex += ' '; + } + ctx.latex += '}'; + } + if (this.sup) { + ctx.latex += '^{'; + var beforeLength = ctx.latex.length; + this.sup.latexRecursive(ctx); + var afterLength = ctx.latex.length; + if (beforeLength === afterLength) { + // nothing was written. so we write a space + ctx.latex += ' '; + } + ctx.latex += '}'; + } + this.checkCursorContextClose(ctx); + }; + SupSub.prototype.text = function () { + function text(prefix, block) { + var l = (block && block.text()) || ''; + return block ? prefix + (l.length === 1 ? l : '(' + (l || ' ') + ')') : ''; + } + return text('_', this.sub) + text('^', this.sup); + }; + SupSub.prototype.addBlock = function (block) { + if (this.supsub === 'sub') { + this.sup = this.upInto = this.sub.upOutOf = block; + block.adopt(this, this.sub, 0).downOutOf = this.sub; + block.setDOM( + domFrag(h('span', { class: 'dcg-mq-sup' })) + .append(block.domFrag().children()) + .prependTo(this.domFrag().oneElement()) + .oneElement() + ); + NodeBase.linkElementByBlockNode(block.domFrag().oneElement(), block); + } else { + this.sub = this.downInto = this.sup.downOutOf = block; + block.adopt(this, 0, this.sup).upOutOf = this.sup; + this.domFrag().removeClass('dcg-mq-sup-only'); + block.setDOM( + domFrag(h('span', { class: 'dcg-mq-sub' })) + .append(block.domFrag().children()) + .appendTo(this.domFrag().oneElement()) + .oneElement() + ); + NodeBase.linkElementByBlockNode(block.domFrag().oneElement(), block); + this.domFrag().append( + domFrag(h('span', { style: 'display:inline-block;width:0' }, [h.text(U_ZERO_WIDTH_SPACE)])) + ); + } + // like 'sub sup'.split(' ').forEach(function(supsub) { ... }); + for (var i = 0; i < 2; i += 1) + (function (cmd, supsub, oppositeSupsub, updown) { + var cmdSubSub = cmd[supsub]; + cmdSubSub.deleteOutOf = function (dir, cursor) { + cursor.insDirOf(this[dir] ? -dir : dir, this.parent); + if (!this.isEmpty()) { + var end = this.getEnd(dir); + this.children() + .disown() + .withDirAdopt(dir, cursor.parent, cursor[dir], cursor[-dir]) + .domFrag() + .insDirOf(-dir, cursor.domFrag()); + cursor[-dir] = end; + } + cmd.supsub = oppositeSupsub; + delete cmd[supsub]; + delete cmd[''.concat(updown, 'Into')]; + var cmdOppositeSupsub = cmd[oppositeSupsub]; + cmdOppositeSupsub[''.concat(updown, 'OutOf')] = insLeftOfMeUnlessAtEnd; + delete cmdOppositeSupsub.deleteOutOf; // TODO - refactor so this method can be optional + if (supsub === 'sub') { + cmd.domFrag().addClass('dcg-mq-sup-only').children().last().remove(); + } + this.remove(); + }; + })(this, 'sub sup'.split(' ')[i], 'sup sub'.split(' ')[i], 'down up'.split(' ')[i]); + }; + return SupSub; + })(MathCommand); + function insLeftOfMeUnlessAtEnd(cursor) { + // cursor.insLeftOf(cmd), unless cursor at the end of block, and every + // ancestor cmd is at the end of every ancestor block + var cmd = this.parent; + var ancestorCmd = cursor; + do { + if (ancestorCmd[R]) return cursor.insLeftOf(cmd); + ancestorCmd = ancestorCmd.parent.parent; + } while (ancestorCmd !== cmd); + cursor.insRightOf(cmd); + return undefined; + } + var SubscriptCommand = /** @class */ (function (_super) { + __extends(SubscriptCommand, _super); + function SubscriptCommand() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.supsub = 'sub'; + _this_1.domView = new DOMView(1, function (blocks) { + return h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf' }, [ + h.block('span', { class: 'dcg-mq-sub' }, blocks[0]), + h('span', { style: 'display:inline-block;width:0' }, [h.text(U_ZERO_WIDTH_SPACE)]), + ]); + }); + _this_1.textTemplate = ['_']; + _this_1.mathspeakTemplate = ['Subscript,', ', Baseline']; + _this_1.ariaLabel = 'subscript'; + return _this_1; + } + SubscriptCommand.prototype.finalizeTree = function () { + this.downInto = this.sub = this.getEnd(L); + this.sub.upOutOf = insLeftOfMeUnlessAtEnd; + _super.prototype.finalizeTree.call(this); + }; + return SubscriptCommand; + })(SupSub); + LatexCmds.subscript = LatexCmds._ = SubscriptCommand; + LatexCmds.superscript = LatexCmds.supscript = LatexCmds['^'] = /** @class */ (function (_super) { + __extends(SuperscriptCommand, _super); + function SuperscriptCommand() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.supsub = 'sup'; + _this_1.domView = new DOMView(1, function (blocks) { + return h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf dcg-mq-sup-only' }, [ + h.block('span', { class: 'dcg-mq-sup' }, blocks[0]), + ]); + }); + _this_1.textTemplate = ['^(', ')']; + _this_1.ariaLabel = 'superscript'; + _this_1.mathspeakTemplate = ['Superscript,', ', Baseline']; + return _this_1; + } + SuperscriptCommand.prototype.mathspeak = function (opts) { + // Simplify basic exponent speech for common whole numbers. + var child = this.upInto; + if (child !== undefined) { + // Calculate this item's inner text to determine whether to shorten the returned speech. + // Do not calculate its inner mathspeak now until we know that the speech is to be truncated. + // Since the mathspeak computation is recursive, we want to call it only once in this function to avoid performance bottlenecks. + var innerText = getCtrlSeqsFromBlock(child); + // If the superscript is a whole number, shorten the speech that is returned. + if ((!opts || !opts.ignoreShorthand) && intRgx.test(innerText)) { + // Simple cases + if (innerText === '0') { + return 'to the 0 power'; + } else if (innerText === '2') { + return 'squared'; + } else if (innerText === '3') { + return 'cubed'; + } + // More complex cases. + var suffix = ''; + // Limit suffix addition to exponents < 1000. + if (/^[+-]?\d{1,3}$/.test(innerText)) { + if (/(11|12|13|4|5|6|7|8|9|0)$/.test(innerText)) { + suffix = 'th'; + } else if (/1$/.test(innerText)) { + suffix = 'st'; + } else if (/2$/.test(innerText)) { + suffix = 'nd'; + } else if (/3$/.test(innerText)) { + suffix = 'rd'; + } + } + var innerMathspeak = typeof child === 'object' ? child.mathspeak() : innerText; + return 'to the ' + innerMathspeak + suffix + ' power'; + } + } + return _super.prototype.mathspeak.call(this); + }; + SuperscriptCommand.prototype.finalizeTree = function () { + this.upInto = this.sup = this.getEnd(R); + this.sup.downOutOf = insLeftOfMeUnlessAtEnd; + _super.prototype.finalizeTree.call(this); + }; + return SuperscriptCommand; + })(SupSub); + var SummationNotation = /** @class */ (function (_super) { + __extends(SummationNotation, _super); + function SummationNotation(ch, symbol, ariaLabel) { + var _this_1 = _super.call(this) || this; + _this_1.ariaLabel = ariaLabel || ch.replace(/^\\/, ''); + var domView = new DOMView(2, function (blocks) { + return h('span', { class: 'dcg-mq-large-operator dcg-mq-non-leaf' }, [ + h('span', { class: 'dcg-mq-to' }, [h.block('span', {}, blocks[1])]), + h('big', {}, [h.text(symbol)]), + h('span', { class: 'dcg-mq-from' }, [h.block('span', {}, blocks[0])]), + ]); + }); + MQSymbol.prototype.setCtrlSeqHtmlTextAndMathspeak.call(_this_1, ch, domView); + return _this_1; + } + SummationNotation.prototype.createLeftOf = function (cursor) { + _super.prototype.createLeftOf.call(this, cursor); + if (cursor.options.sumStartsWithNEquals) { + new Letter('n').createLeftOf(cursor); + new Equality().createLeftOf(cursor); + } + }; + SummationNotation.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += this.ctrlSeq + '_{'; + var beforeLength = ctx.latex.length; + this.getEnd(L).latexRecursive(ctx); + var afterLength = ctx.latex.length; + if (afterLength === beforeLength) { + // nothing was written so we write a space + ctx.latex += ' '; + } + ctx.latex += '}^{'; + beforeLength = ctx.latex.length; + this.getEnd(R).latexRecursive(ctx); + afterLength = ctx.latex.length; + if (beforeLength === afterLength) { + // nothing was written so we write a space + ctx.latex += ' '; + } + ctx.latex += '}'; + this.checkCursorContextClose(ctx); + }; + SummationNotation.prototype.mathspeak = function () { + return ( + 'Start ' + + this.ariaLabel + + ' from ' + + this.getEnd(L).mathspeak() + + ' to ' + + this.getEnd(R).mathspeak() + + ', end ' + + this.ariaLabel + + ', ' + ); + }; + SummationNotation.prototype.parser = function () { + var string = Parser.string; + var optWhitespace = Parser.optWhitespace; + var succeed = Parser.succeed; + var block = latexMathParser.block; + var self = this; + var blocks = (self.blocks = [new MathBlock(), new MathBlock()]); + for (var i = 0; i < blocks.length; i += 1) { + blocks[i].adopt(self, self.getEnd(R), 0); + } + return optWhitespace + .then(string('_').or(string('^'))) + .then(function (supOrSub) { + var child = blocks[supOrSub === '_' ? 0 : 1]; + return block.then(function (block) { + block.children().adopt(child, child.getEnd(R), 0); + return succeed(self); + }); + }) + .many() + .result(self); + }; + SummationNotation.prototype.finalizeTree = function () { + var endsL = this.getEnd(L); + var endsR = this.getEnd(R); + endsL.ariaLabel = 'lower bound'; + endsR.ariaLabel = 'upper bound'; + this.downInto = endsL; + this.upInto = endsR; + endsL.upOutOf = endsR; + endsR.downOutOf = endsL; + }; + return SummationNotation; + })(MathCommand); + LatexCmds['\u2211'] = LatexCmds.sum = LatexCmds.summation = function () { + return new SummationNotation('\\sum ', U_NARY_SUMMATION, 'sum'); + }; + LatexCmds['\u220f'] = LatexCmds.prod = LatexCmds.product = function () { + return new SummationNotation('\\prod ', U_NARY_PRODUCT, 'product'); + }; + LatexCmds.coprod = LatexCmds.coproduct = function () { + return new SummationNotation('\\coprod ', U_NARY_COPRODUCT, 'co product'); + }; + LatexCmds['\u222b'] = LatexCmds['int'] = LatexCmds.integral = /** @class */ (function (_super) { + __extends(class_11, _super); + function class_11() { + var _this_1 = _super.call(this, '\\int ', '', 'integral') || this; + _this_1.ariaLabel = 'integral'; + _this_1.domView = new DOMView(2, function (blocks) { + return h('span', { class: 'dcg-mq-int dcg-mq-non-leaf' }, [ + h('big', {}, [h.text(U_INTEGRAL)]), + h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf' }, [ + h('span', { class: 'dcg-mq-sup' }, [ + h.block('span', { class: 'dcg-mq-sup-inner' }, blocks[1]), + ]), + h.block('span', { class: 'dcg-mq-sub' }, blocks[0]), + h('span', { style: 'display:inline-block;width:0' }, [h.text(U_ZERO_WIDTH_SPACE)]), + ]), + ]); + }); + return _this_1; + } + class_11.prototype.createLeftOf = function (cursor) { + // FIXME: refactor rather than overriding + MathCommand.prototype.createLeftOf.call(this, cursor); + }; + return class_11; + })(SummationNotation); + //window.LatexCmds = LatexCmds; + //console.log(LatexCmds); + //console.log(window); + var Fraction = (LatexCmds.frac = LatexCmds.dfrac = LatexCmds.cfrac = LatexCmds.fraction = /** @class */ (function ( + _super + ) { + __extends(FracNode, _super); + function FracNode() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = '\\frac'; + _this_1.domView = new DOMView(2, function (blocks) { + return h('span', { class: 'dcg-mq-fraction dcg-mq-non-leaf' }, [ + h.block('span', { class: 'dcg-mq-numerator' }, blocks[0]), + h.block('span', { class: 'dcg-mq-denominator' }, blocks[1]), + h('span', { style: 'display:inline-block;width:0' }, [h.text(U_ZERO_WIDTH_SPACE)]), + ]); + }); + _this_1.textTemplate = ['(', ')/(', ')']; + return _this_1; + } + FracNode.prototype.finalizeTree = function () { + var endsL = this.getEnd(L); + var endsR = this.getEnd(R); + this.upInto = endsR.upOutOf = endsL; + this.downInto = endsL.downOutOf = endsR; + endsL.ariaLabel = 'numerator'; + endsR.ariaLabel = 'denominator'; + if (this.getFracDepth() > 1) { + this.mathspeakTemplate = ['StartNestedFraction,', 'NestedOver', ', EndNestedFraction']; + } else { + this.mathspeakTemplate = ['StartFraction,', 'Over', ', EndFraction']; + } + }; + FracNode.prototype.mathspeak = function (opts) { + if (opts && opts.createdLeftOf) { + var cursor = opts.createdLeftOf; + return cursor.parent.mathspeak(); + } + var numText = getCtrlSeqsFromBlock(this.getEnd(L)); + var denText = getCtrlSeqsFromBlock(this.getEnd(R)); + // Shorten mathspeak value for whole number fractions whose denominator is less than 10. + if ((!opts || !opts.ignoreShorthand) && intRgx.test(numText) && intRgx.test(denText)) { + var isSingular = numText === '1' || numText === '-1'; + var newDenSpeech = ''; + if (denText === '2') { + newDenSpeech = isSingular ? 'half' : 'halves'; + } else if (denText === '3') { + newDenSpeech = isSingular ? 'third' : 'thirds'; + } else if (denText === '4') { + newDenSpeech = isSingular ? 'quarter' : 'quarters'; + } else if (denText === '5') { + newDenSpeech = isSingular ? 'fifth' : 'fifths'; + } else if (denText === '6') { + newDenSpeech = isSingular ? 'sixth' : 'sixths'; + } else if (denText === '7') { + newDenSpeech = isSingular ? 'seventh' : 'sevenths'; + } else if (denText === '8') { + newDenSpeech = isSingular ? 'eighth' : 'eighths'; + } else if (denText === '9') { + newDenSpeech = isSingular ? 'ninth' : 'ninths'; + } + if (newDenSpeech !== '') { + var output = ''; + // Handle the case of an integer followed by a simplified fraction such as 1\frac{1}{2}. + // Such combinations should be spoken aloud as "1 and 1 half." + // Start at the left sibling of the fraction and continue leftward until something other than a digit or whitespace is found. + var precededByInteger = false; + for (var sibling = this[L]; sibling && sibling[L] !== undefined; sibling = sibling[L]) { + // Ignore whitespace + if (sibling.ctrlSeq === '\\ ') { + continue; + } else if (intRgx.test(sibling.ctrlSeq || '')) { + precededByInteger = true; + } else { + precededByInteger = false; + break; + } + } + if (precededByInteger) { + output += 'and '; + } + output += this.getEnd(L).mathspeak() + ' ' + newDenSpeech; + return output; + } + } + return _super.prototype.mathspeak.call(this); + }; + FracNode.prototype.getFracDepth = function () { + var level = 0; + var walkUp = function (item, level) { + if (item instanceof MQNode && item.ctrlSeq && item.ctrlSeq.toLowerCase().search('frac') >= 0) + level += 1; + if (item && item.parent) return walkUp(item.parent, level); + else return level; + }; + return walkUp(this, level); + }; + return FracNode; + })(MathCommand)); + var LiveFraction = (LatexCmds.over = CharCmds['/'] = /** @class */ (function (_super) { + __extends(class_12, _super); + function class_12() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + class_12.prototype.createLeftOf = function (cursor) { + if (!this.replacedFragment) { + var leftward = cursor[L]; + if (!cursor.options.typingSlashCreatesNewFraction) { + while ( + leftward && + !( + leftward instanceof BinaryOperator || + leftward instanceof (LatexCmds.text || noop) || + leftward instanceof SummationNotation || + leftward.ctrlSeq === '\\ ' || + /^[,;:]$/.test(leftward.ctrlSeq) + ) //lookbehind for operator + ) + leftward = leftward[L]; + } + if (leftward instanceof SummationNotation && leftward[R] instanceof SupSub) { + leftward = leftward[R]; + var leftwardR = leftward[R]; + if (leftwardR instanceof SupSub && leftwardR.ctrlSeq != leftward.ctrlSeq) + leftward = leftward[R]; + } + if (leftward !== cursor[L] && !cursor.isTooDeep(1)) { + var leftwardR = leftward[R]; + var cursorL = cursor[L]; + this.replaces(new Fragment(leftwardR || cursor.parent.getEnd(L), cursorL)); + cursor[L] = leftward; + } + } + _super.prototype.createLeftOf.call(this, cursor); + }; + return class_12; + })(Fraction)); + var AnsBuilder = function () { + return new MQSymbol('\\operatorname{ans}', h('span', { class: 'dcg-mq-ans' }, [h.text('ans')]), 'ans'); + }; + LatexCmds.ans = AnsBuilder; + var PercentOfBuilder = function () { + return new MQSymbol( + '\\%\\operatorname{of}', + h('span', { class: 'dcg-mq-nonSymbola dcg-mq-operator-name' }, [h.text('% of ')]), + 'percent of' + ); + }; + LatexCmds.percent = LatexCmds.percentof = PercentOfBuilder; + var SquareRoot = /** @class */ (function (_super) { + __extends(SquareRoot, _super); + function SquareRoot() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = '\\sqrt'; + _this_1.domView = new DOMView(1, function (blocks) { + return h('span', { class: 'dcg-mq-non-leaf dcg-mq-sqrt-container' }, [ + h('span', { class: 'dcg-mq-scaled dcg-mq-sqrt-prefix' }, [SVG_SYMBOLS.sqrt.html()]), + h.block('span', { class: 'dcg-mq-non-leaf dcg-mq-sqrt-stem' }, blocks[0]), + ]); + }); + _this_1.textTemplate = ['sqrt(', ')']; + _this_1.mathspeakTemplate = ['StartRoot,', ', EndRoot']; + _this_1.ariaLabel = 'root'; + return _this_1; + } + SquareRoot.prototype.parser = function () { + return latexMathParser.optBlock + .then(function (optBlock) { + return latexMathParser.block.map(function (block) { + var nthroot = new NthRoot(); + nthroot.blocks = [optBlock, block]; + optBlock.adopt(nthroot, 0, 0); + block.adopt(nthroot, optBlock, 0); + return nthroot; + }); + }) + .or(_super.prototype.parser.call(this)); + }; + return SquareRoot; + })(MathCommand); + LatexCmds.sqrt = SquareRoot; + LatexCmds.hat = /** @class */ (function (_super) { + __extends(Hat, _super); + function Hat() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = '\\hat'; + _this_1.domView = new DOMView(1, function (blocks) { + return h('span', { class: 'dcg-mq-non-leaf' }, [ + h('span', { class: 'dcg-mq-hat-prefix' }, [h.text('^')]), + h.block('span', { class: 'dcg-mq-hat-stem' }, blocks[0]), + ]); + }); + _this_1.textTemplate = ['hat(', ')']; + return _this_1; + } + return Hat; + })(MathCommand); + var NthRoot = /** @class */ (function (_super) { + __extends(NthRoot, _super); + function NthRoot() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.domView = new DOMView(2, function (blocks) { + return h('span', { class: 'dcg-mq-nthroot-container dcg-mq-non-leaf' }, [ + h.block('sup', { class: 'dcg-mq-nthroot dcg-mq-non-leaf' }, blocks[0]), + h('span', { class: 'dcg-mq-scaled dcg-mq-sqrt-container' }, [ + h('span', { class: 'dcg-mq-sqrt-prefix dcg-mq-scaled' }, [SVG_SYMBOLS.sqrt.html()]), + h.block('span', { class: 'dcg-mq-sqrt-stem dcg-mq-non-leaf' }, blocks[1]), + ]), + ]); + }); + _this_1.textTemplate = ['sqrt[', '](', ')']; + return _this_1; + } + NthRoot.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += '\\sqrt['; + this.getEnd(L).latexRecursive(ctx); + ctx.latex += ']{'; + this.getEnd(R).latexRecursive(ctx); + ctx.latex += '}'; + this.checkCursorContextClose(ctx); + }; + NthRoot.prototype.mathspeak = function () { + var indexMathspeak = this.getEnd(L).mathspeak(); + var radicandMathspeak = this.getEnd(R).mathspeak(); + this.getEnd(L).ariaLabel = 'Index'; + this.getEnd(R).ariaLabel = 'Radicand'; + if (indexMathspeak === '3') { + // cube root + return 'Start Cube Root, ' + radicandMathspeak + ', End Cube Root'; + } else { + return 'Root Index ' + indexMathspeak + ', Start Root, ' + radicandMathspeak + ', End Root'; + } + }; + return NthRoot; + })(SquareRoot); + LatexCmds.nthroot = NthRoot; + LatexCmds.cbrt = /** @class */ (function (_super) { + __extends(class_13, _super); + function class_13() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + class_13.prototype.createLeftOf = function (cursor) { + _super.prototype.createLeftOf.call(this, cursor); + new Digit('3').createLeftOf(cursor); + cursor.controller.moveRight(); + }; + return class_13; + })(NthRoot); + var DiacriticAbove = /** @class */ (function (_super) { + __extends(DiacriticAbove, _super); + function DiacriticAbove(ctrlSeq, html, textTemplate) { + var _this_1 = this; + var domView = new DOMView(1, function (blocks) { + return h('span', { class: 'dcg-mq-non-leaf' }, [ + h('span', { class: 'dcg-mq-diacritic-above' }, [html]), + h.block('span', { class: 'dcg-mq-diacritic-stem' }, blocks[0]), + ]); + }); + _this_1 = _super.call(this, ctrlSeq, domView, textTemplate) || this; + return _this_1; + } + return DiacriticAbove; + })(MathCommand); + LatexCmds.vec = function () { + return new DiacriticAbove('\\vec', h.entityText('→'), ['vec(', ')']); + }; + LatexCmds.tilde = function () { + return new DiacriticAbove('\\tilde', h.text('~'), ['tilde(', ')']); + }; + var DelimsNode = /** @class */ (function (_super) { + __extends(DelimsNode, _super); + function DelimsNode() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + DelimsNode.prototype.setDOM = function (el) { + var _c; + _super.prototype.setDOM.call(this, el); + var children = this.domFrag().children(); + if (!children.isEmpty()) { + this.delimFrags = ((_c = {}), (_c[L] = children.first()), (_c[R] = children.last()), _c); + } + return this; + }; + return DelimsNode; + })(MathCommand); + // Round/Square/Curly/Angle Brackets (aka Parens/Brackets/Braces) + // first typed as one-sided bracket with matching "ghost" bracket at + // far end of current block, until you type an opposing one + var Bracket = /** @class */ (function (_super) { + __extends(Bracket, _super); + function Bracket(side, open, close, ctrlSeq, end) { + var _c; + var _this_1 = _super.call(this, '\\left' + ctrlSeq, undefined, [open, close]) || this; + _this_1.side = side; + _this_1.sides = + ((_c = {}), (_c[L] = { ch: open, ctrlSeq: ctrlSeq }), (_c[R] = { ch: close, ctrlSeq: end }), _c); + return _this_1; + } + Bracket.prototype.numBlocks = function () { + return 1; + }; + Bracket.prototype.html = function () { + var _this_1 = this; + var leftSymbol = this.getSymbol(L); + var rightSymbol = this.getSymbol(R); + // wait until now so that .side may + this.domView = new DOMView(1, function (blocks) { + return h( + // be set by createLeftOf or parser + 'span', + { class: 'dcg-mq-non-leaf dcg-mq-bracket-container' }, + [ + h( + 'span', + { + style: 'width:' + leftSymbol.width, + class: + 'dcg-mq-scaled dcg-mq-bracket-l dcg-mq-paren' + + (_this_1.side === R ? ' dcg-mq-ghost' : ''), + }, + [leftSymbol.html()] + ), + h.block( + 'span', + { + style: 'margin-left:' + leftSymbol.width + ';margin-right:' + rightSymbol.width, + class: 'dcg-mq-bracket-middle dcg-mq-non-leaf', + }, + blocks[0] + ), + h( + 'span', + { + style: 'width:' + rightSymbol.width, + class: + 'dcg-mq-scaled dcg-mq-bracket-r dcg-mq-paren' + + (_this_1.side === L ? ' dcg-mq-ghost' : ''), + }, + [rightSymbol.html()] + ), + ] + ); + }); + return _super.prototype.html.call(this); + }; + Bracket.prototype.getSymbol = function (side) { + var ch = this.sides[side || R].ch; + return SVG_SYMBOLS[ch] || { width: '0', html: '' }; + }; + Bracket.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += '\\left' + this.sides[L].ctrlSeq; + this.getEnd(L).latexRecursive(ctx); + ctx.latex += '\\right' + this.sides[R].ctrlSeq; + this.checkCursorContextClose(ctx); + }; + Bracket.prototype.mathspeak = function (opts) { + var open = this.sides[L].ch, + close = this.sides[R].ch; + if (open === '|' && close === '|') { + this.mathspeakTemplate = ['StartAbsoluteValue,', ', EndAbsoluteValue']; + this.ariaLabel = 'absolute value'; + } else if (opts && opts.createdLeftOf && this.side) { + var ch = ''; + if (this.side === L) ch = this.textTemplate[0]; + else if (this.side === R) ch = this.textTemplate[1]; + return (this.side === L ? 'left ' : 'right ') + BRACKET_NAMES[ch]; + } else { + this.mathspeakTemplate = ['left ' + BRACKET_NAMES[open] + ',', ', right ' + BRACKET_NAMES[close]]; + this.ariaLabel = BRACKET_NAMES[open] + ' block'; + } + return _super.prototype.mathspeak.call(this); + }; + Bracket.prototype.matchBrack = function (opts, expectedSide, node) { + // return node iff it's a matching 1-sided bracket of expected side (if any) + return ( + node instanceof Bracket && + node.side && + node.side !== -expectedSide && + (!opts.restrictMismatchedBrackets || + OPP_BRACKS[this.sides[this.side].ch] === node.sides[node.side].ch || + { '(': ']', '[': ')' }[this.sides[L].ch] === node.sides[R].ch) && + node + ); + }; + Bracket.prototype.closeOpposing = function (brack) { + brack.side = 0; + brack.sides[this.side] = this.sides[this.side]; // copy over my info (may be + var brackFrag = brack.delimFrags[this.side === L ? L : R] // mismatched, like [a, b)) + .removeClass('dcg-mq-ghost'); + this.replaceBracket(brackFrag, this.side); + }; + Bracket.prototype.createLeftOf = function (cursor) { + var brack; + if (!this.replacedFragment) { + // unless wrapping seln in brackets, + // check if next to or inside an opposing one-sided bracket + var opts = cursor.options; + if (this.sides[L].ch === '|') { + // check both sides if I'm a pipe + brack = + this.matchBrack(opts, R, cursor[R]) || + this.matchBrack(opts, L, cursor[L]) || + this.matchBrack(opts, 0, cursor.parent.parent); + } else { + brack = + this.matchBrack(opts, -this.side, cursor[-this.side]) || + this.matchBrack(opts, -this.side, cursor.parent.parent); + } + } + if (brack) { + var side = (this.side = -brack.side); // may be pipe with .side not yet set + this.closeOpposing(brack); + if (brack === cursor.parent.parent && cursor[side]) { + // move the stuff between + new Fragment(cursor[side], cursor.parent.getEnd(side), -side) // me and ghost outside + .disown() + .withDirAdopt(-side, brack.parent, brack, brack[side]) + .domFrag() + .insDirOf(side, brack.domFrag()); + } + brack.bubble(function (node) { + node.reflow(); + return undefined; + }); + } else { + (brack = this), (side = brack.side); + if (brack.replacedFragment) brack.side = 0; + // wrapping seln, don't be one-sided + else if (cursor[-side]) { + // elsewise, auto-expand so ghost is at far end + brack.replaces(new Fragment(cursor[-side], cursor.parent.getEnd(-side), side)); + cursor[-side] = 0; + } + _super.prototype.createLeftOf.call(this, cursor); + } + if (side === L) cursor.insAtLeftEnd(brack.getEnd(L)); + else cursor.insRightOf(brack); + }; + Bracket.prototype.placeCursor = function () {}; + Bracket.prototype.unwrap = function () { + this.getEnd(L) + .children() + .disown() + .adopt(this.parent, this, this[R]) + .domFrag() + .insertAfter(this.domFrag()); + this.remove(); + }; + Bracket.prototype.deleteSide = function (side, outward, cursor) { + var parent = this.parent, + sib = this[side], + farEnd = parent.getEnd(side); + if (side === this.side) { + // deleting non-ghost of one-sided bracket, unwrap + this.unwrap(); + sib ? cursor.insDirOf(-side, sib) : cursor.insAtDirEnd(side, parent); + return; + } + var opts = cursor.options, + wasSolid = !this.side; + this.side = -side; + // if deleting like, outer close-brace of [(1+2)+3} where inner open-paren + if (this.matchBrack(opts, side, this.getEnd(L).getEnd(this.side))) { + // is ghost, + this.closeOpposing(this.getEnd(L).getEnd(this.side)); // then become [1+2)+3 + var origEnd = this.getEnd(L).getEnd(side); + this.unwrap(); + if (origEnd) origEnd.siblingCreated(cursor.options, side); + if (sib) { + cursor.insDirOf(-side, sib); + } else { + cursor.insAtDirEnd(side, parent); + } + } else { + // if deleting like, inner close-brace of ([1+2}+3) where outer + if (this.matchBrack(opts, side, this.parent.parent)) { + // open-paren is + this.parent.parent.closeOpposing(this); // ghost, then become [1+2+3) + this.parent.parent.unwrap(); + } // else if deleting outward from a solid pair, unwrap + else if (outward && wasSolid) { + this.unwrap(); + sib ? cursor.insDirOf(-side, sib) : cursor.insAtDirEnd(side, parent); + return; + } else { + // else deleting just one of a pair of brackets, become one-sided + this.sides[side] = getOppBracketSide(this); + this.delimFrags[L].removeClass('dcg-mq-ghost'); + this.delimFrags[R].removeClass('dcg-mq-ghost'); + var brackFrag = this.delimFrags[side].addClass('dcg-mq-ghost'); + this.replaceBracket(brackFrag, side); + } + if (sib) { + // auto-expand so ghost is at far end + var leftEnd = this.getEnd(L); + var origEnd = leftEnd.getEnd(side); + leftEnd.domFrag().removeClass('dcg-mq-empty'); + new Fragment(sib, farEnd, -side) + .disown() + .withDirAdopt(-side, leftEnd, origEnd, 0) + .domFrag() + .insAtDirEnd(side, leftEnd.domFrag().oneElement()); + if (origEnd) origEnd.siblingCreated(cursor.options, side); + cursor.insDirOf(-side, sib); + } // didn't auto-expand, cursor goes just outside or just inside parens + else outward ? cursor.insDirOf(side, this) : cursor.insAtDirEnd(side, this.getEnd(L)); + } + }; + Bracket.prototype.replaceBracket = function (brackFrag, side) { + var symbol = this.getSymbol(side); + brackFrag.children().replaceWith(domFrag(symbol.html())); + brackFrag.oneElement().style.width = symbol.width; + if (side === L) { + var next = brackFrag.next(); + if (!next.isEmpty()) { + next.oneElement().style.marginLeft = symbol.width; + } + } else { + var prev = brackFrag.prev(); + if (!prev.isEmpty()) { + prev.oneElement().style.marginRight = symbol.width; + } + } + }; + Bracket.prototype.deleteTowards = function (dir, cursor) { + this.deleteSide(-dir, false, cursor); + }; + Bracket.prototype.finalizeTree = function () { + this.getEnd(L).deleteOutOf = function (dir, cursor) { + this.parent.deleteSide(dir, true, cursor); + }; + // FIXME HACK: after initial creation/insertion, finalizeTree would only be + // called if the paren is selected and replaced, e.g. by LiveFraction + this.finalizeTree = this.intentionalBlur = function () { + this.delimFrags[this.side === L ? R : L].removeClass('dcg-mq-ghost'); + this.side = 0; + }; + }; + Bracket.prototype.siblingCreated = function (_opts, dir) { + // if something typed between ghost and far + if (dir === -this.side) this.finalizeTree(); // end of its block, solidify + }; + return Bracket; + })(DelimsNode); + function getOppBracketSide(bracket) { + var side = bracket.side; + var data = bracket.sides[side]; + return { + ch: OPP_BRACKS[data.ch], + ctrlSeq: OPP_BRACKS[data.ctrlSeq], + }; + } + var OPP_BRACKS = { + '(': ')', + ')': '(', + '[': ']', + ']': '[', + '{': '}', + '}': '{', + '\\{': '\\}', + '\\}': '\\{', + '⟨': '⟩', + '⟩': '⟨', + '\\langle ': '\\rangle ', + '\\rangle ': '\\langle ', + '|': '|', + '\\lVert ': '\\rVert ', + '\\rVert ': '\\lVert ', + }; + var BRACKET_NAMES = { + '⟨': 'angle-bracket', + '⟩': 'angle-bracket', + '|': 'pipe', + }; + function bindCharBracketPair(open, ctrlSeq, name) { + var ctrlSeq = ctrlSeq || open; + var close = OPP_BRACKS[open]; + var end = OPP_BRACKS[ctrlSeq]; + CharCmds[open] = function () { + return new Bracket(L, open, close, ctrlSeq, end); + }; + CharCmds[close] = function () { + return new Bracket(R, open, close, ctrlSeq, end); + }; + BRACKET_NAMES[open] = BRACKET_NAMES[close] = name; + } + bindCharBracketPair('(', '', 'parenthesis'); + bindCharBracketPair('[', '', 'bracket'); + bindCharBracketPair('{', '\\{', 'brace'); + LatexCmds.langle = function () { + return new Bracket(L, '⟨', '⟩', '\\langle ', '\\rangle '); + }; + LatexCmds.rangle = function () { + return new Bracket(R, '⟨', '⟩', '\\langle ', '\\rangle '); + }; + CharCmds['|'] = function () { + return new Bracket(L, '|', '|', '|', '|'); + }; + LatexCmds.lVert = function () { + return new Bracket(L, '∥', '∥', '\\lVert ', '\\rVert '); + }; + LatexCmds.rVert = function () { + return new Bracket(R, '∥', '∥', '\\lVert ', '\\rVert '); + }; + LatexCmds.left = /** @class */ (function (_super) { + __extends(left, _super); + function left() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + left.prototype.parser = function () { + var regex = Parser.regex; + var string = Parser.string; + var optWhitespace = Parser.optWhitespace; + return optWhitespace + .then(regex(/^(?:[([|]|\\\{|\\langle(?![a-zA-Z])|\\lVert(?![a-zA-Z]))/)) + .then(function (ctrlSeq) { + var open = ctrlSeq.replace(/^\\/, ''); + if (ctrlSeq == '\\langle') { + open = '⟨'; + ctrlSeq = ctrlSeq + ' '; + } + if (ctrlSeq == '\\lVert') { + open = '∥'; + ctrlSeq = ctrlSeq + ' '; + } + return latexMathParser.then(function (block) { + return string('\\right') + .skip(optWhitespace) + .then(regex(/^(?:[\])|]|\\\}|\\rangle(?![a-zA-Z])|\\rVert(?![a-zA-Z]))/)) + .map(function (end) { + var close = end.replace(/^\\/, ''); + if (end == '\\rangle') { + close = '⟩'; + end = end + ' '; + } + if (end == '\\rVert') { + close = '∥'; + end = end + ' '; + } + var cmd = new Bracket(0, open, close, ctrlSeq, end); + cmd.blocks = [block]; + block.adopt(cmd, 0, 0); + return cmd; + }); + }); + }); + }; + return left; + })(MathCommand); + LatexCmds.right = /** @class */ (function (_super) { + __extends(right, _super); + function right() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + right.prototype.parser = function () { + return Parser.fail('unmatched \\right'); + }; + return right; + })(MathCommand); + var leftBinomialSymbol = SVG_SYMBOLS['(']; + var rightBinomialSymbol = SVG_SYMBOLS[')']; + var Binomial = /** @class */ (function (_super) { + __extends(Binomial, _super); + function Binomial() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = '\\binom'; + _this_1.domView = new DOMView(2, function (blocks) { + return h('span', { class: 'dcg-mq-non-leaf dcg-mq-bracket-container' }, [ + h( + 'span', + { + style: 'width:' + leftBinomialSymbol.width, + class: 'dcg-mq-paren dcg-mq-bracket-l dcg-mq-scaled', + }, + [leftBinomialSymbol.html()] + ), + h( + 'span', + { + style: + 'margin-left:' + + leftBinomialSymbol.width + + '; margin-right:' + + rightBinomialSymbol.width, + class: 'dcg-mq-non-leaf dcg-mq-bracket-middle', + }, + [ + h('span', { class: 'dcg-mq-array dcg-mq-non-leaf' }, [ + h.block('span', {}, blocks[0]), + h.block('span', {}, blocks[1]), + ]), + ] + ), + h( + 'span', + { + style: 'width:' + rightBinomialSymbol.width, + class: 'dcg-mq-paren dcg-mq-bracket-r dcg-mq-scaled', + }, + [rightBinomialSymbol.html()] + ), + ]); + }); + _this_1.textTemplate = ['choose(', ',', ')']; + _this_1.mathspeakTemplate = ['StartBinomial,', 'Choose', ', EndBinomial']; + _this_1.ariaLabel = 'binomial'; + return _this_1; + } + return Binomial; + })(DelimsNode); + LatexCmds.binom = LatexCmds.binomial = Binomial; + LatexCmds.choose = /** @class */ (function (_super) { + __extends(class_14, _super); + function class_14() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + class_14.prototype.createLeftOf = function (cursor) { + LiveFraction.prototype.createLeftOf(cursor); + }; + return class_14; + })(Binomial); + var MathFieldNode = /** @class */ (function (_super) { + __extends(MathFieldNode, _super); + function MathFieldNode() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = '\\MathQuillMathField'; + _this_1.domView = new DOMView(1, function (blocks) { + return h('span', { class: 'dcg-mq-editable-field' }, [ + h.block('span', { class: 'dcg-mq-root-block', 'aria-hidden': 'true' }, blocks[0]), + ]); + }); + return _this_1; + } + MathFieldNode.prototype.parser = function () { + var self = this, + string = Parser.string, + regex = Parser.regex, + succeed = Parser.succeed; + return string('[') + .then(regex(/^[a-z][a-z0-9]*/i)) + .skip(string(']')) + .map(function (name) { + self.name = name; + }) + .or(succeed(undefined)) + .then(_super.prototype.parser.call(this)); + }; + MathFieldNode.prototype.finalizeTree = function (options) { + var ctrlr = new Controller(this.getEnd(L), this.domFrag().oneElement(), options); + ctrlr.KIND_OF_MQ = 'MathField'; + ctrlr.editable = true; + ctrlr.createTextarea(); + ctrlr.editablesTextareaEvents(); + ctrlr.cursor.insAtRightEnd(ctrlr.root); + RootBlockMixin(ctrlr.root); + // MathQuill applies aria-hidden to .dcg-mq-root-block containers + // because these contain math notation that screen readers can't + // interpret directly. MathQuill use an aria-live region as a + // sibling of these block containers to provide an alternative + // representation for screen readers + // + // MathFieldNodes have their own focusable text aria and aria live + // region, so it is incorrect for any parent of the editable field + // to have an aria-hidden property + // + // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden + // + // Handle this by recursively walking the parents of this element + // until we hit a root block, and if we hit any parent with + // aria-hidden="true", removing the property from the parent and + // pushing it down to each of the parents children. This should + // result in no parent of this node having aria-hidden="true", but + // should keep as much of what was previously hidden hidden as + // possible while obeying this constraint + function pushDownAriaHidden(node) { + if (node.parentNode && !domFrag(node).hasClass('dcg-mq-root-block')) { + pushDownAriaHidden(node.parentNode); + } + if (node.nodeType === Node.ELEMENT_NODE) { + var element = node; + if (element.getAttribute('aria-hidden') === 'true') { + element.removeAttribute('aria-hidden'); + domFrag(node) + .children() + .eachElement(function (child) { + child.setAttribute('aria-hidden', 'true'); + }); + } + } + } + pushDownAriaHidden(this.domFrag().parent().oneElement()); + this.domFrag().oneElement().removeAttribute('aria-hidden'); + }; + MathFieldNode.prototype.registerInnerField = function (innerFields, MathField) { + var controller = this.getEnd(L).controller; + var newField = new MathField(controller); + innerFields[this.name] = newField; + innerFields.push(newField); + }; + MathFieldNode.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + this.getEnd(L).latexRecursive(ctx); + this.checkCursorContextClose(ctx); + }; + MathFieldNode.prototype.text = function () { + return this.getEnd(L).text(); + }; + return MathFieldNode; + })(MathCommand); + LatexCmds.editable = LatexCmds.MathQuillMathField = MathFieldNode; // backcompat with before cfd3620 on #233 + // Embed arbitrary things + // Probably the closest DOM analogue would be an iframe? + // From MathQuill's perspective, it's a MQSymbol, it can be + // anywhere and the cursor can go around it but never in it. + // Create by calling public API method .dropEmbedded(), + // or by calling the global public API method .registerEmbed() + // and rendering LaTeX like \embed{registeredName} (see test). + var EmbedNode = /** @class */ (function (_super) { + __extends(EmbedNode, _super); + function EmbedNode() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + EmbedNode.prototype.setOptions = function (options) { + function noop() { + return ''; + } + this.text = options.text || noop; + this.domView = new DOMView(0, function () { + return h('span', {}, [parseHTML(options.htmlString || '')]); + }); + this.latex = options.latex || noop; + return this; + }; + EmbedNode.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += this.latex(); + this.checkCursorContextClose(ctx); + }; + EmbedNode.prototype.parser = function () { + var self = this, + string = Parser.string, + regex = Parser.regex, + succeed = Parser.succeed; + return string('{') + .then(regex(/^[a-z][a-z0-9]*/i)) + .skip(string('}')) + .then(function (name) { + // the chars allowed in the optional data block are arbitrary other than + // excluding curly braces and square brackets (which'd be too confusing) + return string('[') + .then(regex(/^[-\w\s]*/)) + .skip(string(']')) + .or(succeed(undefined)) + .map(function (data) { + return self.setOptions(EMBEDS[name](data)); + }); + }); + }; + return EmbedNode; + })(MQSymbol); + LatexCmds.embed = EmbedNode; + /**************************************** + * Input box to type backslash commands + ***************************************/ + CharCmds['\\'] = /** @class */ (function (_super) { + __extends(LatexCommandInput, _super); + function LatexCommandInput() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = '\\'; + _this_1.domView = new DOMView(1, function (blocks) { + return h('span', { class: 'dcg-mq-latex-command-input-wrapper dcg-mq-non-leaf' }, [ + h('span', { class: 'dcg-mq-latex-command-input dcg-mq-non-leaf' }, [ + h.text('\\'), + h.block('span', {}, blocks[0]), + ]), + ]); + }); + _this_1.textTemplate = ['\\']; + return _this_1; + } + LatexCommandInput.prototype.replaces = function (replacedFragment) { + this._replacedFragment = replacedFragment.disown(); + this.isEmpty = function () { + return false; + }; + }; + LatexCommandInput.prototype.createBlocks = function () { + _super.prototype.createBlocks.call(this); + var endsL = this.getEnd(L); + endsL.focus = function () { + this.parent.domFrag().addClass('dcg-mq-hasCursor'); + if (this.isEmpty()) this.parent.domFrag().removeClass('dcg-mq-empty'); + return this; + }; + endsL.blur = function () { + this.parent.domFrag().removeClass('dcg-mq-hasCursor'); + if (this.isEmpty()) this.parent.domFrag().addClass('dcg-mq-empty'); + return this; + }; + endsL.write = function (cursor, ch) { + cursor.show().deleteSelection(); + if (ch.match(/[a-z]/i)) { + new VanillaSymbol(ch).createLeftOf(cursor); + // TODO needs tests + cursor.controller.aria.alert(ch); + } else { + var cmd = this.parent.renderCommand(cursor); + // TODO needs tests + cursor.controller.aria.queue(cmd.mathspeak({ createdLeftOf: cursor })); + if (ch !== '\\' || !this.isEmpty()) cursor.parent.write(cursor, ch); + else cursor.controller.aria.alert(); + } + }; + var originalKeystroke = endsL.keystroke; + endsL.keystroke = function (key, e, ctrlr) { + if (key === 'Tab' || key === 'Enter' || key === 'Spacebar') { + var cmd = this.parent.renderCommand(ctrlr.cursor); + // TODO needs tests + ctrlr.aria.alert(cmd.mathspeak({ createdLeftOf: ctrlr.cursor })); + e === null || e === void 0 ? void 0 : e.preventDefault(); + return; + } + return originalKeystroke.call(this, key, e, ctrlr); + }; + }; + LatexCommandInput.prototype.createLeftOf = function (cursor) { + _super.prototype.createLeftOf.call(this, cursor); + if (this._replacedFragment) { + var frag = this.domFrag(); + var el_1 = frag.oneElement(); + this._replacedFragment.domFrag().addClass('dcg-mq-blur'); + //FIXME: is monkey-patching the mousedown and mousemove handlers the right way to do this? + var rewriteMousedownEventTarget = function (e) { + { + // TODO - overwritting e.target + e.target = el_1; + el_1.dispatchEvent(e); + return false; + } + }; + el_1.addEventListener('mousedown', rewriteMousedownEventTarget); + el_1.addEventListener('mouseup', rewriteMousedownEventTarget); + this._replacedFragment.domFrag().insertBefore(frag.children().first()); + } + }; + LatexCommandInput.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += '\\'; + this.getEnd(L).latexRecursive(ctx); + ctx.latex += ' '; + this.checkCursorContextClose(ctx); + }; + LatexCommandInput.prototype.renderCommand = function (cursor) { + this.setDOM(this.domFrag().children().lastElement()); + this.remove(); + if (this[R]) { + cursor.insLeftOf(this[R]); + } else { + cursor.insAtRightEnd(this.parent); + } + var latex = this.getEnd(L).latex(); + if (!latex) latex = ' '; + var cmd = LatexCmds[latex]; + if (cmd) { + //console.log(cmd); + var node = void 0; + if (isMQNodeClass(cmd)) { + node = new cmd(latex); + } else { + node = cmd(latex); + } + if (this._replacedFragment) node.replaces(this._replacedFragment); + node.createLeftOf(cursor); + return node; + } else { + var node = new TextBlock(); + node.replaces(latex); + node.createLeftOf(cursor); + cursor.insRightOf(node); + if (this._replacedFragment) { + this._replacedFragment.remove(); + } + return node; + } + }; + return LatexCommandInput; + })(MathCommand); + // For backwards compatibility, set up the global MathQuill object as an instance of API interface v1 + if (window.jQuery) { + MQ1 = getInterface(1); + for (var key in MQ1) + (function (key, val) { + if (typeof val === 'function') { + MathQuill[key] = function () { + insistOnInterVer(); + return val.apply(this, arguments); + }; + MathQuill[key].prototype = val.prototype; + } else MathQuill[key] = val; + })(key, MQ1[key]); + } + //console.log(MathQuill); + })(); +} + diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index 654eaaf..4bc48ad 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -11,6 +11,9 @@ module.exports = { background: path.join(__dirname, `../${SRC_DIR_NAME}/background/${browser}/background.ts`), contentscript: path.join(__dirname, `../${SRC_DIR_NAME}/contentscript.ts`), inject: path.join(__dirname, `../${SRC_DIR_NAME}/inject.ts`), + extend_mathquill: path.join(__dirname, `../${SRC_DIR_NAME}/extend_mathquill.ts`), + preload_content: path.join(__dirname, `../${SRC_DIR_NAME}/preload_content.ts`), + preload_inject: path.join(__dirname, `../${SRC_DIR_NAME}/preload_inject.ts`), }, output: { path: path.join(__dirname, `../${BUILD_DIR_NAME}`), From 464c621c62af714b3c59935e20a8680ef37f8a0c Mon Sep 17 00:00:00 2001 From: SinclaM Date: Sat, 9 Jul 2022 16:24:23 -0500 Subject: [PATCH 02/32] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dad0b2f..521268a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Support for the following features planned: ## Download links * Firefox: https://addons.mozilla.org/en-US/firefox/addon/desmos-unlocked/ * Chrome: https://chrome.google.com/webstore/detail/desmos-unlocked/mgkcmbkophlnagckoodcmaeofginaokm -* Edge: __coming soon__ +* Edge: https://microsoftedge.microsoft.com/addons/detail/desmos-unlocked/lojelmbmlhfakfgnngkmmfhjbianabgh * Opera: https://addons.opera.com/en/extensions/details/desmos-unlocked/ ## Installing locally From 15a19a03e31c53c2856c70f0e874aa1199ece8e0 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Sun, 10 Jul 2022 00:26:00 -0500 Subject: [PATCH 03/32] Fix webpack optimization issues and refactor --- src/extend_mathquill.js | 9261 +++++++++++++++++++++++++++++++++++++ src/extend_mathquill.ts | 8861 ----------------------------------- src/popup.ts | 2 +- src/preload_inject.ts | 8832 +---------------------------------- tsconfig.json | 31 +- webpack/webpack.common.js | 8 +- 6 files changed, 9279 insertions(+), 17716 deletions(-) create mode 100644 src/extend_mathquill.js delete mode 100644 src/extend_mathquill.ts diff --git a/src/extend_mathquill.js b/src/extend_mathquill.js new file mode 100644 index 0000000..383df0c --- /dev/null +++ b/src/extend_mathquill.js @@ -0,0 +1,9261 @@ +/* eslint-disable */ +export default function() { + var L = -1; + var R = 1; + var min = Math.min; + var max = Math.max; + function noop() { } + /** + * a development-only debug method. This definition and all + * calls to `pray` will be stripped from the minified + * build of mathquill. + * + * This function must be called by name to be removed + * at compile time. Do not define another function + * with the same name, and only call this function by + * name. + */ + function pray(message, cond) { + if (!cond) + throw new Error('prayer failed: ' + message); + } + function prayDirection(dir) { + pray('a direction was passed', dir === L || dir === R); + } + var urlParams = new URLSearchParams(window.location.search); + function parseHTML(s) { + // https://youmightnotneedjquery.com/#parse_html + var tmp = document.implementation.createHTMLDocument(''); + tmp.body.innerHTML = s; + if (tmp.body.children.length === 1) + return tmp.body.children[0]; + var frag = document.createDocumentFragment(); + while (tmp.body.firstChild) { + frag.appendChild(tmp.body.firstChild); + } + return frag; + } + var h = function h(type, attributes, children) { + var el; + switch (type) { + case 'svg': + case 'path': + el = document.createElementNS('http://www.w3.org/2000/svg', type); + break; + default: + el = document.createElement(type); + } + for (var key_1 in attributes) { + var value = attributes[key_1]; + if (value === undefined) + continue; + el.setAttribute(key_1, typeof value === 'string' ? value : String(value)); + } + if (children) { + for (var i = 0; i < children.length; i++) { + el.appendChild(children[i]); + } + } + return el; + }; + h.text = function (s) { return document.createTextNode(s); }; + h.block = function (type, attributes, block) { + var out = h(type, attributes, [block.html()]); + block.setDOM(out); + NodeBase.linkElementByBlockNode(out, block); + return out; + }; + h.entityText = function (s) { + // TODO: replace with h.text(U_BLAHBLAH) or maybe a named entity->unicode lookup + var val = parseHTML(s); + pray('entity parses to a single text node', val instanceof DocumentFragment && + val.childNodes.length === 1 && + val.childNodes[0] instanceof Text); + return val.childNodes[0]; + }; + function closest(el, s) { + var _a, _b, _c; + if (typeof ((_a = el) === null || _a === void 0 ? void 0 : _a.closest) === 'function') { + return el.closest(s); + } + if (!(el instanceof HTMLElement)) + return null; + // https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#polyfill + var matches = Element.prototype.matches || + Element.prototype.msMatchesSelector || + Element.prototype.webkitMatchesSelector; + var match = el; + do { + if (matches.call(match, s)) + return match; + match = (_c = (_b = match === null || match === void 0 ? void 0 : match.parentElement) !== null && _b !== void 0 ? _b : match === null || match === void 0 ? void 0 : match.parentNode) !== null && _c !== void 0 ? _c : null; + } while (match !== null && match.nodeType === 1); + return null; + } + var U_NO_BREAK_SPACE = '\u00A0'; + var U_ZERO_WIDTH_SPACE = '\u200B'; + var U_DOT_ABOVE = '\u02D9'; + var U_NARY_SUMMATION = '\u2211'; + var U_NARY_PRODUCT = '\u220F'; + var U_NARY_COPRODUCT = '\u2210'; + var U_INTEGRAL = '\u222B'; + /** + * Like `el.getBoundingClientRect()` but avoids throwing for + * disconnected and hidden elements in IE <= 11. + * */ + function getBoundingClientRect(el) { + // Return zeros for disconnected and hidden (display: none) elements + // Running getBoundingClientRect on a disconnected node in IE <=11 throws an error + // https://github.com/jquery/jquery/blob/a684e6ba836f7c553968d7d026ed7941e1a612d8/src/offset.js#L83-L86 + if (!el.getClientRects().length) { + return { + top: 0, + left: 0, + height: 0, + width: 0, + x: 0, + y: 0, + bottom: 0, + right: 0, + }; + } + return el.getBoundingClientRect(); + } + /** + * Returns the number of pixels that the document is currently scrolled + * horizontally -- `window.scrollX` in modern browsers. + * */ + function getScrollX() { + // In IE9, scrollX was called pageXOffset + // Previous versions of IE had neither property and use scrollLeft instead + // + // https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX#notes + return window.pageXOffset !== undefined + ? window.pageXOffset + : (document.documentElement || document.body.parentNode || document.body) + .scrollLeft; + } + /** + * Returns the number of pixels that the document is currently scrolled + * vertically -- `window.scrollY` in modern browsers. + * */ + function getScrollY() { + // In IE9, scrollY was called pageYOffset + // Previous versions of IE had neither property and use scrollTop instead + // + // https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX#notes + return window.pageYOffset !== undefined + ? window.pageYOffset + : (document.documentElement || document.body.parentNode || document.body) + .scrollTop; + } + /** + * Given `duration` in ms and callback `cb`, immediately calls `cb(progress, scheduleNext, cancel)` with: + * - `progress` set to `0` if duration > 0, or 1 if duration <= 0 + * - `scheduleNext` a function that schedules a future call to `cb` + * - `cancel` a function that cancels any pending `scheduleNext` call. + * + * `scheduleNext` schedules a call to `cb` with `progress` set to the + * ratio of currently elapsed time and `duration`. + * + * To continue running the animation, `cb` should call `scheduleNext`. + * + * To stop the animation, it is the responsibility of `cb` to check + * whether progress is greater than or equal to 1, in which case `cb` + * should not call `scheduleNext`. + * + * `scheduleNext` uses `requestAnimationFrame` if available and falls + * back to `setTimeout(..., 13)` otherwise. Times are always based on + * `Date.now()` for compatibility between `requestAnimationFrame` and + * the `setTimeout` fallback. `cb` will only be called with strictly + * monotonic `progress` values. + * + * Note: `animate` purposely puts a lot of responsibility on the caller + * to keep its implementation simple because it isn't used very widely + * in the project. + */ + var animate = (function () { + // IIFE exists just to hang on to configured rafShim and cancelShim + // functions + var rafShim, cancelShim; + if (typeof requestAnimationFrame === 'function' && + typeof cancelAnimationFrame === 'function') { + rafShim = requestAnimationFrame; + cancelShim = cancelAnimationFrame; + } + else { + rafShim = function (cb) { return setTimeout(cb, 13); }; + cancelShim = clearTimeout; + } + return function (duration, cb) { + var start = Date.now(); + var cancelToken; + var progress = 0; + function step() { + var proposedProgress = (Date.now() - start) / duration; + // Enforce that progress is strictly monotonic + if (proposedProgress <= progress) { + scheduleNext(); + } + else { + progress = proposedProgress; + } + cb(progress, scheduleNext, cancel); + } + function cancel() { + if (cancelToken !== undefined) + cancelShim(cancelToken); + cancelToken = undefined; + } + function scheduleNext() { + // Calling cancel here ensures that there are never multiple + // concurrent callbacks scheduled for a single animation, even if + // the caller calls `scheduleNext` multiple times in a single + // event loop (which is always a mistake) + cancel(); + cancelToken = rafShim(step); + } + cb(duration <= 0 ? 1 : 0, scheduleNext, cancel); + }; + })(); + var Aria = /** @class */ (function () { + function Aria(controller) { + this.span = h('span', { + class: 'dcg-mq-aria-alert', + 'aria-live': 'assertive', + 'aria-atomic': 'true', + }); + this.msg = ''; + this.items = []; + this.controller = controller; + } + Aria.prototype.attach = function () { + var container = this.controller.container; + if (this.span.parentNode !== container) { + domFrag(container).prepend(domFrag(this.span)); + } + }; + Aria.prototype.queue = function (item, shouldDescribe) { + if (shouldDescribe === void 0) { shouldDescribe = false; } + var output = ''; + if (item instanceof MQNode) { + // Some constructs include verbal shorthand (such as simple fractions and exponents). + // Since ARIA alerts relate to moving through interactive content, we don't want to use that shorthand if it exists + // since doing so may be ambiguous or confusing. + var itemMathspeak = item.mathspeak({ ignoreShorthand: true }); + if (shouldDescribe) { + // used to ensure item is described when cursor reaches block boundaries + if (item.parent && + item.parent.ariaLabel && + item.ariaLabel === 'block') { + output = item.parent.ariaLabel + ' ' + itemMathspeak; + } + else if (item.ariaLabel) { + output = item.ariaLabel + ' ' + itemMathspeak; + } + } + if (output === '') { + output = itemMathspeak; + } + } + else { + output = item || ''; + } + this.items.push(output); + return this; + }; + Aria.prototype.queueDirOf = function (dir) { + prayDirection(dir); + return this.queue(dir === L ? 'before' : 'after'); + }; + Aria.prototype.queueDirEndOf = function (dir) { + prayDirection(dir); + return this.queue(dir === L ? 'beginning of' : 'end of'); + }; + Aria.prototype.alert = function (t) { + this.attach(); + if (t) + this.queue(t); + if (this.items.length) { + // To cut down on potential verbiage from multiple Mathquills firing near-simultaneous ARIA alerts, + // update the text of this instance if its container also has keyboard focus. + // If it does not, leave the DOM unchanged but flush the queue regardless. + // Note: updating the msg variable regardless of focus for unit tests. + this.msg = this.items + .join(' ') + .replace(/ +(?= )/g, '') + .trim(); + if (this.controller.containerHasFocus()) { + this.span.textContent = this.msg; + } + } + return this.clear(); + }; + Aria.prototype.clear = function () { + this.items.length = 0; + return this; + }; + return Aria; + }()); + /** + * A `DOMFragment` represents a contiguous span of sibling DOM Nodes, + * which may include both Element nodes and other nodes like Text and + * Comment nodes. A `DOMFragment` may represent zero or more nodes. + * + * `DOMFragments` are created using the `DOMFragment.create` factory + * function, which is also aliased as `domFrag` for convenience. + * + * A `DOMFragment` simply holds references to nodes. It doesn't move or + * mutate them in the way that the native `DocumentFragment` does. + * + * `DOMFragment` implements many of the same methods for manipulating a + * collection of DOM elements that jQuery does, but it has some notable + * differences: + * + * 1. A jQuery collection can hold an arbitrary ordered set of DOM + * elements, but a `DOMFragment` can only hold a contiguous span of + * sibling nodes. + * 2. Some jQuery DOM manipulation methods like `insert{Before,After}`, + * `append`, `prepend`, `appendTo`, `prependTo`, etc. may insert + * several clones of a collection into different places in the DOM. + * `DOMFragment` never makes clones of DOM nodes--instead, when + * targeting multi-element fragments, it moves source nodes before + * or after the targeted fragment as appropriate without ever making + * more copies. + * 3. For methods like `.children()`, where it's likely to be a mistake + * to call the method on a fragment that doesn't contain exactly one + * node or element, `DOMFragment` will throw whereas jQuery will + * silently do something possibly unintended. Methods that assert + * are commented with the properties that they assert. + * + * Internally, `DOMFragment` holds immutable references to the left and + * right end nodes (if the fragment is not empty). The other nodes are + * represented implicitly through the sibling pointers of the DOM nodes + * themselves. This means that it is possible to invalidate a + * `DOMFragment` by moving one of its ends without moving the other in + * such a way that they are no longer siblings. It is also possible to + * change the contents of a `DOMFragment` by adding or removing DOM + * nodes between its ends. + */ + var DOMFragment = /** @class */ (function () { + /** + * Constructor is private to enforce that the invariant checks in + * `create` are applied to outside callers. Internal methods are + * allowed to use this constructor when they can guarantee they're + * passing sibling nodes (such as children of a parent node). + */ + function DOMFragment(first, last) { + var _a; + if (arguments.length === 1) + last = first; + if (!first || !last) + return; + this.ends = (_a = {}, _a[L] = first, _a[R] = last, _a); + } + /** + * Returns a `DOMFragment` representing the contiguous span of sibling + * DOM nodes betewen `first` and `last`. If only one element is + * passed, creates a `DOMFragment` representing that single element. + * If no elements are passed, creates and empty `DOMFragment`. + * + * If two elements are passed, asserts that the second element is a + * forward sibling of the first element. Checking this invariant is + * O(n) in the total number of nodes in the fragment + */ + DOMFragment.create = function (first, last) { + if (arguments.length === 1) + last = first; + pray('No half-empty DOMFragments', !!first === !!last); + var out = new DOMFragment(first, last); + pray('last is a forward sibling of first', out.isValid()); + return out; + }; + DOMFragment.prototype.isEmpty = function () { + return this.ends === undefined; + }; + DOMFragment.prototype.isOneNode = function () { + return !!(this.ends && this.ends[L] === this.ends[R]); + }; + /** + * Returns true if the fragment is empty or if its last node is equal + * to its first node or is a forward sibling of its first node. + * + * DOMFragments may be invalidated if any of the nodes they contain + * are moved or removed independently of the other nodes they contain. + * + * Note that this check visits each node in the fragment, so it is + * O(n). + */ + DOMFragment.prototype.isValid = function () { + if (!this.ends) + return true; + if (this.ends[L] === this.ends[R]) + return true; + var maybeLast; + this.eachNode(function (el) { return (maybeLast = el); }); + return maybeLast === this.ends[R]; + }; + /** + * Return the first Node of this fragment. May be a a Node that is not + * an Element such as a Text or Comment node. + * + * Asserts fragment is not empty. + */ + DOMFragment.prototype.firstNode = function () { + pray('Fragment is not empty', this.ends); + return this.ends[L]; + }; + /** + * Return the last Node of this fragment. May be a a Node that is not + * an Element such as a Text or Comment node. + * + * Asserts fragment is not empty. + */ + DOMFragment.prototype.lastNode = function () { + pray('Fragment is not empty', this.ends); + return this.ends[R]; + }; + /** + * Return a fragment representing the children (including Text and + * Comment nodes) of the node represented by this fragment. + * + * Asserts that this fragment contains exactly one Node. + * + * Note, because this includes text and comment nodes, this is more + * like jQuery's .contents() than jQuery's .children() + */ + DOMFragment.prototype.children = function () { + var el = this.oneNode(); + var first = el.firstChild; + var last = el.lastChild; + return first && last ? new DOMFragment(first, last) : new DOMFragment(); + }; + /** + * Return a new `DOMFragment` spanning this fragment and `sibling` + * fragment. Does not perform any DOM operations. + * + * Asserts that `sibling` is either empty or a forward sibling of + * this fragment that may share its first node with the last node of + * this fragment + */ + DOMFragment.prototype.join = function (sibling) { + if (!this.ends) + return sibling; + if (!sibling.ends) + return this; + // Check if sibling is actually a sibling of this span + var found = false; + var current = this.ends[R].nextSibling; + while (current) { + if (current === sibling.ends[L]) { + found = true; + break; + } + current = current.nextSibling; + } + pray('sibling must be a forward DOM sibling of this fragment', found); + return new DOMFragment(this.ends[L], sibling.ends[R]); + }; + /** + * Return the single DOM Node represented by this fragment. + * + * Asserts that this fragment contains exactly one Node. + */ + DOMFragment.prototype.oneNode = function () { + pray('Fragment has a single node', this.ends && this.ends[L] === this.ends[R]); + return this.ends[L]; + }; + /** + * Return the single DOM Element represented by this fragment. + * + * Asserts that this fragment contains exactly one Node, and that node + * is an Element node. + */ + DOMFragment.prototype.oneElement = function () { + var el = this.oneNode(); + pray('Node is an Element', el.nodeType === Node.ELEMENT_NODE); + return el; + }; + /** + * Return the single DOM Text node represented by this fragment. + * + * Asserts that this fragment contains exactly one Node, and that node + * is a Text node. + */ + DOMFragment.prototype.oneText = function () { + var el = this.oneNode(); + pray('Node is Text', el.nodeType === Node.TEXT_NODE); + return el; + }; + /** + * Calls callback sequentially with each node in this fragment. + * Includes nodes that are not Elements, such as Text and Comment + * nodes. + */ + DOMFragment.prototype.eachNode = function (cb) { + if (!this.ends) + return this; + var stop = this.ends[R]; + for (var node = this.ends[L], next = void 0; node; node = next) { + // Note, this loop is organized in a slightly tricky way in order + // cache "next" before calling the callback. This is done because + // the callback could mutate node.nextSibling (e.g. by moving the + // node to a documentFragment, like toDocumentFragment does). + // + // It's still possible to break this iteration by messing with + // forward siblings of node in the callback, although it's + // probably rare to want to do that. Perhaps this means "each" is + // too dangerous to have as a public method. + next = node.nextSibling; + cb(node); + if (node === stop) + break; + } + return this; + }; + /** + * Calls callback sequentially with each Element node in this + * fragment. Skips nodes that are not Elements, such as Text and + * Comment nodes. + */ + DOMFragment.prototype.eachElement = function (cb) { + this.eachNode(function (el) { + if (el.nodeType === Node.ELEMENT_NODE) + cb(el); + }); + return this; + }; + /** + * Returns the concatenated text content of all of the nodes in the + * fragment. + */ + DOMFragment.prototype.text = function () { + var accum = ''; + this.eachNode(function (node) { + accum += node.textContent || ''; + }); + return accum; + }; + /** + * Returns an array of all the Nodes in this fragment, including nodes + * that are not Element nodes such as Text and Comment nodes; + */ + DOMFragment.prototype.toNodeArray = function () { + var accum = []; + this.eachNode(function (el) { return accum.push(el); }); + return accum; + }; + /** + * Returns an array of all the Element nodes in this fragment. The + * result does not include nodes that are not Elements, such as Text + * and Comment nodes. + */ + DOMFragment.prototype.toElementArray = function () { + var accum = []; + this.eachElement(function (el) { return accum.push(el); }); + return accum; + }; + /** + * Moves all of the nodes in this fragment into a new DocumentFragment + * and returns it. This includes Nodes that are not Elements such as + * Text and Comment nodes. + */ + DOMFragment.prototype.toDocumentFragment = function () { + var frag = document.createDocumentFragment(); + this.eachNode(function (el) { return frag.appendChild(el); }); + return frag; + }; + /** + * Insert all the nodes in this fragment into the DOM directly before + * the first node of `sibling` fragment. If `sibling` is empty or does + * not have a parent node, detaches this fragment from the document. + * + * Note that this behavior differs from jQuery if `sibling` is a + * collection with multiple nodes. In that case, jQuery inserts this + * collection before the first node in `sibling`, and then inserts a + * clone of this collection before each additional node in the + * `sibling` collection. DOMFragment only ever inserts this collection + * before the first node of the sibling fragment, and never inserts + * additional clones. + */ + DOMFragment.prototype.insertBefore = function (sibling) { + return this.insDirOf(L, sibling); + }; + /** + * Insert all the nodes in this fragment into the DOM directly after + * the last node of `sibling` fragment. If `sibling` is empty or does + * not have a parent node, detaches this fragment from the document. + * + * Note that this behavior differs from jQuery if `sibling` is a + * collection with multiple nodes. In that case, jQuery inserts this + * collection before the first node in `sibling`, and then inserts a + * clone of this collection before each additional node in the + * `sibling` collection. DOMFragment only ever inserts this collection + * before the first node of the sibling fragment, and never inserts + * additional clones. + */ + DOMFragment.prototype.insertAfter = function (sibling) { + return this.insDirOf(R, sibling); + }; + /** + * Append children to the node represented by this fragment. + * + * Asserts that this fragment contains exactly one Element. + */ + DOMFragment.prototype.append = function (children) { + children.appendTo(this.oneElement()); + return this; + }; + /** + * Prepend children to the node represented by this fragment. + * + * Asserts that this fragment contains exactly one Element. + */ + DOMFragment.prototype.prepend = function (children) { + children.prependTo(this.oneElement()); + return this; + }; + /** + * Append all the nodes in this fragment to the children of `el`. + */ + DOMFragment.prototype.appendTo = function (el) { + return this.insAtDirEnd(R, el); + }; + /** + * Prepend all the nodes in this fragment to the children of `el`. + */ + DOMFragment.prototype.prependTo = function (el) { + return this.insAtDirEnd(L, el); + }; + /** + * Return a fragment containing the parent node of the nodes in this + * fragment. Returns an empty fragment if this fragment is empty or + * does not have a parent node. + */ + DOMFragment.prototype.parent = function () { + if (!this.ends) + return this; + var parent = this.ends[L].parentNode; + if (!parent) + return new DOMFragment(); + return new DOMFragment(parent); + }; + /** + * Replace the children of `el` with the contents of this fragment, + * and place `el` into the DOM at the previous location of this + * fragment. + */ + DOMFragment.prototype.wrapAll = function (el) { + el.textContent = ''; // First empty the wrapping element + if (!this.ends) + return this; + var parent = this.ends[L].parentNode; + var next = this.ends[R].nextSibling; + this.appendTo(el); + if (parent) { + parent.insertBefore(el, next); + } + return this; + }; + /** + * Replace this fragment with the fragment given by `children`. If + * this fragment is empty or does not have a parent node, detaches + * `children` from the document. + * + * Note that this behavior differs from jQuery if this is a collection + * with multiple nodes. In that case, jQuery replaces the first + * element of this collection with `children`, and then replaces each + * additional element in this collection with a clone of `children`. + * DOMFragment replaces this entire fragment with `children` and never + * makes additional clones of `children`. + */ + DOMFragment.prototype.replaceWith = function (children) { + var _a; + var rightEnd = (_a = this.ends) === null || _a === void 0 ? void 0 : _a[R]; + // Note: important to cache parent and nextSibling (if they exist) + // before detaching this fragment from the document (which will + // mutate its parent and sibling references) + var parent = rightEnd === null || rightEnd === void 0 ? void 0 : rightEnd.parentNode; + var nextSibling = rightEnd === null || rightEnd === void 0 ? void 0 : rightEnd.nextSibling; + this.detach(); + // Note, this purposely detaches children from the document, even if + // they can't be reinserted because this fragment is empty or has no + // parent + var childDocumentFragment = children.toDocumentFragment(); + if (!rightEnd || !parent) + return this; + parent.insertBefore(childDocumentFragment, nextSibling || null); + return this; + }; + /** + * Return the nth Element node of this collection, or undefined if + * there is no nth Element. Skips Nodes that are not Elements (e.g. + * Text and Comment nodes). + * + * Analogous to jQuery's array indexing syntax, or jQuery's .get() + * with positive arguments. + */ + DOMFragment.prototype.nthElement = function (n) { + if (!this.ends) + return undefined; + if (n < 0 || n !== Math.floor(n)) + return undefined; + var current = this.ends[L]; + while (current) { + // Only count element nodes + if (current.nodeType === Node.ELEMENT_NODE) { + if (n <= 0) + return current; + n -= 1; + } + if (current === this.ends[R]) + return undefined; + current = current.nextSibling; + } + return undefined; + }; + /** + * Return the first Element node of this fragment, or undefined if + * the fragment is empty. Skips Nodes that are not Elements (e.g. + * Text and Comment nodes). + */ + DOMFragment.prototype.firstElement = function () { + return this.nthElement(0); + }; + /** + * Return the first Element node of this fragment, or undefined if + * the fragment is empty. Skips Nodes that are not Elements (e.g. + * Text and Comment nodes). + */ + DOMFragment.prototype.lastElement = function () { + if (!this.ends) + return undefined; + var current = this.ends[R]; + while (current) { + // Only count element nodes + if (current.nodeType === Node.ELEMENT_NODE) { + return current; + } + if (current === this.ends[L]) + return undefined; + current = current.previousSibling; + } + return undefined; + }; + /** + * Return a new fragment holding the first Element node of this + * fragment, or an empty fragment if this fragment is empty. Skips + * Nodes that are not Elements (e.g. Text and Comment nodes). + */ + DOMFragment.prototype.first = function () { + return new DOMFragment(this.firstElement()); + }; + /** + * Return a new fragment holding the last Element node of this + * fragment, or an empty fragment if this fragment is empty. Skips + * Nodes that are not Elements (e.g. Text and Comment nodes). + */ + DOMFragment.prototype.last = function () { + return new DOMFragment(this.lastElement()); + }; + /** + * Return a new fragment holding the nth Element node of this + * fragment, or an empty fragment if there is no nth node of this + * fragment. Skips Nodes that are not Elements (e.g. Text and Comment + * nodes). + */ + DOMFragment.prototype.eq = function (n) { + return new DOMFragment(this.nthElement(n)); + }; + /** + * Return a new fragment beginning with the nth Element node of this + * fragment, and ending with the same end as this fragment, or an + * empty fragment if there is no nth node in this fragment. Skips + * Nodes that are not Elements (e.g. Text and Comment nodes). + */ + DOMFragment.prototype.slice = function (n) { + // Note, would be reasonable to extend this to take a second + // argument if we ever find we need this + if (!this.ends) + return this; + var el = this.nthElement(n); + if (!el) + return new DOMFragment(); + return new DOMFragment(el, this.ends[R]); + }; + /** + * Return a new fragment containing the next Element after the Node + * represented by this fragment, or an empty fragment if there is no + * next Element. Skips Nodes that are not Elements (e.g. Text and + * Comment nodes). + * + * Asserts that this fragment contains exactly one Node. + */ + DOMFragment.prototype.next = function () { + var current = this.oneNode(); + while (current) { + current = current.nextSibling; + if (current && current.nodeType === Node.ELEMENT_NODE) + return new DOMFragment(current); + } + return new DOMFragment(); + }; + /** + * Return a new fragment containing the previousElement after the Node + * represented by this fragment, or an empty fragment if there is no + * previous Element. Skips Nodes that are not Elements (e.g. Text and + * Comment nodes). + * + * Asserts that this fragment contains exactly one Node. + */ + DOMFragment.prototype.prev = function () { + var current = this.oneNode(); + while (current) { + current = current.previousSibling; + if (current && current.nodeType === Node.ELEMENT_NODE) + return new DOMFragment(current); + } + return new DOMFragment(); + }; + /** + * Remove all children of every Element Node in the fragment. Skips + * Nodes that are not Elements (e.g. Text and Comment nodes). + */ + DOMFragment.prototype.empty = function () { + // TODO the corresponding jQuery methods clean up some internal + // references before removing elements from the DOM. That won't + // matter once jQuery is totally gone, but until then, this may + // introduce memory leaks + this.eachElement(function (el) { + el.textContent = ''; + }); + return this; + }; + /** + * Remove every node in the fragment from the DOM. + * + * Implemented by moving every node in the fragment into a new + * document fragment in order to preserve the sibling relationships + * of the removed element. If you want to get access to this document + * fragment, use `.toDocumentFragment()` instead. + */ + DOMFragment.prototype.remove = function () { + // TODO the corresponding jQuery methods clean up some internal + // references before removing elements from the DOM. That won't + // matter once jQuery is totally gone, but until then, this may + // introduce memory leaks + // Note, removing the elements by moving them to a document fragment + // because this way their sibling references stay intact. This is + // important if we want to reattach them somewhere else later + this.toDocumentFragment(); + return this; + }; + /** + * Remove every node in the fragment from the DOM. Alias of remove. + * + * Implemented by moving every node in the fragment into a new + * document fragment in order to preserve the sibling relationships + * of the removed element. If you want to get access to this document + * fragment, use `.toDocumentFragment()` instead. + * + * Note: jQuery makes a distinction between detach() and remove(). + * remove() cleans up internal references, and detach() does not. + */ + DOMFragment.prototype.detach = function () { + // In jQuery, detach() is similar to remove() but it does not clean + // up internal references. Here they're aliases, but I'm leaving + // this as a separate method for the moment to keep track of where + // mathquill did one vs the other. + return this.remove(); + }; + /** + * Insert this fragment either just before or just after `sibling` + * fragment according to the direction specified by `dir`. If + * `sibling` is empty or does not have a parent node, detaches this + * fragment from the document. + */ + DOMFragment.prototype.insDirOf = function (dir, sibling) { + var _a; + if (!this.ends) + return this; + var el = (_a = sibling.ends) === null || _a === void 0 ? void 0 : _a[dir]; + if (!el || !el.parentNode) + return this.detach(); + _insDirOf(dir, el.parentNode, this.toDocumentFragment(), el); + return this; + }; + /** + * Insert this fragment into `el` either at the beginning or end of + * its children, according to the direction specified by `dir`. + */ + DOMFragment.prototype.insAtDirEnd = function (dir, el) { + if (!this.ends) + return this; + _insAtDirEnd(dir, this.toDocumentFragment(), el); + return this; + }; + /** + * Return true if any element in this fragment has class `className` + * and false otherwise. + */ + DOMFragment.prototype.hasClass = function (className) { + var out = false; + this.eachElement(function (el) { + if (el.classList.contains(className)) + out = true; + }); + return out; + }; + /** + * Add each class in space separated list of classes given by + * `classNames` to each element in this fragment. + */ + DOMFragment.prototype.addClass = function (classNames) { + var _loop_1 = function (className) { + if (!className) + return "continue"; + this_1.eachElement(function (el) { + el.classList.add(className); + }); + }; + var this_1 = this; + for (var _i = 0, _a = classNames.split(/\s+/); _i < _a.length; _i++) { + var className = _a[_i]; + _loop_1(className); + } + return this; + }; + /** + * Remove each class in space separated list of classes given by + * `classNames` from each element in this fragment. + */ + DOMFragment.prototype.removeClass = function (classNames) { + var _loop_2 = function (className) { + if (!className) + return "continue"; + this_2.eachElement(function (el) { + el.classList.remove(className); + }); + }; + var this_2 = this; + for (var _i = 0, _a = classNames.split(/\s+/); _i < _a.length; _i++) { + var className = _a[_i]; + _loop_2(className); + } + return this; + }; + /** + * Toggle each class in space separated list of classes given by + * `classNames` on each element in this fragment. + * + * If second arg `on` is given as `true`, always toggle classes on. + * If second arg `on` is passed as `false`, always toggle classes off. + */ + DOMFragment.prototype.toggleClass = function (classNames, on) { + if (on === true) + return this.addClass(classNames); + if (on === false) + return this.removeClass(classNames); + var _loop_3 = function (className) { + if (!className) + return "continue"; + this_3.eachElement(function (el) { + el.classList.toggle(className); + }); + }; + var this_3 = this; + for (var _i = 0, _a = classNames.split(/\s+/); _i < _a.length; _i++) { + var className = _a[_i]; + _loop_3(className); + } + return this; + }; + return DOMFragment; + }()); + var domFrag = DOMFragment.create; + /** + * Insert `source` before or after `target` child of `parent` denending + * on `dir`. Only intended to be used internally as a helper in this module + */ + function _insDirOf(dir, parent, source, target) { + parent.insertBefore(source, dir === L ? target : target.nextSibling); + } + /** + * Insert `source` before or after `target` child of `parent` denending + * on `dir`. Only intended to be used internally as a helper in this module + */ + function _insAtDirEnd(dir, source, parent) { + if (dir === L) { + parent.insertBefore(source, parent.firstChild); + } + else { + parent.appendChild(source); + } + } + /************************************************* + * Base classes of edit tree-related objects + * + * Only doing tree node manipulation via these + * adopt/ disown methods guarantees well-formedness + * of the tree. + ************************************************/ + /** A cursor-like location in an mq node tree. */ + var Point = /** @class */ (function () { + function Point(parent, leftward, rightward) { + this.init(parent, leftward, rightward); + } + // keeping init around only for tests + Point.prototype.init = function (parent, leftward, rightward) { + this.parent = parent; + this[L] = leftward; + this[R] = rightward; + }; + Point.copy = function (pt) { + return new Point(pt.parent, pt[L], pt[R]); + }; + return Point; + }()); + function eachNode(ends, yield_) { + var el = ends[L]; + if (!el) + return; + var stop = ends[R]; + if (!stop) + return; //shouldn't happen because ends[L] is defined; + stop = stop[R]; + // TODO - this cast as MQNode is actually important to keep tests passing. I went to + // fix this code to gracefully handle an undefined el and there are tests that actually + // verify that this will throw an error. So I'm keeping the behavior but ignoring the + // type error. + for (; el !== stop; el = el[R]) { + var result = yield_(el); // TODO - might be passing in 0 intead of a MQNode, but tests want this + if (result === false) + break; + } + } + function foldNodes(ends, fold, yield_) { + var el = ends[L]; + if (!el) + return fold; + var stop = ends[R]; + if (!stop) + return fold; //shouldn't happen because ends[L] is defined; + stop = stop[R]; + // TODO - this cast as MQNode is actually important to keep tests passing. I went to + // fix this code to gracefully handle an undefined el and there are tests that actually + // verify that this will throw an error. So I'm keeping the behavior but ignoring the + // type error. + for (; el !== stop; el = el[R]) { + fold = yield_(fold, el); // TODO - might be passing in 0 intead of a MQNode, but tests want this + } + return fold; + } + var NodeBase = /** @class */ (function () { + function NodeBase() { + var _c; + // TODO - life would be so much better in typescript of these were undefined instead of + // 0. The ! would save us in cases where we know a node is defined. + this[_a] = 0; + this[_b] = 0; + // TODO - can this ever actually stay 0? if so we need to add null checks + this.parent = 0; + /** + * The (doubly-linked) list of this node's children. + * + * NOTE child classes may specify a narrower type for ends e.g. to + * enforce that children are not empty, or that they have a certain + * type. In those cases, this initializer may still run at + * construction time, but this is expected to be followed by a call + * to adopt that sets non-empty ends of the necessary types. + * + * Similarly, `Fragment::disown` may temporarily break non-empty + * invariants, which are expected to be restored by a subsequent call + * to `Fragment::adopt`. + * */ + this.ends = (_c = {}, _c[L] = 0, _c[R] = 0, _c); + this.id = NodeBase.uniqueNodeId(); + } + NodeBase.uniqueNodeId = function () { + return (NodeBase.idCounter += 1); + }; + // The mqBlockNode and mqCmdNode custom properties link back from the + // DOM nodes generated by MathQuill to the MQNodes that generated + // them. This is useful for looking up MQNodes in event handlers and + // in the mq(elt) public API method + NodeBase.getNodeOfElement = function (el) { + if (!el) + return; + if (!el.nodeType) + throw new Error('must pass an Element to NodeBase.getNodeOfElement'); + var elTrackingNode = el; + return elTrackingNode.mqBlockNode || elTrackingNode.mqCmdNode; + }; + NodeBase.linkElementByBlockNode = function (elm, blockNode) { + elm.mqBlockNode = blockNode; + }; + NodeBase.linkElementByCmdNode = function (elm, cmdNode) { + elm.mqCmdNode = cmdNode; + }; + NodeBase.prototype.setEnds = function (ends) { + this.ends = ends; + pray('No half-empty node ends', !!this.ends[L] === !!this.ends[R]); + }; + NodeBase.prototype.getEnd = function (dir) { + return this.ends[dir]; + }; + NodeBase.prototype.toString = function () { + return '{{ MathQuill Node #' + this.id + ' }}'; + }; + NodeBase.prototype.setDOM = function (el) { + if (el) { + pray('DOM is an element or a text node', el.nodeType === Node.ELEMENT_NODE || el.nodeType === Node.TEXT_NODE); + } + this._el = el; + return this; + }; + NodeBase.prototype.domFrag = function () { + return domFrag(this._el); + }; + NodeBase.prototype.createDir = function (dir, cursor) { + prayDirection(dir); + var node = this; + node.html(); + node.domFrag().insDirOf(dir, cursor.domFrag()); + cursor[dir] = node.adopt(cursor.parent, cursor[L], cursor[R]); // TODO - assuming not undefined, could be 0 + return node; + }; + NodeBase.prototype.createLeftOf = function (cursor) { + this.createDir(L, cursor); + }; + NodeBase.prototype.selectChildren = function (leftEnd, rightEnd) { + return new MQSelection(leftEnd, rightEnd); + }; + NodeBase.prototype.bubble = function (yield_) { + var self = this.getSelfNode(); + for (var ancestor = self; ancestor; ancestor = ancestor.parent) { + var result = yield_(ancestor); + if (result === false) + break; + } + return this; + }; + NodeBase.prototype.postOrder = function (yield_) { + var self = this.getSelfNode(); + (function recurse(descendant) { + if (!descendant) + return false; + descendant.eachChild(recurse); + yield_(descendant); + return true; + })(self); + return self; + }; + NodeBase.prototype.isEmpty = function () { + return this.ends[L] === 0 && this.ends[R] === 0; + }; + NodeBase.prototype.isQuietEmptyDelimiter = function (dlms) { + if (!this.isEmpty()) + return false; + if (!dlms) + return false; + if (!this.parent || this.parent.ctrlSeq === undefined) + return false; + // Remove any leading \left or \right from the ctrl sequence before looking it up. + var key = this.parent.ctrlSeq.replace(/^\\(left|right)?/, ''); + return dlms.hasOwnProperty(key); + }; + NodeBase.prototype.isStyleBlock = function () { + return false; + }; + NodeBase.prototype.isTextBlock = function () { + return false; + }; + NodeBase.prototype.children = function () { + return new Fragment(this.getEnd(L), this.getEnd(R)); + }; + NodeBase.prototype.eachChild = function (yield_) { + eachNode(this.ends, yield_); + return this; + }; + NodeBase.prototype.foldChildren = function (fold, yield_) { + return foldNodes(this.ends, fold, yield_); + }; + NodeBase.prototype.withDirAdopt = function (dir, parent, withDir, oppDir) { + var self = this.getSelfNode(); + new Fragment(self, self).withDirAdopt(dir, parent, withDir, oppDir); + return this; + }; + /** + * Add this node to the given parent node's children, at the position between the adjacent + * children `leftward` (or the beginning if omitted) and `rightward` (or the end if omitted). + * See `Fragment#adopt()` + */ + NodeBase.prototype.adopt = function (parent, leftward, rightward) { + var self = this.getSelfNode(); + new Fragment(self, self).adopt(parent, leftward, rightward); + return this.getSelfNode(); + }; + NodeBase.prototype.disown = function () { + var self = this.getSelfNode(); + new Fragment(self, self).disown(); + return this; + }; + NodeBase.prototype.remove = function () { + this.domFrag().remove(); + return this.disown(); + }; + NodeBase.prototype.shouldIgnoreSubstitutionInSimpleSubscript = function (options) { + if (!options.disableAutoSubstitutionInSubscripts) + return false; + if (!this.parent) + return false; + if (!(this.parent.parent instanceof SupSub)) + return false; + // Mathquill is gross. There are many different paths that + // create subscripts and sometimes we don't even construct + // true instances of `LatexCmds._`. Another problem is that + // the relationship between the sub and the SupSub isn't + // completely setup during a paste at the time we check + // this. I wanted to use: `this.parent.parent.sub !== this.parent` + // but that check doesn't always work. This seems to be the only + // check that always works. I'd rather live with this than try + // to change the init order of things. + if (!this.parent.domFrag().hasClass('dcg-mq-sub')) + return false; + return true; + }; + NodeBase.prototype.getSelfNode = function () { + // dumb dance to tell typescript that we eventually become a MQNode + return this; + }; + // Overridden by child classes + NodeBase.prototype.parser = function () { + pray('Abstract parser() method is never called', false); + }; + /** Render this node to DOM */ + NodeBase.prototype.html = function () { + throw new Error('html() unimplemented in NodeBase'); + }; + NodeBase.prototype.text = function () { + return ''; + }; + NodeBase.prototype.latex = function () { + var ctx = { latex: '', startIndex: -1, endIndex: -1 }; + this.latexRecursive(ctx); + return ctx.latex; + }; + NodeBase.prototype.latexRecursive = function (_ctx) { }; + NodeBase.prototype.checkCursorContextOpen = function (ctx) { + if (ctx.startSelectionBefore === this) { + ctx.startIndex = ctx.latex.length; + } + if (ctx.endSelectionBefore === this) { + ctx.endIndex = ctx.latex.length; + } + }; + NodeBase.prototype.checkCursorContextClose = function (ctx) { + if (ctx.startSelectionAfter === this) { + ctx.startIndex = ctx.latex.length; + } + if (ctx.endSelectionAfter === this) { + ctx.endIndex = ctx.latex.length; + } + }; + NodeBase.prototype.finalizeTree = function (_options, _dir) { }; + NodeBase.prototype.contactWeld = function (_cursor, _dir) { }; + NodeBase.prototype.blur = function (_cursor) { }; + NodeBase.prototype.focus = function () { }; + NodeBase.prototype.intentionalBlur = function () { }; + NodeBase.prototype.reflow = function () { }; + NodeBase.prototype.registerInnerField = function (_innerFields, _mathField) { }; + NodeBase.prototype.chToCmd = function (_ch, _options) { + pray('Abstract chToCmd() method is never called', false); + }; + NodeBase.prototype.mathspeak = function (_options) { + return ''; + }; + NodeBase.prototype.seek = function (_clientX, _cursor) { }; + NodeBase.prototype.siblingDeleted = function (_options, _dir) { }; + NodeBase.prototype.siblingCreated = function (_options, _dir) { }; + NodeBase.prototype.finalizeInsert = function (_options, _cursor) { }; + NodeBase.prototype.fixDigitGrouping = function (_opts) { }; + NodeBase.prototype.writeLatex = function (_cursor, _latex) { }; + NodeBase.prototype.write = function (_cursor, _ch) { }; + var _a, _b; + _a = L, _b = R; + NodeBase.idCounter = 0; + return NodeBase; + }()); + function prayWellFormed(parent, leftward, rightward) { + pray('a parent is always present', parent); + pray('leftward is properly set up', (function () { + // either it's empty and `rightward` is the left end child (possibly empty) + if (!leftward) + return parent.getEnd(L) === rightward; + // or it's there and its [R] and .parent are properly set up + return leftward[R] === rightward && leftward.parent === parent; + })()); + pray('rightward is properly set up', (function () { + // either it's empty and `leftward` is the right end child (possibly empty) + if (!rightward) + return parent.getEnd(R) === leftward; + // or it's there and its [L] and .parent are properly set up + return rightward[L] === leftward && rightward.parent === parent; + })()); + } + /** + * An entity outside the virtual tree with one-way pointers (so it's only a + * "view" of part of the tree, not an actual node/entity in the tree) that + * delimits a doubly-linked list of sibling nodes. + * It's like a fanfic love-child between HTML DOM DocumentFragment and the Range + * classes: like DocumentFragment, its contents must be sibling nodes + * (unlike Range, whose contents are arbitrary contiguous pieces of subtrees), + * but like Range, it has only one-way pointers to its contents, its contents + * have no reference to it and in fact may still be in the visible tree (unlike + * DocumentFragment, whose contents must be detached from the visible tree + * and have their 'parent' pointers set to the DocumentFragment). + */ + var Fragment = /** @class */ (function () { + function Fragment(withDir, oppDir, dir) { + var _c, _d; + this.disowned = false; + if (dir === undefined) + dir = L; + prayDirection(dir); + pray('no half-empty fragments', !withDir === !oppDir); + if (!withDir || !oppDir) { + this.setEnds((_c = {}, _c[L] = 0, _c[R] = 0, _c)); + return; + } + pray('withDir is passed to Fragment', withDir instanceof MQNode); + pray('oppDir is passed to Fragment', oppDir instanceof MQNode); + pray('withDir and oppDir have the same parent', withDir.parent === oppDir.parent); + var ends = (_d = {}, + _d[dir] = withDir, + _d[-dir] = oppDir, + _d); + this.setEnds(ends); + var maybeRightEnd = 0; + this.each(function (el) { + maybeRightEnd = el; + }); + pray('following direction siblings from start reaches end', maybeRightEnd === ends[R]); + } + Fragment.prototype.getDOMFragFromEnds = function () { + var left = this.ends[L]; + var right = this.ends[R]; + if (left === 0 || right === 0) { + return domFrag(); + } + else if (left === right) { + // Note, joining a DOMFragment to itself is not allowed, so + // don't attempt to join the end fragments if the ends are equal + return left.domFrag(); + } + else { + return left.domFrag().join(right.domFrag()); + } + }; + /** + * Note, children may override this to enforce extra invariants, + * (e.g. that ends are always defined). Ends should only be set + * through this function. + */ + Fragment.prototype.setEnds = function (ends) { + this.ends = ends; + }; + Fragment.prototype.getEnd = function (dir) { + return this.ends ? this.ends[dir] : 0; + }; + Fragment.prototype.domFrag = function () { + return this.getDOMFragFromEnds(); + }; + // like Cursor::withDirInsertAt(dir, parent, withDir, oppDir) + Fragment.prototype.withDirAdopt = function (dir, parent, withDir, oppDir) { + return dir === L + ? this.adopt(parent, withDir, oppDir) + : this.adopt(parent, oppDir, withDir); + }; + /** + * Splice this fragment into the given parent node's children, at the position between the adjacent + * children `leftward` (or the beginning if omitted) and `rightward` (or the end if omitted). + * + * TODO: why do we need both leftward and rightward? It seems to me that `rightward` is always expected to be `leftward ? leftward[R] : parent.ends[L]`. + */ + Fragment.prototype.adopt = function (parent, leftward, rightward) { + var _c; + prayWellFormed(parent, leftward, rightward); + var self = this; + this.disowned = false; + var leftEnd = self.ends[L]; + if (!leftEnd) + return this; + var rightEnd = self.ends[R]; + if (!rightEnd) + return this; + var ends = (_c = {}, _c[L] = parent.getEnd(L), _c[R] = parent.getEnd(R), _c); + if (leftward) { + // NB: this is handled in the ::each() block + // leftward[R] = leftEnd + } + else { + ends[L] = leftEnd; + } + if (rightward) { + rightward[L] = rightEnd; + } + else { + ends[R] = rightEnd; + } + parent.setEnds(ends); + rightEnd[R] = rightward; + self.each(function (el) { + el[L] = leftward; + el.parent = parent; + if (leftward) + leftward[R] = el; + leftward = el; + return true; + }); + return self; + }; + /** + * Remove the nodes in this fragment from their parent. + */ + Fragment.prototype.disown = function () { + var _c; + var self = this; + var leftEnd = self.ends[L]; + // guard for empty and already-disowned fragments + if (!leftEnd || self.disowned) + return self; + this.disowned = true; + var rightEnd = self.ends[R]; + if (!rightEnd) + return self; + var parent = leftEnd.parent; + prayWellFormed(parent, leftEnd[L], leftEnd); + prayWellFormed(parent, rightEnd, rightEnd[R]); + var ends = (_c = {}, _c[L] = parent.getEnd(L), _c[R] = parent.getEnd(R), _c); + if (leftEnd[L]) { + var leftLeftEnd = leftEnd[L]; + leftLeftEnd[R] = rightEnd[R]; + } + else { + ends[L] = rightEnd[R]; + } + if (rightEnd[R]) { + var rightRightEnd = rightEnd[R]; + rightRightEnd[L] = leftEnd[L]; + } + else { + ends[R] = leftEnd[L]; + } + if (ends[L] && ends[R]) { + parent.setEnds(ends); + } + else { + // some child classes of MQNode try to enforce that their ends + // are never empty through the type system. However, disown may + // temporarily break this invariant in which case it's expected + // that adopt will later be called to fix the invariant. + // + // Cast away the protected status of the ends property and write + // to it directly to get around runtime assertions in setEnds that + // enforce non-emptyness. + parent.ends = ends; + } + return self; + }; + Fragment.prototype.remove = function () { + this.domFrag().remove(); + return this.disown(); + }; + Fragment.prototype.each = function (yield_) { + eachNode(this.ends, yield_); + return this; + }; + Fragment.prototype.fold = function (fold, yield_) { + return foldNodes(this.ends, fold, yield_); + }; + return Fragment; + }()); + /** + * Registry of LaTeX commands and commands created when typing + * a single character. + * + * (Commands are all subclasses of Node.) + */ + var LatexCmds = {}; + var CharCmds = {}; + function isMQNodeClass(cmd) { + return cmd && cmd.prototype instanceof MQNode; + } + /******************************************** + * Cursor and Selection "singleton" classes + *******************************************/ + /* The main thing that manipulates the Math DOM. Makes sure to manipulate the + HTML DOM to match. */ + /* Sort of singletons, since there should only be one per editable math + textbox, but any one HTML document can contain many such textboxes, so any one + JS environment could actually contain many instances. */ + //A fake cursor in the fake textbox that the math is rendered in. + var Anticursor = /** @class */ (function (_super) { + __extends(Anticursor, _super); + function Anticursor(parent, leftward, rightward) { + var _this_1 = _super.call(this, parent, leftward, rightward) || this; + _this_1.ancestors = {}; + return _this_1; + } + Anticursor.fromCursor = function (cursor) { + return new Anticursor(cursor.parent, cursor[L], cursor[R]); + }; + return Anticursor; + }(Point)); + var Cursor = /** @class */ (function (_super) { + __extends(Cursor, _super); + function Cursor(initParent, options, controller) { + var _this_1 = _super.call(this, initParent, 0, 0) || this; + /** Slightly more than just a "cache", this remembers the cursor's position in each block node, so that we can return to the right + * point in that node when moving up and down among blocks. + */ + _this_1.upDownCache = {}; + _this_1.cursorElement = h('span', { class: 'dcg-mq-cursor' }, [h.text(U_ZERO_WIDTH_SPACE)]); + _this_1._domFrag = domFrag(); + _this_1.controller = controller; + _this_1.options = options; + _this_1.setDOMFrag(domFrag(_this_1.cursorElement)); + //closured for setInterval + _this_1.blink = function () { + domFrag(_this_1.cursorElement).toggleClass('dcg-mq-blink'); + }; + return _this_1; + } + Cursor.prototype.setDOMFrag = function (frag) { + this._domFrag = frag; + return this; + }; + Cursor.prototype.domFrag = function () { + return this._domFrag; + }; + Cursor.prototype.show = function () { + domFrag(this.cursorElement).removeClass('dcg-mq-blink'); + this.setDOMFrag(domFrag(this.cursorElement)); + if (this.intervalId) + //already was shown, just restart interval + clearInterval(this.intervalId); + else { + //was hidden and detached, insert this.jQ back into HTML DOM + var right = this[R]; + if (right) { + var selection = this.selection; + if (selection && selection.getEnd(L)[L] === this[L]) + this.domFrag().insertBefore(selection.domFrag()); + else + this.domFrag().insertBefore(right.domFrag()); + } + else + this.domFrag().appendTo(this.parent.domFrag().oneElement()); + this.parent.focus(); + } + this.intervalId = setInterval(this.blink, 500); + return this; + }; + Cursor.prototype.hide = function () { + if (this.intervalId) + clearInterval(this.intervalId); + this.intervalId = 0; + this.domFrag().detach(); + this.setDOMFrag(domFrag()); + return this; + }; + Cursor.prototype.withDirInsertAt = function (dir, parent, withDir, oppDir) { + var oldParent = this.parent; + this.parent = parent; + this[dir] = withDir; + this[-dir] = oppDir; + // by contract, .blur() is called after all has been said and done + // and the cursor has actually been moved + // FIXME pass cursor to .blur() so text can fix cursor pointers when removing itself + if (oldParent !== parent && oldParent.blur) + oldParent.blur(this); + }; + /** Place the cursor before or after `el`, according the side specified by `dir`. */ + Cursor.prototype.insDirOf = function (dir, el) { + prayDirection(dir); + this.domFrag().insDirOf(dir, el.domFrag()); + this.withDirInsertAt(dir, el.parent, el[dir], el); + this.parent.domFrag().addClass('dcg-mq-hasCursor'); + return this; + }; + Cursor.prototype.insLeftOf = function (el) { + return this.insDirOf(L, el); + }; + Cursor.prototype.insRightOf = function (el) { + return this.insDirOf(R, el); + }; + /** Place the cursor inside `el` at either the left or right end, according the side specified by `dir`. */ + Cursor.prototype.insAtDirEnd = function (dir, el) { + prayDirection(dir); + this.domFrag().insAtDirEnd(dir, el.domFrag().oneElement()); + this.withDirInsertAt(dir, el, 0, el.getEnd(dir)); + el.focus(); + return this; + }; + Cursor.prototype.insAtLeftEnd = function (el) { + return this.insAtDirEnd(L, el); + }; + Cursor.prototype.insAtRightEnd = function (el) { + return this.insAtDirEnd(R, el); + }; + /** + * jump up or down from one block Node to another: + * - cache the current Point in the node we're jumping from + * - check if there's a Point in it cached for the node we're jumping to + * + if so put the cursor there, + * + if not seek a position in the node that is horizontally closest to + * the cursor's current position + */ + Cursor.prototype.jumpUpDown = function (from, to) { + var self = this; + self.upDownCache[from.id] = Point.copy(self); + var cached = self.upDownCache[to.id]; + if (cached) { + var cachedR = cached[R]; + if (cachedR) { + self.insLeftOf(cachedR); + } + else { + self.insAtRightEnd(cached.parent); + } + } + else { + var clientX = self.getBoundingClientRectWithoutMargin().left; + to.seek(clientX, self); + } + self.controller.aria.queue(to, true); + }; + Cursor.prototype.getBoundingClientRectWithoutMargin = function () { + //in Opera 11.62, .getBoundingClientRect() and hence jQuery::offset() + //returns all 0's on inline elements with negative margin-right (like + //the cursor) at the end of their parent, so temporarily remove the + //negative margin-right when calling jQuery::offset() + //Opera bug DSK-360043 + //http://bugs.jquery.com/ticket/11523 + //https://github.com/jquery/jquery/pull/717 + var frag = this.domFrag(); + frag.removeClass('dcg-mq-cursor'); + var _c = getBoundingClientRect(frag.oneElement()), left = _c.left, right = _c.right; + frag.addClass('dcg-mq-cursor'); + return { + left: left, + right: right, + }; + }; + Cursor.prototype.unwrapGramp = function () { + var gramp = this.parent.parent; + var greatgramp = gramp.parent; + var rightward = gramp[R]; + var cursor = this; + var leftward = gramp[L]; + gramp.disown().eachChild(function (uncle) { + if (uncle.isEmpty()) + return true; + uncle + .children() + .adopt(greatgramp, leftward, rightward) + .each(function (cousin) { + cousin.domFrag().insertBefore(gramp.domFrag()); + return true; + }); + leftward = uncle.getEnd(R); + return true; + }); + if (!this[R]) { + //then find something to be rightward to insLeftOf + var thisL = this[L]; + if (thisL) + this[R] = thisL[R]; + else { + while (!this[R]) { + var newParent = this.parent[R]; + if (newParent) { + this.parent = newParent; + this[R] = newParent.getEnd(L); + } + else { + this[R] = gramp[R]; + this.parent = greatgramp; + break; + } + } + } + } + var thisR = this[R]; + if (thisR) + this.insLeftOf(thisR); + else + this.insAtRightEnd(greatgramp); + gramp.domFrag().remove(); + var grampL = gramp[L]; + var grampR = gramp[R]; + if (grampL) + grampL.siblingDeleted(cursor.options, R); + if (grampR) + grampR.siblingDeleted(cursor.options, L); + }; + Cursor.prototype.startSelection = function () { + var anticursor = (this.anticursor = Anticursor.fromCursor(this)); + var ancestors = anticursor.ancestors; + for (var ancestor = anticursor; ancestor.parent; ancestor = ancestor.parent) { + ancestors[ancestor.parent.id] = ancestor; + } + }; + Cursor.prototype.endSelection = function () { + delete this.anticursor; + }; + Cursor.prototype.select = function () { + var _lca; + var anticursor = this.anticursor; + if (this[L] === anticursor[L] && this.parent === anticursor.parent) + return false; + // Find the lowest common ancestor (`lca`), and the ancestor of the cursor + // whose parent is the LCA (which'll be an end of the selection fragment). + for (var ancestor = this; ancestor.parent; ancestor = ancestor.parent) { + if (ancestor.parent.id in anticursor.ancestors) { + _lca = ancestor.parent; + break; + } + } + pray('cursor and anticursor in the same tree', _lca); + var lca = _lca; + // The cursor and the anticursor should be in the same tree, because the + // mousemove handler attached to the document, unlike the one attached to + // the root HTML DOM element, doesn't try to get the math tree node of the + // mousemove target, and Cursor::seek() based solely on coordinates stays + // within the tree of `this` cursor's root. + // The other end of the selection fragment, the ancestor of the anticursor + // whose parent is the LCA. + var antiAncestor = anticursor.ancestors[lca.id]; + // Now we have two either Nodes or Points, guaranteed to have a common + // parent and guaranteed that if both are Points, they are not the same, + // and we have to figure out which is the left end and which the right end + // of the selection. + var leftEnd, rightEnd, dir = R; + // This is an extremely subtle algorithm. + // As a special case, `ancestor` could be a Point and `antiAncestor` a Node + // immediately to `ancestor`'s left. + // In all other cases, + // - both Nodes + // - `ancestor` a Point and `antiAncestor` a Node + // - `ancestor` a Node and `antiAncestor` a Point + // `antiAncestor[R] === rightward[R]` for some `rightward` that is + // `ancestor` or to its right, if and only if `antiAncestor` is to + // the right of `ancestor`. + if (ancestor[L] !== antiAncestor) { + for (var rightward = ancestor; rightward; rightward = rightward[R]) { + if (rightward[R] === antiAncestor[R]) { + dir = L; + leftEnd = ancestor; + rightEnd = antiAncestor; + break; + } + } + } + if (dir === R) { + leftEnd = antiAncestor; + rightEnd = ancestor; + } + // only want to select Nodes up to Points, can't select Points themselves + if (leftEnd instanceof Point) + leftEnd = leftEnd[R]; + if (rightEnd instanceof Point) + rightEnd = rightEnd[L]; + this.hide().selection = lca.selectChildren(leftEnd, rightEnd); + var insEl = this.selection.getEnd(dir); + this.insDirOf(dir, insEl); + this.selectionChanged(); + return true; + }; + Cursor.prototype.resetToEnd = function (controller) { + this.clearSelection(); + var root = controller.root; + this[R] = 0; + this[L] = root.getEnd(R); + this.parent = root; + }; + Cursor.prototype.clearSelection = function () { + if (this.selection) { + this.selection.clear(); + delete this.selection; + this.selectionChanged(); + } + return this; + }; + Cursor.prototype.deleteSelection = function () { + var selection = this.selection; + if (!selection) + return; + this[L] = selection.getEnd(L)[L]; + this[R] = selection.getEnd(R)[R]; + selection.remove(); + this.selectionChanged(); + delete this.selection; + }; + Cursor.prototype.replaceSelection = function () { + var seln = this.selection; + if (seln) { + this[L] = seln.getEnd(L)[L]; + this[R] = seln.getEnd(R)[R]; + delete this.selection; + } + return seln; + }; + Cursor.prototype.depth = function () { + var node = this; + var depth = 0; + while ((node = node.parent)) { + depth += node instanceof MathBlock ? 1 : 0; + } + return depth; + }; + Cursor.prototype.isTooDeep = function (offset) { + if (this.options.maxDepth !== undefined) { + return this.depth() + (offset || 0) > this.options.maxDepth; + } + else { + return false; + } + }; + // can be overridden + Cursor.prototype.selectionChanged = function () { }; + return Cursor; + }(Point)); + var MQSelection = /** @class */ (function (_super) { + __extends(MQSelection, _super); + function MQSelection(withDir, oppDir, dir) { + var _this_1 = _super.call(this, withDir, oppDir, dir) || this; + _this_1._el = h('span', { class: 'dcg-mq-selection' }); + _this_1.getDOMFragFromEnds().wrapAll(_this_1._el); + return _this_1; + } + MQSelection.prototype.isCleared = function () { + return this._el === undefined; + }; + MQSelection.prototype.domFrag = function () { + return this.isCleared() ? this.getDOMFragFromEnds() : domFrag(this._el); + }; + MQSelection.prototype.setEnds = function (ends) { + pray('Selection ends are never empty', ends[L] && ends[R]); + this.ends = ends; + }; + MQSelection.prototype.getEnd = function (dir) { + return this.ends[dir]; + }; + MQSelection.prototype.adopt = function (parent, leftward, rightward) { + this.clear(); + return _super.prototype.adopt.call(this, parent, leftward, rightward); + }; + MQSelection.prototype.clear = function () { + // NOTE it's important here that DOMFragment::children includes all + // child nodes (including Text nodes), and not just Element nodes. + // This makes it more similar to the native DOM childNodes property + // and jQuery's .collection() method than jQuery's .children() method + var childFrag = this.getDOMFragFromEnds(); + this.domFrag().replaceWith(childFrag); + this._el = undefined; + return this; + }; + MQSelection.prototype.join = function (methodName, separator) { + if (separator === void 0) { separator = ''; } + return this.fold('', function (fold, child) { + return fold + separator + child[methodName](); + }); + }; + return MQSelection; + }(Fragment)); + var ControllerBase = /** @class */ (function () { + function ControllerBase(root, container, options) { + this.textareaEventListeners = {}; + this.id = root.id; + this.data = {}; + this.root = root; + this.container = container; + this.options = options; + this.aria = new Aria(this.getControllerSelf()); + this.ariaLabel = 'Math Input'; + this.ariaPostLabel = ''; + root.controller = this.getControllerSelf(); + this.cursor = root.cursor = new Cursor(root, options, this.getControllerSelf()); + // TODO: stop depending on root.cursor, and rm it + } + ControllerBase.prototype.getControllerSelf = function () { + // dance we have to do to tell this thing it's a full controller + return this; + }; + ControllerBase.prototype.handle = function (name, dir) { + var _c; + var handlers = this.options.handlers; + var handler = (_c = this.options.handlers) === null || _c === void 0 ? void 0 : _c.fns[name]; + if (handler) { + var APIClass = handlers === null || handlers === void 0 ? void 0 : handlers.APIClasses[this.KIND_OF_MQ]; + pray('APIClass is defined', APIClass); + var mq = new APIClass(this); // cast to any bedcause APIClass needs the final Controller subclass. + if (dir === L || dir === R) + handler(dir, mq); + else + handler(mq); + } + }; + ControllerBase.onNotify = function (f) { + ControllerBase.notifyees.push(f); + }; + ControllerBase.prototype.notify = function (e) { + for (var i = 0; i < ControllerBase.notifyees.length; i += 1) { + ControllerBase.notifyees[i](this.cursor, e); + } + return this; + }; + ControllerBase.prototype.setAriaLabel = function (ariaLabel) { + var oldAriaLabel = this.getAriaLabel(); + if (ariaLabel && typeof ariaLabel === 'string' && ariaLabel !== '') { + this.ariaLabel = ariaLabel; + } + else if (this.editable) { + this.ariaLabel = 'Math Input'; + } + else { + this.ariaLabel = ''; + } + // If this field doesn't have focus, update its computed mathspeak value. + // We check for focus because updating the aria-label attribute of a focused element will cause most screen readers to announce the new value (in our case, label along with the expression's mathspeak). + // If the field does have focus at the time, it will be updated once a blur event occurs. + // Unless we stop using fake text inputs and emulating screen reader behavior, this is going to remain a problem. + if (this.ariaLabel !== oldAriaLabel && !this.containerHasFocus()) { + this.updateMathspeak(); + } + return this; + }; + ControllerBase.prototype.getAriaLabel = function () { + if (this.ariaLabel !== 'Math Input') { + return this.ariaLabel; + } + else if (this.editable) { + return 'Math Input'; + } + else { + return ''; + } + }; + ControllerBase.prototype.setAriaPostLabel = function (ariaPostLabel, timeout) { + var _this_1 = this; + if (ariaPostLabel && + typeof ariaPostLabel === 'string' && + ariaPostLabel !== '') { + if (ariaPostLabel !== this.ariaPostLabel && typeof timeout === 'number') { + if (this._ariaAlertTimeout) + clearTimeout(this._ariaAlertTimeout); + this._ariaAlertTimeout = setTimeout(function () { + if (_this_1.containerHasFocus()) { + // Voice the new label, but do not update content mathspeak to prevent double-speech. + _this_1.aria.alert(_this_1.root.mathspeak().trim() + ' ' + ariaPostLabel.trim()); + } + else { + // This mathquill does not have focus, so update its mathspeak. + _this_1.updateMathspeak(); + } + }, timeout); + } + this.ariaPostLabel = ariaPostLabel; + } + else { + if (this._ariaAlertTimeout) + clearTimeout(this._ariaAlertTimeout); + this.ariaPostLabel = ''; + } + return this; + }; + ControllerBase.prototype.getAriaPostLabel = function () { + return this.ariaPostLabel || ''; + }; + ControllerBase.prototype.containerHasFocus = function () { + return (document.activeElement && this.container.contains(document.activeElement)); + }; + ControllerBase.prototype.getTextareaOrThrow = function () { + var textarea = this.textarea; + if (!textarea) + throw new Error('expected a textarea'); + return textarea; + }; + ControllerBase.prototype.getTextareaSpanOrThrow = function () { + var textareaSpan = this.textareaSpan; + if (!textareaSpan) + throw new Error('expected a textareaSpan'); + return textareaSpan; + }; + /** Add the given event listeners on this.textarea, replacing the existing listener for that event if it exists. */ + ControllerBase.prototype.addTextareaEventListeners = function (listeners) { + if (!this.textarea) + return; + for (var key_2 in listeners) { + var event = key_2; + this.removeTextareaEventListener(event); + this.textarea.addEventListener(event, listeners[event]); + } + }; + ControllerBase.prototype.removeTextareaEventListener = function (event) { + if (!this.textarea) + return; + var listener = this.textareaEventListeners[event]; + if (!listener) + return; + this.textarea.removeEventListener(event, listener); + }; + // based on http://www.gh-mathspeak.com/examples/quick-tutorial/ + // and http://www.gh-mathspeak.com/examples/grammar-rules/ + ControllerBase.prototype.exportMathSpeak = function () { + return this.root.mathspeak(); + }; + // overridden + ControllerBase.prototype.updateMathspeak = function () { }; + ControllerBase.prototype.scrollHoriz = function () { }; + ControllerBase.prototype.selectionChanged = function () { }; + ControllerBase.prototype.setOverflowClasses = function () { }; + ControllerBase.notifyees = []; + return ControllerBase; + }()); + var API = {}; + var EMBEDS = {}; + var processedOptions = { + handlers: true, + autoCommands: true, + quietEmptyDelimiters: true, + autoParenthesizedFunctions: true, + autoOperatorNames: true, + leftRightIntoCmdGoes: true, + maxDepth: true, + interpretTildeAsSim: true, + }; + var baseOptionProcessors = {}; + var Options = /** @class */ (function () { + function Options(version) { + this.version = version; + } + Options.prototype.assertJquery = function () { + pray('Interface versions > 2 do not depend on JQuery', this.version <= 2); + pray('JQuery is set for interface v < 3', this.jQuery); + return this.jQuery; + }; + return Options; + }()); + var Progenote = /** @class */ (function () { + function Progenote() { + } + return Progenote; + }()); + /** + * Interface Versioning (#459, #495) to allow us to virtually guarantee + * backcompat. v0.10.x introduces it, so for now, don't completely break the + * API for people who don't know about it, just complain with console.warn(). + * + * The methods are shimmed in outro.js so that MQ.MathField.prototype etc can + * be accessed. + */ + var insistOnInterVer = function () { + if (window.console) + console.warn('You are using the MathQuill API without specifying an interface version, ' + + 'which will fail in v1.0.0. Easiest fix is to do the following before ' + + 'doing anything else:\n' + + '\n' + + ' MathQuill = MathQuill.getInterface(1);\n' + + ' // now MathQuill.MathField() works like it used to\n' + + '\n' + + 'See also the "`dev` branch (2014\u20132015) \u2192 v0.10.0 Migration Guide" at\n' + + ' https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide'); + }; + // globally exported API object + var MQ1; + function MathQuill(el) { + insistOnInterVer(); + if (!MQ1) { + MQ1 = getInterface(1); + } + return MQ1(el); + } + MathQuill.prototype = Progenote.prototype; + MathQuill.VERSION = 'v0.10.1'; + MathQuill.interfaceVersion = function (v) { + // shim for #459-era interface versioning (ended with #495) + if (v !== 1) + throw 'Only interface version 1 supported. You specified: ' + v; + insistOnInterVer = function () { + if (window.console) + console.warn('You called MathQuill.interfaceVersion(1); to specify the interface ' + + 'version, which will fail in v1.0.0. You can fix this easily by doing ' + + 'this before doing anything else:\n' + + '\n' + + ' MathQuill = MathQuill.getInterface(1);\n' + + ' // now MathQuill.MathField() works like it used to\n' + + '\n' + + 'See also the "`dev` branch (2014\u20132015) \u2192 v0.10.0 Migration Guide" at\n' + + ' https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide'); + }; + insistOnInterVer(); + return MathQuill; + }; + MathQuill.getInterface = getInterface; + var MIN = (getInterface.MIN = 1), MAX = (getInterface.MAX = 3); + function getInterface(v) { + if (v !== 1 && v !== 2 && v !== 3) + throw ('Only interface versions between ' + + MIN + + ' and ' + + MAX + + ' supported. You specified: ' + + v); + var version = v; + if (version < 3) { + var jQuery = window.jQuery; + if (!jQuery) + throw "MathQuill interface version ".concat(version, " requires jQuery 1.5.2+ to be loaded first"); + Options.prototype.jQuery = jQuery; + } + var optionProcessors = __assign(__assign({}, baseOptionProcessors), { handlers: function (handlers) { return ({ + // casting to the v3 version of this type + fns: handlers || {}, + APIClasses: APIClasses, + }); } }); + function config(currentOptions, newOptions) { + for (var name in newOptions) { + if (newOptions.hasOwnProperty(name)) { + if (name === 'substituteKeyboardEvents' && version >= 3) { + throw new Error([ + "As of interface version 3, the 'substituteKeyboardEvents'", + "option is no longer supported. Use 'overrideTypedText' and", + "'overrideKeystroke' instead.", + ].join(' ')); + } + var value = newOptions[name]; // TODO - think about typing this better + var processor = optionProcessors[name]; // TODO - validate option processors better + currentOptions[name] = processor ? processor(value) : value; // TODO - think about typing better + } + } + } + var BaseOptions = version < 3 ? Options : /** @class */ (function (_super) { + __extends(BaseOptions, _super); + function BaseOptions() { + return _super !== null && _super.apply(this, arguments) || this; + } + return BaseOptions; + }(Options)); + var AbstractMathQuill = /** @class */ (function (_super) { + __extends(AbstractMathQuill, _super); + function AbstractMathQuill(ctrlr) { + var _this_1 = _super.call(this) || this; + _this_1.__controller = ctrlr; + _this_1.__options = ctrlr.options; + _this_1.id = ctrlr.id; + _this_1.data = ctrlr.data; + return _this_1; + } + AbstractMathQuill.prototype.mathquillify = function (classNames) { + var ctrlr = this.__controller, root = ctrlr.root, el = ctrlr.container; + ctrlr.createTextarea(); + var contents = domFrag(el).addClass(classNames).children().detach(); + root.setDOM(domFrag(h('span', { class: 'dcg-mq-root-block', 'aria-hidden': true })) + .appendTo(el) + .oneElement()); + NodeBase.linkElementByBlockNode(root.domFrag().oneElement(), root); + this.latex(contents.text()); + this.revert = function () { + ctrlr.removeMouseEventListener(); + domFrag(el) + .removeClass('dcg-mq-editable-field dcg-mq-math-mode dcg-mq-text-mode') + .empty() + .append(contents); + return version < 3 ? this.__options.assertJquery()(el) : el; + }; + }; + AbstractMathQuill.prototype.setAriaLabel = function (ariaLabel) { + this.__controller.setAriaLabel(ariaLabel); + return this; + }; + AbstractMathQuill.prototype.getAriaLabel = function () { + return this.__controller.getAriaLabel(); + }; + AbstractMathQuill.prototype.config = function (opts) { + config(this.__options, opts); + return this; + }; + AbstractMathQuill.prototype.el = function () { + return this.__controller.container; + }; + AbstractMathQuill.prototype.text = function () { + return this.__controller.exportText(); + }; + AbstractMathQuill.prototype.mathspeak = function () { + return this.__controller.exportMathSpeak(); + }; + AbstractMathQuill.prototype.latex = function (latex) { + if (arguments.length > 0) { + this.__controller.renderLatexMath(latex); + var cursor = this.__controller.cursor; + if (this.__controller.blurred) + cursor.hide().parent.blur(cursor); + return this; + } + return this.__controller.exportLatex(); + }; + AbstractMathQuill.prototype.selection = function () { + return this.__controller.exportLatexSelection(); + }; + AbstractMathQuill.prototype.html = function () { + return this.__controller.root + .domFrag() + .oneElement() + .innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, '') // TODO remove when jQuery is completely gone + .replace(/ mathquill-(?:command|block)-id="?\d+"?/g, '') + .replace(/.?<\/span>/i, '') + .replace(/ dcg-mq-hasCursor|dcg-mq-hasCursor ?/, '') + .replace(/ class=(""|(?= |>))/g, ''); + }; + AbstractMathQuill.prototype.reflow = function () { + this.__controller.root.postOrder(function (node) { + node.reflow(); + }); + return this; + }; + return AbstractMathQuill; + }(Progenote)); + var EditableField = /** @class */ (function (_super) { + __extends(EditableField, _super); + function EditableField() { + return _super !== null && _super.apply(this, arguments) || this; + } + EditableField.prototype.mathquillify = function (classNames) { + _super.prototype.mathquillify.call(this, classNames); + this.__controller.editable = true; + this.__controller.addMouseEventListener(); + this.__controller.editablesTextareaEvents(); + return this; + }; + EditableField.prototype.focus = function () { + this.__controller.getTextareaOrThrow().focus(); + this.__controller.scrollHoriz(); + return this; + }; + EditableField.prototype.blur = function () { + this.__controller.getTextareaOrThrow().blur(); + return this; + }; + EditableField.prototype.write = function (latex) { + this.__controller.writeLatex(latex); + this.__controller.scrollHoriz(); + var cursor = this.__controller.cursor; + if (this.__controller.blurred) + cursor.hide().parent.blur(cursor); + return this; + }; + EditableField.prototype.empty = function () { + var _c; + var root = this.__controller.root, cursor = this.__controller.cursor; + root.setEnds((_c = {}, _c[L] = 0, _c[R] = 0, _c)); + root.domFrag().empty(); + delete cursor.selection; + cursor.insAtRightEnd(root); + return this; + }; + EditableField.prototype.cmd = function (cmd) { + var ctrlr = this.__controller.notify(undefined), cursor = ctrlr.cursor; + if (/^\\[a-z]+$/i.test(cmd) && !cursor.isTooDeep()) { + cmd = cmd.slice(1); + var klass = LatexCmds[cmd]; + var node; + if (klass) { + if (klass.constructor) { + node = new klass(cmd); + } + else { + node = klass(cmd); + } + if (cursor.selection) + node.replaces(cursor.replaceSelection()); + node.createLeftOf(cursor.show()); + } /* TODO: API needs better error reporting */ + else + ; + } + else + cursor.parent.write(cursor, cmd); + ctrlr.scrollHoriz(); + if (ctrlr.blurred) + cursor.hide().parent.blur(cursor); + return this; + }; + EditableField.prototype.select = function () { + this.__controller.selectAll(); + return this; + }; + EditableField.prototype.clearSelection = function () { + this.__controller.cursor.clearSelection(); + return this; + }; + EditableField.prototype.moveToDirEnd = function (dir) { + this.__controller + .notify('move') + .cursor.insAtDirEnd(dir, this.__controller.root); + return this; + }; + EditableField.prototype.moveToLeftEnd = function () { + return this.moveToDirEnd(L); + }; + EditableField.prototype.moveToRightEnd = function () { + return this.moveToDirEnd(R); + }; + EditableField.prototype.keystroke = function (keysString, evt) { + var keys = keysString.replace(/^\s+|\s+$/g, '').split(/\s+/); + for (var i = 0; i < keys.length; i += 1) { + this.__controller.keystroke(keys[i], evt); + } + return this; + }; + EditableField.prototype.typedText = function (text) { + for (var i = 0; i < text.length; i += 1) + this.__controller.typedText(text.charAt(i)); + return this; + }; + EditableField.prototype.dropEmbedded = function (pageX, pageY, options) { + var clientX = pageX - getScrollX(); + var clientY = pageY - getScrollY(); + var el = document.elementFromPoint(clientX, clientY); + this.__controller.seek(el, clientX, clientY); + var cmd = new EmbedNode().setOptions(options); + cmd.createLeftOf(this.__controller.cursor); + }; + EditableField.prototype.setAriaPostLabel = function (ariaPostLabel, timeout) { + this.__controller.setAriaPostLabel(ariaPostLabel, timeout); + return this; + }; + EditableField.prototype.getAriaPostLabel = function () { + return this.__controller.getAriaPostLabel(); + }; + EditableField.prototype.clickAt = function (clientX, clientY, target) { + target = target || document.elementFromPoint(clientX, clientY); + var ctrlr = this.__controller, root = ctrlr.root; + var rootElement = root.domFrag().oneElement(); + if (!rootElement.contains(target)) + target = rootElement; + ctrlr.seek(target, clientX, clientY); + if (ctrlr.blurred) + this.focus(); + return this; + }; + EditableField.prototype.ignoreNextMousedown = function (fn) { + this.__controller.cursor.options.ignoreNextMousedown = fn; + return this; + }; + return EditableField; + }(AbstractMathQuill)); + var APIClasses = { + AbstractMathQuill: AbstractMathQuill, + EditableField: EditableField, + }; + pray('API.StaticMath defined', API.StaticMath); + APIClasses.StaticMath = API.StaticMath(APIClasses); + pray('API.MathField defined', API.MathField); + APIClasses.MathField = API.MathField(APIClasses); + pray('API.InnerMathField defined', API.InnerMathField); + APIClasses.InnerMathField = API.InnerMathField(APIClasses); + if (API.TextField) { + APIClasses.TextField = API.TextField(APIClasses); + } + /** + * Function that takes an HTML element and, if it's the root HTML element of a + * static math or math or text field, returns an API object for it (else, null). + * + * var mathfield = MQ.MathField(mathFieldSpan); + * assert(MQ(mathFieldSpan).id === mathfield.id); + * assert(MQ(mathFieldSpan).id === MQ(mathFieldSpan).id); + * + */ + var MQ = function (el) { + if (!el || !el.nodeType) + return null; // check that `el` is a HTML element, using the + // same technique as jQuery: https://github.com/jquery/jquery/blob/679536ee4b7a92ae64a5f58d90e9cc38c001e807/src/core/init.js#L92 + var blockElement; + var childArray = domFrag(el).children().toElementArray(); + for (var _i = 0, childArray_1 = childArray; _i < childArray_1.length; _i++) { + var child = childArray_1[_i]; + if (child.classList.contains('dcg-mq-root-block')) { + blockElement = child; + break; + } + } + var blockNode = NodeBase.getNodeOfElement(blockElement); // TODO - assumng it's a MathBlock + var ctrlr = blockNode && blockNode.controller; + var APIClass = ctrlr && APIClasses[ctrlr.KIND_OF_MQ]; + return ctrlr && APIClass ? new APIClass(ctrlr) : null; + }; + MQ.L = L; + MQ.R = R; + MQ.config = function (opts) { + config(BaseOptions.prototype, opts); + return this; + }; + MQ.registerEmbed = function (name, options) { + if (!/^[a-z][a-z0-9]*$/i.test(name)) { + throw 'Embed name must start with letter and be only letters and digits'; + } + EMBEDS[name] = options; + }; + /* + * Export the API functions that MathQuill-ify an HTML element into API objects + * of each class. If the element had already been MathQuill-ified but into a + * different kind (or it's not an HTML element), return null. + */ + MQ.StaticMath = createEntrypoint('StaticMath', APIClasses.StaticMath); + MQ.MathField = createEntrypoint('MathField', APIClasses.MathField); + MQ.InnerMathField = createEntrypoint('InnerMathField', APIClasses.InnerMathField); + if (APIClasses.TextField) { + MQ.TextField = createEntrypoint('TextField', APIClasses.TextField); + } + MQ.prototype = AbstractMathQuill.prototype; + MQ.EditableField = function () { + throw "wtf don't call me, I'm 'abstract'"; + }; + MQ.EditableField.prototype = EditableField.prototype; + if (version < 3) { + MQ.saneKeyboardEvents = defaultSubstituteKeyboardEvents; + } + function createEntrypoint(kind, APIClass) { + pray(kind + ' is defined', APIClass); + function mqEntrypoint(el, opts) { + if (!el || !el.nodeType) + return null; + var mq = MQ(el); + if (mq instanceof APIClass) + return mq; + var ctrlr = new Controller(new APIClass.RootBlock(), el, new BaseOptions(version)); + ctrlr.KIND_OF_MQ = kind; + return new APIClass(ctrlr).__mathquillify(opts || {}, version); + } + mqEntrypoint.prototype = APIClass.prototype; + return mqEntrypoint; + } + return MQ; + } + MathQuill.noConflict = function () { + window.MathQuill = origMathQuill; + return MathQuill; + }; + var origMathQuill = window.MathQuill; + window.MathQuill = MathQuill; + function RootBlockMixin(_) { + _.moveOutOf = function (dir) { + pray('controller is defined', this.controller); + this.controller.handle('moveOutOf', dir); + }; + _.deleteOutOf = function (dir) { + pray('controller is defined', this.controller); + this.controller.handle('deleteOutOf', dir); + }; + _.selectOutOf = function (dir) { + pray('controller is defined', this.controller); + this.controller.handle('selectOutOf', dir); + }; + _.upOutOf = function () { + pray('controller is defined', this.controller); + this.controller.handle('upOutOf'); + return undefined; + }; + _.downOutOf = function () { + pray('controller is defined', this.controller); + this.controller.handle('downOutOf'); + return undefined; + }; + _.reflow = function () { + pray('controller is defined', this.controller); + this.controller.handle('reflow'); + this.controller.handle('edited'); + this.controller.handle('edit'); + }; + } + function parseError(stream, message) { + if (stream) { + stream = "'" + stream + "'"; + } + else { + stream = 'EOF'; + } + throw 'Parse Error: ' + message + ' at ' + stream; + } + var Parser = /** @class */ (function () { + // The Parser object is a wrapper for a parser function. + // Externally, you use one to parse a string by calling + // var result = SomeParser.parse('Me Me Me! Parse Me!'); + // You should never call the constructor, rather you should + // construct your Parser from the base parsers and the + // parser combinator methods. + function Parser(body) { + this._ = body; + } + Parser.prototype.parse = function (stream) { + return this.skip(Parser.eof)._('' + stream, success, parseError); + function success(_stream, result) { + return result; + } + }; + // -*- primitive combinators -*- // + Parser.prototype.or = function (alternative) { + pray('or is passed a parser', alternative instanceof Parser); + var self = this; + return new Parser(function (stream, onSuccess, onFailure) { + return self._(stream, onSuccess, failure); + function failure(_newStream) { + return alternative._(stream, onSuccess, onFailure); + } + }); + }; + Parser.prototype.then = function (next) { + var self = this; + return new Parser(function (stream, onSuccess, onFailure) { + return self._(stream, success, onFailure); + function success(newStream, result) { + var nextParser = next instanceof Parser ? next : next(result); + pray('a parser is returned', nextParser instanceof Parser); + return nextParser._(newStream, onSuccess, onFailure); + } + }); + }; + // -*- optimized iterative combinators -*- // + Parser.prototype.many = function () { + var self = this; + return new Parser(function (stream, onSuccess, _onFailure) { + var xs = []; + while (self._(stream, success, failure)) + ; + return onSuccess(stream, xs); + function success(newStream, x) { + stream = newStream; + xs.push(x); + return true; + } + function failure() { + return false; + } + }); + }; + Parser.prototype.times = function (min, max) { + if (arguments.length < 2) + max = min; + var self = this; + return new Parser(function (stream, onSuccess, onFailure) { + var xs = []; + var result = true; + var failure; + for (var i = 0; i < min; i += 1) { + // TODO, this may be incorrect for parsers that return boolean + // (or generally, falsey) values + result = !!self._(stream, success, firstFailure); + if (!result) + return onFailure(stream, failure); + } + for (; i < max && result; i += 1) { + self._(stream, success, secondFailure); + } + return onSuccess(stream, xs); + function success(newStream, x) { + xs.push(x); + stream = newStream; + return true; + } + function firstFailure(newStream, msg) { + failure = msg; + stream = newStream; + return false; + } + function secondFailure(_newStream, _msg) { + return false; + } + }); + }; + // -*- higher-level combinators -*- // + Parser.prototype.result = function (res) { + return this.then(Parser.succeed(res)); + }; + Parser.prototype.atMost = function (n) { + return this.times(0, n); + }; + Parser.prototype.atLeast = function (n) { + var self = this; + return self.times(n).then(function (start) { + return self.many().map(function (end) { + return start.concat(end); + }); + }); + }; + Parser.prototype.map = function (fn) { + return this.then(function (result) { + return Parser.succeed(fn(result)); + }); + }; + Parser.prototype.skip = function (two) { + return this.then(function (result) { + return two.result(result); + }); + }; + // -*- primitive parsers -*- // + Parser.string = function (str) { + var len = str.length; + var expected = "expected '" + str + "'"; + return new Parser(function (stream, onSuccess, onFailure) { + var head = stream.slice(0, len); + if (head === str) { + return onSuccess(stream.slice(len), head); + } + else { + return onFailure(stream, expected); + } + }); + }; + Parser.regex = function (re) { + pray('regexp parser is anchored', re.toString().charAt(1) === '^'); + var expected = 'expected ' + re; + return new Parser(function (stream, onSuccess, onFailure) { + var match = re.exec(stream); + if (match) { + var result = match[0]; + return onSuccess(stream.slice(result.length), result); + } + else { + return onFailure(stream, expected); + } + }); + }; + Parser.succeed = function (result) { + return new Parser(function (stream, onSuccess) { + return onSuccess(stream, result); + }); + }; + Parser.fail = function (msg) { + return new Parser(function (stream, _, onFailure) { + return onFailure(stream, msg); + }); + }; + Parser.letter = Parser.regex(/^[a-z]/i); + Parser.letters = Parser.regex(/^[a-z]*/i); + Parser.digit = Parser.regex(/^[0-9]/); + Parser.digits = Parser.regex(/^[0-9]*/); + Parser.whitespace = Parser.regex(/^\s+/); + Parser.optWhitespace = Parser.regex(/^\s*/); + Parser.any = new Parser(function (stream, onSuccess, onFailure) { + if (!stream) + return onFailure(stream, 'expected any character'); + return onSuccess(stream.slice(1), stream.charAt(0)); + }); + Parser.all = new Parser(function (stream, onSuccess, _onFailure) { + return onSuccess('', stream); + }); + Parser.eof = new Parser(function (stream, onSuccess, onFailure) { + if (stream) + return onFailure(stream, 'expected EOF'); + return onSuccess(stream, stream); + }); + return Parser; + }()); + /** Poller that fires once every tick. */ + var EveryTick = /** @class */ (function () { + function EveryTick() { + this.fn = noop; + } + EveryTick.prototype.listen = function (fn) { + this.fn = fn; + clearTimeout(this.timeoutId); + this.timeoutId = setTimeout(this.fn); + }; + EveryTick.prototype.listenOnce = function (fn) { + var _this_1 = this; + this.listen(function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + _this_1.clearListener(); + fn.apply(void 0, args); + }); + }; + EveryTick.prototype.clearListener = function () { + this.fn = noop; + clearTimeout(this.timeoutId); + }; + EveryTick.prototype.trigger = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + this.fn.apply(this, args); + }; + return EveryTick; + }()); + /************************************************* + * Sane Keyboard Events Shim + * + * An abstraction layer over the raw browser browser events + * on the textarea that hides all the nasty cross- + * browser incompatibilities behind a uniform API. + * + * Design goal: This is a *HARD* internal + * abstraction barrier. Cross-browser + * inconsistencies are not allowed to leak through + * and be dealt with by event handlers. All future + * cross-browser issues that arise must be dealt + * with here, and if necessary, the API updated. + ************************************************/ + var saneKeyboardEvents = (function () { + // The following [key values][1] map was compiled from the + // [DOM3 Events appendix section on key codes][2] and + // [a widely cited report on cross-browser tests of key codes][3], + // except for 10: 'Enter', which I've empirically observed in Safari on iOS + // and doesn't appear to conflict with any other known key codes. + // + // [1]: http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120614/#keys-keyvalues + // [2]: http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120614/#fixed-virtual-key-codes + // [3]: http://unixpapa.com/js/key.html + var WHICH_TO_MQ_KEY_STEM = { + 8: 'Backspace', + 9: 'Tab', + 10: 'Enter', + 13: 'Enter', + 16: 'Shift', + 17: 'Control', + 18: 'Alt', + 20: 'CapsLock', + 27: 'Esc', + 32: 'Spacebar', + 33: 'PageUp', + 34: 'PageDown', + 35: 'End', + 36: 'Home', + 37: 'Left', + 38: 'Up', + 39: 'Right', + 40: 'Down', + 45: 'Insert', + 46: 'Del', + 144: 'NumLock', + }; + var KEY_TO_MQ_KEY_STEM = { + ArrowRight: 'Right', + ArrowLeft: 'Left', + ArrowDown: 'Down', + ArrowUp: 'Up', + Delete: 'Del', + Escape: 'Esc', + ' ': 'Spacebar', + }; + function isArrowKey(e) { + // The keyPress event in FF reports which=0 for some reason. The new + // .key property seems to report reasonable results, so we're using that + switch (getMQKeyStem(e)) { + case 'Right': + case 'Left': + case 'Down': + case 'Up': + return true; + } + return false; + } + function isLowercaseAlphaCharacter(s) { + return s.length === 1 && s >= 'a' && s <= 'z'; + } + function getMQKeyStem(evt) { + var _c; + // Translate browser key names to MQ's internal naming system + // + // Ref: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values + if (evt.key === undefined) { + var which = evt.which || evt.keyCode; + return WHICH_TO_MQ_KEY_STEM[which] || String.fromCharCode(which); + } + if (isLowercaseAlphaCharacter(evt.key)) + return evt.key.toUpperCase(); + return (_c = KEY_TO_MQ_KEY_STEM[evt.key]) !== null && _c !== void 0 ? _c : evt.key; + } + /** To the extent possible, create a normalized string representation + * of the key combo (i.e., key code and modifier keys). */ + function getMQKeyName(evt) { + var key = getMQKeyStem(evt); + var modifiers = []; + if (evt.ctrlKey) + modifiers.push('Ctrl'); + if (evt.metaKey) + modifiers.push('Meta'); + if (evt.altKey) + modifiers.push('Alt'); + if (evt.shiftKey) + modifiers.push('Shift'); + if (!modifiers.length) + return key; + modifiers.push(key); + return modifiers.join('-'); + } + return function saneKeyboardEvents( + /** Usually the textarea associated with a MQ instance, but can be another kind of element if `substituteTextarea` was used to replace it with something else. */ + textarea, controller) { + var keydown = null; + var keypress = null; + // everyTick.listen() is called after key or clipboard events to + // say "Hey, I think something was just typed" or "pasted" etc, + // so that at all subsequent opportune times (next event or timeout), + // will check for expected typed or pasted text. + // Need to check repeatedly because #135: in Safari 5.1 (at least), + // after selecting something and then typing, the textarea is + // incorrectly reported as selected during the input event (but not + // subsequently). + var everyTick = new EveryTick(); + function guardedTextareaSelect() { + try { + // IE can throw an 'Incorrect Function' error if you + // try to select a textarea that is hidden. It seems + // likely that we don't really care if the selection + // fails to happen in this case. Why would the textarea + // be hidden? And who would even be able to tell? + if (textarea instanceof HTMLTextAreaElement) + textarea.select(); + } + catch (e) { } + } + // -*- public methods -*- // + function select(text) { + // check textarea at least once/one last time before munging (so + // no race condition if selection happens after keypress/paste but + // before checkTextarea), then never again ('cos it's been munged) + everyTick.trigger(); + everyTick.clearListener(); + if (textarea instanceof HTMLTextAreaElement) + textarea.value = text; + if (text) + guardedTextareaSelect(); + shouldBeSelected = !!text; + } + var shouldBeSelected = false; + // -*- helper subroutines -*- // + // Determine whether there's a selection in the textarea. + // This will always return false in IE < 9, which don't support + // HTMLTextareaElement::selection{Start,End}. + function hasSelection() { + if (!('selectionStart' in textarea)) + return false; + if (!(textarea instanceof HTMLTextAreaElement)) + return false; + return textarea.selectionStart !== textarea.selectionEnd; + } + function handleKey() { + if (controller.options && controller.options.overrideKeystroke) { + controller.options.overrideKeystroke(getMQKeyName(keydown), keydown); + } + else { + controller.keystroke(getMQKeyName(keydown), keydown); + } + } + // -*- event handlers -*- // + function onKeydown(e) { + everyTick.trigger(e); + if (e.target !== textarea) + return; + keydown = e; + keypress = null; + if (shouldBeSelected) + everyTick.listenOnce(function (e) { + if (!(e && e.type === 'focusout')) { + // re-select textarea in case it's an unrecognized key that clears + // the selection, then never again, 'cos next thing might be blur + guardedTextareaSelect(); + } + }); + handleKey(); + } + function onKeypress(e) { + everyTick.trigger(e); + if (e.target !== textarea) + return; + // call the key handler for repeated keypresses. + // This excludes keypresses that happen directly + // after keydown. In that case, there will be + // no previous keypress, so we skip it here + if (keydown && keypress) + handleKey(); + keypress = e; + // only check for typed text if this key can type text. Otherwise + // you can end up with mathquill thinking text was typed if you + // use the mq.keystroke('Right') command while a single character + // is selected. Only detected in FF. + if (!isArrowKey(e)) { + everyTick.listen(typedText); + } + else { + everyTick.listenOnce(maybeReselect); + } + } + function onKeyup(e) { + everyTick.trigger(e); + if (e.target !== textarea) + return; + // Handle case of no keypress event being sent + if (!!keydown && !keypress) { + // only check for typed text if this key can type text. Otherwise + // you can end up with mathquill thinking text was typed if you + // use the mq.keystroke('Right') command while a single character + // is selected. Only detected in FF. + if (!isArrowKey(e)) { + everyTick.listen(typedText); + } + else { + everyTick.listenOnce(maybeReselect); + } + } + } + function typedText() { + // If there is a selection, the contents of the textarea couldn't + // possibly have just been typed in. + // This happens in browsers like Firefox and Opera that fire + // keypress for keystrokes that are not text entry and leave the + // selection in the textarea alone, such as Ctrl-C. + // Note: we assume that browsers that don't support hasSelection() + // also never fire keypress on keystrokes that are not text entry. + // This seems reasonably safe because: + // - all modern browsers including IE 9+ support hasSelection(), + // making it extremely unlikely any browser besides IE < 9 won't + // - as far as we know IE < 9 never fires keypress on keystrokes + // that aren't text entry, which is only as reliable as our + // tests are comprehensive, but the IE < 9 way to do + // hasSelection() is poorly documented and is also only as + // reliable as our tests are comprehensive + // If anything like #40 or #71 is reported in IE < 9, see + // b1318e5349160b665003e36d4eedd64101ceacd8 + if (hasSelection()) + return; + if (!(textarea instanceof HTMLTextAreaElement)) + return; + var text = textarea.value; + if (text.length === 1) { + textarea.value = ''; + if (controller.options && controller.options.overrideTypedText) { + controller.options.overrideTypedText(text); + } + else { + controller.typedText(text); + } + } // in Firefox, keys that don't type text, just clear seln, fire keypress + // https://github.com/mathquill/mathquill/issues/293#issuecomment-40997668 + else + maybeReselect(); // re-select if that's why we're here + } + function maybeReselect() { + if (!(textarea instanceof HTMLTextAreaElement)) + return; + if (textarea.value.length > 1) { + guardedTextareaSelect(); + } + } + function onBlur() { + keydown = null; + keypress = null; + everyTick.clearListener(); + if (textarea instanceof HTMLTextAreaElement) + textarea.value = ''; + } + function onPaste(e) { + everyTick.trigger(); + if (e.target !== textarea) + return; + // browsers are dumb. + // + // In Linux, middle-click pasting causes onPaste to be called, + // when the textarea is not necessarily focused. We focus it + // here to ensure that the pasted text actually ends up in the + // textarea. + // + // It's pretty nifty that by changing focus in this handler, + // we can change the target of the default action. (This works + // on keydown too, FWIW). + // + // And by nifty, we mean dumb (but useful sometimes). + if (document.activeElement !== textarea) { + textarea.focus(); + } + everyTick.listen(function pastedText() { + if (!(textarea instanceof HTMLTextAreaElement)) + return; + var text = textarea.value; + textarea.value = ''; + if (text) + controller.paste(text); + }); + } + function onInput(e) { + everyTick.trigger(e); + } + if (controller.options && controller.options.disableCopyPaste) { + controller.addTextareaEventListeners({ + keydown: onKeydown, + keypress: onKeypress, + keyup: onKeyup, + focusout: onBlur, + copy: function (e) { + e.preventDefault(); + }, + cut: function (e) { + e.preventDefault(); + }, + paste: function (e) { + everyTick.trigger(); + e.preventDefault(); + }, + input: onInput, + }); + } + else { + controller.addTextareaEventListeners({ + keydown: onKeydown, + keypress: onKeypress, + keyup: onKeyup, + focusout: onBlur, + cut: function () { + everyTick.listenOnce(function () { + controller.cut(); + }); + }, + copy: function () { + everyTick.listenOnce(function () { + controller.copy(); + }); + }, + paste: onPaste, + input: onInput, + }); + } + // -*- export public methods -*- // + return { select: select }; + }; + })(); + /*********************************************** + * Export math in a human-readable text format + * As you can see, only half-baked so far. + **********************************************/ + var Controller_exportText = /** @class */ (function (_super) { + __extends(Controller_exportText, _super); + function Controller_exportText() { + return _super !== null && _super.apply(this, arguments) || this; + } + Controller_exportText.prototype.exportText = function () { + return this.root.foldChildren('', function (text, child) { + return text + child.text(); + }); + }; + return Controller_exportText; + }(ControllerBase)); + ControllerBase.onNotify(function (cursor, e) { + // these try to cover all ways that mathquill can be modified + if (e === 'edit' || e === 'replace' || e === undefined) { + var controller = cursor.controller; + if (!controller) + return; + if (!controller.options.enableDigitGrouping) + return; + // TODO - maybe reconsider these 3 states and drop down to only 2 + // + // blurred === false means we are focused. blurred === true or + // blurred === undefined means we are not focused. + if (controller.blurred !== false) + return; + controller.disableGroupingForSeconds(1); + } + }); + var Controller_focusBlur = /** @class */ (function (_super) { + __extends(Controller_focusBlur, _super); + function Controller_focusBlur() { + var _this_1 = _super !== null && _super.apply(this, arguments) || this; + _this_1.handleTextareaFocusEditable = function () { + var cursor = _this_1.cursor; + _this_1.updateMathspeak(); + _this_1.blurred = false; + clearTimeout(_this_1.blurTimeout); + domFrag(_this_1.container).addClass('dcg-mq-focused'); + if (!cursor.parent) + cursor.insAtRightEnd(_this_1.root); + if (cursor.selection) { + cursor.selection.domFrag().removeClass('dcg-mq-blur'); + _this_1.selectionChanged(); //re-select textarea contents after tabbing away and back + } + else { + cursor.show(); + } + _this_1.setOverflowClasses(); + }; + _this_1.handleTextareaBlurEditable = function () { + if (_this_1.textareaSelectionTimeout) { + clearTimeout(_this_1.textareaSelectionTimeout); + _this_1.textareaSelectionTimeout = 0; + } + _this_1.disableGroupingForSeconds(0); + _this_1.blurred = true; + _this_1.blurTimeout = setTimeout(function () { + // wait for blur on window; if + _this_1.root.postOrder(function (node) { + node.intentionalBlur(); + }); // none, intentional blur: #264 + _this_1.cursor.clearSelection().endSelection(); + _this_1.blur(); + _this_1.updateMathspeak(); + _this_1.scrollHoriz(); + }); + window.addEventListener('blur', _this_1.handleWindowBlur); + }; + _this_1.handleTextareaFocusStatic = function () { + _this_1.blurred = false; + }; + _this_1.handleTextareaBlurStatic = function () { + if (_this_1.cursor.selection) { + _this_1.cursor.selection.clear(); + } + //detaching during blur explodes in WebKit + setTimeout(function () { + domFrag(_this_1.getTextareaSpanOrThrow()).detach(); + _this_1.blurred = true; + }); + }; + _this_1.handleWindowBlur = function () { + // blur event also fired on window, just switching + clearTimeout(_this_1.blurTimeout); // tabs/windows, not intentional blur + if (_this_1.cursor.selection) + _this_1.cursor.selection.domFrag().addClass('dcg-mq-blur'); + _this_1.blur(); + _this_1.updateMathspeak(); + }; + return _this_1; + } + Controller_focusBlur.prototype.disableGroupingForSeconds = function (seconds) { + var _this_1 = this; + clearTimeout(this.__disableGroupingTimeout); + if (seconds === 0) { + this.root.domFrag().removeClass('dcg-mq-suppress-grouping'); + } + else { + this.root.domFrag().addClass('dcg-mq-suppress-grouping'); + this.__disableGroupingTimeout = setTimeout(function () { + _this_1.root.domFrag().removeClass('dcg-mq-suppress-grouping'); + }, seconds * 1000); + } + }; + Controller_focusBlur.prototype.blur = function () { + // not directly in the textarea blur handler so as to be + this.cursor.hide().parent.blur(this.cursor); // synchronous with/in the same frame as + domFrag(this.container).removeClass('dcg-mq-focused'); // clearing/blurring selection + window.removeEventListener('blur', this.handleWindowBlur); + if (this.options && this.options.resetCursorOnBlur) { + this.cursor.resetToEnd(this); + } + }; + Controller_focusBlur.prototype.addEditableFocusBlurListeners = function () { + var ctrlr = this, cursor = ctrlr.cursor; + this.addTextareaEventListeners({ + focus: this.handleTextareaFocusEditable, + blur: this.handleTextareaBlurEditable, + }); + ctrlr.blurred = true; + cursor.hide().parent.blur(cursor); + }; + Controller_focusBlur.prototype.addStaticFocusBlurListeners = function () { + this.addTextareaEventListeners({ + focus: this.handleTextareaFocusStatic, + blur: this.handleTextareaBlurStatic, + }); + }; + return Controller_focusBlur; + }(Controller_exportText)); + /** + * TODO: I wanted to move MathBlock::focus and blur here, it would clean + * up lots of stuff like, TextBlock::focus is set to MathBlock::focus + * and TextBlock::blur calls MathBlock::blur, when instead they could + * use inheritance and super_. + * + * Problem is, there's lots of calls to .focus()/.blur() on nodes + * outside Controller::focusBlurEvents(), such as .postOrder('blur') on + * insertion, which if MathBlock::blur becomes MQNode::blur, would add the + * 'blur' CSS class to all MQSymbol's (because .isEmpty() is true for all + * of them). + * + * I'm not even sure there aren't other troublesome calls to .focus() or + * .blur(), so this is TODO for now. + */ + /***************************************** + * Deals with the browser DOM events from + * interaction with the typist. + ****************************************/ + /** + * Only one incremental selection may be open at a time. Track whether + * an incremental selection is open to help enforce this invariant. + */ + var INCREMENTAL_SELECTION_OPEN = false; + var MQNode = /** @class */ (function (_super) { + __extends(MQNode, _super); + function MQNode() { + return _super !== null && _super.apply(this, arguments) || this; + } + MQNode.prototype.keystroke = function (key, e, ctrlr) { + var cursor = ctrlr.cursor; + switch (key) { + case 'Ctrl-Shift-Backspace': + case 'Ctrl-Backspace': + ctrlr.ctrlDeleteDir(L); + break; + case 'Shift-Backspace': + case 'Backspace': + ctrlr.backspace(); + break; + // Tab or Esc -> go one block right if it exists, else escape right. + case 'Esc': + case 'Tab': + ctrlr.escapeDir(R, key, e); + return; + // Shift-Tab -> go one block left if it exists, else escape left. + case 'Shift-Tab': + case 'Shift-Esc': + ctrlr.escapeDir(L, key, e); + return; + // End -> move to the end of the current block. + case 'End': + ctrlr.notify('move').cursor.insAtRightEnd(cursor.parent); + ctrlr.aria.queue('end of').queue(cursor.parent, true); + break; + // Ctrl-End -> move all the way to the end of the root block. + case 'Ctrl-End': + ctrlr.notify('move').cursor.insAtRightEnd(ctrlr.root); + ctrlr.aria + .queue('end of') + .queue(ctrlr.ariaLabel) + .queue(ctrlr.root) + .queue(ctrlr.ariaPostLabel); + break; + // Shift-End -> select to the end of the current block. + case 'Shift-End': + ctrlr.selectToBlockEndInDir(R); + break; + // Ctrl-Shift-End -> select all the way to the end of the root block. + case 'Ctrl-Shift-End': + ctrlr.selectToRootEndInDir(R); + break; + // Home -> move to the start of the current block. + case 'Home': + ctrlr.notify('move').cursor.insAtLeftEnd(cursor.parent); + ctrlr.aria.queue('beginning of').queue(cursor.parent, true); + break; + // Ctrl-Home -> move all the way to the start of the root block. + case 'Ctrl-Home': + ctrlr.notify('move').cursor.insAtLeftEnd(ctrlr.root); + ctrlr.aria + .queue('beginning of') + .queue(ctrlr.ariaLabel) + .queue(ctrlr.root) + .queue(ctrlr.ariaPostLabel); + break; + // Shift-Home -> select to the start of the current block. + case 'Shift-Home': + ctrlr.selectToBlockEndInDir(L); + break; + // Ctrl-Shift-Home -> select all the way to the start of the root block. + case 'Ctrl-Shift-Home': + ctrlr.selectToRootEndInDir(L); + break; + case 'Left': + ctrlr.moveLeft(); + break; + case 'Shift-Left': + ctrlr.selectLeft(); + break; + case 'Ctrl-Left': + break; + case 'Right': + ctrlr.moveRight(); + break; + case 'Shift-Right': + ctrlr.selectRight(); + break; + case 'Ctrl-Right': + break; + case 'Up': + ctrlr.moveUp(); + break; + case 'Down': + ctrlr.moveDown(); + break; + case 'Shift-Up': + ctrlr.withIncrementalSelection(function (selectDir) { + if (cursor[L]) { + while (cursor[L]) + selectDir(L); + } + else { + selectDir(L); + } + }); + break; + case 'Shift-Down': + ctrlr.withIncrementalSelection(function (selectDir) { + if (cursor[R]) { + while (cursor[R]) + selectDir(R); + } + else { + selectDir(R); + } + }); + break; + case 'Ctrl-Up': + break; + case 'Ctrl-Down': + break; + case 'Ctrl-Shift-Del': + case 'Ctrl-Del': + ctrlr.ctrlDeleteDir(R); + break; + case 'Shift-Del': + case 'Del': + ctrlr.deleteForward(); + break; + case 'Meta-A': + case 'Ctrl-A': + ctrlr.selectAll(); + break; + // These remaining hotkeys are only of benefit to people running screen readers. + case 'Ctrl-Alt-Up': // speak parent block that has focus + if (cursor.parent.parent && cursor.parent.parent instanceof MQNode) + ctrlr.aria.queue(cursor.parent.parent); + else + ctrlr.aria.queue('nothing above'); + break; + case 'Ctrl-Alt-Down': // speak current block that has focus + if (cursor.parent && cursor.parent instanceof MQNode) + ctrlr.aria.queue(cursor.parent); + else + ctrlr.aria.queue('block is empty'); + break; + case 'Ctrl-Alt-Left': // speak left-adjacent block + if (cursor.parent.parent && cursor.parent.parent.getEnd(L)) { + ctrlr.aria.queue(cursor.parent.parent.getEnd(L)); + } + else { + ctrlr.aria.queue('nothing to the left'); + } + break; + case 'Ctrl-Alt-Right': // speak right-adjacent block + if (cursor.parent.parent && cursor.parent.parent.getEnd(R)) { + ctrlr.aria.queue(cursor.parent.parent.getEnd(R)); + } + else { + ctrlr.aria.queue('nothing to the right'); + } + break; + case 'Ctrl-Alt-Shift-Down': // speak selection + if (cursor.selection) + ctrlr.aria.queue(cursor.selection.join('mathspeak', ' ').trim() + ' selected'); + else + ctrlr.aria.queue('nothing selected'); + break; + case 'Ctrl-Alt-=': + case 'Ctrl-Alt-Shift-Right': // speak ARIA post label (evaluation or error) + if (ctrlr.ariaPostLabel.length) + ctrlr.aria.queue(ctrlr.ariaPostLabel); + else + ctrlr.aria.queue('no answer'); + break; + default: + return; + } + ctrlr.aria.alert(); + e === null || e === void 0 ? void 0 : e.preventDefault(); + ctrlr.scrollHoriz(); + }; + MQNode.prototype.moveOutOf = function (_dir, _cursor, _updown) { + pray('overridden or never called on this node', false); + }; // called by Controller::escapeDir, moveDir + MQNode.prototype.moveTowards = function (_dir, _cursor, _updown) { + pray('overridden or never called on this node', false); + }; // called by Controller::moveDir + MQNode.prototype.deleteOutOf = function (_dir, _cursor) { + pray('overridden or never called on this node', false); + }; // called by Controller::deleteDir + MQNode.prototype.deleteTowards = function (_dir, _cursor) { + pray('overridden or never called on this node', false); + }; // called by Controller::deleteDir + MQNode.prototype.unselectInto = function (_dir, _cursor) { + pray('overridden or never called on this node', false); + }; // called by Controller::selectDir + MQNode.prototype.selectOutOf = function (_dir, _cursor) { + pray('overridden or never called on this node', false); + }; // called by Controller::selectDir + MQNode.prototype.selectTowards = function (_dir, _cursor) { + pray('overridden or never called on this node', false); + }; // called by Controller::selectDir + return MQNode; + }(NodeBase)); + ControllerBase.onNotify(function (cursor, e) { + if (e === 'move' || e === 'upDown') + cursor.show().clearSelection(); + }); + baseOptionProcessors.leftRightIntoCmdGoes = function (updown) { + if (updown && updown !== 'up' && updown !== 'down') { + throw ('"up" or "down" required for leftRightIntoCmdGoes option, ' + + 'got "' + + updown + + '"'); + } + return updown; + }; + ControllerBase.onNotify(function (cursor, e) { + if (e !== 'upDown') + cursor.upDownCache = {}; + }); + ControllerBase.onNotify(function (cursor, e) { + if (e === 'edit') + cursor.show().deleteSelection(); + }); + ControllerBase.onNotify(function (cursor, e) { + if (e !== 'select') + cursor.endSelection(); + }); + var Controller_keystroke = /** @class */ (function (_super) { + __extends(Controller_keystroke, _super); + function Controller_keystroke() { + return _super !== null && _super.apply(this, arguments) || this; + } + Controller_keystroke.prototype.keystroke = function (key, evt) { + this.cursor.parent.keystroke(key, evt, this.getControllerSelf()); + }; + Controller_keystroke.prototype.escapeDir = function (dir, _key, e) { + prayDirection(dir); + var cursor = this.cursor; + // only prevent default of Tab if not in the root editable + if (cursor.parent !== this.root) + e === null || e === void 0 ? void 0 : e.preventDefault(); + // want to be a noop if in the root editable (in fact, Tab has an unrelated + // default browser action if so) + if (cursor.parent === this.root) + return; + cursor.clearSelection(); + cursor.parent.moveOutOf(dir, cursor); + cursor.controller.aria.alert(); + return this.notify('move'); + }; + Controller_keystroke.prototype.moveDir = function (dir) { + prayDirection(dir); + var cursor = this.cursor, updown = cursor.options.leftRightIntoCmdGoes; + var cursorDir = cursor[dir]; + if (cursor.selection) { + cursor.insDirOf(dir, cursor.selection.getEnd(dir)); + } + else if (cursorDir) + cursorDir.moveTowards(dir, cursor, updown); + else + cursor.parent.moveOutOf(dir, cursor, updown); + return this.notify('move'); + }; + Controller_keystroke.prototype.moveLeft = function () { + return this.moveDir(L); + }; + Controller_keystroke.prototype.moveRight = function () { + return this.moveDir(R); + }; + /** + * moveUp and moveDown have almost identical algorithms: + * - first check left and right, if so insAtLeft/RightEnd of them + * - else check the parent's 'upOutOf'/'downOutOf' property: + * + if it's a function, call it with the cursor as the sole argument and + * use the return value as if it were the value of the property + * + if it's a Node, jump up or down into it: + * - if there is a cached Point in the block, insert there + * - else, seekHoriz within the block to the current x-coordinate (to be + * as close to directly above/below the current position as possible) + * + unless it's exactly `true`, stop bubbling + */ + Controller_keystroke.prototype.moveUp = function () { + return this.moveUpDown('up'); + }; + Controller_keystroke.prototype.moveDown = function () { + return this.moveUpDown('down'); + }; + Controller_keystroke.prototype.moveUpDown = function (dir) { + var self = this; + var cursor = self.notify('upDown').cursor; + var dirInto; + var dirOutOf; + if (dir === 'up') { + dirInto = 'upInto'; + dirOutOf = 'upOutOf'; + } + else { + dirInto = 'downInto'; + dirOutOf = 'downOutOf'; + } + var cursorL = cursor[L]; + var cursorR = cursor[R]; + var cursorR_dirInto = cursorR && cursorR[dirInto]; + var cursorL_dirInto = cursorL && cursorL[dirInto]; + if (cursorR_dirInto) + cursor.insAtLeftEnd(cursorR_dirInto); + else if (cursorL_dirInto) + cursor.insAtRightEnd(cursorL_dirInto); + else { + cursor.parent.bubble(function (ancestor) { + // TODO - revist this + var prop = ancestor[dirOutOf]; + if (prop) { + if (typeof prop === 'function') + prop = prop.call(ancestor, cursor); // TODO - figure out if we need to assign to prop + if (prop instanceof MQNode) + cursor.jumpUpDown(ancestor, prop); + if (prop !== true) + return false; // TODO - figure out how this can return true + } + return undefined; + }); + } + return self; + }; + Controller_keystroke.prototype.deleteDir = function (dir) { + prayDirection(dir); + var cursor = this.cursor; + var cursorEl = cursor[dir]; + var cursorElParent = cursor.parent.parent; + var ctrlr = cursor.controller; + if (cursorEl && cursorEl instanceof MQNode) { + if (cursorEl.sides) { + ctrlr.aria.queue(cursorEl.parent + .chToCmd(cursorEl.sides[-dir].ch) + .mathspeak({ createdLeftOf: cursor })); + // generally, speak the current element if it has no blocks, + // but don't for text block commands as the deleteTowards method + // in the TextCommand class is responsible for speaking the new character under the cursor. + } + else if (!cursorEl.blocks && cursorEl.parent.ctrlSeq !== '\\text') { + ctrlr.aria.queue(cursorEl); + } + } + else if (cursorElParent && cursorElParent instanceof MQNode) { + if (cursorElParent.sides) { + ctrlr.aria.queue(cursorElParent.parent + .chToCmd(cursorElParent.sides[dir].ch) + .mathspeak({ createdLeftOf: cursor })); + } + else if (cursorElParent.blocks && cursorElParent.mathspeakTemplate) { + if (cursorElParent.upInto && cursorElParent.downInto) { + // likely a fraction, and we just backspaced over the slash + ctrlr.aria.queue(cursorElParent.mathspeakTemplate[1]); + } + else { + var mst = cursorElParent.mathspeakTemplate; + var textToQueue = dir === L ? mst[0] : mst[mst.length - 1]; + ctrlr.aria.queue(textToQueue); + } + } + else { + ctrlr.aria.queue(cursorElParent); + } + } + var hadSelection = cursor.selection; + this.notify('edit'); // deletes selection if present + if (!hadSelection) { + var cursorDir = cursor[dir]; + if (cursorDir) + cursorDir.deleteTowards(dir, cursor); + else + cursor.parent.deleteOutOf(dir, cursor); + } + var cursorL = cursor[L]; + var cursorR = cursor[R]; + if (cursorL.siblingDeleted) + cursorL.siblingDeleted(cursor.options, R); + if (cursorR.siblingDeleted) + cursorR.siblingDeleted(cursor.options, L); + cursor.parent.bubble(function (node) { + node.reflow(); + return undefined; + }); + return this; + }; + Controller_keystroke.prototype.ctrlDeleteDir = function (dir) { + prayDirection(dir); + var cursor = this.cursor; + if (!cursor[dir] || cursor.selection) + return this.deleteDir(dir); + this.notify('edit'); + var fragRemoved; + if (dir === L) { + fragRemoved = new Fragment(cursor.parent.getEnd(L), cursor[L]); + } + else { + fragRemoved = new Fragment(cursor[R], cursor.parent.getEnd(R)); + } + cursor.controller.aria.queue(fragRemoved); + fragRemoved.remove(); + cursor.insAtDirEnd(dir, cursor.parent); + var cursorL = cursor[L]; + var cursorR = cursor[R]; + if (cursorL) + cursorL.siblingDeleted(cursor.options, R); + if (cursorR) + cursorR.siblingDeleted(cursor.options, L); + cursor.parent.bubble(function (node) { + node.reflow(); + return undefined; + }); + return this; + }; + Controller_keystroke.prototype.backspace = function () { + return this.deleteDir(L); + }; + Controller_keystroke.prototype.deleteForward = function () { + return this.deleteDir(R); + }; + /** + * startIncrementalSelection, selectDirIncremental, and finishIncrementalSelection + * should only be called by withIncrementalSelection because they must + * be called in sequence. + */ + Controller_keystroke.prototype.startIncrementalSelection = function () { + pray("Multiple selections can't be simultaneously open", !INCREMENTAL_SELECTION_OPEN); + INCREMENTAL_SELECTION_OPEN = true; + this.notify('select'); + var cursor = this.cursor; + if (!cursor.anticursor) + cursor.startSelection(); + }; + /** + * Update the selection model, stored in cursor, without modifying + * selection DOM. + * + * startIncrementalSelection, selectDirIncremental, and finishIncrementalSelection + * should only be called by withIncrementalSelection because they must + * be called in sequence. + */ + Controller_keystroke.prototype.selectDirIncremental = function (dir) { + pray('A selection is open', INCREMENTAL_SELECTION_OPEN); + INCREMENTAL_SELECTION_OPEN = true; + var cursor = this.cursor, seln = cursor.selection; + prayDirection(dir); + var node = cursor[dir]; + if (node) { + // "if node we're selecting towards is inside selection (hence retracting) + // and is on the *far side* of the selection (hence is only node selected) + // and the anticursor is *inside* that node, not just on the other side" + if (seln && + seln.getEnd(dir) === node && + cursor.anticursor[-dir] !== node) { + node.unselectInto(dir, cursor); + } + else + node.selectTowards(dir, cursor); + } + else + cursor.parent.selectOutOf(dir, cursor); + }; + /** + * Update selection DOM to match cursor model + * + * startIncrementalSelection, selectDirIncremental, and finishIncrementalSelection + * should only be called by withIncrementalSelection because they must + * be called in sequence. + */ + Controller_keystroke.prototype.finishIncrementalSelection = function () { + pray('A selection is open', INCREMENTAL_SELECTION_OPEN); + var cursor = this.cursor; + cursor.clearSelection(); + cursor.select() || cursor.show(); + var selection = cursor.selection; + if (selection) { + cursor.controller.aria + .clear() + .queue(selection.join('mathspeak', ' ').trim() + ' selected'); // clearing first because selection fires several times, and we don't want repeated speech. + } + INCREMENTAL_SELECTION_OPEN = false; + }; + /** + * Used to build a selection incrementally in a loop. Calls the passed + * callback with a selectDir function that may be called many times, + * and defers updating the view until the incremental selection is + * complete + * + * Wraps up calling + * + * this.startSelection() + * this.selectDirIncremental(dir) // possibly many times + * this.finishSelection() + * + * with extra error handling and invariant enforcement + */ + Controller_keystroke.prototype.withIncrementalSelection = function (cb) { + var _this_1 = this; + try { + this.startIncrementalSelection(); + try { + cb(function (dir) { return _this_1.selectDirIncremental(dir); }); + } + finally { + // Since we have started a selection, attempt to finish it even + // if the callback throws an error + this.finishIncrementalSelection(); + } + } + finally { + // Mark selection as closed even if finishSelection throws an + // error. Makes a possible error in finishSelection more + // recoverable + INCREMENTAL_SELECTION_OPEN = false; + } + }; + /** + * Grow selection one unit in the given direction + * + * Note, this should not be called in a loop. To incrementally grow a + * selection, use withIncrementalSelection + */ + Controller_keystroke.prototype.selectDir = function (dir) { + this.withIncrementalSelection(function (selectDir) { return selectDir(dir); }); + }; + Controller_keystroke.prototype.selectLeft = function () { + return this.selectDir(L); + }; + Controller_keystroke.prototype.selectRight = function () { + return this.selectDir(R); + }; + Controller_keystroke.prototype.selectAll = function () { + this.notify('move'); + var cursor = this.cursor; + cursor.insAtRightEnd(this.root); + this.withIncrementalSelection(function (selectDir) { + while (cursor[L]) + selectDir(L); + }); + }; + Controller_keystroke.prototype.selectToBlockEndInDir = function (dir) { + var cursor = this.cursor; + this.withIncrementalSelection(function (selectDir) { + while (cursor[dir]) + selectDir(dir); + }); + }; + Controller_keystroke.prototype.selectToRootEndInDir = function (dir) { + var _this_1 = this; + var cursor = this.cursor; + this.withIncrementalSelection(function (selectDir) { + while (cursor[dir] || cursor.parent !== _this_1.root) { + selectDir(dir); + } + }); + }; + return Controller_keystroke; + }(Controller_focusBlur)); + var TempSingleCharNode = /** @class */ (function (_super) { + __extends(TempSingleCharNode, _super); + function TempSingleCharNode(_char) { + return _super.call(this) || this; + } + return TempSingleCharNode; + }(MQNode)); + // Parser MathBlock + var latexMathParser = (function () { + function commandToBlock(cmd) { + // can also take in a Fragment + var block = new MathBlock(); + cmd.adopt(block, 0, 0); + return block; + } + function joinBlocks(blocks) { + var firstBlock = blocks[0] || new MathBlock(); + for (var i = 1; i < blocks.length; i += 1) { + blocks[i].children().adopt(firstBlock, firstBlock.getEnd(R), 0); + } + return firstBlock; + } + var string = Parser.string; + var regex = Parser.regex; + var letter = Parser.letter; + var digit = Parser.digit; + var any = Parser.any; + var optWhitespace = Parser.optWhitespace; + var succeed = Parser.succeed; + var fail = Parser.fail; + // Parsers yielding either MathCommands, or Fragments of MathCommands + // (either way, something that can be adopted by a MathBlock) + var variable = letter.map(function (c) { + return new Letter(c); + }); + var number = digit.map(function (c) { + return new Digit(c); + }); + var symbol = regex(/^[^${}\\_^]/).map(function (c) { + return new VanillaSymbol(c); + }); + var controlSequence = regex(/^[^\\a-eg-zA-Z]/) // hotfix #164; match MathBlock::write + .or(string('\\').then(regex(/^[a-z]+/i) + .or(regex(/^\s+/).result(' ')) + .or(any))) + .then(function (ctrlSeq) { + // TODO - is Parser correct? + var cmdKlass = LatexCmds[ctrlSeq]; + if (cmdKlass) { + if (cmdKlass.constructor) { + var actualClass = cmdKlass; // TODO - figure out how to know the difference + return new actualClass(ctrlSeq).parser(); + } + else { + var builder = cmdKlass; // TODO - figure out how to know the difference + return builder(ctrlSeq).parser(); + } + } + else { + return fail('unknown command: \\' + ctrlSeq); + } + }); + var command = controlSequence.or(variable).or(number).or(symbol); + // Parsers yielding MathBlocks + var mathGroup = string('{') + .then(function () { + return mathSequence; + }) + .skip(string('}')); + var mathBlock = optWhitespace.then(mathGroup.or(command.map(commandToBlock))); + var mathSequence = mathBlock.many().map(joinBlocks).skip(optWhitespace); + var optMathBlock = string('[') + .then(mathBlock + .then(function (block) { + return block.join('latex') !== ']' ? succeed(block) : fail(''); + }) + .many() + .map(joinBlocks) + .skip(optWhitespace)) + .skip(string(']')); + var latexMath = mathSequence; + latexMath.block = mathBlock; + latexMath.optBlock = optMathBlock; + return latexMath; + })(); + baseOptionProcessors.maxDepth = function (depth) { + return typeof depth === 'number' ? depth : undefined; + }; + var Controller_latex = /** @class */ (function (_super) { + __extends(Controller_latex, _super); + function Controller_latex() { + return _super !== null && _super.apply(this, arguments) || this; + } + Controller_latex.prototype.cleanLatex = function (latex) { + //prune unnecessary spaces + return latex.replace(/(\\[a-z]+) (?![a-z])/gi, '$1'); + }; + Controller_latex.prototype.exportLatex = function () { + return this.cleanLatex(this.root.latex()); + }; + Controller_latex.prototype.writeLatex = function (latex) { + var cursor = this.notify('edit').cursor; + cursor.parent.writeLatex(cursor, latex); + return this; + }; + Controller_latex.prototype.exportLatexSelection = function () { + var ctx = { + latex: '', + startIndex: -1, + endIndex: -1, + }; + var selection = this.cursor.selection; + if (selection) { + ctx.startSelectionBefore = selection.getEnd(L); + ctx.endSelectionAfter = selection.getEnd(R); + } + else { + var cursorL = this.cursor[L]; + if (cursorL) { + ctx.startSelectionAfter = cursorL; + } + else { + ctx.startSelectionBefore = this.cursor.parent; + } + var cursorR = this.cursor[R]; + if (cursorR) { + ctx.endSelectionBefore = cursorR; + } + else { + ctx.endSelectionAfter = this.cursor.parent; + } + } + this.root.latexRecursive(ctx); + // need to clean the latex + var originalLatex = ctx.latex; + var cleanLatex = this.cleanLatex(originalLatex); + var startIndex = ctx.startIndex; + var endIndex = ctx.endIndex; + // assumes that the cleaning process will only remove characters. We + // run through the originalLatex and cleanLatex to find differences. + // when we find differences we see how many characters are dropped until + // we sync back up. While detecting missing characters we decrement the + // startIndex and endIndex if appropriate. + var j = 0; + for (var i = 0; i < ctx.endIndex; i++) { + if (originalLatex[i] !== cleanLatex[j]) { + if (i < ctx.startIndex) { + startIndex -= 1; + } + endIndex -= 1; + // do not increment j. We wan to keep looking at this same + // cleanLatex character until we find it in the originalLatex + } + else { + j += 1; //move to next cleanLatex character + } + } + return { + latex: cleanLatex, + startIndex: startIndex, + endIndex: endIndex, + }; + }; + Controller_latex.prototype.classifyLatexForEfficientUpdate = function (latex) { + if (typeof latex !== 'string') + return; + var matches = latex.match(/-?[0-9.]+$/g); + if (matches && matches.length === 1) { + return { + latex: latex, + prefix: latex.substr(0, latex.length - matches[0].length), + digits: matches[0], + }; + } + return; + }; + Controller_latex.prototype.updateLatexMathEfficiently = function (latex, oldLatex) { + var _c, _d, _e, _f; + // Note, benchmark/update.html is useful for measuring the + // performance of renderLatexMathEfficiently + var root = this.root; + var oldClassification; + var classification = this.classifyLatexForEfficientUpdate(latex); + if (classification) { + oldClassification = this.classifyLatexForEfficientUpdate(oldLatex); + if (!oldClassification || + oldClassification.prefix !== classification.prefix) { + return false; + } + } + else { + return false; + } + // check if minus sign is changing + var oldDigits = oldClassification.digits; + var newDigits = classification.digits; + var oldMinusSign = false; + var newMinusSign = false; + if (oldDigits[0] === '-') { + oldMinusSign = true; + oldDigits = oldDigits.substr(1); + } + if (newDigits[0] === '-') { + newMinusSign = true; + newDigits = newDigits.substr(1); + } + // start at the very end + var charNode = this.root.getEnd(R); + var oldCharNodes = []; + for (var i = oldDigits.length - 1; i >= 0; i--) { + // the tree does not match what we expect + if (!charNode || charNode.ctrlSeq !== oldDigits[i]) { + return false; + } + // the trailing digits are not just under the root. We require the root + // to be the parent so that we can be sure we do not need a reflow to + // grow parens. + if (charNode.parent !== root) { + return false; + } + // push to the start. We're traversing backwards + oldCharNodes.unshift(charNode); + // move left one character + charNode = charNode[L]; + } + // remove the minus sign + if (oldMinusSign && !newMinusSign) { + var oldMinusNode = charNode; + if (!oldMinusNode) + return false; + if (oldMinusNode.ctrlSeq !== '-') + return false; + if (oldMinusNode[R] !== oldCharNodes[0]) + return false; + if (oldMinusNode.parent !== root) + return false; + var oldMinusNodeL = oldMinusNode[L]; + if (oldMinusNodeL && oldMinusNodeL.parent !== root) + return false; + oldCharNodes[0][L] = oldMinusNode[L]; + if (root.getEnd(L) === oldMinusNode) { + root.setEnds((_c = {}, _c[L] = oldCharNodes[0], _c[R] = root.getEnd(R), _c)); + } + if (oldMinusNodeL) + oldMinusNodeL[R] = oldCharNodes[0]; + oldMinusNode.domFrag().remove(); + } + // add a minus sign + if (!oldMinusSign && newMinusSign) { + var newMinusNode = new PlusMinus('-'); + var minusSpan = document.createElement('span'); + minusSpan.textContent = '-'; + newMinusNode.setDOM(minusSpan); + var oldCharNodes0L = oldCharNodes[0][L]; + if (oldCharNodes0L) + oldCharNodes0L[R] = newMinusNode; + if (root.getEnd(L) === oldCharNodes[0]) { + root.setEnds((_d = {}, _d[L] = newMinusNode, _d[R] = root.getEnd(R), _d)); + } + newMinusNode.parent = root; + newMinusNode[L] = oldCharNodes[0][L]; + newMinusNode[R] = oldCharNodes[0]; + oldCharNodes[0][L] = newMinusNode; + newMinusNode.contactWeld(this.cursor); // decide if binary operator + newMinusNode.domFrag().insertBefore(oldCharNodes[0].domFrag()); + } + // update the text of the current nodes + var commonLength = Math.min(oldDigits.length, newDigits.length); + for (i = 0; i < commonLength; i++) { + var newText = newDigits[i]; + charNode = oldCharNodes[i]; + if (charNode.ctrlSeq !== newText) { + charNode.ctrlSeq = newText; + charNode.domFrag().oneElement().textContent = newText; + charNode.mathspeakName = newText; + } + } + // remove the extra digits at the end + if (oldDigits.length > newDigits.length) { + charNode = oldCharNodes[newDigits.length - 1]; + root.setEnds((_e = {}, _e[L] = root.getEnd(L), _e[R] = charNode, _e)); + charNode[R] = 0; + for (i = oldDigits.length - 1; i >= commonLength; i--) { + oldCharNodes[i].domFrag().remove(); + } + } + // add new digits after the existing ones + if (newDigits.length > oldDigits.length) { + var frag = document.createDocumentFragment(); + for (i = commonLength; i < newDigits.length; i++) { + var span = document.createElement('span'); + span.className = 'dcg-mq-digit'; + span.textContent = newDigits[i]; + var newNode = new Digit(newDigits[i]); + newNode.parent = root; + newNode.setDOM(span); + frag.appendChild(span); + // splice this node in + newNode[L] = root.getEnd(R); + newNode[R] = 0; + var newNodeL = newNode[L]; + newNodeL[R] = newNode; + root.setEnds((_f = {}, _f[L] = root.getEnd(L), _f[R] = newNode, _f)); + } + root.domFrag().oneElement().appendChild(frag); + } + var currentLatex = this.exportLatex(); + if (currentLatex !== latex) { + console.warn('tried updating latex efficiently but did not work. Attempted: ' + + latex + + ' but wrote: ' + + currentLatex); + return false; + } + var rightMost = root.getEnd(R); + if (rightMost) { + rightMost.fixDigitGrouping(this.cursor.options); + } + return true; + }; + Controller_latex.prototype.renderLatexMathFromScratch = function (latex) { + var _c; + var root = this.root, cursor = this.cursor; + var all = Parser.all; + var eof = Parser.eof; + var block = latexMathParser + .skip(eof) + .or(all.result(false)) + .parse(latex); + root.setEnds((_c = {}, _c[L] = 0, _c[R] = 0, _c)); + if (block) { + block.children().adopt(root, 0, 0); + } + if (block) { + var frag = root.domFrag(); + frag.children().remove(); + frag.oneElement().appendChild(block.html()); + root.finalizeInsert(cursor.options, cursor); + } + else { + root.domFrag().empty(); + } + }; + Controller_latex.prototype.renderLatexMath = function (latex) { + var cursor = this.cursor; + var root = this.root; + this.notify('replace'); + cursor.clearSelection(); + var oldLatex = this.exportLatex(); + if (!root.getEnd(L) || !root.getEnd(R) || oldLatex !== latex) { + this.updateLatexMathEfficiently(latex, oldLatex) || + this.renderLatexMathFromScratch(latex); + this.updateMathspeak(); + } + cursor.insAtRightEnd(root); + }; + Controller_latex.prototype.renderLatexText = function (latex) { + var _c; + var root = this.root, cursor = this.cursor; + root.domFrag().children().slice(1).remove(); + root.setEnds((_c = {}, _c[L] = 0, _c[R] = 0, _c)); + delete cursor.selection; + cursor.show().insAtRightEnd(root); + var regex = Parser.regex; + var string = Parser.string; + var eof = Parser.eof; + var all = Parser.all; + // Parser RootMathCommand + var mathMode = string('$') + .then(latexMathParser) + // because TeX is insane, math mode doesn't necessarily + // have to end. So we allow for the case that math mode + // continues to the end of the stream. + .skip(string('$').or(eof)) + .map(function (block) { + // HACK FIXME: this shouldn't have to have access to cursor + var rootMathCommand = new RootMathCommand(cursor); + rootMathCommand.createBlocks(); + var rootMathBlock = rootMathCommand.getEnd(L); + block.children().adopt(rootMathBlock, 0, 0); + return rootMathCommand; + }); + var escapedDollar = string('\\$').result('$'); + var textChar = escapedDollar + .or(regex(/^[^$]/)) + .map(function (ch) { return new VanillaSymbol(ch); }); + var latexText = mathMode.or(textChar).many(); + var commands = latexText + .skip(eof) + .or(all.result(false)) + .parse(latex); + if (commands) { + for (var i = 0; i < commands.length; i += 1) { + commands[i].adopt(root, root.getEnd(R), 0); + } + domFrag(root.html()).appendTo(root.domFrag().oneElement()); + root.finalizeInsert(cursor.options, cursor); + } + }; + return Controller_latex; + }(Controller_keystroke)); + /******************************************************** + * Deals with mouse events for clicking, drag-to-select + *******************************************************/ + var ignoreNextMouseDownNoop = function (_el) { + return false; + }; + Options.prototype.ignoreNextMousedown = ignoreNextMouseDownNoop; + // Whenever edits to the tree occur, in-progress selection events + // must be invalidated and selection changes must not be applied to + // the edited tree. cancelSelectionOnEdit takes care of this. + var cancelSelectionOnEdit; + (function () { + ControllerBase.onNotify(function (cursor, e) { + if (e === 'edit' || e === 'replace') { + // this will be called any time ANY mathquill is edited. We only want + // to cancel selection if the selection is happening within the mathquill + // that dispatched the notify. Otherwise you won't be able to select any + // mathquills while a slider is playing. + if (cancelSelectionOnEdit && cancelSelectionOnEdit.cursor === cursor) { + cancelSelectionOnEdit.cb(); + } + } + }); + })(); + var Controller_mouse = /** @class */ (function (_super) { + __extends(Controller_mouse, _super); + function Controller_mouse() { + var _this_1 = _super !== null && _super.apply(this, arguments) || this; + _this_1.handleMouseDown = function (e) { + var rootElement = closest(e.target, '.dcg-mq-root-block'); + var root = ((rootElement && NodeBase.getNodeOfElement(rootElement)) || + NodeBase.getNodeOfElement(_this_1.root.domFrag().oneElement())); + var ownerDocument = root.domFrag().firstNode().ownerDocument; + var ctrlr = root.controller, cursor = ctrlr.cursor, blink = cursor.blink; + var textareaSpan = ctrlr.getTextareaSpanOrThrow(); + var textarea = ctrlr.getTextareaOrThrow(); + e.preventDefault(); // doesn't work in IE\u22648, but it's a one-line fix: + e.target.unselectable = true; // http://jsbin.com/yagekiji/1 // TODO - no idea what this unselectable property is + if (cursor.options.ignoreNextMousedown(e)) + return; + else + cursor.options.ignoreNextMousedown = ignoreNextMouseDownNoop; + var lastMousemoveTarget = null; + function mousemove(e) { + lastMousemoveTarget = e.target; + } + function onDocumentMouseMove(e) { + if (!cursor.anticursor) + cursor.startSelection(); + ctrlr.seek(lastMousemoveTarget, e.clientX, e.clientY).cursor.select(); + if (cursor.selection) + cursor.controller.aria + .clear() + .queue(cursor.selection.join('mathspeak') + ' selected') + .alert(); + lastMousemoveTarget = null; + } + // outside rootElement, the MathQuill node corresponding to the target (if any) + // won't be inside this root, so don't mislead Controller::seek with it + function unbindListeners() { + // delete the mouse handlers now that we're not dragging anymore + rootElement === null || rootElement === void 0 ? void 0 : rootElement.removeEventListener('mousemove', mousemove); + ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.removeEventListener('mousemove', onDocumentMouseMove); + ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.removeEventListener('mouseup', onDocumentMouseUp); + cancelSelectionOnEdit = undefined; + } + function updateCursor() { + if (ctrlr.editable) { + cursor.show(); + cursor.controller.aria.queue(cursor.parent).alert(); + } + else { + domFrag(textareaSpan).detach(); + } + } + function onDocumentMouseUp() { + cursor.blink = blink; + if (!cursor.selection) + updateCursor(); + unbindListeners(); + } + var wasEdited; + cancelSelectionOnEdit = { + cursor: cursor, + cb: function () { + // If an edit happens while the mouse is down, the existing + // selection is no longer valid. Clear it and unbind listeners, + // similar to what happens on mouseup. + wasEdited = true; + cursor.blink = blink; + cursor.clearSelection(); + updateCursor(); + unbindListeners(); + }, + }; + if (ctrlr.blurred) { + if (rootElement && !ctrlr.editable) { + domFrag(rootElement).prepend(domFrag(textareaSpan)); + } + textarea.focus(); + // focus call may bubble to clients, who may then write to + // mathquill, triggering cancelSelectionOnEdit. If that happens, we + // don't want to stop the cursor blink or bind listeners, + // so return early. + if (wasEdited) + return; + } + cursor.blink = noop; + ctrlr + .seek(e.target, e.clientX, e.clientY) + .cursor.startSelection(); + rootElement === null || rootElement === void 0 ? void 0 : rootElement.addEventListener('mousemove', mousemove); + ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.addEventListener('mousemove', onDocumentMouseMove); + ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.addEventListener('mouseup', onDocumentMouseUp); + // listen on document not just body to not only hear about mousemove and + // mouseup on page outside field, but even outside page, except iframes: https://github.com/mathquill/mathquill/commit/8c50028afcffcace655d8ae2049f6e02482346c5#commitcomment-6175800 + }; + return _this_1; + } + Controller_mouse.prototype.addMouseEventListener = function () { + //drag-to-select event handling + this.container.addEventListener('mousedown', this.handleMouseDown); + }; + Controller_mouse.prototype.removeMouseEventListener = function () { + this.container.removeEventListener('mousedown', this.handleMouseDown); + }; + Controller_mouse.prototype.seek = function (targetElm, clientX, _clientY) { + var cursor = this.notify('select').cursor; + var node; + // we can click on an element that is deeply nested past the point + // that mathquill knows about. We need to traverse up to the first + // node that mathquill is aware of + while (targetElm) { + // try to find the MQ Node associated with the DOM Element + node = NodeBase.getNodeOfElement(targetElm); + if (node) + break; + // must be too deep, traverse up to the parent DOM Element + targetElm = targetElm.parentElement; + } + // Could not find any nodes, just use the root + if (!node) { + node = this.root; + } + // don't clear selection until after getting node from target, in case + // target was selection span, otherwise target will have no parent and will + // seek from root, which is less accurate (e.g. fraction) + cursor.clearSelection().show(); + node.seek(clientX, cursor); + this.scrollHoriz(); // before .selectFrom when mouse-selecting, so + // always hits no-selection case in scrollHoriz and scrolls slower + return this; + }; + return Controller_mouse; + }(Controller_latex)); + /*********************************************** + * Horizontal panning for editable fields that + * overflow their width + **********************************************/ + var Controller_scrollHoriz = /** @class */ (function (_super) { + __extends(Controller_scrollHoriz, _super); + function Controller_scrollHoriz() { + return _super !== null && _super.apply(this, arguments) || this; + } + Controller_scrollHoriz.prototype.setOverflowClasses = function () { + var root = this.root.domFrag().oneElement(); + var shouldHaveOverflowRight = false; + var shouldHaveOverflowLeft = false; + if (!this.blurred) { + var width = getBoundingClientRect(root).width; + var scrollWidth = root.scrollWidth; + var scroll = root.scrollLeft; + shouldHaveOverflowRight = scrollWidth > width + scroll; + shouldHaveOverflowLeft = scroll > 0; + } + if (root.classList.contains('dcg-mq-editing-overflow-right') !== + shouldHaveOverflowRight) + root.classList.toggle('dcg-mq-editing-overflow-right'); + if (root.classList.contains('dcg-mq-editing-overflow-left') !== + shouldHaveOverflowLeft) + root.classList.toggle('dcg-mq-editing-overflow-left'); + }; + Controller_scrollHoriz.prototype.scrollHoriz = function () { + var _this_1 = this; + var cursor = this.cursor, seln = cursor.selection; + var rootRect = getBoundingClientRect(this.root.domFrag().oneElement()); + if (cursor.domFrag().isEmpty() && !seln) { + if (this.cancelScrollHoriz) { + this.cancelScrollHoriz(); + this.cancelScrollHoriz = undefined; + } + var rootElt_1 = this.root.domFrag().oneElement(); + var start_1 = rootElt_1.scrollLeft; + animate(this.getScrollAnimationDuration(), function (progress, scheduleNext, cancel) { + if (progress >= 1) { + _this_1.cancelScrollHoriz = undefined; + rootElt_1.scrollLeft = 0; + _this_1.setOverflowClasses(); + } + else { + _this_1.cancelScrollHoriz = cancel; + scheduleNext(); + rootElt_1.scrollLeft = Math.round((1 - progress) * start_1); + } + }); + return; + } + else if (!seln) { + var x = getBoundingClientRect(cursor.domFrag().oneElement()).left; + if (x > rootRect.right - 20) + var scrollBy = x - (rootRect.right - 20); + else if (x < rootRect.left + 20) + var scrollBy = x - (rootRect.left + 20); + else + return; + } + else { + var rect = getBoundingClientRect(seln.domFrag().oneElement()); + var overLeft = rect.left - (rootRect.left + 20); + var overRight = rect.right - (rootRect.right - 20); + if (seln.getEnd(L) === cursor[R]) { + if (overLeft < 0) + var scrollBy = overLeft; + else if (overRight > 0) { + if (rect.left - overRight < rootRect.left + 20) + var scrollBy = overLeft; + else + var scrollBy = overRight; + } + else + return; + } + else { + if (overRight > 0) + var scrollBy = overRight; + else if (overLeft < 0) { + if (rect.right - overLeft > rootRect.right - 20) + var scrollBy = overRight; + else + var scrollBy = overLeft; + } + else + return; + } + } + var root = this.root.domFrag().oneElement(); + if (scrollBy < 0 && root.scrollLeft === 0) + return; + if (scrollBy > 0 && root.scrollWidth <= root.scrollLeft + rootRect.width) + return; + if (this.cancelScrollHoriz) { + this.cancelScrollHoriz(); + this.cancelScrollHoriz = undefined; + } + var rootElt = this.root.domFrag().oneElement(); + var start = rootElt.scrollLeft; + animate(this.getScrollAnimationDuration(), function (progress, scheduleNext, cancel) { + if (progress >= 1) { + _this_1.cancelScrollHoriz = undefined; + rootElt.scrollLeft = Math.round(start + scrollBy); + _this_1.setOverflowClasses(); + } + else { + _this_1.cancelScrollHoriz = cancel; + scheduleNext(); + rootElt.scrollLeft = Math.round(start + progress * scrollBy); + } + }); + }; + Controller_scrollHoriz.prototype.getScrollAnimationDuration = function () { + var _c; + return (_c = this.options.scrollAnimationDuration) !== null && _c !== void 0 ? _c : 100; + }; + return Controller_scrollHoriz; + }(Controller_mouse)); + /********************************************* + * Manage the MathQuill instance's textarea + * (as owned by the Controller) + ********************************************/ + Options.prototype.substituteTextarea = function () { + return h('textarea', { + autocapitalize: 'off', + autocomplete: 'off', + autocorrect: 'off', + spellcheck: false, + 'x-palm-disable-ste-all': true, + }); + }; + function defaultSubstituteKeyboardEvents(jq, controller) { + return saneKeyboardEvents(jq[0], controller); + } + Options.prototype.substituteKeyboardEvents = defaultSubstituteKeyboardEvents; + var Controller = /** @class */ (function (_super) { + __extends(Controller, _super); + function Controller() { + var _this_1 = _super !== null && _super.apply(this, arguments) || this; + _this_1.selectFn = noop; + return _this_1; + } + Controller.prototype.createTextarea = function () { + this.textareaSpan = h('span', { class: 'dcg-mq-textarea' }); + var textarea = this.options.substituteTextarea(); + if (!textarea.nodeType) { + throw 'substituteTextarea() must return a DOM element, got ' + textarea; + } + this.textarea = domFrag(textarea) + .appendTo(this.textareaSpan) + .oneElement(); + var ctrlr = this; + ctrlr.cursor.selectionChanged = function () { + ctrlr.selectionChanged(); + }; + }; + Controller.prototype.selectionChanged = function () { + var ctrlr = this; + // throttle calls to setTextareaSelection(), because setting textarea.value + // and/or calling textarea.select() can have anomalously bad performance: + // https://github.com/mathquill/mathquill/issues/43#issuecomment-1399080 + // + // Note, this timeout may be cleared by the blur handler in focusBlur.js + if (!ctrlr.textareaSelectionTimeout) { + ctrlr.textareaSelectionTimeout = setTimeout(function () { + ctrlr.setTextareaSelection(); + }); + } + }; + Controller.prototype.setTextareaSelection = function () { + this.textareaSelectionTimeout = 0; + var latex = ''; + if (this.cursor.selection) { + //cleanLatex prunes unnecessary spaces. defined in latex.js + latex = this.cleanLatex(this.cursor.selection.join('latex')); + if (this.options.statelessClipboard) { + // FIXME: like paste, only this works for math fields; should ask parent + latex = '$' + latex + '$'; + } + } + this.selectFn(latex); + }; + Controller.prototype.staticMathTextareaEvents = function () { + var ctrlr = this; + this.removeTextareaEventListener('cut'); + this.removeTextareaEventListener('paste'); + if (ctrlr.options.disableCopyPaste) { + this.removeTextareaEventListener('copy'); + } + else { + this.addTextareaEventListeners({ + copy: function () { + ctrlr.setTextareaSelection(); + }, + }); + } + this.addStaticFocusBlurListeners(); + ctrlr.selectFn = function (text) { + var textarea = ctrlr.getTextareaOrThrow(); + if (!(textarea instanceof HTMLTextAreaElement)) + return; + textarea.value = text; + if (text) + textarea.select(); + }; + }; + Controller.prototype.editablesTextareaEvents = function () { + var ctrlr = this; + var textarea = ctrlr.getTextareaOrThrow(); + var textareaSpan = ctrlr.getTextareaSpanOrThrow(); + if (this.options.version < 3) { + var $ = this.options.assertJquery(); + var keyboardEventsShim = this.options.substituteKeyboardEvents($(textarea), this); + this.selectFn = function (text) { + keyboardEventsShim.select(text); + }; + } + else { + var select = saneKeyboardEvents(textarea, this).select; + this.selectFn = select; + } + domFrag(this.container).prepend(domFrag(textareaSpan)); + this.addEditableFocusBlurListeners(); + this.updateMathspeak(); + }; + Controller.prototype.unbindEditablesEvents = function () { + var ctrlr = this; + var textarea = ctrlr.getTextareaOrThrow(); + var textareaSpan = ctrlr.getTextareaSpanOrThrow(); + this.selectFn = function (text) { + if (!(textarea instanceof HTMLTextAreaElement)) + return; + textarea.value = text; + if (text) + textarea.select(); + }; + domFrag(textareaSpan).remove(); + this.removeTextareaEventListener('focus'); + this.removeTextareaEventListener('blur'); + ctrlr.blurred = true; + this.removeTextareaEventListener('cut'); + this.removeTextareaEventListener('paste'); + }; + Controller.prototype.typedText = function (ch) { + if (ch === '\n') + return this.handle('enter'); + var cursor = this.notify(undefined).cursor; + cursor.parent.write(cursor, ch); + this.scrollHoriz(); + }; + Controller.prototype.cut = function () { + var ctrlr = this, cursor = ctrlr.cursor; + if (cursor.selection) { + setTimeout(function () { + ctrlr.notify('edit'); // deletes selection if present + cursor.parent.bubble(function (node) { + node.reflow(); + return undefined; + }); + if (ctrlr.options && ctrlr.options.onCut) { + ctrlr.options.onCut(); + } + }); + } + }; + Controller.prototype.copy = function () { + this.setTextareaSelection(); + }; + Controller.prototype.paste = function (text) { + // TODO: document `statelessClipboard` config option in README, after + // making it work like it should, that is, in both text and math mode + // (currently only works in math fields, so worse than pointless, it + // only gets in the way by \text{}-ifying pasted stuff and $-ifying + // cut/copied LaTeX) + if (this.options.statelessClipboard) { + if (text.slice(0, 1) === '$' && text.slice(-1) === '$') { + text = text.slice(1, -1); + } + else { + text = '\\text{' + text + '}'; + } + } + // FIXME: this always inserts math or a TextBlock, even in a RootTextBlock + this.writeLatex(text).cursor.show(); + this.scrollHoriz(); + if (this.options && this.options.onPaste) { + this.options.onPaste(); + } + }; + /** Set up for a static MQ field (i.e., create and attach the mathspeak element and initialize the focus state to blurred) */ + Controller.prototype.setupStaticField = function () { + this.mathspeakSpan = h('span', { class: 'dcg-mq-mathspeak' }); + domFrag(this.container).prepend(domFrag(this.mathspeakSpan)); + this.updateMathspeak(); + this.blurred = true; + this.cursor.hide().parent.blur(this.cursor); + }; + Controller.prototype.updateMathspeak = function () { + var ctrlr = this; + // If the controller's ARIA label doesn't end with a punctuation mark, add a colon by default to better separate it from mathspeak. + var ariaLabel = ctrlr.getAriaLabel(); + var labelWithSuffix = /[A-Za-z0-9]$/.test(ariaLabel) + ? ariaLabel + ':' + : ariaLabel; + var mathspeak = ctrlr.root.mathspeak().trim(); + this.aria.clear(); + var textarea = ctrlr.getTextareaOrThrow(); + // For static math, provide mathspeak in a visually hidden span to allow screen readers and other AT to traverse the content. + // For editable math, assign the mathspeak to the textarea's ARIA label (AT can use text navigation to interrogate the content). + // Be certain to include the mathspeak for only one of these, though, as we don't want to include outdated labels if a field's editable state changes. + // By design, also take careful note that the ariaPostLabel is meant to exist only for editable math (e.g. to serve as an evaluation or error message) + // so it is not included for static math mathspeak calculations. + // The mathspeakSpan should exist only for static math, so we use its presence to decide which approach to take. + if (!!ctrlr.mathspeakSpan) { + textarea.setAttribute('aria-label', ''); + ctrlr.mathspeakSpan.textContent = (labelWithSuffix + + ' ' + + mathspeak).trim(); + } + else { + textarea.setAttribute('aria-label', (labelWithSuffix + ' ' + mathspeak + ' ' + ctrlr.ariaPostLabel).trim()); + } + }; + return Controller; + }(Controller_scrollHoriz)); + /************************************************* + * Abstract classes of math blocks and commands. + ************************************************/ + /** + * Math tree node base class. + * Some math-tree-specific extensions to MQNode. + * Both MathBlock's and MathCommand's descend from it. + */ + var MathElement = /** @class */ (function (_super) { + __extends(MathElement, _super); + function MathElement() { + return _super !== null && _super.apply(this, arguments) || this; + } + MathElement.prototype.finalizeInsert = function (options, cursor) { + var self = this; + self.postOrder(function (node) { + node.finalizeTree(options); + }); + self.postOrder(function (node) { + node.contactWeld(cursor); + }); + // note: this order is important. + // empty elements need the empty box provided by blur to + // be present in order for their dimensions to be measured + // correctly by 'reflow' handlers. + self.postOrder(function (node) { + node.blur(cursor); + }); + self.postOrder(function (node) { + node.reflow(); + }); + var selfR = self[R]; + var selfL = self[L]; + if (selfR) + selfR.siblingCreated(options, L); + if (selfL) + selfL.siblingCreated(options, R); + self.bubble(function (node) { + node.reflow(); + return undefined; + }); + }; + // If the maxDepth option is set, make sure + // deeply nested content is truncated. Just return + // false if the cursor is already too deep. + MathElement.prototype.prepareInsertionAt = function (cursor) { + var maxDepth = cursor.options.maxDepth; + if (maxDepth !== undefined) { + var cursorDepth = cursor.depth(); + if (cursorDepth > maxDepth) { + return false; + } + this.removeNodesDeeperThan(maxDepth - cursorDepth); + } + return true; + }; + // Remove nodes that are more than `cutoff` + // blocks deep from this node. + MathElement.prototype.removeNodesDeeperThan = function (cutoff) { + var depth = 0; + var queue = [[this, depth]]; + var current; + // Do a breadth-first search of this node's descendants + // down to cutoff, removing anything deeper. + while ((current = queue.shift())) { + var c = current; + c[0].children().each(function (child) { + var i = child instanceof MathBlock ? 1 : 0; + depth = c[1] + i; + if (depth <= cutoff) { + queue.push([child, depth]); + } + else { + (i ? child.children() : child).remove(); + } + return undefined; + }); + } + }; + return MathElement; + }(MQNode)); + var DOMView = /** @class */ (function () { + function DOMView(childCount, render) { + this.childCount = childCount; + this.render = render; + } + return DOMView; + }()); + /** + * Commands and operators, like subscripts, exponents, or fractions. + * Descendant commands are organized into blocks. + */ + var MathCommand = /** @class */ (function (_super) { + __extends(MathCommand, _super); + function MathCommand(ctrlSeq, domView, textTemplate) { + var _this_1 = _super.call(this) || this; + _this_1.textTemplate = ['']; + _this_1.mathspeakTemplate = ['']; + _this_1.setCtrlSeqHtmlAndText(ctrlSeq, domView, textTemplate); + return _this_1; + } + MathCommand.prototype.setEnds = function (ends) { + pray('MathCommand ends are never empty', ends[L] && ends[R]); + this.ends = ends; + }; + MathCommand.prototype.getEnd = function (dir) { + return this.ends[dir]; + }; + MathCommand.prototype.setCtrlSeqHtmlAndText = function (ctrlSeq, domView, textTemplate) { + if (!this.ctrlSeq) + this.ctrlSeq = ctrlSeq; + if (domView) + this.domView = domView; + if (textTemplate) + this.textTemplate = textTemplate; + }; + // obvious methods + MathCommand.prototype.replaces = function (replacedFragment) { + replacedFragment.disown(); + this.replacedFragment = replacedFragment; + }; + MathCommand.prototype.isEmpty = function () { + return this.foldChildren(true, function (isEmpty, child) { + return isEmpty && child.isEmpty(); + }); + }; + MathCommand.prototype.parser = function () { + var _this_1 = this; + var block = latexMathParser.block; + return block.times(this.numBlocks()).map(function (blocks) { + _this_1.blocks = blocks; + for (var i = 0; i < blocks.length; i += 1) { + blocks[i].adopt(_this_1, _this_1.getEnd(R), 0); + } + return _this_1; + }); + }; + // createLeftOf(cursor) and the methods it calls + MathCommand.prototype.createLeftOf = function (cursor) { + var cmd = this; + var replacedFragment = cmd.replacedFragment; + cmd.createBlocks(); + _super.prototype.createLeftOf.call(this, cursor); + if (replacedFragment) { + var cmdEndsL = cmd.getEnd(L); + replacedFragment.adopt(cmdEndsL, 0, 0); + replacedFragment.domFrag().appendTo(cmdEndsL.domFrag().oneElement()); + cmd.placeCursor(cursor); + cmd.prepareInsertionAt(cursor); + } + cmd.finalizeInsert(cursor.options, cursor); + cmd.placeCursor(cursor); + }; + MathCommand.prototype.createBlocks = function () { + var cmd = this, numBlocks = cmd.numBlocks(), blocks = (cmd.blocks = Array(numBlocks)); + for (var i = 0; i < numBlocks; i += 1) { + var newBlock = (blocks[i] = new MathBlock()); + newBlock.adopt(cmd, cmd.getEnd(R), 0); + } + }; + MathCommand.prototype.placeCursor = function (cursor) { + //insert the cursor at the right end of the first empty child, searching + //left-to-right, or if none empty, the right end child + cursor.insAtRightEnd(this.foldChildren(this.getEnd(L), function (leftward, child) { + return leftward.isEmpty() ? leftward : child; + })); + }; + // editability methods: called by the cursor for editing, cursor movements, + // and selection of the MathQuill tree, these all take in a direction and + // the cursor + MathCommand.prototype.moveTowards = function (dir, cursor, updown) { + var updownInto; + if (updown === 'up') { + updownInto = this.upInto; + } + else if (updown === 'down') { + updownInto = this.downInto; + } + var el = updownInto || this.getEnd(-dir); + cursor.insAtDirEnd(-dir, el); + cursor.controller.aria + .queueDirEndOf(-dir) + .queue(cursor.parent, true); + }; + MathCommand.prototype.deleteTowards = function (dir, cursor) { + if (this.isEmpty()) + cursor[dir] = this.remove()[dir]; + else + this.moveTowards(dir, cursor); + }; + MathCommand.prototype.selectTowards = function (dir, cursor) { + cursor[-dir] = this; + cursor[dir] = this[dir]; + }; + MathCommand.prototype.selectChildren = function () { + return new MQSelection(this, this); + }; + MathCommand.prototype.unselectInto = function (dir, cursor) { + var antiCursor = cursor.anticursor; + var ancestor = antiCursor.ancestors[this.id]; + cursor.insAtDirEnd(-dir, ancestor); + }; + MathCommand.prototype.seek = function (clientX, cursor) { + function getBounds(node) { + var _c; + var el = node.domFrag().oneElement(); + var l = getBoundingClientRect(el).left; + var r = l + el.offsetWidth; + return _c = {}, + _c[L] = l, + _c[R] = r, + _c; + } + var cmd = this; + var cmdBounds = getBounds(cmd); + if (clientX < cmdBounds[L]) + return cursor.insLeftOf(cmd); + if (clientX > cmdBounds[R]) + return cursor.insRightOf(cmd); + var leftLeftBound = cmdBounds[L]; + cmd.eachChild(function (block) { + var blockBounds = getBounds(block); + if (clientX < blockBounds[L]) { + // closer to this block's left bound, or the bound left of that? + if (clientX - leftLeftBound < blockBounds[L] - clientX) { + if (block[L]) + cursor.insAtRightEnd(block[L]); + else + cursor.insLeftOf(cmd); + } + else + cursor.insAtLeftEnd(block); + return false; + } + else if (clientX > blockBounds[R]) { + if (block[R]) + leftLeftBound = blockBounds[R]; + // continue to next block + else { + // last (rightmost) block + // closer to this block's right bound, or the cmd's right bound? + if (cmdBounds[R] - clientX < clientX - blockBounds[R]) { + cursor.insRightOf(cmd); + } + else + cursor.insAtRightEnd(block); + } + return undefined; + } + else { + block.seek(clientX, cursor); + return false; + } + }); + return undefined; + }; + MathCommand.prototype.numBlocks = function () { + return this.domView.childCount; + }; + /** + * Render the entire math subtree rooted at this command to a DOM node. Assumes `this.domView` is defined. + * + * See dom.test.js for example templates and intended outputs. + */ + MathCommand.prototype.html = function () { + var blocks = this.blocks; + pray('domView is defined', this.domView); + var template = this.domView; + var dom = template.render(blocks || []); + this.setDOM(dom); + NodeBase.linkElementByCmdNode(dom, this); + return dom; + }; + // methods to export a string representation of the math tree + MathCommand.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += this.ctrlSeq || ''; + this.eachChild(function (child) { + ctx.latex += '{'; + var beforeLength = ctx.latex.length; + child.latexRecursive(ctx); + var afterLength = ctx.latex.length; + if (beforeLength === afterLength) { + // nothing was written so we write a space + ctx.latex += ' '; + } + ctx.latex += '}'; + }); + this.checkCursorContextClose(ctx); + }; + MathCommand.prototype.text = function () { + var cmd = this, i = 0; + return cmd.foldChildren(cmd.textTemplate[i], function (text, child) { + i += 1; + var child_text = child.text(); + if (text && + cmd.textTemplate[i] === '(' && + child_text[0] === '(' && + child_text.slice(-1) === ')') + return text + child_text.slice(1, -1) + cmd.textTemplate[i]; + return text + child_text + (cmd.textTemplate[i] || ''); + }); + }; + MathCommand.prototype.mathspeak = function () { + var cmd = this, i = 0; + return cmd.foldChildren(cmd.mathspeakTemplate[i] || 'Start' + cmd.ctrlSeq + ' ', function (speech, block) { + i += 1; + return (speech + + ' ' + + block.mathspeak() + + ' ' + + (cmd.mathspeakTemplate[i] + ' ' || 'End' + cmd.ctrlSeq + ' ')); + }); + }; + return MathCommand; + }(MathElement)); + /** + * Lightweight command without blocks or children. + */ + var MQSymbol = /** @class */ (function (_super) { + __extends(MQSymbol, _super); + function MQSymbol(ctrlSeq, html, text, mathspeak) { + var _this_1 = _super.call(this) || this; + _this_1.setCtrlSeqHtmlTextAndMathspeak(ctrlSeq, html + ? new DOMView(0, function () { return html.cloneNode(true); }) + : undefined, text, mathspeak); + return _this_1; + } + MQSymbol.prototype.setCtrlSeqHtmlTextAndMathspeak = function (ctrlSeq, html, text, mathspeak) { + if (!text && !!ctrlSeq) { + text = ctrlSeq.replace(/^\\/, ''); + } + this.mathspeakName = mathspeak || text; + _super.prototype.setCtrlSeqHtmlAndText.call(this, ctrlSeq, html, [text || '']); + }; + MQSymbol.prototype.parser = function () { + return Parser.succeed(this); + }; + MQSymbol.prototype.numBlocks = function () { + return 0; + }; + MQSymbol.prototype.replaces = function (replacedFragment) { + replacedFragment.remove(); + }; + MQSymbol.prototype.createBlocks = function () { }; + MQSymbol.prototype.moveTowards = function (dir, cursor) { + cursor.domFrag().insDirOf(dir, this.domFrag()); + cursor[-dir] = this; + cursor[dir] = this[dir]; + cursor.controller.aria.queue(this); + }; + MQSymbol.prototype.deleteTowards = function (dir, cursor) { + cursor[dir] = this.remove()[dir]; + }; + MQSymbol.prototype.seek = function (clientX, cursor) { + // insert at whichever side the click was closer to + var el = this.domFrag().oneElement(); + var left = getBoundingClientRect(el).left; + if (clientX - left < el.offsetWidth / 2) + cursor.insLeftOf(this); + else + cursor.insRightOf(this); + return cursor; + }; + MQSymbol.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += this.ctrlSeq || ''; + this.checkCursorContextClose(ctx); + }; + MQSymbol.prototype.text = function () { + return this.textTemplate.join(''); + }; + MQSymbol.prototype.mathspeak = function (_opts) { + return this.mathspeakName || ''; + }; + MQSymbol.prototype.placeCursor = function () { }; + MQSymbol.prototype.isEmpty = function () { + return true; + }; + return MQSymbol; + }(MathCommand)); + var VanillaSymbol = /** @class */ (function (_super) { + __extends(VanillaSymbol, _super); + function VanillaSymbol(ch, html, mathspeak) { + return _super.call(this, ch, h('span', {}, [html || h.text(ch)]), undefined, mathspeak) || this; + } + return VanillaSymbol; + }(MQSymbol)); + function bindVanillaSymbol(ch, htmlEntity, mathspeak) { + return function () { + return new VanillaSymbol(ch, htmlEntity ? h.entityText(htmlEntity) : undefined, mathspeak); + }; + } + var BinaryOperator = /** @class */ (function (_super) { + __extends(BinaryOperator, _super); + function BinaryOperator(ctrlSeq, html, text, mathspeak, treatLikeSymbol) { + var _this_1 = this; + if (treatLikeSymbol) { + _this_1 = _super.call(this, ctrlSeq, h('span', {}, [html || h.text(ctrlSeq || '')]), undefined, mathspeak) || this; + } + else { + _this_1 = _super.call(this, ctrlSeq, h('span', { class: 'dcg-mq-binary-operator' }, html ? [html] : []), text, mathspeak) || this; + } + return _this_1; + } + return BinaryOperator; + }(MQSymbol)); + function bindBinaryOperator(ctrlSeq, htmlEntity, text, mathspeak) { + return function () { + return new BinaryOperator(ctrlSeq, htmlEntity ? h.entityText(htmlEntity) : undefined, text, mathspeak); + }; + } + /** + * Children and parent of MathCommand's. Basically partitions all the + * symbols and operators that descend (in the Math DOM tree) from + * ancestor operators. + */ + var MathBlock = /** @class */ (function (_super) { + __extends(MathBlock, _super); + function MathBlock() { + var _this_1 = _super !== null && _super.apply(this, arguments) || this; + _this_1.ariaLabel = 'block'; + return _this_1; + } + MathBlock.prototype.join = function (methodName) { + return this.foldChildren('', function (fold, child) { + return fold + child[methodName](); + }); + }; + MathBlock.prototype.html = function () { + var fragment = document.createDocumentFragment(); + this.eachChild(function (el) { + var childHtml = el.html(); + fragment.appendChild(childHtml); + return undefined; + }); + return fragment; + }; + MathBlock.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + this.eachChild(function (child) { return child.latexRecursive(ctx); }); + this.checkCursorContextClose(ctx); + }; + MathBlock.prototype.text = function () { + var endsL = this.getEnd(L); + var endsR = this.getEnd(R); + return endsL === endsR && endsL !== 0 ? endsL.text() : this.join('text'); + }; + MathBlock.prototype.mathspeak = function () { + var tempOp = ''; + var autoOps = {}; + if (this.controller) + autoOps = this.controller.options.autoOperatorNames; + return (this.foldChildren([], function (speechArray, cmd) { + if (cmd.isPartOfOperator) { + tempOp += cmd.mathspeak(); + } + else { + if (tempOp !== '') { + if (autoOps._maxLength > 0) { + var x = autoOps[tempOp.toLowerCase()]; + if (typeof x === 'string') + tempOp = x; + } + speechArray.push(tempOp + ' '); + tempOp = ''; + } + var mathspeakText = cmd.mathspeak(); + var cmdText = cmd.ctrlSeq; + if (isNaN(cmdText) && // TODO - revisit this to improve the isNumber() check + cmdText !== '.' && + (!cmd.parent || + !cmd.parent.parent || + !cmd.parent.parent.isTextBlock())) { + mathspeakText = ' ' + mathspeakText + ' '; + } + speechArray.push(mathspeakText); + } + return speechArray; + }) + .join('') + .replace(/ +(?= )/g, '') + // For Apple devices in particular, split out digits after a decimal point so they aren't read aloud as whole words. + // Not doing so makes 123.456 potentially spoken as "one hundred twenty-three point four hundred fifty-six." + // Instead, add spaces so it is spoken as "one hundred twenty-three point four five six." + .replace(/(\.)([0-9]+)/g, function (_match, p1, p2) { + return p1 + p2.split('').join(' ').trim(); + })); + }; + MathBlock.prototype.keystroke = function (key, e, ctrlr) { + if (ctrlr.options.spaceBehavesLikeTab && + (key === 'Spacebar' || key === 'Shift-Spacebar')) { + e === null || e === void 0 ? void 0 : e.preventDefault(); + ctrlr.escapeDir(key === 'Shift-Spacebar' ? L : R, key, e); + return; + } + return _super.prototype.keystroke.call(this, key, e, ctrlr); + }; + // editability methods: called by the cursor for editing, cursor movements, + // and selection of the MathQuill tree, these all take in a direction and + // the cursor + MathBlock.prototype.moveOutOf = function (dir, cursor, updown) { + var updownInto; + if (updown === 'up') { + updownInto = this.parent.upInto; + } + else if (updown === 'down') { + updownInto = this.parent.downInto; + } + if (!updownInto && this[dir]) { + var otherDir = -dir; + cursor.insAtDirEnd(otherDir, this[dir]); + cursor.controller.aria.queueDirEndOf(otherDir).queue(cursor.parent, true); + } + else { + cursor.insDirOf(dir, this.parent); + cursor.controller.aria.queueDirOf(dir).queue(this.parent); + } + }; + MathBlock.prototype.selectOutOf = function (dir, cursor) { + cursor.insDirOf(dir, this.parent); + }; + MathBlock.prototype.deleteOutOf = function (_dir, cursor) { + cursor.unwrapGramp(); + }; + MathBlock.prototype.seek = function (clientX, cursor) { + var node = this.getEnd(R); + if (!node) + return cursor.insAtRightEnd(this); + var el = node.domFrag().oneElement(); + var left = getBoundingClientRect(el).left; + if (left + el.offsetWidth < clientX) { + return cursor.insAtRightEnd(this); + } + var endsL = this.getEnd(L); + if (clientX < getBoundingClientRect(endsL.domFrag().oneElement()).left) + return cursor.insAtLeftEnd(this); + while (clientX < getBoundingClientRect(node.domFrag().oneElement()).left) + node = node[L]; + return node.seek(clientX, cursor); + }; + MathBlock.prototype.chToCmd = function (ch, options) { + var cons; + // exclude f because it gets a dedicated command with more spacing + if (ch.match(/^[a-eg-zA-Z]$/)) + return new Letter(ch); + else if (/^\d$/.test(ch)) + return new Digit(ch); + else if (options && options.typingSlashWritesDivisionSymbol && ch === '/') + return LatexCmds['\u00f7'](ch); + else if (options && options.typingAsteriskWritesTimesSymbol && ch === '*') + return LatexCmds['\u00d7'](ch); + else if (options && options.typingPercentWritesPercentOf && ch === '%') + return LatexCmds.percentof(ch); + else if ((cons = CharCmds[ch] || LatexCmds[ch])) { + if (cons.constructor) { + return new cons(ch); + } + else { + return cons(ch); + } + } + else + return new VanillaSymbol(ch); + }; + MathBlock.prototype.write = function (cursor, ch) { + var cmd = this.chToCmd(ch, cursor.options); + if (cursor.selection) + cmd.replaces(cursor.replaceSelection()); + if (!cursor.isTooDeep()) { + cmd.createLeftOf(cursor.show()); + // special-case the slash so that fractions are voiced while typing + if (ch === '/') { + cursor.controller.aria.alert('over'); + } + else { + cursor.controller.aria.alert(cmd.mathspeak({ createdLeftOf: cursor })); + } + } + }; + MathBlock.prototype.writeLatex = function (cursor, latex) { + var all = Parser.all; + var eof = Parser.eof; + var block = latexMathParser + .skip(eof) + .or(all.result(false)) + .parse(latex); + if (block && !block.isEmpty() && block.prepareInsertionAt(cursor)) { + block + .children() + .adopt(cursor.parent, cursor[L], cursor[R]); // TODO - masking undefined. should be 0 + domFrag(block.html()).insertBefore(cursor.domFrag()); + cursor[L] = block.getEnd(R); + block.finalizeInsert(cursor.options, cursor); + var blockEndsR = block.getEnd(R); + var blockEndsL = block.getEnd(L); + var blockEndsRR = blockEndsR[R]; + var blockEndsLL = blockEndsL[L]; + if (blockEndsRR) + blockEndsRR.siblingCreated(cursor.options, L); + if (blockEndsLL) + blockEndsLL.siblingCreated(cursor.options, R); + cursor.parent.bubble(function (node) { + node.reflow(); + return undefined; + }); + } + }; + MathBlock.prototype.focus = function () { + this.domFrag().addClass('dcg-mq-hasCursor'); + this.domFrag().removeClass('dcg-mq-empty'); + return this; + }; + MathBlock.prototype.blur = function (cursor) { + this.domFrag().removeClass('dcg-mq-hasCursor'); + if (this.isEmpty()) { + this.domFrag().addClass('dcg-mq-empty'); + if (cursor && + this.isQuietEmptyDelimiter(cursor.options.quietEmptyDelimiters)) { + this.domFrag().addClass('dcg-mq-quiet-delimiter'); + } + } + return this; + }; + return MathBlock; + }(MathElement)); + Options.prototype.mouseEvents = true; + API.StaticMath = function (APIClasses) { + var _c; + return _c = /** @class */ (function (_super) { + __extends(StaticMath, _super); + function StaticMath(el) { + var _this_1 = _super.call(this, el) || this; + var innerFields = (_this_1.innerFields = []); + _this_1.__controller.root.postOrder(function (node) { + node.registerInnerField(innerFields, APIClasses.InnerMathField); + }); + return _this_1; + } + StaticMath.prototype.__mathquillify = function (opts, _interfaceVersion) { + this.config(opts); + _super.prototype.mathquillify.call(this, 'dcg-mq-math-mode'); + this.__controller.setupStaticField(); + if (this.__options.mouseEvents) { + this.__controller.addMouseEventListener(); + this.__controller.staticMathTextareaEvents(); + } + return this; + }; + StaticMath.prototype.latex = function (_latex) { + var returned = _super.prototype.latex.apply(this, arguments); + if (arguments.length > 0) { + var innerFields = (this.innerFields = []); + this.__controller.root.postOrder(function (node) { + node.registerInnerField(innerFields, APIClasses.InnerMathField); + }); + // Force an ARIA label update to remain in sync with the new LaTeX value. + this.__controller.updateMathspeak(); + } + return returned; + }; + StaticMath.prototype.setAriaLabel = function (ariaLabel) { + this.__controller.setAriaLabel(ariaLabel); + return this; + }; + StaticMath.prototype.getAriaLabel = function () { + return this.__controller.getAriaLabel(); + }; + return StaticMath; + }(APIClasses.AbstractMathQuill)), + _c.RootBlock = MathBlock, + _c; + }; + var RootMathBlock = /** @class */ (function (_super) { + __extends(RootMathBlock, _super); + function RootMathBlock() { + return _super !== null && _super.apply(this, arguments) || this; + } + return RootMathBlock; + }(MathBlock)); + RootBlockMixin(RootMathBlock.prototype); // adds methods to RootMathBlock + API.MathField = function (APIClasses) { + var _c; + return _c = /** @class */ (function (_super) { + __extends(MathField, _super); + function MathField() { + return _super !== null && _super.apply(this, arguments) || this; + } + MathField.prototype.__mathquillify = function (opts, interfaceVersion) { + this.config(opts); + if (interfaceVersion > 1) + this.__controller.root.reflow = noop; + _super.prototype.mathquillify.call(this, 'dcg-mq-editable-field dcg-mq-math-mode'); + // TODO: Why does this need to be deleted (contrary to the type definition)? Could we set it to `noop` instead? + delete this.__controller.root.reflow; + return this; + }; + return MathField; + }(APIClasses.EditableField)), + _c.RootBlock = RootMathBlock, + _c; + }; + API.InnerMathField = function (APIClasses) { + pray('MathField class is defined', APIClasses.MathField); + return /** @class */ (function (_super) { + __extends(class_1, _super); + function class_1() { + return _super !== null && _super.apply(this, arguments) || this; + } + class_1.prototype.makeStatic = function () { + this.__controller.editable = false; + this.__controller.root.blur(); + this.__controller.unbindEditablesEvents(); + domFrag(this.__controller.container).removeClass('dcg-mq-editable-field'); + }; + class_1.prototype.makeEditable = function () { + this.__controller.editable = true; + this.__controller.editablesTextareaEvents(); + this.__controller.cursor.insAtRightEnd(this.__controller.root); + domFrag(this.__controller.container).addClass('dcg-mq-editable-field'); + }; + return class_1; + }(APIClasses.MathField)); + }; + /************************************************* + * Abstract classes of text blocks + ************************************************/ + /** + * Blocks of plain text, with one or two TextPiece's as children. + * Represents flat strings of typically serif-font Roman characters, as + * opposed to hierchical, nested, tree-structured math. + * Wraps a single HTMLSpanElement. + */ + var TextBlock = /** @class */ (function (_super) { + __extends(TextBlock, _super); + function TextBlock() { + var _this_1 = _super !== null && _super.apply(this, arguments) || this; + _this_1.ctrlSeq = '\\text'; + _this_1.ariaLabel = 'Text'; + _this_1.mathspeakTemplate = ['StartText', 'EndText']; + return _this_1; + } + TextBlock.prototype.replaces = function (replacedText) { + if (replacedText instanceof Fragment) { + this.replacedText = replacedText.remove().domFrag().text(); + } + else if (typeof replacedText === 'string') + this.replacedText = replacedText; + }; + TextBlock.prototype.setDOMFrag = function (el) { + _super.prototype.setDOM.call(this, el); + var endsL = this.getEnd(L); + if (endsL) { + var children = this.domFrag().children(); + if (!children.isEmpty()) { + endsL.setDOM(children.oneText()); + } + } + return this; + }; + TextBlock.prototype.createLeftOf = function (cursor) { + var textBlock = this; + _super.prototype.createLeftOf.call(this, cursor); + cursor.insAtRightEnd(textBlock); + if (textBlock.replacedText) + for (var i = 0; i < textBlock.replacedText.length; i += 1) + textBlock.write(cursor, textBlock.replacedText.charAt(i)); + var textBlockR = textBlock[R]; + if (textBlockR) + textBlockR.siblingCreated(cursor.options, L); + var textBlockL = textBlock[L]; + if (textBlockL) + textBlockL.siblingCreated(cursor.options, R); + textBlock.bubble(function (node) { + node.reflow(); + return undefined; + }); + }; + TextBlock.prototype.parser = function () { + var textBlock = this; + // TODO: correctly parse text mode + var string = Parser.string; + var regex = Parser.regex; + var optWhitespace = Parser.optWhitespace; + return optWhitespace + .then(string('{')) + .then(regex(/^[^}]*/)) + .skip(string('}')) + .map(function (text) { + if (text.length === 0) + return new Fragment(0, 0); + new TextPiece(text).adopt(textBlock, 0, 0); + return textBlock; + }); + }; + TextBlock.prototype.textContents = function () { + return this.foldChildren('', function (text, child) { + return text + child.textStr; + }); + }; + TextBlock.prototype.text = function () { + return '"' + this.textContents() + '"'; + }; + TextBlock.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + var contents = this.textContents(); + if (contents.length > 0) { + ctx.latex += this.ctrlSeq + '{'; + ctx.latex += contents + .replace(/\\/g, '\\backslash ') + .replace(/[{}]/g, '\\$&'); + ctx.latex += '}'; + } + this.checkCursorContextClose(ctx); + }; + TextBlock.prototype.html = function () { + var out = h('span', { class: 'dcg-mq-text-mode' }, [ + h.text(this.textContents()), + ]); + this.setDOM(out); + NodeBase.linkElementByCmdNode(out, this); + return out; + }; + TextBlock.prototype.mathspeak = function (opts) { + if (opts && opts.ignoreShorthand) { + return (this.mathspeakTemplate[0] + + ', ' + + this.textContents() + + ', ' + + this.mathspeakTemplate[1]); + } + else { + return this.textContents(); + } + }; + TextBlock.prototype.isTextBlock = function () { + return true; + }; + // editability methods: called by the cursor for editing, cursor movements, + // and selection of the MathQuill tree, these all take in a direction and + // the cursor + TextBlock.prototype.moveTowards = function (dir, cursor) { + cursor.insAtDirEnd(-dir, this); + cursor.controller.aria + .queueDirEndOf(-dir) + .queue(cursor.parent, true); + }; + TextBlock.prototype.moveOutOf = function (dir, cursor) { + cursor.insDirOf(dir, this); + cursor.controller.aria.queueDirOf(dir).queue(this); + }; + TextBlock.prototype.unselectInto = function (dir, cursor) { + this.moveTowards(dir, cursor); + }; + // TODO: make these methods part of a shared mixin or something. + TextBlock.prototype.selectTowards = function (dir, cursor) { + MathCommand.prototype.selectTowards.call(this, dir, cursor); + }; + TextBlock.prototype.deleteTowards = function (dir, cursor) { + MathCommand.prototype.deleteTowards.call(this, dir, cursor); + }; + TextBlock.prototype.selectOutOf = function (dir, cursor) { + cursor.insDirOf(dir, this); + }; + TextBlock.prototype.deleteOutOf = function (_dir, cursor) { + // backspace and delete at ends of block don't unwrap + if (this.isEmpty()) + cursor.insRightOf(this); + }; + TextBlock.prototype.write = function (cursor, ch) { + cursor.show().deleteSelection(); + if (ch !== '$') { + var cursorL = cursor[L]; + if (!cursorL) + new TextPiece(ch).createLeftOf(cursor); + else if (cursorL instanceof TextPiece) + cursorL.appendText(ch); + } + else if (this.isEmpty()) { + cursor.insRightOf(this); + new VanillaSymbol('\\$', h.text('$')).createLeftOf(cursor); + } + else if (!cursor[R]) + cursor.insRightOf(this); + else if (!cursor[L]) + cursor.insLeftOf(this); + else { + // split apart + var leftBlock = new TextBlock(); + var leftPc = this.getEnd(L); + if (leftPc) { + leftPc.disown().domFrag().detach(); + leftPc.adopt(leftBlock, 0, 0); + } + cursor.insLeftOf(this); + _super.prototype.createLeftOf.call(leftBlock, cursor); // micro-optimization, not for correctness + } + this.bubble(function (node) { + node.reflow(); + return undefined; + }); + // TODO needs tests + cursor.controller.aria.alert(ch); + }; + TextBlock.prototype.writeLatex = function (cursor, latex) { + var cursorL = cursor[L]; + if (!cursorL) + new TextPiece(latex).createLeftOf(cursor); + else if (cursorL instanceof TextPiece) + cursorL.appendText(latex); + this.bubble(function (node) { + node.reflow(); + return undefined; + }); + }; + TextBlock.prototype.seek = function (clientX, cursor) { + cursor.hide(); + var textPc = TextBlockFuseChildren(this); + if (!textPc) + return; + // insert cursor at approx position in DOMTextNode + var textNode = this.domFrag().children().oneText(); + var range = document.createRange(); + range.selectNodeContents(textNode); + var rects = range.getClientRects(); + if (rects.length === 1) { + var _c = rects[0], width = _c.width, left = _c.left; + var avgChWidth = width / this.textContents().length; + var approxPosition = Math.round((clientX - left) / avgChWidth); + if (approxPosition <= 0) { + cursor.insAtLeftEnd(this); + } + else if (approxPosition >= textPc.textStr.length) { + cursor.insAtRightEnd(this); + } + else { + cursor.insLeftOf(textPc.splitRight(approxPosition)); + } + } + else { + cursor.insAtLeftEnd(this); + } + // move towards mousedown (clientX) + var displ = clientX - cursor.show().getBoundingClientRectWithoutMargin().left; // displacement + var dir = displ && displ < 0 ? L : R; + var prevDispl = dir; + // displ * prevDispl > 0 iff displacement direction === previous direction + while (cursor[dir] && displ * prevDispl > 0) { + cursor[dir].moveTowards(dir, cursor); + prevDispl = displ; + displ = clientX - cursor.getBoundingClientRectWithoutMargin().left; + } + if (dir * displ < -dir * prevDispl) + cursor[-dir].moveTowards(-dir, cursor); + if (!cursor.anticursor) { + // about to start mouse-selecting, the anticursor is gonna get put here + var cursorL = cursor[L]; + this.anticursorPosition = + cursorL && cursorL.textStr.length; + // ^ get it? 'cos if there's no cursor[L], it's 0... I'm a terrible person. + } + else if (cursor.anticursor.parent === this) { + // mouse-selecting within this TextBlock, re-insert the anticursor + var cursorL = cursor[L]; + var cursorPosition = cursorL && cursorL.textStr.length; + if (this.anticursorPosition === cursorPosition) { + cursor.anticursor = Anticursor.fromCursor(cursor); + } + else { + if (this.anticursorPosition < cursorPosition) { + var newTextPc = cursorL.splitRight(this.anticursorPosition); + cursor[L] = newTextPc; + } + else { + var cursorR = cursor[R]; + var newTextPc = cursorR.splitRight(this.anticursorPosition - cursorPosition); + } + cursor.anticursor = new Anticursor(this, newTextPc[L], newTextPc); + } + } + }; + TextBlock.prototype.blur = function (cursor) { + MathBlock.prototype.blur.call(this, cursor); + if (!cursor) + return; + if (this.textContents() === '') { + this.remove(); + if (cursor[L] === this) + cursor[L] = this[L]; + else if (cursor[R] === this) + cursor[R] = this[R]; + } + else + TextBlockFuseChildren(this); + }; + TextBlock.prototype.focus = function () { + MathBlock.prototype.focus.call(this); + }; + return TextBlock; + }(MQNode)); + function TextBlockFuseChildren(self) { + self.domFrag().oneElement().normalize(); + var children = self.domFrag().children(); + if (children.isEmpty()) + return; + var textPcDom = children.oneText(); + pray('only node in TextBlock span is Text node', textPcDom.nodeType === 3); + // nodeType === 3 has meant a Text node since ancient times: + // http://reference.sitepoint.com/javascript/Node/nodeType + var textPc = new TextPiece(textPcDom.data); + textPc.setDOM(textPcDom); + self.children().disown(); + textPc.adopt(self, 0, 0); + return textPc; + } + /** + * Piece of plain text, with a TextBlock as a parent and no children. + * Wraps a single DOMTextNode. + * For convenience, has a .textStr property that's just a JavaScript string + * mirroring the text contents of the DOMTextNode. + * Text contents must always be nonempty. + */ + var TextPiece = /** @class */ (function (_super) { + __extends(TextPiece, _super); + function TextPiece(text) { + var _this_1 = _super.call(this) || this; + _this_1.textStr = text; + return _this_1; + } + TextPiece.prototype.html = function () { + var out = h.text(this.textStr); + this.setDOM(out); + return out; + }; + TextPiece.prototype.appendText = function (text) { + this.textStr += text; + this.domFrag().oneText().appendData(text); + }; + TextPiece.prototype.prependText = function (text) { + this.textStr = text + this.textStr; + this.domFrag().oneText().insertData(0, text); + }; + TextPiece.prototype.insTextAtDirEnd = function (text, dir) { + prayDirection(dir); + if (dir === R) + this.appendText(text); + else + this.prependText(text); + }; + TextPiece.prototype.splitRight = function (i) { + var newPc = new TextPiece(this.textStr.slice(i)).adopt(this.parent, this, this[R]); + newPc.setDOM(this.domFrag().oneText().splitText(i)); + this.textStr = this.textStr.slice(0, i); + return newPc; + }; + TextPiece.prototype.endChar = function (dir, text) { + return text.charAt(dir === L ? 0 : -1 + text.length); + }; + TextPiece.prototype.moveTowards = function (dir, cursor) { + prayDirection(dir); + var ch = this.endChar(-dir, this.textStr); + var from = this[-dir]; + if (from instanceof TextPiece) + from.insTextAtDirEnd(ch, dir); + else + new TextPiece(ch).createDir(-dir, cursor); + return this.deleteTowards(dir, cursor); + }; + TextPiece.prototype.mathspeak = function () { + return this.textStr; + }; + TextPiece.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += this.textStr; + this.checkCursorContextClose(ctx); + }; + TextPiece.prototype.deleteTowards = function (dir, cursor) { + if (this.textStr.length > 1) { + var deletedChar; + if (dir === R) { + this.domFrag().oneText().deleteData(0, 1); + deletedChar = this.textStr[0]; + this.textStr = this.textStr.slice(1); + } + else { + // note that the order of these 2 lines is annoyingly important + // (the second line mutates this.textStr.length) + this.domFrag() + .oneText() + .deleteData(-1 + this.textStr.length, 1); + deletedChar = this.textStr[this.textStr.length - 1]; + this.textStr = this.textStr.slice(0, -1); + } + cursor.controller.aria.queue(deletedChar); + } + else { + this.remove(); + cursor[dir] = this[dir]; + cursor.controller.aria.queue(this.textStr); + } + }; + TextPiece.prototype.selectTowards = function (dir, cursor) { + prayDirection(dir); + var anticursor = cursor.anticursor; + if (!anticursor) + return; + var ch = this.endChar(-dir, this.textStr); + if (anticursor[dir] === this) { + var newPc = new TextPiece(ch).createDir(dir, cursor); + anticursor[dir] = newPc; + cursor.insDirOf(dir, newPc); + } + else { + var from = this[-dir]; + if (from instanceof TextPiece) + from.insTextAtDirEnd(ch, dir); + else { + var newPc = new TextPiece(ch).createDir(-dir, cursor); + var selection = cursor.selection; + if (selection) { + newPc.domFrag().insDirOf(-dir, selection.domFrag()); + } + } + if (this.textStr.length === 1 && anticursor[-dir] === this) { + anticursor[-dir] = this[-dir]; // `this` will be removed in deleteTowards + } + } + return this.deleteTowards(dir, cursor); + }; + return TextPiece; + }(MQNode)); + LatexCmds.text = + LatexCmds.textnormal = + LatexCmds.textrm = + LatexCmds.textup = + LatexCmds.textmd = + TextBlock; + function makeTextBlock(latex, ariaLabel, tagName, attrs) { + return /** @class */ (function (_super) { + __extends(class_2, _super); + function class_2() { + var _this_1 = _super !== null && _super.apply(this, arguments) || this; + _this_1.ctrlSeq = latex; + _this_1.mathspeakTemplate = ['Start' + ariaLabel, 'End' + ariaLabel]; + _this_1.ariaLabel = ariaLabel; + return _this_1; + } + class_2.prototype.html = function () { + var out = h(tagName, attrs, [h.text(this.textContents())]); + this.setDOM(out); + NodeBase.linkElementByCmdNode(out, this); + return out; + }; + return class_2; + }(TextBlock)); + } + LatexCmds.em = + LatexCmds.italic = + LatexCmds.italics = + LatexCmds.emph = + LatexCmds.textit = + LatexCmds.textsl = + makeTextBlock('\\textit', 'Italic', 'i', { class: 'dcg-mq-text-mode' }); + LatexCmds.strong = + LatexCmds.bold = + LatexCmds.textbf = + makeTextBlock('\\textbf', 'Bold', 'b', { class: 'dcg-mq-text-mode' }); + LatexCmds.sf = LatexCmds.textsf = makeTextBlock('\\textsf', 'Sans serif font', 'span', { class: 'dcg-mq-sans-serif dcg-mq-text-mode' }); + LatexCmds.tt = LatexCmds.texttt = makeTextBlock('\\texttt', 'Mono space font', 'span', { class: 'dcg-mq-monospace dcg-mq-text-mode' }); + LatexCmds.textsc = makeTextBlock('\\textsc', 'Variable font', 'span', { + style: 'font-variant:small-caps', + class: 'dcg-mq-text-mode', + }); + LatexCmds.uppercase = makeTextBlock('\\uppercase', 'Uppercase', 'span', { + style: 'text-transform:uppercase', + class: 'dcg-mq-text-mode', + }); + LatexCmds.lowercase = makeTextBlock('\\lowercase', 'Lowercase', 'span', { + style: 'text-transform:lowercase', + class: 'dcg-mq-text-mode', + }); + var RootMathCommand = /** @class */ (function (_super) { + __extends(RootMathCommand, _super); + function RootMathCommand(cursor) { + var _this_1 = _super.call(this, '$') || this; + _this_1.domView = new DOMView(1, function (blocks) { + return h.block('span', { class: 'dcg-mq-math-mode' }, blocks[0]); + }); + _this_1.cursor = cursor; + return _this_1; + } + RootMathCommand.prototype.createBlocks = function () { + _super.prototype.createBlocks.call(this); + var endsL = this.getEnd(L); // TODO - how do we know this is a RootMathCommand? + endsL.cursor = this.cursor; + endsL.write = function (cursor, ch) { + if (ch !== '$') + MathBlock.prototype.write.call(this, cursor, ch); + else if (this.isEmpty()) { + cursor.insRightOf(this.parent); + this.parent.deleteTowards(undefined, cursor); + new VanillaSymbol('\\$', h.text('$')).createLeftOf(cursor.show()); + } + else if (!cursor[R]) + cursor.insRightOf(this.parent); + else if (!cursor[L]) + cursor.insLeftOf(this.parent); + else + MathBlock.prototype.write.call(this, cursor, ch); + }; + }; + RootMathCommand.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += '$'; + this.getEnd(L).latexRecursive(ctx); + ctx.latex += '$'; + this.checkCursorContextClose(ctx); + }; + return RootMathCommand; + }(MathCommand)); + var RootTextBlock = /** @class */ (function (_super) { + __extends(RootTextBlock, _super); + function RootTextBlock() { + return _super !== null && _super.apply(this, arguments) || this; + } + RootTextBlock.prototype.keystroke = function (key, e, ctrlr) { + if (key === 'Spacebar' || key === 'Shift-Spacebar') + return; + return _super.prototype.keystroke.call(this, key, e, ctrlr); + }; + RootTextBlock.prototype.write = function (cursor, ch) { + cursor.show().deleteSelection(); + if (ch === '$') + new RootMathCommand(cursor).createLeftOf(cursor); + else { + var html; + if (ch === '<') + html = h.entityText('<'); + else if (ch === '>') + html = h.entityText('>'); + new VanillaSymbol(ch, html).createLeftOf(cursor); + } + }; + return RootTextBlock; + }(RootMathBlock)); + API.TextField = function (APIClasses) { + var _c; + return _c = /** @class */ (function (_super) { + __extends(TextField, _super); + function TextField() { + return _super !== null && _super.apply(this, arguments) || this; + } + TextField.prototype.__mathquillify = function () { + _super.prototype.mathquillify.call(this, 'dcg-mq-editable-field dcg-mq-text-mode'); + return this; + }; + TextField.prototype.latex = function (latex) { + if (latex) { + this.__controller.renderLatexText(latex); + if (this.__controller.blurred) + this.__controller.cursor.hide().parent.blur(); + var _this = this; // just to help help TS out + return _this; + } + return this.__controller.exportLatex(); + }; + return TextField; + }(APIClasses.EditableField)), + _c.RootBlock = RootTextBlock, + _c; + }; + /************************************ + * Symbols for Advanced Mathematics + ***********************************/ + LatexCmds.notin = + LatexCmds.cong = + LatexCmds.equiv = + LatexCmds.oplus = + LatexCmds.otimes = + function (latex) { + return new BinaryOperator('\\' + latex + ' ', h.entityText('&' + latex + ';')); + }; + LatexCmds['\u2217'] = + LatexCmds.ast = + LatexCmds.star = + LatexCmds.loast = + LatexCmds.lowast = + bindBinaryOperator('\\ast ', '∗', 'low asterisk'); + LatexCmds.therefor = LatexCmds.therefore = bindBinaryOperator('\\therefore ', '∴', 'therefore'); + LatexCmds.cuz = LatexCmds.because = bindBinaryOperator( + // l33t + '\\because ', '∵', 'because'); + LatexCmds.prop = LatexCmds.propto = bindBinaryOperator('\\propto ', '∝', 'proportional to'); + LatexCmds['\u2248'] = + LatexCmds.asymp = + LatexCmds.approx = + bindBinaryOperator('\\approx ', '≈', 'approximately equal to'); + LatexCmds.isin = LatexCmds['in'] = bindBinaryOperator('\\in ', '∈', 'is in'); + LatexCmds.ni = LatexCmds.contains = bindBinaryOperator('\\ni ', '∋', 'is not in'); + LatexCmds.notni = + LatexCmds.niton = + LatexCmds.notcontains = + LatexCmds.doesnotcontain = + bindBinaryOperator('\\not\\ni ', '∌', 'does not contain'); + LatexCmds.sub = LatexCmds.subset = bindBinaryOperator('\\subset ', '⊂', 'subset'); + LatexCmds.sup = + LatexCmds.supset = + LatexCmds.superset = + bindBinaryOperator('\\supset ', '⊃', 'superset'); + LatexCmds.nsub = + LatexCmds.notsub = + LatexCmds.nsubset = + LatexCmds.notsubset = + bindBinaryOperator('\\not\\subset ', '⊄', 'not a subset'); + LatexCmds.nsup = + LatexCmds.notsup = + LatexCmds.nsupset = + LatexCmds.notsupset = + LatexCmds.nsuperset = + LatexCmds.notsuperset = + bindBinaryOperator('\\not\\supset ', '⊅', 'not a superset'); + LatexCmds.sube = + LatexCmds.subeq = + LatexCmds.subsete = + LatexCmds.subseteq = + bindBinaryOperator('\\subseteq ', '⊆', 'subset or equal to'); + LatexCmds.supe = + LatexCmds.supeq = + LatexCmds.supsete = + LatexCmds.supseteq = + LatexCmds.supersete = + LatexCmds.superseteq = + bindBinaryOperator('\\supseteq ', '⊇', 'superset or equal to'); + LatexCmds.nsube = + LatexCmds.nsubeq = + LatexCmds.notsube = + LatexCmds.notsubeq = + LatexCmds.nsubsete = + LatexCmds.nsubseteq = + LatexCmds.notsubsete = + LatexCmds.notsubseteq = + bindBinaryOperator('\\not\\subseteq ', '⊈', 'not subset or equal to'); + LatexCmds.nsupe = + LatexCmds.nsupeq = + LatexCmds.notsupe = + LatexCmds.notsupeq = + LatexCmds.nsupsete = + LatexCmds.nsupseteq = + LatexCmds.notsupsete = + LatexCmds.notsupseteq = + LatexCmds.nsupersete = + LatexCmds.nsuperseteq = + LatexCmds.notsupersete = + LatexCmds.notsuperseteq = + bindBinaryOperator('\\not\\supseteq ', '⊉', 'not superset or equal to'); + //the canonical sets of numbers + LatexCmds.mathbb = /** @class */ (function (_super) { + __extends(class_3, _super); + function class_3() { + return _super !== null && _super.apply(this, arguments) || this; + } + class_3.prototype.createLeftOf = function (_cursor) { }; + class_3.prototype.numBlocks = function () { + return 1; + }; + class_3.prototype.parser = function () { + var string = Parser.string; + var regex = Parser.regex; + var optWhitespace = Parser.optWhitespace; + return optWhitespace + .then(string('{')) + .then(optWhitespace) + .then(regex(/^[NPZQRCH]/)) + .skip(optWhitespace) + .skip(string('}')) + .map(function (c) { + // instantiate the class for the matching char + var cmd = LatexCmds[c]; + if (isMQNodeClass(cmd)) { + return new cmd(); + } + else { + return cmd(); + } + }); + }; + return class_3; + }(MathCommand)); + LatexCmds.N = + LatexCmds.naturals = + LatexCmds.Naturals = + bindVanillaSymbol('\\mathbb{N}', 'ℕ', 'naturals'); + LatexCmds.P = + LatexCmds.primes = + LatexCmds.Primes = + LatexCmds.projective = + LatexCmds.Projective = + LatexCmds.probability = + LatexCmds.Probability = + bindVanillaSymbol('\\mathbb{P}', 'ℙ', 'P'); + LatexCmds.Z = + LatexCmds.integers = + LatexCmds.Integers = + bindVanillaSymbol('\\mathbb{Z}', 'ℤ', 'integers'); + LatexCmds.Q = + LatexCmds.rationals = + LatexCmds.Rationals = + bindVanillaSymbol('\\mathbb{Q}', 'ℚ', 'rationals'); + LatexCmds.R = + LatexCmds.reals = + LatexCmds.Reals = + bindVanillaSymbol('\\mathbb{R}', 'ℝ', 'reals'); + LatexCmds.C = + LatexCmds.complex = + LatexCmds.Complex = + LatexCmds.complexes = + LatexCmds.Complexes = + LatexCmds.complexplane = + LatexCmds.Complexplane = + LatexCmds.ComplexPlane = + bindVanillaSymbol('\\mathbb{C}', 'ℂ', 'complexes'); + LatexCmds.H = + LatexCmds.Hamiltonian = + LatexCmds.quaternions = + LatexCmds.Quaternions = + bindVanillaSymbol('\\mathbb{H}', 'ℍ', 'quaternions'); + //spacing + LatexCmds.quad = LatexCmds.emsp = bindVanillaSymbol('\\quad ', ' ', '4 spaces'); + LatexCmds.qquad = bindVanillaSymbol('\\qquad ', ' ', '8 spaces'); + /* spacing special characters, gonna have to implement this in LatexCommandInput::onText somehow + case ',': + return VanillaSymbol('\\, ',' ', 'comma'); + case ':': + return VanillaSymbol('\\: ',' ', 'colon'); + case ';': + return VanillaSymbol('\\; ',' ', 'semicolon'); + case '!': + return MQSymbol('\\! ','', 'exclamation point'); + */ + //binary operators + LatexCmds.diamond = bindVanillaSymbol('\\diamond ', '◇', 'diamond'); + LatexCmds.bigtriangleup = bindVanillaSymbol('\\bigtriangleup ', '△', 'triangle up'); + LatexCmds.ominus = bindVanillaSymbol('\\ominus ', '⊖', 'o minus'); + LatexCmds.uplus = bindVanillaSymbol('\\uplus ', '⊎', 'disjoint union'); + LatexCmds.bigtriangledown = bindVanillaSymbol('\\bigtriangledown ', '▽', 'triangle down'); + LatexCmds.sqcap = bindVanillaSymbol('\\sqcap ', '⊓', 'greatest lower bound'); + LatexCmds.triangleleft = bindVanillaSymbol('\\triangleleft ', '⊲', 'triangle left'); + LatexCmds.sqcup = bindVanillaSymbol('\\sqcup ', '⊔', 'least upper bound'); + LatexCmds.triangleright = bindVanillaSymbol('\\triangleright ', '⊳', 'triangle right'); + //circledot is not a not real LaTex command see https://github.com/mathquill/mathquill/pull/552 for more details + LatexCmds.odot = LatexCmds.circledot = bindVanillaSymbol('\\odot ', '⊙', 'circle dot'); + LatexCmds.bigcirc = bindVanillaSymbol('\\bigcirc ', '◯', 'circle'); + LatexCmds.dagger = bindVanillaSymbol('\\dagger ', '†', 'dagger'); + LatexCmds.ddagger = bindVanillaSymbol('\\ddagger ', '‡', 'big dagger'); + LatexCmds.wr = bindVanillaSymbol('\\wr ', '≀', 'wreath'); + LatexCmds.amalg = bindVanillaSymbol('\\amalg ', '∐', 'amalgam'); + //relationship symbols + LatexCmds.models = bindVanillaSymbol('\\models ', '⊨', 'models'); + LatexCmds.prec = bindVanillaSymbol('\\prec ', '≺', 'precedes'); + LatexCmds.succ = bindVanillaSymbol('\\succ ', '≻', 'succeeds'); + LatexCmds.preceq = bindVanillaSymbol('\\preceq ', '≼', 'precedes or equals'); + LatexCmds.succeq = bindVanillaSymbol('\\succeq ', '≽', 'succeeds or equals'); + LatexCmds.simeq = bindVanillaSymbol('\\simeq ', '≃', 'similar or equal to'); + LatexCmds.mid = bindVanillaSymbol('\\mid ', '∣', 'divides'); + LatexCmds.ll = bindVanillaSymbol('\\ll ', '≪', 'll'); + LatexCmds.gg = bindVanillaSymbol('\\gg ', '≫', 'gg'); + LatexCmds.parallel = bindVanillaSymbol('\\parallel ', '∥', 'parallel with'); + LatexCmds.nparallel = bindVanillaSymbol('\\nparallel ', '∦', 'not parallel with'); + LatexCmds.bowtie = bindVanillaSymbol('\\bowtie ', '⋈', 'bowtie'); + LatexCmds.sqsubset = bindVanillaSymbol('\\sqsubset ', '⊏', 'square subset'); + LatexCmds.sqsupset = bindVanillaSymbol('\\sqsupset ', '⊐', 'square superset'); + LatexCmds.smile = bindVanillaSymbol('\\smile ', '⌣', 'smile'); + LatexCmds.sqsubseteq = bindVanillaSymbol('\\sqsubseteq ', '⊑', 'square subset or equal to'); + LatexCmds.sqsupseteq = bindVanillaSymbol('\\sqsupseteq ', '⊒', 'square superset or equal to'); + LatexCmds.doteq = bindVanillaSymbol('\\doteq ', '≐', 'dotted equals'); + LatexCmds.frown = bindVanillaSymbol('\\frown ', '⌢', 'frown'); + LatexCmds.vdash = bindVanillaSymbol('\\vdash ', '⊦', 'v dash'); + LatexCmds.dashv = bindVanillaSymbol('\\dashv ', '⊣', 'dash v'); + LatexCmds.nless = bindVanillaSymbol('\\nless ', '≮', 'not less than'); + LatexCmds.ngtr = bindVanillaSymbol('\\ngtr ', '≯', 'not greater than'); + //arrows + LatexCmds.longleftarrow = bindVanillaSymbol('\\longleftarrow ', '←', 'left arrow'); + LatexCmds.longrightarrow = bindVanillaSymbol('\\longrightarrow ', '→', 'right arrow'); + LatexCmds.Longleftarrow = bindVanillaSymbol('\\Longleftarrow ', '⇐', 'left arrow'); + LatexCmds.Longrightarrow = bindVanillaSymbol('\\Longrightarrow ', '⇒', 'right arrow'); + LatexCmds.longleftrightarrow = bindVanillaSymbol('\\longleftrightarrow ', '↔', 'left and right arrow'); + LatexCmds.updownarrow = bindVanillaSymbol('\\updownarrow ', '↕', 'up and down arrow'); + LatexCmds.Longleftrightarrow = bindVanillaSymbol('\\Longleftrightarrow ', '⇔', 'left and right arrow'); + LatexCmds.Updownarrow = bindVanillaSymbol('\\Updownarrow ', '⇕', 'up and down arrow'); + LatexCmds.mapsto = bindVanillaSymbol('\\mapsto ', '↦', 'maps to'); + LatexCmds.nearrow = bindVanillaSymbol('\\nearrow ', '↗', 'northeast arrow'); + LatexCmds.hookleftarrow = bindVanillaSymbol('\\hookleftarrow ', '↩', 'hook left arrow'); + LatexCmds.hookrightarrow = bindVanillaSymbol('\\hookrightarrow ', '↪', 'hook right arrow'); + LatexCmds.searrow = bindVanillaSymbol('\\searrow ', '↘', 'southeast arrow'); + LatexCmds.leftharpoonup = bindVanillaSymbol('\\leftharpoonup ', '↼', 'left harpoon up'); + LatexCmds.rightharpoonup = bindVanillaSymbol('\\rightharpoonup ', '⇀', 'right harpoon up'); + LatexCmds.swarrow = bindVanillaSymbol('\\swarrow ', '↙', 'southwest arrow'); + LatexCmds.leftharpoondown = bindVanillaSymbol('\\leftharpoondown ', '↽', 'left harpoon down'); + LatexCmds.rightharpoondown = bindVanillaSymbol('\\rightharpoondown ', '⇁', 'right harpoon down'); + LatexCmds.nwarrow = bindVanillaSymbol('\\nwarrow ', '↖', 'northwest arrow'); + //Misc + LatexCmds.ldots = bindVanillaSymbol('\\ldots ', '…', 'l dots'); + LatexCmds.cdots = bindVanillaSymbol('\\cdots ', '⋯', 'c dots'); + LatexCmds.vdots = bindVanillaSymbol('\\vdots ', '⋮', 'v dots'); + LatexCmds.ddots = bindVanillaSymbol('\\ddots ', '⋱', 'd dots'); + LatexCmds.surd = bindVanillaSymbol('\\surd ', '√', 'unresolved root'); + LatexCmds.triangle = bindVanillaSymbol('\\triangle ', '△', 'triangle'); + LatexCmds.ell = bindVanillaSymbol('\\ell ', 'ℓ', 'ell'); + LatexCmds.top = bindVanillaSymbol('\\top ', '⊤', 'top'); + LatexCmds.flat = bindVanillaSymbol('\\flat ', '♭', 'flat'); + LatexCmds.natural = bindVanillaSymbol('\\natural ', '♮', 'natural'); + LatexCmds.sharp = bindVanillaSymbol('\\sharp ', '♯', 'sharp'); + LatexCmds.wp = bindVanillaSymbol('\\wp ', '℘', 'wp'); + LatexCmds.bot = bindVanillaSymbol('\\bot ', '⊥', 'bot'); + LatexCmds.clubsuit = bindVanillaSymbol('\\clubsuit ', '♣', 'club suit'); + LatexCmds.diamondsuit = bindVanillaSymbol('\\diamondsuit ', '♢', 'diamond suit'); + LatexCmds.heartsuit = bindVanillaSymbol('\\heartsuit ', '♡', 'heart suit'); + LatexCmds.spadesuit = bindVanillaSymbol('\\spadesuit ', '♠', 'spade suit'); + //not real LaTex command see https://github.com/mathquill/mathquill/pull/552 for more details + LatexCmds.parallelogram = bindVanillaSymbol('\\parallelogram ', '▱', 'parallelogram'); + LatexCmds.square = bindVanillaSymbol('\\square ', '⬜', 'square'); + //variable-sized + LatexCmds.oint = bindVanillaSymbol('\\oint ', '∮', 'o int'); + LatexCmds.bigcap = bindVanillaSymbol('\\bigcap ', '∩', 'big cap'); + LatexCmds.bigcup = bindVanillaSymbol('\\bigcup ', '∪', 'big cup'); + LatexCmds.bigsqcup = bindVanillaSymbol('\\bigsqcup ', '⊔', 'big square cup'); + LatexCmds.bigvee = bindVanillaSymbol('\\bigvee ', '∨', 'big vee'); + LatexCmds.bigwedge = bindVanillaSymbol('\\bigwedge ', '∧', 'big wedge'); + LatexCmds.bigodot = bindVanillaSymbol('\\bigodot ', '⊙', 'big o dot'); + LatexCmds.bigotimes = bindVanillaSymbol('\\bigotimes ', '⊗', 'big o times'); + LatexCmds.bigoplus = bindVanillaSymbol('\\bigoplus ', '⊕', 'big o plus'); + LatexCmds.biguplus = bindVanillaSymbol('\\biguplus ', '⊎', 'big u plus'); + //delimiters + LatexCmds.lfloor = bindVanillaSymbol('\\lfloor ', '⌊', 'left floor'); + LatexCmds.rfloor = bindVanillaSymbol('\\rfloor ', '⌋', 'right floor'); + LatexCmds.lceil = bindVanillaSymbol('\\lceil ', '⌈', 'left ceiling'); + LatexCmds.rceil = bindVanillaSymbol('\\rceil ', '⌉', 'right ceiling'); + LatexCmds.opencurlybrace = LatexCmds.lbrace = bindVanillaSymbol('\\lbrace ', '{', 'left brace'); + LatexCmds.closecurlybrace = LatexCmds.rbrace = bindVanillaSymbol('\\rbrace ', '}', 'right brace'); + LatexCmds.lbrack = bindVanillaSymbol('[', 'left bracket'); + LatexCmds.rbrack = bindVanillaSymbol(']', 'right bracket'); + //various symbols + LatexCmds.slash = bindVanillaSymbol('/', 'slash'); + LatexCmds.vert = bindVanillaSymbol('|', 'vertical bar'); + LatexCmds.perp = LatexCmds.perpendicular = bindVanillaSymbol('\\perp ', '⊥', 'perpendicular'); + LatexCmds.nabla = LatexCmds.del = bindVanillaSymbol('\\nabla ', '∇'); + LatexCmds.hbar = bindVanillaSymbol('\\hbar ', 'ℏ', 'horizontal bar'); + LatexCmds.AA = + LatexCmds.Angstrom = + LatexCmds.angstrom = + bindVanillaSymbol('\\text\\AA ', 'Å', 'AA'); + LatexCmds.ring = + LatexCmds.circ = + LatexCmds.circle = + bindVanillaSymbol('\\circ ', '∘', 'circle'); + LatexCmds.bull = LatexCmds.bullet = bindVanillaSymbol('\\bullet ', '•', 'bullet'); + LatexCmds.setminus = LatexCmds.smallsetminus = bindVanillaSymbol('\\setminus ', '∖', 'set minus'); + LatexCmds.not = //bind(MQSymbol,'\\not ','/', 'not'); + LatexCmds['\u00ac'] = + LatexCmds.neg = + bindVanillaSymbol('\\neg ', '¬', 'not'); + LatexCmds['\u2026'] = + LatexCmds.dots = + LatexCmds.ellip = + LatexCmds.hellip = + LatexCmds.ellipsis = + LatexCmds.hellipsis = + bindVanillaSymbol('\\dots ', '…', 'ellipsis'); + LatexCmds.converges = + LatexCmds.darr = + LatexCmds.dnarr = + LatexCmds.dnarrow = + LatexCmds.downarrow = + bindVanillaSymbol('\\downarrow ', '↓', 'converges with'); + LatexCmds.dArr = + LatexCmds.dnArr = + LatexCmds.dnArrow = + LatexCmds.Downarrow = + bindVanillaSymbol('\\Downarrow ', '⇓', 'down arrow'); + LatexCmds.diverges = + LatexCmds.uarr = + LatexCmds.uparrow = + bindVanillaSymbol('\\uparrow ', '↑', 'diverges from'); + LatexCmds.uArr = LatexCmds.Uparrow = bindVanillaSymbol('\\Uparrow ', '⇑', 'up arrow'); + LatexCmds.rarr = LatexCmds.rightarrow = bindVanillaSymbol('\\rightarrow ', '→', 'right arrow'); + LatexCmds.implies = bindBinaryOperator('\\Rightarrow ', '⇒', 'implies'); + LatexCmds.rArr = LatexCmds.Rightarrow = bindVanillaSymbol('\\Rightarrow ', '⇒', 'right arrow'); + LatexCmds.gets = bindBinaryOperator('\\gets ', '←', 'gets'); + LatexCmds.larr = LatexCmds.leftarrow = bindVanillaSymbol('\\leftarrow ', '←', 'left arrow'); + LatexCmds.impliedby = bindBinaryOperator('\\Leftarrow ', '⇐', 'implied by'); + LatexCmds.lArr = LatexCmds.Leftarrow = bindVanillaSymbol('\\Leftarrow ', '⇐', 'left arrow'); + LatexCmds.harr = + LatexCmds.lrarr = + LatexCmds.leftrightarrow = + bindVanillaSymbol('\\leftrightarrow ', '↔', 'left and right arrow'); + LatexCmds.iff = bindBinaryOperator('\\Leftrightarrow ', '⇔', 'if and only if'); + LatexCmds.hArr = + LatexCmds.lrArr = + LatexCmds.Leftrightarrow = + bindVanillaSymbol('\\Leftrightarrow ', '⇔', 'left and right arrow'); + LatexCmds.Re = + LatexCmds.Real = + LatexCmds.real = + bindVanillaSymbol('\\Re ', 'ℜ', 'real'); + LatexCmds.Im = + LatexCmds.imag = + LatexCmds.image = + LatexCmds.imagin = + LatexCmds.imaginary = + LatexCmds.Imaginary = + bindVanillaSymbol('\\Im ', 'ℑ', 'imaginary'); + LatexCmds.part = LatexCmds.partial = bindVanillaSymbol('\\partial ', '∂', 'partial'); + LatexCmds.pounds = bindVanillaSymbol('\\pounds ', '£'); + LatexCmds.alef = + LatexCmds.alefsym = + LatexCmds.aleph = + LatexCmds.alephsym = + bindVanillaSymbol('\\aleph ', 'ℵ', 'alef sym'); + LatexCmds.xist = //LOL + LatexCmds.xists = + LatexCmds.exist = + LatexCmds.exists = + bindVanillaSymbol('\\exists ', '∃', 'there exists at least 1'); + LatexCmds.nexists = LatexCmds.nexist = bindVanillaSymbol('\\nexists ', '∄', 'there is no'); + LatexCmds.and = + LatexCmds.land = + LatexCmds.wedge = + bindBinaryOperator('\\wedge ', '∧', 'and'); + LatexCmds.or = + LatexCmds.lor = + LatexCmds.vee = + bindBinaryOperator('\\vee ', '∨', 'or'); + LatexCmds.o = + LatexCmds.O = + LatexCmds.empty = + LatexCmds.emptyset = + LatexCmds.oslash = + LatexCmds.Oslash = + LatexCmds.nothing = + LatexCmds.varnothing = + bindBinaryOperator('\\varnothing ', '∅', 'nothing'); + LatexCmds.cup = LatexCmds.union = bindBinaryOperator('\\cup ', '∪', 'union'); + LatexCmds.cap = + LatexCmds.intersect = + LatexCmds.intersection = + bindBinaryOperator('\\cap ', '∩', 'intersection'); + // FIXME: the correct LaTeX would be ^\circ but we can't parse that + LatexCmds.deg = LatexCmds.degree = bindVanillaSymbol('\\degree ', '°', 'degrees'); + LatexCmds.ang = LatexCmds.angle = bindVanillaSymbol('\\angle ', '∠', 'angle'); + LatexCmds.measuredangle = bindVanillaSymbol('\\measuredangle ', '∡', 'measured angle'); + /********************************* + * Symbols for Basic Mathematics + ********************************/ + var DigitGroupingChar = /** @class */ (function (_super) { + __extends(DigitGroupingChar, _super); + function DigitGroupingChar() { + return _super !== null && _super.apply(this, arguments) || this; + } + DigitGroupingChar.prototype.finalizeTree = function (opts, dir) { + this.sharedSiblingMethod(opts, dir); + }; + DigitGroupingChar.prototype.siblingDeleted = function (opts, dir) { + this.sharedSiblingMethod(opts, dir); + }; + DigitGroupingChar.prototype.siblingCreated = function (opts, dir) { + this.sharedSiblingMethod(opts, dir); + }; + DigitGroupingChar.prototype.sharedSiblingMethod = function (opts, dir) { + // don't try to fix digit grouping if the sibling to my right changed (dir === R or + // undefined) and it's now a DigitGroupingChar, it will try to fix grouping + if (dir !== L && this[R] instanceof DigitGroupingChar) + return; + this.fixDigitGrouping(opts); + }; + DigitGroupingChar.prototype.fixDigitGrouping = function (opts) { + if (!opts.enableDigitGrouping) + return; + var left = this; + var right = this; + var spacesFound = 0; + var dots = []; + var SPACE = '\\ '; + var DOT = '.'; + // traverse left as far as possible (starting at this char) + var node = left; + do { + if (/^[0-9]$/.test(node.ctrlSeq)) { + left = node; + } + else if (node.ctrlSeq === SPACE) { + left = node; + spacesFound += 1; + } + else if (node.ctrlSeq === DOT) { + left = node; + dots.push(node); + } + else { + break; + } + } while ((node = left[L])); + // traverse right as far as possible (starting to right of this char) + while ((node = right[R])) { + if (/^[0-9]$/.test(node.ctrlSeq)) { + right = node; + } + else if (node.ctrlSeq === SPACE) { + right = node; + spacesFound += 1; + } + else if (node.ctrlSeq === DOT) { + right = node; + dots.push(node); + } + else { + break; + } + } + // trim the leading spaces + while (right !== left && left && left.ctrlSeq === SPACE) { + left = left[R]; + spacesFound -= 1; + } + // trim the trailing spaces + while (right !== left && right && right.ctrlSeq === SPACE) { + right = right[L]; + spacesFound -= 1; + } + // happens when you only have a space + if (left === right && left && left.ctrlSeq === SPACE) + return; + var disableFormatting = spacesFound > 0 || dots.length > 1; + if (disableFormatting) { + this.removeGroupingBetween(left, right); + } + else if (dots[0]) { + if (dots[0] !== left) { + this.addGroupingBetween(dots[0][L], left); + } + if (dots[0] !== right) { + // we do not show grouping to the right of a decimal place #yet + this.removeGroupingBetween(dots[0][R], right); + } + } + else { + this.addGroupingBetween(right, left); + } + }; + DigitGroupingChar.prototype.removeGroupingBetween = function (left, right) { + var node = left; + do { + if (node instanceof DigitGroupingChar) { + node.setGroupingClass(undefined); + } + if (!node || node === right) + break; + } while ((node = node[R])); + }; + DigitGroupingChar.prototype.addGroupingBetween = function (start, end) { + var node = start; + var count = 0; + var totalDigits = 0; + var node = start; + while (node) { + totalDigits += 1; + if (node === end) + break; + node = node[L]; + } + var numDigitsInFirstGroup = totalDigits % 3; + if (numDigitsInFirstGroup === 0) + numDigitsInFirstGroup = 3; + var node = start; + while (node) { + count += 1; + var cls = undefined; + // only do grouping if we have at least 4 numbers + if (totalDigits >= 4) { + if (count === totalDigits) { + cls = 'dcg-mq-group-leading-' + numDigitsInFirstGroup; + } + else if (count % 3 === 0) { + if (count !== totalDigits) { + cls = 'dcg-mq-group-start'; + } + } + if (!cls) { + cls = 'dcg-mq-group-other'; + } + } + if (node instanceof DigitGroupingChar) { + node.setGroupingClass(cls); + } + if (node === end) + break; + node = node[L]; + } + }; + DigitGroupingChar.prototype.setGroupingClass = function (cls) { + // nothing changed (either class is the same or it's still undefined) + if (this._groupingClass === cls) + return; + // remove existing class + if (this._groupingClass) + this.domFrag().removeClass(this._groupingClass); + // add new class + if (cls) + this.domFrag().addClass(cls); + // cache the groupingClass + this._groupingClass = cls; + }; + return DigitGroupingChar; + }(MQSymbol)); + var Digit = /** @class */ (function (_super) { + __extends(Digit, _super); + function Digit(ch, mathspeak) { + return _super.call(this, ch, h('span', { class: 'dcg-mq-digit' }, [h.text(ch)]), undefined, mathspeak) || this; + } + Digit.prototype.createLeftOf = function (cursor) { + var cursorL = cursor[L]; + var cursorLL = cursorL && cursorL[L]; + var cursorParentParentSub = cursor.parent.parent instanceof SupSub + ? cursor.parent.parent.sub + : undefined; + if (cursor.options.autoSubscriptNumerals && + cursor.parent !== cursorParentParentSub && + ((cursorL instanceof Variable && cursorL.isItalic !== false) || + (cursorL instanceof SupSub && + cursorLL instanceof Variable && + cursorLL.isItalic !== false))) { + new SubscriptCommand().createLeftOf(cursor); + _super.prototype.createLeftOf.call(this, cursor); + cursor.insRightOf(cursor.parent.parent); + } + else + _super.prototype.createLeftOf.call(this, cursor); + }; + Digit.prototype.mathspeak = function (opts) { + if (opts && opts.createdLeftOf) { + var cursor = opts.createdLeftOf; + var cursorL = cursor[L]; + var cursorLL = cursorL && cursorL[L]; + var cursorParentParentSub = cursor.parent.parent instanceof SupSub + ? cursor.parent.parent.sub + : undefined; + if (cursor.options.autoSubscriptNumerals && + cursor.parent !== cursorParentParentSub && + ((cursorL instanceof Variable && cursorL.isItalic !== false) || + (cursor[L] instanceof SupSub && + cursorLL instanceof Variable && + cursorLL.isItalic !== false))) { + return 'Subscript ' + _super.prototype.mathspeak.call(this) + ' Baseline'; + } + } + return _super.prototype.mathspeak.call(this); + }; + return Digit; + }(DigitGroupingChar)); + var Variable = /** @class */ (function (_super) { + __extends(Variable, _super); + function Variable(chOrCtrlSeq, html) { + return _super.call(this, chOrCtrlSeq, h('var', {}, [html || h.text(chOrCtrlSeq)])) || this; + } + Variable.prototype.text = function () { + var text = this.ctrlSeq || ''; + if (this.isPartOfOperator) { + if (text[0] == '\\') { + text = text.slice(1, text.length); + } + else if (text[text.length - 1] == ' ') { + text = text.slice(0, -1); + } + } + else { + if (this[L] && + !(this[L] instanceof Variable) && + !(this[L] instanceof BinaryOperator) && + this[L].ctrlSeq !== '\\ ') + text = '*' + text; + if (this[R] && + !(this[R] instanceof BinaryOperator) && + !(this[R] instanceof SupSub)) + text += '*'; + } + return text; + }; + Variable.prototype.mathspeak = function () { + var text = this.ctrlSeq || ''; + if (this.isPartOfOperator || + text.length > 1 || + (this.parent && this.parent.parent && this.parent.parent.isTextBlock())) { + return _super.prototype.mathspeak.call(this); + } + else { + // Apple voices in VoiceOver (such as Alex, Bruce, and Victoria) do + // some strange pronunciation given certain expressions, + // e.g. "y-2" is spoken as "ee minus 2" (as if the y is short). + // Not an ideal solution, but surrounding non-numeric text blocks with quotation marks works. + // This bug has been acknowledged by Apple. + return '"' + text + '"'; + } + }; + return Variable; + }(MQSymbol)); + function bindVariable(ch, htmlEntity, _unusedMathspeak) { + return function () { return new Variable(ch, h.entityText(htmlEntity)); }; + } + Options.prototype.autoCommands = { + _maxLength: 0, + }; + baseOptionProcessors.autoCommands = function (cmds) { + if (typeof cmds !== 'string' || !/^[a-z]+(?: [a-z]+)*$/i.test(cmds)) { + throw '"' + cmds + '" not a space-delimited list of only letters'; + } + var list = cmds.split(' '); + var dict = {}; + var maxLength = 0; + for (var i = 0; i < list.length; i += 1) { + var cmd = list[i]; + if (cmd.length < 2) { + throw 'autocommand "' + cmd + '" not minimum length of 2'; + } + if (LatexCmds[cmd] === OperatorName) { + throw '"' + cmd + '" is a built-in operator name'; + } + dict[cmd] = 1; + maxLength = max(maxLength, cmd.length); + } + dict._maxLength = maxLength; + return dict; + }; + Options.prototype.quietEmptyDelimiters = {}; + baseOptionProcessors.quietEmptyDelimiters = function (dlms) { + if (dlms === void 0) { dlms = ''; } + var list = dlms.split(' '); + var dict = {}; + for (var i = 0; i < list.length; i += 1) { + var dlm = list[i]; + dict[dlm] = 1; + } + return dict; + }; + Options.prototype.autoParenthesizedFunctions = { _maxLength: 0 }; + baseOptionProcessors.autoParenthesizedFunctions = function (cmds) { + if (typeof cmds !== 'string' || !/^[a-z]+(?: [a-z]+)*$/i.test(cmds)) { + throw '"' + cmds + '" not a space-delimited list of only letters'; + } + var list = cmds.split(' '); + var dict = {}; + var maxLength = 0; + for (var i = 0; i < list.length; i += 1) { + var cmd = list[i]; + if (cmd.length < 2) { + throw 'autocommand "' + cmd + '" not minimum length of 2'; + } + dict[cmd] = 1; + maxLength = max(maxLength, cmd.length); + } + dict._maxLength = maxLength; + return dict; + }; + var Letter = /** @class */ (function (_super) { + __extends(Letter, _super); + function Letter(ch) { + var _this_1 = _super.call(this, ch) || this; + _this_1.letter = ch; + return _this_1; + } + Letter.prototype.checkAutoCmds = function (cursor) { + //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. + if (this.shouldIgnoreSubstitutionInSimpleSubscript(cursor.options)) { + return; + } + //handle autoCommands + var autoCmds = cursor.options.autoCommands; + var maxLength = autoCmds._maxLength || 0; + if (maxLength > 0) { + // want longest possible autocommand, so join together longest + // sequence of letters + var str = ''; + var l = this; + var i = 0; + // FIXME: l.ctrlSeq === l.letter checks if first or last in an operator name + while (l instanceof Letter && l.ctrlSeq === l.letter && i < maxLength) { + str = l.letter + str; + l = l[L]; + i += 1; + } + // check for an autocommand, going thru substrings longest to shortest + while (str.length) { + if (autoCmds.hasOwnProperty(str)) { + l = this; + for (i = 1; l && i < str.length; i += 1, l = l[L]) + ; + new Fragment(l, this).remove(); + cursor[L] = l[L]; + var cmd = LatexCmds[str]; + var node; + if (isMQNodeClass(cmd)) { + node = new cmd(str); // TODO - How do we know that this class expects a single str input? + } + else { + node = cmd(str); + } + return node.createLeftOf(cursor); + } + str = str.slice(1); + } + } + }; + Letter.prototype.autoParenthesize = function (cursor) { + //exit early if already parenthesized + var right = cursor.parent.getEnd(R); + if (right && right instanceof Bracket && right.ctrlSeq === '\\left(') { + return; + } + //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. + if (this.shouldIgnoreSubstitutionInSimpleSubscript(cursor.options)) { + return; + } + //handle autoParenthesized functions + var str = ''; + var l = this; + var i = 0; + var autoParenthesizedFunctions = cursor.options.autoParenthesizedFunctions; + var maxLength = autoParenthesizedFunctions._maxLength || 0; + var autoOperatorNames = cursor.options.autoOperatorNames; + while (l instanceof Letter && i < maxLength) { + (str = l.letter + str), (l = l[L]), (i += 1); + } + // check for an autoParenthesized functions, going thru substrings longest to shortest + // only allow autoParenthesized functions that are also autoOperatorNames + while (str.length) { + if (autoParenthesizedFunctions.hasOwnProperty(str) && + autoOperatorNames.hasOwnProperty(str)) { + return cursor.parent.write(cursor, '('); + } + str = str.slice(1); + } + }; + Letter.prototype.createLeftOf = function (cursor) { + _super.prototype.createLeftOf.call(this, cursor); + this.checkAutoCmds(cursor); + this.autoParenthesize(cursor); + }; + Letter.prototype.italicize = function (bool) { + this.isItalic = bool; + this.isPartOfOperator = !bool; + this.domFrag().toggleClass('dcg-mq-operator-name', !bool); + return this; + }; + Letter.prototype.finalizeTree = function (opts, dir) { + this.sharedSiblingMethod(opts, dir); + }; + Letter.prototype.siblingDeleted = function (opts, dir) { + this.sharedSiblingMethod(opts, dir); + }; + Letter.prototype.siblingCreated = function (opts, dir) { + this.sharedSiblingMethod(opts, dir); + }; + Letter.prototype.sharedSiblingMethod = function (opts, dir) { + // don't auto-un-italicize if the sibling to my right changed (dir === R or + // undefined) and it's now a Letter, it will un-italicize everyone + if (dir !== L && this[R] instanceof Letter) + return; + this.autoUnItalicize(opts); + }; + Letter.prototype.autoUnItalicize = function (opts) { + var autoOps = opts.autoOperatorNames; + if (autoOps._maxLength === 0) + return; + //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. + if (this.shouldIgnoreSubstitutionInSimpleSubscript(opts)) { + return; + } + // want longest possible operator names, so join together entire contiguous + // sequence of letters + var str = this.letter; + for (var l = this[L]; l instanceof Letter; l = l[L]) + str = l.letter + str; + for (var r = this[R]; r instanceof Letter; r = r[R]) + str += r.letter; + // removeClass and delete flags from all letters before figuring out + // which, if any, are part of an operator name + var lR = l && l[R]; + var rL = r && r[L]; + new Fragment(lR || this.parent.getEnd(L), rL || this.parent.getEnd(R)).each(function (el) { + if (el instanceof Letter) { + el.italicize(true) + .domFrag() + .removeClass('dcg-mq-first dcg-mq-last dcg-mq-followed-by-supsub'); + el.ctrlSeq = el.letter; + } + return undefined; + }); + var autoOpsLength = autoOps._maxLength || 0; + // check for operator names: at each position from left to right, check + // substrings from longest to shortest + outer: for (var i = 0, first = l[R] || this.parent.getEnd(L); first && i < str.length; i += 1, first = first[R]) { + for (var len = min(autoOpsLength, str.length - i); len > 0; len -= 1) { + var word = str.slice(i, i + len); + var last = undefined; // TODO - TS complaining that we use last before assigning to it + if (autoOps.hasOwnProperty(word)) { + for (var j = 0, letter = first; j < len; j += 1, letter = letter[R]) { + if (letter instanceof Letter) { + letter.italicize(false); + last = letter; + } + } + var isBuiltIn = BuiltInOpNames.hasOwnProperty(word); + first.ctrlSeq = + (isBuiltIn ? '\\' : '\\operatorname{') + first.ctrlSeq; + last.ctrlSeq += isBuiltIn ? ' ' : '}'; + if (TwoWordOpNames.hasOwnProperty(word)) { + var lastL = last[L]; + var lastLL = lastL && lastL[L]; + var lastLLL = (lastLL && lastLL[L]); + lastLLL.domFrag().addClass('dcg-mq-last'); + } + if (!this.shouldOmitPadding(first[L])) + first.domFrag().addClass('dcg-mq-first'); + if (!this.shouldOmitPadding(last[R])) { + if (last[R] instanceof SupSub) { + var supsub = last[R]; // XXX monkey-patching, but what's the right thing here? + // Have operatorname-specific code in SupSub? A CSS-like language to style the + // math tree, but which ignores cursor and selection (which CSS can't)? + var respace = (supsub.siblingCreated = + supsub.siblingDeleted = + function () { + supsub + .domFrag() + .toggleClass('dcg-mq-after-operator-name', !(supsub[R] instanceof Bracket)); + }); + respace(); + } + else { + last + .domFrag() + .toggleClass('dcg-mq-last', !(last[R] instanceof Bracket)); + } + } + i += len - 1; + first = last; + continue outer; + } + } + } + }; + Letter.prototype.shouldOmitPadding = function (node) { + // omit padding if no node + if (!node) + return true; + // do not add padding between letter and '.' + if (node.ctrlSeq === '.') + return true; + // do not add padding between letter and binary operator. The + // binary operator already has padding + if (node instanceof BinaryOperator) + return true; + if (node instanceof SummationNotation) + return true; + return false; + }; + return Letter; + }(Variable)); + var BuiltInOpNames = {}; // the set of operator names like \sin, \cos, etc that + // are built-into LaTeX, see Section 3.17 of the Short Math Guide: http://tinyurl.com/jm9okjc + // MathQuill auto-unitalicizes some operator names not in that set, like 'hcf' + // and 'arsinh', which must be exported as \operatorname{hcf} and + // \operatorname{arsinh}. Note: over/under line/arrow \lim variants like + // \varlimsup are not supported + // the set of operator names that MathQuill auto-unitalicizes by default; overridable + Options.prototype.autoOperatorNames = defaultAutoOpNames(); + var TwoWordOpNames = { limsup: 1, liminf: 1, projlim: 1, injlim: 1 }; + function defaultAutoOpNames() { + var AutoOpNames = { + _maxLength: 9, + }; + var mostOps = ('arg deg det dim exp gcd hom inf ker lg lim ln log max min sup' + + ' limsup liminf injlim projlim Pr').split(' '); + for (var i = 0; i < mostOps.length; i += 1) { + BuiltInOpNames[mostOps[i]] = AutoOpNames[mostOps[i]] = 1; + } + var builtInTrigs = 'sin cos tan arcsin arccos arctan sinh cosh tanh sec csc cot coth'.split( + // why coth but not sech and csch, LaTeX? + ' '); + for (var i = 0; i < builtInTrigs.length; i += 1) { + BuiltInOpNames[builtInTrigs[i]] = 1; + } + var autoTrigs = 'sin cos tan sec cosec csc cotan cot ctg'.split(' '); + for (var i = 0; i < autoTrigs.length; i += 1) { + AutoOpNames[autoTrigs[i]] = + AutoOpNames['arc' + autoTrigs[i]] = + AutoOpNames[autoTrigs[i] + 'h'] = + AutoOpNames['ar' + autoTrigs[i] + 'h'] = + AutoOpNames['arc' + autoTrigs[i] + 'h'] = + 1; + } + // compat with some of the nonstandard LaTeX exported by MathQuill + // before #247. None of these are real LaTeX commands so, seems safe + var moreNonstandardOps = 'gcf hcf lcm proj span'.split(' '); + for (var i = 0; i < moreNonstandardOps.length; i += 1) { + AutoOpNames[moreNonstandardOps[i]] = 1; + } + return AutoOpNames; + } + baseOptionProcessors.autoOperatorNames = function (cmds) { + if (typeof cmds !== 'string') { + throw '"' + cmds + '" not a space-delimited list'; + } + if (!/^[a-z\|\-]+(?: [a-z\|\-]+)*$/i.test(cmds)) { + throw '"' + cmds + '" not a space-delimited list of letters or "|"'; + } + var list = cmds.split(' '); + var dict = {}; + var maxLength = 0; + for (var i = 0; i < list.length; i += 1) { + var cmd = list[i]; + if (cmd.length < 2) { + throw '"' + cmd + '" not minimum length of 2'; + } + if (cmd.indexOf('|') < 0) { + // normal auto operator + dict[cmd] = cmd; + maxLength = max(maxLength, cmd.length); + } + else { + // this item has a speech-friendly alternative + var cmdArray = cmd.split('|'); + if (cmdArray.length > 2) { + throw '"' + cmd + '" has more than 1 mathspeak delimiter'; + } + if (cmdArray[0].length < 2) { + throw '"' + cmd[0] + '" not minimum length of 2'; + } + dict[cmdArray[0]] = cmdArray[1].replace(/-/g, ' '); // convert dashes to spaces for the sake of speech + maxLength = max(maxLength, cmdArray[0].length); + } + } + dict._maxLength = maxLength; + return dict; + }; + var OperatorName = /** @class */ (function (_super) { + __extends(OperatorName, _super); + function OperatorName(fn) { + return _super.call(this, fn || '') || this; + } + OperatorName.prototype.createLeftOf = function (cursor) { + var fn = this.ctrlSeq; + for (var i = 0; i < fn.length; i += 1) { + new Letter(fn.charAt(i)).createLeftOf(cursor); + } + }; + OperatorName.prototype.parser = function () { + var fn = this.ctrlSeq; + var block = new MathBlock(); + for (var i = 0; i < fn.length; i += 1) { + new Letter(fn.charAt(i)).adopt(block, block.getEnd(R), 0); + } + return Parser.succeed(block.children()); + }; + return OperatorName; + }(MQSymbol)); + for (var fn in Options.prototype.autoOperatorNames) + if (Options.prototype.autoOperatorNames.hasOwnProperty(fn)) { + LatexCmds[fn] = OperatorName; + } + LatexCmds.operatorname = /** @class */ (function (_super) { + __extends(class_4, _super); + function class_4() { + return _super !== null && _super.apply(this, arguments) || this; + } + class_4.prototype.createLeftOf = function () { }; + class_4.prototype.numBlocks = function () { + return 1; + }; + class_4.prototype.parser = function () { + return latexMathParser.block.map(function (b) { + // Check for the special case of \operatorname{ans}, which has + // a special html representation + var isAllLetters = true; + var str = ''; + var children = b.children(); + children.each(function (child) { + if (child instanceof Letter) { + str += child.letter; + } + else { + isAllLetters = false; + } + return undefined; + }); + if (isAllLetters && str === 'ans') { + return AnsBuilder(); + } + // In cases other than `ans`, just return the children directly + return children; + }); + }; + return class_4; + }(MathCommand)); + LatexCmds.f = /** @class */ (function (_super) { + __extends(class_5, _super); + function class_5() { + var _this_1 = this; + var letter = 'f'; + _this_1 = _super.call(this, letter) || this; + _this_1.letter = letter; + _this_1.domView = new DOMView(0, function () { + return h('var', { class: 'dcg-mq-f' }, [h.text('f')]); + }); + return _this_1; + } + class_5.prototype.italicize = function (bool) { + // Why is this necesssary? Does someone replace the `f` at some + // point? + this.domFrag().eachElement(function (el) { return (el.textContent = 'f'); }); + this.domFrag().toggleClass('dcg-mq-f', bool); + return _super.prototype.italicize.call(this, bool); + }; + return class_5; + }(Letter)); + // VanillaSymbol's + LatexCmds[' '] = LatexCmds.space = function () { + return new DigitGroupingChar('\\ ', h('span', {}, [h.text(U_NO_BREAK_SPACE)]), ' '); + }; + LatexCmds['.'] = function () { + return new DigitGroupingChar('.', h('span', { class: 'dcg-mq-digit' }, [h.text('.')]), '.'); + }; + LatexCmds["'"] = LatexCmds.prime = bindVanillaSymbol("'", '′', 'prime'); + LatexCmds['\u2033'] = LatexCmds.dprime = bindVanillaSymbol('\u2033', '″', 'double prime'); + LatexCmds.backslash = bindVanillaSymbol('\\backslash ', '\\', 'backslash'); + if (!CharCmds['\\']) + CharCmds['\\'] = LatexCmds.backslash; + LatexCmds.$ = bindVanillaSymbol('\\$', '$', 'dollar'); + LatexCmds.square = bindVanillaSymbol('\\square ', '\u25A1', 'square'); + LatexCmds.mid = bindVanillaSymbol('\\mid ', '\u2223', 'mid'); + // does not use Symbola font + var NonSymbolaSymbol = /** @class */ (function (_super) { + __extends(NonSymbolaSymbol, _super); + function NonSymbolaSymbol(ch, html, _unusedMathspeak) { + return _super.call(this, ch, h('span', { class: 'dcg-mq-nonSymbola' }, [html || h.text(ch)])) || this; + } + return NonSymbolaSymbol; + }(MQSymbol)); + LatexCmds['@'] = function () { return new NonSymbolaSymbol('@'); }; + LatexCmds['&'] = function () { + return new NonSymbolaSymbol('\\&', h.entityText('&'), 'and'); + }; + LatexCmds['%'] = /** @class */ (function (_super) { + __extends(class_6, _super); + function class_6() { + return _super.call(this, '\\%', h.text('%'), 'percent') || this; + } + class_6.prototype.parser = function () { + var optWhitespace = Parser.optWhitespace; + var string = Parser.string; + // Parse `\%\operatorname{of}` as special `percentof` node so that + // it will be serialized properly and deleted as a unit. + return optWhitespace + .then(string('\\operatorname{of}').map(function () { + return PercentOfBuilder(); + })) + .or(_super.prototype.parser.call(this)); + }; + return class_6; + }(NonSymbolaSymbol)); + LatexCmds['\u2225'] = LatexCmds.parallel = bindVanillaSymbol('\\parallel ', '∥', 'parallel'); + LatexCmds['\u2226'] = LatexCmds.nparallel = bindVanillaSymbol('\\nparallel ', '∦', 'not parallel'); + LatexCmds['\u27c2'] = LatexCmds.perp = bindVanillaSymbol('\\perp ', '⟂', 'perpendicular'); + //the following are all Greek to me, but this helped a lot: http://www.ams.org/STIX/ion/stixsig03.html + //lowercase Greek letter variables + LatexCmds.alpha = + LatexCmds.beta = + LatexCmds.gamma = + LatexCmds.delta = + LatexCmds.zeta = + LatexCmds.eta = + LatexCmds.theta = + LatexCmds.iota = + LatexCmds.kappa = + LatexCmds.mu = + LatexCmds.nu = + LatexCmds.xi = + LatexCmds.rho = + LatexCmds.sigma = + LatexCmds.tau = + LatexCmds.chi = + LatexCmds.psi = + LatexCmds.omega = + function (latex) { + return new Variable('\\' + latex + ' ', h.entityText('&' + latex + ';')); + }; + //why can't anybody FUCKING agree on these + LatexCmds.phi = bindVariable('\\phi ', 'ϕ', 'phi'); //W3C or Unicode? + LatexCmds.phiv = LatexCmds.varphi = bindVariable('\\varphi ', 'φ', 'phi'); //Elsevier and 9573-13 //AMS and LaTeX + LatexCmds.epsilon = bindVariable('\\epsilon ', 'ϵ', 'epsilon'); //W3C or Unicode? + LatexCmds.epsiv = LatexCmds.varepsilon = bindVariable( + //Elsevier and 9573-13 //AMS and LaTeX + '\\varepsilon ', 'ε', 'epsilon'); + LatexCmds.piv = LatexCmds.varpi = bindVariable('\\varpi ', 'ϖ', 'piv'); //W3C/Unicode and Elsevier and 9573-13 //AMS and LaTeX + LatexCmds.sigmaf = //W3C/Unicode + LatexCmds.sigmav = //Elsevier + LatexCmds.varsigma = //LaTeX + bindVariable('\\varsigma ', 'ς', 'sigma'); + LatexCmds.thetav = //Elsevier and 9573-13 + LatexCmds.vartheta = //AMS and LaTeX + LatexCmds.thetasym = //W3C/Unicode + bindVariable('\\vartheta ', 'ϑ', 'theta'); + LatexCmds.upsilon = LatexCmds.upsi = bindVariable( + //AMS and LaTeX and W3C/Unicode //Elsevier and 9573-13 + '\\upsilon ', 'υ', 'upsilon'); + //these aren't even mentioned in the HTML character entity references + LatexCmds.gammad = //Elsevier + LatexCmds.Gammad = //9573-13 -- WTF, right? I dunno if this was a typo in the reference (see above) + LatexCmds.digamma = //LaTeX + bindVariable('\\digamma ', 'ϝ', 'gamma'); + LatexCmds.kappav = LatexCmds.varkappa = bindVariable( + //Elsevier //AMS and LaTeX + '\\varkappa ', 'ϰ', 'kappa'); + LatexCmds.rhov = LatexCmds.varrho = bindVariable('\\varrho ', 'ϱ', 'rho'); //Elsevier and 9573-13 //AMS and LaTeX + //Greek constants, look best in non-italicized Times New Roman + LatexCmds.pi = LatexCmds['\u03c0'] = function () { + return new NonSymbolaSymbol('\\pi ', h.entityText('π'), 'pi'); + }; + LatexCmds.lambda = function () { + return new NonSymbolaSymbol('\\lambda ', h.entityText('λ'), 'lambda'); + }; + //uppercase greek letters + LatexCmds.Upsilon = //LaTeX + LatexCmds.Upsi = //Elsevier and 9573-13 + LatexCmds.upsih = //W3C/Unicode "upsilon with hook" + LatexCmds.Upsih = //'cos it makes sense to me + function () { + return new MQSymbol('\\Upsilon ', h('var', { style: 'font-family: serif' }, [h.entityText('ϒ')]), 'capital upsilon'); + }; //Symbola's 'upsilon with a hook' is a capital Y without hooks :( + //other symbols with the same LaTeX command and HTML character entity reference + LatexCmds.Gamma = + LatexCmds.Delta = + LatexCmds.Theta = + LatexCmds.Lambda = + LatexCmds.Xi = + LatexCmds.Pi = + LatexCmds.Sigma = + LatexCmds.Phi = + LatexCmds.Psi = + LatexCmds.Omega = + LatexCmds.forall = + function (latex) { + return new VanillaSymbol('\\' + latex + ' ', h.entityText('&' + latex + ';')); + }; + // symbols that aren't a single MathCommand, but are instead a whole + // Fragment. Creates the Fragment from a LaTeX string + var LatexFragment = /** @class */ (function (_super) { + __extends(LatexFragment, _super); + function LatexFragment(latex) { + var _this_1 = _super.call(this) || this; + _this_1.latexStr = latex; + return _this_1; + } + LatexFragment.prototype.createLeftOf = function (cursor) { + var block = latexMathParser.parse(this.latexStr); + block + .children() + .adopt(cursor.parent, cursor[L], cursor[R]); + cursor[L] = block.getEnd(R); + domFrag(block.html()).insertBefore(cursor.domFrag()); + block.finalizeInsert(cursor.options, cursor); + var blockEndsR = block.getEnd(R); + var blockEndsRR = blockEndsR && blockEndsR[R]; + if (blockEndsRR) + blockEndsRR.siblingCreated(cursor.options, L); + var blockEndsL = block.getEnd(L); + var blockEndsLL = blockEndsL && blockEndsL[L]; + if (blockEndsLL) + blockEndsLL.siblingCreated(cursor.options, R); + cursor.parent.bubble(function (node) { + node.reflow(); + return undefined; + }); + }; + LatexFragment.prototype.mathspeak = function () { + return latexMathParser.parse(this.latexStr).mathspeak(); + }; + LatexFragment.prototype.parser = function () { + var frag = latexMathParser.parse(this.latexStr).children(); + return Parser.succeed(frag); + }; + return LatexFragment; + }(MathCommand)); + // for what seems to me like [stupid reasons][1], Unicode provides + // subscripted and superscripted versions of all ten Arabic numerals, + // as well as [so-called "vulgar fractions"][2]. + // Nobody really cares about most of them, but some of them actually + // predate Unicode, dating back to [ISO-8859-1][3], apparently also + // known as "Latin-1", which among other things [Windows-1252][4] + // largely coincides with, so Microsoft Word sometimes inserts them + // and they get copy-pasted into MathQuill. + // + // (Irrelevant but funny story: though not a superset of Latin-1 aka + // ISO-8859-1, Windows-1252 **is** a strict superset of the "closely + // related but distinct"[3] "ISO 8859-1" -- see the lack of a dash + // after "ISO"? Completely different character set, like elephants vs + // elephant seals, or "Zombies" vs "Zombie Redneck Torture Family". + // What kind of idiot would get them confused. + // People in fact got them confused so much, it was so common to + // mislabel Windows-1252 text as ISO-8859-1, that most modern web + // browsers and email clients treat the MIME charset of ISO-8859-1 + // as actually Windows-1252, behavior now standard in the HTML5 spec.) + // + // [1]: http://en.wikipedia.org/wiki/Unicode_subscripts_andsuper_scripts + // [2]: http://en.wikipedia.org/wiki/Number_Forms + // [3]: http://en.wikipedia.org/wiki/ISO/IEC_8859-1 + // [4]: http://en.wikipedia.org/wiki/Windows-1252 + LatexCmds['\u2070'] = function () { return new LatexFragment('^0'); }; + LatexCmds['\u00b9'] = function () { return new LatexFragment('^1'); }; + LatexCmds['\u00b2'] = function () { return new LatexFragment('^2'); }; + LatexCmds['\u00b3'] = function () { return new LatexFragment('^3'); }; + LatexCmds['\u2074'] = function () { return new LatexFragment('^4'); }; + LatexCmds['\u2075'] = function () { return new LatexFragment('^5'); }; + LatexCmds['\u2076'] = function () { return new LatexFragment('^6'); }; + LatexCmds['\u2077'] = function () { return new LatexFragment('^7'); }; + LatexCmds['\u2078'] = function () { return new LatexFragment('^8'); }; + LatexCmds['\u2079'] = function () { return new LatexFragment('^9'); }; + LatexCmds['\u00bc'] = function () { return new LatexFragment('\\frac14'); }; + LatexCmds['\u00bd'] = function () { return new LatexFragment('\\frac12'); }; + LatexCmds['\u00be'] = function () { return new LatexFragment('\\frac34'); }; + // this is a hack to make pasting the \u221a symbol + // actually insert a sqrt command. This isn't ideal, + // but it's way better than what we have now. I think + // before we invest any more time into this single character + // we should consider how to make the pipe (|) automatically + // insert absolute value. We also will want the percent (%) + // to expand to '% of'. I've always just thought mathquill's + // ability to handle pasted latex magical until I started actually + // testing it. It's a lot more buggy that I previously thought. + // + // KNOWN ISSUES: + // 1) pasting \u221a does not put focus in side the sqrt symbol + // 2) pasting \u221a2 puts the 2 outside of the sqrt symbol. + // + // The first issue seems like we could invest more time into this to + // fix it, but doesn't feel worth special casing. I think we'd want + // to address it by addressing ALL pasting issues. + // + // The second issue seems like it might go away too if you fix paste to + // act more like simply typing the characters out. I'd be scared to try + // to make that change because I'm fairly confident I'd break something + // around handling valid latex as latex rather than treating it as keystrokes. + LatexCmds['\u221a'] = function () { return new LatexFragment('\\sqrt{}'); }; + // Binary operator determination is used in several contexts for PlusMinus nodes and their descendants. + // For instance, we set the item's class name based on this factor, and also assign different mathspeak values (plus vs positive, negative vs minus). + function isBinaryOperator(node) { + if (!node) + return false; + var nodeL = node[L]; + if (nodeL) { + // If the left sibling is a binary operator or a separator (comma, semicolon, colon, space) + // or an open bracket (open parenthesis, open square bracket) + // consider the operator to be unary + if (nodeL instanceof BinaryOperator || + /^(\\ )|[,;:\(\[]$/.test(nodeL.ctrlSeq)) { + return false; + } + } + else if (node.parent && + node.parent.parent && + node.parent.parent.isStyleBlock()) { + //if we are in a style block at the leftmost edge, determine unary/binary based on + //the style block + //this allows style blocks to be transparent for unary/binary purposes + return isBinaryOperator(node.parent.parent); + } + else { + return false; + } + return true; + } + var PlusMinus = /** @class */ (function (_super) { + __extends(class_7, _super); + function class_7(ch, html, mathspeak) { + return _super.call(this, ch, html, undefined, mathspeak, true) || this; + } + class_7.prototype.contactWeld = function (cursor, dir) { + this.sharedSiblingMethod(cursor.options, dir); + }; + class_7.prototype.siblingCreated = function (opts, dir) { + this.sharedSiblingMethod(opts, dir); + }; + class_7.prototype.siblingDeleted = function (opts, dir) { + this.sharedSiblingMethod(opts, dir); + }; + class_7.prototype.sharedSiblingMethod = function (_opts, dir) { + if (dir === R) + return; // ignore if sibling only changed on the right + this.domFrag().oneElement().className = isBinaryOperator(this) + ? 'dcg-mq-binary-operator' + : ''; + return this; + }; + return class_7; + }(BinaryOperator)); + LatexCmds['+'] = /** @class */ (function (_super) { + __extends(class_8, _super); + function class_8() { + return _super.call(this, '+', h.text('+')) || this; + } + class_8.prototype.mathspeak = function () { + return isBinaryOperator(this) ? 'plus' : 'positive'; + }; + return class_8; + }(PlusMinus)); + //yes, these are different dashes, en-dash, em-dash, unicode minus, actual dash + var MinusNode = /** @class */ (function (_super) { + __extends(MinusNode, _super); + function MinusNode() { + return _super.call(this, '-', h.entityText('−')) || this; + } + MinusNode.prototype.mathspeak = function () { + return isBinaryOperator(this) ? 'minus' : 'negative'; + }; + return MinusNode; + }(PlusMinus)); + LatexCmds['\u2212'] = LatexCmds['\u2014'] = LatexCmds['\u2013'] = LatexCmds['-'] = MinusNode; + LatexCmds['\u00b1'] = + LatexCmds.pm = + LatexCmds.plusmn = + LatexCmds.plusminus = + function () { return new PlusMinus('\\pm ', h.entityText('±'), 'plus-or-minus'); }; + LatexCmds.mp = + LatexCmds.mnplus = + LatexCmds.minusplus = + function () { return new PlusMinus('\\mp ', h.entityText('∓'), 'minus-or-plus'); }; + CharCmds['*'] = + LatexCmds.sdot = + LatexCmds.cdot = + bindBinaryOperator('\\cdot ', '·', '*', 'times'); //semantically should be ⋅, but · looks better + var To = /** @class */ (function (_super) { + __extends(To, _super); + function To() { + return _super.call(this, '\\to ', h.entityText('→'), 'to') || this; + } + To.prototype.deleteTowards = function (dir, cursor) { + if (dir === L) { + var l = cursor[L]; + new Fragment(l, this).remove(); + cursor[L] = l[L]; + new MinusNode().createLeftOf(cursor); + cursor[L].bubble(function (node) { + node.reflow(); + return undefined; + }); + return; + } + _super.prototype.deleteTowards.call(this, dir, cursor); + }; + return To; + }(BinaryOperator)); + LatexCmds['\u2192'] = LatexCmds.to = To; + var Inequality = /** @class */ (function (_super) { + __extends(Inequality, _super); + function Inequality(data, strict) { + var _this_1 = this; + var strictness = strict ? 'Strict' : ''; + _this_1 = _super.call(this, data["ctrlSeq".concat(strictness)], h.entityText(data["htmlEntity".concat(strictness)]), data["text".concat(strictness)], data["mathspeak".concat(strictness)]) || this; + _this_1.data = data; + _this_1.strict = strict; + return _this_1; + } + Inequality.prototype.swap = function (strict) { + this.strict = strict; + var strictness = strict ? 'Strict' : ''; + this.ctrlSeq = this.data["ctrlSeq".concat(strictness)]; + this.domFrag() + .children() + .replaceWith(domFrag(h.entityText(this.data["htmlEntity".concat(strictness)]))); + this.textTemplate = [this.data["text".concat(strictness)]]; + this.mathspeakName = this.data["mathspeak".concat(strictness)]; + }; + Inequality.prototype.deleteTowards = function (dir, cursor) { + if (dir === L && !this.strict) { + this.swap(true); + this.bubble(function (node) { + node.reflow(); + return undefined; + }); + return; + } + _super.prototype.deleteTowards.call(this, dir, cursor); + }; + return Inequality; + }(BinaryOperator)); + var less = { + ctrlSeq: '\\le ', + htmlEntity: '≤', + text: '\u2264', + mathspeak: 'less than or equal to', + ctrlSeqStrict: '<', + htmlEntityStrict: '<', + textStrict: '<', + mathspeakStrict: 'less than', + }; + var greater = { + ctrlSeq: '\\ge ', + htmlEntity: '≥', + text: '\u2265', + mathspeak: 'greater than or equal to', + ctrlSeqStrict: '>', + htmlEntityStrict: '>', + textStrict: '>', + mathspeakStrict: 'greater than', + }; + var Greater = /** @class */ (function (_super) { + __extends(Greater, _super); + function Greater() { + return _super.call(this, greater, true) || this; + } + Greater.prototype.createLeftOf = function (cursor) { + var cursorL = cursor[L]; + if (cursorL instanceof BinaryOperator && cursorL.ctrlSeq === '-') { + var l = cursorL; + cursor[L] = l[L]; + l.remove(); + new To().createLeftOf(cursor); + cursor[L].bubble(function (node) { + node.reflow(); + return undefined; + }); + return; + } + _super.prototype.createLeftOf.call(this, cursor); + }; + return Greater; + }(Inequality)); + LatexCmds['<'] = LatexCmds.lt = function () { return new Inequality(less, true); }; + LatexCmds['>'] = LatexCmds.gt = Greater; + LatexCmds['\u2264'] = + LatexCmds.le = + LatexCmds.leq = + function () { return new Inequality(less, false); }; + LatexCmds['\u2265'] = + LatexCmds.ge = + LatexCmds.geq = + function () { return new Inequality(greater, false); }; + LatexCmds.infty = + LatexCmds.infin = + LatexCmds.infinity = + bindVanillaSymbol('\\infty ', '∞', 'infinity'); + LatexCmds['\u2260'] = + LatexCmds.ne = + LatexCmds.neq = + bindBinaryOperator('\\ne ', '≠', 'not equal'); + var Equality = /** @class */ (function (_super) { + __extends(Equality, _super); + function Equality() { + return _super.call(this, '=', h.text('='), '=', 'equals') || this; + } + Equality.prototype.createLeftOf = function (cursor) { + var cursorL = cursor[L]; + if (cursorL instanceof Inequality && cursorL.strict) { + cursorL.swap(false); + cursorL.bubble(function (node) { + node.reflow(); + return undefined; + }); + return; + } + _super.prototype.createLeftOf.call(this, cursor); + }; + return Equality; + }(BinaryOperator)); + LatexCmds['='] = Equality; + LatexCmds['\u00d7'] = LatexCmds.times = bindBinaryOperator('\\times ', '×', '[x]', 'times'); + LatexCmds['\u00f7'] = + LatexCmds.div = + LatexCmds.divide = + LatexCmds.divides = + bindBinaryOperator('\\div ', '÷', '[/]', 'over'); + var Sim = /** @class */ (function (_super) { + __extends(Sim, _super); + function Sim() { + return _super.call(this, '\\sim ', h.text('~'), '~', 'tilde') || this; + } + Sim.prototype.createLeftOf = function (cursor) { + if (cursor[L] instanceof Sim) { + var l = cursor[L]; + cursor[L] = l[L]; + l.remove(); + new Approx().createLeftOf(cursor); + cursor[L].bubble(function (node) { + node.reflow(); + return undefined; + }); + return; + } + _super.prototype.createLeftOf.call(this, cursor); + }; + return Sim; + }(BinaryOperator)); + var Approx = /** @class */ (function (_super) { + __extends(Approx, _super); + function Approx() { + return _super.call(this, '\\approx ', h.entityText('≈'), '\u2248', 'approximately equal') || this; + } + Approx.prototype.deleteTowards = function (dir, cursor) { + if (dir === L) { + var l = cursor[L]; + new Fragment(l, this).remove(); + cursor[L] = l[L]; + new Sim().createLeftOf(cursor); + cursor[L].bubble(function (node) { + node.reflow(); + return undefined; + }); + return; + } + _super.prototype.deleteTowards.call(this, dir, cursor); + }; + return Approx; + }(BinaryOperator)); + LatexCmds.tildeNbsp = bindVanillaSymbol('~', U_NO_BREAK_SPACE, ' '); + LatexCmds.sim = Sim; + LatexCmds['\u2248'] = LatexCmds.approx = Approx; + // When interpreting raw LaTeX, we can either evaluate the tilde as its standard nonbreaking space + // or transform it to the \sim operator depending on whether the "interpretTildeAsSim" configuration option is set. + // Tilde symbols input from a keyboard will always be transformed to \sim. + CharCmds['~'] = LatexCmds.sim; + LatexCmds['~'] = LatexCmds.tildeNbsp; + baseOptionProcessors.interpretTildeAsSim = function (val) { + var interpretAsSim = !!val; + if (interpretAsSim) { + LatexCmds['~'] = LatexCmds.sim; + } + else { + LatexCmds['~'] = LatexCmds.tildeNbsp; + } + return interpretAsSim; + }; + /*************************** + * Commands and Operators. + **************************/ + var SVG_SYMBOLS = { + sqrt: { + width: '', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 32 54' }, [ + h('path', { + d: 'M0 33 L7 27 L12.5 47 L13 47 L30 0 L32 0 L13 54 L11 54 L4.5 31 L0 33', + }), + ]); + }, + }, + '|': { + width: '.4em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ + h('path', { d: 'M4.4 0 L4.4 54 L5.6 54 L5.6 0' }), + ]); + }, + }, + '[': { + width: '.55em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 11 24' }, [ + h('path', { d: 'M8 0 L3 0 L3 24 L8 24 L8 23 L4 23 L4 1 L8 1' }), + ]); + }, + }, + ']': { + width: '.55em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 11 24' }, [ + h('path', { d: 'M3 0 L8 0 L8 24 L3 24 L3 23 L7 23 L7 1 L3 1' }), + ]); + }, + }, + '(': { + width: '.55em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '3 0 106 186' }, [ + h('path', { + d: 'M85 0 A61 101 0 0 0 85 186 L75 186 A75 101 0 0 1 75 0', + }), + ]); + }, + }, + ')': { + width: '.55em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '3 0 106 186' }, [ + h('path', { + d: 'M24 0 A61 101 0 0 1 24 186 L34 186 A75 101 0 0 0 34 0', + }), + ]); + }, + }, + '{': { + width: '.7em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '10 0 210 350' }, [ + h('path', { + d: 'M170 0 L170 6 A47 52 0 0 0 123 60 L123 127 A35 48 0 0 1 88 175 A35 48 0 0 1 123 223 L123 290 A47 52 0 0 0 170 344 L170 350 L160 350 A58 49 0 0 1 102 301 L103 220 A45 40 0 0 0 58 180 L58 170 A45 40 0 0 0 103 130 L103 49 A58 49 0 0 1 161 0', + }), + ]); + }, + }, + '}': { + width: '.7em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '10 0 210 350' }, [ + h('path', { + d: 'M60 0 L60 6 A47 52 0 0 1 107 60 L107 127 A35 48 0 0 0 142 175 A35 48 0 0 0 107 223 L107 290 A47 52 0 0 1 60 344 L60 350 L70 350 A58 49 0 0 0 128 301 L127 220 A45 40 0 0 1 172 180 L172 170 A45 40 0 0 1 127 130 L127 49 A58 49 0 0 0 70 0', + }), + ]); + }, + }, + '∥': { + width: '.7em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ + h('path', { d: 'M3.2 0 L3.2 54 L4 54 L4 0 M6.8 0 L6.8 54 L6 54 L6 0' }), + ]); + }, + }, + '⟨': { + width: '.55em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ + h('path', { d: 'M6.8 0 L3.2 27 L6.8 54 L7.8 54 L4.2 27 L7.8 0' }), + ]); + }, + }, + '⟩': { + width: '.55em', + html: function () { + return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ + h('path', { d: 'M3.2 0 L6.8 27 L3.2 54 L2.2 54 L5.8 27 L2.2 0' }), + ]); + }, + }, + }; + var Style = /** @class */ (function (_super) { + __extends(Style, _super); + function Style(ctrlSeq, tagName, attrs, ariaLabel, opts) { + var _this_1 = _super.call(this, ctrlSeq, new DOMView(1, function (blocks) { return h.block(tagName, attrs, blocks[0]); })) || this; + _this_1.ariaLabel = ariaLabel || ctrlSeq.replace(/^\\/, ''); + _this_1.mathspeakTemplate = [ + 'Start' + _this_1.ariaLabel + ',', + 'End' + _this_1.ariaLabel, + ]; + // In most cases, mathspeak should announce the start and end of style blocks. + // There is one exception currently (mathrm). + _this_1.shouldNotSpeakDelimiters = opts && opts.shouldNotSpeakDelimiters; + return _this_1; + } + Style.prototype.mathspeak = function (opts) { + if (!this.shouldNotSpeakDelimiters || (opts && opts.ignoreShorthand)) { + return _super.prototype.mathspeak.call(this); + } + return this.foldChildren('', function (speech, block) { + return speech + ' ' + block.mathspeak(opts); + }).trim(); + }; + return Style; + }(MathCommand)); + //fonts + LatexCmds.mathrm = /** @class */ (function (_super) { + __extends(mathrm, _super); + function mathrm() { + return _super.call(this, '\\mathrm', 'span', { class: 'dcg-mq-roman dcg-mq-font' }, 'Roman Font', { + shouldNotSpeakDelimiters: true, + }) || this; + } + mathrm.prototype.isTextBlock = function () { + return true; + }; + return mathrm; + }(Style)); + LatexCmds.mathit = function () { + return new Style('\\mathit', 'i', { class: 'dcg-mq-font' }, 'Italic Font'); + }; + LatexCmds.mathbf = function () { + return new Style('\\mathbf', 'b', { class: 'dcg-mq-font' }, 'Bold Font'); + }; + LatexCmds.mathsf = function () { + return new Style('\\mathsf', 'span', { class: 'dcg-mq-sans-serif dcg-mq-font' }, 'Serif Font'); + }; + LatexCmds.mathtt = function () { + return new Style('\\mathtt', 'span', { class: 'dcg-mq-monospace dcg-mq-font' }, 'Math Text'); + }; + //text-decoration + LatexCmds.underline = function () { + return new Style('\\underline', 'span', { class: 'dcg-mq-non-leaf dcg-mq-underline' }, 'Underline'); + }; + LatexCmds.overline = LatexCmds.bar = function () { + return new Style('\\overline', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overline' }, 'Overline'); + }; + LatexCmds.overrightarrow = function () { + return new Style('\\overrightarrow', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-right' }, 'Over Right Arrow'); + }; + LatexCmds.overleftarrow = function () { + return new Style('\\overleftarrow', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-left' }, 'Over Left Arrow'); + }; + LatexCmds.overleftrightarrow = function () { + return new Style('\\overleftrightarrow ', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-leftright' }, 'Over Left and Right Arrow'); + }; + LatexCmds.overarc = function () { + return new Style('\\overarc', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overarc' }, 'Over Arc'); + }; + LatexCmds.dot = function () { + return new MathCommand('\\dot', new DOMView(1, function (blocks) { + return h('span', { class: 'dcg-mq-non-leaf' }, [ + h('span', { class: 'dcg-mq-dot-recurring-inner' }, [ + h('span', { class: 'dcg-mq-dot-recurring' }, [h.text(U_DOT_ABOVE)]), + h.block('span', { class: 'dcg-mq-empty-box' }, blocks[0]), + ]), + ]); + })); + }; + // `\textcolor{color}{math}` will apply a color to the given math content, where + // `color` is any valid CSS Color Value (see [SitePoint docs][] (recommended), + // [Mozilla docs][], or [W3C spec][]). + // + // [SitePoint docs]: http://reference.sitepoint.com/css/colorvalues + // [Mozilla docs]: https://developer.mozilla.org/en-US/docs/CSS/color_value#Values + // [W3C spec]: http://dev.w3.org/csswg/css3-color/#colorunits + LatexCmds.textcolor = /** @class */ (function (_super) { + __extends(class_9, _super); + function class_9() { + return _super !== null && _super.apply(this, arguments) || this; + } + class_9.prototype.setColor = function (color) { + this.color = color; + this.domView = new DOMView(1, function (blocks) { + return h.block('span', { class: 'dcg-mq-textcolor', style: 'color:' + color }, blocks[0]); + }); + this.ariaLabel = color.replace(/^\\/, ''); + this.mathspeakTemplate = [ + 'Start ' + this.ariaLabel + ',', + 'End ' + this.ariaLabel, + ]; + }; + class_9.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + var blocks0 = this.blocks[0]; + ctx.latex += '\\textcolor{' + this.color + '}{'; + blocks0.latexRecursive(ctx); + ctx.latex += '}'; + this.checkCursorContextClose(ctx); + }; + class_9.prototype.parser = function () { + var _this_1 = this; + var optWhitespace = Parser.optWhitespace; + var string = Parser.string; + var regex = Parser.regex; + return optWhitespace + .then(string('{')) + .then(regex(/^[#\w\s.,()%-]*/)) + .skip(string('}')) + .then(function (color) { + _this_1.setColor(color); + return _super.prototype.parser.call(_this_1); + }); + }; + class_9.prototype.isStyleBlock = function () { + return true; + }; + return class_9; + }(MathCommand)); + // Very similar to the \textcolor command, but will add the given CSS class. + // Usage: \class{classname}{math} + // Note regex that whitelists valid CSS classname characters: + // https://github.com/mathquill/mathquill/pull/191#discussion_r4327442 + var Class = (LatexCmds['class'] = /** @class */ (function (_super) { + __extends(class_10, _super); + function class_10() { + return _super !== null && _super.apply(this, arguments) || this; + } + class_10.prototype.parser = function () { + var _this_1 = this; + var string = Parser.string, regex = Parser.regex; + return Parser.optWhitespace + .then(string('{')) + .then(regex(/^[-\w\s\\\xA0-\xFF]*/)) + .skip(string('}')) + .then(function (cls) { + _this_1.cls = cls || ''; + _this_1.domView = new DOMView(1, function (blocks) { + return h.block('span', { class: "dcg-mq-class ".concat(cls) }, blocks[0]); + }); + _this_1.ariaLabel = cls + ' class'; + _this_1.mathspeakTemplate = [ + 'Start ' + _this_1.ariaLabel + ',', + 'End ' + _this_1.ariaLabel, + ]; + return _super.prototype.parser.call(_this_1); + }); + }; + class_10.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + var blocks0 = this.blocks[0]; + ctx.latex += '\\class{' + this.cls + '}{'; + blocks0.latexRecursive(ctx); + ctx.latex += '}'; + this.checkCursorContextClose(ctx); + }; + class_10.prototype.isStyleBlock = function () { + return true; + }; + return class_10; + }(MathCommand))); + // This test is used to determine whether an item may be treated as a whole number + // for shortening the verbalized (mathspeak) forms of some fractions and superscripts. + var intRgx = /^[\+\-]?[\d]+$/; + // Traverses the top level of the passed block's children and returns the concatenation of their ctrlSeq properties. + // Used in shortened mathspeak computations as a block's .text() method can be potentially expensive. + // + function getCtrlSeqsFromBlock(block) { + if (!block) + return ''; + var chars = ''; + block.eachChild(function (child) { + if (child.ctrlSeq !== undefined) + chars += child.ctrlSeq; + }); + return chars; + } + Options.prototype.charsThatBreakOutOfSupSub = ''; + var SupSub = /** @class */ (function (_super) { + __extends(SupSub, _super); + function SupSub() { + var _this_1 = _super !== null && _super.apply(this, arguments) || this; + _this_1.ctrlSeq = '_{...}^{...}'; + return _this_1; + } + SupSub.prototype.setEnds = function (ends) { + pray('SupSub ends must be MathBlocks', ends[L] instanceof MathBlock && ends[R] instanceof MathBlock); + this.ends = ends; + }; + SupSub.prototype.getEnd = function (dir) { + return this.ends[dir]; + }; + SupSub.prototype.createLeftOf = function (cursor) { + if (!this.replacedFragment && + !cursor[L] && + cursor.options.supSubsRequireOperand) + return; + return _super.prototype.createLeftOf.call(this, cursor); + }; + SupSub.prototype.contactWeld = function (cursor) { + // Look on either side for a SupSub, if one is found compare my + // .sub, .sup with its .sub, .sup. If I have one that it doesn't, + // then call .addBlock() on it with my block; if I have one that + // it also has, then insert my block's children into its block, + // unless my block has none, in which case insert the cursor into + // its block (and not mine, I'm about to remove myself) in the case + // I was just typed. + // TODO: simplify + // equiv. to [L, R].forEach(function(dir) { ... }); + for (var dir = L; dir; dir = dir === L ? R : false) { + var thisDir = this[dir]; + var pt = void 0; + if (thisDir instanceof SupSub) { + // equiv. to 'sub sup'.split(' ').forEach(function(supsub) { ... }); + for (var supsub = 'sub'; supsub; supsub = supsub === 'sub' ? 'sup' : false) { + var src = this[supsub], dest = thisDir[supsub]; + if (!src) + continue; + if (!dest) + thisDir.addBlock(src.disown()); + else if (!src.isEmpty()) { + // ins src children at -dir end of dest + src + .domFrag() + .children() + .insAtDirEnd(-dir, dest.domFrag().oneElement()); + var children = src.children().disown(); + pt = new Point(dest, children.getEnd(R), dest.getEnd(L)); + if (dir === L) + children.adopt(dest, dest.getEnd(R), 0); + else + children.adopt(dest, 0, dest.getEnd(L)); + } + else { + pt = new Point(dest, 0, dest.getEnd(L)); + } + this.placeCursor = (function (dest, src) { + // TODO: don't monkey-patch + return function (cursor) { + cursor.insAtDirEnd(-dir, dest || src); + }; + })(dest, src); + } + this.remove(); + if (cursor && cursor[L] === this) { + if (dir === R && pt) { + if (pt[L]) { + cursor.insRightOf(pt[L]); + } + else { + cursor.insAtLeftEnd(pt.parent); + } + } + else + cursor.insRightOf(thisDir); + } + break; + } + } + }; + SupSub.prototype.finalizeTree = function () { + var endsL = this.getEnd(L); + endsL.write = function (cursor, ch) { + if (cursor.options.autoSubscriptNumerals && + this === this.parent.sub) { + if (ch === '_') + return; + var cmd = this.chToCmd(ch, cursor.options); + if (cmd instanceof MQSymbol) + cursor.deleteSelection(); + else + cursor.clearSelection().insRightOf(this.parent); + cmd.createLeftOf(cursor.show()); + cursor.controller.aria + .queue('Baseline') + .alert(cmd.mathspeak({ createdLeftOf: cursor })); + return; + } + if (cursor[L] && + !cursor[R] && + !cursor.selection && + cursor.options.charsThatBreakOutOfSupSub.indexOf(ch) > -1) { + cursor.insRightOf(this.parent); + cursor.controller.aria.queue('Baseline'); + } + MathBlock.prototype.write.call(this, cursor, ch); + }; + }; + SupSub.prototype.moveTowards = function (dir, cursor, updown) { + if (cursor.options.autoSubscriptNumerals && !this.sup) { + cursor.insDirOf(dir, this); + } + else + _super.prototype.moveTowards.call(this, dir, cursor, updown); + }; + SupSub.prototype.deleteTowards = function (dir, cursor) { + if (cursor.options.autoSubscriptNumerals && this.sub) { + var cmd = this.sub.getEnd(-dir); + if (cmd instanceof MQSymbol) + cmd.remove(); + else if (cmd) + cmd.deleteTowards(dir, cursor.insAtDirEnd(-dir, this.sub)); + // TODO: factor out a .removeBlock() or something + if (this.sub.isEmpty()) { + this.sub.deleteOutOf(L, cursor.insAtLeftEnd(this.sub)); + if (this.sup) + cursor.insDirOf(-dir, this); + // Note `-dir` because in e.g. x_1^2| want backspacing (leftward) + // to delete the 1 but to end up rightward of x^2; with non-negated + // `dir` (try it), the cursor appears to have gone "through" the ^2. + } + } + else + _super.prototype.deleteTowards.call(this, dir, cursor); + }; + SupSub.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + if (this.sub) { + ctx.latex += '_{'; + var beforeLength = ctx.latex.length; + this.sub.latexRecursive(ctx); + var afterLength = ctx.latex.length; + if (beforeLength === afterLength) { + // nothing was written. so we write a space + ctx.latex += ' '; + } + ctx.latex += '}'; + } + if (this.sup) { + ctx.latex += '^{'; + var beforeLength = ctx.latex.length; + this.sup.latexRecursive(ctx); + var afterLength = ctx.latex.length; + if (beforeLength === afterLength) { + // nothing was written. so we write a space + ctx.latex += ' '; + } + ctx.latex += '}'; + } + this.checkCursorContextClose(ctx); + }; + SupSub.prototype.text = function () { + function text(prefix, block) { + var l = (block && block.text()) || ''; + return block + ? prefix + (l.length === 1 ? l : '(' + (l || ' ') + ')') + : ''; + } + return text('_', this.sub) + text('^', this.sup); + }; + SupSub.prototype.addBlock = function (block) { + if (this.supsub === 'sub') { + this.sup = this.upInto = this.sub.upOutOf = block; + block.adopt(this, this.sub, 0).downOutOf = this.sub; + block.setDOM(domFrag(h('span', { class: 'dcg-mq-sup' })) + .append(block.domFrag().children()) + .prependTo(this.domFrag().oneElement()) + .oneElement()); + NodeBase.linkElementByBlockNode(block.domFrag().oneElement(), block); + } + else { + this.sub = this.downInto = this.sup.downOutOf = block; + block.adopt(this, 0, this.sup).upOutOf = this.sup; + this.domFrag().removeClass('dcg-mq-sup-only'); + block.setDOM(domFrag(h('span', { class: 'dcg-mq-sub' })) + .append(block.domFrag().children()) + .appendTo(this.domFrag().oneElement()) + .oneElement()); + NodeBase.linkElementByBlockNode(block.domFrag().oneElement(), block); + this.domFrag().append(domFrag(h('span', { style: 'display:inline-block;width:0' }, [ + h.text(U_ZERO_WIDTH_SPACE), + ]))); + } + // like 'sub sup'.split(' ').forEach(function(supsub) { ... }); + for (var i = 0; i < 2; i += 1) + (function (cmd, supsub, oppositeSupsub, updown) { + var cmdSubSub = cmd[supsub]; + cmdSubSub.deleteOutOf = function (dir, cursor) { + cursor.insDirOf(this[dir] ? -dir : dir, this.parent); + if (!this.isEmpty()) { + var end = this.getEnd(dir); + this.children() + .disown() + .withDirAdopt(dir, cursor.parent, cursor[dir], cursor[-dir]) + .domFrag() + .insDirOf(-dir, cursor.domFrag()); + cursor[-dir] = end; + } + cmd.supsub = oppositeSupsub; + delete cmd[supsub]; + delete cmd["".concat(updown, "Into")]; + var cmdOppositeSupsub = cmd[oppositeSupsub]; + cmdOppositeSupsub["".concat(updown, "OutOf")] = insLeftOfMeUnlessAtEnd; + delete cmdOppositeSupsub.deleteOutOf; // TODO - refactor so this method can be optional + if (supsub === 'sub') { + cmd.domFrag().addClass('dcg-mq-sup-only').children().last().remove(); + } + this.remove(); + }; + })(this, 'sub sup'.split(' ')[i], 'sup sub'.split(' ')[i], 'down up'.split(' ')[i]); + }; + return SupSub; + }(MathCommand)); + function insLeftOfMeUnlessAtEnd(cursor) { + // cursor.insLeftOf(cmd), unless cursor at the end of block, and every + // ancestor cmd is at the end of every ancestor block + var cmd = this.parent; + var ancestorCmd = cursor; + do { + if (ancestorCmd[R]) + return cursor.insLeftOf(cmd); + ancestorCmd = ancestorCmd.parent.parent; + } while (ancestorCmd !== cmd); + cursor.insRightOf(cmd); + return undefined; + } + var SubscriptCommand = /** @class */ (function (_super) { + __extends(SubscriptCommand, _super); + function SubscriptCommand() { + var _this_1 = _super !== null && _super.apply(this, arguments) || this; + _this_1.supsub = 'sub'; + _this_1.domView = new DOMView(1, function (blocks) { + return h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf' }, [ + h.block('span', { class: 'dcg-mq-sub' }, blocks[0]), + h('span', { style: 'display:inline-block;width:0' }, [ + h.text(U_ZERO_WIDTH_SPACE), + ]), + ]); + }); + _this_1.textTemplate = ['_']; + _this_1.mathspeakTemplate = ['Subscript,', ', Baseline']; + _this_1.ariaLabel = 'subscript'; + return _this_1; + } + SubscriptCommand.prototype.finalizeTree = function () { + this.downInto = this.sub = this.getEnd(L); + this.sub.upOutOf = insLeftOfMeUnlessAtEnd; + _super.prototype.finalizeTree.call(this); + }; + return SubscriptCommand; + }(SupSub)); + LatexCmds.subscript = LatexCmds._ = SubscriptCommand; + LatexCmds.superscript = + LatexCmds.supscript = + LatexCmds['^'] = /** @class */ (function (_super) { + __extends(SuperscriptCommand, _super); + function SuperscriptCommand() { + var _this_1 = _super !== null && _super.apply(this, arguments) || this; + _this_1.supsub = 'sup'; + _this_1.domView = new DOMView(1, function (blocks) { + return h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf dcg-mq-sup-only' }, [ + h.block('span', { class: 'dcg-mq-sup' }, blocks[0]), + ]); + }); + _this_1.textTemplate = ['^(', ')']; + _this_1.ariaLabel = 'superscript'; + _this_1.mathspeakTemplate = ['Superscript,', ', Baseline']; + return _this_1; + } + SuperscriptCommand.prototype.mathspeak = function (opts) { + // Simplify basic exponent speech for common whole numbers. + var child = this.upInto; + if (child !== undefined) { + // Calculate this item's inner text to determine whether to shorten the returned speech. + // Do not calculate its inner mathspeak now until we know that the speech is to be truncated. + // Since the mathspeak computation is recursive, we want to call it only once in this function to avoid performance bottlenecks. + var innerText = getCtrlSeqsFromBlock(child); + // If the superscript is a whole number, shorten the speech that is returned. + if ((!opts || !opts.ignoreShorthand) && intRgx.test(innerText)) { + // Simple cases + if (innerText === '0') { + return 'to the 0 power'; + } + else if (innerText === '2') { + return 'squared'; + } + else if (innerText === '3') { + return 'cubed'; + } + // More complex cases. + var suffix = ''; + // Limit suffix addition to exponents < 1000. + if (/^[+-]?\d{1,3}$/.test(innerText)) { + if (/(11|12|13|4|5|6|7|8|9|0)$/.test(innerText)) { + suffix = 'th'; + } + else if (/1$/.test(innerText)) { + suffix = 'st'; + } + else if (/2$/.test(innerText)) { + suffix = 'nd'; + } + else if (/3$/.test(innerText)) { + suffix = 'rd'; + } + } + var innerMathspeak = typeof child === 'object' ? child.mathspeak() : innerText; + return 'to the ' + innerMathspeak + suffix + ' power'; + } + } + return _super.prototype.mathspeak.call(this); + }; + SuperscriptCommand.prototype.finalizeTree = function () { + this.upInto = this.sup = this.getEnd(R); + this.sup.downOutOf = insLeftOfMeUnlessAtEnd; + _super.prototype.finalizeTree.call(this); + }; + return SuperscriptCommand; + }(SupSub)); + var SummationNotation = /** @class */ (function (_super) { + __extends(SummationNotation, _super); + function SummationNotation(ch, symbol, ariaLabel) { + var _this_1 = _super.call(this) || this; + _this_1.ariaLabel = ariaLabel || ch.replace(/^\\/, ''); + var domView = new DOMView(2, function (blocks) { + return h('span', { class: 'dcg-mq-large-operator dcg-mq-non-leaf' }, [ + h('span', { class: 'dcg-mq-to' }, [h.block('span', {}, blocks[1])]), + h('big', {}, [h.text(symbol)]), + h('span', { class: 'dcg-mq-from' }, [h.block('span', {}, blocks[0])]), + ]); + }); + MQSymbol.prototype.setCtrlSeqHtmlTextAndMathspeak.call(_this_1, ch, domView); + return _this_1; + } + SummationNotation.prototype.createLeftOf = function (cursor) { + _super.prototype.createLeftOf.call(this, cursor); + if (cursor.options.sumStartsWithNEquals) { + new Letter('n').createLeftOf(cursor); + new Equality().createLeftOf(cursor); + } + }; + SummationNotation.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += this.ctrlSeq + '_{'; + var beforeLength = ctx.latex.length; + this.getEnd(L).latexRecursive(ctx); + var afterLength = ctx.latex.length; + if (afterLength === beforeLength) { + // nothing was written so we write a space + ctx.latex += ' '; + } + ctx.latex += '}^{'; + beforeLength = ctx.latex.length; + this.getEnd(R).latexRecursive(ctx); + afterLength = ctx.latex.length; + if (beforeLength === afterLength) { + // nothing was written so we write a space + ctx.latex += ' '; + } + ctx.latex += '}'; + this.checkCursorContextClose(ctx); + }; + SummationNotation.prototype.mathspeak = function () { + return ('Start ' + + this.ariaLabel + + ' from ' + + this.getEnd(L).mathspeak() + + ' to ' + + this.getEnd(R).mathspeak() + + ', end ' + + this.ariaLabel + + ', '); + }; + SummationNotation.prototype.parser = function () { + var string = Parser.string; + var optWhitespace = Parser.optWhitespace; + var succeed = Parser.succeed; + var block = latexMathParser.block; + var self = this; + var blocks = (self.blocks = [new MathBlock(), new MathBlock()]); + for (var i = 0; i < blocks.length; i += 1) { + blocks[i].adopt(self, self.getEnd(R), 0); + } + return optWhitespace + .then(string('_').or(string('^'))) + .then(function (supOrSub) { + var child = blocks[supOrSub === '_' ? 0 : 1]; + return block.then(function (block) { + block.children().adopt(child, child.getEnd(R), 0); + return succeed(self); + }); + }) + .many() + .result(self); + }; + SummationNotation.prototype.finalizeTree = function () { + var endsL = this.getEnd(L); + var endsR = this.getEnd(R); + endsL.ariaLabel = 'lower bound'; + endsR.ariaLabel = 'upper bound'; + this.downInto = endsL; + this.upInto = endsR; + endsL.upOutOf = endsR; + endsR.downOutOf = endsL; + }; + return SummationNotation; + }(MathCommand)); + LatexCmds['\u2211'] = + LatexCmds.sum = + LatexCmds.summation = + function () { return new SummationNotation('\\sum ', U_NARY_SUMMATION, 'sum'); }; + LatexCmds['\u220f'] = + LatexCmds.prod = + LatexCmds.product = + function () { return new SummationNotation('\\prod ', U_NARY_PRODUCT, 'product'); }; + LatexCmds.coprod = LatexCmds.coproduct = function () { + return new SummationNotation('\\coprod ', U_NARY_COPRODUCT, 'co product'); + }; + LatexCmds['\u222b'] = + LatexCmds['int'] = + LatexCmds.integral = /** @class */ (function (_super) { + __extends(class_11, _super); + function class_11() { + var _this_1 = _super.call(this, '\\int ', '', 'integral') || this; + _this_1.ariaLabel = 'integral'; + _this_1.domView = new DOMView(2, function (blocks) { + return h('span', { class: 'dcg-mq-int dcg-mq-non-leaf' }, [ + h('big', {}, [h.text(U_INTEGRAL)]), + h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf' }, [ + h('span', { class: 'dcg-mq-sup' }, [ + h.block('span', { class: 'dcg-mq-sup-inner' }, blocks[1]), + ]), + h.block('span', { class: 'dcg-mq-sub' }, blocks[0]), + h('span', { style: 'display:inline-block;width:0' }, [ + h.text(U_ZERO_WIDTH_SPACE), + ]), + ]), + ]); + }); + return _this_1; + } + class_11.prototype.createLeftOf = function (cursor) { + // FIXME: refactor rather than overriding + MathCommand.prototype.createLeftOf.call(this, cursor); + }; + return class_11; + }(SummationNotation)); + //window.LatexCmds = LatexCmds; + //console.log(LatexCmds); + //console.log(window); + var Fraction = (LatexCmds.frac = + LatexCmds.dfrac = + LatexCmds.cfrac = + LatexCmds.fraction = /** @class */ (function (_super) { + __extends(FracNode, _super); + function FracNode() { + var _this_1 = _super !== null && _super.apply(this, arguments) || this; + _this_1.ctrlSeq = '\\frac'; + _this_1.domView = new DOMView(2, function (blocks) { + return h('span', { class: 'dcg-mq-fraction dcg-mq-non-leaf' }, [ + h.block('span', { class: 'dcg-mq-numerator' }, blocks[0]), + h.block('span', { class: 'dcg-mq-denominator' }, blocks[1]), + h('span', { style: 'display:inline-block;width:0' }, [ + h.text(U_ZERO_WIDTH_SPACE), + ]), + ]); + }); + _this_1.textTemplate = ['(', ')/(', ')']; + return _this_1; + } + FracNode.prototype.finalizeTree = function () { + var endsL = this.getEnd(L); + var endsR = this.getEnd(R); + this.upInto = endsR.upOutOf = endsL; + this.downInto = endsL.downOutOf = endsR; + endsL.ariaLabel = 'numerator'; + endsR.ariaLabel = 'denominator'; + if (this.getFracDepth() > 1) { + this.mathspeakTemplate = [ + 'StartNestedFraction,', + 'NestedOver', + ', EndNestedFraction', + ]; + } + else { + this.mathspeakTemplate = ['StartFraction,', 'Over', ', EndFraction']; + } + }; + FracNode.prototype.mathspeak = function (opts) { + if (opts && opts.createdLeftOf) { + var cursor = opts.createdLeftOf; + return cursor.parent.mathspeak(); + } + var numText = getCtrlSeqsFromBlock(this.getEnd(L)); + var denText = getCtrlSeqsFromBlock(this.getEnd(R)); + // Shorten mathspeak value for whole number fractions whose denominator is less than 10. + if ((!opts || !opts.ignoreShorthand) && + intRgx.test(numText) && + intRgx.test(denText)) { + var isSingular = numText === '1' || numText === '-1'; + var newDenSpeech = ''; + if (denText === '2') { + newDenSpeech = isSingular ? 'half' : 'halves'; + } + else if (denText === '3') { + newDenSpeech = isSingular ? 'third' : 'thirds'; + } + else if (denText === '4') { + newDenSpeech = isSingular ? 'quarter' : 'quarters'; + } + else if (denText === '5') { + newDenSpeech = isSingular ? 'fifth' : 'fifths'; + } + else if (denText === '6') { + newDenSpeech = isSingular ? 'sixth' : 'sixths'; + } + else if (denText === '7') { + newDenSpeech = isSingular ? 'seventh' : 'sevenths'; + } + else if (denText === '8') { + newDenSpeech = isSingular ? 'eighth' : 'eighths'; + } + else if (denText === '9') { + newDenSpeech = isSingular ? 'ninth' : 'ninths'; + } + if (newDenSpeech !== '') { + var output = ''; + // Handle the case of an integer followed by a simplified fraction such as 1\frac{1}{2}. + // Such combinations should be spoken aloud as "1 and 1 half." + // Start at the left sibling of the fraction and continue leftward until something other than a digit or whitespace is found. + var precededByInteger = false; + for (var sibling = this[L]; sibling && sibling[L] !== undefined; sibling = sibling[L]) { + // Ignore whitespace + if (sibling.ctrlSeq === '\\ ') { + continue; + } + else if (intRgx.test(sibling.ctrlSeq || '')) { + precededByInteger = true; + } + else { + precededByInteger = false; + break; + } + } + if (precededByInteger) { + output += 'and '; + } + output += this.getEnd(L).mathspeak() + ' ' + newDenSpeech; + return output; + } + } + return _super.prototype.mathspeak.call(this); + }; + FracNode.prototype.getFracDepth = function () { + var level = 0; + var walkUp = function (item, level) { + if (item instanceof MQNode && + item.ctrlSeq && + item.ctrlSeq.toLowerCase().search('frac') >= 0) + level += 1; + if (item && item.parent) + return walkUp(item.parent, level); + else + return level; + }; + return walkUp(this, level); + }; + return FracNode; + }(MathCommand))); + var LiveFraction = (LatexCmds.over = + CharCmds['/'] = /** @class */ (function (_super) { + __extends(class_12, _super); + function class_12() { + return _super !== null && _super.apply(this, arguments) || this; + } + class_12.prototype.createLeftOf = function (cursor) { + if (!this.replacedFragment) { + var leftward = cursor[L]; + if (!cursor.options.typingSlashCreatesNewFraction) { + while (leftward && + !(leftward instanceof BinaryOperator || + leftward instanceof (LatexCmds.text || noop) || + leftward instanceof SummationNotation || + leftward.ctrlSeq === '\\ ' || + /^[,;:]$/.test(leftward.ctrlSeq)) //lookbehind for operator + ) + leftward = leftward[L]; + } + if (leftward instanceof SummationNotation && + leftward[R] instanceof SupSub) { + leftward = leftward[R]; + var leftwardR = leftward[R]; + if (leftwardR instanceof SupSub && + leftwardR.ctrlSeq != leftward.ctrlSeq) + leftward = leftward[R]; + } + if (leftward !== cursor[L] && !cursor.isTooDeep(1)) { + var leftwardR = leftward[R]; + var cursorL = cursor[L]; + this.replaces(new Fragment(leftwardR || cursor.parent.getEnd(L), cursorL)); + cursor[L] = leftward; + } + } + _super.prototype.createLeftOf.call(this, cursor); + }; + return class_12; + }(Fraction))); + var AnsBuilder = function () { + return new MQSymbol('\\operatorname{ans}', h('span', { class: 'dcg-mq-ans' }, [h.text('ans')]), 'ans'); + }; + LatexCmds.ans = AnsBuilder; + var PercentOfBuilder = function () { + return new MQSymbol('\\%\\operatorname{of}', h('span', { class: 'dcg-mq-nonSymbola dcg-mq-operator-name' }, [h.text('% of ')]), 'percent of'); + }; + LatexCmds.percent = LatexCmds.percentof = PercentOfBuilder; + var SquareRoot = /** @class */ (function (_super) { + __extends(SquareRoot, _super); + function SquareRoot() { + var _this_1 = _super !== null && _super.apply(this, arguments) || this; + _this_1.ctrlSeq = '\\sqrt'; + _this_1.domView = new DOMView(1, function (blocks) { + return h('span', { class: 'dcg-mq-non-leaf dcg-mq-sqrt-container' }, [ + h('span', { class: 'dcg-mq-scaled dcg-mq-sqrt-prefix' }, [ + SVG_SYMBOLS.sqrt.html(), + ]), + h.block('span', { class: 'dcg-mq-non-leaf dcg-mq-sqrt-stem' }, blocks[0]), + ]); + }); + _this_1.textTemplate = ['sqrt(', ')']; + _this_1.mathspeakTemplate = ['StartRoot,', ', EndRoot']; + _this_1.ariaLabel = 'root'; + return _this_1; + } + SquareRoot.prototype.parser = function () { + return latexMathParser.optBlock + .then(function (optBlock) { + return latexMathParser.block.map(function (block) { + var nthroot = new NthRoot(); + nthroot.blocks = [optBlock, block]; + optBlock.adopt(nthroot, 0, 0); + block.adopt(nthroot, optBlock, 0); + return nthroot; + }); + }) + .or(_super.prototype.parser.call(this)); + }; + return SquareRoot; + }(MathCommand)); + LatexCmds.sqrt = SquareRoot; + LatexCmds.hat = /** @class */ (function (_super) { + __extends(Hat, _super); + function Hat() { + var _this_1 = _super !== null && _super.apply(this, arguments) || this; + _this_1.ctrlSeq = '\\hat'; + _this_1.domView = new DOMView(1, function (blocks) { + return h('span', { class: 'dcg-mq-non-leaf' }, [ + h('span', { class: 'dcg-mq-hat-prefix' }, [h.text('^')]), + h.block('span', { class: 'dcg-mq-hat-stem' }, blocks[0]), + ]); + }); + _this_1.textTemplate = ['hat(', ')']; + return _this_1; + } + return Hat; + }(MathCommand)); + var NthRoot = /** @class */ (function (_super) { + __extends(NthRoot, _super); + function NthRoot() { + var _this_1 = _super !== null && _super.apply(this, arguments) || this; + _this_1.domView = new DOMView(2, function (blocks) { + return h('span', { class: 'dcg-mq-nthroot-container dcg-mq-non-leaf' }, [ + h.block('sup', { class: 'dcg-mq-nthroot dcg-mq-non-leaf' }, blocks[0]), + h('span', { class: 'dcg-mq-scaled dcg-mq-sqrt-container' }, [ + h('span', { class: 'dcg-mq-sqrt-prefix dcg-mq-scaled' }, [ + SVG_SYMBOLS.sqrt.html(), + ]), + h.block('span', { class: 'dcg-mq-sqrt-stem dcg-mq-non-leaf' }, blocks[1]), + ]), + ]); + }); + _this_1.textTemplate = ['sqrt[', '](', ')']; + return _this_1; + } + NthRoot.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += '\\sqrt['; + this.getEnd(L).latexRecursive(ctx); + ctx.latex += ']{'; + this.getEnd(R).latexRecursive(ctx); + ctx.latex += '}'; + this.checkCursorContextClose(ctx); + }; + NthRoot.prototype.mathspeak = function () { + var indexMathspeak = this.getEnd(L).mathspeak(); + var radicandMathspeak = this.getEnd(R).mathspeak(); + this.getEnd(L).ariaLabel = 'Index'; + this.getEnd(R).ariaLabel = 'Radicand'; + if (indexMathspeak === '3') { + // cube root + return 'Start Cube Root, ' + radicandMathspeak + ', End Cube Root'; + } + else { + return ('Root Index ' + + indexMathspeak + + ', Start Root, ' + + radicandMathspeak + + ', End Root'); + } + }; + return NthRoot; + }(SquareRoot)); + LatexCmds.nthroot = NthRoot; + LatexCmds.cbrt = /** @class */ (function (_super) { + __extends(class_13, _super); + function class_13() { + return _super !== null && _super.apply(this, arguments) || this; + } + class_13.prototype.createLeftOf = function (cursor) { + _super.prototype.createLeftOf.call(this, cursor); + new Digit('3').createLeftOf(cursor); + cursor.controller.moveRight(); + }; + return class_13; + }(NthRoot)); + var DiacriticAbove = /** @class */ (function (_super) { + __extends(DiacriticAbove, _super); + function DiacriticAbove(ctrlSeq, html, textTemplate) { + var _this_1 = this; + var domView = new DOMView(1, function (blocks) { + return h('span', { class: 'dcg-mq-non-leaf' }, [ + h('span', { class: 'dcg-mq-diacritic-above' }, [html]), + h.block('span', { class: 'dcg-mq-diacritic-stem' }, blocks[0]), + ]); + }); + _this_1 = _super.call(this, ctrlSeq, domView, textTemplate) || this; + return _this_1; + } + return DiacriticAbove; + }(MathCommand)); + LatexCmds.vec = function () { + return new DiacriticAbove('\\vec', h.entityText('→'), ['vec(', ')']); + }; + LatexCmds.tilde = function () { + return new DiacriticAbove('\\tilde', h.text('~'), ['tilde(', ')']); + }; + var DelimsNode = /** @class */ (function (_super) { + __extends(DelimsNode, _super); + function DelimsNode() { + return _super !== null && _super.apply(this, arguments) || this; + } + DelimsNode.prototype.setDOM = function (el) { + var _c; + _super.prototype.setDOM.call(this, el); + var children = this.domFrag().children(); + if (!children.isEmpty()) { + this.delimFrags = (_c = {}, + _c[L] = children.first(), + _c[R] = children.last(), + _c); + } + return this; + }; + return DelimsNode; + }(MathCommand)); + // Round/Square/Curly/Angle Brackets (aka Parens/Brackets/Braces) + // first typed as one-sided bracket with matching "ghost" bracket at + // far end of current block, until you type an opposing one + var Bracket = /** @class */ (function (_super) { + __extends(Bracket, _super); + function Bracket(side, open, close, ctrlSeq, end) { + var _c; + var _this_1 = _super.call(this, '\\left' + ctrlSeq, undefined, [open, close]) || this; + _this_1.side = side; + _this_1.sides = (_c = {}, + _c[L] = { ch: open, ctrlSeq: ctrlSeq }, + _c[R] = { ch: close, ctrlSeq: end }, + _c); + return _this_1; + } + Bracket.prototype.numBlocks = function () { + return 1; + }; + Bracket.prototype.html = function () { + var _this_1 = this; + var leftSymbol = this.getSymbol(L); + var rightSymbol = this.getSymbol(R); + // wait until now so that .side may + this.domView = new DOMView(1, function (blocks) { + return h( + // be set by createLeftOf or parser + 'span', { class: 'dcg-mq-non-leaf dcg-mq-bracket-container' }, [ + h('span', { + style: 'width:' + leftSymbol.width, + class: 'dcg-mq-scaled dcg-mq-bracket-l dcg-mq-paren' + + (_this_1.side === R ? ' dcg-mq-ghost' : ''), + }, [leftSymbol.html()]), + h.block('span', { + style: 'margin-left:' + + leftSymbol.width + + ';margin-right:' + + rightSymbol.width, + class: 'dcg-mq-bracket-middle dcg-mq-non-leaf', + }, blocks[0]), + h('span', { + style: 'width:' + rightSymbol.width, + class: 'dcg-mq-scaled dcg-mq-bracket-r dcg-mq-paren' + + (_this_1.side === L ? ' dcg-mq-ghost' : ''), + }, [rightSymbol.html()]), + ]); + }); + return _super.prototype.html.call(this); + }; + Bracket.prototype.getSymbol = function (side) { + var ch = this.sides[side || R].ch; + return SVG_SYMBOLS[ch] || { width: '0', html: '' }; + }; + Bracket.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += '\\left' + this.sides[L].ctrlSeq; + this.getEnd(L).latexRecursive(ctx); + ctx.latex += '\\right' + this.sides[R].ctrlSeq; + this.checkCursorContextClose(ctx); + }; + Bracket.prototype.mathspeak = function (opts) { + var open = this.sides[L].ch, close = this.sides[R].ch; + if (open === '|' && close === '|') { + this.mathspeakTemplate = ['StartAbsoluteValue,', ', EndAbsoluteValue']; + this.ariaLabel = 'absolute value'; + } + else if (opts && opts.createdLeftOf && this.side) { + var ch = ''; + if (this.side === L) + ch = this.textTemplate[0]; + else if (this.side === R) + ch = this.textTemplate[1]; + return ((this.side === L ? 'left ' : 'right ') + + BRACKET_NAMES[ch]); + } + else { + this.mathspeakTemplate = [ + 'left ' + BRACKET_NAMES[open] + ',', + ', right ' + BRACKET_NAMES[close], + ]; + this.ariaLabel = + BRACKET_NAMES[open] + ' block'; + } + return _super.prototype.mathspeak.call(this); + }; + Bracket.prototype.matchBrack = function (opts, expectedSide, node) { + // return node iff it's a matching 1-sided bracket of expected side (if any) + return (node instanceof Bracket && + node.side && + node.side !== -expectedSide && + (!opts.restrictMismatchedBrackets || + OPP_BRACKS[this.sides[this.side].ch] === node.sides[node.side].ch || + { '(': ']', '[': ')' }[this.sides[L].ch] === node.sides[R].ch) && + node); + }; + Bracket.prototype.closeOpposing = function (brack) { + brack.side = 0; + brack.sides[this.side] = this.sides[this.side]; // copy over my info (may be + var brackFrag = brack.delimFrags[this.side === L ? L : R] // mismatched, like [a, b)) + .removeClass('dcg-mq-ghost'); + this.replaceBracket(brackFrag, this.side); + }; + Bracket.prototype.createLeftOf = function (cursor) { + var brack; + if (!this.replacedFragment) { + // unless wrapping seln in brackets, + // check if next to or inside an opposing one-sided bracket + var opts = cursor.options; + if (this.sides[L].ch === '|') { + // check both sides if I'm a pipe + brack = + this.matchBrack(opts, R, cursor[R]) || + this.matchBrack(opts, L, cursor[L]) || + this.matchBrack(opts, 0, cursor.parent.parent); + } + else { + brack = + this.matchBrack(opts, -this.side, cursor[-this.side]) || + this.matchBrack(opts, -this.side, cursor.parent.parent); + } + } + if (brack) { + var side = (this.side = -brack.side); // may be pipe with .side not yet set + this.closeOpposing(brack); + if (brack === cursor.parent.parent && cursor[side]) { + // move the stuff between + new Fragment(cursor[side], cursor.parent.getEnd(side), -side) // me and ghost outside + .disown() + .withDirAdopt(-side, brack.parent, brack, brack[side]) + .domFrag() + .insDirOf(side, brack.domFrag()); + } + brack.bubble(function (node) { + node.reflow(); + return undefined; + }); + } + else { + (brack = this), (side = brack.side); + if (brack.replacedFragment) + brack.side = 0; + // wrapping seln, don't be one-sided + else if (cursor[-side]) { + // elsewise, auto-expand so ghost is at far end + brack.replaces(new Fragment(cursor[-side], cursor.parent.getEnd(-side), side)); + cursor[-side] = 0; + } + _super.prototype.createLeftOf.call(this, cursor); + } + if (side === L) + cursor.insAtLeftEnd(brack.getEnd(L)); + else + cursor.insRightOf(brack); + }; + Bracket.prototype.placeCursor = function () { }; + Bracket.prototype.unwrap = function () { + this.getEnd(L) + .children() + .disown() + .adopt(this.parent, this, this[R]) + .domFrag() + .insertAfter(this.domFrag()); + this.remove(); + }; + Bracket.prototype.deleteSide = function (side, outward, cursor) { + var parent = this.parent, sib = this[side], farEnd = parent.getEnd(side); + if (side === this.side) { + // deleting non-ghost of one-sided bracket, unwrap + this.unwrap(); + sib + ? cursor.insDirOf(-side, sib) + : cursor.insAtDirEnd(side, parent); + return; + } + var opts = cursor.options, wasSolid = !this.side; + this.side = -side; + // if deleting like, outer close-brace of [(1+2)+3} where inner open-paren + if (this.matchBrack(opts, side, this.getEnd(L).getEnd(this.side))) { + // is ghost, + this.closeOpposing(this.getEnd(L).getEnd(this.side)); // then become [1+2)+3 + var origEnd = this.getEnd(L).getEnd(side); + this.unwrap(); + if (origEnd) + origEnd.siblingCreated(cursor.options, side); + if (sib) { + cursor.insDirOf(-side, sib); + } + else { + cursor.insAtDirEnd(side, parent); + } + } + else { + // if deleting like, inner close-brace of ([1+2}+3) where outer + if (this.matchBrack(opts, side, this.parent.parent)) { + // open-paren is + this.parent.parent.closeOpposing(this); // ghost, then become [1+2+3) + this.parent.parent.unwrap(); + } // else if deleting outward from a solid pair, unwrap + else if (outward && wasSolid) { + this.unwrap(); + sib + ? cursor.insDirOf(-side, sib) + : cursor.insAtDirEnd(side, parent); + return; + } + else { + // else deleting just one of a pair of brackets, become one-sided + this.sides[side] = getOppBracketSide(this); + this.delimFrags[L].removeClass('dcg-mq-ghost'); + this.delimFrags[R].removeClass('dcg-mq-ghost'); + var brackFrag = this.delimFrags[side].addClass('dcg-mq-ghost'); + this.replaceBracket(brackFrag, side); + } + if (sib) { + // auto-expand so ghost is at far end + var leftEnd = this.getEnd(L); + var origEnd = leftEnd.getEnd(side); + leftEnd.domFrag().removeClass('dcg-mq-empty'); + new Fragment(sib, farEnd, -side) + .disown() + .withDirAdopt(-side, leftEnd, origEnd, 0) + .domFrag() + .insAtDirEnd(side, leftEnd.domFrag().oneElement()); + if (origEnd) + origEnd.siblingCreated(cursor.options, side); + cursor.insDirOf(-side, sib); + } // didn't auto-expand, cursor goes just outside or just inside parens + else + outward + ? cursor.insDirOf(side, this) + : cursor.insAtDirEnd(side, this.getEnd(L)); + } + }; + Bracket.prototype.replaceBracket = function (brackFrag, side) { + var symbol = this.getSymbol(side); + brackFrag.children().replaceWith(domFrag(symbol.html())); + brackFrag.oneElement().style.width = symbol.width; + if (side === L) { + var next = brackFrag.next(); + if (!next.isEmpty()) { + next.oneElement().style.marginLeft = symbol.width; + } + } + else { + var prev = brackFrag.prev(); + if (!prev.isEmpty()) { + prev.oneElement().style.marginRight = symbol.width; + } + } + }; + Bracket.prototype.deleteTowards = function (dir, cursor) { + this.deleteSide(-dir, false, cursor); + }; + Bracket.prototype.finalizeTree = function () { + this.getEnd(L).deleteOutOf = function (dir, cursor) { + this.parent.deleteSide(dir, true, cursor); + }; + // FIXME HACK: after initial creation/insertion, finalizeTree would only be + // called if the paren is selected and replaced, e.g. by LiveFraction + this.finalizeTree = this.intentionalBlur = function () { + this.delimFrags[this.side === L ? R : L].removeClass('dcg-mq-ghost'); + this.side = 0; + }; + }; + Bracket.prototype.siblingCreated = function (_opts, dir) { + // if something typed between ghost and far + if (dir === -this.side) + this.finalizeTree(); // end of its block, solidify + }; + return Bracket; + }(DelimsNode)); + function getOppBracketSide(bracket) { + var side = bracket.side; + var data = bracket.sides[side]; + return { + ch: OPP_BRACKS[data.ch], + ctrlSeq: OPP_BRACKS[data.ctrlSeq], + }; + } + var OPP_BRACKS = { + '(': ')', + ')': '(', + '[': ']', + ']': '[', + '{': '}', + '}': '{', + '\\{': '\\}', + '\\}': '\\{', + '⟨': '⟩', + '⟩': '⟨', + '\\langle ': '\\rangle ', + '\\rangle ': '\\langle ', + '|': '|', + '\\lVert ': '\\rVert ', + '\\rVert ': '\\lVert ', + }; + var BRACKET_NAMES = { + '⟨': 'angle-bracket', + '⟩': 'angle-bracket', + '|': 'pipe', + }; + function bindCharBracketPair(open, ctrlSeq, name) { + var ctrlSeq = ctrlSeq || open; + var close = OPP_BRACKS[open]; + var end = OPP_BRACKS[ctrlSeq]; + CharCmds[open] = function () { return new Bracket(L, open, close, ctrlSeq, end); }; + CharCmds[close] = function () { return new Bracket(R, open, close, ctrlSeq, end); }; + BRACKET_NAMES[open] = BRACKET_NAMES[close] = name; + } + bindCharBracketPair('(', '', 'parenthesis'); + bindCharBracketPair('[', '', 'bracket'); + bindCharBracketPair('{', '\\{', 'brace'); + LatexCmds.langle = function () { + return new Bracket(L, '⟨', '⟩', '\\langle ', '\\rangle '); + }; + LatexCmds.rangle = function () { + return new Bracket(R, '⟨', '⟩', '\\langle ', '\\rangle '); + }; + CharCmds['|'] = function () { return new Bracket(L, '|', '|', '|', '|'); }; + LatexCmds.lVert = function () { + return new Bracket(L, '∥', '∥', '\\lVert ', '\\rVert '); + }; + LatexCmds.rVert = function () { + return new Bracket(R, '∥', '∥', '\\lVert ', '\\rVert '); + }; + LatexCmds.left = /** @class */ (function (_super) { + __extends(left, _super); + function left() { + return _super !== null && _super.apply(this, arguments) || this; + } + left.prototype.parser = function () { + var regex = Parser.regex; + var string = Parser.string; + var optWhitespace = Parser.optWhitespace; + return optWhitespace + .then(regex(/^(?:[([|]|\\\{|\\langle(?![a-zA-Z])|\\lVert(?![a-zA-Z]))/)) + .then(function (ctrlSeq) { + var open = ctrlSeq.replace(/^\\/, ''); + if (ctrlSeq == '\\langle') { + open = '⟨'; + ctrlSeq = ctrlSeq + ' '; + } + if (ctrlSeq == '\\lVert') { + open = '∥'; + ctrlSeq = ctrlSeq + ' '; + } + return latexMathParser.then(function (block) { + return string('\\right') + .skip(optWhitespace) + .then(regex(/^(?:[\])|]|\\\}|\\rangle(?![a-zA-Z])|\\rVert(?![a-zA-Z]))/)) + .map(function (end) { + var close = end.replace(/^\\/, ''); + if (end == '\\rangle') { + close = '⟩'; + end = end + ' '; + } + if (end == '\\rVert') { + close = '∥'; + end = end + ' '; + } + var cmd = new Bracket(0, open, close, ctrlSeq, end); + cmd.blocks = [block]; + block.adopt(cmd, 0, 0); + return cmd; + }); + }); + }); + }; + return left; + }(MathCommand)); + LatexCmds.right = /** @class */ (function (_super) { + __extends(right, _super); + function right() { + return _super !== null && _super.apply(this, arguments) || this; + } + right.prototype.parser = function () { + return Parser.fail('unmatched \\right'); + }; + return right; + }(MathCommand)); + var leftBinomialSymbol = SVG_SYMBOLS['(']; + var rightBinomialSymbol = SVG_SYMBOLS[')']; + var Binomial = /** @class */ (function (_super) { + __extends(Binomial, _super); + function Binomial() { + var _this_1 = _super !== null && _super.apply(this, arguments) || this; + _this_1.ctrlSeq = '\\binom'; + _this_1.domView = new DOMView(2, function (blocks) { + return h('span', { class: 'dcg-mq-non-leaf dcg-mq-bracket-container' }, [ + h('span', { + style: 'width:' + leftBinomialSymbol.width, + class: 'dcg-mq-paren dcg-mq-bracket-l dcg-mq-scaled', + }, [leftBinomialSymbol.html()]), + h('span', { + style: 'margin-left:' + + leftBinomialSymbol.width + + '; margin-right:' + + rightBinomialSymbol.width, + class: 'dcg-mq-non-leaf dcg-mq-bracket-middle', + }, [ + h('span', { class: 'dcg-mq-array dcg-mq-non-leaf' }, [ + h.block('span', {}, blocks[0]), + h.block('span', {}, blocks[1]), + ]), + ]), + h('span', { + style: 'width:' + rightBinomialSymbol.width, + class: 'dcg-mq-paren dcg-mq-bracket-r dcg-mq-scaled', + }, [rightBinomialSymbol.html()]), + ]); + }); + _this_1.textTemplate = ['choose(', ',', ')']; + _this_1.mathspeakTemplate = ['StartBinomial,', 'Choose', ', EndBinomial']; + _this_1.ariaLabel = 'binomial'; + return _this_1; + } + return Binomial; + }(DelimsNode)); + LatexCmds.binom = LatexCmds.binomial = Binomial; + LatexCmds.choose = /** @class */ (function (_super) { + __extends(class_14, _super); + function class_14() { + return _super !== null && _super.apply(this, arguments) || this; + } + class_14.prototype.createLeftOf = function (cursor) { + LiveFraction.prototype.createLeftOf(cursor); + }; + return class_14; + }(Binomial)); + var MathFieldNode = /** @class */ (function (_super) { + __extends(MathFieldNode, _super); + function MathFieldNode() { + var _this_1 = _super !== null && _super.apply(this, arguments) || this; + _this_1.ctrlSeq = '\\MathQuillMathField'; + _this_1.domView = new DOMView(1, function (blocks) { + return h('span', { class: 'dcg-mq-editable-field' }, [ + h.block('span', { class: 'dcg-mq-root-block', 'aria-hidden': 'true' }, blocks[0]), + ]); + }); + return _this_1; + } + MathFieldNode.prototype.parser = function () { + var self = this, string = Parser.string, regex = Parser.regex, succeed = Parser.succeed; + return string('[') + .then(regex(/^[a-z][a-z0-9]*/i)) + .skip(string(']')) + .map(function (name) { + self.name = name; + }) + .or(succeed(undefined)) + .then(_super.prototype.parser.call(this)); + }; + MathFieldNode.prototype.finalizeTree = function (options) { + var ctrlr = new Controller(this.getEnd(L), this.domFrag().oneElement(), options); + ctrlr.KIND_OF_MQ = 'MathField'; + ctrlr.editable = true; + ctrlr.createTextarea(); + ctrlr.editablesTextareaEvents(); + ctrlr.cursor.insAtRightEnd(ctrlr.root); + RootBlockMixin(ctrlr.root); + // MathQuill applies aria-hidden to .dcg-mq-root-block containers + // because these contain math notation that screen readers can't + // interpret directly. MathQuill use an aria-live region as a + // sibling of these block containers to provide an alternative + // representation for screen readers + // + // MathFieldNodes have their own focusable text aria and aria live + // region, so it is incorrect for any parent of the editable field + // to have an aria-hidden property + // + // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden + // + // Handle this by recursively walking the parents of this element + // until we hit a root block, and if we hit any parent with + // aria-hidden="true", removing the property from the parent and + // pushing it down to each of the parents children. This should + // result in no parent of this node having aria-hidden="true", but + // should keep as much of what was previously hidden hidden as + // possible while obeying this constraint + function pushDownAriaHidden(node) { + if (node.parentNode && !domFrag(node).hasClass('dcg-mq-root-block')) { + pushDownAriaHidden(node.parentNode); + } + if (node.nodeType === Node.ELEMENT_NODE) { + var element = node; + if (element.getAttribute('aria-hidden') === 'true') { + element.removeAttribute('aria-hidden'); + domFrag(node) + .children() + .eachElement(function (child) { + child.setAttribute('aria-hidden', 'true'); + }); + } + } + } + pushDownAriaHidden(this.domFrag().parent().oneElement()); + this.domFrag().oneElement().removeAttribute('aria-hidden'); + }; + MathFieldNode.prototype.registerInnerField = function (innerFields, MathField) { + var controller = this.getEnd(L).controller; + var newField = new MathField(controller); + innerFields[this.name] = newField; + innerFields.push(newField); + }; + MathFieldNode.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + this.getEnd(L).latexRecursive(ctx); + this.checkCursorContextClose(ctx); + }; + MathFieldNode.prototype.text = function () { + return this.getEnd(L).text(); + }; + return MathFieldNode; + }(MathCommand)); + LatexCmds.editable = LatexCmds.MathQuillMathField = MathFieldNode; // backcompat with before cfd3620 on #233 + // Embed arbitrary things + // Probably the closest DOM analogue would be an iframe? + // From MathQuill's perspective, it's a MQSymbol, it can be + // anywhere and the cursor can go around it but never in it. + // Create by calling public API method .dropEmbedded(), + // or by calling the global public API method .registerEmbed() + // and rendering LaTeX like \embed{registeredName} (see test). + var EmbedNode = /** @class */ (function (_super) { + __extends(EmbedNode, _super); + function EmbedNode() { + return _super !== null && _super.apply(this, arguments) || this; + } + EmbedNode.prototype.setOptions = function (options) { + function noop() { + return ''; + } + this.text = options.text || noop; + this.domView = new DOMView(0, function () { + return h('span', {}, [parseHTML(options.htmlString || '')]); + }); + this.latex = options.latex || noop; + return this; + }; + EmbedNode.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += this.latex(); + this.checkCursorContextClose(ctx); + }; + EmbedNode.prototype.parser = function () { + var self = this, string = Parser.string, regex = Parser.regex, succeed = Parser.succeed; + return string('{') + .then(regex(/^[a-z][a-z0-9]*/i)) + .skip(string('}')) + .then(function (name) { + // the chars allowed in the optional data block are arbitrary other than + // excluding curly braces and square brackets (which'd be too confusing) + return string('[') + .then(regex(/^[-\w\s]*/)) + .skip(string(']')) + .or(succeed(undefined)) + .map(function (data) { + return self.setOptions(EMBEDS[name](data)); + }); + }); + }; + return EmbedNode; + }(MQSymbol)); + LatexCmds.embed = EmbedNode; + /**************************************** + * Input box to type backslash commands + ***************************************/ + CharCmds['\\'] = /** @class */ (function (_super) { + __extends(LatexCommandInput, _super); + function LatexCommandInput() { + var _this_1 = _super !== null && _super.apply(this, arguments) || this; + _this_1.ctrlSeq = '\\'; + _this_1.domView = new DOMView(1, function (blocks) { + return h('span', { class: 'dcg-mq-latex-command-input-wrapper dcg-mq-non-leaf' }, [ + h('span', { class: 'dcg-mq-latex-command-input dcg-mq-non-leaf' }, [ + h.text('\\'), + h.block('span', {}, blocks[0]), + ]), + ]); + }); + _this_1.textTemplate = ['\\']; + return _this_1; + } + LatexCommandInput.prototype.replaces = function (replacedFragment) { + this._replacedFragment = replacedFragment.disown(); + this.isEmpty = function () { + return false; + }; + }; + LatexCommandInput.prototype.createBlocks = function () { + _super.prototype.createBlocks.call(this); + var endsL = this.getEnd(L); + endsL.focus = function () { + this.parent.domFrag().addClass('dcg-mq-hasCursor'); + if (this.isEmpty()) + this.parent.domFrag().removeClass('dcg-mq-empty'); + return this; + }; + endsL.blur = function () { + this.parent.domFrag().removeClass('dcg-mq-hasCursor'); + if (this.isEmpty()) + this.parent.domFrag().addClass('dcg-mq-empty'); + return this; + }; + endsL.write = function (cursor, ch) { + cursor.show().deleteSelection(); + if (ch.match(/[a-z]/i)) { + new VanillaSymbol(ch).createLeftOf(cursor); + // TODO needs tests + cursor.controller.aria.alert(ch); + } + else { + var cmd = this.parent.renderCommand(cursor); + // TODO needs tests + cursor.controller.aria.queue(cmd.mathspeak({ createdLeftOf: cursor })); + if (ch !== '\\' || !this.isEmpty()) + cursor.parent.write(cursor, ch); + else + cursor.controller.aria.alert(); + } + }; + var originalKeystroke = endsL.keystroke; + endsL.keystroke = function (key, e, ctrlr) { + if (key === 'Tab' || key === 'Enter' || key === 'Spacebar') { + var cmd = this.parent.renderCommand(ctrlr.cursor); + // TODO needs tests + ctrlr.aria.alert(cmd.mathspeak({ createdLeftOf: ctrlr.cursor })); + e === null || e === void 0 ? void 0 : e.preventDefault(); + return; + } + return originalKeystroke.call(this, key, e, ctrlr); + }; + }; + LatexCommandInput.prototype.createLeftOf = function (cursor) { + _super.prototype.createLeftOf.call(this, cursor); + if (this._replacedFragment) { + var frag = this.domFrag(); + var el_1 = frag.oneElement(); + this._replacedFragment.domFrag().addClass('dcg-mq-blur'); + //FIXME: is monkey-patching the mousedown and mousemove handlers the right way to do this? + var rewriteMousedownEventTarget = function (e) { + { + // TODO - overwritting e.target + e.target = el_1; + el_1.dispatchEvent(e); + return false; + } + }; + el_1.addEventListener('mousedown', rewriteMousedownEventTarget); + el_1.addEventListener('mouseup', rewriteMousedownEventTarget); + this._replacedFragment.domFrag().insertBefore(frag.children().first()); + } + }; + LatexCommandInput.prototype.latexRecursive = function (ctx) { + this.checkCursorContextOpen(ctx); + ctx.latex += '\\'; + this.getEnd(L).latexRecursive(ctx); + ctx.latex += ' '; + this.checkCursorContextClose(ctx); + }; + LatexCommandInput.prototype.renderCommand = function (cursor) { + this.setDOM(this.domFrag().children().lastElement()); + this.remove(); + if (this[R]) { + cursor.insLeftOf(this[R]); + } + else { + cursor.insAtRightEnd(this.parent); + } + var latex = this.getEnd(L).latex(); + if (!latex) + latex = ' '; + var cmd = LatexCmds[latex]; + if (cmd) { + //console.log(cmd); + var node = void 0; + if (isMQNodeClass(cmd)) { + node = new cmd(latex); + } + else { + node = cmd(latex); + } + if (this._replacedFragment) + node.replaces(this._replacedFragment); + node.createLeftOf(cursor); + return node; + } + else { + var node = new TextBlock(); + node.replaces(latex); + node.createLeftOf(cursor); + cursor.insRightOf(node); + if (this._replacedFragment) { + this._replacedFragment.remove(); + } + return node; + } + }; + return LatexCommandInput; + }(MathCommand)); + // For backwards compatibility, set up the global MathQuill object as an instance of API interface v1 + if (window.jQuery) { + MQ1 = getInterface(1); + for (var key in MQ1) + (function (key, val) { + if (typeof val === 'function') { + MathQuill[key] = function () { + insistOnInterVer(); + return val.apply(this, arguments); + }; + MathQuill[key].prototype = val.prototype; + } + else + MathQuill[key] = val; + })(key, MQ1[key]); + } + //console.log(MathQuill); +} diff --git a/src/extend_mathquill.ts b/src/extend_mathquill.ts deleted file mode 100644 index 5102ae0..0000000 --- a/src/extend_mathquill.ts +++ /dev/null @@ -1,8861 +0,0 @@ -// // @ts-nocheck -// /* eslint-disable */ -// export default function extendMathQuill() { -// var __extends = -// (this && this.__extends) || -// (function () { -// var t = function (e, n) { -// return (t = -// Object.setPrototypeOf || -// ({ __proto__: [] } instanceof Array && -// function (t, e) { -// t.__proto__ = e; -// }) || -// function (t, e) { -// for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); -// })(e, n); -// }; -// return function (e, n) { -// if ('function' != typeof n && null !== n) -// throw new TypeError('Class extends value ' + String(n) + ' is not a constructor or null'); -// function r() { -// this.constructor = e; -// } -// t(e, n), (e.prototype = null === n ? Object.create(n) : ((r.prototype = n.prototype), new r())); -// }; -// })(), -// __assign = -// (this && this.__assign) || -// function () { -// return (__assign = -// Object.assign || -// function (t) { -// for (var e, n = 1, r = arguments.length; n < r; n++) -// for (var i in (e = arguments[n])) -// Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); -// return t; -// }).apply(this, arguments); -// }; -// (function () { -// var L = -1; -// var R = 1; -// var min = Math.min; -// var max = Math.max; -// function noop() {} -// /** -// * a development-only debug method. This definition and all -// * calls to `pray` will be stripped from the minified -// * build of mathquill. -// * -// * This function must be called by name to be removed -// * at compile time. Do not define another function -// * with the same name, and only call this function by -// * name. -// */ -// function pray(message, cond) { -// if (!cond) throw new Error('prayer failed: ' + message); -// } -// function prayDirection(dir) { -// pray('a direction was passed', dir === L || dir === R); -// } -// var urlParams = new URLSearchParams(window.location.search); -// function parseHTML(s) { -// // https://youmightnotneedjquery.com/#parse_html -// var tmp = document.implementation.createHTMLDocument(''); -// tmp.body.innerHTML = s; -// if (tmp.body.children.length === 1) return tmp.body.children[0]; -// var frag = document.createDocumentFragment(); -// while (tmp.body.firstChild) { -// frag.appendChild(tmp.body.firstChild); -// } -// return frag; -// } -// var h = function h(type, attributes, children) { -// var el; -// switch (type) { -// case 'svg': -// case 'path': -// el = document.createElementNS('http://www.w3.org/2000/svg', type); -// break; -// default: -// el = document.createElement(type); -// } -// for (var key_1 in attributes) { -// var value = attributes[key_1]; -// if (value === undefined) continue; -// el.setAttribute(key_1, typeof value === 'string' ? value : String(value)); -// } -// if (children) { -// for (var i = 0; i < children.length; i++) { -// el.appendChild(children[i]); -// } -// } -// return el; -// }; -// h.text = function (s) { -// return document.createTextNode(s); -// }; -// h.block = function (type, attributes, block) { -// var out = h(type, attributes, [block.html()]); -// block.setDOM(out); -// NodeBase.linkElementByBlockNode(out, block); -// return out; -// }; -// h.entityText = function (s) { -// // TODO: replace with h.text(U_BLAHBLAH) or maybe a named entity->unicode lookup -// var val = parseHTML(s); -// pray( -// 'entity parses to a single text node', -// val instanceof DocumentFragment && val.childNodes.length === 1 && val.childNodes[0] instanceof Text -// ); -// return val.childNodes[0]; -// }; -// function closest(el, s) { -// var _a, _b, _c; -// if (typeof ((_a = el) === null || _a === void 0 ? void 0 : _a.closest) === 'function') { -// return el.closest(s); -// } -// if (!(el instanceof HTMLElement)) return null; -// // https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#polyfill -// var matches = -// Element.prototype.matches || -// Element.prototype.msMatchesSelector || -// Element.prototype.webkitMatchesSelector; -// var match = el; -// do { -// if (matches.call(match, s)) return match; -// match = -// (_c = -// (_b = match === null || match === void 0 ? void 0 : match.parentElement) !== null && -// _b !== void 0 -// ? _b -// : match === null || match === void 0 -// ? void 0 -// : match.parentNode) !== null && _c !== void 0 -// ? _c -// : null; -// } while (match !== null && match.nodeType === 1); -// return null; -// } -// var U_NO_BREAK_SPACE = '\u00A0'; -// var U_ZERO_WIDTH_SPACE = '\u200B'; -// var U_DOT_ABOVE = '\u02D9'; -// var U_NARY_SUMMATION = '\u2211'; -// var U_NARY_PRODUCT = '\u220F'; -// var U_NARY_COPRODUCT = '\u2210'; -// var U_INTEGRAL = '\u222B'; -// /** -// * Like `el.getBoundingClientRect()` but avoids throwing for -// * disconnected and hidden elements in IE <= 11. -// * */ -// function getBoundingClientRect(el) { -// // Return zeros for disconnected and hidden (display: none) elements -// // Running getBoundingClientRect on a disconnected node in IE <=11 throws an error -// // https://github.com/jquery/jquery/blob/a684e6ba836f7c553968d7d026ed7941e1a612d8/src/offset.js#L83-L86 -// if (!el.getClientRects().length) { -// return { -// top: 0, -// left: 0, -// height: 0, -// width: 0, -// x: 0, -// y: 0, -// bottom: 0, -// right: 0, -// }; -// } -// return el.getBoundingClientRect(); -// } -// /** -// * Returns the number of pixels that the document is currently scrolled -// * horizontally -- `window.scrollX` in modern browsers. -// * */ -// function getScrollX() { -// // In IE9, scrollX was called pageXOffset -// // Previous versions of IE had neither property and use scrollLeft instead -// // -// // https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX#notes -// return window.pageXOffset !== undefined -// ? window.pageXOffset -// : (document.documentElement || document.body.parentNode || document.body).scrollLeft; -// } -// /** -// * Returns the number of pixels that the document is currently scrolled -// * vertically -- `window.scrollY` in modern browsers. -// * */ -// function getScrollY() { -// // In IE9, scrollY was called pageYOffset -// // Previous versions of IE had neither property and use scrollTop instead -// // -// // https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX#notes -// return window.pageYOffset !== undefined -// ? window.pageYOffset -// : (document.documentElement || document.body.parentNode || document.body).scrollTop; -// } -// /** -// * Given `duration` in ms and callback `cb`, immediately calls `cb(progress, scheduleNext, cancel)` with: -// * - `progress` set to `0` if duration > 0, or 1 if duration <= 0 -// * - `scheduleNext` a function that schedules a future call to `cb` -// * - `cancel` a function that cancels any pending `scheduleNext` call. -// * -// * `scheduleNext` schedules a call to `cb` with `progress` set to the -// * ratio of currently elapsed time and `duration`. -// * -// * To continue running the animation, `cb` should call `scheduleNext`. -// * -// * To stop the animation, it is the responsibility of `cb` to check -// * whether progress is greater than or equal to 1, in which case `cb` -// * should not call `scheduleNext`. -// * -// * `scheduleNext` uses `requestAnimationFrame` if available and falls -// * back to `setTimeout(..., 13)` otherwise. Times are always based on -// * `Date.now()` for compatibility between `requestAnimationFrame` and -// * the `setTimeout` fallback. `cb` will only be called with strictly -// * monotonic `progress` values. -// * -// * Note: `animate` purposely puts a lot of responsibility on the caller -// * to keep its implementation simple because it isn't used very widely -// * in the project. -// */ -// var animate = (function () { -// // IIFE exists just to hang on to configured rafShim and cancelShim -// // functions -// var rafShim, cancelShim; -// if (typeof requestAnimationFrame === 'function' && typeof cancelAnimationFrame === 'function') { -// rafShim = requestAnimationFrame; -// cancelShim = cancelAnimationFrame; -// } else { -// rafShim = function (cb) { -// return setTimeout(cb, 13); -// }; -// cancelShim = clearTimeout; -// } -// return function (duration, cb) { -// var start = Date.now(); -// var cancelToken; -// var progress = 0; -// function step() { -// var proposedProgress = (Date.now() - start) / duration; -// // Enforce that progress is strictly monotonic -// if (proposedProgress <= progress) { -// scheduleNext(); -// } else { -// progress = proposedProgress; -// } -// cb(progress, scheduleNext, cancel); -// } -// function cancel() { -// if (cancelToken !== undefined) cancelShim(cancelToken); -// cancelToken = undefined; -// } -// function scheduleNext() { -// // Calling cancel here ensures that there are never multiple -// // concurrent callbacks scheduled for a single animation, even if -// // the caller calls `scheduleNext` multiple times in a single -// // event loop (which is always a mistake) -// cancel(); -// cancelToken = rafShim(step); -// } -// cb(duration <= 0 ? 1 : 0, scheduleNext, cancel); -// }; -// })(); -// var Aria = /** @class */ (function () { -// function Aria(controller) { -// this.span = h('span', { -// class: 'dcg-mq-aria-alert', -// 'aria-live': 'assertive', -// 'aria-atomic': 'true', -// }); -// this.msg = ''; -// this.items = []; -// this.controller = controller; -// } -// Aria.prototype.attach = function () { -// var container = this.controller.container; -// if (this.span.parentNode !== container) { -// domFrag(container).prepend(domFrag(this.span)); -// } -// }; -// Aria.prototype.queue = function (item, shouldDescribe) { -// if (shouldDescribe === void 0) { -// shouldDescribe = false; -// } -// var output = ''; -// if (item instanceof MQNode) { -// // Some constructs include verbal shorthand (such as simple fractions and exponents). -// // Since ARIA alerts relate to moving through interactive content, we don't want to use that shorthand if it exists -// // since doing so may be ambiguous or confusing. -// var itemMathspeak = item.mathspeak({ ignoreShorthand: true }); -// if (shouldDescribe) { -// // used to ensure item is described when cursor reaches block boundaries -// if (item.parent && item.parent.ariaLabel && item.ariaLabel === 'block') { -// output = item.parent.ariaLabel + ' ' + itemMathspeak; -// } else if (item.ariaLabel) { -// output = item.ariaLabel + ' ' + itemMathspeak; -// } -// } -// if (output === '') { -// output = itemMathspeak; -// } -// } else { -// output = item || ''; -// } -// this.items.push(output); -// return this; -// }; -// Aria.prototype.queueDirOf = function (dir) { -// prayDirection(dir); -// return this.queue(dir === L ? 'before' : 'after'); -// }; -// Aria.prototype.queueDirEndOf = function (dir) { -// prayDirection(dir); -// return this.queue(dir === L ? 'beginning of' : 'end of'); -// }; -// Aria.prototype.alert = function (t) { -// this.attach(); -// if (t) this.queue(t); -// if (this.items.length) { -// // To cut down on potential verbiage from multiple Mathquills firing near-simultaneous ARIA alerts, -// // update the text of this instance if its container also has keyboard focus. -// // If it does not, leave the DOM unchanged but flush the queue regardless. -// // Note: updating the msg variable regardless of focus for unit tests. -// this.msg = this.items -// .join(' ') -// .replace(/ +(?= )/g, '') -// .trim(); -// if (this.controller.containerHasFocus()) { -// this.span.textContent = this.msg; -// } -// } -// return this.clear(); -// }; -// Aria.prototype.clear = function () { -// this.items.length = 0; -// return this; -// }; -// return Aria; -// })(); -// /** -// * A `DOMFragment` represents a contiguous span of sibling DOM Nodes, -// * which may include both Element nodes and other nodes like Text and -// * Comment nodes. A `DOMFragment` may represent zero or more nodes. -// * -// * `DOMFragments` are created using the `DOMFragment.create` factory -// * function, which is also aliased as `domFrag` for convenience. -// * -// * A `DOMFragment` simply holds references to nodes. It doesn't move or -// * mutate them in the way that the native `DocumentFragment` does. -// * -// * `DOMFragment` implements many of the same methods for manipulating a -// * collection of DOM elements that jQuery does, but it has some notable -// * differences: -// * -// * 1. A jQuery collection can hold an arbitrary ordered set of DOM -// * elements, but a `DOMFragment` can only hold a contiguous span of -// * sibling nodes. -// * 2. Some jQuery DOM manipulation methods like `insert{Before,After}`, -// * `append`, `prepend`, `appendTo`, `prependTo`, etc. may insert -// * several clones of a collection into different places in the DOM. -// * `DOMFragment` never makes clones of DOM nodes--instead, when -// * targeting multi-element fragments, it moves source nodes before -// * or after the targeted fragment as appropriate without ever making -// * more copies. -// * 3. For methods like `.children()`, where it's likely to be a mistake -// * to call the method on a fragment that doesn't contain exactly one -// * node or element, `DOMFragment` will throw whereas jQuery will -// * silently do something possibly unintended. Methods that assert -// * are commented with the properties that they assert. -// * -// * Internally, `DOMFragment` holds immutable references to the left and -// * right end nodes (if the fragment is not empty). The other nodes are -// * represented implicitly through the sibling pointers of the DOM nodes -// * themselves. This means that it is possible to invalidate a -// * `DOMFragment` by moving one of its ends without moving the other in -// * such a way that they are no longer siblings. It is also possible to -// * change the contents of a `DOMFragment` by adding or removing DOM -// * nodes between its ends. -// */ -// var DOMFragment = /** @class */ (function () { -// /** -// * Constructor is private to enforce that the invariant checks in -// * `create` are applied to outside callers. Internal methods are -// * allowed to use this constructor when they can guarantee they're -// * passing sibling nodes (such as children of a parent node). -// */ -// function DOMFragment(first, last) { -// var _a; -// if (arguments.length === 1) last = first; -// if (!first || !last) return; -// this.ends = ((_a = {}), (_a[L] = first), (_a[R] = last), _a); -// } -// /** -// * Returns a `DOMFragment` representing the contiguous span of sibling -// * DOM nodes betewen `first` and `last`. If only one element is -// * passed, creates a `DOMFragment` representing that single element. -// * If no elements are passed, creates and empty `DOMFragment`. -// * -// * If two elements are passed, asserts that the second element is a -// * forward sibling of the first element. Checking this invariant is -// * O(n) in the total number of nodes in the fragment -// */ -// DOMFragment.create = function (first, last) { -// if (arguments.length === 1) last = first; -// pray('No half-empty DOMFragments', !!first === !!last); -// var out = new DOMFragment(first, last); -// pray('last is a forward sibling of first', out.isValid()); -// return out; -// }; -// DOMFragment.prototype.isEmpty = function () { -// return this.ends === undefined; -// }; -// DOMFragment.prototype.isOneNode = function () { -// return !!(this.ends && this.ends[L] === this.ends[R]); -// }; -// /** -// * Returns true if the fragment is empty or if its last node is equal -// * to its first node or is a forward sibling of its first node. -// * -// * DOMFragments may be invalidated if any of the nodes they contain -// * are moved or removed independently of the other nodes they contain. -// * -// * Note that this check visits each node in the fragment, so it is -// * O(n). -// */ -// DOMFragment.prototype.isValid = function () { -// if (!this.ends) return true; -// if (this.ends[L] === this.ends[R]) return true; -// var maybeLast; -// this.eachNode(function (el) { -// return (maybeLast = el); -// }); -// return maybeLast === this.ends[R]; -// }; -// /** -// * Return the first Node of this fragment. May be a a Node that is not -// * an Element such as a Text or Comment node. -// * -// * Asserts fragment is not empty. -// */ -// DOMFragment.prototype.firstNode = function () { -// pray('Fragment is not empty', this.ends); -// return this.ends[L]; -// }; -// /** -// * Return the last Node of this fragment. May be a a Node that is not -// * an Element such as a Text or Comment node. -// * -// * Asserts fragment is not empty. -// */ -// DOMFragment.prototype.lastNode = function () { -// pray('Fragment is not empty', this.ends); -// return this.ends[R]; -// }; -// /** -// * Return a fragment representing the children (including Text and -// * Comment nodes) of the node represented by this fragment. -// * -// * Asserts that this fragment contains exactly one Node. -// * -// * Note, because this includes text and comment nodes, this is more -// * like jQuery's .contents() than jQuery's .children() -// */ -// DOMFragment.prototype.children = function () { -// var el = this.oneNode(); -// var first = el.firstChild; -// var last = el.lastChild; -// return first && last ? new DOMFragment(first, last) : new DOMFragment(); -// }; -// /** -// * Return a new `DOMFragment` spanning this fragment and `sibling` -// * fragment. Does not perform any DOM operations. -// * -// * Asserts that `sibling` is either empty or a forward sibling of -// * this fragment that may share its first node with the last node of -// * this fragment -// */ -// DOMFragment.prototype.join = function (sibling) { -// if (!this.ends) return sibling; -// if (!sibling.ends) return this; -// // Check if sibling is actually a sibling of this span -// var found = false; -// var current = this.ends[R].nextSibling; -// while (current) { -// if (current === sibling.ends[L]) { -// found = true; -// break; -// } -// current = current.nextSibling; -// } -// pray('sibling must be a forward DOM sibling of this fragment', found); -// return new DOMFragment(this.ends[L], sibling.ends[R]); -// }; -// /** -// * Return the single DOM Node represented by this fragment. -// * -// * Asserts that this fragment contains exactly one Node. -// */ -// DOMFragment.prototype.oneNode = function () { -// pray('Fragment has a single node', this.ends && this.ends[L] === this.ends[R]); -// return this.ends[L]; -// }; -// /** -// * Return the single DOM Element represented by this fragment. -// * -// * Asserts that this fragment contains exactly one Node, and that node -// * is an Element node. -// */ -// DOMFragment.prototype.oneElement = function () { -// var el = this.oneNode(); -// pray('Node is an Element', el.nodeType === Node.ELEMENT_NODE); -// return el; -// }; -// /** -// * Return the single DOM Text node represented by this fragment. -// * -// * Asserts that this fragment contains exactly one Node, and that node -// * is a Text node. -// */ -// DOMFragment.prototype.oneText = function () { -// var el = this.oneNode(); -// pray('Node is Text', el.nodeType === Node.TEXT_NODE); -// return el; -// }; -// /** -// * Calls callback sequentially with each node in this fragment. -// * Includes nodes that are not Elements, such as Text and Comment -// * nodes. -// */ -// DOMFragment.prototype.eachNode = function (cb) { -// if (!this.ends) return this; -// var stop = this.ends[R]; -// for (var node = this.ends[L], next = void 0; node; node = next) { -// // Note, this loop is organized in a slightly tricky way in order -// // cache "next" before calling the callback. This is done because -// // the callback could mutate node.nextSibling (e.g. by moving the -// // node to a documentFragment, like toDocumentFragment does). -// // -// // It's still possible to break this iteration by messing with -// // forward siblings of node in the callback, although it's -// // probably rare to want to do that. Perhaps this means "each" is -// // too dangerous to have as a public method. -// next = node.nextSibling; -// cb(node); -// if (node === stop) break; -// } -// return this; -// }; -// /** -// * Calls callback sequentially with each Element node in this -// * fragment. Skips nodes that are not Elements, such as Text and -// * Comment nodes. -// */ -// DOMFragment.prototype.eachElement = function (cb) { -// this.eachNode(function (el) { -// if (el.nodeType === Node.ELEMENT_NODE) cb(el); -// }); -// return this; -// }; -// /** -// * Returns the concatenated text content of all of the nodes in the -// * fragment. -// */ -// DOMFragment.prototype.text = function () { -// var accum = ''; -// this.eachNode(function (node) { -// accum += node.textContent || ''; -// }); -// return accum; -// }; -// /** -// * Returns an array of all the Nodes in this fragment, including nodes -// * that are not Element nodes such as Text and Comment nodes; -// */ -// DOMFragment.prototype.toNodeArray = function () { -// var accum = []; -// this.eachNode(function (el) { -// return accum.push(el); -// }); -// return accum; -// }; -// /** -// * Returns an array of all the Element nodes in this fragment. The -// * result does not include nodes that are not Elements, such as Text -// * and Comment nodes. -// */ -// DOMFragment.prototype.toElementArray = function () { -// var accum = []; -// this.eachElement(function (el) { -// return accum.push(el); -// }); -// return accum; -// }; -// /** -// * Moves all of the nodes in this fragment into a new DocumentFragment -// * and returns it. This includes Nodes that are not Elements such as -// * Text and Comment nodes. -// */ -// DOMFragment.prototype.toDocumentFragment = function () { -// var frag = document.createDocumentFragment(); -// this.eachNode(function (el) { -// return frag.appendChild(el); -// }); -// return frag; -// }; -// /** -// * Insert all the nodes in this fragment into the DOM directly before -// * the first node of `sibling` fragment. If `sibling` is empty or does -// * not have a parent node, detaches this fragment from the document. -// * -// * Note that this behavior differs from jQuery if `sibling` is a -// * collection with multiple nodes. In that case, jQuery inserts this -// * collection before the first node in `sibling`, and then inserts a -// * clone of this collection before each additional node in the -// * `sibling` collection. DOMFragment only ever inserts this collection -// * before the first node of the sibling fragment, and never inserts -// * additional clones. -// */ -// DOMFragment.prototype.insertBefore = function (sibling) { -// return this.insDirOf(L, sibling); -// }; -// /** -// * Insert all the nodes in this fragment into the DOM directly after -// * the last node of `sibling` fragment. If `sibling` is empty or does -// * not have a parent node, detaches this fragment from the document. -// * -// * Note that this behavior differs from jQuery if `sibling` is a -// * collection with multiple nodes. In that case, jQuery inserts this -// * collection before the first node in `sibling`, and then inserts a -// * clone of this collection before each additional node in the -// * `sibling` collection. DOMFragment only ever inserts this collection -// * before the first node of the sibling fragment, and never inserts -// * additional clones. -// */ -// DOMFragment.prototype.insertAfter = function (sibling) { -// return this.insDirOf(R, sibling); -// }; -// /** -// * Append children to the node represented by this fragment. -// * -// * Asserts that this fragment contains exactly one Element. -// */ -// DOMFragment.prototype.append = function (children) { -// children.appendTo(this.oneElement()); -// return this; -// }; -// /** -// * Prepend children to the node represented by this fragment. -// * -// * Asserts that this fragment contains exactly one Element. -// */ -// DOMFragment.prototype.prepend = function (children) { -// children.prependTo(this.oneElement()); -// return this; -// }; -// /** -// * Append all the nodes in this fragment to the children of `el`. -// */ -// DOMFragment.prototype.appendTo = function (el) { -// return this.insAtDirEnd(R, el); -// }; -// /** -// * Prepend all the nodes in this fragment to the children of `el`. -// */ -// DOMFragment.prototype.prependTo = function (el) { -// return this.insAtDirEnd(L, el); -// }; -// /** -// * Return a fragment containing the parent node of the nodes in this -// * fragment. Returns an empty fragment if this fragment is empty or -// * does not have a parent node. -// */ -// DOMFragment.prototype.parent = function () { -// if (!this.ends) return this; -// var parent = this.ends[L].parentNode; -// if (!parent) return new DOMFragment(); -// return new DOMFragment(parent); -// }; -// /** -// * Replace the children of `el` with the contents of this fragment, -// * and place `el` into the DOM at the previous location of this -// * fragment. -// */ -// DOMFragment.prototype.wrapAll = function (el) { -// el.textContent = ''; // First empty the wrapping element -// if (!this.ends) return this; -// var parent = this.ends[L].parentNode; -// var next = this.ends[R].nextSibling; -// this.appendTo(el); -// if (parent) { -// parent.insertBefore(el, next); -// } -// return this; -// }; -// /** -// * Replace this fragment with the fragment given by `children`. If -// * this fragment is empty or does not have a parent node, detaches -// * `children` from the document. -// * -// * Note that this behavior differs from jQuery if this is a collection -// * with multiple nodes. In that case, jQuery replaces the first -// * element of this collection with `children`, and then replaces each -// * additional element in this collection with a clone of `children`. -// * DOMFragment replaces this entire fragment with `children` and never -// * makes additional clones of `children`. -// */ -// DOMFragment.prototype.replaceWith = function (children) { -// var _a; -// var rightEnd = (_a = this.ends) === null || _a === void 0 ? void 0 : _a[R]; -// // Note: important to cache parent and nextSibling (if they exist) -// // before detaching this fragment from the document (which will -// // mutate its parent and sibling references) -// var parent = rightEnd === null || rightEnd === void 0 ? void 0 : rightEnd.parentNode; -// var nextSibling = rightEnd === null || rightEnd === void 0 ? void 0 : rightEnd.nextSibling; -// this.detach(); -// // Note, this purposely detaches children from the document, even if -// // they can't be reinserted because this fragment is empty or has no -// // parent -// var childDocumentFragment = children.toDocumentFragment(); -// if (!rightEnd || !parent) return this; -// parent.insertBefore(childDocumentFragment, nextSibling || null); -// return this; -// }; -// /** -// * Return the nth Element node of this collection, or undefined if -// * there is no nth Element. Skips Nodes that are not Elements (e.g. -// * Text and Comment nodes). -// * -// * Analogous to jQuery's array indexing syntax, or jQuery's .get() -// * with positive arguments. -// */ -// DOMFragment.prototype.nthElement = function (n) { -// if (!this.ends) return undefined; -// if (n < 0 || n !== Math.floor(n)) return undefined; -// var current = this.ends[L]; -// while (current) { -// // Only count element nodes -// if (current.nodeType === Node.ELEMENT_NODE) { -// if (n <= 0) return current; -// n -= 1; -// } -// if (current === this.ends[R]) return undefined; -// current = current.nextSibling; -// } -// return undefined; -// }; -// /** -// * Return the first Element node of this fragment, or undefined if -// * the fragment is empty. Skips Nodes that are not Elements (e.g. -// * Text and Comment nodes). -// */ -// DOMFragment.prototype.firstElement = function () { -// return this.nthElement(0); -// }; -// /** -// * Return the first Element node of this fragment, or undefined if -// * the fragment is empty. Skips Nodes that are not Elements (e.g. -// * Text and Comment nodes). -// */ -// DOMFragment.prototype.lastElement = function () { -// if (!this.ends) return undefined; -// var current = this.ends[R]; -// while (current) { -// // Only count element nodes -// if (current.nodeType === Node.ELEMENT_NODE) { -// return current; -// } -// if (current === this.ends[L]) return undefined; -// current = current.previousSibling; -// } -// return undefined; -// }; -// /** -// * Return a new fragment holding the first Element node of this -// * fragment, or an empty fragment if this fragment is empty. Skips -// * Nodes that are not Elements (e.g. Text and Comment nodes). -// */ -// DOMFragment.prototype.first = function () { -// return new DOMFragment(this.firstElement()); -// }; -// /** -// * Return a new fragment holding the last Element node of this -// * fragment, or an empty fragment if this fragment is empty. Skips -// * Nodes that are not Elements (e.g. Text and Comment nodes). -// */ -// DOMFragment.prototype.last = function () { -// return new DOMFragment(this.lastElement()); -// }; -// /** -// * Return a new fragment holding the nth Element node of this -// * fragment, or an empty fragment if there is no nth node of this -// * fragment. Skips Nodes that are not Elements (e.g. Text and Comment -// * nodes). -// */ -// DOMFragment.prototype.eq = function (n) { -// return new DOMFragment(this.nthElement(n)); -// }; -// /** -// * Return a new fragment beginning with the nth Element node of this -// * fragment, and ending with the same end as this fragment, or an -// * empty fragment if there is no nth node in this fragment. Skips -// * Nodes that are not Elements (e.g. Text and Comment nodes). -// */ -// DOMFragment.prototype.slice = function (n) { -// // Note, would be reasonable to extend this to take a second -// // argument if we ever find we need this -// if (!this.ends) return this; -// var el = this.nthElement(n); -// if (!el) return new DOMFragment(); -// return new DOMFragment(el, this.ends[R]); -// }; -// /** -// * Return a new fragment containing the next Element after the Node -// * represented by this fragment, or an empty fragment if there is no -// * next Element. Skips Nodes that are not Elements (e.g. Text and -// * Comment nodes). -// * -// * Asserts that this fragment contains exactly one Node. -// */ -// DOMFragment.prototype.next = function () { -// var current = this.oneNode(); -// while (current) { -// current = current.nextSibling; -// if (current && current.nodeType === Node.ELEMENT_NODE) return new DOMFragment(current); -// } -// return new DOMFragment(); -// }; -// /** -// * Return a new fragment containing the previousElement after the Node -// * represented by this fragment, or an empty fragment if there is no -// * previous Element. Skips Nodes that are not Elements (e.g. Text and -// * Comment nodes). -// * -// * Asserts that this fragment contains exactly one Node. -// */ -// DOMFragment.prototype.prev = function () { -// var current = this.oneNode(); -// while (current) { -// current = current.previousSibling; -// if (current && current.nodeType === Node.ELEMENT_NODE) return new DOMFragment(current); -// } -// return new DOMFragment(); -// }; -// /** -// * Remove all children of every Element Node in the fragment. Skips -// * Nodes that are not Elements (e.g. Text and Comment nodes). -// */ -// DOMFragment.prototype.empty = function () { -// // TODO the corresponding jQuery methods clean up some internal -// // references before removing elements from the DOM. That won't -// // matter once jQuery is totally gone, but until then, this may -// // introduce memory leaks -// this.eachElement(function (el) { -// el.textContent = ''; -// }); -// return this; -// }; -// /** -// * Remove every node in the fragment from the DOM. -// * -// * Implemented by moving every node in the fragment into a new -// * document fragment in order to preserve the sibling relationships -// * of the removed element. If you want to get access to this document -// * fragment, use `.toDocumentFragment()` instead. -// */ -// DOMFragment.prototype.remove = function () { -// // TODO the corresponding jQuery methods clean up some internal -// // references before removing elements from the DOM. That won't -// // matter once jQuery is totally gone, but until then, this may -// // introduce memory leaks -// // Note, removing the elements by moving them to a document fragment -// // because this way their sibling references stay intact. This is -// // important if we want to reattach them somewhere else later -// this.toDocumentFragment(); -// return this; -// }; -// /** -// * Remove every node in the fragment from the DOM. Alias of remove. -// * -// * Implemented by moving every node in the fragment into a new -// * document fragment in order to preserve the sibling relationships -// * of the removed element. If you want to get access to this document -// * fragment, use `.toDocumentFragment()` instead. -// * -// * Note: jQuery makes a distinction between detach() and remove(). -// * remove() cleans up internal references, and detach() does not. -// */ -// DOMFragment.prototype.detach = function () { -// // In jQuery, detach() is similar to remove() but it does not clean -// // up internal references. Here they're aliases, but I'm leaving -// // this as a separate method for the moment to keep track of where -// // mathquill did one vs the other. -// return this.remove(); -// }; -// /** -// * Insert this fragment either just before or just after `sibling` -// * fragment according to the direction specified by `dir`. If -// * `sibling` is empty or does not have a parent node, detaches this -// * fragment from the document. -// */ -// DOMFragment.prototype.insDirOf = function (dir, sibling) { -// var _a; -// if (!this.ends) return this; -// var el = (_a = sibling.ends) === null || _a === void 0 ? void 0 : _a[dir]; -// if (!el || !el.parentNode) return this.detach(); -// _insDirOf(dir, el.parentNode, this.toDocumentFragment(), el); -// return this; -// }; -// /** -// * Insert this fragment into `el` either at the beginning or end of -// * its children, according to the direction specified by `dir`. -// */ -// DOMFragment.prototype.insAtDirEnd = function (dir, el) { -// if (!this.ends) return this; -// _insAtDirEnd(dir, this.toDocumentFragment(), el); -// return this; -// }; -// /** -// * Return true if any element in this fragment has class `className` -// * and false otherwise. -// */ -// DOMFragment.prototype.hasClass = function (className) { -// var out = false; -// this.eachElement(function (el) { -// if (el.classList.contains(className)) out = true; -// }); -// return out; -// }; -// /** -// * Add each class in space separated list of classes given by -// * `classNames` to each element in this fragment. -// */ -// DOMFragment.prototype.addClass = function (classNames) { -// var _loop_1 = function (className) { -// if (!className) return 'continue'; -// this_1.eachElement(function (el) { -// el.classList.add(className); -// }); -// }; -// var this_1 = this; -// for (var _i = 0, _a = classNames.split(/\s+/); _i < _a.length; _i++) { -// var className = _a[_i]; -// _loop_1(className); -// } -// return this; -// }; -// /** -// * Remove each class in space separated list of classes given by -// * `classNames` from each element in this fragment. -// */ -// DOMFragment.prototype.removeClass = function (classNames) { -// var _loop_2 = function (className) { -// if (!className) return 'continue'; -// this_2.eachElement(function (el) { -// el.classList.remove(className); -// }); -// }; -// var this_2 = this; -// for (var _i = 0, _a = classNames.split(/\s+/); _i < _a.length; _i++) { -// var className = _a[_i]; -// _loop_2(className); -// } -// return this; -// }; -// /** -// * Toggle each class in space separated list of classes given by -// * `classNames` on each element in this fragment. -// * -// * If second arg `on` is given as `true`, always toggle classes on. -// * If second arg `on` is passed as `false`, always toggle classes off. -// */ -// DOMFragment.prototype.toggleClass = function (classNames, on) { -// if (on === true) return this.addClass(classNames); -// if (on === false) return this.removeClass(classNames); -// var _loop_3 = function (className) { -// if (!className) return 'continue'; -// this_3.eachElement(function (el) { -// el.classList.toggle(className); -// }); -// }; -// var this_3 = this; -// for (var _i = 0, _a = classNames.split(/\s+/); _i < _a.length; _i++) { -// var className = _a[_i]; -// _loop_3(className); -// } -// return this; -// }; -// return DOMFragment; -// })(); -// var domFrag = DOMFragment.create; -// /** -// * Insert `source` before or after `target` child of `parent` denending -// * on `dir`. Only intended to be used internally as a helper in this module -// */ -// function _insDirOf(dir, parent, source, target) { -// parent.insertBefore(source, dir === L ? target : target.nextSibling); -// } -// /** -// * Insert `source` before or after `target` child of `parent` denending -// * on `dir`. Only intended to be used internally as a helper in this module -// */ -// function _insAtDirEnd(dir, source, parent) { -// if (dir === L) { -// parent.insertBefore(source, parent.firstChild); -// } else { -// parent.appendChild(source); -// } -// } -// /************************************************* -// * Base classes of edit tree-related objects -// * -// * Only doing tree node manipulation via these -// * adopt/ disown methods guarantees well-formedness -// * of the tree. -// ************************************************/ -// /** A cursor-like location in an mq node tree. */ -// var Point = /** @class */ (function () { -// function Point(parent, leftward, rightward) { -// this.init(parent, leftward, rightward); -// } -// // keeping init around only for tests -// Point.prototype.init = function (parent, leftward, rightward) { -// this.parent = parent; -// this[L] = leftward; -// this[R] = rightward; -// }; -// Point.copy = function (pt) { -// return new Point(pt.parent, pt[L], pt[R]); -// }; -// return Point; -// })(); -// function eachNode(ends, yield_) { -// var el = ends[L]; -// if (!el) return; -// var stop = ends[R]; -// if (!stop) return; //shouldn't happen because ends[L] is defined; -// stop = stop[R]; -// // TODO - this cast as MQNode is actually important to keep tests passing. I went to -// // fix this code to gracefully handle an undefined el and there are tests that actually -// // verify that this will throw an error. So I'm keeping the behavior but ignoring the -// // type error. -// for (; el !== stop; el = el[R]) { -// var result = yield_(el); // TODO - might be passing in 0 intead of a MQNode, but tests want this -// if (result === false) break; -// } -// } -// function foldNodes(ends, fold, yield_) { -// var el = ends[L]; -// if (!el) return fold; -// var stop = ends[R]; -// if (!stop) return fold; //shouldn't happen because ends[L] is defined; -// stop = stop[R]; -// // TODO - this cast as MQNode is actually important to keep tests passing. I went to -// // fix this code to gracefully handle an undefined el and there are tests that actually -// // verify that this will throw an error. So I'm keeping the behavior but ignoring the -// // type error. -// for (; el !== stop; el = el[R]) { -// fold = yield_(fold, el); // TODO - might be passing in 0 intead of a MQNode, but tests want this -// } -// return fold; -// } -// var NodeBase = /** @class */ (function () { -// function NodeBase() { -// var _c; -// // TODO - life would be so much better in typescript of these were undefined instead of -// // 0. The ! would save us in cases where we know a node is defined. -// this[_a] = 0; -// this[_b] = 0; -// // TODO - can this ever actually stay 0? if so we need to add null checks -// this.parent = 0; -// /** -// * The (doubly-linked) list of this node's children. -// * -// * NOTE child classes may specify a narrower type for ends e.g. to -// * enforce that children are not empty, or that they have a certain -// * type. In those cases, this initializer may still run at -// * construction time, but this is expected to be followed by a call -// * to adopt that sets non-empty ends of the necessary types. -// * -// * Similarly, `Fragment::disown` may temporarily break non-empty -// * invariants, which are expected to be restored by a subsequent call -// * to `Fragment::adopt`. -// * */ -// this.ends = ((_c = {}), (_c[L] = 0), (_c[R] = 0), _c); -// this.id = NodeBase.uniqueNodeId(); -// } -// NodeBase.uniqueNodeId = function () { -// return (NodeBase.idCounter += 1); -// }; -// // The mqBlockNode and mqCmdNode custom properties link back from the -// // DOM nodes generated by MathQuill to the MQNodes that generated -// // them. This is useful for looking up MQNodes in event handlers and -// // in the mq(elt) public API method -// NodeBase.getNodeOfElement = function (el) { -// if (!el) return; -// if (!el.nodeType) throw new Error('must pass an Element to NodeBase.getNodeOfElement'); -// var elTrackingNode = el; -// return elTrackingNode.mqBlockNode || elTrackingNode.mqCmdNode; -// }; -// NodeBase.linkElementByBlockNode = function (elm, blockNode) { -// elm.mqBlockNode = blockNode; -// }; -// NodeBase.linkElementByCmdNode = function (elm, cmdNode) { -// elm.mqCmdNode = cmdNode; -// }; -// NodeBase.prototype.setEnds = function (ends) { -// this.ends = ends; -// pray('No half-empty node ends', !!this.ends[L] === !!this.ends[R]); -// }; -// NodeBase.prototype.getEnd = function (dir) { -// return this.ends[dir]; -// }; -// NodeBase.prototype.toString = function () { -// return '{{ MathQuill Node #' + this.id + ' }}'; -// }; -// NodeBase.prototype.setDOM = function (el) { -// if (el) { -// pray( -// 'DOM is an element or a text node', -// el.nodeType === Node.ELEMENT_NODE || el.nodeType === Node.TEXT_NODE -// ); -// } -// this._el = el; -// return this; -// }; -// NodeBase.prototype.domFrag = function () { -// return domFrag(this._el); -// }; -// NodeBase.prototype.createDir = function (dir, cursor) { -// prayDirection(dir); -// var node = this; -// node.html(); -// node.domFrag().insDirOf(dir, cursor.domFrag()); -// cursor[dir] = node.adopt(cursor.parent, cursor[L], cursor[R]); // TODO - assuming not undefined, could be 0 -// return node; -// }; -// NodeBase.prototype.createLeftOf = function (cursor) { -// this.createDir(L, cursor); -// }; -// NodeBase.prototype.selectChildren = function (leftEnd, rightEnd) { -// return new MQSelection(leftEnd, rightEnd); -// }; -// NodeBase.prototype.bubble = function (yield_) { -// var self = this.getSelfNode(); -// for (var ancestor = self; ancestor; ancestor = ancestor.parent) { -// var result = yield_(ancestor); -// if (result === false) break; -// } -// return this; -// }; -// NodeBase.prototype.postOrder = function (yield_) { -// var self = this.getSelfNode(); -// (function recurse(descendant) { -// if (!descendant) return false; -// descendant.eachChild(recurse); -// yield_(descendant); -// return true; -// })(self); -// return self; -// }; -// NodeBase.prototype.isEmpty = function () { -// return this.ends[L] === 0 && this.ends[R] === 0; -// }; -// NodeBase.prototype.isQuietEmptyDelimiter = function (dlms) { -// if (!this.isEmpty()) return false; -// if (!dlms) return false; -// if (!this.parent || this.parent.ctrlSeq === undefined) return false; -// // Remove any leading \left or \right from the ctrl sequence before looking it up. -// var key = this.parent.ctrlSeq.replace(/^\\(left|right)?/, ''); -// return dlms.hasOwnProperty(key); -// }; -// NodeBase.prototype.isStyleBlock = function () { -// return false; -// }; -// NodeBase.prototype.isTextBlock = function () { -// return false; -// }; -// NodeBase.prototype.children = function () { -// return new Fragment(this.getEnd(L), this.getEnd(R)); -// }; -// NodeBase.prototype.eachChild = function (yield_) { -// eachNode(this.ends, yield_); -// return this; -// }; -// NodeBase.prototype.foldChildren = function (fold, yield_) { -// return foldNodes(this.ends, fold, yield_); -// }; -// NodeBase.prototype.withDirAdopt = function (dir, parent, withDir, oppDir) { -// var self = this.getSelfNode(); -// new Fragment(self, self).withDirAdopt(dir, parent, withDir, oppDir); -// return this; -// }; -// /** -// * Add this node to the given parent node's children, at the position between the adjacent -// * children `leftward` (or the beginning if omitted) and `rightward` (or the end if omitted). -// * See `Fragment#adopt()` -// */ -// NodeBase.prototype.adopt = function (parent, leftward, rightward) { -// var self = this.getSelfNode(); -// new Fragment(self, self).adopt(parent, leftward, rightward); -// return this.getSelfNode(); -// }; -// NodeBase.prototype.disown = function () { -// var self = this.getSelfNode(); -// new Fragment(self, self).disown(); -// return this; -// }; -// NodeBase.prototype.remove = function () { -// this.domFrag().remove(); -// return this.disown(); -// }; -// NodeBase.prototype.shouldIgnoreSubstitutionInSimpleSubscript = function (options) { -// if (!options.disableAutoSubstitutionInSubscripts) return false; -// if (!this.parent) return false; -// if (!(this.parent.parent instanceof SupSub)) return false; -// // Mathquill is gross. There are many different paths that -// // create subscripts and sometimes we don't even construct -// // true instances of `LatexCmds._`. Another problem is that -// // the relationship between the sub and the SupSub isn't -// // completely setup during a paste at the time we check -// // this. I wanted to use: `this.parent.parent.sub !== this.parent` -// // but that check doesn't always work. This seems to be the only -// // check that always works. I'd rather live with this than try -// // to change the init order of things. -// if (!this.parent.domFrag().hasClass('dcg-mq-sub')) return false; -// return true; -// }; -// NodeBase.prototype.getSelfNode = function () { -// // dumb dance to tell typescript that we eventually become a MQNode -// return this; -// }; -// // Overridden by child classes -// NodeBase.prototype.parser = function () { -// pray('Abstract parser() method is never called', false); -// }; -// /** Render this node to DOM */ -// NodeBase.prototype.html = function () { -// throw new Error('html() unimplemented in NodeBase'); -// }; -// NodeBase.prototype.text = function () { -// return ''; -// }; -// NodeBase.prototype.latex = function () { -// var ctx = { latex: '', startIndex: -1, endIndex: -1 }; -// this.latexRecursive(ctx); -// return ctx.latex; -// }; -// NodeBase.prototype.latexRecursive = function (_ctx) {}; -// NodeBase.prototype.checkCursorContextOpen = function (ctx) { -// if (ctx.startSelectionBefore === this) { -// ctx.startIndex = ctx.latex.length; -// } -// if (ctx.endSelectionBefore === this) { -// ctx.endIndex = ctx.latex.length; -// } -// }; -// NodeBase.prototype.checkCursorContextClose = function (ctx) { -// if (ctx.startSelectionAfter === this) { -// ctx.startIndex = ctx.latex.length; -// } -// if (ctx.endSelectionAfter === this) { -// ctx.endIndex = ctx.latex.length; -// } -// }; -// NodeBase.prototype.finalizeTree = function (_options, _dir) {}; -// NodeBase.prototype.contactWeld = function (_cursor, _dir) {}; -// NodeBase.prototype.blur = function (_cursor) {}; -// NodeBase.prototype.focus = function () {}; -// NodeBase.prototype.intentionalBlur = function () {}; -// NodeBase.prototype.reflow = function () {}; -// NodeBase.prototype.registerInnerField = function (_innerFields, _mathField) {}; -// NodeBase.prototype.chToCmd = function (_ch, _options) { -// pray('Abstract chToCmd() method is never called', false); -// }; -// NodeBase.prototype.mathspeak = function (_options) { -// return ''; -// }; -// NodeBase.prototype.seek = function (_clientX, _cursor) {}; -// NodeBase.prototype.siblingDeleted = function (_options, _dir) {}; -// NodeBase.prototype.siblingCreated = function (_options, _dir) {}; -// NodeBase.prototype.finalizeInsert = function (_options, _cursor) {}; -// NodeBase.prototype.fixDigitGrouping = function (_opts) {}; -// NodeBase.prototype.writeLatex = function (_cursor, _latex) {}; -// NodeBase.prototype.write = function (_cursor, _ch) {}; -// var _a, _b; -// (_a = L), (_b = R); -// NodeBase.idCounter = 0; -// return NodeBase; -// })(); -// function prayWellFormed(parent, leftward, rightward) { -// pray('a parent is always present', parent); -// pray( -// 'leftward is properly set up', -// (function () { -// // either it's empty and `rightward` is the left end child (possibly empty) -// if (!leftward) return parent.getEnd(L) === rightward; -// // or it's there and its [R] and .parent are properly set up -// return leftward[R] === rightward && leftward.parent === parent; -// })() -// ); -// pray( -// 'rightward is properly set up', -// (function () { -// // either it's empty and `leftward` is the right end child (possibly empty) -// if (!rightward) return parent.getEnd(R) === leftward; -// // or it's there and its [L] and .parent are properly set up -// return rightward[L] === leftward && rightward.parent === parent; -// })() -// ); -// } -// /** -// * An entity outside the virtual tree with one-way pointers (so it's only a -// * "view" of part of the tree, not an actual node/entity in the tree) that -// * delimits a doubly-linked list of sibling nodes. -// * It's like a fanfic love-child between HTML DOM DocumentFragment and the Range -// * classes: like DocumentFragment, its contents must be sibling nodes -// * (unlike Range, whose contents are arbitrary contiguous pieces of subtrees), -// * but like Range, it has only one-way pointers to its contents, its contents -// * have no reference to it and in fact may still be in the visible tree (unlike -// * DocumentFragment, whose contents must be detached from the visible tree -// * and have their 'parent' pointers set to the DocumentFragment). -// */ -// var Fragment = /** @class */ (function () { -// function Fragment(withDir, oppDir, dir) { -// var _c, _d; -// this.disowned = false; -// if (dir === undefined) dir = L; -// prayDirection(dir); -// pray('no half-empty fragments', !withDir === !oppDir); -// if (!withDir || !oppDir) { -// this.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); -// return; -// } -// pray('withDir is passed to Fragment', withDir instanceof MQNode); -// pray('oppDir is passed to Fragment', oppDir instanceof MQNode); -// pray('withDir and oppDir have the same parent', withDir.parent === oppDir.parent); -// var ends = ((_d = {}), (_d[dir] = withDir), (_d[-dir] = oppDir), _d); -// this.setEnds(ends); -// var maybeRightEnd = 0; -// this.each(function (el) { -// maybeRightEnd = el; -// }); -// pray('following direction siblings from start reaches end', maybeRightEnd === ends[R]); -// } -// Fragment.prototype.getDOMFragFromEnds = function () { -// var left = this.ends[L]; -// var right = this.ends[R]; -// if (left === 0 || right === 0) { -// return domFrag(); -// } else if (left === right) { -// // Note, joining a DOMFragment to itself is not allowed, so -// // don't attempt to join the end fragments if the ends are equal -// return left.domFrag(); -// } else { -// return left.domFrag().join(right.domFrag()); -// } -// }; -// /** -// * Note, children may override this to enforce extra invariants, -// * (e.g. that ends are always defined). Ends should only be set -// * through this function. -// */ -// Fragment.prototype.setEnds = function (ends) { -// this.ends = ends; -// }; -// Fragment.prototype.getEnd = function (dir) { -// return this.ends ? this.ends[dir] : 0; -// }; -// Fragment.prototype.domFrag = function () { -// return this.getDOMFragFromEnds(); -// }; -// // like Cursor::withDirInsertAt(dir, parent, withDir, oppDir) -// Fragment.prototype.withDirAdopt = function (dir, parent, withDir, oppDir) { -// return dir === L ? this.adopt(parent, withDir, oppDir) : this.adopt(parent, oppDir, withDir); -// }; -// /** -// * Splice this fragment into the given parent node's children, at the position between the adjacent -// * children `leftward` (or the beginning if omitted) and `rightward` (or the end if omitted). -// * -// * TODO: why do we need both leftward and rightward? It seems to me that `rightward` is always expected to be `leftward ? leftward[R] : parent.ends[L]`. -// */ -// Fragment.prototype.adopt = function (parent, leftward, rightward) { -// var _c; -// prayWellFormed(parent, leftward, rightward); -// var self = this; -// this.disowned = false; -// var leftEnd = self.ends[L]; -// if (!leftEnd) return this; -// var rightEnd = self.ends[R]; -// if (!rightEnd) return this; -// var ends = ((_c = {}), (_c[L] = parent.getEnd(L)), (_c[R] = parent.getEnd(R)), _c); -// if (leftward) { -// // NB: this is handled in the ::each() block -// // leftward[R] = leftEnd -// } else { -// ends[L] = leftEnd; -// } -// if (rightward) { -// rightward[L] = rightEnd; -// } else { -// ends[R] = rightEnd; -// } -// parent.setEnds(ends); -// rightEnd[R] = rightward; -// self.each(function (el) { -// el[L] = leftward; -// el.parent = parent; -// if (leftward) leftward[R] = el; -// leftward = el; -// return true; -// }); -// return self; -// }; -// /** -// * Remove the nodes in this fragment from their parent. -// */ -// Fragment.prototype.disown = function () { -// var _c; -// var self = this; -// var leftEnd = self.ends[L]; -// // guard for empty and already-disowned fragments -// if (!leftEnd || self.disowned) return self; -// this.disowned = true; -// var rightEnd = self.ends[R]; -// if (!rightEnd) return self; -// var parent = leftEnd.parent; -// prayWellFormed(parent, leftEnd[L], leftEnd); -// prayWellFormed(parent, rightEnd, rightEnd[R]); -// var ends = ((_c = {}), (_c[L] = parent.getEnd(L)), (_c[R] = parent.getEnd(R)), _c); -// if (leftEnd[L]) { -// var leftLeftEnd = leftEnd[L]; -// leftLeftEnd[R] = rightEnd[R]; -// } else { -// ends[L] = rightEnd[R]; -// } -// if (rightEnd[R]) { -// var rightRightEnd = rightEnd[R]; -// rightRightEnd[L] = leftEnd[L]; -// } else { -// ends[R] = leftEnd[L]; -// } -// if (ends[L] && ends[R]) { -// parent.setEnds(ends); -// } else { -// // some child classes of MQNode try to enforce that their ends -// // are never empty through the type system. However, disown may -// // temporarily break this invariant in which case it's expected -// // that adopt will later be called to fix the invariant. -// // -// // Cast away the protected status of the ends property and write -// // to it directly to get around runtime assertions in setEnds that -// // enforce non-emptyness. -// parent.ends = ends; -// } -// return self; -// }; -// Fragment.prototype.remove = function () { -// this.domFrag().remove(); -// return this.disown(); -// }; -// Fragment.prototype.each = function (yield_) { -// eachNode(this.ends, yield_); -// return this; -// }; -// Fragment.prototype.fold = function (fold, yield_) { -// return foldNodes(this.ends, fold, yield_); -// }; -// return Fragment; -// })(); -// /** -// * Registry of LaTeX commands and commands created when typing -// * a single character. -// * -// * (Commands are all subclasses of Node.) -// */ -// var LatexCmds = {}; -// var CharCmds = {}; -// function isMQNodeClass(cmd) { -// return cmd && cmd.prototype instanceof MQNode; -// } -// /******************************************** -// * Cursor and Selection "singleton" classes -// *******************************************/ -// /* The main thing that manipulates the Math DOM. Makes sure to manipulate the -// HTML DOM to match. */ -// /* Sort of singletons, since there should only be one per editable math -// textbox, but any one HTML document can contain many such textboxes, so any one -// JS environment could actually contain many instances. */ -// //A fake cursor in the fake textbox that the math is rendered in. -// var Anticursor = /** @class */ (function (_super) { -// __extends(Anticursor, _super); -// function Anticursor(parent, leftward, rightward) { -// var _this_1 = _super.call(this, parent, leftward, rightward) || this; -// _this_1.ancestors = {}; -// return _this_1; -// } -// Anticursor.fromCursor = function (cursor) { -// return new Anticursor(cursor.parent, cursor[L], cursor[R]); -// }; -// return Anticursor; -// })(Point); -// var Cursor = /** @class */ (function (_super) { -// __extends(Cursor, _super); -// function Cursor(initParent, options, controller) { -// var _this_1 = _super.call(this, initParent, 0, 0) || this; -// /** Slightly more than just a "cache", this remembers the cursor's position in each block node, so that we can return to the right -// * point in that node when moving up and down among blocks. -// */ -// _this_1.upDownCache = {}; -// _this_1.cursorElement = h('span', { class: 'dcg-mq-cursor' }, [h.text(U_ZERO_WIDTH_SPACE)]); -// _this_1._domFrag = domFrag(); -// _this_1.controller = controller; -// _this_1.options = options; -// _this_1.setDOMFrag(domFrag(_this_1.cursorElement)); -// //closured for setInterval -// _this_1.blink = function () { -// domFrag(_this_1.cursorElement).toggleClass('dcg-mq-blink'); -// }; -// return _this_1; -// } -// Cursor.prototype.setDOMFrag = function (frag) { -// this._domFrag = frag; -// return this; -// }; -// Cursor.prototype.domFrag = function () { -// return this._domFrag; -// }; -// Cursor.prototype.show = function () { -// domFrag(this.cursorElement).removeClass('dcg-mq-blink'); -// this.setDOMFrag(domFrag(this.cursorElement)); -// if (this.intervalId) -// //already was shown, just restart interval -// clearInterval(this.intervalId); -// else { -// //was hidden and detached, insert this.jQ back into HTML DOM -// var right = this[R]; -// if (right) { -// var selection = this.selection; -// if (selection && selection.getEnd(L)[L] === this[L]) -// this.domFrag().insertBefore(selection.domFrag()); -// else this.domFrag().insertBefore(right.domFrag()); -// } else this.domFrag().appendTo(this.parent.domFrag().oneElement()); -// this.parent.focus(); -// } -// this.intervalId = setInterval(this.blink, 500); -// return this; -// }; -// Cursor.prototype.hide = function () { -// if (this.intervalId) clearInterval(this.intervalId); -// this.intervalId = 0; -// this.domFrag().detach(); -// this.setDOMFrag(domFrag()); -// return this; -// }; -// Cursor.prototype.withDirInsertAt = function (dir, parent, withDir, oppDir) { -// var oldParent = this.parent; -// this.parent = parent; -// this[dir] = withDir; -// this[-dir] = oppDir; -// // by contract, .blur() is called after all has been said and done -// // and the cursor has actually been moved -// // FIXME pass cursor to .blur() so text can fix cursor pointers when removing itself -// if (oldParent !== parent && oldParent.blur) oldParent.blur(this); -// }; -// /** Place the cursor before or after `el`, according the side specified by `dir`. */ -// Cursor.prototype.insDirOf = function (dir, el) { -// prayDirection(dir); -// this.domFrag().insDirOf(dir, el.domFrag()); -// this.withDirInsertAt(dir, el.parent, el[dir], el); -// this.parent.domFrag().addClass('dcg-mq-hasCursor'); -// return this; -// }; -// Cursor.prototype.insLeftOf = function (el) { -// return this.insDirOf(L, el); -// }; -// Cursor.prototype.insRightOf = function (el) { -// return this.insDirOf(R, el); -// }; -// /** Place the cursor inside `el` at either the left or right end, according the side specified by `dir`. */ -// Cursor.prototype.insAtDirEnd = function (dir, el) { -// prayDirection(dir); -// this.domFrag().insAtDirEnd(dir, el.domFrag().oneElement()); -// this.withDirInsertAt(dir, el, 0, el.getEnd(dir)); -// el.focus(); -// return this; -// }; -// Cursor.prototype.insAtLeftEnd = function (el) { -// return this.insAtDirEnd(L, el); -// }; -// Cursor.prototype.insAtRightEnd = function (el) { -// return this.insAtDirEnd(R, el); -// }; -// /** -// * jump up or down from one block Node to another: -// * - cache the current Point in the node we're jumping from -// * - check if there's a Point in it cached for the node we're jumping to -// * + if so put the cursor there, -// * + if not seek a position in the node that is horizontally closest to -// * the cursor's current position -// */ -// Cursor.prototype.jumpUpDown = function (from, to) { -// var self = this; -// self.upDownCache[from.id] = Point.copy(self); -// var cached = self.upDownCache[to.id]; -// if (cached) { -// var cachedR = cached[R]; -// if (cachedR) { -// self.insLeftOf(cachedR); -// } else { -// self.insAtRightEnd(cached.parent); -// } -// } else { -// var clientX = self.getBoundingClientRectWithoutMargin().left; -// to.seek(clientX, self); -// } -// self.controller.aria.queue(to, true); -// }; -// Cursor.prototype.getBoundingClientRectWithoutMargin = function () { -// //in Opera 11.62, .getBoundingClientRect() and hence jQuery::offset() -// //returns all 0's on inline elements with negative margin-right (like -// //the cursor) at the end of their parent, so temporarily remove the -// //negative margin-right when calling jQuery::offset() -// //Opera bug DSK-360043 -// //http://bugs.jquery.com/ticket/11523 -// //https://github.com/jquery/jquery/pull/717 -// var frag = this.domFrag(); -// frag.removeClass('dcg-mq-cursor'); -// var _c = getBoundingClientRect(frag.oneElement()), -// left = _c.left, -// right = _c.right; -// frag.addClass('dcg-mq-cursor'); -// return { -// left: left, -// right: right, -// }; -// }; -// Cursor.prototype.unwrapGramp = function () { -// var gramp = this.parent.parent; -// var greatgramp = gramp.parent; -// var rightward = gramp[R]; -// var cursor = this; -// var leftward = gramp[L]; -// gramp.disown().eachChild(function (uncle) { -// if (uncle.isEmpty()) return true; -// uncle -// .children() -// .adopt(greatgramp, leftward, rightward) -// .each(function (cousin) { -// cousin.domFrag().insertBefore(gramp.domFrag()); -// return true; -// }); -// leftward = uncle.getEnd(R); -// return true; -// }); -// if (!this[R]) { -// //then find something to be rightward to insLeftOf -// var thisL = this[L]; -// if (thisL) this[R] = thisL[R]; -// else { -// while (!this[R]) { -// var newParent = this.parent[R]; -// if (newParent) { -// this.parent = newParent; -// this[R] = newParent.getEnd(L); -// } else { -// this[R] = gramp[R]; -// this.parent = greatgramp; -// break; -// } -// } -// } -// } -// var thisR = this[R]; -// if (thisR) this.insLeftOf(thisR); -// else this.insAtRightEnd(greatgramp); -// gramp.domFrag().remove(); -// var grampL = gramp[L]; -// var grampR = gramp[R]; -// if (grampL) grampL.siblingDeleted(cursor.options, R); -// if (grampR) grampR.siblingDeleted(cursor.options, L); -// }; -// Cursor.prototype.startSelection = function () { -// var anticursor = (this.anticursor = Anticursor.fromCursor(this)); -// var ancestors = anticursor.ancestors; -// for (var ancestor = anticursor; ancestor.parent; ancestor = ancestor.parent) { -// ancestors[ancestor.parent.id] = ancestor; -// } -// }; -// Cursor.prototype.endSelection = function () { -// delete this.anticursor; -// }; -// Cursor.prototype.select = function () { -// var _lca; -// var anticursor = this.anticursor; -// if (this[L] === anticursor[L] && this.parent === anticursor.parent) return false; -// // Find the lowest common ancestor (`lca`), and the ancestor of the cursor -// // whose parent is the LCA (which'll be an end of the selection fragment). -// for (var ancestor = this; ancestor.parent; ancestor = ancestor.parent) { -// if (ancestor.parent.id in anticursor.ancestors) { -// _lca = ancestor.parent; -// break; -// } -// } -// pray('cursor and anticursor in the same tree', _lca); -// var lca = _lca; -// // The cursor and the anticursor should be in the same tree, because the -// // mousemove handler attached to the document, unlike the one attached to -// // the root HTML DOM element, doesn't try to get the math tree node of the -// // mousemove target, and Cursor::seek() based solely on coordinates stays -// // within the tree of `this` cursor's root. -// // The other end of the selection fragment, the ancestor of the anticursor -// // whose parent is the LCA. -// var antiAncestor = anticursor.ancestors[lca.id]; -// // Now we have two either Nodes or Points, guaranteed to have a common -// // parent and guaranteed that if both are Points, they are not the same, -// // and we have to figure out which is the left end and which the right end -// // of the selection. -// var leftEnd, -// rightEnd, -// dir = R; -// // This is an extremely subtle algorithm. -// // As a special case, `ancestor` could be a Point and `antiAncestor` a Node -// // immediately to `ancestor`'s left. -// // In all other cases, -// // - both Nodes -// // - `ancestor` a Point and `antiAncestor` a Node -// // - `ancestor` a Node and `antiAncestor` a Point -// // `antiAncestor[R] === rightward[R]` for some `rightward` that is -// // `ancestor` or to its right, if and only if `antiAncestor` is to -// // the right of `ancestor`. -// if (ancestor[L] !== antiAncestor) { -// for (var rightward = ancestor; rightward; rightward = rightward[R]) { -// if (rightward[R] === antiAncestor[R]) { -// dir = L; -// leftEnd = ancestor; -// rightEnd = antiAncestor; -// break; -// } -// } -// } -// if (dir === R) { -// leftEnd = antiAncestor; -// rightEnd = ancestor; -// } -// // only want to select Nodes up to Points, can't select Points themselves -// if (leftEnd instanceof Point) leftEnd = leftEnd[R]; -// if (rightEnd instanceof Point) rightEnd = rightEnd[L]; -// this.hide().selection = lca.selectChildren(leftEnd, rightEnd); -// var insEl = this.selection.getEnd(dir); -// this.insDirOf(dir, insEl); -// this.selectionChanged(); -// return true; -// }; -// Cursor.prototype.resetToEnd = function (controller) { -// this.clearSelection(); -// var root = controller.root; -// this[R] = 0; -// this[L] = root.getEnd(R); -// this.parent = root; -// }; -// Cursor.prototype.clearSelection = function () { -// if (this.selection) { -// this.selection.clear(); -// delete this.selection; -// this.selectionChanged(); -// } -// return this; -// }; -// Cursor.prototype.deleteSelection = function () { -// var selection = this.selection; -// if (!selection) return; -// this[L] = selection.getEnd(L)[L]; -// this[R] = selection.getEnd(R)[R]; -// selection.remove(); -// this.selectionChanged(); -// delete this.selection; -// }; -// Cursor.prototype.replaceSelection = function () { -// var seln = this.selection; -// if (seln) { -// this[L] = seln.getEnd(L)[L]; -// this[R] = seln.getEnd(R)[R]; -// delete this.selection; -// } -// return seln; -// }; -// Cursor.prototype.depth = function () { -// var node = this; -// var depth = 0; -// while ((node = node.parent)) { -// depth += node instanceof MathBlock ? 1 : 0; -// } -// return depth; -// }; -// Cursor.prototype.isTooDeep = function (offset) { -// if (this.options.maxDepth !== undefined) { -// return this.depth() + (offset || 0) > this.options.maxDepth; -// } else { -// return false; -// } -// }; -// // can be overridden -// Cursor.prototype.selectionChanged = function () {}; -// return Cursor; -// })(Point); -// var MQSelection = /** @class */ (function (_super) { -// __extends(MQSelection, _super); -// function MQSelection(withDir, oppDir, dir) { -// var _this_1 = _super.call(this, withDir, oppDir, dir) || this; -// _this_1._el = h('span', { class: 'dcg-mq-selection' }); -// _this_1.getDOMFragFromEnds().wrapAll(_this_1._el); -// return _this_1; -// } -// MQSelection.prototype.isCleared = function () { -// return this._el === undefined; -// }; -// MQSelection.prototype.domFrag = function () { -// return this.isCleared() ? this.getDOMFragFromEnds() : domFrag(this._el); -// }; -// MQSelection.prototype.setEnds = function (ends) { -// pray('Selection ends are never empty', ends[L] && ends[R]); -// this.ends = ends; -// }; -// MQSelection.prototype.getEnd = function (dir) { -// return this.ends[dir]; -// }; -// MQSelection.prototype.adopt = function (parent, leftward, rightward) { -// this.clear(); -// return _super.prototype.adopt.call(this, parent, leftward, rightward); -// }; -// MQSelection.prototype.clear = function () { -// // NOTE it's important here that DOMFragment::children includes all -// // child nodes (including Text nodes), and not just Element nodes. -// // This makes it more similar to the native DOM childNodes property -// // and jQuery's .collection() method than jQuery's .children() method -// var childFrag = this.getDOMFragFromEnds(); -// this.domFrag().replaceWith(childFrag); -// this._el = undefined; -// return this; -// }; -// MQSelection.prototype.join = function (methodName, separator) { -// if (separator === void 0) { -// separator = ''; -// } -// return this.fold('', function (fold, child) { -// return fold + separator + child[methodName](); -// }); -// }; -// return MQSelection; -// })(Fragment); -// var ControllerBase = /** @class */ (function () { -// function ControllerBase(root, container, options) { -// this.textareaEventListeners = {}; -// this.id = root.id; -// this.data = {}; -// this.root = root; -// this.container = container; -// this.options = options; -// this.aria = new Aria(this.getControllerSelf()); -// this.ariaLabel = 'Math Input'; -// this.ariaPostLabel = ''; -// root.controller = this.getControllerSelf(); -// this.cursor = root.cursor = new Cursor(root, options, this.getControllerSelf()); -// // TODO: stop depending on root.cursor, and rm it -// } -// ControllerBase.prototype.getControllerSelf = function () { -// // dance we have to do to tell this thing it's a full controller -// return this; -// }; -// ControllerBase.prototype.handle = function (name, dir) { -// var _c; -// var handlers = this.options.handlers; -// var handler = (_c = this.options.handlers) === null || _c === void 0 ? void 0 : _c.fns[name]; -// if (handler) { -// var APIClass = -// handlers === null || handlers === void 0 ? void 0 : handlers.APIClasses[this.KIND_OF_MQ]; -// pray('APIClass is defined', APIClass); -// var mq = new APIClass(this); // cast to any bedcause APIClass needs the final Controller subclass. -// if (dir === L || dir === R) handler(dir, mq); -// else handler(mq); -// } -// }; -// ControllerBase.onNotify = function (f) { -// ControllerBase.notifyees.push(f); -// }; -// ControllerBase.prototype.notify = function (e) { -// for (var i = 0; i < ControllerBase.notifyees.length; i += 1) { -// ControllerBase.notifyees[i](this.cursor, e); -// } -// return this; -// }; -// ControllerBase.prototype.setAriaLabel = function (ariaLabel) { -// var oldAriaLabel = this.getAriaLabel(); -// if (ariaLabel && typeof ariaLabel === 'string' && ariaLabel !== '') { -// this.ariaLabel = ariaLabel; -// } else if (this.editable) { -// this.ariaLabel = 'Math Input'; -// } else { -// this.ariaLabel = ''; -// } -// // If this field doesn't have focus, update its computed mathspeak value. -// // We check for focus because updating the aria-label attribute of a focused element will cause most screen readers to announce the new value (in our case, label along with the expression's mathspeak). -// // If the field does have focus at the time, it will be updated once a blur event occurs. -// // Unless we stop using fake text inputs and emulating screen reader behavior, this is going to remain a problem. -// if (this.ariaLabel !== oldAriaLabel && !this.containerHasFocus()) { -// this.updateMathspeak(); -// } -// return this; -// }; -// ControllerBase.prototype.getAriaLabel = function () { -// if (this.ariaLabel !== 'Math Input') { -// return this.ariaLabel; -// } else if (this.editable) { -// return 'Math Input'; -// } else { -// return ''; -// } -// }; -// ControllerBase.prototype.setAriaPostLabel = function (ariaPostLabel, timeout) { -// var _this_1 = this; -// if (ariaPostLabel && typeof ariaPostLabel === 'string' && ariaPostLabel !== '') { -// if (ariaPostLabel !== this.ariaPostLabel && typeof timeout === 'number') { -// if (this._ariaAlertTimeout) clearTimeout(this._ariaAlertTimeout); -// this._ariaAlertTimeout = setTimeout(function () { -// if (_this_1.containerHasFocus()) { -// // Voice the new label, but do not update content mathspeak to prevent double-speech. -// _this_1.aria.alert(_this_1.root.mathspeak().trim() + ' ' + ariaPostLabel.trim()); -// } else { -// // This mathquill does not have focus, so update its mathspeak. -// _this_1.updateMathspeak(); -// } -// }, timeout); -// } -// this.ariaPostLabel = ariaPostLabel; -// } else { -// if (this._ariaAlertTimeout) clearTimeout(this._ariaAlertTimeout); -// this.ariaPostLabel = ''; -// } -// return this; -// }; -// ControllerBase.prototype.getAriaPostLabel = function () { -// return this.ariaPostLabel || ''; -// }; -// ControllerBase.prototype.containerHasFocus = function () { -// return document.activeElement && this.container.contains(document.activeElement); -// }; -// ControllerBase.prototype.getTextareaOrThrow = function () { -// var textarea = this.textarea; -// if (!textarea) throw new Error('expected a textarea'); -// return textarea; -// }; -// ControllerBase.prototype.getTextareaSpanOrThrow = function () { -// var textareaSpan = this.textareaSpan; -// if (!textareaSpan) throw new Error('expected a textareaSpan'); -// return textareaSpan; -// }; -// /** Add the given event listeners on this.textarea, replacing the existing listener for that event if it exists. */ -// ControllerBase.prototype.addTextareaEventListeners = function (listeners) { -// if (!this.textarea) return; -// for (var key_2 in listeners) { -// var event = key_2; -// this.removeTextareaEventListener(event); -// this.textarea.addEventListener(event, listeners[event]); -// } -// }; -// ControllerBase.prototype.removeTextareaEventListener = function (event) { -// if (!this.textarea) return; -// var listener = this.textareaEventListeners[event]; -// if (!listener) return; -// this.textarea.removeEventListener(event, listener); -// }; -// // based on http://www.gh-mathspeak.com/examples/quick-tutorial/ -// // and http://www.gh-mathspeak.com/examples/grammar-rules/ -// ControllerBase.prototype.exportMathSpeak = function () { -// return this.root.mathspeak(); -// }; -// // overridden -// ControllerBase.prototype.updateMathspeak = function () {}; -// ControllerBase.prototype.scrollHoriz = function () {}; -// ControllerBase.prototype.selectionChanged = function () {}; -// ControllerBase.prototype.setOverflowClasses = function () {}; -// ControllerBase.notifyees = []; -// return ControllerBase; -// })(); -// var API = {}; -// var EMBEDS = {}; -// var processedOptions = { -// handlers: true, -// autoCommands: true, -// quietEmptyDelimiters: true, -// autoParenthesizedFunctions: true, -// autoOperatorNames: true, -// leftRightIntoCmdGoes: true, -// maxDepth: true, -// interpretTildeAsSim: true, -// }; -// var baseOptionProcessors = {}; -// var Options = /** @class */ (function () { -// function Options(version) { -// this.version = version; -// } -// Options.prototype.assertJquery = function () { -// pray('Interface versions > 2 do not depend on JQuery', this.version <= 2); -// pray('JQuery is set for interface v < 3', this.jQuery); -// return this.jQuery; -// }; -// return Options; -// })(); -// var Progenote = /** @class */ (function () { -// function Progenote() {} -// return Progenote; -// })(); -// /** -// * Interface Versioning (#459, #495) to allow us to virtually guarantee -// * backcompat. v0.10.x introduces it, so for now, don't completely break the -// * API for people who don't know about it, just complain with console.warn(). -// * -// * The methods are shimmed in outro.js so that MQ.MathField.prototype etc can -// * be accessed. -// */ -// var insistOnInterVer = function () { -// if (window.console) -// console.warn( -// 'You are using the MathQuill API without specifying an interface version, ' + -// 'which will fail in v1.0.0. Easiest fix is to do the following before ' + -// 'doing anything else:\n' + -// '\n' + -// ' MathQuill = MathQuill.getInterface(1);\n' + -// ' // now MathQuill.MathField() works like it used to\n' + -// '\n' + -// 'See also the "`dev` branch (2014\u20132015) \u2192 v0.10.0 Migration Guide" at\n' + -// ' https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide' -// ); -// }; -// // globally exported API object -// var MQ1; -// function MathQuill(el) { -// insistOnInterVer(); -// if (!MQ1) { -// MQ1 = getInterface(1); -// } -// return MQ1(el); -// } -// MathQuill.prototype = Progenote.prototype; -// MathQuill.VERSION = 'v0.10.1'; -// MathQuill.interfaceVersion = function (v) { -// // shim for #459-era interface versioning (ended with #495) -// if (v !== 1) throw 'Only interface version 1 supported. You specified: ' + v; -// insistOnInterVer = function () { -// if (window.console) -// console.warn( -// 'You called MathQuill.interfaceVersion(1); to specify the interface ' + -// 'version, which will fail in v1.0.0. You can fix this easily by doing ' + -// 'this before doing anything else:\n' + -// '\n' + -// ' MathQuill = MathQuill.getInterface(1);\n' + -// ' // now MathQuill.MathField() works like it used to\n' + -// '\n' + -// 'See also the "`dev` branch (2014\u20132015) \u2192 v0.10.0 Migration Guide" at\n' + -// ' https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide' -// ); -// }; -// insistOnInterVer(); -// return MathQuill; -// }; -// MathQuill.getInterface = getInterface; -// var MIN = (getInterface.MIN = 1), -// MAX = (getInterface.MAX = 3); -// function getInterface(v) { -// if (v !== 1 && v !== 2 && v !== 3) -// throw 'Only interface versions between ' + MIN + ' and ' + MAX + ' supported. You specified: ' + v; -// var version = v; -// if (version < 3) { -// var jQuery = window.jQuery; -// if (!jQuery) -// throw 'MathQuill interface version '.concat(version, ' requires jQuery 1.5.2+ to be loaded first'); -// Options.prototype.jQuery = jQuery; -// } -// var optionProcessors = __assign(__assign({}, baseOptionProcessors), { -// handlers: function (handlers) { -// return { -// // casting to the v3 version of this type -// fns: handlers || {}, -// APIClasses: APIClasses, -// }; -// }, -// }); -// function config(currentOptions, newOptions) { -// for (var name in newOptions) { -// if (newOptions.hasOwnProperty(name)) { -// if (name === 'substituteKeyboardEvents' && version >= 3) { -// throw new Error( -// [ -// "As of interface version 3, the 'substituteKeyboardEvents'", -// "option is no longer supported. Use 'overrideTypedText' and", -// "'overrideKeystroke' instead.", -// ].join(' ') -// ); -// } -// var value = newOptions[name]; // TODO - think about typing this better -// var processor = optionProcessors[name]; // TODO - validate option processors better -// currentOptions[name] = processor ? processor(value) : value; // TODO - think about typing better -// } -// } -// } -// var BaseOptions = -// version < 3 -// ? Options -// : /** @class */ (function (_super) { -// __extends(BaseOptions, _super); -// function BaseOptions() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// return BaseOptions; -// })(Options); -// var AbstractMathQuill = /** @class */ (function (_super) { -// __extends(AbstractMathQuill, _super); -// function AbstractMathQuill(ctrlr) { -// var _this_1 = _super.call(this) || this; -// _this_1.__controller = ctrlr; -// _this_1.__options = ctrlr.options; -// _this_1.id = ctrlr.id; -// _this_1.data = ctrlr.data; -// return _this_1; -// } -// AbstractMathQuill.prototype.mathquillify = function (classNames) { -// var ctrlr = this.__controller, -// root = ctrlr.root, -// el = ctrlr.container; -// ctrlr.createTextarea(); -// var contents = domFrag(el).addClass(classNames).children().detach(); -// root.setDOM( -// domFrag(h('span', { class: 'dcg-mq-root-block', 'aria-hidden': true })) -// .appendTo(el) -// .oneElement() -// ); -// NodeBase.linkElementByBlockNode(root.domFrag().oneElement(), root); -// this.latex(contents.text()); -// this.revert = function () { -// ctrlr.removeMouseEventListener(); -// domFrag(el) -// .removeClass('dcg-mq-editable-field dcg-mq-math-mode dcg-mq-text-mode') -// .empty() -// .append(contents); -// return version < 3 ? this.__options.assertJquery()(el) : el; -// }; -// }; -// AbstractMathQuill.prototype.setAriaLabel = function (ariaLabel) { -// this.__controller.setAriaLabel(ariaLabel); -// return this; -// }; -// AbstractMathQuill.prototype.getAriaLabel = function () { -// return this.__controller.getAriaLabel(); -// }; -// AbstractMathQuill.prototype.config = function (opts) { -// config(this.__options, opts); -// return this; -// }; -// AbstractMathQuill.prototype.el = function () { -// return this.__controller.container; -// }; -// AbstractMathQuill.prototype.text = function () { -// return this.__controller.exportText(); -// }; -// AbstractMathQuill.prototype.mathspeak = function () { -// return this.__controller.exportMathSpeak(); -// }; -// AbstractMathQuill.prototype.latex = function (latex) { -// if (arguments.length > 0) { -// this.__controller.renderLatexMath(latex); -// var cursor = this.__controller.cursor; -// if (this.__controller.blurred) cursor.hide().parent.blur(cursor); -// return this; -// } -// return this.__controller.exportLatex(); -// }; -// AbstractMathQuill.prototype.selection = function () { -// return this.__controller.exportLatexSelection(); -// }; -// AbstractMathQuill.prototype.html = function () { -// return this.__controller.root -// .domFrag() -// .oneElement() -// .innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, '') // TODO remove when jQuery is completely gone -// .replace(/ mathquill-(?:command|block)-id="?\d+"?/g, '') -// .replace(/.?<\/span>/i, '') -// .replace(/ dcg-mq-hasCursor|dcg-mq-hasCursor ?/, '') -// .replace(/ class=(""|(?= |>))/g, ''); -// }; -// AbstractMathQuill.prototype.reflow = function () { -// this.__controller.root.postOrder(function (node) { -// node.reflow(); -// }); -// return this; -// }; -// return AbstractMathQuill; -// })(Progenote); -// var EditableField = /** @class */ (function (_super) { -// __extends(EditableField, _super); -// function EditableField() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// EditableField.prototype.mathquillify = function (classNames) { -// _super.prototype.mathquillify.call(this, classNames); -// this.__controller.editable = true; -// this.__controller.addMouseEventListener(); -// this.__controller.editablesTextareaEvents(); -// return this; -// }; -// EditableField.prototype.focus = function () { -// this.__controller.getTextareaOrThrow().focus(); -// this.__controller.scrollHoriz(); -// return this; -// }; -// EditableField.prototype.blur = function () { -// this.__controller.getTextareaOrThrow().blur(); -// return this; -// }; -// EditableField.prototype.write = function (latex) { -// this.__controller.writeLatex(latex); -// this.__controller.scrollHoriz(); -// var cursor = this.__controller.cursor; -// if (this.__controller.blurred) cursor.hide().parent.blur(cursor); -// return this; -// }; -// EditableField.prototype.empty = function () { -// var _c; -// var root = this.__controller.root, -// cursor = this.__controller.cursor; -// root.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); -// root.domFrag().empty(); -// delete cursor.selection; -// cursor.insAtRightEnd(root); -// return this; -// }; -// EditableField.prototype.cmd = function (cmd) { -// var ctrlr = this.__controller.notify(undefined), -// cursor = ctrlr.cursor; -// if (/^\\[a-z]+$/i.test(cmd) && !cursor.isTooDeep()) { -// cmd = cmd.slice(1); -// var klass = LatexCmds[cmd]; -// var node; -// if (klass) { -// if (klass.constructor) { -// node = new klass(cmd); -// } else { -// node = klass(cmd); -// } -// if (cursor.selection) node.replaces(cursor.replaceSelection()); -// node.createLeftOf(cursor.show()); -// } /* TODO: API needs better error reporting */ else; -// } else cursor.parent.write(cursor, cmd); -// ctrlr.scrollHoriz(); -// if (ctrlr.blurred) cursor.hide().parent.blur(cursor); -// return this; -// }; -// EditableField.prototype.select = function () { -// this.__controller.selectAll(); -// return this; -// }; -// EditableField.prototype.clearSelection = function () { -// this.__controller.cursor.clearSelection(); -// return this; -// }; -// EditableField.prototype.moveToDirEnd = function (dir) { -// this.__controller.notify('move').cursor.insAtDirEnd(dir, this.__controller.root); -// return this; -// }; -// EditableField.prototype.moveToLeftEnd = function () { -// return this.moveToDirEnd(L); -// }; -// EditableField.prototype.moveToRightEnd = function () { -// return this.moveToDirEnd(R); -// }; -// EditableField.prototype.keystroke = function (keysString, evt) { -// var keys = keysString.replace(/^\s+|\s+$/g, '').split(/\s+/); -// for (var i = 0; i < keys.length; i += 1) { -// this.__controller.keystroke(keys[i], evt); -// } -// return this; -// }; -// EditableField.prototype.typedText = function (text) { -// for (var i = 0; i < text.length; i += 1) this.__controller.typedText(text.charAt(i)); -// return this; -// }; -// EditableField.prototype.dropEmbedded = function (pageX, pageY, options) { -// var clientX = pageX - getScrollX(); -// var clientY = pageY - getScrollY(); -// var el = document.elementFromPoint(clientX, clientY); -// this.__controller.seek(el, clientX, clientY); -// var cmd = new EmbedNode().setOptions(options); -// cmd.createLeftOf(this.__controller.cursor); -// }; -// EditableField.prototype.setAriaPostLabel = function (ariaPostLabel, timeout) { -// this.__controller.setAriaPostLabel(ariaPostLabel, timeout); -// return this; -// }; -// EditableField.prototype.getAriaPostLabel = function () { -// return this.__controller.getAriaPostLabel(); -// }; -// EditableField.prototype.clickAt = function (clientX, clientY, target) { -// target = target || document.elementFromPoint(clientX, clientY); -// var ctrlr = this.__controller, -// root = ctrlr.root; -// var rootElement = root.domFrag().oneElement(); -// if (!rootElement.contains(target)) target = rootElement; -// ctrlr.seek(target, clientX, clientY); -// if (ctrlr.blurred) this.focus(); -// return this; -// }; -// EditableField.prototype.ignoreNextMousedown = function (fn) { -// this.__controller.cursor.options.ignoreNextMousedown = fn; -// return this; -// }; -// return EditableField; -// })(AbstractMathQuill); -// var APIClasses = { -// AbstractMathQuill: AbstractMathQuill, -// EditableField: EditableField, -// }; -// pray('API.StaticMath defined', API.StaticMath); -// APIClasses.StaticMath = API.StaticMath(APIClasses); -// pray('API.MathField defined', API.MathField); -// APIClasses.MathField = API.MathField(APIClasses); -// pray('API.InnerMathField defined', API.InnerMathField); -// APIClasses.InnerMathField = API.InnerMathField(APIClasses); -// if (API.TextField) { -// APIClasses.TextField = API.TextField(APIClasses); -// } -// /** -// * Function that takes an HTML element and, if it's the root HTML element of a -// * static math or math or text field, returns an API object for it (else, null). -// * -// * var mathfield = MQ.MathField(mathFieldSpan); -// * assert(MQ(mathFieldSpan).id === mathfield.id); -// * assert(MQ(mathFieldSpan).id === MQ(mathFieldSpan).id); -// * -// */ -// var MQ = function (el) { -// if (!el || !el.nodeType) return null; // check that `el` is a HTML element, using the -// // same technique as jQuery: https://github.com/jquery/jquery/blob/679536ee4b7a92ae64a5f58d90e9cc38c001e807/src/core/init.js#L92 -// var blockElement; -// var childArray = domFrag(el).children().toElementArray(); -// for (var _i = 0, childArray_1 = childArray; _i < childArray_1.length; _i++) { -// var child = childArray_1[_i]; -// if (child.classList.contains('dcg-mq-root-block')) { -// blockElement = child; -// break; -// } -// } -// var blockNode = NodeBase.getNodeOfElement(blockElement); // TODO - assumng it's a MathBlock -// var ctrlr = blockNode && blockNode.controller; -// var APIClass = ctrlr && APIClasses[ctrlr.KIND_OF_MQ]; -// return ctrlr && APIClass ? new APIClass(ctrlr) : null; -// }; -// MQ.L = L; -// MQ.R = R; -// MQ.config = function (opts) { -// config(BaseOptions.prototype, opts); -// return this; -// }; -// MQ.registerEmbed = function (name, options) { -// if (!/^[a-z][a-z0-9]*$/i.test(name)) { -// throw 'Embed name must start with letter and be only letters and digits'; -// } -// EMBEDS[name] = options; -// }; -// /* -// * Export the API functions that MathQuill-ify an HTML element into API objects -// * of each class. If the element had already been MathQuill-ified but into a -// * different kind (or it's not an HTML element), return null. -// */ -// MQ.StaticMath = createEntrypoint('StaticMath', APIClasses.StaticMath); -// MQ.MathField = createEntrypoint('MathField', APIClasses.MathField); -// MQ.InnerMathField = createEntrypoint('InnerMathField', APIClasses.InnerMathField); -// if (APIClasses.TextField) { -// MQ.TextField = createEntrypoint('TextField', APIClasses.TextField); -// } -// MQ.prototype = AbstractMathQuill.prototype; -// MQ.EditableField = function () { -// throw "wtf don't call me, I'm 'abstract'"; -// }; -// MQ.EditableField.prototype = EditableField.prototype; -// if (version < 3) { -// MQ.saneKeyboardEvents = defaultSubstituteKeyboardEvents; -// } -// function createEntrypoint(kind, APIClass) { -// pray(kind + ' is defined', APIClass); -// function mqEntrypoint(el, opts) { -// if (!el || !el.nodeType) return null; -// var mq = MQ(el); -// if (mq instanceof APIClass) return mq; -// var ctrlr = new Controller(new APIClass.RootBlock(), el, new BaseOptions(version)); -// ctrlr.KIND_OF_MQ = kind; -// return new APIClass(ctrlr).__mathquillify(opts || {}, version); -// } -// mqEntrypoint.prototype = APIClass.prototype; -// return mqEntrypoint; -// } -// return MQ; -// } -// MathQuill.noConflict = function () { -// window.MathQuill = origMathQuill; -// return MathQuill; -// }; -// var origMathQuill = window.MathQuill; -// window.MathQuill = MathQuill; -// function RootBlockMixin(_) { -// _.moveOutOf = function (dir) { -// pray('controller is defined', this.controller); -// this.controller.handle('moveOutOf', dir); -// }; -// _.deleteOutOf = function (dir) { -// pray('controller is defined', this.controller); -// this.controller.handle('deleteOutOf', dir); -// }; -// _.selectOutOf = function (dir) { -// pray('controller is defined', this.controller); -// this.controller.handle('selectOutOf', dir); -// }; -// _.upOutOf = function () { -// pray('controller is defined', this.controller); -// this.controller.handle('upOutOf'); -// return undefined; -// }; -// _.downOutOf = function () { -// pray('controller is defined', this.controller); -// this.controller.handle('downOutOf'); -// return undefined; -// }; -// _.reflow = function () { -// pray('controller is defined', this.controller); -// this.controller.handle('reflow'); -// this.controller.handle('edited'); -// this.controller.handle('edit'); -// }; -// } -// function parseError(stream, message) { -// if (stream) { -// stream = "'" + stream + "'"; -// } else { -// stream = 'EOF'; -// } -// throw 'Parse Error: ' + message + ' at ' + stream; -// } -// var Parser = /** @class */ (function () { -// // The Parser object is a wrapper for a parser function. -// // Externally, you use one to parse a string by calling -// // var result = SomeParser.parse('Me Me Me! Parse Me!'); -// // You should never call the constructor, rather you should -// // construct your Parser from the base parsers and the -// // parser combinator methods. -// function Parser(body) { -// this._ = body; -// } -// Parser.prototype.parse = function (stream) { -// return this.skip(Parser.eof)._('' + stream, success, parseError); -// function success(_stream, result) { -// return result; -// } -// }; -// // -*- primitive combinators -*- // -// Parser.prototype.or = function (alternative) { -// pray('or is passed a parser', alternative instanceof Parser); -// var self = this; -// return new Parser(function (stream, onSuccess, onFailure) { -// return self._(stream, onSuccess, failure); -// function failure(_newStream) { -// return alternative._(stream, onSuccess, onFailure); -// } -// }); -// }; -// Parser.prototype.then = function (next) { -// var self = this; -// return new Parser(function (stream, onSuccess, onFailure) { -// return self._(stream, success, onFailure); -// function success(newStream, result) { -// var nextParser = next instanceof Parser ? next : next(result); -// pray('a parser is returned', nextParser instanceof Parser); -// return nextParser._(newStream, onSuccess, onFailure); -// } -// }); -// }; -// // -*- optimized iterative combinators -*- // -// Parser.prototype.many = function () { -// var self = this; -// return new Parser(function (stream, onSuccess, _onFailure) { -// var xs = []; -// while (self._(stream, success, failure)); -// return onSuccess(stream, xs); -// function success(newStream, x) { -// stream = newStream; -// xs.push(x); -// return true; -// } -// function failure() { -// return false; -// } -// }); -// }; -// Parser.prototype.times = function (min, max) { -// if (arguments.length < 2) max = min; -// var self = this; -// return new Parser(function (stream, onSuccess, onFailure) { -// var xs = []; -// var result = true; -// var failure; -// for (var i = 0; i < min; i += 1) { -// // TODO, this may be incorrect for parsers that return boolean -// // (or generally, falsey) values -// result = !!self._(stream, success, firstFailure); -// if (!result) return onFailure(stream, failure); -// } -// for (; i < max && result; i += 1) { -// self._(stream, success, secondFailure); -// } -// return onSuccess(stream, xs); -// function success(newStream, x) { -// xs.push(x); -// stream = newStream; -// return true; -// } -// function firstFailure(newStream, msg) { -// failure = msg; -// stream = newStream; -// return false; -// } -// function secondFailure(_newStream, _msg) { -// return false; -// } -// }); -// }; -// // -*- higher-level combinators -*- // -// Parser.prototype.result = function (res) { -// return this.then(Parser.succeed(res)); -// }; -// Parser.prototype.atMost = function (n) { -// return this.times(0, n); -// }; -// Parser.prototype.atLeast = function (n) { -// var self = this; -// return self.times(n).then(function (start) { -// return self.many().map(function (end) { -// return start.concat(end); -// }); -// }); -// }; -// Parser.prototype.map = function (fn) { -// return this.then(function (result) { -// return Parser.succeed(fn(result)); -// }); -// }; -// Parser.prototype.skip = function (two) { -// return this.then(function (result) { -// return two.result(result); -// }); -// }; -// // -*- primitive parsers -*- // -// Parser.string = function (str) { -// var len = str.length; -// var expected = "expected '" + str + "'"; -// return new Parser(function (stream, onSuccess, onFailure) { -// var head = stream.slice(0, len); -// if (head === str) { -// return onSuccess(stream.slice(len), head); -// } else { -// return onFailure(stream, expected); -// } -// }); -// }; -// Parser.regex = function (re) { -// pray('regexp parser is anchored', re.toString().charAt(1) === '^'); -// var expected = 'expected ' + re; -// return new Parser(function (stream, onSuccess, onFailure) { -// var match = re.exec(stream); -// if (match) { -// var result = match[0]; -// return onSuccess(stream.slice(result.length), result); -// } else { -// return onFailure(stream, expected); -// } -// }); -// }; -// Parser.succeed = function (result) { -// return new Parser(function (stream, onSuccess) { -// return onSuccess(stream, result); -// }); -// }; -// Parser.fail = function (msg) { -// return new Parser(function (stream, _, onFailure) { -// return onFailure(stream, msg); -// }); -// }; -// Parser.letter = Parser.regex(/^[a-z]/i); -// Parser.letters = Parser.regex(/^[a-z]*/i); -// Parser.digit = Parser.regex(/^[0-9]/); -// Parser.digits = Parser.regex(/^[0-9]*/); -// Parser.whitespace = Parser.regex(/^\s+/); -// Parser.optWhitespace = Parser.regex(/^\s*/); -// Parser.any = new Parser(function (stream, onSuccess, onFailure) { -// if (!stream) return onFailure(stream, 'expected any character'); -// return onSuccess(stream.slice(1), stream.charAt(0)); -// }); -// Parser.all = new Parser(function (stream, onSuccess, _onFailure) { -// return onSuccess('', stream); -// }); -// Parser.eof = new Parser(function (stream, onSuccess, onFailure) { -// if (stream) return onFailure(stream, 'expected EOF'); -// return onSuccess(stream, stream); -// }); -// return Parser; -// })(); -// /** Poller that fires once every tick. */ -// var EveryTick = /** @class */ (function () { -// function EveryTick() { -// this.fn = noop; -// } -// EveryTick.prototype.listen = function (fn) { -// this.fn = fn; -// clearTimeout(this.timeoutId); -// this.timeoutId = setTimeout(this.fn); -// }; -// EveryTick.prototype.listenOnce = function (fn) { -// var _this_1 = this; -// this.listen(function () { -// var args = []; -// for (var _i = 0; _i < arguments.length; _i++) { -// args[_i] = arguments[_i]; -// } -// _this_1.clearListener(); -// fn.apply(void 0, args); -// }); -// }; -// EveryTick.prototype.clearListener = function () { -// this.fn = noop; -// clearTimeout(this.timeoutId); -// }; -// EveryTick.prototype.trigger = function () { -// var args = []; -// for (var _i = 0; _i < arguments.length; _i++) { -// args[_i] = arguments[_i]; -// } -// this.fn.apply(this, args); -// }; -// return EveryTick; -// })(); -// /************************************************* -// * Sane Keyboard Events Shim -// * -// * An abstraction layer over the raw browser browser events -// * on the textarea that hides all the nasty cross- -// * browser incompatibilities behind a uniform API. -// * -// * Design goal: This is a *HARD* internal -// * abstraction barrier. Cross-browser -// * inconsistencies are not allowed to leak through -// * and be dealt with by event handlers. All future -// * cross-browser issues that arise must be dealt -// * with here, and if necessary, the API updated. -// ************************************************/ -// var saneKeyboardEvents = (function () { -// // The following [key values][1] map was compiled from the -// // [DOM3 Events appendix section on key codes][2] and -// // [a widely cited report on cross-browser tests of key codes][3], -// // except for 10: 'Enter', which I've empirically observed in Safari on iOS -// // and doesn't appear to conflict with any other known key codes. -// // -// // [1]: http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120614/#keys-keyvalues -// // [2]: http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120614/#fixed-virtual-key-codes -// // [3]: http://unixpapa.com/js/key.html -// var WHICH_TO_MQ_KEY_STEM = { -// 8: 'Backspace', -// 9: 'Tab', -// 10: 'Enter', -// 13: 'Enter', -// 16: 'Shift', -// 17: 'Control', -// 18: 'Alt', -// 20: 'CapsLock', -// 27: 'Esc', -// 32: 'Spacebar', -// 33: 'PageUp', -// 34: 'PageDown', -// 35: 'End', -// 36: 'Home', -// 37: 'Left', -// 38: 'Up', -// 39: 'Right', -// 40: 'Down', -// 45: 'Insert', -// 46: 'Del', -// 144: 'NumLock', -// }; -// var KEY_TO_MQ_KEY_STEM = { -// ArrowRight: 'Right', -// ArrowLeft: 'Left', -// ArrowDown: 'Down', -// ArrowUp: 'Up', -// Delete: 'Del', -// Escape: 'Esc', -// ' ': 'Spacebar', -// }; -// function isArrowKey(e) { -// // The keyPress event in FF reports which=0 for some reason. The new -// // .key property seems to report reasonable results, so we're using that -// switch (getMQKeyStem(e)) { -// case 'Right': -// case 'Left': -// case 'Down': -// case 'Up': -// return true; -// } -// return false; -// } -// function isLowercaseAlphaCharacter(s) { -// return s.length === 1 && s >= 'a' && s <= 'z'; -// } -// function getMQKeyStem(evt) { -// var _c; -// // Translate browser key names to MQ's internal naming system -// // -// // Ref: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values -// if (evt.key === undefined) { -// var which = evt.which || evt.keyCode; -// return WHICH_TO_MQ_KEY_STEM[which] || String.fromCharCode(which); -// } -// if (isLowercaseAlphaCharacter(evt.key)) return evt.key.toUpperCase(); -// return (_c = KEY_TO_MQ_KEY_STEM[evt.key]) !== null && _c !== void 0 ? _c : evt.key; -// } -// /** To the extent possible, create a normalized string representation -// * of the key combo (i.e., key code and modifier keys). */ -// function getMQKeyName(evt) { -// var key = getMQKeyStem(evt); -// var modifiers = []; -// if (evt.ctrlKey) modifiers.push('Ctrl'); -// if (evt.metaKey) modifiers.push('Meta'); -// if (evt.altKey) modifiers.push('Alt'); -// if (evt.shiftKey) modifiers.push('Shift'); -// if (!modifiers.length) return key; -// modifiers.push(key); -// return modifiers.join('-'); -// } -// return function saneKeyboardEvents( -// /** Usually the textarea associated with a MQ instance, but can be another kind of element if `substituteTextarea` was used to replace it with something else. */ -// textarea, -// controller -// ) { -// var keydown = null; -// var keypress = null; -// // everyTick.listen() is called after key or clipboard events to -// // say "Hey, I think something was just typed" or "pasted" etc, -// // so that at all subsequent opportune times (next event or timeout), -// // will check for expected typed or pasted text. -// // Need to check repeatedly because #135: in Safari 5.1 (at least), -// // after selecting something and then typing, the textarea is -// // incorrectly reported as selected during the input event (but not -// // subsequently). -// var everyTick = new EveryTick(); -// function guardedTextareaSelect() { -// try { -// // IE can throw an 'Incorrect Function' error if you -// // try to select a textarea that is hidden. It seems -// // likely that we don't really care if the selection -// // fails to happen in this case. Why would the textarea -// // be hidden? And who would even be able to tell? -// if (textarea instanceof HTMLTextAreaElement) textarea.select(); -// } catch (e) {} -// } -// // -*- public methods -*- // -// function select(text) { -// // check textarea at least once/one last time before munging (so -// // no race condition if selection happens after keypress/paste but -// // before checkTextarea), then never again ('cos it's been munged) -// everyTick.trigger(); -// everyTick.clearListener(); -// if (textarea instanceof HTMLTextAreaElement) textarea.value = text; -// if (text) guardedTextareaSelect(); -// shouldBeSelected = !!text; -// } -// var shouldBeSelected = false; -// // -*- helper subroutines -*- // -// // Determine whether there's a selection in the textarea. -// // This will always return false in IE < 9, which don't support -// // HTMLTextareaElement::selection{Start,End}. -// function hasSelection() { -// if (!('selectionStart' in textarea)) return false; -// if (!(textarea instanceof HTMLTextAreaElement)) return false; -// return textarea.selectionStart !== textarea.selectionEnd; -// } -// function handleKey() { -// if (controller.options && controller.options.overrideKeystroke) { -// controller.options.overrideKeystroke(getMQKeyName(keydown), keydown); -// } else { -// controller.keystroke(getMQKeyName(keydown), keydown); -// } -// } -// // -*- event handlers -*- // -// function onKeydown(e) { -// everyTick.trigger(e); -// if (e.target !== textarea) return; -// keydown = e; -// keypress = null; -// if (shouldBeSelected) -// everyTick.listenOnce(function (e) { -// if (!(e && e.type === 'focusout')) { -// // re-select textarea in case it's an unrecognized key that clears -// // the selection, then never again, 'cos next thing might be blur -// guardedTextareaSelect(); -// } -// }); -// handleKey(); -// } -// function onKeypress(e) { -// everyTick.trigger(e); -// if (e.target !== textarea) return; -// // call the key handler for repeated keypresses. -// // This excludes keypresses that happen directly -// // after keydown. In that case, there will be -// // no previous keypress, so we skip it here -// if (keydown && keypress) handleKey(); -// keypress = e; -// // only check for typed text if this key can type text. Otherwise -// // you can end up with mathquill thinking text was typed if you -// // use the mq.keystroke('Right') command while a single character -// // is selected. Only detected in FF. -// if (!isArrowKey(e)) { -// everyTick.listen(typedText); -// } else { -// everyTick.listenOnce(maybeReselect); -// } -// } -// function onKeyup(e) { -// everyTick.trigger(e); -// if (e.target !== textarea) return; -// // Handle case of no keypress event being sent -// if (!!keydown && !keypress) { -// // only check for typed text if this key can type text. Otherwise -// // you can end up with mathquill thinking text was typed if you -// // use the mq.keystroke('Right') command while a single character -// // is selected. Only detected in FF. -// if (!isArrowKey(e)) { -// everyTick.listen(typedText); -// } else { -// everyTick.listenOnce(maybeReselect); -// } -// } -// } -// function typedText() { -// // If there is a selection, the contents of the textarea couldn't -// // possibly have just been typed in. -// // This happens in browsers like Firefox and Opera that fire -// // keypress for keystrokes that are not text entry and leave the -// // selection in the textarea alone, such as Ctrl-C. -// // Note: we assume that browsers that don't support hasSelection() -// // also never fire keypress on keystrokes that are not text entry. -// // This seems reasonably safe because: -// // - all modern browsers including IE 9+ support hasSelection(), -// // making it extremely unlikely any browser besides IE < 9 won't -// // - as far as we know IE < 9 never fires keypress on keystrokes -// // that aren't text entry, which is only as reliable as our -// // tests are comprehensive, but the IE < 9 way to do -// // hasSelection() is poorly documented and is also only as -// // reliable as our tests are comprehensive -// // If anything like #40 or #71 is reported in IE < 9, see -// // b1318e5349160b665003e36d4eedd64101ceacd8 -// if (hasSelection()) return; -// if (!(textarea instanceof HTMLTextAreaElement)) return; -// var text = textarea.value; -// if (text.length === 1) { -// textarea.value = ''; -// if (controller.options && controller.options.overrideTypedText) { -// controller.options.overrideTypedText(text); -// } else { -// controller.typedText(text); -// } -// } // in Firefox, keys that don't type text, just clear seln, fire keypress -// // https://github.com/mathquill/mathquill/issues/293#issuecomment-40997668 -// else maybeReselect(); // re-select if that's why we're here -// } -// function maybeReselect() { -// if (!(textarea instanceof HTMLTextAreaElement)) return; -// if (textarea.value.length > 1) { -// guardedTextareaSelect(); -// } -// } -// function onBlur() { -// keydown = null; -// keypress = null; -// everyTick.clearListener(); -// if (textarea instanceof HTMLTextAreaElement) textarea.value = ''; -// } -// function onPaste(e) { -// everyTick.trigger(); -// if (e.target !== textarea) return; -// // browsers are dumb. -// // -// // In Linux, middle-click pasting causes onPaste to be called, -// // when the textarea is not necessarily focused. We focus it -// // here to ensure that the pasted text actually ends up in the -// // textarea. -// // -// // It's pretty nifty that by changing focus in this handler, -// // we can change the target of the default action. (This works -// // on keydown too, FWIW). -// // -// // And by nifty, we mean dumb (but useful sometimes). -// if (document.activeElement !== textarea) { -// textarea.focus(); -// } -// everyTick.listen(function pastedText() { -// if (!(textarea instanceof HTMLTextAreaElement)) return; -// var text = textarea.value; -// textarea.value = ''; -// if (text) controller.paste(text); -// }); -// } -// function onInput(e) { -// everyTick.trigger(e); -// } -// if (controller.options && controller.options.disableCopyPaste) { -// controller.addTextareaEventListeners({ -// keydown: onKeydown, -// keypress: onKeypress, -// keyup: onKeyup, -// focusout: onBlur, -// copy: function (e) { -// e.preventDefault(); -// }, -// cut: function (e) { -// e.preventDefault(); -// }, -// paste: function (e) { -// everyTick.trigger(); -// e.preventDefault(); -// }, -// input: onInput, -// }); -// } else { -// controller.addTextareaEventListeners({ -// keydown: onKeydown, -// keypress: onKeypress, -// keyup: onKeyup, -// focusout: onBlur, -// cut: function () { -// everyTick.listenOnce(function () { -// controller.cut(); -// }); -// }, -// copy: function () { -// everyTick.listenOnce(function () { -// controller.copy(); -// }); -// }, -// paste: onPaste, -// input: onInput, -// }); -// } -// // -*- export public methods -*- // -// return { select: select }; -// }; -// })(); -// /*********************************************** -// * Export math in a human-readable text format -// * As you can see, only half-baked so far. -// **********************************************/ -// var Controller_exportText = /** @class */ (function (_super) { -// __extends(Controller_exportText, _super); -// function Controller_exportText() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// Controller_exportText.prototype.exportText = function () { -// return this.root.foldChildren('', function (text, child) { -// return text + child.text(); -// }); -// }; -// return Controller_exportText; -// })(ControllerBase); -// ControllerBase.onNotify(function (cursor, e) { -// // these try to cover all ways that mathquill can be modified -// if (e === 'edit' || e === 'replace' || e === undefined) { -// var controller = cursor.controller; -// if (!controller) return; -// if (!controller.options.enableDigitGrouping) return; -// // TODO - maybe reconsider these 3 states and drop down to only 2 -// // -// // blurred === false means we are focused. blurred === true or -// // blurred === undefined means we are not focused. -// if (controller.blurred !== false) return; -// controller.disableGroupingForSeconds(1); -// } -// }); -// var Controller_focusBlur = /** @class */ (function (_super) { -// __extends(Controller_focusBlur, _super); -// function Controller_focusBlur() { -// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; -// _this_1.handleTextareaFocusEditable = function () { -// var cursor = _this_1.cursor; -// _this_1.updateMathspeak(); -// _this_1.blurred = false; -// clearTimeout(_this_1.blurTimeout); -// domFrag(_this_1.container).addClass('dcg-mq-focused'); -// if (!cursor.parent) cursor.insAtRightEnd(_this_1.root); -// if (cursor.selection) { -// cursor.selection.domFrag().removeClass('dcg-mq-blur'); -// _this_1.selectionChanged(); //re-select textarea contents after tabbing away and back -// } else { -// cursor.show(); -// } -// _this_1.setOverflowClasses(); -// }; -// _this_1.handleTextareaBlurEditable = function () { -// if (_this_1.textareaSelectionTimeout) { -// clearTimeout(_this_1.textareaSelectionTimeout); -// _this_1.textareaSelectionTimeout = 0; -// } -// _this_1.disableGroupingForSeconds(0); -// _this_1.blurred = true; -// _this_1.blurTimeout = setTimeout(function () { -// // wait for blur on window; if -// _this_1.root.postOrder(function (node) { -// node.intentionalBlur(); -// }); // none, intentional blur: #264 -// _this_1.cursor.clearSelection().endSelection(); -// _this_1.blur(); -// _this_1.updateMathspeak(); -// _this_1.scrollHoriz(); -// }); -// window.addEventListener('blur', _this_1.handleWindowBlur); -// }; -// _this_1.handleTextareaFocusStatic = function () { -// _this_1.blurred = false; -// }; -// _this_1.handleTextareaBlurStatic = function () { -// if (_this_1.cursor.selection) { -// _this_1.cursor.selection.clear(); -// } -// //detaching during blur explodes in WebKit -// setTimeout(function () { -// domFrag(_this_1.getTextareaSpanOrThrow()).detach(); -// _this_1.blurred = true; -// }); -// }; -// _this_1.handleWindowBlur = function () { -// // blur event also fired on window, just switching -// clearTimeout(_this_1.blurTimeout); // tabs/windows, not intentional blur -// if (_this_1.cursor.selection) _this_1.cursor.selection.domFrag().addClass('dcg-mq-blur'); -// _this_1.blur(); -// _this_1.updateMathspeak(); -// }; -// return _this_1; -// } -// Controller_focusBlur.prototype.disableGroupingForSeconds = function (seconds) { -// var _this_1 = this; -// clearTimeout(this.__disableGroupingTimeout); -// if (seconds === 0) { -// this.root.domFrag().removeClass('dcg-mq-suppress-grouping'); -// } else { -// this.root.domFrag().addClass('dcg-mq-suppress-grouping'); -// this.__disableGroupingTimeout = setTimeout(function () { -// _this_1.root.domFrag().removeClass('dcg-mq-suppress-grouping'); -// }, seconds * 1000); -// } -// }; -// Controller_focusBlur.prototype.blur = function () { -// // not directly in the textarea blur handler so as to be -// this.cursor.hide().parent.blur(this.cursor); // synchronous with/in the same frame as -// domFrag(this.container).removeClass('dcg-mq-focused'); // clearing/blurring selection -// window.removeEventListener('blur', this.handleWindowBlur); -// if (this.options && this.options.resetCursorOnBlur) { -// this.cursor.resetToEnd(this); -// } -// }; -// Controller_focusBlur.prototype.addEditableFocusBlurListeners = function () { -// var ctrlr = this, -// cursor = ctrlr.cursor; -// this.addTextareaEventListeners({ -// focus: this.handleTextareaFocusEditable, -// blur: this.handleTextareaBlurEditable, -// }); -// ctrlr.blurred = true; -// cursor.hide().parent.blur(cursor); -// }; -// Controller_focusBlur.prototype.addStaticFocusBlurListeners = function () { -// this.addTextareaEventListeners({ -// focus: this.handleTextareaFocusStatic, -// blur: this.handleTextareaBlurStatic, -// }); -// }; -// return Controller_focusBlur; -// })(Controller_exportText); -// /** -// * TODO: I wanted to move MathBlock::focus and blur here, it would clean -// * up lots of stuff like, TextBlock::focus is set to MathBlock::focus -// * and TextBlock::blur calls MathBlock::blur, when instead they could -// * use inheritance and super_. -// * -// * Problem is, there's lots of calls to .focus()/.blur() on nodes -// * outside Controller::focusBlurEvents(), such as .postOrder('blur') on -// * insertion, which if MathBlock::blur becomes MQNode::blur, would add the -// * 'blur' CSS class to all MQSymbol's (because .isEmpty() is true for all -// * of them). -// * -// * I'm not even sure there aren't other troublesome calls to .focus() or -// * .blur(), so this is TODO for now. -// */ -// /***************************************** -// * Deals with the browser DOM events from -// * interaction with the typist. -// ****************************************/ -// /** -// * Only one incremental selection may be open at a time. Track whether -// * an incremental selection is open to help enforce this invariant. -// */ -// var INCREMENTAL_SELECTION_OPEN = false; -// var MQNode = /** @class */ (function (_super) { -// __extends(MQNode, _super); -// function MQNode() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// MQNode.prototype.keystroke = function (key, e, ctrlr) { -// var cursor = ctrlr.cursor; -// switch (key) { -// case 'Ctrl-Shift-Backspace': -// case 'Ctrl-Backspace': -// ctrlr.ctrlDeleteDir(L); -// break; -// case 'Shift-Backspace': -// case 'Backspace': -// ctrlr.backspace(); -// break; -// // Tab or Esc -> go one block right if it exists, else escape right. -// case 'Esc': -// case 'Tab': -// ctrlr.escapeDir(R, key, e); -// return; -// // Shift-Tab -> go one block left if it exists, else escape left. -// case 'Shift-Tab': -// case 'Shift-Esc': -// ctrlr.escapeDir(L, key, e); -// return; -// // End -> move to the end of the current block. -// case 'End': -// ctrlr.notify('move').cursor.insAtRightEnd(cursor.parent); -// ctrlr.aria.queue('end of').queue(cursor.parent, true); -// break; -// // Ctrl-End -> move all the way to the end of the root block. -// case 'Ctrl-End': -// ctrlr.notify('move').cursor.insAtRightEnd(ctrlr.root); -// ctrlr.aria.queue('end of').queue(ctrlr.ariaLabel).queue(ctrlr.root).queue(ctrlr.ariaPostLabel); -// break; -// // Shift-End -> select to the end of the current block. -// case 'Shift-End': -// ctrlr.selectToBlockEndInDir(R); -// break; -// // Ctrl-Shift-End -> select all the way to the end of the root block. -// case 'Ctrl-Shift-End': -// ctrlr.selectToRootEndInDir(R); -// break; -// // Home -> move to the start of the current block. -// case 'Home': -// ctrlr.notify('move').cursor.insAtLeftEnd(cursor.parent); -// ctrlr.aria.queue('beginning of').queue(cursor.parent, true); -// break; -// // Ctrl-Home -> move all the way to the start of the root block. -// case 'Ctrl-Home': -// ctrlr.notify('move').cursor.insAtLeftEnd(ctrlr.root); -// ctrlr.aria -// .queue('beginning of') -// .queue(ctrlr.ariaLabel) -// .queue(ctrlr.root) -// .queue(ctrlr.ariaPostLabel); -// break; -// // Shift-Home -> select to the start of the current block. -// case 'Shift-Home': -// ctrlr.selectToBlockEndInDir(L); -// break; -// // Ctrl-Shift-Home -> select all the way to the start of the root block. -// case 'Ctrl-Shift-Home': -// ctrlr.selectToRootEndInDir(L); -// break; -// case 'Left': -// ctrlr.moveLeft(); -// break; -// case 'Shift-Left': -// ctrlr.selectLeft(); -// break; -// case 'Ctrl-Left': -// break; -// case 'Right': -// ctrlr.moveRight(); -// break; -// case 'Shift-Right': -// ctrlr.selectRight(); -// break; -// case 'Ctrl-Right': -// break; -// case 'Up': -// ctrlr.moveUp(); -// break; -// case 'Down': -// ctrlr.moveDown(); -// break; -// case 'Shift-Up': -// ctrlr.withIncrementalSelection(function (selectDir) { -// if (cursor[L]) { -// while (cursor[L]) selectDir(L); -// } else { -// selectDir(L); -// } -// }); -// break; -// case 'Shift-Down': -// ctrlr.withIncrementalSelection(function (selectDir) { -// if (cursor[R]) { -// while (cursor[R]) selectDir(R); -// } else { -// selectDir(R); -// } -// }); -// break; -// case 'Ctrl-Up': -// break; -// case 'Ctrl-Down': -// break; -// case 'Ctrl-Shift-Del': -// case 'Ctrl-Del': -// ctrlr.ctrlDeleteDir(R); -// break; -// case 'Shift-Del': -// case 'Del': -// ctrlr.deleteForward(); -// break; -// case 'Meta-A': -// case 'Ctrl-A': -// ctrlr.selectAll(); -// break; -// // These remaining hotkeys are only of benefit to people running screen readers. -// case 'Ctrl-Alt-Up': // speak parent block that has focus -// if (cursor.parent.parent && cursor.parent.parent instanceof MQNode) -// ctrlr.aria.queue(cursor.parent.parent); -// else ctrlr.aria.queue('nothing above'); -// break; -// case 'Ctrl-Alt-Down': // speak current block that has focus -// if (cursor.parent && cursor.parent instanceof MQNode) ctrlr.aria.queue(cursor.parent); -// else ctrlr.aria.queue('block is empty'); -// break; -// case 'Ctrl-Alt-Left': // speak left-adjacent block -// if (cursor.parent.parent && cursor.parent.parent.getEnd(L)) { -// ctrlr.aria.queue(cursor.parent.parent.getEnd(L)); -// } else { -// ctrlr.aria.queue('nothing to the left'); -// } -// break; -// case 'Ctrl-Alt-Right': // speak right-adjacent block -// if (cursor.parent.parent && cursor.parent.parent.getEnd(R)) { -// ctrlr.aria.queue(cursor.parent.parent.getEnd(R)); -// } else { -// ctrlr.aria.queue('nothing to the right'); -// } -// break; -// case 'Ctrl-Alt-Shift-Down': // speak selection -// if (cursor.selection) -// ctrlr.aria.queue(cursor.selection.join('mathspeak', ' ').trim() + ' selected'); -// else ctrlr.aria.queue('nothing selected'); -// break; -// case 'Ctrl-Alt-=': -// case 'Ctrl-Alt-Shift-Right': // speak ARIA post label (evaluation or error) -// if (ctrlr.ariaPostLabel.length) ctrlr.aria.queue(ctrlr.ariaPostLabel); -// else ctrlr.aria.queue('no answer'); -// break; -// default: -// return; -// } -// ctrlr.aria.alert(); -// e === null || e === void 0 ? void 0 : e.preventDefault(); -// ctrlr.scrollHoriz(); -// }; -// MQNode.prototype.moveOutOf = function (_dir, _cursor, _updown) { -// pray('overridden or never called on this node', false); -// }; // called by Controller::escapeDir, moveDir -// MQNode.prototype.moveTowards = function (_dir, _cursor, _updown) { -// pray('overridden or never called on this node', false); -// }; // called by Controller::moveDir -// MQNode.prototype.deleteOutOf = function (_dir, _cursor) { -// pray('overridden or never called on this node', false); -// }; // called by Controller::deleteDir -// MQNode.prototype.deleteTowards = function (_dir, _cursor) { -// pray('overridden or never called on this node', false); -// }; // called by Controller::deleteDir -// MQNode.prototype.unselectInto = function (_dir, _cursor) { -// pray('overridden or never called on this node', false); -// }; // called by Controller::selectDir -// MQNode.prototype.selectOutOf = function (_dir, _cursor) { -// pray('overridden or never called on this node', false); -// }; // called by Controller::selectDir -// MQNode.prototype.selectTowards = function (_dir, _cursor) { -// pray('overridden or never called on this node', false); -// }; // called by Controller::selectDir -// return MQNode; -// })(NodeBase); -// ControllerBase.onNotify(function (cursor, e) { -// if (e === 'move' || e === 'upDown') cursor.show().clearSelection(); -// }); -// baseOptionProcessors.leftRightIntoCmdGoes = function (updown) { -// if (updown && updown !== 'up' && updown !== 'down') { -// throw '"up" or "down" required for leftRightIntoCmdGoes option, ' + 'got "' + updown + '"'; -// } -// return updown; -// }; -// ControllerBase.onNotify(function (cursor, e) { -// if (e !== 'upDown') cursor.upDownCache = {}; -// }); -// ControllerBase.onNotify(function (cursor, e) { -// if (e === 'edit') cursor.show().deleteSelection(); -// }); -// ControllerBase.onNotify(function (cursor, e) { -// if (e !== 'select') cursor.endSelection(); -// }); -// var Controller_keystroke = /** @class */ (function (_super) { -// __extends(Controller_keystroke, _super); -// function Controller_keystroke() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// Controller_keystroke.prototype.keystroke = function (key, evt) { -// this.cursor.parent.keystroke(key, evt, this.getControllerSelf()); -// }; -// Controller_keystroke.prototype.escapeDir = function (dir, _key, e) { -// prayDirection(dir); -// var cursor = this.cursor; -// // only prevent default of Tab if not in the root editable -// if (cursor.parent !== this.root) e === null || e === void 0 ? void 0 : e.preventDefault(); -// // want to be a noop if in the root editable (in fact, Tab has an unrelated -// // default browser action if so) -// if (cursor.parent === this.root) return; -// cursor.clearSelection(); -// cursor.parent.moveOutOf(dir, cursor); -// cursor.controller.aria.alert(); -// return this.notify('move'); -// }; -// Controller_keystroke.prototype.moveDir = function (dir) { -// prayDirection(dir); -// var cursor = this.cursor, -// updown = cursor.options.leftRightIntoCmdGoes; -// var cursorDir = cursor[dir]; -// if (cursor.selection) { -// cursor.insDirOf(dir, cursor.selection.getEnd(dir)); -// } else if (cursorDir) cursorDir.moveTowards(dir, cursor, updown); -// else cursor.parent.moveOutOf(dir, cursor, updown); -// return this.notify('move'); -// }; -// Controller_keystroke.prototype.moveLeft = function () { -// return this.moveDir(L); -// }; -// Controller_keystroke.prototype.moveRight = function () { -// return this.moveDir(R); -// }; -// /** -// * moveUp and moveDown have almost identical algorithms: -// * - first check left and right, if so insAtLeft/RightEnd of them -// * - else check the parent's 'upOutOf'/'downOutOf' property: -// * + if it's a function, call it with the cursor as the sole argument and -// * use the return value as if it were the value of the property -// * + if it's a Node, jump up or down into it: -// * - if there is a cached Point in the block, insert there -// * - else, seekHoriz within the block to the current x-coordinate (to be -// * as close to directly above/below the current position as possible) -// * + unless it's exactly `true`, stop bubbling -// */ -// Controller_keystroke.prototype.moveUp = function () { -// return this.moveUpDown('up'); -// }; -// Controller_keystroke.prototype.moveDown = function () { -// return this.moveUpDown('down'); -// }; -// Controller_keystroke.prototype.moveUpDown = function (dir) { -// var self = this; -// var cursor = self.notify('upDown').cursor; -// var dirInto; -// var dirOutOf; -// if (dir === 'up') { -// dirInto = 'upInto'; -// dirOutOf = 'upOutOf'; -// } else { -// dirInto = 'downInto'; -// dirOutOf = 'downOutOf'; -// } -// var cursorL = cursor[L]; -// var cursorR = cursor[R]; -// var cursorR_dirInto = cursorR && cursorR[dirInto]; -// var cursorL_dirInto = cursorL && cursorL[dirInto]; -// if (cursorR_dirInto) cursor.insAtLeftEnd(cursorR_dirInto); -// else if (cursorL_dirInto) cursor.insAtRightEnd(cursorL_dirInto); -// else { -// cursor.parent.bubble(function (ancestor) { -// // TODO - revist this -// var prop = ancestor[dirOutOf]; -// if (prop) { -// if (typeof prop === 'function') prop = prop.call(ancestor, cursor); // TODO - figure out if we need to assign to prop -// if (prop instanceof MQNode) cursor.jumpUpDown(ancestor, prop); -// if (prop !== true) return false; // TODO - figure out how this can return true -// } -// return undefined; -// }); -// } -// return self; -// }; -// Controller_keystroke.prototype.deleteDir = function (dir) { -// prayDirection(dir); -// var cursor = this.cursor; -// var cursorEl = cursor[dir]; -// var cursorElParent = cursor.parent.parent; -// var ctrlr = cursor.controller; -// if (cursorEl && cursorEl instanceof MQNode) { -// if (cursorEl.sides) { -// ctrlr.aria.queue( -// cursorEl.parent.chToCmd(cursorEl.sides[-dir].ch).mathspeak({ createdLeftOf: cursor }) -// ); -// // generally, speak the current element if it has no blocks, -// // but don't for text block commands as the deleteTowards method -// // in the TextCommand class is responsible for speaking the new character under the cursor. -// } else if (!cursorEl.blocks && cursorEl.parent.ctrlSeq !== '\\text') { -// ctrlr.aria.queue(cursorEl); -// } -// } else if (cursorElParent && cursorElParent instanceof MQNode) { -// if (cursorElParent.sides) { -// ctrlr.aria.queue( -// cursorElParent.parent -// .chToCmd(cursorElParent.sides[dir].ch) -// .mathspeak({ createdLeftOf: cursor }) -// ); -// } else if (cursorElParent.blocks && cursorElParent.mathspeakTemplate) { -// if (cursorElParent.upInto && cursorElParent.downInto) { -// // likely a fraction, and we just backspaced over the slash -// ctrlr.aria.queue(cursorElParent.mathspeakTemplate[1]); -// } else { -// var mst = cursorElParent.mathspeakTemplate; -// var textToQueue = dir === L ? mst[0] : mst[mst.length - 1]; -// ctrlr.aria.queue(textToQueue); -// } -// } else { -// ctrlr.aria.queue(cursorElParent); -// } -// } -// var hadSelection = cursor.selection; -// this.notify('edit'); // deletes selection if present -// if (!hadSelection) { -// var cursorDir = cursor[dir]; -// if (cursorDir) cursorDir.deleteTowards(dir, cursor); -// else cursor.parent.deleteOutOf(dir, cursor); -// } -// var cursorL = cursor[L]; -// var cursorR = cursor[R]; -// if (cursorL.siblingDeleted) cursorL.siblingDeleted(cursor.options, R); -// if (cursorR.siblingDeleted) cursorR.siblingDeleted(cursor.options, L); -// cursor.parent.bubble(function (node) { -// node.reflow(); -// return undefined; -// }); -// return this; -// }; -// Controller_keystroke.prototype.ctrlDeleteDir = function (dir) { -// prayDirection(dir); -// var cursor = this.cursor; -// if (!cursor[dir] || cursor.selection) return this.deleteDir(dir); -// this.notify('edit'); -// var fragRemoved; -// if (dir === L) { -// fragRemoved = new Fragment(cursor.parent.getEnd(L), cursor[L]); -// } else { -// fragRemoved = new Fragment(cursor[R], cursor.parent.getEnd(R)); -// } -// cursor.controller.aria.queue(fragRemoved); -// fragRemoved.remove(); -// cursor.insAtDirEnd(dir, cursor.parent); -// var cursorL = cursor[L]; -// var cursorR = cursor[R]; -// if (cursorL) cursorL.siblingDeleted(cursor.options, R); -// if (cursorR) cursorR.siblingDeleted(cursor.options, L); -// cursor.parent.bubble(function (node) { -// node.reflow(); -// return undefined; -// }); -// return this; -// }; -// Controller_keystroke.prototype.backspace = function () { -// return this.deleteDir(L); -// }; -// Controller_keystroke.prototype.deleteForward = function () { -// return this.deleteDir(R); -// }; -// /** -// * startIncrementalSelection, selectDirIncremental, and finishIncrementalSelection -// * should only be called by withIncrementalSelection because they must -// * be called in sequence. -// */ -// Controller_keystroke.prototype.startIncrementalSelection = function () { -// pray("Multiple selections can't be simultaneously open", !INCREMENTAL_SELECTION_OPEN); -// INCREMENTAL_SELECTION_OPEN = true; -// this.notify('select'); -// var cursor = this.cursor; -// if (!cursor.anticursor) cursor.startSelection(); -// }; -// /** -// * Update the selection model, stored in cursor, without modifying -// * selection DOM. -// * -// * startIncrementalSelection, selectDirIncremental, and finishIncrementalSelection -// * should only be called by withIncrementalSelection because they must -// * be called in sequence. -// */ -// Controller_keystroke.prototype.selectDirIncremental = function (dir) { -// pray('A selection is open', INCREMENTAL_SELECTION_OPEN); -// INCREMENTAL_SELECTION_OPEN = true; -// var cursor = this.cursor, -// seln = cursor.selection; -// prayDirection(dir); -// var node = cursor[dir]; -// if (node) { -// // "if node we're selecting towards is inside selection (hence retracting) -// // and is on the *far side* of the selection (hence is only node selected) -// // and the anticursor is *inside* that node, not just on the other side" -// if (seln && seln.getEnd(dir) === node && cursor.anticursor[-dir] !== node) { -// node.unselectInto(dir, cursor); -// } else node.selectTowards(dir, cursor); -// } else cursor.parent.selectOutOf(dir, cursor); -// }; -// /** -// * Update selection DOM to match cursor model -// * -// * startIncrementalSelection, selectDirIncremental, and finishIncrementalSelection -// * should only be called by withIncrementalSelection because they must -// * be called in sequence. -// */ -// Controller_keystroke.prototype.finishIncrementalSelection = function () { -// pray('A selection is open', INCREMENTAL_SELECTION_OPEN); -// var cursor = this.cursor; -// cursor.clearSelection(); -// cursor.select() || cursor.show(); -// var selection = cursor.selection; -// if (selection) { -// cursor.controller.aria.clear().queue(selection.join('mathspeak', ' ').trim() + ' selected'); // clearing first because selection fires several times, and we don't want repeated speech. -// } -// INCREMENTAL_SELECTION_OPEN = false; -// }; -// /** -// * Used to build a selection incrementally in a loop. Calls the passed -// * callback with a selectDir function that may be called many times, -// * and defers updating the view until the incremental selection is -// * complete -// * -// * Wraps up calling -// * -// * this.startSelection() -// * this.selectDirIncremental(dir) // possibly many times -// * this.finishSelection() -// * -// * with extra error handling and invariant enforcement -// */ -// Controller_keystroke.prototype.withIncrementalSelection = function (cb) { -// var _this_1 = this; -// try { -// this.startIncrementalSelection(); -// try { -// cb(function (dir) { -// return _this_1.selectDirIncremental(dir); -// }); -// } finally { -// // Since we have started a selection, attempt to finish it even -// // if the callback throws an error -// this.finishIncrementalSelection(); -// } -// } finally { -// // Mark selection as closed even if finishSelection throws an -// // error. Makes a possible error in finishSelection more -// // recoverable -// INCREMENTAL_SELECTION_OPEN = false; -// } -// }; -// /** -// * Grow selection one unit in the given direction -// * -// * Note, this should not be called in a loop. To incrementally grow a -// * selection, use withIncrementalSelection -// */ -// Controller_keystroke.prototype.selectDir = function (dir) { -// this.withIncrementalSelection(function (selectDir) { -// return selectDir(dir); -// }); -// }; -// Controller_keystroke.prototype.selectLeft = function () { -// return this.selectDir(L); -// }; -// Controller_keystroke.prototype.selectRight = function () { -// return this.selectDir(R); -// }; -// Controller_keystroke.prototype.selectAll = function () { -// this.notify('move'); -// var cursor = this.cursor; -// cursor.insAtRightEnd(this.root); -// this.withIncrementalSelection(function (selectDir) { -// while (cursor[L]) selectDir(L); -// }); -// }; -// Controller_keystroke.prototype.selectToBlockEndInDir = function (dir) { -// var cursor = this.cursor; -// this.withIncrementalSelection(function (selectDir) { -// while (cursor[dir]) selectDir(dir); -// }); -// }; -// Controller_keystroke.prototype.selectToRootEndInDir = function (dir) { -// var _this_1 = this; -// var cursor = this.cursor; -// this.withIncrementalSelection(function (selectDir) { -// while (cursor[dir] || cursor.parent !== _this_1.root) { -// selectDir(dir); -// } -// }); -// }; -// return Controller_keystroke; -// })(Controller_focusBlur); -// var TempSingleCharNode = /** @class */ (function (_super) { -// __extends(TempSingleCharNode, _super); -// function TempSingleCharNode(_char) { -// return _super.call(this) || this; -// } -// return TempSingleCharNode; -// })(MQNode); -// // Parser MathBlock -// var latexMathParser = (function () { -// function commandToBlock(cmd) { -// // can also take in a Fragment -// var block = new MathBlock(); -// cmd.adopt(block, 0, 0); -// return block; -// } -// function joinBlocks(blocks) { -// var firstBlock = blocks[0] || new MathBlock(); -// for (var i = 1; i < blocks.length; i += 1) { -// blocks[i].children().adopt(firstBlock, firstBlock.getEnd(R), 0); -// } -// return firstBlock; -// } -// var string = Parser.string; -// var regex = Parser.regex; -// var letter = Parser.letter; -// var digit = Parser.digit; -// var any = Parser.any; -// var optWhitespace = Parser.optWhitespace; -// var succeed = Parser.succeed; -// var fail = Parser.fail; -// // Parsers yielding either MathCommands, or Fragments of MathCommands -// // (either way, something that can be adopted by a MathBlock) -// var variable = letter.map(function (c) { -// return new Letter(c); -// }); -// var number = digit.map(function (c) { -// return new Digit(c); -// }); -// var symbol = regex(/^[^${}\\_^]/).map(function (c) { -// return new VanillaSymbol(c); -// }); -// var controlSequence = regex(/^[^\\a-eg-zA-Z]/) // hotfix #164; match MathBlock::write -// .or( -// string('\\').then( -// regex(/^[a-z]+/i) -// .or(regex(/^\s+/).result(' ')) -// .or(any) -// ) -// ) -// .then(function (ctrlSeq) { -// // TODO - is Parser correct? -// var cmdKlass = LatexCmds[ctrlSeq]; -// if (cmdKlass) { -// if (cmdKlass.constructor) { -// var actualClass = cmdKlass; // TODO - figure out how to know the difference -// return new actualClass(ctrlSeq).parser(); -// } else { -// var builder = cmdKlass; // TODO - figure out how to know the difference -// return builder(ctrlSeq).parser(); -// } -// } else { -// return fail('unknown command: \\' + ctrlSeq); -// } -// }); -// var command = controlSequence.or(variable).or(number).or(symbol); -// // Parsers yielding MathBlocks -// var mathGroup = string('{') -// .then(function () { -// return mathSequence; -// }) -// .skip(string('}')); -// var mathBlock = optWhitespace.then(mathGroup.or(command.map(commandToBlock))); -// var mathSequence = mathBlock.many().map(joinBlocks).skip(optWhitespace); -// var optMathBlock = string('[') -// .then( -// mathBlock -// .then(function (block) { -// return block.join('latex') !== ']' ? succeed(block) : fail(''); -// }) -// .many() -// .map(joinBlocks) -// .skip(optWhitespace) -// ) -// .skip(string(']')); -// var latexMath = mathSequence; -// latexMath.block = mathBlock; -// latexMath.optBlock = optMathBlock; -// return latexMath; -// })(); -// baseOptionProcessors.maxDepth = function (depth) { -// return typeof depth === 'number' ? depth : undefined; -// }; -// var Controller_latex = /** @class */ (function (_super) { -// __extends(Controller_latex, _super); -// function Controller_latex() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// Controller_latex.prototype.cleanLatex = function (latex) { -// //prune unnecessary spaces -// return latex.replace(/(\\[a-z]+) (?![a-z])/gi, '$1'); -// }; -// Controller_latex.prototype.exportLatex = function () { -// return this.cleanLatex(this.root.latex()); -// }; -// Controller_latex.prototype.writeLatex = function (latex) { -// var cursor = this.notify('edit').cursor; -// cursor.parent.writeLatex(cursor, latex); -// return this; -// }; -// Controller_latex.prototype.exportLatexSelection = function () { -// var ctx = { -// latex: '', -// startIndex: -1, -// endIndex: -1, -// }; -// var selection = this.cursor.selection; -// if (selection) { -// ctx.startSelectionBefore = selection.getEnd(L); -// ctx.endSelectionAfter = selection.getEnd(R); -// } else { -// var cursorL = this.cursor[L]; -// if (cursorL) { -// ctx.startSelectionAfter = cursorL; -// } else { -// ctx.startSelectionBefore = this.cursor.parent; -// } -// var cursorR = this.cursor[R]; -// if (cursorR) { -// ctx.endSelectionBefore = cursorR; -// } else { -// ctx.endSelectionAfter = this.cursor.parent; -// } -// } -// this.root.latexRecursive(ctx); -// // need to clean the latex -// var originalLatex = ctx.latex; -// var cleanLatex = this.cleanLatex(originalLatex); -// var startIndex = ctx.startIndex; -// var endIndex = ctx.endIndex; -// // assumes that the cleaning process will only remove characters. We -// // run through the originalLatex and cleanLatex to find differences. -// // when we find differences we see how many characters are dropped until -// // we sync back up. While detecting missing characters we decrement the -// // startIndex and endIndex if appropriate. -// var j = 0; -// for (var i = 0; i < ctx.endIndex; i++) { -// if (originalLatex[i] !== cleanLatex[j]) { -// if (i < ctx.startIndex) { -// startIndex -= 1; -// } -// endIndex -= 1; -// // do not increment j. We wan to keep looking at this same -// // cleanLatex character until we find it in the originalLatex -// } else { -// j += 1; //move to next cleanLatex character -// } -// } -// return { -// latex: cleanLatex, -// startIndex: startIndex, -// endIndex: endIndex, -// }; -// }; -// Controller_latex.prototype.classifyLatexForEfficientUpdate = function (latex) { -// if (typeof latex !== 'string') return; -// var matches = latex.match(/-?[0-9.]+$/g); -// if (matches && matches.length === 1) { -// return { -// latex: latex, -// prefix: latex.substr(0, latex.length - matches[0].length), -// digits: matches[0], -// }; -// } -// return; -// }; -// Controller_latex.prototype.updateLatexMathEfficiently = function (latex, oldLatex) { -// var _c, _d, _e, _f; -// // Note, benchmark/update.html is useful for measuring the -// // performance of renderLatexMathEfficiently -// var root = this.root; -// var oldClassification; -// var classification = this.classifyLatexForEfficientUpdate(latex); -// if (classification) { -// oldClassification = this.classifyLatexForEfficientUpdate(oldLatex); -// if (!oldClassification || oldClassification.prefix !== classification.prefix) { -// return false; -// } -// } else { -// return false; -// } -// // check if minus sign is changing -// var oldDigits = oldClassification.digits; -// var newDigits = classification.digits; -// var oldMinusSign = false; -// var newMinusSign = false; -// if (oldDigits[0] === '-') { -// oldMinusSign = true; -// oldDigits = oldDigits.substr(1); -// } -// if (newDigits[0] === '-') { -// newMinusSign = true; -// newDigits = newDigits.substr(1); -// } -// // start at the very end -// var charNode = this.root.getEnd(R); -// var oldCharNodes = []; -// for (var i = oldDigits.length - 1; i >= 0; i--) { -// // the tree does not match what we expect -// if (!charNode || charNode.ctrlSeq !== oldDigits[i]) { -// return false; -// } -// // the trailing digits are not just under the root. We require the root -// // to be the parent so that we can be sure we do not need a reflow to -// // grow parens. -// if (charNode.parent !== root) { -// return false; -// } -// // push to the start. We're traversing backwards -// oldCharNodes.unshift(charNode); -// // move left one character -// charNode = charNode[L]; -// } -// // remove the minus sign -// if (oldMinusSign && !newMinusSign) { -// var oldMinusNode = charNode; -// if (!oldMinusNode) return false; -// if (oldMinusNode.ctrlSeq !== '-') return false; -// if (oldMinusNode[R] !== oldCharNodes[0]) return false; -// if (oldMinusNode.parent !== root) return false; -// var oldMinusNodeL = oldMinusNode[L]; -// if (oldMinusNodeL && oldMinusNodeL.parent !== root) return false; -// oldCharNodes[0][L] = oldMinusNode[L]; -// if (root.getEnd(L) === oldMinusNode) { -// root.setEnds(((_c = {}), (_c[L] = oldCharNodes[0]), (_c[R] = root.getEnd(R)), _c)); -// } -// if (oldMinusNodeL) oldMinusNodeL[R] = oldCharNodes[0]; -// oldMinusNode.domFrag().remove(); -// } -// // add a minus sign -// if (!oldMinusSign && newMinusSign) { -// var newMinusNode = new PlusMinus('-'); -// var minusSpan = document.createElement('span'); -// minusSpan.textContent = '-'; -// newMinusNode.setDOM(minusSpan); -// var oldCharNodes0L = oldCharNodes[0][L]; -// if (oldCharNodes0L) oldCharNodes0L[R] = newMinusNode; -// if (root.getEnd(L) === oldCharNodes[0]) { -// root.setEnds(((_d = {}), (_d[L] = newMinusNode), (_d[R] = root.getEnd(R)), _d)); -// } -// newMinusNode.parent = root; -// newMinusNode[L] = oldCharNodes[0][L]; -// newMinusNode[R] = oldCharNodes[0]; -// oldCharNodes[0][L] = newMinusNode; -// newMinusNode.contactWeld(this.cursor); // decide if binary operator -// newMinusNode.domFrag().insertBefore(oldCharNodes[0].domFrag()); -// } -// // update the text of the current nodes -// var commonLength = Math.min(oldDigits.length, newDigits.length); -// for (i = 0; i < commonLength; i++) { -// var newText = newDigits[i]; -// charNode = oldCharNodes[i]; -// if (charNode.ctrlSeq !== newText) { -// charNode.ctrlSeq = newText; -// charNode.domFrag().oneElement().textContent = newText; -// charNode.mathspeakName = newText; -// } -// } -// // remove the extra digits at the end -// if (oldDigits.length > newDigits.length) { -// charNode = oldCharNodes[newDigits.length - 1]; -// root.setEnds(((_e = {}), (_e[L] = root.getEnd(L)), (_e[R] = charNode), _e)); -// charNode[R] = 0; -// for (i = oldDigits.length - 1; i >= commonLength; i--) { -// oldCharNodes[i].domFrag().remove(); -// } -// } -// // add new digits after the existing ones -// if (newDigits.length > oldDigits.length) { -// var frag = document.createDocumentFragment(); -// for (i = commonLength; i < newDigits.length; i++) { -// var span = document.createElement('span'); -// span.className = 'dcg-mq-digit'; -// span.textContent = newDigits[i]; -// var newNode = new Digit(newDigits[i]); -// newNode.parent = root; -// newNode.setDOM(span); -// frag.appendChild(span); -// // splice this node in -// newNode[L] = root.getEnd(R); -// newNode[R] = 0; -// var newNodeL = newNode[L]; -// newNodeL[R] = newNode; -// root.setEnds(((_f = {}), (_f[L] = root.getEnd(L)), (_f[R] = newNode), _f)); -// } -// root.domFrag().oneElement().appendChild(frag); -// } -// var currentLatex = this.exportLatex(); -// if (currentLatex !== latex) { -// console.warn( -// 'tried updating latex efficiently but did not work. Attempted: ' + -// latex + -// ' but wrote: ' + -// currentLatex -// ); -// return false; -// } -// var rightMost = root.getEnd(R); -// if (rightMost) { -// rightMost.fixDigitGrouping(this.cursor.options); -// } -// return true; -// }; -// Controller_latex.prototype.renderLatexMathFromScratch = function (latex) { -// var _c; -// var root = this.root, -// cursor = this.cursor; -// var all = Parser.all; -// var eof = Parser.eof; -// var block = latexMathParser.skip(eof).or(all.result(false)).parse(latex); -// root.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); -// if (block) { -// block.children().adopt(root, 0, 0); -// } -// if (block) { -// var frag = root.domFrag(); -// frag.children().remove(); -// frag.oneElement().appendChild(block.html()); -// root.finalizeInsert(cursor.options, cursor); -// } else { -// root.domFrag().empty(); -// } -// }; -// Controller_latex.prototype.renderLatexMath = function (latex) { -// var cursor = this.cursor; -// var root = this.root; -// this.notify('replace'); -// cursor.clearSelection(); -// var oldLatex = this.exportLatex(); -// if (!root.getEnd(L) || !root.getEnd(R) || oldLatex !== latex) { -// this.updateLatexMathEfficiently(latex, oldLatex) || this.renderLatexMathFromScratch(latex); -// this.updateMathspeak(); -// } -// cursor.insAtRightEnd(root); -// }; -// Controller_latex.prototype.renderLatexText = function (latex) { -// var _c; -// var root = this.root, -// cursor = this.cursor; -// root.domFrag().children().slice(1).remove(); -// root.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); -// delete cursor.selection; -// cursor.show().insAtRightEnd(root); -// var regex = Parser.regex; -// var string = Parser.string; -// var eof = Parser.eof; -// var all = Parser.all; -// // Parser RootMathCommand -// var mathMode = string('$') -// .then(latexMathParser) -// // because TeX is insane, math mode doesn't necessarily -// // have to end. So we allow for the case that math mode -// // continues to the end of the stream. -// .skip(string('$').or(eof)) -// .map(function (block) { -// // HACK FIXME: this shouldn't have to have access to cursor -// var rootMathCommand = new RootMathCommand(cursor); -// rootMathCommand.createBlocks(); -// var rootMathBlock = rootMathCommand.getEnd(L); -// block.children().adopt(rootMathBlock, 0, 0); -// return rootMathCommand; -// }); -// var escapedDollar = string('\\$').result('$'); -// var textChar = escapedDollar.or(regex(/^[^$]/)).map(function (ch) { -// return new VanillaSymbol(ch); -// }); -// var latexText = mathMode.or(textChar).many(); -// var commands = latexText.skip(eof).or(all.result(false)).parse(latex); -// if (commands) { -// for (var i = 0; i < commands.length; i += 1) { -// commands[i].adopt(root, root.getEnd(R), 0); -// } -// domFrag(root.html()).appendTo(root.domFrag().oneElement()); -// root.finalizeInsert(cursor.options, cursor); -// } -// }; -// return Controller_latex; -// })(Controller_keystroke); -// /******************************************************** -// * Deals with mouse events for clicking, drag-to-select -// *******************************************************/ -// var ignoreNextMouseDownNoop = function (_el) { -// return false; -// }; -// Options.prototype.ignoreNextMousedown = ignoreNextMouseDownNoop; -// // Whenever edits to the tree occur, in-progress selection events -// // must be invalidated and selection changes must not be applied to -// // the edited tree. cancelSelectionOnEdit takes care of this. -// var cancelSelectionOnEdit; -// (function () { -// ControllerBase.onNotify(function (cursor, e) { -// if (e === 'edit' || e === 'replace') { -// // this will be called any time ANY mathquill is edited. We only want -// // to cancel selection if the selection is happening within the mathquill -// // that dispatched the notify. Otherwise you won't be able to select any -// // mathquills while a slider is playing. -// if (cancelSelectionOnEdit && cancelSelectionOnEdit.cursor === cursor) { -// cancelSelectionOnEdit.cb(); -// } -// } -// }); -// })(); -// var Controller_mouse = /** @class */ (function (_super) { -// __extends(Controller_mouse, _super); -// function Controller_mouse() { -// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; -// _this_1.handleMouseDown = function (e) { -// var rootElement = closest(e.target, '.dcg-mq-root-block'); -// var root = -// (rootElement && NodeBase.getNodeOfElement(rootElement)) || -// NodeBase.getNodeOfElement(_this_1.root.domFrag().oneElement()); -// var ownerDocument = root.domFrag().firstNode().ownerDocument; -// var ctrlr = root.controller, -// cursor = ctrlr.cursor, -// blink = cursor.blink; -// var textareaSpan = ctrlr.getTextareaSpanOrThrow(); -// var textarea = ctrlr.getTextareaOrThrow(); -// e.preventDefault(); // doesn't work in IE\u22648, but it's a one-line fix: -// e.target.unselectable = true; // http://jsbin.com/yagekiji/1 // TODO - no idea what this unselectable property is -// if (cursor.options.ignoreNextMousedown(e)) return; -// else cursor.options.ignoreNextMousedown = ignoreNextMouseDownNoop; -// var lastMousemoveTarget = null; -// function mousemove(e) { -// lastMousemoveTarget = e.target; -// } -// function onDocumentMouseMove(e) { -// if (!cursor.anticursor) cursor.startSelection(); -// ctrlr.seek(lastMousemoveTarget, e.clientX, e.clientY).cursor.select(); -// if (cursor.selection) -// cursor.controller.aria -// .clear() -// .queue(cursor.selection.join('mathspeak') + ' selected') -// .alert(); -// lastMousemoveTarget = null; -// } -// // outside rootElement, the MathQuill node corresponding to the target (if any) -// // won't be inside this root, so don't mislead Controller::seek with it -// function unbindListeners() { -// // delete the mouse handlers now that we're not dragging anymore -// rootElement === null || rootElement === void 0 -// ? void 0 -// : rootElement.removeEventListener('mousemove', mousemove); -// ownerDocument === null || ownerDocument === void 0 -// ? void 0 -// : ownerDocument.removeEventListener('mousemove', onDocumentMouseMove); -// ownerDocument === null || ownerDocument === void 0 -// ? void 0 -// : ownerDocument.removeEventListener('mouseup', onDocumentMouseUp); -// cancelSelectionOnEdit = undefined; -// } -// function updateCursor() { -// if (ctrlr.editable) { -// cursor.show(); -// cursor.controller.aria.queue(cursor.parent).alert(); -// } else { -// domFrag(textareaSpan).detach(); -// } -// } -// function onDocumentMouseUp() { -// cursor.blink = blink; -// if (!cursor.selection) updateCursor(); -// unbindListeners(); -// } -// var wasEdited; -// cancelSelectionOnEdit = { -// cursor: cursor, -// cb: function () { -// // If an edit happens while the mouse is down, the existing -// // selection is no longer valid. Clear it and unbind listeners, -// // similar to what happens on mouseup. -// wasEdited = true; -// cursor.blink = blink; -// cursor.clearSelection(); -// updateCursor(); -// unbindListeners(); -// }, -// }; -// if (ctrlr.blurred) { -// if (rootElement && !ctrlr.editable) { -// domFrag(rootElement).prepend(domFrag(textareaSpan)); -// } -// textarea.focus(); -// // focus call may bubble to clients, who may then write to -// // mathquill, triggering cancelSelectionOnEdit. If that happens, we -// // don't want to stop the cursor blink or bind listeners, -// // so return early. -// if (wasEdited) return; -// } -// cursor.blink = noop; -// ctrlr.seek(e.target, e.clientX, e.clientY).cursor.startSelection(); -// rootElement === null || rootElement === void 0 -// ? void 0 -// : rootElement.addEventListener('mousemove', mousemove); -// ownerDocument === null || ownerDocument === void 0 -// ? void 0 -// : ownerDocument.addEventListener('mousemove', onDocumentMouseMove); -// ownerDocument === null || ownerDocument === void 0 -// ? void 0 -// : ownerDocument.addEventListener('mouseup', onDocumentMouseUp); -// // listen on document not just body to not only hear about mousemove and -// // mouseup on page outside field, but even outside page, except iframes: https://github.com/mathquill/mathquill/commit/8c50028afcffcace655d8ae2049f6e02482346c5#commitcomment-6175800 -// }; -// return _this_1; -// } -// Controller_mouse.prototype.addMouseEventListener = function () { -// //drag-to-select event handling -// this.container.addEventListener('mousedown', this.handleMouseDown); -// }; -// Controller_mouse.prototype.removeMouseEventListener = function () { -// this.container.removeEventListener('mousedown', this.handleMouseDown); -// }; -// Controller_mouse.prototype.seek = function (targetElm, clientX, _clientY) { -// var cursor = this.notify('select').cursor; -// var node; -// // we can click on an element that is deeply nested past the point -// // that mathquill knows about. We need to traverse up to the first -// // node that mathquill is aware of -// while (targetElm) { -// // try to find the MQ Node associated with the DOM Element -// node = NodeBase.getNodeOfElement(targetElm); -// if (node) break; -// // must be too deep, traverse up to the parent DOM Element -// targetElm = targetElm.parentElement; -// } -// // Could not find any nodes, just use the root -// if (!node) { -// node = this.root; -// } -// // don't clear selection until after getting node from target, in case -// // target was selection span, otherwise target will have no parent and will -// // seek from root, which is less accurate (e.g. fraction) -// cursor.clearSelection().show(); -// node.seek(clientX, cursor); -// this.scrollHoriz(); // before .selectFrom when mouse-selecting, so -// // always hits no-selection case in scrollHoriz and scrolls slower -// return this; -// }; -// return Controller_mouse; -// })(Controller_latex); -// /*********************************************** -// * Horizontal panning for editable fields that -// * overflow their width -// **********************************************/ -// var Controller_scrollHoriz = /** @class */ (function (_super) { -// __extends(Controller_scrollHoriz, _super); -// function Controller_scrollHoriz() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// Controller_scrollHoriz.prototype.setOverflowClasses = function () { -// var root = this.root.domFrag().oneElement(); -// var shouldHaveOverflowRight = false; -// var shouldHaveOverflowLeft = false; -// if (!this.blurred) { -// var width = getBoundingClientRect(root).width; -// var scrollWidth = root.scrollWidth; -// var scroll = root.scrollLeft; -// shouldHaveOverflowRight = scrollWidth > width + scroll; -// shouldHaveOverflowLeft = scroll > 0; -// } -// if (root.classList.contains('dcg-mq-editing-overflow-right') !== shouldHaveOverflowRight) -// root.classList.toggle('dcg-mq-editing-overflow-right'); -// if (root.classList.contains('dcg-mq-editing-overflow-left') !== shouldHaveOverflowLeft) -// root.classList.toggle('dcg-mq-editing-overflow-left'); -// }; -// Controller_scrollHoriz.prototype.scrollHoriz = function () { -// var _this_1 = this; -// var cursor = this.cursor, -// seln = cursor.selection; -// var rootRect = getBoundingClientRect(this.root.domFrag().oneElement()); -// if (cursor.domFrag().isEmpty() && !seln) { -// if (this.cancelScrollHoriz) { -// this.cancelScrollHoriz(); -// this.cancelScrollHoriz = undefined; -// } -// var rootElt_1 = this.root.domFrag().oneElement(); -// var start_1 = rootElt_1.scrollLeft; -// animate(this.getScrollAnimationDuration(), function (progress, scheduleNext, cancel) { -// if (progress >= 1) { -// _this_1.cancelScrollHoriz = undefined; -// rootElt_1.scrollLeft = 0; -// _this_1.setOverflowClasses(); -// } else { -// _this_1.cancelScrollHoriz = cancel; -// scheduleNext(); -// rootElt_1.scrollLeft = Math.round((1 - progress) * start_1); -// } -// }); -// return; -// } else if (!seln) { -// var x = getBoundingClientRect(cursor.domFrag().oneElement()).left; -// if (x > rootRect.right - 20) var scrollBy = x - (rootRect.right - 20); -// else if (x < rootRect.left + 20) var scrollBy = x - (rootRect.left + 20); -// else return; -// } else { -// var rect = getBoundingClientRect(seln.domFrag().oneElement()); -// var overLeft = rect.left - (rootRect.left + 20); -// var overRight = rect.right - (rootRect.right - 20); -// if (seln.getEnd(L) === cursor[R]) { -// if (overLeft < 0) var scrollBy = overLeft; -// else if (overRight > 0) { -// if (rect.left - overRight < rootRect.left + 20) var scrollBy = overLeft; -// else var scrollBy = overRight; -// } else return; -// } else { -// if (overRight > 0) var scrollBy = overRight; -// else if (overLeft < 0) { -// if (rect.right - overLeft > rootRect.right - 20) var scrollBy = overRight; -// else var scrollBy = overLeft; -// } else return; -// } -// } -// var root = this.root.domFrag().oneElement(); -// if (scrollBy < 0 && root.scrollLeft === 0) return; -// if (scrollBy > 0 && root.scrollWidth <= root.scrollLeft + rootRect.width) return; -// if (this.cancelScrollHoriz) { -// this.cancelScrollHoriz(); -// this.cancelScrollHoriz = undefined; -// } -// var rootElt = this.root.domFrag().oneElement(); -// var start = rootElt.scrollLeft; -// animate(this.getScrollAnimationDuration(), function (progress, scheduleNext, cancel) { -// if (progress >= 1) { -// _this_1.cancelScrollHoriz = undefined; -// rootElt.scrollLeft = Math.round(start + scrollBy); -// _this_1.setOverflowClasses(); -// } else { -// _this_1.cancelScrollHoriz = cancel; -// scheduleNext(); -// rootElt.scrollLeft = Math.round(start + progress * scrollBy); -// } -// }); -// }; -// Controller_scrollHoriz.prototype.getScrollAnimationDuration = function () { -// var _c; -// return (_c = this.options.scrollAnimationDuration) !== null && _c !== void 0 ? _c : 100; -// }; -// return Controller_scrollHoriz; -// })(Controller_mouse); -// /********************************************* -// * Manage the MathQuill instance's textarea -// * (as owned by the Controller) -// ********************************************/ -// Options.prototype.substituteTextarea = function () { -// return h('textarea', { -// autocapitalize: 'off', -// autocomplete: 'off', -// autocorrect: 'off', -// spellcheck: false, -// 'x-palm-disable-ste-all': true, -// }); -// }; -// function defaultSubstituteKeyboardEvents(jq, controller) { -// return saneKeyboardEvents(jq[0], controller); -// } -// Options.prototype.substituteKeyboardEvents = defaultSubstituteKeyboardEvents; -// var Controller = /** @class */ (function (_super) { -// __extends(Controller, _super); -// function Controller() { -// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; -// _this_1.selectFn = noop; -// return _this_1; -// } -// Controller.prototype.createTextarea = function () { -// this.textareaSpan = h('span', { class: 'dcg-mq-textarea' }); -// var textarea = this.options.substituteTextarea(); -// if (!textarea.nodeType) { -// throw 'substituteTextarea() must return a DOM element, got ' + textarea; -// } -// this.textarea = domFrag(textarea).appendTo(this.textareaSpan).oneElement(); -// var ctrlr = this; -// ctrlr.cursor.selectionChanged = function () { -// ctrlr.selectionChanged(); -// }; -// }; -// Controller.prototype.selectionChanged = function () { -// var ctrlr = this; -// // throttle calls to setTextareaSelection(), because setting textarea.value -// // and/or calling textarea.select() can have anomalously bad performance: -// // https://github.com/mathquill/mathquill/issues/43#issuecomment-1399080 -// // -// // Note, this timeout may be cleared by the blur handler in focusBlur.js -// if (!ctrlr.textareaSelectionTimeout) { -// ctrlr.textareaSelectionTimeout = setTimeout(function () { -// ctrlr.setTextareaSelection(); -// }); -// } -// }; -// Controller.prototype.setTextareaSelection = function () { -// this.textareaSelectionTimeout = 0; -// var latex = ''; -// if (this.cursor.selection) { -// //cleanLatex prunes unnecessary spaces. defined in latex.js -// latex = this.cleanLatex(this.cursor.selection.join('latex')); -// if (this.options.statelessClipboard) { -// // FIXME: like paste, only this works for math fields; should ask parent -// latex = '$' + latex + '$'; -// } -// } -// this.selectFn(latex); -// }; -// Controller.prototype.staticMathTextareaEvents = function () { -// var ctrlr = this; -// this.removeTextareaEventListener('cut'); -// this.removeTextareaEventListener('paste'); -// if (ctrlr.options.disableCopyPaste) { -// this.removeTextareaEventListener('copy'); -// } else { -// this.addTextareaEventListeners({ -// copy: function () { -// ctrlr.setTextareaSelection(); -// }, -// }); -// } -// this.addStaticFocusBlurListeners(); -// ctrlr.selectFn = function (text) { -// var textarea = ctrlr.getTextareaOrThrow(); -// if (!(textarea instanceof HTMLTextAreaElement)) return; -// textarea.value = text; -// if (text) textarea.select(); -// }; -// }; -// Controller.prototype.editablesTextareaEvents = function () { -// var ctrlr = this; -// var textarea = ctrlr.getTextareaOrThrow(); -// var textareaSpan = ctrlr.getTextareaSpanOrThrow(); -// if (this.options.version < 3) { -// var $ = this.options.assertJquery(); -// var keyboardEventsShim = this.options.substituteKeyboardEvents($(textarea), this); -// this.selectFn = function (text) { -// keyboardEventsShim.select(text); -// }; -// } else { -// var select = saneKeyboardEvents(textarea, this).select; -// this.selectFn = select; -// } -// domFrag(this.container).prepend(domFrag(textareaSpan)); -// this.addEditableFocusBlurListeners(); -// this.updateMathspeak(); -// }; -// Controller.prototype.unbindEditablesEvents = function () { -// var ctrlr = this; -// var textarea = ctrlr.getTextareaOrThrow(); -// var textareaSpan = ctrlr.getTextareaSpanOrThrow(); -// this.selectFn = function (text) { -// if (!(textarea instanceof HTMLTextAreaElement)) return; -// textarea.value = text; -// if (text) textarea.select(); -// }; -// domFrag(textareaSpan).remove(); -// this.removeTextareaEventListener('focus'); -// this.removeTextareaEventListener('blur'); -// ctrlr.blurred = true; -// this.removeTextareaEventListener('cut'); -// this.removeTextareaEventListener('paste'); -// }; -// Controller.prototype.typedText = function (ch) { -// if (ch === '\n') return this.handle('enter'); -// var cursor = this.notify(undefined).cursor; -// cursor.parent.write(cursor, ch); -// this.scrollHoriz(); -// }; -// Controller.prototype.cut = function () { -// var ctrlr = this, -// cursor = ctrlr.cursor; -// if (cursor.selection) { -// setTimeout(function () { -// ctrlr.notify('edit'); // deletes selection if present -// cursor.parent.bubble(function (node) { -// node.reflow(); -// return undefined; -// }); -// if (ctrlr.options && ctrlr.options.onCut) { -// ctrlr.options.onCut(); -// } -// }); -// } -// }; -// Controller.prototype.copy = function () { -// this.setTextareaSelection(); -// }; -// Controller.prototype.paste = function (text) { -// // TODO: document `statelessClipboard` config option in README, after -// // making it work like it should, that is, in both text and math mode -// // (currently only works in math fields, so worse than pointless, it -// // only gets in the way by \text{}-ifying pasted stuff and $-ifying -// // cut/copied LaTeX) -// if (this.options.statelessClipboard) { -// if (text.slice(0, 1) === '$' && text.slice(-1) === '$') { -// text = text.slice(1, -1); -// } else { -// text = '\\text{' + text + '}'; -// } -// } -// // FIXME: this always inserts math or a TextBlock, even in a RootTextBlock -// this.writeLatex(text).cursor.show(); -// this.scrollHoriz(); -// if (this.options && this.options.onPaste) { -// this.options.onPaste(); -// } -// }; -// /** Set up for a static MQ field (i.e., create and attach the mathspeak element and initialize the focus state to blurred) */ -// Controller.prototype.setupStaticField = function () { -// this.mathspeakSpan = h('span', { class: 'dcg-mq-mathspeak' }); -// domFrag(this.container).prepend(domFrag(this.mathspeakSpan)); -// this.updateMathspeak(); -// this.blurred = true; -// this.cursor.hide().parent.blur(this.cursor); -// }; -// Controller.prototype.updateMathspeak = function () { -// var ctrlr = this; -// // If the controller's ARIA label doesn't end with a punctuation mark, add a colon by default to better separate it from mathspeak. -// var ariaLabel = ctrlr.getAriaLabel(); -// var labelWithSuffix = /[A-Za-z0-9]$/.test(ariaLabel) ? ariaLabel + ':' : ariaLabel; -// var mathspeak = ctrlr.root.mathspeak().trim(); -// this.aria.clear(); -// var textarea = ctrlr.getTextareaOrThrow(); -// // For static math, provide mathspeak in a visually hidden span to allow screen readers and other AT to traverse the content. -// // For editable math, assign the mathspeak to the textarea's ARIA label (AT can use text navigation to interrogate the content). -// // Be certain to include the mathspeak for only one of these, though, as we don't want to include outdated labels if a field's editable state changes. -// // By design, also take careful note that the ariaPostLabel is meant to exist only for editable math (e.g. to serve as an evaluation or error message) -// // so it is not included for static math mathspeak calculations. -// // The mathspeakSpan should exist only for static math, so we use its presence to decide which approach to take. -// if (!!ctrlr.mathspeakSpan) { -// textarea.setAttribute('aria-label', ''); -// ctrlr.mathspeakSpan.textContent = (labelWithSuffix + ' ' + mathspeak).trim(); -// } else { -// textarea.setAttribute( -// 'aria-label', -// (labelWithSuffix + ' ' + mathspeak + ' ' + ctrlr.ariaPostLabel).trim() -// ); -// } -// }; -// return Controller; -// })(Controller_scrollHoriz); -// /************************************************* -// * Abstract classes of math blocks and commands. -// ************************************************/ -// /** -// * Math tree node base class. -// * Some math-tree-specific extensions to MQNode. -// * Both MathBlock's and MathCommand's descend from it. -// */ -// var MathElement = /** @class */ (function (_super) { -// __extends(MathElement, _super); -// function MathElement() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// MathElement.prototype.finalizeInsert = function (options, cursor) { -// var self = this; -// self.postOrder(function (node) { -// node.finalizeTree(options); -// }); -// self.postOrder(function (node) { -// node.contactWeld(cursor); -// }); -// // note: this order is important. -// // empty elements need the empty box provided by blur to -// // be present in order for their dimensions to be measured -// // correctly by 'reflow' handlers. -// self.postOrder(function (node) { -// node.blur(cursor); -// }); -// self.postOrder(function (node) { -// node.reflow(); -// }); -// var selfR = self[R]; -// var selfL = self[L]; -// if (selfR) selfR.siblingCreated(options, L); -// if (selfL) selfL.siblingCreated(options, R); -// self.bubble(function (node) { -// node.reflow(); -// return undefined; -// }); -// }; -// // If the maxDepth option is set, make sure -// // deeply nested content is truncated. Just return -// // false if the cursor is already too deep. -// MathElement.prototype.prepareInsertionAt = function (cursor) { -// var maxDepth = cursor.options.maxDepth; -// if (maxDepth !== undefined) { -// var cursorDepth = cursor.depth(); -// if (cursorDepth > maxDepth) { -// return false; -// } -// this.removeNodesDeeperThan(maxDepth - cursorDepth); -// } -// return true; -// }; -// // Remove nodes that are more than `cutoff` -// // blocks deep from this node. -// MathElement.prototype.removeNodesDeeperThan = function (cutoff) { -// var depth = 0; -// var queue = [[this, depth]]; -// var current; -// // Do a breadth-first search of this node's descendants -// // down to cutoff, removing anything deeper. -// while ((current = queue.shift())) { -// var c = current; -// c[0].children().each(function (child) { -// var i = child instanceof MathBlock ? 1 : 0; -// depth = c[1] + i; -// if (depth <= cutoff) { -// queue.push([child, depth]); -// } else { -// (i ? child.children() : child).remove(); -// } -// return undefined; -// }); -// } -// }; -// return MathElement; -// })(MQNode); -// var DOMView = /** @class */ (function () { -// function DOMView(childCount, render) { -// this.childCount = childCount; -// this.render = render; -// } -// return DOMView; -// })(); -// /** -// * Commands and operators, like subscripts, exponents, or fractions. -// * Descendant commands are organized into blocks. -// */ -// var MathCommand = /** @class */ (function (_super) { -// __extends(MathCommand, _super); -// function MathCommand(ctrlSeq, domView, textTemplate) { -// var _this_1 = _super.call(this) || this; -// _this_1.textTemplate = ['']; -// _this_1.mathspeakTemplate = ['']; -// _this_1.setCtrlSeqHtmlAndText(ctrlSeq, domView, textTemplate); -// return _this_1; -// } -// MathCommand.prototype.setEnds = function (ends) { -// pray('MathCommand ends are never empty', ends[L] && ends[R]); -// this.ends = ends; -// }; -// MathCommand.prototype.getEnd = function (dir) { -// return this.ends[dir]; -// }; -// MathCommand.prototype.setCtrlSeqHtmlAndText = function (ctrlSeq, domView, textTemplate) { -// if (!this.ctrlSeq) this.ctrlSeq = ctrlSeq; -// if (domView) this.domView = domView; -// if (textTemplate) this.textTemplate = textTemplate; -// }; -// // obvious methods -// MathCommand.prototype.replaces = function (replacedFragment) { -// replacedFragment.disown(); -// this.replacedFragment = replacedFragment; -// }; -// MathCommand.prototype.isEmpty = function () { -// return this.foldChildren(true, function (isEmpty, child) { -// return isEmpty && child.isEmpty(); -// }); -// }; -// MathCommand.prototype.parser = function () { -// var _this_1 = this; -// var block = latexMathParser.block; -// return block.times(this.numBlocks()).map(function (blocks) { -// _this_1.blocks = blocks; -// for (var i = 0; i < blocks.length; i += 1) { -// blocks[i].adopt(_this_1, _this_1.getEnd(R), 0); -// } -// return _this_1; -// }); -// }; -// // createLeftOf(cursor) and the methods it calls -// MathCommand.prototype.createLeftOf = function (cursor) { -// var cmd = this; -// var replacedFragment = cmd.replacedFragment; -// cmd.createBlocks(); -// _super.prototype.createLeftOf.call(this, cursor); -// if (replacedFragment) { -// var cmdEndsL = cmd.getEnd(L); -// replacedFragment.adopt(cmdEndsL, 0, 0); -// replacedFragment.domFrag().appendTo(cmdEndsL.domFrag().oneElement()); -// cmd.placeCursor(cursor); -// cmd.prepareInsertionAt(cursor); -// } -// cmd.finalizeInsert(cursor.options, cursor); -// cmd.placeCursor(cursor); -// }; -// MathCommand.prototype.createBlocks = function () { -// var cmd = this, -// numBlocks = cmd.numBlocks(), -// blocks = (cmd.blocks = Array(numBlocks)); -// for (var i = 0; i < numBlocks; i += 1) { -// var newBlock = (blocks[i] = new MathBlock()); -// newBlock.adopt(cmd, cmd.getEnd(R), 0); -// } -// }; -// MathCommand.prototype.placeCursor = function (cursor) { -// //insert the cursor at the right end of the first empty child, searching -// //left-to-right, or if none empty, the right end child -// cursor.insAtRightEnd( -// this.foldChildren(this.getEnd(L), function (leftward, child) { -// return leftward.isEmpty() ? leftward : child; -// }) -// ); -// }; -// // editability methods: called by the cursor for editing, cursor movements, -// // and selection of the MathQuill tree, these all take in a direction and -// // the cursor -// MathCommand.prototype.moveTowards = function (dir, cursor, updown) { -// var updownInto; -// if (updown === 'up') { -// updownInto = this.upInto; -// } else if (updown === 'down') { -// updownInto = this.downInto; -// } -// var el = updownInto || this.getEnd(-dir); -// cursor.insAtDirEnd(-dir, el); -// cursor.controller.aria.queueDirEndOf(-dir).queue(cursor.parent, true); -// }; -// MathCommand.prototype.deleteTowards = function (dir, cursor) { -// if (this.isEmpty()) cursor[dir] = this.remove()[dir]; -// else this.moveTowards(dir, cursor); -// }; -// MathCommand.prototype.selectTowards = function (dir, cursor) { -// cursor[-dir] = this; -// cursor[dir] = this[dir]; -// }; -// MathCommand.prototype.selectChildren = function () { -// return new MQSelection(this, this); -// }; -// MathCommand.prototype.unselectInto = function (dir, cursor) { -// var antiCursor = cursor.anticursor; -// var ancestor = antiCursor.ancestors[this.id]; -// cursor.insAtDirEnd(-dir, ancestor); -// }; -// MathCommand.prototype.seek = function (clientX, cursor) { -// function getBounds(node) { -// var _c; -// var el = node.domFrag().oneElement(); -// var l = getBoundingClientRect(el).left; -// var r = l + el.offsetWidth; -// return (_c = {}), (_c[L] = l), (_c[R] = r), _c; -// } -// var cmd = this; -// var cmdBounds = getBounds(cmd); -// if (clientX < cmdBounds[L]) return cursor.insLeftOf(cmd); -// if (clientX > cmdBounds[R]) return cursor.insRightOf(cmd); -// var leftLeftBound = cmdBounds[L]; -// cmd.eachChild(function (block) { -// var blockBounds = getBounds(block); -// if (clientX < blockBounds[L]) { -// // closer to this block's left bound, or the bound left of that? -// if (clientX - leftLeftBound < blockBounds[L] - clientX) { -// if (block[L]) cursor.insAtRightEnd(block[L]); -// else cursor.insLeftOf(cmd); -// } else cursor.insAtLeftEnd(block); -// return false; -// } else if (clientX > blockBounds[R]) { -// if (block[R]) leftLeftBound = blockBounds[R]; -// // continue to next block -// else { -// // last (rightmost) block -// // closer to this block's right bound, or the cmd's right bound? -// if (cmdBounds[R] - clientX < clientX - blockBounds[R]) { -// cursor.insRightOf(cmd); -// } else cursor.insAtRightEnd(block); -// } -// return undefined; -// } else { -// block.seek(clientX, cursor); -// return false; -// } -// }); -// return undefined; -// }; -// MathCommand.prototype.numBlocks = function () { -// return this.domView.childCount; -// }; -// /** -// * Render the entire math subtree rooted at this command to a DOM node. Assumes `this.domView` is defined. -// * -// * See dom.test.js for example templates and intended outputs. -// */ -// MathCommand.prototype.html = function () { -// var blocks = this.blocks; -// pray('domView is defined', this.domView); -// var template = this.domView; -// var dom = template.render(blocks || []); -// this.setDOM(dom); -// NodeBase.linkElementByCmdNode(dom, this); -// return dom; -// }; -// // methods to export a string representation of the math tree -// MathCommand.prototype.latexRecursive = function (ctx) { -// this.checkCursorContextOpen(ctx); -// ctx.latex += this.ctrlSeq || ''; -// this.eachChild(function (child) { -// ctx.latex += '{'; -// var beforeLength = ctx.latex.length; -// child.latexRecursive(ctx); -// var afterLength = ctx.latex.length; -// if (beforeLength === afterLength) { -// // nothing was written so we write a space -// ctx.latex += ' '; -// } -// ctx.latex += '}'; -// }); -// this.checkCursorContextClose(ctx); -// }; -// MathCommand.prototype.text = function () { -// var cmd = this, -// i = 0; -// return cmd.foldChildren(cmd.textTemplate[i], function (text, child) { -// i += 1; -// var child_text = child.text(); -// if (text && cmd.textTemplate[i] === '(' && child_text[0] === '(' && child_text.slice(-1) === ')') -// return text + child_text.slice(1, -1) + cmd.textTemplate[i]; -// return text + child_text + (cmd.textTemplate[i] || ''); -// }); -// }; -// MathCommand.prototype.mathspeak = function () { -// var cmd = this, -// i = 0; -// return cmd.foldChildren( -// cmd.mathspeakTemplate[i] || 'Start' + cmd.ctrlSeq + ' ', -// function (speech, block) { -// i += 1; -// return ( -// speech + -// ' ' + -// block.mathspeak() + -// ' ' + -// (cmd.mathspeakTemplate[i] + ' ' || 'End' + cmd.ctrlSeq + ' ') -// ); -// } -// ); -// }; -// return MathCommand; -// })(MathElement); -// /** -// * Lightweight command without blocks or children. -// */ -// var MQSymbol = /** @class */ (function (_super) { -// __extends(MQSymbol, _super); -// function MQSymbol(ctrlSeq, html, text, mathspeak) { -// var _this_1 = _super.call(this) || this; -// _this_1.setCtrlSeqHtmlTextAndMathspeak( -// ctrlSeq, -// html -// ? new DOMView(0, function () { -// return html.cloneNode(true); -// }) -// : undefined, -// text, -// mathspeak -// ); -// return _this_1; -// } -// MQSymbol.prototype.setCtrlSeqHtmlTextAndMathspeak = function (ctrlSeq, html, text, mathspeak) { -// if (!text && !!ctrlSeq) { -// text = ctrlSeq.replace(/^\\/, ''); -// } -// this.mathspeakName = mathspeak || text; -// _super.prototype.setCtrlSeqHtmlAndText.call(this, ctrlSeq, html, [text || '']); -// }; -// MQSymbol.prototype.parser = function () { -// return Parser.succeed(this); -// }; -// MQSymbol.prototype.numBlocks = function () { -// return 0; -// }; -// MQSymbol.prototype.replaces = function (replacedFragment) { -// replacedFragment.remove(); -// }; -// MQSymbol.prototype.createBlocks = function () {}; -// MQSymbol.prototype.moveTowards = function (dir, cursor) { -// cursor.domFrag().insDirOf(dir, this.domFrag()); -// cursor[-dir] = this; -// cursor[dir] = this[dir]; -// cursor.controller.aria.queue(this); -// }; -// MQSymbol.prototype.deleteTowards = function (dir, cursor) { -// cursor[dir] = this.remove()[dir]; -// }; -// MQSymbol.prototype.seek = function (clientX, cursor) { -// // insert at whichever side the click was closer to -// var el = this.domFrag().oneElement(); -// var left = getBoundingClientRect(el).left; -// if (clientX - left < el.offsetWidth / 2) cursor.insLeftOf(this); -// else cursor.insRightOf(this); -// return cursor; -// }; -// MQSymbol.prototype.latexRecursive = function (ctx) { -// this.checkCursorContextOpen(ctx); -// ctx.latex += this.ctrlSeq || ''; -// this.checkCursorContextClose(ctx); -// }; -// MQSymbol.prototype.text = function () { -// return this.textTemplate.join(''); -// }; -// MQSymbol.prototype.mathspeak = function (_opts) { -// return this.mathspeakName || ''; -// }; -// MQSymbol.prototype.placeCursor = function () {}; -// MQSymbol.prototype.isEmpty = function () { -// return true; -// }; -// return MQSymbol; -// })(MathCommand); -// var VanillaSymbol = /** @class */ (function (_super) { -// __extends(VanillaSymbol, _super); -// function VanillaSymbol(ch, html, mathspeak) { -// return _super.call(this, ch, h('span', {}, [html || h.text(ch)]), undefined, mathspeak) || this; -// } -// return VanillaSymbol; -// })(MQSymbol); -// function bindVanillaSymbol(ch, htmlEntity, mathspeak) { -// return function () { -// return new VanillaSymbol(ch, htmlEntity ? h.entityText(htmlEntity) : undefined, mathspeak); -// }; -// } -// var BinaryOperator = /** @class */ (function (_super) { -// __extends(BinaryOperator, _super); -// function BinaryOperator(ctrlSeq, html, text, mathspeak, treatLikeSymbol) { -// var _this_1 = this; -// if (treatLikeSymbol) { -// _this_1 = -// _super.call( -// this, -// ctrlSeq, -// h('span', {}, [html || h.text(ctrlSeq || '')]), -// undefined, -// mathspeak -// ) || this; -// } else { -// _this_1 = -// _super.call( -// this, -// ctrlSeq, -// h('span', { class: 'dcg-mq-binary-operator' }, html ? [html] : []), -// text, -// mathspeak -// ) || this; -// } -// return _this_1; -// } -// return BinaryOperator; -// })(MQSymbol); -// function bindBinaryOperator(ctrlSeq, htmlEntity, text, mathspeak) { -// return function () { -// return new BinaryOperator(ctrlSeq, htmlEntity ? h.entityText(htmlEntity) : undefined, text, mathspeak); -// }; -// } -// /** -// * Children and parent of MathCommand's. Basically partitions all the -// * symbols and operators that descend (in the Math DOM tree) from -// * ancestor operators. -// */ -// var MathBlock = /** @class */ (function (_super) { -// __extends(MathBlock, _super); -// function MathBlock() { -// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; -// _this_1.ariaLabel = 'block'; -// return _this_1; -// } -// MathBlock.prototype.join = function (methodName) { -// return this.foldChildren('', function (fold, child) { -// return fold + child[methodName](); -// }); -// }; -// MathBlock.prototype.html = function () { -// var fragment = document.createDocumentFragment(); -// this.eachChild(function (el) { -// var childHtml = el.html(); -// fragment.appendChild(childHtml); -// return undefined; -// }); -// return fragment; -// }; -// MathBlock.prototype.latexRecursive = function (ctx) { -// this.checkCursorContextOpen(ctx); -// this.eachChild(function (child) { -// return child.latexRecursive(ctx); -// }); -// this.checkCursorContextClose(ctx); -// }; -// MathBlock.prototype.text = function () { -// var endsL = this.getEnd(L); -// var endsR = this.getEnd(R); -// return endsL === endsR && endsL !== 0 ? endsL.text() : this.join('text'); -// }; -// MathBlock.prototype.mathspeak = function () { -// var tempOp = ''; -// var autoOps = {}; -// if (this.controller) autoOps = this.controller.options.autoOperatorNames; -// return ( -// this.foldChildren([], function (speechArray, cmd) { -// if (cmd.isPartOfOperator) { -// tempOp += cmd.mathspeak(); -// } else { -// if (tempOp !== '') { -// if (autoOps._maxLength > 0) { -// var x = autoOps[tempOp.toLowerCase()]; -// if (typeof x === 'string') tempOp = x; -// } -// speechArray.push(tempOp + ' '); -// tempOp = ''; -// } -// var mathspeakText = cmd.mathspeak(); -// var cmdText = cmd.ctrlSeq; -// if ( -// isNaN(cmdText) && // TODO - revisit this to improve the isNumber() check -// cmdText !== '.' && -// (!cmd.parent || !cmd.parent.parent || !cmd.parent.parent.isTextBlock()) -// ) { -// mathspeakText = ' ' + mathspeakText + ' '; -// } -// speechArray.push(mathspeakText); -// } -// return speechArray; -// }) -// .join('') -// .replace(/ +(?= )/g, '') -// // For Apple devices in particular, split out digits after a decimal point so they aren't read aloud as whole words. -// // Not doing so makes 123.456 potentially spoken as "one hundred twenty-three point four hundred fifty-six." -// // Instead, add spaces so it is spoken as "one hundred twenty-three point four five six." -// .replace(/(\.)([0-9]+)/g, function (_match, p1, p2) { -// return p1 + p2.split('').join(' ').trim(); -// }) -// ); -// }; -// MathBlock.prototype.keystroke = function (key, e, ctrlr) { -// if (ctrlr.options.spaceBehavesLikeTab && (key === 'Spacebar' || key === 'Shift-Spacebar')) { -// e === null || e === void 0 ? void 0 : e.preventDefault(); -// ctrlr.escapeDir(key === 'Shift-Spacebar' ? L : R, key, e); -// return; -// } -// return _super.prototype.keystroke.call(this, key, e, ctrlr); -// }; -// // editability methods: called by the cursor for editing, cursor movements, -// // and selection of the MathQuill tree, these all take in a direction and -// // the cursor -// MathBlock.prototype.moveOutOf = function (dir, cursor, updown) { -// var updownInto; -// if (updown === 'up') { -// updownInto = this.parent.upInto; -// } else if (updown === 'down') { -// updownInto = this.parent.downInto; -// } -// if (!updownInto && this[dir]) { -// var otherDir = -dir; -// cursor.insAtDirEnd(otherDir, this[dir]); -// cursor.controller.aria.queueDirEndOf(otherDir).queue(cursor.parent, true); -// } else { -// cursor.insDirOf(dir, this.parent); -// cursor.controller.aria.queueDirOf(dir).queue(this.parent); -// } -// }; -// MathBlock.prototype.selectOutOf = function (dir, cursor) { -// cursor.insDirOf(dir, this.parent); -// }; -// MathBlock.prototype.deleteOutOf = function (_dir, cursor) { -// cursor.unwrapGramp(); -// }; -// MathBlock.prototype.seek = function (clientX, cursor) { -// var node = this.getEnd(R); -// if (!node) return cursor.insAtRightEnd(this); -// var el = node.domFrag().oneElement(); -// var left = getBoundingClientRect(el).left; -// if (left + el.offsetWidth < clientX) { -// return cursor.insAtRightEnd(this); -// } -// var endsL = this.getEnd(L); -// if (clientX < getBoundingClientRect(endsL.domFrag().oneElement()).left) -// return cursor.insAtLeftEnd(this); -// while (clientX < getBoundingClientRect(node.domFrag().oneElement()).left) node = node[L]; -// return node.seek(clientX, cursor); -// }; -// MathBlock.prototype.chToCmd = function (ch, options) { -// var cons; -// // exclude f because it gets a dedicated command with more spacing -// if (ch.match(/^[a-eg-zA-Z]$/)) return new Letter(ch); -// else if (/^\d$/.test(ch)) return new Digit(ch); -// else if (options && options.typingSlashWritesDivisionSymbol && ch === '/') -// return LatexCmds['\u00f7'](ch); -// else if (options && options.typingAsteriskWritesTimesSymbol && ch === '*') -// return LatexCmds['\u00d7'](ch); -// else if (options && options.typingPercentWritesPercentOf && ch === '%') return LatexCmds.percentof(ch); -// else if ((cons = CharCmds[ch] || LatexCmds[ch])) { -// if (cons.constructor) { -// return new cons(ch); -// } else { -// return cons(ch); -// } -// } else return new VanillaSymbol(ch); -// }; -// MathBlock.prototype.write = function (cursor, ch) { -// var cmd = this.chToCmd(ch, cursor.options); -// if (cursor.selection) cmd.replaces(cursor.replaceSelection()); -// if (!cursor.isTooDeep()) { -// cmd.createLeftOf(cursor.show()); -// // special-case the slash so that fractions are voiced while typing -// if (ch === '/') { -// cursor.controller.aria.alert('over'); -// } else { -// cursor.controller.aria.alert(cmd.mathspeak({ createdLeftOf: cursor })); -// } -// } -// }; -// MathBlock.prototype.writeLatex = function (cursor, latex) { -// var all = Parser.all; -// var eof = Parser.eof; -// var block = latexMathParser.skip(eof).or(all.result(false)).parse(latex); -// if (block && !block.isEmpty() && block.prepareInsertionAt(cursor)) { -// block.children().adopt(cursor.parent, cursor[L], cursor[R]); // TODO - masking undefined. should be 0 -// domFrag(block.html()).insertBefore(cursor.domFrag()); -// cursor[L] = block.getEnd(R); -// block.finalizeInsert(cursor.options, cursor); -// var blockEndsR = block.getEnd(R); -// var blockEndsL = block.getEnd(L); -// var blockEndsRR = blockEndsR[R]; -// var blockEndsLL = blockEndsL[L]; -// if (blockEndsRR) blockEndsRR.siblingCreated(cursor.options, L); -// if (blockEndsLL) blockEndsLL.siblingCreated(cursor.options, R); -// cursor.parent.bubble(function (node) { -// node.reflow(); -// return undefined; -// }); -// } -// }; -// MathBlock.prototype.focus = function () { -// this.domFrag().addClass('dcg-mq-hasCursor'); -// this.domFrag().removeClass('dcg-mq-empty'); -// return this; -// }; -// MathBlock.prototype.blur = function (cursor) { -// this.domFrag().removeClass('dcg-mq-hasCursor'); -// if (this.isEmpty()) { -// this.domFrag().addClass('dcg-mq-empty'); -// if (cursor && this.isQuietEmptyDelimiter(cursor.options.quietEmptyDelimiters)) { -// this.domFrag().addClass('dcg-mq-quiet-delimiter'); -// } -// } -// return this; -// }; -// return MathBlock; -// })(MathElement); -// Options.prototype.mouseEvents = true; -// API.StaticMath = function (APIClasses) { -// var _c; -// return ( -// (_c = /** @class */ (function (_super) { -// __extends(StaticMath, _super); -// function StaticMath(el) { -// var _this_1 = _super.call(this, el) || this; -// var innerFields = (_this_1.innerFields = []); -// _this_1.__controller.root.postOrder(function (node) { -// node.registerInnerField(innerFields, APIClasses.InnerMathField); -// }); -// return _this_1; -// } -// StaticMath.prototype.__mathquillify = function (opts, _interfaceVersion) { -// this.config(opts); -// _super.prototype.mathquillify.call(this, 'dcg-mq-math-mode'); -// this.__controller.setupStaticField(); -// if (this.__options.mouseEvents) { -// this.__controller.addMouseEventListener(); -// this.__controller.staticMathTextareaEvents(); -// } -// return this; -// }; -// StaticMath.prototype.latex = function (_latex) { -// var returned = _super.prototype.latex.apply(this, arguments); -// if (arguments.length > 0) { -// var innerFields = (this.innerFields = []); -// this.__controller.root.postOrder(function (node) { -// node.registerInnerField(innerFields, APIClasses.InnerMathField); -// }); -// // Force an ARIA label update to remain in sync with the new LaTeX value. -// this.__controller.updateMathspeak(); -// } -// return returned; -// }; -// StaticMath.prototype.setAriaLabel = function (ariaLabel) { -// this.__controller.setAriaLabel(ariaLabel); -// return this; -// }; -// StaticMath.prototype.getAriaLabel = function () { -// return this.__controller.getAriaLabel(); -// }; -// return StaticMath; -// })(APIClasses.AbstractMathQuill)), -// (_c.RootBlock = MathBlock), -// _c -// ); -// }; -// var RootMathBlock = /** @class */ (function (_super) { -// __extends(RootMathBlock, _super); -// function RootMathBlock() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// return RootMathBlock; -// })(MathBlock); -// RootBlockMixin(RootMathBlock.prototype); // adds methods to RootMathBlock -// API.MathField = function (APIClasses) { -// var _c; -// return ( -// (_c = /** @class */ (function (_super) { -// __extends(MathField, _super); -// function MathField() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// MathField.prototype.__mathquillify = function (opts, interfaceVersion) { -// this.config(opts); -// if (interfaceVersion > 1) this.__controller.root.reflow = noop; -// _super.prototype.mathquillify.call(this, 'dcg-mq-editable-field dcg-mq-math-mode'); -// // TODO: Why does this need to be deleted (contrary to the type definition)? Could we set it to `noop` instead? -// delete this.__controller.root.reflow; -// return this; -// }; -// return MathField; -// })(APIClasses.EditableField)), -// (_c.RootBlock = RootMathBlock), -// _c -// ); -// }; -// API.InnerMathField = function (APIClasses) { -// pray('MathField class is defined', APIClasses.MathField); -// return /** @class */ (function (_super) { -// __extends(class_1, _super); -// function class_1() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// class_1.prototype.makeStatic = function () { -// this.__controller.editable = false; -// this.__controller.root.blur(); -// this.__controller.unbindEditablesEvents(); -// domFrag(this.__controller.container).removeClass('dcg-mq-editable-field'); -// }; -// class_1.prototype.makeEditable = function () { -// this.__controller.editable = true; -// this.__controller.editablesTextareaEvents(); -// this.__controller.cursor.insAtRightEnd(this.__controller.root); -// domFrag(this.__controller.container).addClass('dcg-mq-editable-field'); -// }; -// return class_1; -// })(APIClasses.MathField); -// }; -// /************************************************* -// * Abstract classes of text blocks -// ************************************************/ -// /** -// * Blocks of plain text, with one or two TextPiece's as children. -// * Represents flat strings of typically serif-font Roman characters, as -// * opposed to hierchical, nested, tree-structured math. -// * Wraps a single HTMLSpanElement. -// */ -// var TextBlock = /** @class */ (function (_super) { -// __extends(TextBlock, _super); -// function TextBlock() { -// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; -// _this_1.ctrlSeq = '\\text'; -// _this_1.ariaLabel = 'Text'; -// _this_1.mathspeakTemplate = ['StartText', 'EndText']; -// return _this_1; -// } -// TextBlock.prototype.replaces = function (replacedText) { -// if (replacedText instanceof Fragment) { -// this.replacedText = replacedText.remove().domFrag().text(); -// } else if (typeof replacedText === 'string') this.replacedText = replacedText; -// }; -// TextBlock.prototype.setDOMFrag = function (el) { -// _super.prototype.setDOM.call(this, el); -// var endsL = this.getEnd(L); -// if (endsL) { -// var children = this.domFrag().children(); -// if (!children.isEmpty()) { -// endsL.setDOM(children.oneText()); -// } -// } -// return this; -// }; -// TextBlock.prototype.createLeftOf = function (cursor) { -// var textBlock = this; -// _super.prototype.createLeftOf.call(this, cursor); -// cursor.insAtRightEnd(textBlock); -// if (textBlock.replacedText) -// for (var i = 0; i < textBlock.replacedText.length; i += 1) -// textBlock.write(cursor, textBlock.replacedText.charAt(i)); -// var textBlockR = textBlock[R]; -// if (textBlockR) textBlockR.siblingCreated(cursor.options, L); -// var textBlockL = textBlock[L]; -// if (textBlockL) textBlockL.siblingCreated(cursor.options, R); -// textBlock.bubble(function (node) { -// node.reflow(); -// return undefined; -// }); -// }; -// TextBlock.prototype.parser = function () { -// var textBlock = this; -// // TODO: correctly parse text mode -// var string = Parser.string; -// var regex = Parser.regex; -// var optWhitespace = Parser.optWhitespace; -// return optWhitespace -// .then(string('{')) -// .then(regex(/^[^}]*/)) -// .skip(string('}')) -// .map(function (text) { -// if (text.length === 0) return new Fragment(0, 0); -// new TextPiece(text).adopt(textBlock, 0, 0); -// return textBlock; -// }); -// }; -// TextBlock.prototype.textContents = function () { -// return this.foldChildren('', function (text, child) { -// return text + child.textStr; -// }); -// }; -// TextBlock.prototype.text = function () { -// return '"' + this.textContents() + '"'; -// }; -// TextBlock.prototype.latexRecursive = function (ctx) { -// this.checkCursorContextOpen(ctx); -// var contents = this.textContents(); -// if (contents.length > 0) { -// ctx.latex += this.ctrlSeq + '{'; -// ctx.latex += contents.replace(/\\/g, '\\backslash ').replace(/[{}]/g, '\\$&'); -// ctx.latex += '}'; -// } -// this.checkCursorContextClose(ctx); -// }; -// TextBlock.prototype.html = function () { -// var out = h('span', { class: 'dcg-mq-text-mode' }, [h.text(this.textContents())]); -// this.setDOM(out); -// NodeBase.linkElementByCmdNode(out, this); -// return out; -// }; -// TextBlock.prototype.mathspeak = function (opts) { -// if (opts && opts.ignoreShorthand) { -// return this.mathspeakTemplate[0] + ', ' + this.textContents() + ', ' + this.mathspeakTemplate[1]; -// } else { -// return this.textContents(); -// } -// }; -// TextBlock.prototype.isTextBlock = function () { -// return true; -// }; -// // editability methods: called by the cursor for editing, cursor movements, -// // and selection of the MathQuill tree, these all take in a direction and -// // the cursor -// TextBlock.prototype.moveTowards = function (dir, cursor) { -// cursor.insAtDirEnd(-dir, this); -// cursor.controller.aria.queueDirEndOf(-dir).queue(cursor.parent, true); -// }; -// TextBlock.prototype.moveOutOf = function (dir, cursor) { -// cursor.insDirOf(dir, this); -// cursor.controller.aria.queueDirOf(dir).queue(this); -// }; -// TextBlock.prototype.unselectInto = function (dir, cursor) { -// this.moveTowards(dir, cursor); -// }; -// // TODO: make these methods part of a shared mixin or something. -// TextBlock.prototype.selectTowards = function (dir, cursor) { -// MathCommand.prototype.selectTowards.call(this, dir, cursor); -// }; -// TextBlock.prototype.deleteTowards = function (dir, cursor) { -// MathCommand.prototype.deleteTowards.call(this, dir, cursor); -// }; -// TextBlock.prototype.selectOutOf = function (dir, cursor) { -// cursor.insDirOf(dir, this); -// }; -// TextBlock.prototype.deleteOutOf = function (_dir, cursor) { -// // backspace and delete at ends of block don't unwrap -// if (this.isEmpty()) cursor.insRightOf(this); -// }; -// TextBlock.prototype.write = function (cursor, ch) { -// cursor.show().deleteSelection(); -// if (ch !== '$') { -// var cursorL = cursor[L]; -// if (!cursorL) new TextPiece(ch).createLeftOf(cursor); -// else if (cursorL instanceof TextPiece) cursorL.appendText(ch); -// } else if (this.isEmpty()) { -// cursor.insRightOf(this); -// new VanillaSymbol('\\$', h.text('$')).createLeftOf(cursor); -// } else if (!cursor[R]) cursor.insRightOf(this); -// else if (!cursor[L]) cursor.insLeftOf(this); -// else { -// // split apart -// var leftBlock = new TextBlock(); -// var leftPc = this.getEnd(L); -// if (leftPc) { -// leftPc.disown().domFrag().detach(); -// leftPc.adopt(leftBlock, 0, 0); -// } -// cursor.insLeftOf(this); -// _super.prototype.createLeftOf.call(leftBlock, cursor); // micro-optimization, not for correctness -// } -// this.bubble(function (node) { -// node.reflow(); -// return undefined; -// }); -// // TODO needs tests -// cursor.controller.aria.alert(ch); -// }; -// TextBlock.prototype.writeLatex = function (cursor, latex) { -// var cursorL = cursor[L]; -// if (!cursorL) new TextPiece(latex).createLeftOf(cursor); -// else if (cursorL instanceof TextPiece) cursorL.appendText(latex); -// this.bubble(function (node) { -// node.reflow(); -// return undefined; -// }); -// }; -// TextBlock.prototype.seek = function (clientX, cursor) { -// cursor.hide(); -// var textPc = TextBlockFuseChildren(this); -// if (!textPc) return; -// // insert cursor at approx position in DOMTextNode -// var textNode = this.domFrag().children().oneText(); -// var range = document.createRange(); -// range.selectNodeContents(textNode); -// var rects = range.getClientRects(); -// if (rects.length === 1) { -// var _c = rects[0], -// width = _c.width, -// left = _c.left; -// var avgChWidth = width / this.textContents().length; -// var approxPosition = Math.round((clientX - left) / avgChWidth); -// if (approxPosition <= 0) { -// cursor.insAtLeftEnd(this); -// } else if (approxPosition >= textPc.textStr.length) { -// cursor.insAtRightEnd(this); -// } else { -// cursor.insLeftOf(textPc.splitRight(approxPosition)); -// } -// } else { -// cursor.insAtLeftEnd(this); -// } -// // move towards mousedown (clientX) -// var displ = clientX - cursor.show().getBoundingClientRectWithoutMargin().left; // displacement -// var dir = displ && displ < 0 ? L : R; -// var prevDispl = dir; -// // displ * prevDispl > 0 iff displacement direction === previous direction -// while (cursor[dir] && displ * prevDispl > 0) { -// cursor[dir].moveTowards(dir, cursor); -// prevDispl = displ; -// displ = clientX - cursor.getBoundingClientRectWithoutMargin().left; -// } -// if (dir * displ < -dir * prevDispl) cursor[-dir].moveTowards(-dir, cursor); -// if (!cursor.anticursor) { -// // about to start mouse-selecting, the anticursor is gonna get put here -// var cursorL = cursor[L]; -// this.anticursorPosition = cursorL && cursorL.textStr.length; -// // ^ get it? 'cos if there's no cursor[L], it's 0... I'm a terrible person. -// } else if (cursor.anticursor.parent === this) { -// // mouse-selecting within this TextBlock, re-insert the anticursor -// var cursorL = cursor[L]; -// var cursorPosition = cursorL && cursorL.textStr.length; -// if (this.anticursorPosition === cursorPosition) { -// cursor.anticursor = Anticursor.fromCursor(cursor); -// } else { -// if (this.anticursorPosition < cursorPosition) { -// var newTextPc = cursorL.splitRight(this.anticursorPosition); -// cursor[L] = newTextPc; -// } else { -// var cursorR = cursor[R]; -// var newTextPc = cursorR.splitRight(this.anticursorPosition - cursorPosition); -// } -// cursor.anticursor = new Anticursor(this, newTextPc[L], newTextPc); -// } -// } -// }; -// TextBlock.prototype.blur = function (cursor) { -// MathBlock.prototype.blur.call(this, cursor); -// if (!cursor) return; -// if (this.textContents() === '') { -// this.remove(); -// if (cursor[L] === this) cursor[L] = this[L]; -// else if (cursor[R] === this) cursor[R] = this[R]; -// } else TextBlockFuseChildren(this); -// }; -// TextBlock.prototype.focus = function () { -// MathBlock.prototype.focus.call(this); -// }; -// return TextBlock; -// })(MQNode); -// function TextBlockFuseChildren(self) { -// self.domFrag().oneElement().normalize(); -// var children = self.domFrag().children(); -// if (children.isEmpty()) return; -// var textPcDom = children.oneText(); -// pray('only node in TextBlock span is Text node', textPcDom.nodeType === 3); -// // nodeType === 3 has meant a Text node since ancient times: -// // http://reference.sitepoint.com/javascript/Node/nodeType -// var textPc = new TextPiece(textPcDom.data); -// textPc.setDOM(textPcDom); -// self.children().disown(); -// textPc.adopt(self, 0, 0); -// return textPc; -// } -// /** -// * Piece of plain text, with a TextBlock as a parent and no children. -// * Wraps a single DOMTextNode. -// * For convenience, has a .textStr property that's just a JavaScript string -// * mirroring the text contents of the DOMTextNode. -// * Text contents must always be nonempty. -// */ -// var TextPiece = /** @class */ (function (_super) { -// __extends(TextPiece, _super); -// function TextPiece(text) { -// var _this_1 = _super.call(this) || this; -// _this_1.textStr = text; -// return _this_1; -// } -// TextPiece.prototype.html = function () { -// var out = h.text(this.textStr); -// this.setDOM(out); -// return out; -// }; -// TextPiece.prototype.appendText = function (text) { -// this.textStr += text; -// this.domFrag().oneText().appendData(text); -// }; -// TextPiece.prototype.prependText = function (text) { -// this.textStr = text + this.textStr; -// this.domFrag().oneText().insertData(0, text); -// }; -// TextPiece.prototype.insTextAtDirEnd = function (text, dir) { -// prayDirection(dir); -// if (dir === R) this.appendText(text); -// else this.prependText(text); -// }; -// TextPiece.prototype.splitRight = function (i) { -// var newPc = new TextPiece(this.textStr.slice(i)).adopt(this.parent, this, this[R]); -// newPc.setDOM(this.domFrag().oneText().splitText(i)); -// this.textStr = this.textStr.slice(0, i); -// return newPc; -// }; -// TextPiece.prototype.endChar = function (dir, text) { -// return text.charAt(dir === L ? 0 : -1 + text.length); -// }; -// TextPiece.prototype.moveTowards = function (dir, cursor) { -// prayDirection(dir); -// var ch = this.endChar(-dir, this.textStr); -// var from = this[-dir]; -// if (from instanceof TextPiece) from.insTextAtDirEnd(ch, dir); -// else new TextPiece(ch).createDir(-dir, cursor); -// return this.deleteTowards(dir, cursor); -// }; -// TextPiece.prototype.mathspeak = function () { -// return this.textStr; -// }; -// TextPiece.prototype.latexRecursive = function (ctx) { -// this.checkCursorContextOpen(ctx); -// ctx.latex += this.textStr; -// this.checkCursorContextClose(ctx); -// }; -// TextPiece.prototype.deleteTowards = function (dir, cursor) { -// if (this.textStr.length > 1) { -// var deletedChar; -// if (dir === R) { -// this.domFrag().oneText().deleteData(0, 1); -// deletedChar = this.textStr[0]; -// this.textStr = this.textStr.slice(1); -// } else { -// // note that the order of these 2 lines is annoyingly important -// // (the second line mutates this.textStr.length) -// this.domFrag() -// .oneText() -// .deleteData(-1 + this.textStr.length, 1); -// deletedChar = this.textStr[this.textStr.length - 1]; -// this.textStr = this.textStr.slice(0, -1); -// } -// cursor.controller.aria.queue(deletedChar); -// } else { -// this.remove(); -// cursor[dir] = this[dir]; -// cursor.controller.aria.queue(this.textStr); -// } -// }; -// TextPiece.prototype.selectTowards = function (dir, cursor) { -// prayDirection(dir); -// var anticursor = cursor.anticursor; -// if (!anticursor) return; -// var ch = this.endChar(-dir, this.textStr); -// if (anticursor[dir] === this) { -// var newPc = new TextPiece(ch).createDir(dir, cursor); -// anticursor[dir] = newPc; -// cursor.insDirOf(dir, newPc); -// } else { -// var from = this[-dir]; -// if (from instanceof TextPiece) from.insTextAtDirEnd(ch, dir); -// else { -// var newPc = new TextPiece(ch).createDir(-dir, cursor); -// var selection = cursor.selection; -// if (selection) { -// newPc.domFrag().insDirOf(-dir, selection.domFrag()); -// } -// } -// if (this.textStr.length === 1 && anticursor[-dir] === this) { -// anticursor[-dir] = this[-dir]; // `this` will be removed in deleteTowards -// } -// } -// return this.deleteTowards(dir, cursor); -// }; -// return TextPiece; -// })(MQNode); -// LatexCmds.text = LatexCmds.textnormal = LatexCmds.textrm = LatexCmds.textup = LatexCmds.textmd = TextBlock; -// function makeTextBlock(latex, ariaLabel, tagName, attrs) { -// return /** @class */ (function (_super) { -// __extends(class_2, _super); -// function class_2() { -// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; -// _this_1.ctrlSeq = latex; -// _this_1.mathspeakTemplate = ['Start' + ariaLabel, 'End' + ariaLabel]; -// _this_1.ariaLabel = ariaLabel; -// return _this_1; -// } -// class_2.prototype.html = function () { -// var out = h(tagName, attrs, [h.text(this.textContents())]); -// this.setDOM(out); -// NodeBase.linkElementByCmdNode(out, this); -// return out; -// }; -// return class_2; -// })(TextBlock); -// } -// LatexCmds.em = LatexCmds.italic = LatexCmds.italics = LatexCmds.emph = LatexCmds.textit = LatexCmds.textsl = makeTextBlock( -// '\\textit', -// 'Italic', -// 'i', -// { class: 'dcg-mq-text-mode' } -// ); -// LatexCmds.strong = LatexCmds.bold = LatexCmds.textbf = makeTextBlock('\\textbf', 'Bold', 'b', { -// class: 'dcg-mq-text-mode', -// }); -// LatexCmds.sf = LatexCmds.textsf = makeTextBlock('\\textsf', 'Sans serif font', 'span', { -// class: 'dcg-mq-sans-serif dcg-mq-text-mode', -// }); -// LatexCmds.tt = LatexCmds.texttt = makeTextBlock('\\texttt', 'Mono space font', 'span', { -// class: 'dcg-mq-monospace dcg-mq-text-mode', -// }); -// LatexCmds.textsc = makeTextBlock('\\textsc', 'Variable font', 'span', { -// style: 'font-variant:small-caps', -// class: 'dcg-mq-text-mode', -// }); -// LatexCmds.uppercase = makeTextBlock('\\uppercase', 'Uppercase', 'span', { -// style: 'text-transform:uppercase', -// class: 'dcg-mq-text-mode', -// }); -// LatexCmds.lowercase = makeTextBlock('\\lowercase', 'Lowercase', 'span', { -// style: 'text-transform:lowercase', -// class: 'dcg-mq-text-mode', -// }); -// var RootMathCommand = /** @class */ (function (_super) { -// __extends(RootMathCommand, _super); -// function RootMathCommand(cursor) { -// var _this_1 = _super.call(this, '$') || this; -// _this_1.domView = new DOMView(1, function (blocks) { -// return h.block('span', { class: 'dcg-mq-math-mode' }, blocks[0]); -// }); -// _this_1.cursor = cursor; -// return _this_1; -// } -// RootMathCommand.prototype.createBlocks = function () { -// _super.prototype.createBlocks.call(this); -// var endsL = this.getEnd(L); // TODO - how do we know this is a RootMathCommand? -// endsL.cursor = this.cursor; -// endsL.write = function (cursor, ch) { -// if (ch !== '$') MathBlock.prototype.write.call(this, cursor, ch); -// else if (this.isEmpty()) { -// cursor.insRightOf(this.parent); -// this.parent.deleteTowards(undefined, cursor); -// new VanillaSymbol('\\$', h.text('$')).createLeftOf(cursor.show()); -// } else if (!cursor[R]) cursor.insRightOf(this.parent); -// else if (!cursor[L]) cursor.insLeftOf(this.parent); -// else MathBlock.prototype.write.call(this, cursor, ch); -// }; -// }; -// RootMathCommand.prototype.latexRecursive = function (ctx) { -// this.checkCursorContextOpen(ctx); -// ctx.latex += '$'; -// this.getEnd(L).latexRecursive(ctx); -// ctx.latex += '$'; -// this.checkCursorContextClose(ctx); -// }; -// return RootMathCommand; -// })(MathCommand); -// var RootTextBlock = /** @class */ (function (_super) { -// __extends(RootTextBlock, _super); -// function RootTextBlock() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// RootTextBlock.prototype.keystroke = function (key, e, ctrlr) { -// if (key === 'Spacebar' || key === 'Shift-Spacebar') return; -// return _super.prototype.keystroke.call(this, key, e, ctrlr); -// }; -// RootTextBlock.prototype.write = function (cursor, ch) { -// cursor.show().deleteSelection(); -// if (ch === '$') new RootMathCommand(cursor).createLeftOf(cursor); -// else { -// var html; -// if (ch === '<') html = h.entityText('<'); -// else if (ch === '>') html = h.entityText('>'); -// new VanillaSymbol(ch, html).createLeftOf(cursor); -// } -// }; -// return RootTextBlock; -// })(RootMathBlock); -// API.TextField = function (APIClasses) { -// var _c; -// return ( -// (_c = /** @class */ (function (_super) { -// __extends(TextField, _super); -// function TextField() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// TextField.prototype.__mathquillify = function () { -// _super.prototype.mathquillify.call(this, 'dcg-mq-editable-field dcg-mq-text-mode'); -// return this; -// }; -// TextField.prototype.latex = function (latex) { -// if (latex) { -// this.__controller.renderLatexText(latex); -// if (this.__controller.blurred) this.__controller.cursor.hide().parent.blur(); -// var _this = this; // just to help help TS out -// return _this; -// } -// return this.__controller.exportLatex(); -// }; -// return TextField; -// })(APIClasses.EditableField)), -// (_c.RootBlock = RootTextBlock), -// _c -// ); -// }; -// /************************************ -// * Symbols for Advanced Mathematics -// ***********************************/ -// LatexCmds.notin = LatexCmds.cong = LatexCmds.equiv = LatexCmds.oplus = LatexCmds.otimes = function (latex) { -// return new BinaryOperator('\\' + latex + ' ', h.entityText('&' + latex + ';')); -// }; -// LatexCmds['\u2217'] = LatexCmds.ast = LatexCmds.star = LatexCmds.loast = LatexCmds.lowast = bindBinaryOperator( -// '\\ast ', -// '∗', -// 'low asterisk' -// ); -// LatexCmds.therefor = LatexCmds.therefore = bindBinaryOperator('\\therefore ', '∴', 'therefore'); -// LatexCmds.cuz = LatexCmds.because = bindBinaryOperator( -// // l33t -// '\\because ', -// '∵', -// 'because' -// ); -// LatexCmds.prop = LatexCmds.propto = bindBinaryOperator('\\propto ', '∝', 'proportional to'); -// LatexCmds['\u2248'] = LatexCmds.asymp = LatexCmds.approx = bindBinaryOperator( -// '\\approx ', -// '≈', -// 'approximately equal to' -// ); -// LatexCmds.isin = LatexCmds['in'] = bindBinaryOperator('\\in ', '∈', 'is in'); -// LatexCmds.ni = LatexCmds.contains = bindBinaryOperator('\\ni ', '∋', 'is not in'); -// LatexCmds.notni = LatexCmds.niton = LatexCmds.notcontains = LatexCmds.doesnotcontain = bindBinaryOperator( -// '\\not\\ni ', -// '∌', -// 'does not contain' -// ); -// LatexCmds.sub = LatexCmds.subset = bindBinaryOperator('\\subset ', '⊂', 'subset'); -// LatexCmds.sup = LatexCmds.supset = LatexCmds.superset = bindBinaryOperator('\\supset ', '⊃', 'superset'); -// LatexCmds.nsub = LatexCmds.notsub = LatexCmds.nsubset = LatexCmds.notsubset = bindBinaryOperator( -// '\\not\\subset ', -// '⊄', -// 'not a subset' -// ); -// LatexCmds.nsup = LatexCmds.notsup = LatexCmds.nsupset = LatexCmds.notsupset = LatexCmds.nsuperset = LatexCmds.notsuperset = bindBinaryOperator( -// '\\not\\supset ', -// '⊅', -// 'not a superset' -// ); -// LatexCmds.sube = LatexCmds.subeq = LatexCmds.subsete = LatexCmds.subseteq = bindBinaryOperator( -// '\\subseteq ', -// '⊆', -// 'subset or equal to' -// ); -// LatexCmds.supe = LatexCmds.supeq = LatexCmds.supsete = LatexCmds.supseteq = LatexCmds.supersete = LatexCmds.superseteq = bindBinaryOperator( -// '\\supseteq ', -// '⊇', -// 'superset or equal to' -// ); -// LatexCmds.nsube = LatexCmds.nsubeq = LatexCmds.notsube = LatexCmds.notsubeq = LatexCmds.nsubsete = LatexCmds.nsubseteq = LatexCmds.notsubsete = LatexCmds.notsubseteq = bindBinaryOperator( -// '\\not\\subseteq ', -// '⊈', -// 'not subset or equal to' -// ); -// LatexCmds.nsupe = LatexCmds.nsupeq = LatexCmds.notsupe = LatexCmds.notsupeq = LatexCmds.nsupsete = LatexCmds.nsupseteq = LatexCmds.notsupsete = LatexCmds.notsupseteq = LatexCmds.nsupersete = LatexCmds.nsuperseteq = LatexCmds.notsupersete = LatexCmds.notsuperseteq = bindBinaryOperator( -// '\\not\\supseteq ', -// '⊉', -// 'not superset or equal to' -// ); -// //the canonical sets of numbers -// LatexCmds.mathbb = /** @class */ (function (_super) { -// __extends(class_3, _super); -// function class_3() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// class_3.prototype.createLeftOf = function (_cursor) {}; -// class_3.prototype.numBlocks = function () { -// return 1; -// }; -// class_3.prototype.parser = function () { -// var string = Parser.string; -// var regex = Parser.regex; -// var optWhitespace = Parser.optWhitespace; -// return optWhitespace -// .then(string('{')) -// .then(optWhitespace) -// .then(regex(/^[NPZQRCH]/)) -// .skip(optWhitespace) -// .skip(string('}')) -// .map(function (c) { -// // instantiate the class for the matching char -// var cmd = LatexCmds[c]; -// if (isMQNodeClass(cmd)) { -// return new cmd(); -// } else { -// return cmd(); -// } -// }); -// }; -// return class_3; -// })(MathCommand); -// LatexCmds.N = LatexCmds.naturals = LatexCmds.Naturals = bindVanillaSymbol('\\mathbb{N}', 'ℕ', 'naturals'); -// LatexCmds.P = LatexCmds.primes = LatexCmds.Primes = LatexCmds.projective = LatexCmds.Projective = LatexCmds.probability = LatexCmds.Probability = bindVanillaSymbol( -// '\\mathbb{P}', -// 'ℙ', -// 'P' -// ); -// LatexCmds.Z = LatexCmds.integers = LatexCmds.Integers = bindVanillaSymbol('\\mathbb{Z}', 'ℤ', 'integers'); -// LatexCmds.Q = LatexCmds.rationals = LatexCmds.Rationals = bindVanillaSymbol( -// '\\mathbb{Q}', -// 'ℚ', -// 'rationals' -// ); -// LatexCmds.R = LatexCmds.reals = LatexCmds.Reals = bindVanillaSymbol('\\mathbb{R}', 'ℝ', 'reals'); -// LatexCmds.C = LatexCmds.complex = LatexCmds.Complex = LatexCmds.complexes = LatexCmds.Complexes = LatexCmds.complexplane = LatexCmds.Complexplane = LatexCmds.ComplexPlane = bindVanillaSymbol( -// '\\mathbb{C}', -// 'ℂ', -// 'complexes' -// ); -// LatexCmds.H = LatexCmds.Hamiltonian = LatexCmds.quaternions = LatexCmds.Quaternions = bindVanillaSymbol( -// '\\mathbb{H}', -// 'ℍ', -// 'quaternions' -// ); -// //spacing -// LatexCmds.quad = LatexCmds.emsp = bindVanillaSymbol('\\quad ', ' ', '4 spaces'); -// LatexCmds.qquad = bindVanillaSymbol('\\qquad ', ' ', '8 spaces'); -// /* spacing special characters, gonna have to implement this in LatexCommandInput::onText somehow -// case ',': -// return VanillaSymbol('\\, ',' ', 'comma'); -// case ':': -// return VanillaSymbol('\\: ',' ', 'colon'); -// case ';': -// return VanillaSymbol('\\; ',' ', 'semicolon'); -// case '!': -// return MQSymbol('\\! ','', 'exclamation point'); -// */ -// //binary operators -// LatexCmds.diamond = bindVanillaSymbol('\\diamond ', '◇', 'diamond'); -// LatexCmds.bigtriangleup = bindVanillaSymbol('\\bigtriangleup ', '△', 'triangle up'); -// LatexCmds.ominus = bindVanillaSymbol('\\ominus ', '⊖', 'o minus'); -// LatexCmds.uplus = bindVanillaSymbol('\\uplus ', '⊎', 'disjoint union'); -// LatexCmds.bigtriangledown = bindVanillaSymbol('\\bigtriangledown ', '▽', 'triangle down'); -// LatexCmds.sqcap = bindVanillaSymbol('\\sqcap ', '⊓', 'greatest lower bound'); -// LatexCmds.triangleleft = bindVanillaSymbol('\\triangleleft ', '⊲', 'triangle left'); -// LatexCmds.sqcup = bindVanillaSymbol('\\sqcup ', '⊔', 'least upper bound'); -// LatexCmds.triangleright = bindVanillaSymbol('\\triangleright ', '⊳', 'triangle right'); -// //circledot is not a not real LaTex command see https://github.com/mathquill/mathquill/pull/552 for more details -// LatexCmds.odot = LatexCmds.circledot = bindVanillaSymbol('\\odot ', '⊙', 'circle dot'); -// LatexCmds.bigcirc = bindVanillaSymbol('\\bigcirc ', '◯', 'circle'); -// LatexCmds.dagger = bindVanillaSymbol('\\dagger ', '†', 'dagger'); -// LatexCmds.ddagger = bindVanillaSymbol('\\ddagger ', '‡', 'big dagger'); -// LatexCmds.wr = bindVanillaSymbol('\\wr ', '≀', 'wreath'); -// LatexCmds.amalg = bindVanillaSymbol('\\amalg ', '∐', 'amalgam'); -// //relationship symbols -// LatexCmds.models = bindVanillaSymbol('\\models ', '⊨', 'models'); -// LatexCmds.prec = bindVanillaSymbol('\\prec ', '≺', 'precedes'); -// LatexCmds.succ = bindVanillaSymbol('\\succ ', '≻', 'succeeds'); -// LatexCmds.preceq = bindVanillaSymbol('\\preceq ', '≼', 'precedes or equals'); -// LatexCmds.succeq = bindVanillaSymbol('\\succeq ', '≽', 'succeeds or equals'); -// LatexCmds.simeq = bindVanillaSymbol('\\simeq ', '≃', 'similar or equal to'); -// LatexCmds.mid = bindVanillaSymbol('\\mid ', '∣', 'divides'); -// LatexCmds.ll = bindVanillaSymbol('\\ll ', '≪', 'll'); -// LatexCmds.gg = bindVanillaSymbol('\\gg ', '≫', 'gg'); -// LatexCmds.parallel = bindVanillaSymbol('\\parallel ', '∥', 'parallel with'); -// LatexCmds.nparallel = bindVanillaSymbol('\\nparallel ', '∦', 'not parallel with'); -// LatexCmds.bowtie = bindVanillaSymbol('\\bowtie ', '⋈', 'bowtie'); -// LatexCmds.sqsubset = bindVanillaSymbol('\\sqsubset ', '⊏', 'square subset'); -// LatexCmds.sqsupset = bindVanillaSymbol('\\sqsupset ', '⊐', 'square superset'); -// LatexCmds.smile = bindVanillaSymbol('\\smile ', '⌣', 'smile'); -// LatexCmds.sqsubseteq = bindVanillaSymbol('\\sqsubseteq ', '⊑', 'square subset or equal to'); -// LatexCmds.sqsupseteq = bindVanillaSymbol('\\sqsupseteq ', '⊒', 'square superset or equal to'); -// LatexCmds.doteq = bindVanillaSymbol('\\doteq ', '≐', 'dotted equals'); -// LatexCmds.frown = bindVanillaSymbol('\\frown ', '⌢', 'frown'); -// LatexCmds.vdash = bindVanillaSymbol('\\vdash ', '⊦', 'v dash'); -// LatexCmds.dashv = bindVanillaSymbol('\\dashv ', '⊣', 'dash v'); -// LatexCmds.nless = bindVanillaSymbol('\\nless ', '≮', 'not less than'); -// LatexCmds.ngtr = bindVanillaSymbol('\\ngtr ', '≯', 'not greater than'); -// //arrows -// LatexCmds.longleftarrow = bindVanillaSymbol('\\longleftarrow ', '←', 'left arrow'); -// LatexCmds.longrightarrow = bindVanillaSymbol('\\longrightarrow ', '→', 'right arrow'); -// LatexCmds.Longleftarrow = bindVanillaSymbol('\\Longleftarrow ', '⇐', 'left arrow'); -// LatexCmds.Longrightarrow = bindVanillaSymbol('\\Longrightarrow ', '⇒', 'right arrow'); -// LatexCmds.longleftrightarrow = bindVanillaSymbol('\\longleftrightarrow ', '↔', 'left and right arrow'); -// LatexCmds.updownarrow = bindVanillaSymbol('\\updownarrow ', '↕', 'up and down arrow'); -// LatexCmds.Longleftrightarrow = bindVanillaSymbol('\\Longleftrightarrow ', '⇔', 'left and right arrow'); -// LatexCmds.Updownarrow = bindVanillaSymbol('\\Updownarrow ', '⇕', 'up and down arrow'); -// LatexCmds.mapsto = bindVanillaSymbol('\\mapsto ', '↦', 'maps to'); -// LatexCmds.nearrow = bindVanillaSymbol('\\nearrow ', '↗', 'northeast arrow'); -// LatexCmds.hookleftarrow = bindVanillaSymbol('\\hookleftarrow ', '↩', 'hook left arrow'); -// LatexCmds.hookrightarrow = bindVanillaSymbol('\\hookrightarrow ', '↪', 'hook right arrow'); -// LatexCmds.searrow = bindVanillaSymbol('\\searrow ', '↘', 'southeast arrow'); -// LatexCmds.leftharpoonup = bindVanillaSymbol('\\leftharpoonup ', '↼', 'left harpoon up'); -// LatexCmds.rightharpoonup = bindVanillaSymbol('\\rightharpoonup ', '⇀', 'right harpoon up'); -// LatexCmds.swarrow = bindVanillaSymbol('\\swarrow ', '↙', 'southwest arrow'); -// LatexCmds.leftharpoondown = bindVanillaSymbol('\\leftharpoondown ', '↽', 'left harpoon down'); -// LatexCmds.rightharpoondown = bindVanillaSymbol('\\rightharpoondown ', '⇁', 'right harpoon down'); -// LatexCmds.nwarrow = bindVanillaSymbol('\\nwarrow ', '↖', 'northwest arrow'); -// //Misc -// LatexCmds.ldots = bindVanillaSymbol('\\ldots ', '…', 'l dots'); -// LatexCmds.cdots = bindVanillaSymbol('\\cdots ', '⋯', 'c dots'); -// LatexCmds.vdots = bindVanillaSymbol('\\vdots ', '⋮', 'v dots'); -// LatexCmds.ddots = bindVanillaSymbol('\\ddots ', '⋱', 'd dots'); -// LatexCmds.surd = bindVanillaSymbol('\\surd ', '√', 'unresolved root'); -// LatexCmds.triangle = bindVanillaSymbol('\\triangle ', '△', 'triangle'); -// LatexCmds.ell = bindVanillaSymbol('\\ell ', 'ℓ', 'ell'); -// LatexCmds.top = bindVanillaSymbol('\\top ', '⊤', 'top'); -// LatexCmds.flat = bindVanillaSymbol('\\flat ', '♭', 'flat'); -// LatexCmds.natural = bindVanillaSymbol('\\natural ', '♮', 'natural'); -// LatexCmds.sharp = bindVanillaSymbol('\\sharp ', '♯', 'sharp'); -// LatexCmds.wp = bindVanillaSymbol('\\wp ', '℘', 'wp'); -// LatexCmds.bot = bindVanillaSymbol('\\bot ', '⊥', 'bot'); -// LatexCmds.clubsuit = bindVanillaSymbol('\\clubsuit ', '♣', 'club suit'); -// LatexCmds.diamondsuit = bindVanillaSymbol('\\diamondsuit ', '♢', 'diamond suit'); -// LatexCmds.heartsuit = bindVanillaSymbol('\\heartsuit ', '♡', 'heart suit'); -// LatexCmds.spadesuit = bindVanillaSymbol('\\spadesuit ', '♠', 'spade suit'); -// //not real LaTex command see https://github.com/mathquill/mathquill/pull/552 for more details -// LatexCmds.parallelogram = bindVanillaSymbol('\\parallelogram ', '▱', 'parallelogram'); -// LatexCmds.square = bindVanillaSymbol('\\square ', '⬜', 'square'); -// //variable-sized -// LatexCmds.oint = bindVanillaSymbol('\\oint ', '∮', 'o int'); -// LatexCmds.bigcap = bindVanillaSymbol('\\bigcap ', '∩', 'big cap'); -// LatexCmds.bigcup = bindVanillaSymbol('\\bigcup ', '∪', 'big cup'); -// LatexCmds.bigsqcup = bindVanillaSymbol('\\bigsqcup ', '⊔', 'big square cup'); -// LatexCmds.bigvee = bindVanillaSymbol('\\bigvee ', '∨', 'big vee'); -// LatexCmds.bigwedge = bindVanillaSymbol('\\bigwedge ', '∧', 'big wedge'); -// LatexCmds.bigodot = bindVanillaSymbol('\\bigodot ', '⊙', 'big o dot'); -// LatexCmds.bigotimes = bindVanillaSymbol('\\bigotimes ', '⊗', 'big o times'); -// LatexCmds.bigoplus = bindVanillaSymbol('\\bigoplus ', '⊕', 'big o plus'); -// LatexCmds.biguplus = bindVanillaSymbol('\\biguplus ', '⊎', 'big u plus'); -// //delimiters -// LatexCmds.lfloor = bindVanillaSymbol('\\lfloor ', '⌊', 'left floor'); -// LatexCmds.rfloor = bindVanillaSymbol('\\rfloor ', '⌋', 'right floor'); -// LatexCmds.lceil = bindVanillaSymbol('\\lceil ', '⌈', 'left ceiling'); -// LatexCmds.rceil = bindVanillaSymbol('\\rceil ', '⌉', 'right ceiling'); -// LatexCmds.opencurlybrace = LatexCmds.lbrace = bindVanillaSymbol('\\lbrace ', '{', 'left brace'); -// LatexCmds.closecurlybrace = LatexCmds.rbrace = bindVanillaSymbol('\\rbrace ', '}', 'right brace'); -// LatexCmds.lbrack = bindVanillaSymbol('[', 'left bracket'); -// LatexCmds.rbrack = bindVanillaSymbol(']', 'right bracket'); -// //various symbols -// LatexCmds.slash = bindVanillaSymbol('/', 'slash'); -// LatexCmds.vert = bindVanillaSymbol('|', 'vertical bar'); -// LatexCmds.perp = LatexCmds.perpendicular = bindVanillaSymbol('\\perp ', '⊥', 'perpendicular'); -// LatexCmds.nabla = LatexCmds.del = bindVanillaSymbol('\\nabla ', '∇'); -// LatexCmds.hbar = bindVanillaSymbol('\\hbar ', 'ℏ', 'horizontal bar'); -// LatexCmds.AA = LatexCmds.Angstrom = LatexCmds.angstrom = bindVanillaSymbol('\\text\\AA ', 'Å', 'AA'); -// LatexCmds.ring = LatexCmds.circ = LatexCmds.circle = bindVanillaSymbol('\\circ ', '∘', 'circle'); -// LatexCmds.bull = LatexCmds.bullet = bindVanillaSymbol('\\bullet ', '•', 'bullet'); -// LatexCmds.setminus = LatexCmds.smallsetminus = bindVanillaSymbol('\\setminus ', '∖', 'set minus'); -// LatexCmds.not = LatexCmds['\u00ac'] = LatexCmds.neg = bindVanillaSymbol('\\neg ', '¬', 'not'); //bind(MQSymbol,'\\not ','/', 'not'); -// LatexCmds[ -// '\u2026' -// ] = LatexCmds.dots = LatexCmds.ellip = LatexCmds.hellip = LatexCmds.ellipsis = LatexCmds.hellipsis = bindVanillaSymbol( -// '\\dots ', -// '…', -// 'ellipsis' -// ); -// LatexCmds.converges = LatexCmds.darr = LatexCmds.dnarr = LatexCmds.dnarrow = LatexCmds.downarrow = bindVanillaSymbol( -// '\\downarrow ', -// '↓', -// 'converges with' -// ); -// LatexCmds.dArr = LatexCmds.dnArr = LatexCmds.dnArrow = LatexCmds.Downarrow = bindVanillaSymbol( -// '\\Downarrow ', -// '⇓', -// 'down arrow' -// ); -// LatexCmds.diverges = LatexCmds.uarr = LatexCmds.uparrow = bindVanillaSymbol( -// '\\uparrow ', -// '↑', -// 'diverges from' -// ); -// LatexCmds.uArr = LatexCmds.Uparrow = bindVanillaSymbol('\\Uparrow ', '⇑', 'up arrow'); -// LatexCmds.rarr = LatexCmds.rightarrow = bindVanillaSymbol('\\rightarrow ', '→', 'right arrow'); -// LatexCmds.implies = bindBinaryOperator('\\Rightarrow ', '⇒', 'implies'); -// LatexCmds.rArr = LatexCmds.Rightarrow = bindVanillaSymbol('\\Rightarrow ', '⇒', 'right arrow'); -// LatexCmds.gets = bindBinaryOperator('\\gets ', '←', 'gets'); -// LatexCmds.larr = LatexCmds.leftarrow = bindVanillaSymbol('\\leftarrow ', '←', 'left arrow'); -// LatexCmds.impliedby = bindBinaryOperator('\\Leftarrow ', '⇐', 'implied by'); -// LatexCmds.lArr = LatexCmds.Leftarrow = bindVanillaSymbol('\\Leftarrow ', '⇐', 'left arrow'); -// LatexCmds.harr = LatexCmds.lrarr = LatexCmds.leftrightarrow = bindVanillaSymbol( -// '\\leftrightarrow ', -// '↔', -// 'left and right arrow' -// ); -// LatexCmds.iff = bindBinaryOperator('\\Leftrightarrow ', '⇔', 'if and only if'); -// LatexCmds.hArr = LatexCmds.lrArr = LatexCmds.Leftrightarrow = bindVanillaSymbol( -// '\\Leftrightarrow ', -// '⇔', -// 'left and right arrow' -// ); -// LatexCmds.Re = LatexCmds.Real = LatexCmds.real = bindVanillaSymbol('\\Re ', 'ℜ', 'real'); -// LatexCmds.Im = LatexCmds.imag = LatexCmds.image = LatexCmds.imagin = LatexCmds.imaginary = LatexCmds.Imaginary = bindVanillaSymbol( -// '\\Im ', -// 'ℑ', -// 'imaginary' -// ); -// LatexCmds.part = LatexCmds.partial = bindVanillaSymbol('\\partial ', '∂', 'partial'); -// LatexCmds.pounds = bindVanillaSymbol('\\pounds ', '£'); -// LatexCmds.alef = LatexCmds.alefsym = LatexCmds.aleph = LatexCmds.alephsym = bindVanillaSymbol( -// '\\aleph ', -// 'ℵ', -// 'alef sym' -// ); -// LatexCmds.xist = LatexCmds.xists = LatexCmds.exist = LatexCmds.exists = bindVanillaSymbol( //LOL -// '\\exists ', -// '∃', -// 'there exists at least 1' -// ); -// LatexCmds.nexists = LatexCmds.nexist = bindVanillaSymbol('\\nexists ', '∄', 'there is no'); -// LatexCmds.and = LatexCmds.land = LatexCmds.wedge = bindBinaryOperator('\\wedge ', '∧', 'and'); -// LatexCmds.or = LatexCmds.lor = LatexCmds.vee = bindBinaryOperator('\\vee ', '∨', 'or'); -// LatexCmds.o = LatexCmds.O = LatexCmds.empty = LatexCmds.emptyset = LatexCmds.oslash = LatexCmds.Oslash = LatexCmds.nothing = LatexCmds.varnothing = bindBinaryOperator( -// '\\varnothing ', -// '∅', -// 'nothing' -// ); -// LatexCmds.cup = LatexCmds.union = bindBinaryOperator('\\cup ', '∪', 'union'); -// LatexCmds.cap = LatexCmds.intersect = LatexCmds.intersection = bindBinaryOperator( -// '\\cap ', -// '∩', -// 'intersection' -// ); -// // FIXME: the correct LaTeX would be ^\circ but we can't parse that -// LatexCmds.deg = LatexCmds.degree = bindVanillaSymbol('\\degree ', '°', 'degrees'); -// LatexCmds.ang = LatexCmds.angle = bindVanillaSymbol('\\angle ', '∠', 'angle'); -// LatexCmds.measuredangle = bindVanillaSymbol('\\measuredangle ', '∡', 'measured angle'); -// /********************************* -// * Symbols for Basic Mathematics -// ********************************/ -// var DigitGroupingChar = /** @class */ (function (_super) { -// __extends(DigitGroupingChar, _super); -// function DigitGroupingChar() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// DigitGroupingChar.prototype.finalizeTree = function (opts, dir) { -// this.sharedSiblingMethod(opts, dir); -// }; -// DigitGroupingChar.prototype.siblingDeleted = function (opts, dir) { -// this.sharedSiblingMethod(opts, dir); -// }; -// DigitGroupingChar.prototype.siblingCreated = function (opts, dir) { -// this.sharedSiblingMethod(opts, dir); -// }; -// DigitGroupingChar.prototype.sharedSiblingMethod = function (opts, dir) { -// // don't try to fix digit grouping if the sibling to my right changed (dir === R or -// // undefined) and it's now a DigitGroupingChar, it will try to fix grouping -// if (dir !== L && this[R] instanceof DigitGroupingChar) return; -// this.fixDigitGrouping(opts); -// }; -// DigitGroupingChar.prototype.fixDigitGrouping = function (opts) { -// if (!opts.enableDigitGrouping) return; -// var left = this; -// var right = this; -// var spacesFound = 0; -// var dots = []; -// var SPACE = '\\ '; -// var DOT = '.'; -// // traverse left as far as possible (starting at this char) -// var node = left; -// do { -// if (/^[0-9]$/.test(node.ctrlSeq)) { -// left = node; -// } else if (node.ctrlSeq === SPACE) { -// left = node; -// spacesFound += 1; -// } else if (node.ctrlSeq === DOT) { -// left = node; -// dots.push(node); -// } else { -// break; -// } -// } while ((node = left[L])); -// // traverse right as far as possible (starting to right of this char) -// while ((node = right[R])) { -// if (/^[0-9]$/.test(node.ctrlSeq)) { -// right = node; -// } else if (node.ctrlSeq === SPACE) { -// right = node; -// spacesFound += 1; -// } else if (node.ctrlSeq === DOT) { -// right = node; -// dots.push(node); -// } else { -// break; -// } -// } -// // trim the leading spaces -// while (right !== left && left && left.ctrlSeq === SPACE) { -// left = left[R]; -// spacesFound -= 1; -// } -// // trim the trailing spaces -// while (right !== left && right && right.ctrlSeq === SPACE) { -// right = right[L]; -// spacesFound -= 1; -// } -// // happens when you only have a space -// if (left === right && left && left.ctrlSeq === SPACE) return; -// var disableFormatting = spacesFound > 0 || dots.length > 1; -// if (disableFormatting) { -// this.removeGroupingBetween(left, right); -// } else if (dots[0]) { -// if (dots[0] !== left) { -// this.addGroupingBetween(dots[0][L], left); -// } -// if (dots[0] !== right) { -// // we do not show grouping to the right of a decimal place #yet -// this.removeGroupingBetween(dots[0][R], right); -// } -// } else { -// this.addGroupingBetween(right, left); -// } -// }; -// DigitGroupingChar.prototype.removeGroupingBetween = function (left, right) { -// var node = left; -// do { -// if (node instanceof DigitGroupingChar) { -// node.setGroupingClass(undefined); -// } -// if (!node || node === right) break; -// } while ((node = node[R])); -// }; -// DigitGroupingChar.prototype.addGroupingBetween = function (start, end) { -// var node = start; -// var count = 0; -// var totalDigits = 0; -// var node = start; -// while (node) { -// totalDigits += 1; -// if (node === end) break; -// node = node[L]; -// } -// var numDigitsInFirstGroup = totalDigits % 3; -// if (numDigitsInFirstGroup === 0) numDigitsInFirstGroup = 3; -// var node = start; -// while (node) { -// count += 1; -// var cls = undefined; -// // only do grouping if we have at least 4 numbers -// if (totalDigits >= 4) { -// if (count === totalDigits) { -// cls = 'dcg-mq-group-leading-' + numDigitsInFirstGroup; -// } else if (count % 3 === 0) { -// if (count !== totalDigits) { -// cls = 'dcg-mq-group-start'; -// } -// } -// if (!cls) { -// cls = 'dcg-mq-group-other'; -// } -// } -// if (node instanceof DigitGroupingChar) { -// node.setGroupingClass(cls); -// } -// if (node === end) break; -// node = node[L]; -// } -// }; -// DigitGroupingChar.prototype.setGroupingClass = function (cls) { -// // nothing changed (either class is the same or it's still undefined) -// if (this._groupingClass === cls) return; -// // remove existing class -// if (this._groupingClass) this.domFrag().removeClass(this._groupingClass); -// // add new class -// if (cls) this.domFrag().addClass(cls); -// // cache the groupingClass -// this._groupingClass = cls; -// }; -// return DigitGroupingChar; -// })(MQSymbol); -// var Digit = /** @class */ (function (_super) { -// __extends(Digit, _super); -// function Digit(ch, mathspeak) { -// return ( -// _super.call(this, ch, h('span', { class: 'dcg-mq-digit' }, [h.text(ch)]), undefined, mathspeak) || -// this -// ); -// } -// Digit.prototype.createLeftOf = function (cursor) { -// var cursorL = cursor[L]; -// var cursorLL = cursorL && cursorL[L]; -// var cursorParentParentSub = -// cursor.parent.parent instanceof SupSub ? cursor.parent.parent.sub : undefined; -// if ( -// cursor.options.autoSubscriptNumerals && -// cursor.parent !== cursorParentParentSub && -// ((cursorL instanceof Variable && cursorL.isItalic !== false) || -// (cursorL instanceof SupSub && cursorLL instanceof Variable && cursorLL.isItalic !== false)) -// ) { -// new SubscriptCommand().createLeftOf(cursor); -// _super.prototype.createLeftOf.call(this, cursor); -// cursor.insRightOf(cursor.parent.parent); -// } else _super.prototype.createLeftOf.call(this, cursor); -// }; -// Digit.prototype.mathspeak = function (opts) { -// if (opts && opts.createdLeftOf) { -// var cursor = opts.createdLeftOf; -// var cursorL = cursor[L]; -// var cursorLL = cursorL && cursorL[L]; -// var cursorParentParentSub = -// cursor.parent.parent instanceof SupSub ? cursor.parent.parent.sub : undefined; -// if ( -// cursor.options.autoSubscriptNumerals && -// cursor.parent !== cursorParentParentSub && -// ((cursorL instanceof Variable && cursorL.isItalic !== false) || -// (cursor[L] instanceof SupSub && -// cursorLL instanceof Variable && -// cursorLL.isItalic !== false)) -// ) { -// return 'Subscript ' + _super.prototype.mathspeak.call(this) + ' Baseline'; -// } -// } -// return _super.prototype.mathspeak.call(this); -// }; -// return Digit; -// })(DigitGroupingChar); -// var Variable = /** @class */ (function (_super) { -// __extends(Variable, _super); -// function Variable(chOrCtrlSeq, html) { -// return _super.call(this, chOrCtrlSeq, h('var', {}, [html || h.text(chOrCtrlSeq)])) || this; -// } -// Variable.prototype.text = function () { -// var text = this.ctrlSeq || ''; -// if (this.isPartOfOperator) { -// if (text[0] == '\\') { -// text = text.slice(1, text.length); -// } else if (text[text.length - 1] == ' ') { -// text = text.slice(0, -1); -// } -// } else { -// if ( -// this[L] && -// !(this[L] instanceof Variable) && -// !(this[L] instanceof BinaryOperator) && -// this[L].ctrlSeq !== '\\ ' -// ) -// text = '*' + text; -// if (this[R] && !(this[R] instanceof BinaryOperator) && !(this[R] instanceof SupSub)) text += '*'; -// } -// return text; -// }; -// Variable.prototype.mathspeak = function () { -// var text = this.ctrlSeq || ''; -// if ( -// this.isPartOfOperator || -// text.length > 1 || -// (this.parent && this.parent.parent && this.parent.parent.isTextBlock()) -// ) { -// return _super.prototype.mathspeak.call(this); -// } else { -// // Apple voices in VoiceOver (such as Alex, Bruce, and Victoria) do -// // some strange pronunciation given certain expressions, -// // e.g. "y-2" is spoken as "ee minus 2" (as if the y is short). -// // Not an ideal solution, but surrounding non-numeric text blocks with quotation marks works. -// // This bug has been acknowledged by Apple. -// return '"' + text + '"'; -// } -// }; -// return Variable; -// })(MQSymbol); -// function bindVariable(ch, htmlEntity, _unusedMathspeak) { -// return function () { -// return new Variable(ch, h.entityText(htmlEntity)); -// }; -// } -// Options.prototype.autoCommands = { -// _maxLength: 0, -// }; -// baseOptionProcessors.autoCommands = function (cmds) { -// if (typeof cmds !== 'string' || !/^[a-z]+(?: [a-z]+)*$/i.test(cmds)) { -// throw '"' + cmds + '" not a space-delimited list of only letters'; -// } -// var list = cmds.split(' '); -// var dict = {}; -// var maxLength = 0; -// for (var i = 0; i < list.length; i += 1) { -// var cmd = list[i]; -// if (cmd.length < 2) { -// throw 'autocommand "' + cmd + '" not minimum length of 2'; -// } -// if (LatexCmds[cmd] === OperatorName) { -// throw '"' + cmd + '" is a built-in operator name'; -// } -// dict[cmd] = 1; -// maxLength = max(maxLength, cmd.length); -// } -// dict._maxLength = maxLength; -// return dict; -// }; -// Options.prototype.quietEmptyDelimiters = {}; -// baseOptionProcessors.quietEmptyDelimiters = function (dlms) { -// if (dlms === void 0) { -// dlms = ''; -// } -// var list = dlms.split(' '); -// var dict = {}; -// for (var i = 0; i < list.length; i += 1) { -// var dlm = list[i]; -// dict[dlm] = 1; -// } -// return dict; -// }; -// Options.prototype.autoParenthesizedFunctions = { _maxLength: 0 }; -// baseOptionProcessors.autoParenthesizedFunctions = function (cmds) { -// if (typeof cmds !== 'string' || !/^[a-z]+(?: [a-z]+)*$/i.test(cmds)) { -// throw '"' + cmds + '" not a space-delimited list of only letters'; -// } -// var list = cmds.split(' '); -// var dict = {}; -// var maxLength = 0; -// for (var i = 0; i < list.length; i += 1) { -// var cmd = list[i]; -// if (cmd.length < 2) { -// throw 'autocommand "' + cmd + '" not minimum length of 2'; -// } -// dict[cmd] = 1; -// maxLength = max(maxLength, cmd.length); -// } -// dict._maxLength = maxLength; -// return dict; -// }; -// var Letter = /** @class */ (function (_super) { -// __extends(Letter, _super); -// function Letter(ch) { -// var _this_1 = _super.call(this, ch) || this; -// _this_1.letter = ch; -// return _this_1; -// } -// Letter.prototype.checkAutoCmds = function (cursor) { -// //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. -// if (this.shouldIgnoreSubstitutionInSimpleSubscript(cursor.options)) { -// return; -// } -// //handle autoCommands -// var autoCmds = cursor.options.autoCommands; -// var maxLength = autoCmds._maxLength || 0; -// if (maxLength > 0) { -// // want longest possible autocommand, so join together longest -// // sequence of letters -// var str = ''; -// var l = this; -// var i = 0; -// // FIXME: l.ctrlSeq === l.letter checks if first or last in an operator name -// while (l instanceof Letter && l.ctrlSeq === l.letter && i < maxLength) { -// str = l.letter + str; -// l = l[L]; -// i += 1; -// } -// // check for an autocommand, going thru substrings longest to shortest -// while (str.length) { -// if (autoCmds.hasOwnProperty(str)) { -// l = this; -// for (i = 1; l && i < str.length; i += 1, l = l[L]); -// new Fragment(l, this).remove(); -// cursor[L] = l[L]; -// var cmd = LatexCmds[str]; -// var node; -// if (isMQNodeClass(cmd)) { -// node = new cmd(str); // TODO - How do we know that this class expects a single str input? -// } else { -// node = cmd(str); -// } -// return node.createLeftOf(cursor); -// } -// str = str.slice(1); -// } -// } -// }; -// Letter.prototype.autoParenthesize = function (cursor) { -// //exit early if already parenthesized -// var right = cursor.parent.getEnd(R); -// if (right && right instanceof Bracket && right.ctrlSeq === '\\left(') { -// return; -// } -// //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. -// if (this.shouldIgnoreSubstitutionInSimpleSubscript(cursor.options)) { -// return; -// } -// //handle autoParenthesized functions -// var str = ''; -// var l = this; -// var i = 0; -// var autoParenthesizedFunctions = cursor.options.autoParenthesizedFunctions; -// var maxLength = autoParenthesizedFunctions._maxLength || 0; -// var autoOperatorNames = cursor.options.autoOperatorNames; -// while (l instanceof Letter && i < maxLength) { -// (str = l.letter + str), (l = l[L]), (i += 1); -// } -// // check for an autoParenthesized functions, going thru substrings longest to shortest -// // only allow autoParenthesized functions that are also autoOperatorNames -// while (str.length) { -// if (autoParenthesizedFunctions.hasOwnProperty(str) && autoOperatorNames.hasOwnProperty(str)) { -// return cursor.parent.write(cursor, '('); -// } -// str = str.slice(1); -// } -// }; -// Letter.prototype.createLeftOf = function (cursor) { -// _super.prototype.createLeftOf.call(this, cursor); -// this.checkAutoCmds(cursor); -// this.autoParenthesize(cursor); -// }; -// Letter.prototype.italicize = function (bool) { -// this.isItalic = bool; -// this.isPartOfOperator = !bool; -// this.domFrag().toggleClass('dcg-mq-operator-name', !bool); -// return this; -// }; -// Letter.prototype.finalizeTree = function (opts, dir) { -// this.sharedSiblingMethod(opts, dir); -// }; -// Letter.prototype.siblingDeleted = function (opts, dir) { -// this.sharedSiblingMethod(opts, dir); -// }; -// Letter.prototype.siblingCreated = function (opts, dir) { -// this.sharedSiblingMethod(opts, dir); -// }; -// Letter.prototype.sharedSiblingMethod = function (opts, dir) { -// // don't auto-un-italicize if the sibling to my right changed (dir === R or -// // undefined) and it's now a Letter, it will un-italicize everyone -// if (dir !== L && this[R] instanceof Letter) return; -// this.autoUnItalicize(opts); -// }; -// Letter.prototype.autoUnItalicize = function (opts) { -// var autoOps = opts.autoOperatorNames; -// if (autoOps._maxLength === 0) return; -// //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. -// if (this.shouldIgnoreSubstitutionInSimpleSubscript(opts)) { -// return; -// } -// // want longest possible operator names, so join together entire contiguous -// // sequence of letters -// var str = this.letter; -// for (var l = this[L]; l instanceof Letter; l = l[L]) str = l.letter + str; -// for (var r = this[R]; r instanceof Letter; r = r[R]) str += r.letter; -// // removeClass and delete flags from all letters before figuring out -// // which, if any, are part of an operator name -// var lR = l && l[R]; -// var rL = r && r[L]; -// new Fragment(lR || this.parent.getEnd(L), rL || this.parent.getEnd(R)).each(function (el) { -// if (el instanceof Letter) { -// el.italicize(true).domFrag().removeClass('dcg-mq-first dcg-mq-last dcg-mq-followed-by-supsub'); -// el.ctrlSeq = el.letter; -// } -// return undefined; -// }); -// var autoOpsLength = autoOps._maxLength || 0; -// // check for operator names: at each position from left to right, check -// // substrings from longest to shortest -// outer: for ( -// var i = 0, first = l[R] || this.parent.getEnd(L); -// first && i < str.length; -// i += 1, first = first[R] -// ) { -// for (var len = min(autoOpsLength, str.length - i); len > 0; len -= 1) { -// var word = str.slice(i, i + len); -// var last = undefined; // TODO - TS complaining that we use last before assigning to it -// if (autoOps.hasOwnProperty(word)) { -// for (var j = 0, letter = first; j < len; j += 1, letter = letter[R]) { -// if (letter instanceof Letter) { -// letter.italicize(false); -// last = letter; -// } -// } -// var isBuiltIn = BuiltInOpNames.hasOwnProperty(word); -// first.ctrlSeq = (isBuiltIn ? '\\' : '\\operatorname{') + first.ctrlSeq; -// last.ctrlSeq += isBuiltIn ? ' ' : '}'; -// if (TwoWordOpNames.hasOwnProperty(word)) { -// var lastL = last[L]; -// var lastLL = lastL && lastL[L]; -// var lastLLL = lastLL && lastLL[L]; -// lastLLL.domFrag().addClass('dcg-mq-last'); -// } -// if (!this.shouldOmitPadding(first[L])) first.domFrag().addClass('dcg-mq-first'); -// if (!this.shouldOmitPadding(last[R])) { -// if (last[R] instanceof SupSub) { -// var supsub = last[R]; // XXX monkey-patching, but what's the right thing here? -// // Have operatorname-specific code in SupSub? A CSS-like language to style the -// // math tree, but which ignores cursor and selection (which CSS can't)? -// var respace = (supsub.siblingCreated = supsub.siblingDeleted = function () { -// supsub -// .domFrag() -// .toggleClass('dcg-mq-after-operator-name', !(supsub[R] instanceof Bracket)); -// }); -// respace(); -// } else { -// last.domFrag().toggleClass('dcg-mq-last', !(last[R] instanceof Bracket)); -// } -// } -// i += len - 1; -// first = last; -// continue outer; -// } -// } -// } -// }; -// Letter.prototype.shouldOmitPadding = function (node) { -// // omit padding if no node -// if (!node) return true; -// // do not add padding between letter and '.' -// if (node.ctrlSeq === '.') return true; -// // do not add padding between letter and binary operator. The -// // binary operator already has padding -// if (node instanceof BinaryOperator) return true; -// if (node instanceof SummationNotation) return true; -// return false; -// }; -// return Letter; -// })(Variable); -// var BuiltInOpNames = {}; // the set of operator names like \sin, \cos, etc that -// // are built-into LaTeX, see Section 3.17 of the Short Math Guide: http://tinyurl.com/jm9okjc -// // MathQuill auto-unitalicizes some operator names not in that set, like 'hcf' -// // and 'arsinh', which must be exported as \operatorname{hcf} and -// // \operatorname{arsinh}. Note: over/under line/arrow \lim variants like -// // \varlimsup are not supported -// // the set of operator names that MathQuill auto-unitalicizes by default; overridable -// Options.prototype.autoOperatorNames = defaultAutoOpNames(); -// var TwoWordOpNames = { limsup: 1, liminf: 1, projlim: 1, injlim: 1 }; -// function defaultAutoOpNames() { -// var AutoOpNames = { -// _maxLength: 9, -// }; -// var mostOps = ( -// 'arg deg det dim exp gcd hom inf ker lg lim ln log max min sup' + ' limsup liminf injlim projlim Pr' -// ).split(' '); -// for (var i = 0; i < mostOps.length; i += 1) { -// BuiltInOpNames[mostOps[i]] = AutoOpNames[mostOps[i]] = 1; -// } -// var builtInTrigs = 'sin cos tan arcsin arccos arctan sinh cosh tanh sec csc cot coth'.split( -// // why coth but not sech and csch, LaTeX? -// ' ' -// ); -// for (var i = 0; i < builtInTrigs.length; i += 1) { -// BuiltInOpNames[builtInTrigs[i]] = 1; -// } -// var autoTrigs = 'sin cos tan sec cosec csc cotan cot ctg'.split(' '); -// for (var i = 0; i < autoTrigs.length; i += 1) { -// AutoOpNames[autoTrigs[i]] = AutoOpNames['arc' + autoTrigs[i]] = AutoOpNames[ -// autoTrigs[i] + 'h' -// ] = AutoOpNames['ar' + autoTrigs[i] + 'h'] = AutoOpNames['arc' + autoTrigs[i] + 'h'] = 1; -// } -// // compat with some of the nonstandard LaTeX exported by MathQuill -// // before #247. None of these are real LaTeX commands so, seems safe -// var moreNonstandardOps = 'gcf hcf lcm proj span'.split(' '); -// for (var i = 0; i < moreNonstandardOps.length; i += 1) { -// AutoOpNames[moreNonstandardOps[i]] = 1; -// } -// return AutoOpNames; -// } -// baseOptionProcessors.autoOperatorNames = function (cmds) { -// if (typeof cmds !== 'string') { -// throw '"' + cmds + '" not a space-delimited list'; -// } -// if (!/^[a-z\|\-]+(?: [a-z\|\-]+)*$/i.test(cmds)) { -// throw '"' + cmds + '" not a space-delimited list of letters or "|"'; -// } -// var list = cmds.split(' '); -// var dict = {}; -// var maxLength = 0; -// for (var i = 0; i < list.length; i += 1) { -// var cmd = list[i]; -// if (cmd.length < 2) { -// throw '"' + cmd + '" not minimum length of 2'; -// } -// if (cmd.indexOf('|') < 0) { -// // normal auto operator -// dict[cmd] = cmd; -// maxLength = max(maxLength, cmd.length); -// } else { -// // this item has a speech-friendly alternative -// var cmdArray = cmd.split('|'); -// if (cmdArray.length > 2) { -// throw '"' + cmd + '" has more than 1 mathspeak delimiter'; -// } -// if (cmdArray[0].length < 2) { -// throw '"' + cmd[0] + '" not minimum length of 2'; -// } -// dict[cmdArray[0]] = cmdArray[1].replace(/-/g, ' '); // convert dashes to spaces for the sake of speech -// maxLength = max(maxLength, cmdArray[0].length); -// } -// } -// dict._maxLength = maxLength; -// return dict; -// }; -// var OperatorName = /** @class */ (function (_super) { -// __extends(OperatorName, _super); -// function OperatorName(fn) { -// return _super.call(this, fn || '') || this; -// } -// OperatorName.prototype.createLeftOf = function (cursor) { -// var fn = this.ctrlSeq; -// for (var i = 0; i < fn.length; i += 1) { -// new Letter(fn.charAt(i)).createLeftOf(cursor); -// } -// }; -// OperatorName.prototype.parser = function () { -// var fn = this.ctrlSeq; -// var block = new MathBlock(); -// for (var i = 0; i < fn.length; i += 1) { -// new Letter(fn.charAt(i)).adopt(block, block.getEnd(R), 0); -// } -// return Parser.succeed(block.children()); -// }; -// return OperatorName; -// })(MQSymbol); -// for (var fn in Options.prototype.autoOperatorNames) -// if (Options.prototype.autoOperatorNames.hasOwnProperty(fn)) { -// LatexCmds[fn] = OperatorName; -// } -// LatexCmds.operatorname = /** @class */ (function (_super) { -// __extends(class_4, _super); -// function class_4() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// class_4.prototype.createLeftOf = function () {}; -// class_4.prototype.numBlocks = function () { -// return 1; -// }; -// class_4.prototype.parser = function () { -// return latexMathParser.block.map(function (b) { -// // Check for the special case of \operatorname{ans}, which has -// // a special html representation -// var isAllLetters = true; -// var str = ''; -// var children = b.children(); -// children.each(function (child) { -// if (child instanceof Letter) { -// str += child.letter; -// } else { -// isAllLetters = false; -// } -// return undefined; -// }); -// if (isAllLetters && str === 'ans') { -// return AnsBuilder(); -// } -// // In cases other than `ans`, just return the children directly -// return children; -// }); -// }; -// return class_4; -// })(MathCommand); -// LatexCmds.f = /** @class */ (function (_super) { -// __extends(class_5, _super); -// function class_5() { -// var _this_1 = this; -// var letter = 'f'; -// _this_1 = _super.call(this, letter) || this; -// _this_1.letter = letter; -// _this_1.domView = new DOMView(0, function () { -// return h('var', { class: 'dcg-mq-f' }, [h.text('f')]); -// }); -// return _this_1; -// } -// class_5.prototype.italicize = function (bool) { -// // Why is this necesssary? Does someone replace the `f` at some -// // point? -// this.domFrag().eachElement(function (el) { -// return (el.textContent = 'f'); -// }); -// this.domFrag().toggleClass('dcg-mq-f', bool); -// return _super.prototype.italicize.call(this, bool); -// }; -// return class_5; -// })(Letter); -// // VanillaSymbol's -// LatexCmds[' '] = LatexCmds.space = function () { -// return new DigitGroupingChar('\\ ', h('span', {}, [h.text(U_NO_BREAK_SPACE)]), ' '); -// }; -// LatexCmds['.'] = function () { -// return new DigitGroupingChar('.', h('span', { class: 'dcg-mq-digit' }, [h.text('.')]), '.'); -// }; -// LatexCmds["'"] = LatexCmds.prime = bindVanillaSymbol("'", '′', 'prime'); -// LatexCmds['\u2033'] = LatexCmds.dprime = bindVanillaSymbol('\u2033', '″', 'double prime'); -// LatexCmds.backslash = bindVanillaSymbol('\\backslash ', '\\', 'backslash'); -// if (!CharCmds['\\']) CharCmds['\\'] = LatexCmds.backslash; -// LatexCmds.$ = bindVanillaSymbol('\\$', '$', 'dollar'); -// LatexCmds.square = bindVanillaSymbol('\\square ', '\u25A1', 'square'); -// LatexCmds.mid = bindVanillaSymbol('\\mid ', '\u2223', 'mid'); -// // does not use Symbola font -// var NonSymbolaSymbol = /** @class */ (function (_super) { -// __extends(NonSymbolaSymbol, _super); -// function NonSymbolaSymbol(ch, html, _unusedMathspeak) { -// return _super.call(this, ch, h('span', { class: 'dcg-mq-nonSymbola' }, [html || h.text(ch)])) || this; -// } -// return NonSymbolaSymbol; -// })(MQSymbol); -// LatexCmds['@'] = function () { -// return new NonSymbolaSymbol('@'); -// }; -// LatexCmds['&'] = function () { -// return new NonSymbolaSymbol('\\&', h.entityText('&'), 'and'); -// }; -// LatexCmds['%'] = /** @class */ (function (_super) { -// __extends(class_6, _super); -// function class_6() { -// return _super.call(this, '\\%', h.text('%'), 'percent') || this; -// } -// class_6.prototype.parser = function () { -// var optWhitespace = Parser.optWhitespace; -// var string = Parser.string; -// // Parse `\%\operatorname{of}` as special `percentof` node so that -// // it will be serialized properly and deleted as a unit. -// return optWhitespace -// .then( -// string('\\operatorname{of}').map(function () { -// return PercentOfBuilder(); -// }) -// ) -// .or(_super.prototype.parser.call(this)); -// }; -// return class_6; -// })(NonSymbolaSymbol); -// LatexCmds['\u2225'] = LatexCmds.parallel = bindVanillaSymbol('\\parallel ', '∥', 'parallel'); -// LatexCmds['\u2226'] = LatexCmds.nparallel = bindVanillaSymbol('\\nparallel ', '∦', 'not parallel'); -// LatexCmds['\u27c2'] = LatexCmds.perp = bindVanillaSymbol('\\perp ', '⟂', 'perpendicular'); -// //the following are all Greek to me, but this helped a lot: http://www.ams.org/STIX/ion/stixsig03.html -// //lowercase Greek letter variables -// LatexCmds.alpha = LatexCmds.beta = LatexCmds.gamma = LatexCmds.delta = LatexCmds.zeta = LatexCmds.eta = LatexCmds.theta = LatexCmds.iota = LatexCmds.kappa = LatexCmds.mu = LatexCmds.nu = LatexCmds.xi = LatexCmds.rho = LatexCmds.sigma = LatexCmds.tau = LatexCmds.chi = LatexCmds.psi = LatexCmds.omega = function ( -// latex -// ) { -// return new Variable('\\' + latex + ' ', h.entityText('&' + latex + ';')); -// }; -// //why can't anybody FUCKING agree on these -// LatexCmds.phi = bindVariable('\\phi ', 'ϕ', 'phi'); //W3C or Unicode? -// LatexCmds.phiv = LatexCmds.varphi = bindVariable('\\varphi ', 'φ', 'phi'); //Elsevier and 9573-13 //AMS and LaTeX -// LatexCmds.epsilon = bindVariable('\\epsilon ', 'ϵ', 'epsilon'); //W3C or Unicode? -// LatexCmds.epsiv = LatexCmds.varepsilon = bindVariable( -// //Elsevier and 9573-13 //AMS and LaTeX -// '\\varepsilon ', -// 'ε', -// 'epsilon' -// ); -// LatexCmds.piv = LatexCmds.varpi = bindVariable('\\varpi ', 'ϖ', 'piv'); //W3C/Unicode and Elsevier and 9573-13 //AMS and LaTeX -// LatexCmds.sigmaf = LatexCmds.sigmav = LatexCmds.varsigma = bindVariable('\\varsigma ', 'ς', 'sigma'); //W3C/Unicode //Elsevier //LaTeX -// LatexCmds.thetav = LatexCmds.vartheta = LatexCmds.thetasym = bindVariable('\\vartheta ', 'ϑ', 'theta'); //Elsevier and 9573-13 //AMS and LaTeX //W3C/Unicode -// LatexCmds.upsilon = LatexCmds.upsi = bindVariable( -// //AMS and LaTeX and W3C/Unicode //Elsevier and 9573-13 -// '\\upsilon ', -// 'υ', -// 'upsilon' -// ); -// //these aren't even mentioned in the HTML character entity references -// LatexCmds.gammad = LatexCmds.Gammad = LatexCmds.digamma = bindVariable('\\digamma ', 'ϝ', 'gamma'); //Elsevier //9573-13 -- WTF, right? I dunno if this was a typo in the reference (see above) //LaTeX -// LatexCmds.kappav = LatexCmds.varkappa = bindVariable( -// //Elsevier //AMS and LaTeX -// '\\varkappa ', -// 'ϰ', -// 'kappa' -// ); -// LatexCmds.rhov = LatexCmds.varrho = bindVariable('\\varrho ', 'ϱ', 'rho'); //Elsevier and 9573-13 //AMS and LaTeX -// //Greek constants, look best in non-italicized Times New Roman -// LatexCmds.pi = LatexCmds['\u03c0'] = function () { -// return new NonSymbolaSymbol('\\pi ', h.entityText('π'), 'pi'); -// }; -// LatexCmds.lambda = function () { -// return new NonSymbolaSymbol('\\lambda ', h.entityText('λ'), 'lambda'); -// }; -// //uppercase greek letters -// LatexCmds.Upsilon = LatexCmds.Upsi = LatexCmds.upsih = LatexCmds.Upsih = function () { //LaTeX //Elsevier and 9573-13 //W3C/Unicode "upsilon with hook" //'cos it makes sense to me -// return new MQSymbol( -// '\\Upsilon ', -// h('var', { style: 'font-family: serif' }, [h.entityText('ϒ')]), -// 'capital upsilon' -// ); -// }; //Symbola's 'upsilon with a hook' is a capital Y without hooks :( -// //other symbols with the same LaTeX command and HTML character entity reference -// LatexCmds.Gamma = LatexCmds.Delta = LatexCmds.Theta = LatexCmds.Lambda = LatexCmds.Xi = LatexCmds.Pi = LatexCmds.Sigma = LatexCmds.Phi = LatexCmds.Psi = LatexCmds.Omega = LatexCmds.forall = function ( -// latex -// ) { -// return new VanillaSymbol('\\' + latex + ' ', h.entityText('&' + latex + ';')); -// }; -// // symbols that aren't a single MathCommand, but are instead a whole -// // Fragment. Creates the Fragment from a LaTeX string -// var LatexFragment = /** @class */ (function (_super) { -// __extends(LatexFragment, _super); -// function LatexFragment(latex) { -// var _this_1 = _super.call(this) || this; -// _this_1.latexStr = latex; -// return _this_1; -// } -// LatexFragment.prototype.createLeftOf = function (cursor) { -// var block = latexMathParser.parse(this.latexStr); -// block.children().adopt(cursor.parent, cursor[L], cursor[R]); -// cursor[L] = block.getEnd(R); -// domFrag(block.html()).insertBefore(cursor.domFrag()); -// block.finalizeInsert(cursor.options, cursor); -// var blockEndsR = block.getEnd(R); -// var blockEndsRR = blockEndsR && blockEndsR[R]; -// if (blockEndsRR) blockEndsRR.siblingCreated(cursor.options, L); -// var blockEndsL = block.getEnd(L); -// var blockEndsLL = blockEndsL && blockEndsL[L]; -// if (blockEndsLL) blockEndsLL.siblingCreated(cursor.options, R); -// cursor.parent.bubble(function (node) { -// node.reflow(); -// return undefined; -// }); -// }; -// LatexFragment.prototype.mathspeak = function () { -// return latexMathParser.parse(this.latexStr).mathspeak(); -// }; -// LatexFragment.prototype.parser = function () { -// var frag = latexMathParser.parse(this.latexStr).children(); -// return Parser.succeed(frag); -// }; -// return LatexFragment; -// })(MathCommand); -// // for what seems to me like [stupid reasons][1], Unicode provides -// // subscripted and superscripted versions of all ten Arabic numerals, -// // as well as [so-called "vulgar fractions"][2]. -// // Nobody really cares about most of them, but some of them actually -// // predate Unicode, dating back to [ISO-8859-1][3], apparently also -// // known as "Latin-1", which among other things [Windows-1252][4] -// // largely coincides with, so Microsoft Word sometimes inserts them -// // and they get copy-pasted into MathQuill. -// // -// // (Irrelevant but funny story: though not a superset of Latin-1 aka -// // ISO-8859-1, Windows-1252 **is** a strict superset of the "closely -// // related but distinct"[3] "ISO 8859-1" -- see the lack of a dash -// // after "ISO"? Completely different character set, like elephants vs -// // elephant seals, or "Zombies" vs "Zombie Redneck Torture Family". -// // What kind of idiot would get them confused. -// // People in fact got them confused so much, it was so common to -// // mislabel Windows-1252 text as ISO-8859-1, that most modern web -// // browsers and email clients treat the MIME charset of ISO-8859-1 -// // as actually Windows-1252, behavior now standard in the HTML5 spec.) -// // -// // [1]: http://en.wikipedia.org/wiki/Unicode_subscripts_andsuper_scripts -// // [2]: http://en.wikipedia.org/wiki/Number_Forms -// // [3]: http://en.wikipedia.org/wiki/ISO/IEC_8859-1 -// // [4]: http://en.wikipedia.org/wiki/Windows-1252 -// LatexCmds['\u2070'] = function () { -// return new LatexFragment('^0'); -// }; -// LatexCmds['\u00b9'] = function () { -// return new LatexFragment('^1'); -// }; -// LatexCmds['\u00b2'] = function () { -// return new LatexFragment('^2'); -// }; -// LatexCmds['\u00b3'] = function () { -// return new LatexFragment('^3'); -// }; -// LatexCmds['\u2074'] = function () { -// return new LatexFragment('^4'); -// }; -// LatexCmds['\u2075'] = function () { -// return new LatexFragment('^5'); -// }; -// LatexCmds['\u2076'] = function () { -// return new LatexFragment('^6'); -// }; -// LatexCmds['\u2077'] = function () { -// return new LatexFragment('^7'); -// }; -// LatexCmds['\u2078'] = function () { -// return new LatexFragment('^8'); -// }; -// LatexCmds['\u2079'] = function () { -// return new LatexFragment('^9'); -// }; -// LatexCmds['\u00bc'] = function () { -// return new LatexFragment('\\frac14'); -// }; -// LatexCmds['\u00bd'] = function () { -// return new LatexFragment('\\frac12'); -// }; -// LatexCmds['\u00be'] = function () { -// return new LatexFragment('\\frac34'); -// }; -// // this is a hack to make pasting the \u221a symbol -// // actually insert a sqrt command. This isn't ideal, -// // but it's way better than what we have now. I think -// // before we invest any more time into this single character -// // we should consider how to make the pipe (|) automatically -// // insert absolute value. We also will want the percent (%) -// // to expand to '% of'. I've always just thought mathquill's -// // ability to handle pasted latex magical until I started actually -// // testing it. It's a lot more buggy that I previously thought. -// // -// // KNOWN ISSUES: -// // 1) pasting \u221a does not put focus in side the sqrt symbol -// // 2) pasting \u221a2 puts the 2 outside of the sqrt symbol. -// // -// // The first issue seems like we could invest more time into this to -// // fix it, but doesn't feel worth special casing. I think we'd want -// // to address it by addressing ALL pasting issues. -// // -// // The second issue seems like it might go away too if you fix paste to -// // act more like simply typing the characters out. I'd be scared to try -// // to make that change because I'm fairly confident I'd break something -// // around handling valid latex as latex rather than treating it as keystrokes. -// LatexCmds['\u221a'] = function () { -// return new LatexFragment('\\sqrt{}'); -// }; -// // Binary operator determination is used in several contexts for PlusMinus nodes and their descendants. -// // For instance, we set the item's class name based on this factor, and also assign different mathspeak values (plus vs positive, negative vs minus). -// function isBinaryOperator(node) { -// if (!node) return false; -// var nodeL = node[L]; -// if (nodeL) { -// // If the left sibling is a binary operator or a separator (comma, semicolon, colon, space) -// // or an open bracket (open parenthesis, open square bracket) -// // consider the operator to be unary -// if (nodeL instanceof BinaryOperator || /^(\\ )|[,;:\(\[]$/.test(nodeL.ctrlSeq)) { -// return false; -// } -// } else if (node.parent && node.parent.parent && node.parent.parent.isStyleBlock()) { -// //if we are in a style block at the leftmost edge, determine unary/binary based on -// //the style block -// //this allows style blocks to be transparent for unary/binary purposes -// return isBinaryOperator(node.parent.parent); -// } else { -// return false; -// } -// return true; -// } -// var PlusMinus = /** @class */ (function (_super) { -// __extends(class_7, _super); -// function class_7(ch, html, mathspeak) { -// return _super.call(this, ch, html, undefined, mathspeak, true) || this; -// } -// class_7.prototype.contactWeld = function (cursor, dir) { -// this.sharedSiblingMethod(cursor.options, dir); -// }; -// class_7.prototype.siblingCreated = function (opts, dir) { -// this.sharedSiblingMethod(opts, dir); -// }; -// class_7.prototype.siblingDeleted = function (opts, dir) { -// this.sharedSiblingMethod(opts, dir); -// }; -// class_7.prototype.sharedSiblingMethod = function (_opts, dir) { -// if (dir === R) return; // ignore if sibling only changed on the right -// this.domFrag().oneElement().className = isBinaryOperator(this) ? 'dcg-mq-binary-operator' : ''; -// return this; -// }; -// return class_7; -// })(BinaryOperator); -// LatexCmds['+'] = /** @class */ (function (_super) { -// __extends(class_8, _super); -// function class_8() { -// return _super.call(this, '+', h.text('+')) || this; -// } -// class_8.prototype.mathspeak = function () { -// return isBinaryOperator(this) ? 'plus' : 'positive'; -// }; -// return class_8; -// })(PlusMinus); -// //yes, these are different dashes, en-dash, em-dash, unicode minus, actual dash -// var MinusNode = /** @class */ (function (_super) { -// __extends(MinusNode, _super); -// function MinusNode() { -// return _super.call(this, '-', h.entityText('−')) || this; -// } -// MinusNode.prototype.mathspeak = function () { -// return isBinaryOperator(this) ? 'minus' : 'negative'; -// }; -// return MinusNode; -// })(PlusMinus); -// LatexCmds['\u2212'] = LatexCmds['\u2014'] = LatexCmds['\u2013'] = LatexCmds['-'] = MinusNode; -// LatexCmds['\u00b1'] = LatexCmds.pm = LatexCmds.plusmn = LatexCmds.plusminus = function () { -// return new PlusMinus('\\pm ', h.entityText('±'), 'plus-or-minus'); -// }; -// LatexCmds.mp = LatexCmds.mnplus = LatexCmds.minusplus = function () { -// return new PlusMinus('\\mp ', h.entityText('∓'), 'minus-or-plus'); -// }; -// CharCmds['*'] = LatexCmds.sdot = LatexCmds.cdot = bindBinaryOperator('\\cdot ', '·', '*', 'times'); //semantically should be ⋅, but · looks better -// var To = /** @class */ (function (_super) { -// __extends(To, _super); -// function To() { -// return _super.call(this, '\\to ', h.entityText('→'), 'to') || this; -// } -// To.prototype.deleteTowards = function (dir, cursor) { -// if (dir === L) { -// var l = cursor[L]; -// new Fragment(l, this).remove(); -// cursor[L] = l[L]; -// new MinusNode().createLeftOf(cursor); -// cursor[L].bubble(function (node) { -// node.reflow(); -// return undefined; -// }); -// return; -// } -// _super.prototype.deleteTowards.call(this, dir, cursor); -// }; -// return To; -// })(BinaryOperator); -// LatexCmds['\u2192'] = LatexCmds.to = To; -// var Inequality = /** @class */ (function (_super) { -// __extends(Inequality, _super); -// function Inequality(data, strict) { -// var _this_1 = this; -// var strictness = strict ? 'Strict' : ''; -// _this_1 = -// _super.call( -// this, -// data['ctrlSeq'.concat(strictness)], -// h.entityText(data['htmlEntity'.concat(strictness)]), -// data['text'.concat(strictness)], -// data['mathspeak'.concat(strictness)] -// ) || this; -// _this_1.data = data; -// _this_1.strict = strict; -// return _this_1; -// } -// Inequality.prototype.swap = function (strict) { -// this.strict = strict; -// var strictness = strict ? 'Strict' : ''; -// this.ctrlSeq = this.data['ctrlSeq'.concat(strictness)]; -// this.domFrag() -// .children() -// .replaceWith(domFrag(h.entityText(this.data['htmlEntity'.concat(strictness)]))); -// this.textTemplate = [this.data['text'.concat(strictness)]]; -// this.mathspeakName = this.data['mathspeak'.concat(strictness)]; -// }; -// Inequality.prototype.deleteTowards = function (dir, cursor) { -// if (dir === L && !this.strict) { -// this.swap(true); -// this.bubble(function (node) { -// node.reflow(); -// return undefined; -// }); -// return; -// } -// _super.prototype.deleteTowards.call(this, dir, cursor); -// }; -// return Inequality; -// })(BinaryOperator); -// var less = { -// ctrlSeq: '\\le ', -// htmlEntity: '≤', -// text: '\u2264', -// mathspeak: 'less than or equal to', -// ctrlSeqStrict: '<', -// htmlEntityStrict: '<', -// textStrict: '<', -// mathspeakStrict: 'less than', -// }; -// var greater = { -// ctrlSeq: '\\ge ', -// htmlEntity: '≥', -// text: '\u2265', -// mathspeak: 'greater than or equal to', -// ctrlSeqStrict: '>', -// htmlEntityStrict: '>', -// textStrict: '>', -// mathspeakStrict: 'greater than', -// }; -// var Greater = /** @class */ (function (_super) { -// __extends(Greater, _super); -// function Greater() { -// return _super.call(this, greater, true) || this; -// } -// Greater.prototype.createLeftOf = function (cursor) { -// var cursorL = cursor[L]; -// if (cursorL instanceof BinaryOperator && cursorL.ctrlSeq === '-') { -// var l = cursorL; -// cursor[L] = l[L]; -// l.remove(); -// new To().createLeftOf(cursor); -// cursor[L].bubble(function (node) { -// node.reflow(); -// return undefined; -// }); -// return; -// } -// _super.prototype.createLeftOf.call(this, cursor); -// }; -// return Greater; -// })(Inequality); -// LatexCmds['<'] = LatexCmds.lt = function () { -// return new Inequality(less, true); -// }; -// LatexCmds['>'] = LatexCmds.gt = Greater; -// LatexCmds['\u2264'] = LatexCmds.le = LatexCmds.leq = function () { -// return new Inequality(less, false); -// }; -// LatexCmds['\u2265'] = LatexCmds.ge = LatexCmds.geq = function () { -// return new Inequality(greater, false); -// }; -// LatexCmds.infty = LatexCmds.infin = LatexCmds.infinity = bindVanillaSymbol('\\infty ', '∞', 'infinity'); -// LatexCmds['\u2260'] = LatexCmds.ne = LatexCmds.neq = bindBinaryOperator('\\ne ', '≠', 'not equal'); -// var Equality = /** @class */ (function (_super) { -// __extends(Equality, _super); -// function Equality() { -// return _super.call(this, '=', h.text('='), '=', 'equals') || this; -// } -// Equality.prototype.createLeftOf = function (cursor) { -// var cursorL = cursor[L]; -// if (cursorL instanceof Inequality && cursorL.strict) { -// cursorL.swap(false); -// cursorL.bubble(function (node) { -// node.reflow(); -// return undefined; -// }); -// return; -// } -// _super.prototype.createLeftOf.call(this, cursor); -// }; -// return Equality; -// })(BinaryOperator); -// LatexCmds['='] = Equality; -// LatexCmds['\u00d7'] = LatexCmds.times = bindBinaryOperator('\\times ', '×', '[x]', 'times'); -// LatexCmds['\u00f7'] = LatexCmds.div = LatexCmds.divide = LatexCmds.divides = bindBinaryOperator( -// '\\div ', -// '÷', -// '[/]', -// 'over' -// ); -// var Sim = /** @class */ (function (_super) { -// __extends(Sim, _super); -// function Sim() { -// return _super.call(this, '\\sim ', h.text('~'), '~', 'tilde') || this; -// } -// Sim.prototype.createLeftOf = function (cursor) { -// if (cursor[L] instanceof Sim) { -// var l = cursor[L]; -// cursor[L] = l[L]; -// l.remove(); -// new Approx().createLeftOf(cursor); -// cursor[L].bubble(function (node) { -// node.reflow(); -// return undefined; -// }); -// return; -// } -// _super.prototype.createLeftOf.call(this, cursor); -// }; -// return Sim; -// })(BinaryOperator); -// var Approx = /** @class */ (function (_super) { -// __extends(Approx, _super); -// function Approx() { -// return ( -// _super.call(this, '\\approx ', h.entityText('≈'), '\u2248', 'approximately equal') || this -// ); -// } -// Approx.prototype.deleteTowards = function (dir, cursor) { -// if (dir === L) { -// var l = cursor[L]; -// new Fragment(l, this).remove(); -// cursor[L] = l[L]; -// new Sim().createLeftOf(cursor); -// cursor[L].bubble(function (node) { -// node.reflow(); -// return undefined; -// }); -// return; -// } -// _super.prototype.deleteTowards.call(this, dir, cursor); -// }; -// return Approx; -// })(BinaryOperator); -// LatexCmds.tildeNbsp = bindVanillaSymbol('~', U_NO_BREAK_SPACE, ' '); -// LatexCmds.sim = Sim; -// LatexCmds['\u2248'] = LatexCmds.approx = Approx; -// // When interpreting raw LaTeX, we can either evaluate the tilde as its standard nonbreaking space -// // or transform it to the \sim operator depending on whether the "interpretTildeAsSim" configuration option is set. -// // Tilde symbols input from a keyboard will always be transformed to \sim. -// CharCmds['~'] = LatexCmds.sim; -// LatexCmds['~'] = LatexCmds.tildeNbsp; -// baseOptionProcessors.interpretTildeAsSim = function (val) { -// var interpretAsSim = !!val; -// if (interpretAsSim) { -// LatexCmds['~'] = LatexCmds.sim; -// } else { -// LatexCmds['~'] = LatexCmds.tildeNbsp; -// } -// return interpretAsSim; -// }; -// /*************************** -// * Commands and Operators. -// **************************/ -// var SVG_SYMBOLS = { -// sqrt: { -// width: '', -// html: function () { -// return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 32 54' }, [ -// h('path', { -// d: 'M0 33 L7 27 L12.5 47 L13 47 L30 0 L32 0 L13 54 L11 54 L4.5 31 L0 33', -// }), -// ]); -// }, -// }, -// '|': { -// width: '.4em', -// html: function () { -// return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ -// h('path', { d: 'M4.4 0 L4.4 54 L5.6 54 L5.6 0' }), -// ]); -// }, -// }, -// '[': { -// width: '.55em', -// html: function () { -// return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 11 24' }, [ -// h('path', { d: 'M8 0 L3 0 L3 24 L8 24 L8 23 L4 23 L4 1 L8 1' }), -// ]); -// }, -// }, -// ']': { -// width: '.55em', -// html: function () { -// return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 11 24' }, [ -// h('path', { d: 'M3 0 L8 0 L8 24 L3 24 L3 23 L7 23 L7 1 L3 1' }), -// ]); -// }, -// }, -// '(': { -// width: '.55em', -// html: function () { -// return h('svg', { preserveAspectRatio: 'none', viewBox: '3 0 106 186' }, [ -// h('path', { -// d: 'M85 0 A61 101 0 0 0 85 186 L75 186 A75 101 0 0 1 75 0', -// }), -// ]); -// }, -// }, -// ')': { -// width: '.55em', -// html: function () { -// return h('svg', { preserveAspectRatio: 'none', viewBox: '3 0 106 186' }, [ -// h('path', { -// d: 'M24 0 A61 101 0 0 1 24 186 L34 186 A75 101 0 0 0 34 0', -// }), -// ]); -// }, -// }, -// '{': { -// width: '.7em', -// html: function () { -// return h('svg', { preserveAspectRatio: 'none', viewBox: '10 0 210 350' }, [ -// h('path', { -// d: -// 'M170 0 L170 6 A47 52 0 0 0 123 60 L123 127 A35 48 0 0 1 88 175 A35 48 0 0 1 123 223 L123 290 A47 52 0 0 0 170 344 L170 350 L160 350 A58 49 0 0 1 102 301 L103 220 A45 40 0 0 0 58 180 L58 170 A45 40 0 0 0 103 130 L103 49 A58 49 0 0 1 161 0', -// }), -// ]); -// }, -// }, -// '}': { -// width: '.7em', -// html: function () { -// return h('svg', { preserveAspectRatio: 'none', viewBox: '10 0 210 350' }, [ -// h('path', { -// d: -// 'M60 0 L60 6 A47 52 0 0 1 107 60 L107 127 A35 48 0 0 0 142 175 A35 48 0 0 0 107 223 L107 290 A47 52 0 0 1 60 344 L60 350 L70 350 A58 49 0 0 0 128 301 L127 220 A45 40 0 0 1 172 180 L172 170 A45 40 0 0 1 127 130 L127 49 A58 49 0 0 0 70 0', -// }), -// ]); -// }, -// }, -// '∥': { -// width: '.7em', -// html: function () { -// return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ -// h('path', { d: 'M3.2 0 L3.2 54 L4 54 L4 0 M6.8 0 L6.8 54 L6 54 L6 0' }), -// ]); -// }, -// }, -// '⟨': { -// width: '.55em', -// html: function () { -// return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ -// h('path', { d: 'M6.8 0 L3.2 27 L6.8 54 L7.8 54 L4.2 27 L7.8 0' }), -// ]); -// }, -// }, -// '⟩': { -// width: '.55em', -// html: function () { -// return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ -// h('path', { d: 'M3.2 0 L6.8 27 L3.2 54 L2.2 54 L5.8 27 L2.2 0' }), -// ]); -// }, -// }, -// }; -// var Style = /** @class */ (function (_super) { -// __extends(Style, _super); -// function Style(ctrlSeq, tagName, attrs, ariaLabel, opts) { -// var _this_1 = -// _super.call( -// this, -// ctrlSeq, -// new DOMView(1, function (blocks) { -// return h.block(tagName, attrs, blocks[0]); -// }) -// ) || this; -// _this_1.ariaLabel = ariaLabel || ctrlSeq.replace(/^\\/, ''); -// _this_1.mathspeakTemplate = ['Start' + _this_1.ariaLabel + ',', 'End' + _this_1.ariaLabel]; -// // In most cases, mathspeak should announce the start and end of style blocks. -// // There is one exception currently (mathrm). -// _this_1.shouldNotSpeakDelimiters = opts && opts.shouldNotSpeakDelimiters; -// return _this_1; -// } -// Style.prototype.mathspeak = function (opts) { -// if (!this.shouldNotSpeakDelimiters || (opts && opts.ignoreShorthand)) { -// return _super.prototype.mathspeak.call(this); -// } -// return this.foldChildren('', function (speech, block) { -// return speech + ' ' + block.mathspeak(opts); -// }).trim(); -// }; -// return Style; -// })(MathCommand); -// //fonts -// LatexCmds.mathrm = /** @class */ (function (_super) { -// __extends(mathrm, _super); -// function mathrm() { -// return ( -// _super.call(this, '\\mathrm', 'span', { class: 'dcg-mq-roman dcg-mq-font' }, 'Roman Font', { -// shouldNotSpeakDelimiters: true, -// }) || this -// ); -// } -// mathrm.prototype.isTextBlock = function () { -// return true; -// }; -// return mathrm; -// })(Style); -// LatexCmds.mathit = function () { -// return new Style('\\mathit', 'i', { class: 'dcg-mq-font' }, 'Italic Font'); -// }; -// LatexCmds.mathbf = function () { -// return new Style('\\mathbf', 'b', { class: 'dcg-mq-font' }, 'Bold Font'); -// }; -// LatexCmds.mathsf = function () { -// return new Style('\\mathsf', 'span', { class: 'dcg-mq-sans-serif dcg-mq-font' }, 'Serif Font'); -// }; -// LatexCmds.mathtt = function () { -// return new Style('\\mathtt', 'span', { class: 'dcg-mq-monospace dcg-mq-font' }, 'Math Text'); -// }; -// //text-decoration -// LatexCmds.underline = function () { -// return new Style('\\underline', 'span', { class: 'dcg-mq-non-leaf dcg-mq-underline' }, 'Underline'); -// }; -// LatexCmds.overline = LatexCmds.bar = function () { -// return new Style('\\overline', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overline' }, 'Overline'); -// }; -// LatexCmds.overrightarrow = function () { -// return new Style( -// '\\overrightarrow', -// 'span', -// { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-right' }, -// 'Over Right Arrow' -// ); -// }; -// LatexCmds.overleftarrow = function () { -// return new Style( -// '\\overleftarrow', -// 'span', -// { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-left' }, -// 'Over Left Arrow' -// ); -// }; -// LatexCmds.overleftrightarrow = function () { -// return new Style( -// '\\overleftrightarrow ', -// 'span', -// { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-leftright' }, -// 'Over Left and Right Arrow' -// ); -// }; -// LatexCmds.overarc = function () { -// return new Style('\\overarc', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overarc' }, 'Over Arc'); -// }; -// LatexCmds.dot = function () { -// return new MathCommand( -// '\\dot', -// new DOMView(1, function (blocks) { -// return h('span', { class: 'dcg-mq-non-leaf' }, [ -// h('span', { class: 'dcg-mq-dot-recurring-inner' }, [ -// h('span', { class: 'dcg-mq-dot-recurring' }, [h.text(U_DOT_ABOVE)]), -// h.block('span', { class: 'dcg-mq-empty-box' }, blocks[0]), -// ]), -// ]); -// }) -// ); -// }; -// // `\textcolor{color}{math}` will apply a color to the given math content, where -// // `color` is any valid CSS Color Value (see [SitePoint docs][] (recommended), -// // [Mozilla docs][], or [W3C spec][]). -// // -// // [SitePoint docs]: http://reference.sitepoint.com/css/colorvalues -// // [Mozilla docs]: https://developer.mozilla.org/en-US/docs/CSS/color_value#Values -// // [W3C spec]: http://dev.w3.org/csswg/css3-color/#colorunits -// LatexCmds.textcolor = /** @class */ (function (_super) { -// __extends(class_9, _super); -// function class_9() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// class_9.prototype.setColor = function (color) { -// this.color = color; -// this.domView = new DOMView(1, function (blocks) { -// return h.block('span', { class: 'dcg-mq-textcolor', style: 'color:' + color }, blocks[0]); -// }); -// this.ariaLabel = color.replace(/^\\/, ''); -// this.mathspeakTemplate = ['Start ' + this.ariaLabel + ',', 'End ' + this.ariaLabel]; -// }; -// class_9.prototype.latexRecursive = function (ctx) { -// this.checkCursorContextOpen(ctx); -// var blocks0 = this.blocks[0]; -// ctx.latex += '\\textcolor{' + this.color + '}{'; -// blocks0.latexRecursive(ctx); -// ctx.latex += '}'; -// this.checkCursorContextClose(ctx); -// }; -// class_9.prototype.parser = function () { -// var _this_1 = this; -// var optWhitespace = Parser.optWhitespace; -// var string = Parser.string; -// var regex = Parser.regex; -// return optWhitespace -// .then(string('{')) -// .then(regex(/^[#\w\s.,()%-]*/)) -// .skip(string('}')) -// .then(function (color) { -// _this_1.setColor(color); -// return _super.prototype.parser.call(_this_1); -// }); -// }; -// class_9.prototype.isStyleBlock = function () { -// return true; -// }; -// return class_9; -// })(MathCommand); -// // Very similar to the \textcolor command, but will add the given CSS class. -// // Usage: \class{classname}{math} -// // Note regex that whitelists valid CSS classname characters: -// // https://github.com/mathquill/mathquill/pull/191#discussion_r4327442 -// var Class = (LatexCmds['class'] = /** @class */ (function (_super) { -// __extends(class_10, _super); -// function class_10() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// class_10.prototype.parser = function () { -// var _this_1 = this; -// var string = Parser.string, -// regex = Parser.regex; -// return Parser.optWhitespace -// .then(string('{')) -// .then(regex(/^[-\w\s\\\xA0-\xFF]*/)) -// .skip(string('}')) -// .then(function (cls) { -// _this_1.cls = cls || ''; -// _this_1.domView = new DOMView(1, function (blocks) { -// return h.block('span', { class: 'dcg-mq-class '.concat(cls) }, blocks[0]); -// }); -// _this_1.ariaLabel = cls + ' class'; -// _this_1.mathspeakTemplate = ['Start ' + _this_1.ariaLabel + ',', 'End ' + _this_1.ariaLabel]; -// return _super.prototype.parser.call(_this_1); -// }); -// }; -// class_10.prototype.latexRecursive = function (ctx) { -// this.checkCursorContextOpen(ctx); -// var blocks0 = this.blocks[0]; -// ctx.latex += '\\class{' + this.cls + '}{'; -// blocks0.latexRecursive(ctx); -// ctx.latex += '}'; -// this.checkCursorContextClose(ctx); -// }; -// class_10.prototype.isStyleBlock = function () { -// return true; -// }; -// return class_10; -// })(MathCommand)); -// // This test is used to determine whether an item may be treated as a whole number -// // for shortening the verbalized (mathspeak) forms of some fractions and superscripts. -// var intRgx = /^[\+\-]?[\d]+$/; -// // Traverses the top level of the passed block's children and returns the concatenation of their ctrlSeq properties. -// // Used in shortened mathspeak computations as a block's .text() method can be potentially expensive. -// // -// function getCtrlSeqsFromBlock(block) { -// if (!block) return ''; -// var chars = ''; -// block.eachChild(function (child) { -// if (child.ctrlSeq !== undefined) chars += child.ctrlSeq; -// }); -// return chars; -// } -// Options.prototype.charsThatBreakOutOfSupSub = ''; -// var SupSub = /** @class */ (function (_super) { -// __extends(SupSub, _super); -// function SupSub() { -// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; -// _this_1.ctrlSeq = '_{...}^{...}'; -// return _this_1; -// } -// SupSub.prototype.setEnds = function (ends) { -// pray('SupSub ends must be MathBlocks', ends[L] instanceof MathBlock && ends[R] instanceof MathBlock); -// this.ends = ends; -// }; -// SupSub.prototype.getEnd = function (dir) { -// return this.ends[dir]; -// }; -// SupSub.prototype.createLeftOf = function (cursor) { -// if (!this.replacedFragment && !cursor[L] && cursor.options.supSubsRequireOperand) return; -// return _super.prototype.createLeftOf.call(this, cursor); -// }; -// SupSub.prototype.contactWeld = function (cursor) { -// // Look on either side for a SupSub, if one is found compare my -// // .sub, .sup with its .sub, .sup. If I have one that it doesn't, -// // then call .addBlock() on it with my block; if I have one that -// // it also has, then insert my block's children into its block, -// // unless my block has none, in which case insert the cursor into -// // its block (and not mine, I'm about to remove myself) in the case -// // I was just typed. -// // TODO: simplify -// // equiv. to [L, R].forEach(function(dir) { ... }); -// for (var dir = L; dir; dir = dir === L ? R : false) { -// var thisDir = this[dir]; -// var pt = void 0; -// if (thisDir instanceof SupSub) { -// // equiv. to 'sub sup'.split(' ').forEach(function(supsub) { ... }); -// for (var supsub = 'sub'; supsub; supsub = supsub === 'sub' ? 'sup' : false) { -// var src = this[supsub], -// dest = thisDir[supsub]; -// if (!src) continue; -// if (!dest) thisDir.addBlock(src.disown()); -// else if (!src.isEmpty()) { -// // ins src children at -dir end of dest -// src.domFrag().children().insAtDirEnd(-dir, dest.domFrag().oneElement()); -// var children = src.children().disown(); -// pt = new Point(dest, children.getEnd(R), dest.getEnd(L)); -// if (dir === L) children.adopt(dest, dest.getEnd(R), 0); -// else children.adopt(dest, 0, dest.getEnd(L)); -// } else { -// pt = new Point(dest, 0, dest.getEnd(L)); -// } -// this.placeCursor = (function (dest, src) { -// // TODO: don't monkey-patch -// return function (cursor) { -// cursor.insAtDirEnd(-dir, dest || src); -// }; -// })(dest, src); -// } -// this.remove(); -// if (cursor && cursor[L] === this) { -// if (dir === R && pt) { -// if (pt[L]) { -// cursor.insRightOf(pt[L]); -// } else { -// cursor.insAtLeftEnd(pt.parent); -// } -// } else cursor.insRightOf(thisDir); -// } -// break; -// } -// } -// }; -// SupSub.prototype.finalizeTree = function () { -// var endsL = this.getEnd(L); -// endsL.write = function (cursor, ch) { -// if (cursor.options.autoSubscriptNumerals && this === this.parent.sub) { -// if (ch === '_') return; -// var cmd = this.chToCmd(ch, cursor.options); -// if (cmd instanceof MQSymbol) cursor.deleteSelection(); -// else cursor.clearSelection().insRightOf(this.parent); -// cmd.createLeftOf(cursor.show()); -// cursor.controller.aria.queue('Baseline').alert(cmd.mathspeak({ createdLeftOf: cursor })); -// return; -// } -// if ( -// cursor[L] && -// !cursor[R] && -// !cursor.selection && -// cursor.options.charsThatBreakOutOfSupSub.indexOf(ch) > -1 -// ) { -// cursor.insRightOf(this.parent); -// cursor.controller.aria.queue('Baseline'); -// } -// MathBlock.prototype.write.call(this, cursor, ch); -// }; -// }; -// SupSub.prototype.moveTowards = function (dir, cursor, updown) { -// if (cursor.options.autoSubscriptNumerals && !this.sup) { -// cursor.insDirOf(dir, this); -// } else _super.prototype.moveTowards.call(this, dir, cursor, updown); -// }; -// SupSub.prototype.deleteTowards = function (dir, cursor) { -// if (cursor.options.autoSubscriptNumerals && this.sub) { -// var cmd = this.sub.getEnd(-dir); -// if (cmd instanceof MQSymbol) cmd.remove(); -// else if (cmd) cmd.deleteTowards(dir, cursor.insAtDirEnd(-dir, this.sub)); -// // TODO: factor out a .removeBlock() or something -// if (this.sub.isEmpty()) { -// this.sub.deleteOutOf(L, cursor.insAtLeftEnd(this.sub)); -// if (this.sup) cursor.insDirOf(-dir, this); -// // Note `-dir` because in e.g. x_1^2| want backspacing (leftward) -// // to delete the 1 but to end up rightward of x^2; with non-negated -// // `dir` (try it), the cursor appears to have gone "through" the ^2. -// } -// } else _super.prototype.deleteTowards.call(this, dir, cursor); -// }; -// SupSub.prototype.latexRecursive = function (ctx) { -// this.checkCursorContextOpen(ctx); -// if (this.sub) { -// ctx.latex += '_{'; -// var beforeLength = ctx.latex.length; -// this.sub.latexRecursive(ctx); -// var afterLength = ctx.latex.length; -// if (beforeLength === afterLength) { -// // nothing was written. so we write a space -// ctx.latex += ' '; -// } -// ctx.latex += '}'; -// } -// if (this.sup) { -// ctx.latex += '^{'; -// var beforeLength = ctx.latex.length; -// this.sup.latexRecursive(ctx); -// var afterLength = ctx.latex.length; -// if (beforeLength === afterLength) { -// // nothing was written. so we write a space -// ctx.latex += ' '; -// } -// ctx.latex += '}'; -// } -// this.checkCursorContextClose(ctx); -// }; -// SupSub.prototype.text = function () { -// function text(prefix, block) { -// var l = (block && block.text()) || ''; -// return block ? prefix + (l.length === 1 ? l : '(' + (l || ' ') + ')') : ''; -// } -// return text('_', this.sub) + text('^', this.sup); -// }; -// SupSub.prototype.addBlock = function (block) { -// if (this.supsub === 'sub') { -// this.sup = this.upInto = this.sub.upOutOf = block; -// block.adopt(this, this.sub, 0).downOutOf = this.sub; -// block.setDOM( -// domFrag(h('span', { class: 'dcg-mq-sup' })) -// .append(block.domFrag().children()) -// .prependTo(this.domFrag().oneElement()) -// .oneElement() -// ); -// NodeBase.linkElementByBlockNode(block.domFrag().oneElement(), block); -// } else { -// this.sub = this.downInto = this.sup.downOutOf = block; -// block.adopt(this, 0, this.sup).upOutOf = this.sup; -// this.domFrag().removeClass('dcg-mq-sup-only'); -// block.setDOM( -// domFrag(h('span', { class: 'dcg-mq-sub' })) -// .append(block.domFrag().children()) -// .appendTo(this.domFrag().oneElement()) -// .oneElement() -// ); -// NodeBase.linkElementByBlockNode(block.domFrag().oneElement(), block); -// this.domFrag().append( -// domFrag(h('span', { style: 'display:inline-block;width:0' }, [h.text(U_ZERO_WIDTH_SPACE)])) -// ); -// } -// // like 'sub sup'.split(' ').forEach(function(supsub) { ... }); -// for (var i = 0; i < 2; i += 1) -// (function (cmd, supsub, oppositeSupsub, updown) { -// var cmdSubSub = cmd[supsub]; -// cmdSubSub.deleteOutOf = function (dir, cursor) { -// cursor.insDirOf(this[dir] ? -dir : dir, this.parent); -// if (!this.isEmpty()) { -// var end = this.getEnd(dir); -// this.children() -// .disown() -// .withDirAdopt(dir, cursor.parent, cursor[dir], cursor[-dir]) -// .domFrag() -// .insDirOf(-dir, cursor.domFrag()); -// cursor[-dir] = end; -// } -// cmd.supsub = oppositeSupsub; -// delete cmd[supsub]; -// delete cmd[''.concat(updown, 'Into')]; -// var cmdOppositeSupsub = cmd[oppositeSupsub]; -// cmdOppositeSupsub[''.concat(updown, 'OutOf')] = insLeftOfMeUnlessAtEnd; -// delete cmdOppositeSupsub.deleteOutOf; // TODO - refactor so this method can be optional -// if (supsub === 'sub') { -// cmd.domFrag().addClass('dcg-mq-sup-only').children().last().remove(); -// } -// this.remove(); -// }; -// })(this, 'sub sup'.split(' ')[i], 'sup sub'.split(' ')[i], 'down up'.split(' ')[i]); -// }; -// return SupSub; -// })(MathCommand); -// function insLeftOfMeUnlessAtEnd(cursor) { -// // cursor.insLeftOf(cmd), unless cursor at the end of block, and every -// // ancestor cmd is at the end of every ancestor block -// var cmd = this.parent; -// var ancestorCmd = cursor; -// do { -// if (ancestorCmd[R]) return cursor.insLeftOf(cmd); -// ancestorCmd = ancestorCmd.parent.parent; -// } while (ancestorCmd !== cmd); -// cursor.insRightOf(cmd); -// return undefined; -// } -// var SubscriptCommand = /** @class */ (function (_super) { -// __extends(SubscriptCommand, _super); -// function SubscriptCommand() { -// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; -// _this_1.supsub = 'sub'; -// _this_1.domView = new DOMView(1, function (blocks) { -// return h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf' }, [ -// h.block('span', { class: 'dcg-mq-sub' }, blocks[0]), -// h('span', { style: 'display:inline-block;width:0' }, [h.text(U_ZERO_WIDTH_SPACE)]), -// ]); -// }); -// _this_1.textTemplate = ['_']; -// _this_1.mathspeakTemplate = ['Subscript,', ', Baseline']; -// _this_1.ariaLabel = 'subscript'; -// return _this_1; -// } -// SubscriptCommand.prototype.finalizeTree = function () { -// this.downInto = this.sub = this.getEnd(L); -// this.sub.upOutOf = insLeftOfMeUnlessAtEnd; -// _super.prototype.finalizeTree.call(this); -// }; -// return SubscriptCommand; -// })(SupSub); -// LatexCmds.subscript = LatexCmds._ = SubscriptCommand; -// LatexCmds.superscript = LatexCmds.supscript = LatexCmds['^'] = /** @class */ (function (_super) { -// __extends(SuperscriptCommand, _super); -// function SuperscriptCommand() { -// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; -// _this_1.supsub = 'sup'; -// _this_1.domView = new DOMView(1, function (blocks) { -// return h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf dcg-mq-sup-only' }, [ -// h.block('span', { class: 'dcg-mq-sup' }, blocks[0]), -// ]); -// }); -// _this_1.textTemplate = ['^(', ')']; -// _this_1.ariaLabel = 'superscript'; -// _this_1.mathspeakTemplate = ['Superscript,', ', Baseline']; -// return _this_1; -// } -// SuperscriptCommand.prototype.mathspeak = function (opts) { -// // Simplify basic exponent speech for common whole numbers. -// var child = this.upInto; -// if (child !== undefined) { -// // Calculate this item's inner text to determine whether to shorten the returned speech. -// // Do not calculate its inner mathspeak now until we know that the speech is to be truncated. -// // Since the mathspeak computation is recursive, we want to call it only once in this function to avoid performance bottlenecks. -// var innerText = getCtrlSeqsFromBlock(child); -// // If the superscript is a whole number, shorten the speech that is returned. -// if ((!opts || !opts.ignoreShorthand) && intRgx.test(innerText)) { -// // Simple cases -// if (innerText === '0') { -// return 'to the 0 power'; -// } else if (innerText === '2') { -// return 'squared'; -// } else if (innerText === '3') { -// return 'cubed'; -// } -// // More complex cases. -// var suffix = ''; -// // Limit suffix addition to exponents < 1000. -// if (/^[+-]?\d{1,3}$/.test(innerText)) { -// if (/(11|12|13|4|5|6|7|8|9|0)$/.test(innerText)) { -// suffix = 'th'; -// } else if (/1$/.test(innerText)) { -// suffix = 'st'; -// } else if (/2$/.test(innerText)) { -// suffix = 'nd'; -// } else if (/3$/.test(innerText)) { -// suffix = 'rd'; -// } -// } -// var innerMathspeak = typeof child === 'object' ? child.mathspeak() : innerText; -// return 'to the ' + innerMathspeak + suffix + ' power'; -// } -// } -// return _super.prototype.mathspeak.call(this); -// }; -// SuperscriptCommand.prototype.finalizeTree = function () { -// this.upInto = this.sup = this.getEnd(R); -// this.sup.downOutOf = insLeftOfMeUnlessAtEnd; -// _super.prototype.finalizeTree.call(this); -// }; -// return SuperscriptCommand; -// })(SupSub); -// var SummationNotation = /** @class */ (function (_super) { -// __extends(SummationNotation, _super); -// function SummationNotation(ch, symbol, ariaLabel) { -// var _this_1 = _super.call(this) || this; -// _this_1.ariaLabel = ariaLabel || ch.replace(/^\\/, ''); -// var domView = new DOMView(2, function (blocks) { -// return h('span', { class: 'dcg-mq-large-operator dcg-mq-non-leaf' }, [ -// h('span', { class: 'dcg-mq-to' }, [h.block('span', {}, blocks[1])]), -// h('big', {}, [h.text(symbol)]), -// h('span', { class: 'dcg-mq-from' }, [h.block('span', {}, blocks[0])]), -// ]); -// }); -// MQSymbol.prototype.setCtrlSeqHtmlTextAndMathspeak.call(_this_1, ch, domView); -// return _this_1; -// } -// SummationNotation.prototype.createLeftOf = function (cursor) { -// _super.prototype.createLeftOf.call(this, cursor); -// if (cursor.options.sumStartsWithNEquals) { -// new Letter('n').createLeftOf(cursor); -// new Equality().createLeftOf(cursor); -// } -// }; -// SummationNotation.prototype.latexRecursive = function (ctx) { -// this.checkCursorContextOpen(ctx); -// ctx.latex += this.ctrlSeq + '_{'; -// var beforeLength = ctx.latex.length; -// this.getEnd(L).latexRecursive(ctx); -// var afterLength = ctx.latex.length; -// if (afterLength === beforeLength) { -// // nothing was written so we write a space -// ctx.latex += ' '; -// } -// ctx.latex += '}^{'; -// beforeLength = ctx.latex.length; -// this.getEnd(R).latexRecursive(ctx); -// afterLength = ctx.latex.length; -// if (beforeLength === afterLength) { -// // nothing was written so we write a space -// ctx.latex += ' '; -// } -// ctx.latex += '}'; -// this.checkCursorContextClose(ctx); -// }; -// SummationNotation.prototype.mathspeak = function () { -// return ( -// 'Start ' + -// this.ariaLabel + -// ' from ' + -// this.getEnd(L).mathspeak() + -// ' to ' + -// this.getEnd(R).mathspeak() + -// ', end ' + -// this.ariaLabel + -// ', ' -// ); -// }; -// SummationNotation.prototype.parser = function () { -// var string = Parser.string; -// var optWhitespace = Parser.optWhitespace; -// var succeed = Parser.succeed; -// var block = latexMathParser.block; -// var self = this; -// var blocks = (self.blocks = [new MathBlock(), new MathBlock()]); -// for (var i = 0; i < blocks.length; i += 1) { -// blocks[i].adopt(self, self.getEnd(R), 0); -// } -// return optWhitespace -// .then(string('_').or(string('^'))) -// .then(function (supOrSub) { -// var child = blocks[supOrSub === '_' ? 0 : 1]; -// return block.then(function (block) { -// block.children().adopt(child, child.getEnd(R), 0); -// return succeed(self); -// }); -// }) -// .many() -// .result(self); -// }; -// SummationNotation.prototype.finalizeTree = function () { -// var endsL = this.getEnd(L); -// var endsR = this.getEnd(R); -// endsL.ariaLabel = 'lower bound'; -// endsR.ariaLabel = 'upper bound'; -// this.downInto = endsL; -// this.upInto = endsR; -// endsL.upOutOf = endsR; -// endsR.downOutOf = endsL; -// }; -// return SummationNotation; -// })(MathCommand); -// LatexCmds['\u2211'] = LatexCmds.sum = LatexCmds.summation = function () { -// return new SummationNotation('\\sum ', U_NARY_SUMMATION, 'sum'); -// }; -// LatexCmds['\u220f'] = LatexCmds.prod = LatexCmds.product = function () { -// return new SummationNotation('\\prod ', U_NARY_PRODUCT, 'product'); -// }; -// LatexCmds.coprod = LatexCmds.coproduct = function () { -// return new SummationNotation('\\coprod ', U_NARY_COPRODUCT, 'co product'); -// }; -// LatexCmds['\u222b'] = LatexCmds['int'] = LatexCmds.integral = /** @class */ (function (_super) { -// __extends(class_11, _super); -// function class_11() { -// var _this_1 = _super.call(this, '\\int ', '', 'integral') || this; -// _this_1.ariaLabel = 'integral'; -// _this_1.domView = new DOMView(2, function (blocks) { -// return h('span', { class: 'dcg-mq-int dcg-mq-non-leaf' }, [ -// h('big', {}, [h.text(U_INTEGRAL)]), -// h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf' }, [ -// h('span', { class: 'dcg-mq-sup' }, [ -// h.block('span', { class: 'dcg-mq-sup-inner' }, blocks[1]), -// ]), -// h.block('span', { class: 'dcg-mq-sub' }, blocks[0]), -// h('span', { style: 'display:inline-block;width:0' }, [h.text(U_ZERO_WIDTH_SPACE)]), -// ]), -// ]); -// }); -// return _this_1; -// } -// class_11.prototype.createLeftOf = function (cursor) { -// // FIXME: refactor rather than overriding -// MathCommand.prototype.createLeftOf.call(this, cursor); -// }; -// return class_11; -// })(SummationNotation); -// //window.LatexCmds = LatexCmds; -// //console.log(LatexCmds); -// //console.log(window); -// var Fraction = (LatexCmds.frac = LatexCmds.dfrac = LatexCmds.cfrac = LatexCmds.fraction = /** @class */ (function ( -// _super -// ) { -// __extends(FracNode, _super); -// function FracNode() { -// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; -// _this_1.ctrlSeq = '\\frac'; -// _this_1.domView = new DOMView(2, function (blocks) { -// return h('span', { class: 'dcg-mq-fraction dcg-mq-non-leaf' }, [ -// h.block('span', { class: 'dcg-mq-numerator' }, blocks[0]), -// h.block('span', { class: 'dcg-mq-denominator' }, blocks[1]), -// h('span', { style: 'display:inline-block;width:0' }, [h.text(U_ZERO_WIDTH_SPACE)]), -// ]); -// }); -// _this_1.textTemplate = ['(', ')/(', ')']; -// return _this_1; -// } -// FracNode.prototype.finalizeTree = function () { -// var endsL = this.getEnd(L); -// var endsR = this.getEnd(R); -// this.upInto = endsR.upOutOf = endsL; -// this.downInto = endsL.downOutOf = endsR; -// endsL.ariaLabel = 'numerator'; -// endsR.ariaLabel = 'denominator'; -// if (this.getFracDepth() > 1) { -// this.mathspeakTemplate = ['StartNestedFraction,', 'NestedOver', ', EndNestedFraction']; -// } else { -// this.mathspeakTemplate = ['StartFraction,', 'Over', ', EndFraction']; -// } -// }; -// FracNode.prototype.mathspeak = function (opts) { -// if (opts && opts.createdLeftOf) { -// var cursor = opts.createdLeftOf; -// return cursor.parent.mathspeak(); -// } -// var numText = getCtrlSeqsFromBlock(this.getEnd(L)); -// var denText = getCtrlSeqsFromBlock(this.getEnd(R)); -// // Shorten mathspeak value for whole number fractions whose denominator is less than 10. -// if ((!opts || !opts.ignoreShorthand) && intRgx.test(numText) && intRgx.test(denText)) { -// var isSingular = numText === '1' || numText === '-1'; -// var newDenSpeech = ''; -// if (denText === '2') { -// newDenSpeech = isSingular ? 'half' : 'halves'; -// } else if (denText === '3') { -// newDenSpeech = isSingular ? 'third' : 'thirds'; -// } else if (denText === '4') { -// newDenSpeech = isSingular ? 'quarter' : 'quarters'; -// } else if (denText === '5') { -// newDenSpeech = isSingular ? 'fifth' : 'fifths'; -// } else if (denText === '6') { -// newDenSpeech = isSingular ? 'sixth' : 'sixths'; -// } else if (denText === '7') { -// newDenSpeech = isSingular ? 'seventh' : 'sevenths'; -// } else if (denText === '8') { -// newDenSpeech = isSingular ? 'eighth' : 'eighths'; -// } else if (denText === '9') { -// newDenSpeech = isSingular ? 'ninth' : 'ninths'; -// } -// if (newDenSpeech !== '') { -// var output = ''; -// // Handle the case of an integer followed by a simplified fraction such as 1\frac{1}{2}. -// // Such combinations should be spoken aloud as "1 and 1 half." -// // Start at the left sibling of the fraction and continue leftward until something other than a digit or whitespace is found. -// var precededByInteger = false; -// for (var sibling = this[L]; sibling && sibling[L] !== undefined; sibling = sibling[L]) { -// // Ignore whitespace -// if (sibling.ctrlSeq === '\\ ') { -// continue; -// } else if (intRgx.test(sibling.ctrlSeq || '')) { -// precededByInteger = true; -// } else { -// precededByInteger = false; -// break; -// } -// } -// if (precededByInteger) { -// output += 'and '; -// } -// output += this.getEnd(L).mathspeak() + ' ' + newDenSpeech; -// return output; -// } -// } -// return _super.prototype.mathspeak.call(this); -// }; -// FracNode.prototype.getFracDepth = function () { -// var level = 0; -// var walkUp = function (item, level) { -// if (item instanceof MQNode && item.ctrlSeq && item.ctrlSeq.toLowerCase().search('frac') >= 0) -// level += 1; -// if (item && item.parent) return walkUp(item.parent, level); -// else return level; -// }; -// return walkUp(this, level); -// }; -// return FracNode; -// })(MathCommand)); -// var LiveFraction = (LatexCmds.over = CharCmds['/'] = /** @class */ (function (_super) { -// __extends(class_12, _super); -// function class_12() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// class_12.prototype.createLeftOf = function (cursor) { -// if (!this.replacedFragment) { -// var leftward = cursor[L]; -// if (!cursor.options.typingSlashCreatesNewFraction) { -// while ( -// leftward && -// !( -// leftward instanceof BinaryOperator || -// leftward instanceof (LatexCmds.text || noop) || -// leftward instanceof SummationNotation || -// leftward.ctrlSeq === '\\ ' || -// /^[,;:]$/.test(leftward.ctrlSeq) -// ) //lookbehind for operator -// ) -// leftward = leftward[L]; -// } -// if (leftward instanceof SummationNotation && leftward[R] instanceof SupSub) { -// leftward = leftward[R]; -// var leftwardR = leftward[R]; -// if (leftwardR instanceof SupSub && leftwardR.ctrlSeq != leftward.ctrlSeq) -// leftward = leftward[R]; -// } -// if (leftward !== cursor[L] && !cursor.isTooDeep(1)) { -// var leftwardR = leftward[R]; -// var cursorL = cursor[L]; -// this.replaces(new Fragment(leftwardR || cursor.parent.getEnd(L), cursorL)); -// cursor[L] = leftward; -// } -// } -// _super.prototype.createLeftOf.call(this, cursor); -// }; -// return class_12; -// })(Fraction)); -// var AnsBuilder = function () { -// return new MQSymbol('\\operatorname{ans}', h('span', { class: 'dcg-mq-ans' }, [h.text('ans')]), 'ans'); -// }; -// LatexCmds.ans = AnsBuilder; -// var PercentOfBuilder = function () { -// return new MQSymbol( -// '\\%\\operatorname{of}', -// h('span', { class: 'dcg-mq-nonSymbola dcg-mq-operator-name' }, [h.text('% of ')]), -// 'percent of' -// ); -// }; -// LatexCmds.percent = LatexCmds.percentof = PercentOfBuilder; -// var SquareRoot = /** @class */ (function (_super) { -// __extends(SquareRoot, _super); -// function SquareRoot() { -// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; -// _this_1.ctrlSeq = '\\sqrt'; -// _this_1.domView = new DOMView(1, function (blocks) { -// return h('span', { class: 'dcg-mq-non-leaf dcg-mq-sqrt-container' }, [ -// h('span', { class: 'dcg-mq-scaled dcg-mq-sqrt-prefix' }, [SVG_SYMBOLS.sqrt.html()]), -// h.block('span', { class: 'dcg-mq-non-leaf dcg-mq-sqrt-stem' }, blocks[0]), -// ]); -// }); -// _this_1.textTemplate = ['sqrt(', ')']; -// _this_1.mathspeakTemplate = ['StartRoot,', ', EndRoot']; -// _this_1.ariaLabel = 'root'; -// return _this_1; -// } -// SquareRoot.prototype.parser = function () { -// return latexMathParser.optBlock -// .then(function (optBlock) { -// return latexMathParser.block.map(function (block) { -// var nthroot = new NthRoot(); -// nthroot.blocks = [optBlock, block]; -// optBlock.adopt(nthroot, 0, 0); -// block.adopt(nthroot, optBlock, 0); -// return nthroot; -// }); -// }) -// .or(_super.prototype.parser.call(this)); -// }; -// return SquareRoot; -// })(MathCommand); -// LatexCmds.sqrt = SquareRoot; -// LatexCmds.hat = /** @class */ (function (_super) { -// __extends(Hat, _super); -// function Hat() { -// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; -// _this_1.ctrlSeq = '\\hat'; -// _this_1.domView = new DOMView(1, function (blocks) { -// return h('span', { class: 'dcg-mq-non-leaf' }, [ -// h('span', { class: 'dcg-mq-hat-prefix' }, [h.text('^')]), -// h.block('span', { class: 'dcg-mq-hat-stem' }, blocks[0]), -// ]); -// }); -// _this_1.textTemplate = ['hat(', ')']; -// return _this_1; -// } -// return Hat; -// })(MathCommand); -// var NthRoot = /** @class */ (function (_super) { -// __extends(NthRoot, _super); -// function NthRoot() { -// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; -// _this_1.domView = new DOMView(2, function (blocks) { -// return h('span', { class: 'dcg-mq-nthroot-container dcg-mq-non-leaf' }, [ -// h.block('sup', { class: 'dcg-mq-nthroot dcg-mq-non-leaf' }, blocks[0]), -// h('span', { class: 'dcg-mq-scaled dcg-mq-sqrt-container' }, [ -// h('span', { class: 'dcg-mq-sqrt-prefix dcg-mq-scaled' }, [SVG_SYMBOLS.sqrt.html()]), -// h.block('span', { class: 'dcg-mq-sqrt-stem dcg-mq-non-leaf' }, blocks[1]), -// ]), -// ]); -// }); -// _this_1.textTemplate = ['sqrt[', '](', ')']; -// return _this_1; -// } -// NthRoot.prototype.latexRecursive = function (ctx) { -// this.checkCursorContextOpen(ctx); -// ctx.latex += '\\sqrt['; -// this.getEnd(L).latexRecursive(ctx); -// ctx.latex += ']{'; -// this.getEnd(R).latexRecursive(ctx); -// ctx.latex += '}'; -// this.checkCursorContextClose(ctx); -// }; -// NthRoot.prototype.mathspeak = function () { -// var indexMathspeak = this.getEnd(L).mathspeak(); -// var radicandMathspeak = this.getEnd(R).mathspeak(); -// this.getEnd(L).ariaLabel = 'Index'; -// this.getEnd(R).ariaLabel = 'Radicand'; -// if (indexMathspeak === '3') { -// // cube root -// return 'Start Cube Root, ' + radicandMathspeak + ', End Cube Root'; -// } else { -// return 'Root Index ' + indexMathspeak + ', Start Root, ' + radicandMathspeak + ', End Root'; -// } -// }; -// return NthRoot; -// })(SquareRoot); -// LatexCmds.nthroot = NthRoot; -// LatexCmds.cbrt = /** @class */ (function (_super) { -// __extends(class_13, _super); -// function class_13() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// class_13.prototype.createLeftOf = function (cursor) { -// _super.prototype.createLeftOf.call(this, cursor); -// new Digit('3').createLeftOf(cursor); -// cursor.controller.moveRight(); -// }; -// return class_13; -// })(NthRoot); -// var DiacriticAbove = /** @class */ (function (_super) { -// __extends(DiacriticAbove, _super); -// function DiacriticAbove(ctrlSeq, html, textTemplate) { -// var _this_1 = this; -// var domView = new DOMView(1, function (blocks) { -// return h('span', { class: 'dcg-mq-non-leaf' }, [ -// h('span', { class: 'dcg-mq-diacritic-above' }, [html]), -// h.block('span', { class: 'dcg-mq-diacritic-stem' }, blocks[0]), -// ]); -// }); -// _this_1 = _super.call(this, ctrlSeq, domView, textTemplate) || this; -// return _this_1; -// } -// return DiacriticAbove; -// })(MathCommand); -// LatexCmds.vec = function () { -// return new DiacriticAbove('\\vec', h.entityText('→'), ['vec(', ')']); -// }; -// LatexCmds.tilde = function () { -// return new DiacriticAbove('\\tilde', h.text('~'), ['tilde(', ')']); -// }; -// var DelimsNode = /** @class */ (function (_super) { -// __extends(DelimsNode, _super); -// function DelimsNode() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// DelimsNode.prototype.setDOM = function (el) { -// var _c; -// _super.prototype.setDOM.call(this, el); -// var children = this.domFrag().children(); -// if (!children.isEmpty()) { -// this.delimFrags = ((_c = {}), (_c[L] = children.first()), (_c[R] = children.last()), _c); -// } -// return this; -// }; -// return DelimsNode; -// })(MathCommand); -// // Round/Square/Curly/Angle Brackets (aka Parens/Brackets/Braces) -// // first typed as one-sided bracket with matching "ghost" bracket at -// // far end of current block, until you type an opposing one -// var Bracket = /** @class */ (function (_super) { -// __extends(Bracket, _super); -// function Bracket(side, open, close, ctrlSeq, end) { -// var _c; -// var _this_1 = _super.call(this, '\\left' + ctrlSeq, undefined, [open, close]) || this; -// _this_1.side = side; -// _this_1.sides = -// ((_c = {}), (_c[L] = { ch: open, ctrlSeq: ctrlSeq }), (_c[R] = { ch: close, ctrlSeq: end }), _c); -// return _this_1; -// } -// Bracket.prototype.numBlocks = function () { -// return 1; -// }; -// Bracket.prototype.html = function () { -// var _this_1 = this; -// var leftSymbol = this.getSymbol(L); -// var rightSymbol = this.getSymbol(R); -// // wait until now so that .side may -// this.domView = new DOMView(1, function (blocks) { -// return h( -// // be set by createLeftOf or parser -// 'span', -// { class: 'dcg-mq-non-leaf dcg-mq-bracket-container' }, -// [ -// h( -// 'span', -// { -// style: 'width:' + leftSymbol.width, -// class: -// 'dcg-mq-scaled dcg-mq-bracket-l dcg-mq-paren' + -// (_this_1.side === R ? ' dcg-mq-ghost' : ''), -// }, -// [leftSymbol.html()] -// ), -// h.block( -// 'span', -// { -// style: 'margin-left:' + leftSymbol.width + ';margin-right:' + rightSymbol.width, -// class: 'dcg-mq-bracket-middle dcg-mq-non-leaf', -// }, -// blocks[0] -// ), -// h( -// 'span', -// { -// style: 'width:' + rightSymbol.width, -// class: -// 'dcg-mq-scaled dcg-mq-bracket-r dcg-mq-paren' + -// (_this_1.side === L ? ' dcg-mq-ghost' : ''), -// }, -// [rightSymbol.html()] -// ), -// ] -// ); -// }); -// return _super.prototype.html.call(this); -// }; -// Bracket.prototype.getSymbol = function (side) { -// var ch = this.sides[side || R].ch; -// return SVG_SYMBOLS[ch] || { width: '0', html: '' }; -// }; -// Bracket.prototype.latexRecursive = function (ctx) { -// this.checkCursorContextOpen(ctx); -// ctx.latex += '\\left' + this.sides[L].ctrlSeq; -// this.getEnd(L).latexRecursive(ctx); -// ctx.latex += '\\right' + this.sides[R].ctrlSeq; -// this.checkCursorContextClose(ctx); -// }; -// Bracket.prototype.mathspeak = function (opts) { -// var open = this.sides[L].ch, -// close = this.sides[R].ch; -// if (open === '|' && close === '|') { -// this.mathspeakTemplate = ['StartAbsoluteValue,', ', EndAbsoluteValue']; -// this.ariaLabel = 'absolute value'; -// } else if (opts && opts.createdLeftOf && this.side) { -// var ch = ''; -// if (this.side === L) ch = this.textTemplate[0]; -// else if (this.side === R) ch = this.textTemplate[1]; -// return (this.side === L ? 'left ' : 'right ') + BRACKET_NAMES[ch]; -// } else { -// this.mathspeakTemplate = ['left ' + BRACKET_NAMES[open] + ',', ', right ' + BRACKET_NAMES[close]]; -// this.ariaLabel = BRACKET_NAMES[open] + ' block'; -// } -// return _super.prototype.mathspeak.call(this); -// }; -// Bracket.prototype.matchBrack = function (opts, expectedSide, node) { -// // return node iff it's a matching 1-sided bracket of expected side (if any) -// return ( -// node instanceof Bracket && -// node.side && -// node.side !== -expectedSide && -// (!opts.restrictMismatchedBrackets || -// OPP_BRACKS[this.sides[this.side].ch] === node.sides[node.side].ch || -// { '(': ']', '[': ')' }[this.sides[L].ch] === node.sides[R].ch) && -// node -// ); -// }; -// Bracket.prototype.closeOpposing = function (brack) { -// brack.side = 0; -// brack.sides[this.side] = this.sides[this.side]; // copy over my info (may be -// var brackFrag = brack.delimFrags[this.side === L ? L : R] // mismatched, like [a, b)) -// .removeClass('dcg-mq-ghost'); -// this.replaceBracket(brackFrag, this.side); -// }; -// Bracket.prototype.createLeftOf = function (cursor) { -// var brack; -// if (!this.replacedFragment) { -// // unless wrapping seln in brackets, -// // check if next to or inside an opposing one-sided bracket -// var opts = cursor.options; -// if (this.sides[L].ch === '|') { -// // check both sides if I'm a pipe -// brack = -// this.matchBrack(opts, R, cursor[R]) || -// this.matchBrack(opts, L, cursor[L]) || -// this.matchBrack(opts, 0, cursor.parent.parent); -// } else { -// brack = -// this.matchBrack(opts, -this.side, cursor[-this.side]) || -// this.matchBrack(opts, -this.side, cursor.parent.parent); -// } -// } -// if (brack) { -// var side = (this.side = -brack.side); // may be pipe with .side not yet set -// this.closeOpposing(brack); -// if (brack === cursor.parent.parent && cursor[side]) { -// // move the stuff between -// new Fragment(cursor[side], cursor.parent.getEnd(side), -side) // me and ghost outside -// .disown() -// .withDirAdopt(-side, brack.parent, brack, brack[side]) -// .domFrag() -// .insDirOf(side, brack.domFrag()); -// } -// brack.bubble(function (node) { -// node.reflow(); -// return undefined; -// }); -// } else { -// (brack = this), (side = brack.side); -// if (brack.replacedFragment) brack.side = 0; -// // wrapping seln, don't be one-sided -// else if (cursor[-side]) { -// // elsewise, auto-expand so ghost is at far end -// brack.replaces(new Fragment(cursor[-side], cursor.parent.getEnd(-side), side)); -// cursor[-side] = 0; -// } -// _super.prototype.createLeftOf.call(this, cursor); -// } -// if (side === L) cursor.insAtLeftEnd(brack.getEnd(L)); -// else cursor.insRightOf(brack); -// }; -// Bracket.prototype.placeCursor = function () {}; -// Bracket.prototype.unwrap = function () { -// this.getEnd(L) -// .children() -// .disown() -// .adopt(this.parent, this, this[R]) -// .domFrag() -// .insertAfter(this.domFrag()); -// this.remove(); -// }; -// Bracket.prototype.deleteSide = function (side, outward, cursor) { -// var parent = this.parent, -// sib = this[side], -// farEnd = parent.getEnd(side); -// if (side === this.side) { -// // deleting non-ghost of one-sided bracket, unwrap -// this.unwrap(); -// sib ? cursor.insDirOf(-side, sib) : cursor.insAtDirEnd(side, parent); -// return; -// } -// var opts = cursor.options, -// wasSolid = !this.side; -// this.side = -side; -// // if deleting like, outer close-brace of [(1+2)+3} where inner open-paren -// if (this.matchBrack(opts, side, this.getEnd(L).getEnd(this.side))) { -// // is ghost, -// this.closeOpposing(this.getEnd(L).getEnd(this.side)); // then become [1+2)+3 -// var origEnd = this.getEnd(L).getEnd(side); -// this.unwrap(); -// if (origEnd) origEnd.siblingCreated(cursor.options, side); -// if (sib) { -// cursor.insDirOf(-side, sib); -// } else { -// cursor.insAtDirEnd(side, parent); -// } -// } else { -// // if deleting like, inner close-brace of ([1+2}+3) where outer -// if (this.matchBrack(opts, side, this.parent.parent)) { -// // open-paren is -// this.parent.parent.closeOpposing(this); // ghost, then become [1+2+3) -// this.parent.parent.unwrap(); -// } // else if deleting outward from a solid pair, unwrap -// else if (outward && wasSolid) { -// this.unwrap(); -// sib ? cursor.insDirOf(-side, sib) : cursor.insAtDirEnd(side, parent); -// return; -// } else { -// // else deleting just one of a pair of brackets, become one-sided -// this.sides[side] = getOppBracketSide(this); -// this.delimFrags[L].removeClass('dcg-mq-ghost'); -// this.delimFrags[R].removeClass('dcg-mq-ghost'); -// var brackFrag = this.delimFrags[side].addClass('dcg-mq-ghost'); -// this.replaceBracket(brackFrag, side); -// } -// if (sib) { -// // auto-expand so ghost is at far end -// var leftEnd = this.getEnd(L); -// var origEnd = leftEnd.getEnd(side); -// leftEnd.domFrag().removeClass('dcg-mq-empty'); -// new Fragment(sib, farEnd, -side) -// .disown() -// .withDirAdopt(-side, leftEnd, origEnd, 0) -// .domFrag() -// .insAtDirEnd(side, leftEnd.domFrag().oneElement()); -// if (origEnd) origEnd.siblingCreated(cursor.options, side); -// cursor.insDirOf(-side, sib); -// } // didn't auto-expand, cursor goes just outside or just inside parens -// else outward ? cursor.insDirOf(side, this) : cursor.insAtDirEnd(side, this.getEnd(L)); -// } -// }; -// Bracket.prototype.replaceBracket = function (brackFrag, side) { -// var symbol = this.getSymbol(side); -// brackFrag.children().replaceWith(domFrag(symbol.html())); -// brackFrag.oneElement().style.width = symbol.width; -// if (side === L) { -// var next = brackFrag.next(); -// if (!next.isEmpty()) { -// next.oneElement().style.marginLeft = symbol.width; -// } -// } else { -// var prev = brackFrag.prev(); -// if (!prev.isEmpty()) { -// prev.oneElement().style.marginRight = symbol.width; -// } -// } -// }; -// Bracket.prototype.deleteTowards = function (dir, cursor) { -// this.deleteSide(-dir, false, cursor); -// }; -// Bracket.prototype.finalizeTree = function () { -// this.getEnd(L).deleteOutOf = function (dir, cursor) { -// this.parent.deleteSide(dir, true, cursor); -// }; -// // FIXME HACK: after initial creation/insertion, finalizeTree would only be -// // called if the paren is selected and replaced, e.g. by LiveFraction -// this.finalizeTree = this.intentionalBlur = function () { -// this.delimFrags[this.side === L ? R : L].removeClass('dcg-mq-ghost'); -// this.side = 0; -// }; -// }; -// Bracket.prototype.siblingCreated = function (_opts, dir) { -// // if something typed between ghost and far -// if (dir === -this.side) this.finalizeTree(); // end of its block, solidify -// }; -// return Bracket; -// })(DelimsNode); -// function getOppBracketSide(bracket) { -// var side = bracket.side; -// var data = bracket.sides[side]; -// return { -// ch: OPP_BRACKS[data.ch], -// ctrlSeq: OPP_BRACKS[data.ctrlSeq], -// }; -// } -// var OPP_BRACKS = { -// '(': ')', -// ')': '(', -// '[': ']', -// ']': '[', -// '{': '}', -// '}': '{', -// '\\{': '\\}', -// '\\}': '\\{', -// '⟨': '⟩', -// '⟩': '⟨', -// '\\langle ': '\\rangle ', -// '\\rangle ': '\\langle ', -// '|': '|', -// '\\lVert ': '\\rVert ', -// '\\rVert ': '\\lVert ', -// }; -// var BRACKET_NAMES = { -// '⟨': 'angle-bracket', -// '⟩': 'angle-bracket', -// '|': 'pipe', -// }; -// function bindCharBracketPair(open, ctrlSeq, name) { -// var ctrlSeq = ctrlSeq || open; -// var close = OPP_BRACKS[open]; -// var end = OPP_BRACKS[ctrlSeq]; -// CharCmds[open] = function () { -// return new Bracket(L, open, close, ctrlSeq, end); -// }; -// CharCmds[close] = function () { -// return new Bracket(R, open, close, ctrlSeq, end); -// }; -// BRACKET_NAMES[open] = BRACKET_NAMES[close] = name; -// } -// bindCharBracketPair('(', '', 'parenthesis'); -// bindCharBracketPair('[', '', 'bracket'); -// bindCharBracketPair('{', '\\{', 'brace'); -// LatexCmds.langle = function () { -// return new Bracket(L, '⟨', '⟩', '\\langle ', '\\rangle '); -// }; -// LatexCmds.rangle = function () { -// return new Bracket(R, '⟨', '⟩', '\\langle ', '\\rangle '); -// }; -// CharCmds['|'] = function () { -// return new Bracket(L, '|', '|', '|', '|'); -// }; -// LatexCmds.lVert = function () { -// return new Bracket(L, '∥', '∥', '\\lVert ', '\\rVert '); -// }; -// LatexCmds.rVert = function () { -// return new Bracket(R, '∥', '∥', '\\lVert ', '\\rVert '); -// }; -// LatexCmds.left = /** @class */ (function (_super) { -// __extends(left, _super); -// function left() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// left.prototype.parser = function () { -// var regex = Parser.regex; -// var string = Parser.string; -// var optWhitespace = Parser.optWhitespace; -// return optWhitespace -// .then(regex(/^(?:[([|]|\\\{|\\langle(?![a-zA-Z])|\\lVert(?![a-zA-Z]))/)) -// .then(function (ctrlSeq) { -// var open = ctrlSeq.replace(/^\\/, ''); -// if (ctrlSeq == '\\langle') { -// open = '⟨'; -// ctrlSeq = ctrlSeq + ' '; -// } -// if (ctrlSeq == '\\lVert') { -// open = '∥'; -// ctrlSeq = ctrlSeq + ' '; -// } -// return latexMathParser.then(function (block) { -// return string('\\right') -// .skip(optWhitespace) -// .then(regex(/^(?:[\])|]|\\\}|\\rangle(?![a-zA-Z])|\\rVert(?![a-zA-Z]))/)) -// .map(function (end) { -// var close = end.replace(/^\\/, ''); -// if (end == '\\rangle') { -// close = '⟩'; -// end = end + ' '; -// } -// if (end == '\\rVert') { -// close = '∥'; -// end = end + ' '; -// } -// var cmd = new Bracket(0, open, close, ctrlSeq, end); -// cmd.blocks = [block]; -// block.adopt(cmd, 0, 0); -// return cmd; -// }); -// }); -// }); -// }; -// return left; -// })(MathCommand); -// LatexCmds.right = /** @class */ (function (_super) { -// __extends(right, _super); -// function right() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// right.prototype.parser = function () { -// return Parser.fail('unmatched \\right'); -// }; -// return right; -// })(MathCommand); -// var leftBinomialSymbol = SVG_SYMBOLS['(']; -// var rightBinomialSymbol = SVG_SYMBOLS[')']; -// var Binomial = /** @class */ (function (_super) { -// __extends(Binomial, _super); -// function Binomial() { -// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; -// _this_1.ctrlSeq = '\\binom'; -// _this_1.domView = new DOMView(2, function (blocks) { -// return h('span', { class: 'dcg-mq-non-leaf dcg-mq-bracket-container' }, [ -// h( -// 'span', -// { -// style: 'width:' + leftBinomialSymbol.width, -// class: 'dcg-mq-paren dcg-mq-bracket-l dcg-mq-scaled', -// }, -// [leftBinomialSymbol.html()] -// ), -// h( -// 'span', -// { -// style: -// 'margin-left:' + -// leftBinomialSymbol.width + -// '; margin-right:' + -// rightBinomialSymbol.width, -// class: 'dcg-mq-non-leaf dcg-mq-bracket-middle', -// }, -// [ -// h('span', { class: 'dcg-mq-array dcg-mq-non-leaf' }, [ -// h.block('span', {}, blocks[0]), -// h.block('span', {}, blocks[1]), -// ]), -// ] -// ), -// h( -// 'span', -// { -// style: 'width:' + rightBinomialSymbol.width, -// class: 'dcg-mq-paren dcg-mq-bracket-r dcg-mq-scaled', -// }, -// [rightBinomialSymbol.html()] -// ), -// ]); -// }); -// _this_1.textTemplate = ['choose(', ',', ')']; -// _this_1.mathspeakTemplate = ['StartBinomial,', 'Choose', ', EndBinomial']; -// _this_1.ariaLabel = 'binomial'; -// return _this_1; -// } -// return Binomial; -// })(DelimsNode); -// LatexCmds.binom = LatexCmds.binomial = Binomial; -// LatexCmds.choose = /** @class */ (function (_super) { -// __extends(class_14, _super); -// function class_14() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// class_14.prototype.createLeftOf = function (cursor) { -// LiveFraction.prototype.createLeftOf(cursor); -// }; -// return class_14; -// })(Binomial); -// var MathFieldNode = /** @class */ (function (_super) { -// __extends(MathFieldNode, _super); -// function MathFieldNode() { -// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; -// _this_1.ctrlSeq = '\\MathQuillMathField'; -// _this_1.domView = new DOMView(1, function (blocks) { -// return h('span', { class: 'dcg-mq-editable-field' }, [ -// h.block('span', { class: 'dcg-mq-root-block', 'aria-hidden': 'true' }, blocks[0]), -// ]); -// }); -// return _this_1; -// } -// MathFieldNode.prototype.parser = function () { -// var self = this, -// string = Parser.string, -// regex = Parser.regex, -// succeed = Parser.succeed; -// return string('[') -// .then(regex(/^[a-z][a-z0-9]*/i)) -// .skip(string(']')) -// .map(function (name) { -// self.name = name; -// }) -// .or(succeed(undefined)) -// .then(_super.prototype.parser.call(this)); -// }; -// MathFieldNode.prototype.finalizeTree = function (options) { -// var ctrlr = new Controller(this.getEnd(L), this.domFrag().oneElement(), options); -// ctrlr.KIND_OF_MQ = 'MathField'; -// ctrlr.editable = true; -// ctrlr.createTextarea(); -// ctrlr.editablesTextareaEvents(); -// ctrlr.cursor.insAtRightEnd(ctrlr.root); -// RootBlockMixin(ctrlr.root); -// // MathQuill applies aria-hidden to .dcg-mq-root-block containers -// // because these contain math notation that screen readers can't -// // interpret directly. MathQuill use an aria-live region as a -// // sibling of these block containers to provide an alternative -// // representation for screen readers -// // -// // MathFieldNodes have their own focusable text aria and aria live -// // region, so it is incorrect for any parent of the editable field -// // to have an aria-hidden property -// // -// // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden -// // -// // Handle this by recursively walking the parents of this element -// // until we hit a root block, and if we hit any parent with -// // aria-hidden="true", removing the property from the parent and -// // pushing it down to each of the parents children. This should -// // result in no parent of this node having aria-hidden="true", but -// // should keep as much of what was previously hidden hidden as -// // possible while obeying this constraint -// function pushDownAriaHidden(node) { -// if (node.parentNode && !domFrag(node).hasClass('dcg-mq-root-block')) { -// pushDownAriaHidden(node.parentNode); -// } -// if (node.nodeType === Node.ELEMENT_NODE) { -// var element = node; -// if (element.getAttribute('aria-hidden') === 'true') { -// element.removeAttribute('aria-hidden'); -// domFrag(node) -// .children() -// .eachElement(function (child) { -// child.setAttribute('aria-hidden', 'true'); -// }); -// } -// } -// } -// pushDownAriaHidden(this.domFrag().parent().oneElement()); -// this.domFrag().oneElement().removeAttribute('aria-hidden'); -// }; -// MathFieldNode.prototype.registerInnerField = function (innerFields, MathField) { -// var controller = this.getEnd(L).controller; -// var newField = new MathField(controller); -// innerFields[this.name] = newField; -// innerFields.push(newField); -// }; -// MathFieldNode.prototype.latexRecursive = function (ctx) { -// this.checkCursorContextOpen(ctx); -// this.getEnd(L).latexRecursive(ctx); -// this.checkCursorContextClose(ctx); -// }; -// MathFieldNode.prototype.text = function () { -// return this.getEnd(L).text(); -// }; -// return MathFieldNode; -// })(MathCommand); -// LatexCmds.editable = LatexCmds.MathQuillMathField = MathFieldNode; // backcompat with before cfd3620 on #233 -// // Embed arbitrary things -// // Probably the closest DOM analogue would be an iframe? -// // From MathQuill's perspective, it's a MQSymbol, it can be -// // anywhere and the cursor can go around it but never in it. -// // Create by calling public API method .dropEmbedded(), -// // or by calling the global public API method .registerEmbed() -// // and rendering LaTeX like \embed{registeredName} (see test). -// var EmbedNode = /** @class */ (function (_super) { -// __extends(EmbedNode, _super); -// function EmbedNode() { -// return (_super !== null && _super.apply(this, arguments)) || this; -// } -// EmbedNode.prototype.setOptions = function (options) { -// function noop() { -// return ''; -// } -// this.text = options.text || noop; -// this.domView = new DOMView(0, function () { -// return h('span', {}, [parseHTML(options.htmlString || '')]); -// }); -// this.latex = options.latex || noop; -// return this; -// }; -// EmbedNode.prototype.latexRecursive = function (ctx) { -// this.checkCursorContextOpen(ctx); -// ctx.latex += this.latex(); -// this.checkCursorContextClose(ctx); -// }; -// EmbedNode.prototype.parser = function () { -// var self = this, -// string = Parser.string, -// regex = Parser.regex, -// succeed = Parser.succeed; -// return string('{') -// .then(regex(/^[a-z][a-z0-9]*/i)) -// .skip(string('}')) -// .then(function (name) { -// // the chars allowed in the optional data block are arbitrary other than -// // excluding curly braces and square brackets (which'd be too confusing) -// return string('[') -// .then(regex(/^[-\w\s]*/)) -// .skip(string(']')) -// .or(succeed(undefined)) -// .map(function (data) { -// return self.setOptions(EMBEDS[name](data)); -// }); -// }); -// }; -// return EmbedNode; -// })(MQSymbol); -// LatexCmds.embed = EmbedNode; -// /**************************************** -// * Input box to type backslash commands -// ***************************************/ -// CharCmds['\\'] = /** @class */ (function (_super) { -// __extends(LatexCommandInput, _super); -// function LatexCommandInput() { -// var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; -// _this_1.ctrlSeq = '\\'; -// _this_1.domView = new DOMView(1, function (blocks) { -// return h('span', { class: 'dcg-mq-latex-command-input-wrapper dcg-mq-non-leaf' }, [ -// h('span', { class: 'dcg-mq-latex-command-input dcg-mq-non-leaf' }, [ -// h.text('\\'), -// h.block('span', {}, blocks[0]), -// ]), -// ]); -// }); -// _this_1.textTemplate = ['\\']; -// return _this_1; -// } -// LatexCommandInput.prototype.replaces = function (replacedFragment) { -// this._replacedFragment = replacedFragment.disown(); -// this.isEmpty = function () { -// return false; -// }; -// }; -// LatexCommandInput.prototype.createBlocks = function () { -// _super.prototype.createBlocks.call(this); -// var endsL = this.getEnd(L); -// endsL.focus = function () { -// this.parent.domFrag().addClass('dcg-mq-hasCursor'); -// if (this.isEmpty()) this.parent.domFrag().removeClass('dcg-mq-empty'); -// return this; -// }; -// endsL.blur = function () { -// this.parent.domFrag().removeClass('dcg-mq-hasCursor'); -// if (this.isEmpty()) this.parent.domFrag().addClass('dcg-mq-empty'); -// return this; -// }; -// endsL.write = function (cursor, ch) { -// cursor.show().deleteSelection(); -// if (ch.match(/[a-z]/i)) { -// new VanillaSymbol(ch).createLeftOf(cursor); -// // TODO needs tests -// cursor.controller.aria.alert(ch); -// } else { -// var cmd = this.parent.renderCommand(cursor); -// // TODO needs tests -// cursor.controller.aria.queue(cmd.mathspeak({ createdLeftOf: cursor })); -// if (ch !== '\\' || !this.isEmpty()) cursor.parent.write(cursor, ch); -// else cursor.controller.aria.alert(); -// } -// }; -// var originalKeystroke = endsL.keystroke; -// endsL.keystroke = function (key, e, ctrlr) { -// if (key === 'Tab' || key === 'Enter' || key === 'Spacebar') { -// var cmd = this.parent.renderCommand(ctrlr.cursor); -// // TODO needs tests -// ctrlr.aria.alert(cmd.mathspeak({ createdLeftOf: ctrlr.cursor })); -// e === null || e === void 0 ? void 0 : e.preventDefault(); -// return; -// } -// return originalKeystroke.call(this, key, e, ctrlr); -// }; -// }; -// LatexCommandInput.prototype.createLeftOf = function (cursor) { -// _super.prototype.createLeftOf.call(this, cursor); -// if (this._replacedFragment) { -// var frag = this.domFrag(); -// var el_1 = frag.oneElement(); -// this._replacedFragment.domFrag().addClass('dcg-mq-blur'); -// //FIXME: is monkey-patching the mousedown and mousemove handlers the right way to do this? -// var rewriteMousedownEventTarget = function (e) { -// { -// // TODO - overwritting e.target -// e.target = el_1; -// el_1.dispatchEvent(e); -// return false; -// } -// }; -// el_1.addEventListener('mousedown', rewriteMousedownEventTarget); -// el_1.addEventListener('mouseup', rewriteMousedownEventTarget); -// this._replacedFragment.domFrag().insertBefore(frag.children().first()); -// } -// }; -// LatexCommandInput.prototype.latexRecursive = function (ctx) { -// this.checkCursorContextOpen(ctx); -// ctx.latex += '\\'; -// this.getEnd(L).latexRecursive(ctx); -// ctx.latex += ' '; -// this.checkCursorContextClose(ctx); -// }; -// LatexCommandInput.prototype.renderCommand = function (cursor) { -// this.setDOM(this.domFrag().children().lastElement()); -// this.remove(); -// if (this[R]) { -// cursor.insLeftOf(this[R]); -// } else { -// cursor.insAtRightEnd(this.parent); -// } -// var latex = this.getEnd(L).latex(); -// if (!latex) latex = ' '; -// var cmd = LatexCmds[latex]; -// if (cmd) { -// //console.log(cmd); -// var node = void 0; -// if (isMQNodeClass(cmd)) { -// node = new cmd(latex); -// } else { -// node = cmd(latex); -// } -// if (this._replacedFragment) node.replaces(this._replacedFragment); -// node.createLeftOf(cursor); -// return node; -// } else { -// var node = new TextBlock(); -// node.replaces(latex); -// node.createLeftOf(cursor); -// cursor.insRightOf(node); -// if (this._replacedFragment) { -// this._replacedFragment.remove(); -// } -// return node; -// } -// }; -// return LatexCommandInput; -// })(MathCommand); -// // For backwards compatibility, set up the global MathQuill object as an instance of API interface v1 -// if (window.jQuery) { -// MQ1 = getInterface(1); -// for (var key in MQ1) -// (function (key, val) { -// if (typeof val === 'function') { -// MathQuill[key] = function () { -// insistOnInterVer(); -// return val.apply(this, arguments); -// }; -// MathQuill[key].prototype = val.prototype; -// } else MathQuill[key] = val; -// })(key, MQ1[key]); -// } -// //console.log(MathQuill); -// })(); -// } diff --git a/src/popup.ts b/src/popup.ts index 51b29ee..4f6d835 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -96,7 +96,7 @@ async function getStorageData(key) { // Function to add/remove user config data corresponding to a slider that was // just clicked. -async function storeConfig() { +async function storeConfig(this: HTMLInputElement) { let wordToStore = this.parentElement.parentElement.id; const opt = this.parentElement.parentElement.getAttribute('opt'); let currentlyStored = await getStorageData(opt); diff --git a/src/preload_inject.ts b/src/preload_inject.ts index e64cda5..f5c5ea2 100644 --- a/src/preload_inject.ts +++ b/src/preload_inject.ts @@ -1,5 +1,4 @@ -// @ts-nocheck -//import extendMathQuill from './extend_mathquill'; +import extendMathQuill from './extend_mathquill'; console.log('Preload injected'); @@ -97,8832 +96,3 @@ pollForValue( document.body.appendChild(script); }); - -// @ts-nocheck -/* eslint-disable */ -function extendMathQuill() { - console.log("Running extend"); - (function () { - var L = -1; - var R = 1; - var min = Math.min; - var max = Math.max; - function noop() {} - /** - * a development-only debug method. This definition and all - * calls to `pray` will be stripped from the minified - * build of mathquill. - * - * This function must be called by name to be removed - * at compile time. Do not define another function - * with the same name, and only call this function by - * name. - */ - function pray(message, cond) { - if (!cond) throw new Error('prayer failed: ' + message); - } - function prayDirection(dir) { - pray('a direction was passed', dir === L || dir === R); - } - var urlParams = new URLSearchParams(window.location.search); - function parseHTML(s) { - // https://youmightnotneedjquery.com/#parse_html - var tmp = document.implementation.createHTMLDocument(''); - tmp.body.innerHTML = s; - if (tmp.body.children.length === 1) return tmp.body.children[0]; - var frag = document.createDocumentFragment(); - while (tmp.body.firstChild) { - frag.appendChild(tmp.body.firstChild); - } - return frag; - } - var h = function h(type, attributes, children) { - var el; - switch (type) { - case 'svg': - case 'path': - el = document.createElementNS('http://www.w3.org/2000/svg', type); - break; - default: - el = document.createElement(type); - } - for (var key_1 in attributes) { - var value = attributes[key_1]; - if (value === undefined) continue; - el.setAttribute(key_1, typeof value === 'string' ? value : String(value)); - } - if (children) { - for (var i = 0; i < children.length; i++) { - el.appendChild(children[i]); - } - } - return el; - }; - h.text = function (s) { - return document.createTextNode(s); - }; - h.block = function (type, attributes, block) { - var out = h(type, attributes, [block.html()]); - block.setDOM(out); - NodeBase.linkElementByBlockNode(out, block); - return out; - }; - h.entityText = function (s) { - // TODO: replace with h.text(U_BLAHBLAH) or maybe a named entity->unicode lookup - var val = parseHTML(s); - pray( - 'entity parses to a single text node', - val instanceof DocumentFragment && val.childNodes.length === 1 && val.childNodes[0] instanceof Text - ); - return val.childNodes[0]; - }; - function closest(el, s) { - var _a, _b, _c; - if (typeof ((_a = el) === null || _a === void 0 ? void 0 : _a.closest) === 'function') { - return el.closest(s); - } - if (!(el instanceof HTMLElement)) return null; - // https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#polyfill - var matches = - Element.prototype.matches || - Element.prototype.msMatchesSelector || - Element.prototype.webkitMatchesSelector; - var match = el; - do { - if (matches.call(match, s)) return match; - match = - (_c = - (_b = match === null || match === void 0 ? void 0 : match.parentElement) !== null && - _b !== void 0 - ? _b - : match === null || match === void 0 - ? void 0 - : match.parentNode) !== null && _c !== void 0 - ? _c - : null; - } while (match !== null && match.nodeType === 1); - return null; - } - var U_NO_BREAK_SPACE = '\u00A0'; - var U_ZERO_WIDTH_SPACE = '\u200B'; - var U_DOT_ABOVE = '\u02D9'; - var U_NARY_SUMMATION = '\u2211'; - var U_NARY_PRODUCT = '\u220F'; - var U_NARY_COPRODUCT = '\u2210'; - var U_INTEGRAL = '\u222B'; - /** - * Like `el.getBoundingClientRect()` but avoids throwing for - * disconnected and hidden elements in IE <= 11. - * */ - function getBoundingClientRect(el) { - // Return zeros for disconnected and hidden (display: none) elements - // Running getBoundingClientRect on a disconnected node in IE <=11 throws an error - // https://github.com/jquery/jquery/blob/a684e6ba836f7c553968d7d026ed7941e1a612d8/src/offset.js#L83-L86 - if (!el.getClientRects().length) { - return { - top: 0, - left: 0, - height: 0, - width: 0, - x: 0, - y: 0, - bottom: 0, - right: 0, - }; - } - return el.getBoundingClientRect(); - } - /** - * Returns the number of pixels that the document is currently scrolled - * horizontally -- `window.scrollX` in modern browsers. - * */ - function getScrollX() { - // In IE9, scrollX was called pageXOffset - // Previous versions of IE had neither property and use scrollLeft instead - // - // https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX#notes - return window.pageXOffset !== undefined - ? window.pageXOffset - : (document.documentElement || document.body.parentNode || document.body).scrollLeft; - } - /** - * Returns the number of pixels that the document is currently scrolled - * vertically -- `window.scrollY` in modern browsers. - * */ - function getScrollY() { - // In IE9, scrollY was called pageYOffset - // Previous versions of IE had neither property and use scrollTop instead - // - // https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX#notes - return window.pageYOffset !== undefined - ? window.pageYOffset - : (document.documentElement || document.body.parentNode || document.body).scrollTop; - } - /** - * Given `duration` in ms and callback `cb`, immediately calls `cb(progress, scheduleNext, cancel)` with: - * - `progress` set to `0` if duration > 0, or 1 if duration <= 0 - * - `scheduleNext` a function that schedules a future call to `cb` - * - `cancel` a function that cancels any pending `scheduleNext` call. - * - * `scheduleNext` schedules a call to `cb` with `progress` set to the - * ratio of currently elapsed time and `duration`. - * - * To continue running the animation, `cb` should call `scheduleNext`. - * - * To stop the animation, it is the responsibility of `cb` to check - * whether progress is greater than or equal to 1, in which case `cb` - * should not call `scheduleNext`. - * - * `scheduleNext` uses `requestAnimationFrame` if available and falls - * back to `setTimeout(..., 13)` otherwise. Times are always based on - * `Date.now()` for compatibility between `requestAnimationFrame` and - * the `setTimeout` fallback. `cb` will only be called with strictly - * monotonic `progress` values. - * - * Note: `animate` purposely puts a lot of responsibility on the caller - * to keep its implementation simple because it isn't used very widely - * in the project. - */ - var animate = (function () { - // IIFE exists just to hang on to configured rafShim and cancelShim - // functions - var rafShim, cancelShim; - if (typeof requestAnimationFrame === 'function' && typeof cancelAnimationFrame === 'function') { - rafShim = requestAnimationFrame; - cancelShim = cancelAnimationFrame; - } else { - rafShim = function (cb) { - return setTimeout(cb, 13); - }; - cancelShim = clearTimeout; - } - return function (duration, cb) { - var start = Date.now(); - var cancelToken; - var progress = 0; - function step() { - var proposedProgress = (Date.now() - start) / duration; - // Enforce that progress is strictly monotonic - if (proposedProgress <= progress) { - scheduleNext(); - } else { - progress = proposedProgress; - } - cb(progress, scheduleNext, cancel); - } - function cancel() { - if (cancelToken !== undefined) cancelShim(cancelToken); - cancelToken = undefined; - } - function scheduleNext() { - // Calling cancel here ensures that there are never multiple - // concurrent callbacks scheduled for a single animation, even if - // the caller calls `scheduleNext` multiple times in a single - // event loop (which is always a mistake) - cancel(); - cancelToken = rafShim(step); - } - cb(duration <= 0 ? 1 : 0, scheduleNext, cancel); - }; - })(); - var Aria = /** @class */ (function () { - function Aria(controller) { - this.span = h('span', { - class: 'dcg-mq-aria-alert', - 'aria-live': 'assertive', - 'aria-atomic': 'true', - }); - this.msg = ''; - this.items = []; - this.controller = controller; - } - Aria.prototype.attach = function () { - var container = this.controller.container; - if (this.span.parentNode !== container) { - domFrag(container).prepend(domFrag(this.span)); - } - }; - Aria.prototype.queue = function (item, shouldDescribe) { - if (shouldDescribe === void 0) { - shouldDescribe = false; - } - var output = ''; - if (item instanceof MQNode) { - // Some constructs include verbal shorthand (such as simple fractions and exponents). - // Since ARIA alerts relate to moving through interactive content, we don't want to use that shorthand if it exists - // since doing so may be ambiguous or confusing. - var itemMathspeak = item.mathspeak({ ignoreShorthand: true }); - if (shouldDescribe) { - // used to ensure item is described when cursor reaches block boundaries - if (item.parent && item.parent.ariaLabel && item.ariaLabel === 'block') { - output = item.parent.ariaLabel + ' ' + itemMathspeak; - } else if (item.ariaLabel) { - output = item.ariaLabel + ' ' + itemMathspeak; - } - } - if (output === '') { - output = itemMathspeak; - } - } else { - output = item || ''; - } - this.items.push(output); - return this; - }; - Aria.prototype.queueDirOf = function (dir) { - prayDirection(dir); - return this.queue(dir === L ? 'before' : 'after'); - }; - Aria.prototype.queueDirEndOf = function (dir) { - prayDirection(dir); - return this.queue(dir === L ? 'beginning of' : 'end of'); - }; - Aria.prototype.alert = function (t) { - this.attach(); - if (t) this.queue(t); - if (this.items.length) { - // To cut down on potential verbiage from multiple Mathquills firing near-simultaneous ARIA alerts, - // update the text of this instance if its container also has keyboard focus. - // If it does not, leave the DOM unchanged but flush the queue regardless. - // Note: updating the msg variable regardless of focus for unit tests. - this.msg = this.items - .join(' ') - .replace(/ +(?= )/g, '') - .trim(); - if (this.controller.containerHasFocus()) { - this.span.textContent = this.msg; - } - } - return this.clear(); - }; - Aria.prototype.clear = function () { - this.items.length = 0; - return this; - }; - return Aria; - })(); - /** - * A `DOMFragment` represents a contiguous span of sibling DOM Nodes, - * which may include both Element nodes and other nodes like Text and - * Comment nodes. A `DOMFragment` may represent zero or more nodes. - * - * `DOMFragments` are created using the `DOMFragment.create` factory - * function, which is also aliased as `domFrag` for convenience. - * - * A `DOMFragment` simply holds references to nodes. It doesn't move or - * mutate them in the way that the native `DocumentFragment` does. - * - * `DOMFragment` implements many of the same methods for manipulating a - * collection of DOM elements that jQuery does, but it has some notable - * differences: - * - * 1. A jQuery collection can hold an arbitrary ordered set of DOM - * elements, but a `DOMFragment` can only hold a contiguous span of - * sibling nodes. - * 2. Some jQuery DOM manipulation methods like `insert{Before,After}`, - * `append`, `prepend`, `appendTo`, `prependTo`, etc. may insert - * several clones of a collection into different places in the DOM. - * `DOMFragment` never makes clones of DOM nodes--instead, when - * targeting multi-element fragments, it moves source nodes before - * or after the targeted fragment as appropriate without ever making - * more copies. - * 3. For methods like `.children()`, where it's likely to be a mistake - * to call the method on a fragment that doesn't contain exactly one - * node or element, `DOMFragment` will throw whereas jQuery will - * silently do something possibly unintended. Methods that assert - * are commented with the properties that they assert. - * - * Internally, `DOMFragment` holds immutable references to the left and - * right end nodes (if the fragment is not empty). The other nodes are - * represented implicitly through the sibling pointers of the DOM nodes - * themselves. This means that it is possible to invalidate a - * `DOMFragment` by moving one of its ends without moving the other in - * such a way that they are no longer siblings. It is also possible to - * change the contents of a `DOMFragment` by adding or removing DOM - * nodes between its ends. - */ - var DOMFragment = /** @class */ (function () { - /** - * Constructor is private to enforce that the invariant checks in - * `create` are applied to outside callers. Internal methods are - * allowed to use this constructor when they can guarantee they're - * passing sibling nodes (such as children of a parent node). - */ - function DOMFragment(first, last) { - var _a; - if (arguments.length === 1) last = first; - if (!first || !last) return; - this.ends = ((_a = {}), (_a[L] = first), (_a[R] = last), _a); - } - /** - * Returns a `DOMFragment` representing the contiguous span of sibling - * DOM nodes betewen `first` and `last`. If only one element is - * passed, creates a `DOMFragment` representing that single element. - * If no elements are passed, creates and empty `DOMFragment`. - * - * If two elements are passed, asserts that the second element is a - * forward sibling of the first element. Checking this invariant is - * O(n) in the total number of nodes in the fragment - */ - DOMFragment.create = function (first, last) { - if (arguments.length === 1) last = first; - pray('No half-empty DOMFragments', !!first === !!last); - var out = new DOMFragment(first, last); - pray('last is a forward sibling of first', out.isValid()); - return out; - }; - DOMFragment.prototype.isEmpty = function () { - return this.ends === undefined; - }; - DOMFragment.prototype.isOneNode = function () { - return !!(this.ends && this.ends[L] === this.ends[R]); - }; - /** - * Returns true if the fragment is empty or if its last node is equal - * to its first node or is a forward sibling of its first node. - * - * DOMFragments may be invalidated if any of the nodes they contain - * are moved or removed independently of the other nodes they contain. - * - * Note that this check visits each node in the fragment, so it is - * O(n). - */ - DOMFragment.prototype.isValid = function () { - if (!this.ends) return true; - if (this.ends[L] === this.ends[R]) return true; - var maybeLast; - this.eachNode(function (el) { - return (maybeLast = el); - }); - return maybeLast === this.ends[R]; - }; - /** - * Return the first Node of this fragment. May be a a Node that is not - * an Element such as a Text or Comment node. - * - * Asserts fragment is not empty. - */ - DOMFragment.prototype.firstNode = function () { - pray('Fragment is not empty', this.ends); - return this.ends[L]; - }; - /** - * Return the last Node of this fragment. May be a a Node that is not - * an Element such as a Text or Comment node. - * - * Asserts fragment is not empty. - */ - DOMFragment.prototype.lastNode = function () { - pray('Fragment is not empty', this.ends); - return this.ends[R]; - }; - /** - * Return a fragment representing the children (including Text and - * Comment nodes) of the node represented by this fragment. - * - * Asserts that this fragment contains exactly one Node. - * - * Note, because this includes text and comment nodes, this is more - * like jQuery's .contents() than jQuery's .children() - */ - DOMFragment.prototype.children = function () { - var el = this.oneNode(); - var first = el.firstChild; - var last = el.lastChild; - return first && last ? new DOMFragment(first, last) : new DOMFragment(); - }; - /** - * Return a new `DOMFragment` spanning this fragment and `sibling` - * fragment. Does not perform any DOM operations. - * - * Asserts that `sibling` is either empty or a forward sibling of - * this fragment that may share its first node with the last node of - * this fragment - */ - DOMFragment.prototype.join = function (sibling) { - if (!this.ends) return sibling; - if (!sibling.ends) return this; - // Check if sibling is actually a sibling of this span - var found = false; - var current = this.ends[R].nextSibling; - while (current) { - if (current === sibling.ends[L]) { - found = true; - break; - } - current = current.nextSibling; - } - pray('sibling must be a forward DOM sibling of this fragment', found); - return new DOMFragment(this.ends[L], sibling.ends[R]); - }; - /** - * Return the single DOM Node represented by this fragment. - * - * Asserts that this fragment contains exactly one Node. - */ - DOMFragment.prototype.oneNode = function () { - pray('Fragment has a single node', this.ends && this.ends[L] === this.ends[R]); - return this.ends[L]; - }; - /** - * Return the single DOM Element represented by this fragment. - * - * Asserts that this fragment contains exactly one Node, and that node - * is an Element node. - */ - DOMFragment.prototype.oneElement = function () { - var el = this.oneNode(); - pray('Node is an Element', el.nodeType === Node.ELEMENT_NODE); - return el; - }; - /** - * Return the single DOM Text node represented by this fragment. - * - * Asserts that this fragment contains exactly one Node, and that node - * is a Text node. - */ - DOMFragment.prototype.oneText = function () { - var el = this.oneNode(); - pray('Node is Text', el.nodeType === Node.TEXT_NODE); - return el; - }; - /** - * Calls callback sequentially with each node in this fragment. - * Includes nodes that are not Elements, such as Text and Comment - * nodes. - */ - DOMFragment.prototype.eachNode = function (cb) { - if (!this.ends) return this; - var stop = this.ends[R]; - for (var node = this.ends[L], next = void 0; node; node = next) { - // Note, this loop is organized in a slightly tricky way in order - // cache "next" before calling the callback. This is done because - // the callback could mutate node.nextSibling (e.g. by moving the - // node to a documentFragment, like toDocumentFragment does). - // - // It's still possible to break this iteration by messing with - // forward siblings of node in the callback, although it's - // probably rare to want to do that. Perhaps this means "each" is - // too dangerous to have as a public method. - next = node.nextSibling; - cb(node); - if (node === stop) break; - } - return this; - }; - /** - * Calls callback sequentially with each Element node in this - * fragment. Skips nodes that are not Elements, such as Text and - * Comment nodes. - */ - DOMFragment.prototype.eachElement = function (cb) { - this.eachNode(function (el) { - if (el.nodeType === Node.ELEMENT_NODE) cb(el); - }); - return this; - }; - /** - * Returns the concatenated text content of all of the nodes in the - * fragment. - */ - DOMFragment.prototype.text = function () { - var accum = ''; - this.eachNode(function (node) { - accum += node.textContent || ''; - }); - return accum; - }; - /** - * Returns an array of all the Nodes in this fragment, including nodes - * that are not Element nodes such as Text and Comment nodes; - */ - DOMFragment.prototype.toNodeArray = function () { - var accum = []; - this.eachNode(function (el) { - return accum.push(el); - }); - return accum; - }; - /** - * Returns an array of all the Element nodes in this fragment. The - * result does not include nodes that are not Elements, such as Text - * and Comment nodes. - */ - DOMFragment.prototype.toElementArray = function () { - var accum = []; - this.eachElement(function (el) { - return accum.push(el); - }); - return accum; - }; - /** - * Moves all of the nodes in this fragment into a new DocumentFragment - * and returns it. This includes Nodes that are not Elements such as - * Text and Comment nodes. - */ - DOMFragment.prototype.toDocumentFragment = function () { - var frag = document.createDocumentFragment(); - this.eachNode(function (el) { - return frag.appendChild(el); - }); - return frag; - }; - /** - * Insert all the nodes in this fragment into the DOM directly before - * the first node of `sibling` fragment. If `sibling` is empty or does - * not have a parent node, detaches this fragment from the document. - * - * Note that this behavior differs from jQuery if `sibling` is a - * collection with multiple nodes. In that case, jQuery inserts this - * collection before the first node in `sibling`, and then inserts a - * clone of this collection before each additional node in the - * `sibling` collection. DOMFragment only ever inserts this collection - * before the first node of the sibling fragment, and never inserts - * additional clones. - */ - DOMFragment.prototype.insertBefore = function (sibling) { - return this.insDirOf(L, sibling); - }; - /** - * Insert all the nodes in this fragment into the DOM directly after - * the last node of `sibling` fragment. If `sibling` is empty or does - * not have a parent node, detaches this fragment from the document. - * - * Note that this behavior differs from jQuery if `sibling` is a - * collection with multiple nodes. In that case, jQuery inserts this - * collection before the first node in `sibling`, and then inserts a - * clone of this collection before each additional node in the - * `sibling` collection. DOMFragment only ever inserts this collection - * before the first node of the sibling fragment, and never inserts - * additional clones. - */ - DOMFragment.prototype.insertAfter = function (sibling) { - return this.insDirOf(R, sibling); - }; - /** - * Append children to the node represented by this fragment. - * - * Asserts that this fragment contains exactly one Element. - */ - DOMFragment.prototype.append = function (children) { - children.appendTo(this.oneElement()); - return this; - }; - /** - * Prepend children to the node represented by this fragment. - * - * Asserts that this fragment contains exactly one Element. - */ - DOMFragment.prototype.prepend = function (children) { - children.prependTo(this.oneElement()); - return this; - }; - /** - * Append all the nodes in this fragment to the children of `el`. - */ - DOMFragment.prototype.appendTo = function (el) { - return this.insAtDirEnd(R, el); - }; - /** - * Prepend all the nodes in this fragment to the children of `el`. - */ - DOMFragment.prototype.prependTo = function (el) { - return this.insAtDirEnd(L, el); - }; - /** - * Return a fragment containing the parent node of the nodes in this - * fragment. Returns an empty fragment if this fragment is empty or - * does not have a parent node. - */ - DOMFragment.prototype.parent = function () { - if (!this.ends) return this; - var parent = this.ends[L].parentNode; - if (!parent) return new DOMFragment(); - return new DOMFragment(parent); - }; - /** - * Replace the children of `el` with the contents of this fragment, - * and place `el` into the DOM at the previous location of this - * fragment. - */ - DOMFragment.prototype.wrapAll = function (el) { - el.textContent = ''; // First empty the wrapping element - if (!this.ends) return this; - var parent = this.ends[L].parentNode; - var next = this.ends[R].nextSibling; - this.appendTo(el); - if (parent) { - parent.insertBefore(el, next); - } - return this; - }; - /** - * Replace this fragment with the fragment given by `children`. If - * this fragment is empty or does not have a parent node, detaches - * `children` from the document. - * - * Note that this behavior differs from jQuery if this is a collection - * with multiple nodes. In that case, jQuery replaces the first - * element of this collection with `children`, and then replaces each - * additional element in this collection with a clone of `children`. - * DOMFragment replaces this entire fragment with `children` and never - * makes additional clones of `children`. - */ - DOMFragment.prototype.replaceWith = function (children) { - var _a; - var rightEnd = (_a = this.ends) === null || _a === void 0 ? void 0 : _a[R]; - // Note: important to cache parent and nextSibling (if they exist) - // before detaching this fragment from the document (which will - // mutate its parent and sibling references) - var parent = rightEnd === null || rightEnd === void 0 ? void 0 : rightEnd.parentNode; - var nextSibling = rightEnd === null || rightEnd === void 0 ? void 0 : rightEnd.nextSibling; - this.detach(); - // Note, this purposely detaches children from the document, even if - // they can't be reinserted because this fragment is empty or has no - // parent - var childDocumentFragment = children.toDocumentFragment(); - if (!rightEnd || !parent) return this; - parent.insertBefore(childDocumentFragment, nextSibling || null); - return this; - }; - /** - * Return the nth Element node of this collection, or undefined if - * there is no nth Element. Skips Nodes that are not Elements (e.g. - * Text and Comment nodes). - * - * Analogous to jQuery's array indexing syntax, or jQuery's .get() - * with positive arguments. - */ - DOMFragment.prototype.nthElement = function (n) { - if (!this.ends) return undefined; - if (n < 0 || n !== Math.floor(n)) return undefined; - var current = this.ends[L]; - while (current) { - // Only count element nodes - if (current.nodeType === Node.ELEMENT_NODE) { - if (n <= 0) return current; - n -= 1; - } - if (current === this.ends[R]) return undefined; - current = current.nextSibling; - } - return undefined; - }; - /** - * Return the first Element node of this fragment, or undefined if - * the fragment is empty. Skips Nodes that are not Elements (e.g. - * Text and Comment nodes). - */ - DOMFragment.prototype.firstElement = function () { - return this.nthElement(0); - }; - /** - * Return the first Element node of this fragment, or undefined if - * the fragment is empty. Skips Nodes that are not Elements (e.g. - * Text and Comment nodes). - */ - DOMFragment.prototype.lastElement = function () { - if (!this.ends) return undefined; - var current = this.ends[R]; - while (current) { - // Only count element nodes - if (current.nodeType === Node.ELEMENT_NODE) { - return current; - } - if (current === this.ends[L]) return undefined; - current = current.previousSibling; - } - return undefined; - }; - /** - * Return a new fragment holding the first Element node of this - * fragment, or an empty fragment if this fragment is empty. Skips - * Nodes that are not Elements (e.g. Text and Comment nodes). - */ - DOMFragment.prototype.first = function () { - return new DOMFragment(this.firstElement()); - }; - /** - * Return a new fragment holding the last Element node of this - * fragment, or an empty fragment if this fragment is empty. Skips - * Nodes that are not Elements (e.g. Text and Comment nodes). - */ - DOMFragment.prototype.last = function () { - return new DOMFragment(this.lastElement()); - }; - /** - * Return a new fragment holding the nth Element node of this - * fragment, or an empty fragment if there is no nth node of this - * fragment. Skips Nodes that are not Elements (e.g. Text and Comment - * nodes). - */ - DOMFragment.prototype.eq = function (n) { - return new DOMFragment(this.nthElement(n)); - }; - /** - * Return a new fragment beginning with the nth Element node of this - * fragment, and ending with the same end as this fragment, or an - * empty fragment if there is no nth node in this fragment. Skips - * Nodes that are not Elements (e.g. Text and Comment nodes). - */ - DOMFragment.prototype.slice = function (n) { - // Note, would be reasonable to extend this to take a second - // argument if we ever find we need this - if (!this.ends) return this; - var el = this.nthElement(n); - if (!el) return new DOMFragment(); - return new DOMFragment(el, this.ends[R]); - }; - /** - * Return a new fragment containing the next Element after the Node - * represented by this fragment, or an empty fragment if there is no - * next Element. Skips Nodes that are not Elements (e.g. Text and - * Comment nodes). - * - * Asserts that this fragment contains exactly one Node. - */ - DOMFragment.prototype.next = function () { - var current = this.oneNode(); - while (current) { - current = current.nextSibling; - if (current && current.nodeType === Node.ELEMENT_NODE) return new DOMFragment(current); - } - return new DOMFragment(); - }; - /** - * Return a new fragment containing the previousElement after the Node - * represented by this fragment, or an empty fragment if there is no - * previous Element. Skips Nodes that are not Elements (e.g. Text and - * Comment nodes). - * - * Asserts that this fragment contains exactly one Node. - */ - DOMFragment.prototype.prev = function () { - var current = this.oneNode(); - while (current) { - current = current.previousSibling; - if (current && current.nodeType === Node.ELEMENT_NODE) return new DOMFragment(current); - } - return new DOMFragment(); - }; - /** - * Remove all children of every Element Node in the fragment. Skips - * Nodes that are not Elements (e.g. Text and Comment nodes). - */ - DOMFragment.prototype.empty = function () { - // TODO the corresponding jQuery methods clean up some internal - // references before removing elements from the DOM. That won't - // matter once jQuery is totally gone, but until then, this may - // introduce memory leaks - this.eachElement(function (el) { - el.textContent = ''; - }); - return this; - }; - /** - * Remove every node in the fragment from the DOM. - * - * Implemented by moving every node in the fragment into a new - * document fragment in order to preserve the sibling relationships - * of the removed element. If you want to get access to this document - * fragment, use `.toDocumentFragment()` instead. - */ - DOMFragment.prototype.remove = function () { - // TODO the corresponding jQuery methods clean up some internal - // references before removing elements from the DOM. That won't - // matter once jQuery is totally gone, but until then, this may - // introduce memory leaks - // Note, removing the elements by moving them to a document fragment - // because this way their sibling references stay intact. This is - // important if we want to reattach them somewhere else later - this.toDocumentFragment(); - return this; - }; - /** - * Remove every node in the fragment from the DOM. Alias of remove. - * - * Implemented by moving every node in the fragment into a new - * document fragment in order to preserve the sibling relationships - * of the removed element. If you want to get access to this document - * fragment, use `.toDocumentFragment()` instead. - * - * Note: jQuery makes a distinction between detach() and remove(). - * remove() cleans up internal references, and detach() does not. - */ - DOMFragment.prototype.detach = function () { - // In jQuery, detach() is similar to remove() but it does not clean - // up internal references. Here they're aliases, but I'm leaving - // this as a separate method for the moment to keep track of where - // mathquill did one vs the other. - return this.remove(); - }; - /** - * Insert this fragment either just before or just after `sibling` - * fragment according to the direction specified by `dir`. If - * `sibling` is empty or does not have a parent node, detaches this - * fragment from the document. - */ - DOMFragment.prototype.insDirOf = function (dir, sibling) { - var _a; - if (!this.ends) return this; - var el = (_a = sibling.ends) === null || _a === void 0 ? void 0 : _a[dir]; - if (!el || !el.parentNode) return this.detach(); - _insDirOf(dir, el.parentNode, this.toDocumentFragment(), el); - return this; - }; - /** - * Insert this fragment into `el` either at the beginning or end of - * its children, according to the direction specified by `dir`. - */ - DOMFragment.prototype.insAtDirEnd = function (dir, el) { - if (!this.ends) return this; - _insAtDirEnd(dir, this.toDocumentFragment(), el); - return this; - }; - /** - * Return true if any element in this fragment has class `className` - * and false otherwise. - */ - DOMFragment.prototype.hasClass = function (className) { - var out = false; - this.eachElement(function (el) { - if (el.classList.contains(className)) out = true; - }); - return out; - }; - /** - * Add each class in space separated list of classes given by - * `classNames` to each element in this fragment. - */ - DOMFragment.prototype.addClass = function (classNames) { - var _loop_1 = function (className) { - if (!className) return 'continue'; - this_1.eachElement(function (el) { - el.classList.add(className); - }); - }; - var this_1 = this; - for (var _i = 0, _a = classNames.split(/\s+/); _i < _a.length; _i++) { - var className = _a[_i]; - _loop_1(className); - } - return this; - }; - /** - * Remove each class in space separated list of classes given by - * `classNames` from each element in this fragment. - */ - DOMFragment.prototype.removeClass = function (classNames) { - var _loop_2 = function (className) { - if (!className) return 'continue'; - this_2.eachElement(function (el) { - el.classList.remove(className); - }); - }; - var this_2 = this; - for (var _i = 0, _a = classNames.split(/\s+/); _i < _a.length; _i++) { - var className = _a[_i]; - _loop_2(className); - } - return this; - }; - /** - * Toggle each class in space separated list of classes given by - * `classNames` on each element in this fragment. - * - * If second arg `on` is given as `true`, always toggle classes on. - * If second arg `on` is passed as `false`, always toggle classes off. - */ - DOMFragment.prototype.toggleClass = function (classNames, on) { - if (on === true) return this.addClass(classNames); - if (on === false) return this.removeClass(classNames); - var _loop_3 = function (className) { - if (!className) return 'continue'; - this_3.eachElement(function (el) { - el.classList.toggle(className); - }); - }; - var this_3 = this; - for (var _i = 0, _a = classNames.split(/\s+/); _i < _a.length; _i++) { - var className = _a[_i]; - _loop_3(className); - } - return this; - }; - return DOMFragment; - })(); - var domFrag = DOMFragment.create; - /** - * Insert `source` before or after `target` child of `parent` denending - * on `dir`. Only intended to be used internally as a helper in this module - */ - function _insDirOf(dir, parent, source, target) { - parent.insertBefore(source, dir === L ? target : target.nextSibling); - } - /** - * Insert `source` before or after `target` child of `parent` denending - * on `dir`. Only intended to be used internally as a helper in this module - */ - function _insAtDirEnd(dir, source, parent) { - if (dir === L) { - parent.insertBefore(source, parent.firstChild); - } else { - parent.appendChild(source); - } - } - /************************************************* - * Base classes of edit tree-related objects - * - * Only doing tree node manipulation via these - * adopt/ disown methods guarantees well-formedness - * of the tree. - ************************************************/ - /** A cursor-like location in an mq node tree. */ - var Point = /** @class */ (function () { - function Point(parent, leftward, rightward) { - this.init(parent, leftward, rightward); - } - // keeping init around only for tests - Point.prototype.init = function (parent, leftward, rightward) { - this.parent = parent; - this[L] = leftward; - this[R] = rightward; - }; - Point.copy = function (pt) { - return new Point(pt.parent, pt[L], pt[R]); - }; - return Point; - })(); - function eachNode(ends, yield_) { - var el = ends[L]; - if (!el) return; - var stop = ends[R]; - if (!stop) return; //shouldn't happen because ends[L] is defined; - stop = stop[R]; - // TODO - this cast as MQNode is actually important to keep tests passing. I went to - // fix this code to gracefully handle an undefined el and there are tests that actually - // verify that this will throw an error. So I'm keeping the behavior but ignoring the - // type error. - for (; el !== stop; el = el[R]) { - var result = yield_(el); // TODO - might be passing in 0 intead of a MQNode, but tests want this - if (result === false) break; - } - } - function foldNodes(ends, fold, yield_) { - var el = ends[L]; - if (!el) return fold; - var stop = ends[R]; - if (!stop) return fold; //shouldn't happen because ends[L] is defined; - stop = stop[R]; - // TODO - this cast as MQNode is actually important to keep tests passing. I went to - // fix this code to gracefully handle an undefined el and there are tests that actually - // verify that this will throw an error. So I'm keeping the behavior but ignoring the - // type error. - for (; el !== stop; el = el[R]) { - fold = yield_(fold, el); // TODO - might be passing in 0 intead of a MQNode, but tests want this - } - return fold; - } - var NodeBase = /** @class */ (function () { - function NodeBase() { - var _c; - // TODO - life would be so much better in typescript of these were undefined instead of - // 0. The ! would save us in cases where we know a node is defined. - this[_a] = 0; - this[_b] = 0; - // TODO - can this ever actually stay 0? if so we need to add null checks - this.parent = 0; - /** - * The (doubly-linked) list of this node's children. - * - * NOTE child classes may specify a narrower type for ends e.g. to - * enforce that children are not empty, or that they have a certain - * type. In those cases, this initializer may still run at - * construction time, but this is expected to be followed by a call - * to adopt that sets non-empty ends of the necessary types. - * - * Similarly, `Fragment::disown` may temporarily break non-empty - * invariants, which are expected to be restored by a subsequent call - * to `Fragment::adopt`. - * */ - this.ends = ((_c = {}), (_c[L] = 0), (_c[R] = 0), _c); - this.id = NodeBase.uniqueNodeId(); - } - NodeBase.uniqueNodeId = function () { - return (NodeBase.idCounter += 1); - }; - // The mqBlockNode and mqCmdNode custom properties link back from the - // DOM nodes generated by MathQuill to the MQNodes that generated - // them. This is useful for looking up MQNodes in event handlers and - // in the mq(elt) public API method - NodeBase.getNodeOfElement = function (el) { - if (!el) return; - if (!el.nodeType) throw new Error('must pass an Element to NodeBase.getNodeOfElement'); - var elTrackingNode = el; - return elTrackingNode.mqBlockNode || elTrackingNode.mqCmdNode; - }; - NodeBase.linkElementByBlockNode = function (elm, blockNode) { - elm.mqBlockNode = blockNode; - }; - NodeBase.linkElementByCmdNode = function (elm, cmdNode) { - elm.mqCmdNode = cmdNode; - }; - NodeBase.prototype.setEnds = function (ends) { - this.ends = ends; - pray('No half-empty node ends', !!this.ends[L] === !!this.ends[R]); - }; - NodeBase.prototype.getEnd = function (dir) { - return this.ends[dir]; - }; - NodeBase.prototype.toString = function () { - return '{{ MathQuill Node #' + this.id + ' }}'; - }; - NodeBase.prototype.setDOM = function (el) { - if (el) { - pray( - 'DOM is an element or a text node', - el.nodeType === Node.ELEMENT_NODE || el.nodeType === Node.TEXT_NODE - ); - } - this._el = el; - return this; - }; - NodeBase.prototype.domFrag = function () { - return domFrag(this._el); - }; - NodeBase.prototype.createDir = function (dir, cursor) { - prayDirection(dir); - var node = this; - node.html(); - node.domFrag().insDirOf(dir, cursor.domFrag()); - cursor[dir] = node.adopt(cursor.parent, cursor[L], cursor[R]); // TODO - assuming not undefined, could be 0 - return node; - }; - NodeBase.prototype.createLeftOf = function (cursor) { - this.createDir(L, cursor); - }; - NodeBase.prototype.selectChildren = function (leftEnd, rightEnd) { - return new MQSelection(leftEnd, rightEnd); - }; - NodeBase.prototype.bubble = function (yield_) { - var self = this.getSelfNode(); - for (var ancestor = self; ancestor; ancestor = ancestor.parent) { - var result = yield_(ancestor); - if (result === false) break; - } - return this; - }; - NodeBase.prototype.postOrder = function (yield_) { - var self = this.getSelfNode(); - (function recurse(descendant) { - if (!descendant) return false; - descendant.eachChild(recurse); - yield_(descendant); - return true; - })(self); - return self; - }; - NodeBase.prototype.isEmpty = function () { - return this.ends[L] === 0 && this.ends[R] === 0; - }; - NodeBase.prototype.isQuietEmptyDelimiter = function (dlms) { - if (!this.isEmpty()) return false; - if (!dlms) return false; - if (!this.parent || this.parent.ctrlSeq === undefined) return false; - // Remove any leading \left or \right from the ctrl sequence before looking it up. - var key = this.parent.ctrlSeq.replace(/^\\(left|right)?/, ''); - return dlms.hasOwnProperty(key); - }; - NodeBase.prototype.isStyleBlock = function () { - return false; - }; - NodeBase.prototype.isTextBlock = function () { - return false; - }; - NodeBase.prototype.children = function () { - return new Fragment(this.getEnd(L), this.getEnd(R)); - }; - NodeBase.prototype.eachChild = function (yield_) { - eachNode(this.ends, yield_); - return this; - }; - NodeBase.prototype.foldChildren = function (fold, yield_) { - return foldNodes(this.ends, fold, yield_); - }; - NodeBase.prototype.withDirAdopt = function (dir, parent, withDir, oppDir) { - var self = this.getSelfNode(); - new Fragment(self, self).withDirAdopt(dir, parent, withDir, oppDir); - return this; - }; - /** - * Add this node to the given parent node's children, at the position between the adjacent - * children `leftward` (or the beginning if omitted) and `rightward` (or the end if omitted). - * See `Fragment#adopt()` - */ - NodeBase.prototype.adopt = function (parent, leftward, rightward) { - var self = this.getSelfNode(); - new Fragment(self, self).adopt(parent, leftward, rightward); - return this.getSelfNode(); - }; - NodeBase.prototype.disown = function () { - var self = this.getSelfNode(); - new Fragment(self, self).disown(); - return this; - }; - NodeBase.prototype.remove = function () { - this.domFrag().remove(); - return this.disown(); - }; - NodeBase.prototype.shouldIgnoreSubstitutionInSimpleSubscript = function (options) { - if (!options.disableAutoSubstitutionInSubscripts) return false; - if (!this.parent) return false; - if (!(this.parent.parent instanceof SupSub)) return false; - // Mathquill is gross. There are many different paths that - // create subscripts and sometimes we don't even construct - // true instances of `LatexCmds._`. Another problem is that - // the relationship between the sub and the SupSub isn't - // completely setup during a paste at the time we check - // this. I wanted to use: `this.parent.parent.sub !== this.parent` - // but that check doesn't always work. This seems to be the only - // check that always works. I'd rather live with this than try - // to change the init order of things. - if (!this.parent.domFrag().hasClass('dcg-mq-sub')) return false; - return true; - }; - NodeBase.prototype.getSelfNode = function () { - // dumb dance to tell typescript that we eventually become a MQNode - return this; - }; - // Overridden by child classes - NodeBase.prototype.parser = function () { - pray('Abstract parser() method is never called', false); - }; - /** Render this node to DOM */ - NodeBase.prototype.html = function () { - throw new Error('html() unimplemented in NodeBase'); - }; - NodeBase.prototype.text = function () { - return ''; - }; - NodeBase.prototype.latex = function () { - var ctx = { latex: '', startIndex: -1, endIndex: -1 }; - this.latexRecursive(ctx); - return ctx.latex; - }; - NodeBase.prototype.latexRecursive = function (_ctx) {}; - NodeBase.prototype.checkCursorContextOpen = function (ctx) { - if (ctx.startSelectionBefore === this) { - ctx.startIndex = ctx.latex.length; - } - if (ctx.endSelectionBefore === this) { - ctx.endIndex = ctx.latex.length; - } - }; - NodeBase.prototype.checkCursorContextClose = function (ctx) { - if (ctx.startSelectionAfter === this) { - ctx.startIndex = ctx.latex.length; - } - if (ctx.endSelectionAfter === this) { - ctx.endIndex = ctx.latex.length; - } - }; - NodeBase.prototype.finalizeTree = function (_options, _dir) {}; - NodeBase.prototype.contactWeld = function (_cursor, _dir) {}; - NodeBase.prototype.blur = function (_cursor) {}; - NodeBase.prototype.focus = function () {}; - NodeBase.prototype.intentionalBlur = function () {}; - NodeBase.prototype.reflow = function () {}; - NodeBase.prototype.registerInnerField = function (_innerFields, _mathField) {}; - NodeBase.prototype.chToCmd = function (_ch, _options) { - pray('Abstract chToCmd() method is never called', false); - }; - NodeBase.prototype.mathspeak = function (_options) { - return ''; - }; - NodeBase.prototype.seek = function (_clientX, _cursor) {}; - NodeBase.prototype.siblingDeleted = function (_options, _dir) {}; - NodeBase.prototype.siblingCreated = function (_options, _dir) {}; - NodeBase.prototype.finalizeInsert = function (_options, _cursor) {}; - NodeBase.prototype.fixDigitGrouping = function (_opts) {}; - NodeBase.prototype.writeLatex = function (_cursor, _latex) {}; - NodeBase.prototype.write = function (_cursor, _ch) {}; - var _a, _b; - (_a = L), (_b = R); - NodeBase.idCounter = 0; - return NodeBase; - })(); - function prayWellFormed(parent, leftward, rightward) { - pray('a parent is always present', parent); - pray( - 'leftward is properly set up', - (function () { - // either it's empty and `rightward` is the left end child (possibly empty) - if (!leftward) return parent.getEnd(L) === rightward; - // or it's there and its [R] and .parent are properly set up - return leftward[R] === rightward && leftward.parent === parent; - })() - ); - pray( - 'rightward is properly set up', - (function () { - // either it's empty and `leftward` is the right end child (possibly empty) - if (!rightward) return parent.getEnd(R) === leftward; - // or it's there and its [L] and .parent are properly set up - return rightward[L] === leftward && rightward.parent === parent; - })() - ); - } - /** - * An entity outside the virtual tree with one-way pointers (so it's only a - * "view" of part of the tree, not an actual node/entity in the tree) that - * delimits a doubly-linked list of sibling nodes. - * It's like a fanfic love-child between HTML DOM DocumentFragment and the Range - * classes: like DocumentFragment, its contents must be sibling nodes - * (unlike Range, whose contents are arbitrary contiguous pieces of subtrees), - * but like Range, it has only one-way pointers to its contents, its contents - * have no reference to it and in fact may still be in the visible tree (unlike - * DocumentFragment, whose contents must be detached from the visible tree - * and have their 'parent' pointers set to the DocumentFragment). - */ - var Fragment = /** @class */ (function () { - function Fragment(withDir, oppDir, dir) { - var _c, _d; - this.disowned = false; - if (dir === undefined) dir = L; - prayDirection(dir); - pray('no half-empty fragments', !withDir === !oppDir); - if (!withDir || !oppDir) { - this.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); - return; - } - pray('withDir is passed to Fragment', withDir instanceof MQNode); - pray('oppDir is passed to Fragment', oppDir instanceof MQNode); - pray('withDir and oppDir have the same parent', withDir.parent === oppDir.parent); - var ends = ((_d = {}), (_d[dir] = withDir), (_d[-dir] = oppDir), _d); - this.setEnds(ends); - var maybeRightEnd = 0; - this.each(function (el) { - maybeRightEnd = el; - }); - pray('following direction siblings from start reaches end', maybeRightEnd === ends[R]); - } - Fragment.prototype.getDOMFragFromEnds = function () { - var left = this.ends[L]; - var right = this.ends[R]; - if (left === 0 || right === 0) { - return domFrag(); - } else if (left === right) { - // Note, joining a DOMFragment to itself is not allowed, so - // don't attempt to join the end fragments if the ends are equal - return left.domFrag(); - } else { - return left.domFrag().join(right.domFrag()); - } - }; - /** - * Note, children may override this to enforce extra invariants, - * (e.g. that ends are always defined). Ends should only be set - * through this function. - */ - Fragment.prototype.setEnds = function (ends) { - this.ends = ends; - }; - Fragment.prototype.getEnd = function (dir) { - return this.ends ? this.ends[dir] : 0; - }; - Fragment.prototype.domFrag = function () { - return this.getDOMFragFromEnds(); - }; - // like Cursor::withDirInsertAt(dir, parent, withDir, oppDir) - Fragment.prototype.withDirAdopt = function (dir, parent, withDir, oppDir) { - return dir === L ? this.adopt(parent, withDir, oppDir) : this.adopt(parent, oppDir, withDir); - }; - /** - * Splice this fragment into the given parent node's children, at the position between the adjacent - * children `leftward` (or the beginning if omitted) and `rightward` (or the end if omitted). - * - * TODO: why do we need both leftward and rightward? It seems to me that `rightward` is always expected to be `leftward ? leftward[R] : parent.ends[L]`. - */ - Fragment.prototype.adopt = function (parent, leftward, rightward) { - var _c; - prayWellFormed(parent, leftward, rightward); - var self = this; - this.disowned = false; - var leftEnd = self.ends[L]; - if (!leftEnd) return this; - var rightEnd = self.ends[R]; - if (!rightEnd) return this; - var ends = ((_c = {}), (_c[L] = parent.getEnd(L)), (_c[R] = parent.getEnd(R)), _c); - if (leftward) { - // NB: this is handled in the ::each() block - // leftward[R] = leftEnd - } else { - ends[L] = leftEnd; - } - if (rightward) { - rightward[L] = rightEnd; - } else { - ends[R] = rightEnd; - } - parent.setEnds(ends); - rightEnd[R] = rightward; - self.each(function (el) { - el[L] = leftward; - el.parent = parent; - if (leftward) leftward[R] = el; - leftward = el; - return true; - }); - return self; - }; - /** - * Remove the nodes in this fragment from their parent. - */ - Fragment.prototype.disown = function () { - var _c; - var self = this; - var leftEnd = self.ends[L]; - // guard for empty and already-disowned fragments - if (!leftEnd || self.disowned) return self; - this.disowned = true; - var rightEnd = self.ends[R]; - if (!rightEnd) return self; - var parent = leftEnd.parent; - prayWellFormed(parent, leftEnd[L], leftEnd); - prayWellFormed(parent, rightEnd, rightEnd[R]); - var ends = ((_c = {}), (_c[L] = parent.getEnd(L)), (_c[R] = parent.getEnd(R)), _c); - if (leftEnd[L]) { - var leftLeftEnd = leftEnd[L]; - leftLeftEnd[R] = rightEnd[R]; - } else { - ends[L] = rightEnd[R]; - } - if (rightEnd[R]) { - var rightRightEnd = rightEnd[R]; - rightRightEnd[L] = leftEnd[L]; - } else { - ends[R] = leftEnd[L]; - } - if (ends[L] && ends[R]) { - parent.setEnds(ends); - } else { - // some child classes of MQNode try to enforce that their ends - // are never empty through the type system. However, disown may - // temporarily break this invariant in which case it's expected - // that adopt will later be called to fix the invariant. - // - // Cast away the protected status of the ends property and write - // to it directly to get around runtime assertions in setEnds that - // enforce non-emptyness. - parent.ends = ends; - } - return self; - }; - Fragment.prototype.remove = function () { - this.domFrag().remove(); - return this.disown(); - }; - Fragment.prototype.each = function (yield_) { - eachNode(this.ends, yield_); - return this; - }; - Fragment.prototype.fold = function (fold, yield_) { - return foldNodes(this.ends, fold, yield_); - }; - return Fragment; - })(); - /** - * Registry of LaTeX commands and commands created when typing - * a single character. - * - * (Commands are all subclasses of Node.) - */ - var LatexCmds = {}; - var CharCmds = {}; - function isMQNodeClass(cmd) { - return cmd && cmd.prototype instanceof MQNode; - } - /******************************************** - * Cursor and Selection "singleton" classes - *******************************************/ - /* The main thing that manipulates the Math DOM. Makes sure to manipulate the - HTML DOM to match. */ - /* Sort of singletons, since there should only be one per editable math - textbox, but any one HTML document can contain many such textboxes, so any one - JS environment could actually contain many instances. */ - //A fake cursor in the fake textbox that the math is rendered in. - var Anticursor = /** @class */ (function (_super) { - __extends(Anticursor, _super); - function Anticursor(parent, leftward, rightward) { - var _this_1 = _super.call(this, parent, leftward, rightward) || this; - _this_1.ancestors = {}; - return _this_1; - } - Anticursor.fromCursor = function (cursor) { - return new Anticursor(cursor.parent, cursor[L], cursor[R]); - }; - return Anticursor; - })(Point); - var Cursor = /** @class */ (function (_super) { - __extends(Cursor, _super); - function Cursor(initParent, options, controller) { - var _this_1 = _super.call(this, initParent, 0, 0) || this; - /** Slightly more than just a "cache", this remembers the cursor's position in each block node, so that we can return to the right - * point in that node when moving up and down among blocks. - */ - _this_1.upDownCache = {}; - _this_1.cursorElement = h('span', { class: 'dcg-mq-cursor' }, [h.text(U_ZERO_WIDTH_SPACE)]); - _this_1._domFrag = domFrag(); - _this_1.controller = controller; - _this_1.options = options; - _this_1.setDOMFrag(domFrag(_this_1.cursorElement)); - //closured for setInterval - _this_1.blink = function () { - domFrag(_this_1.cursorElement).toggleClass('dcg-mq-blink'); - }; - return _this_1; - } - Cursor.prototype.setDOMFrag = function (frag) { - this._domFrag = frag; - return this; - }; - Cursor.prototype.domFrag = function () { - return this._domFrag; - }; - Cursor.prototype.show = function () { - domFrag(this.cursorElement).removeClass('dcg-mq-blink'); - this.setDOMFrag(domFrag(this.cursorElement)); - if (this.intervalId) - //already was shown, just restart interval - clearInterval(this.intervalId); - else { - //was hidden and detached, insert this.jQ back into HTML DOM - var right = this[R]; - if (right) { - var selection = this.selection; - if (selection && selection.getEnd(L)[L] === this[L]) - this.domFrag().insertBefore(selection.domFrag()); - else this.domFrag().insertBefore(right.domFrag()); - } else this.domFrag().appendTo(this.parent.domFrag().oneElement()); - this.parent.focus(); - } - this.intervalId = setInterval(this.blink, 500); - return this; - }; - Cursor.prototype.hide = function () { - if (this.intervalId) clearInterval(this.intervalId); - this.intervalId = 0; - this.domFrag().detach(); - this.setDOMFrag(domFrag()); - return this; - }; - Cursor.prototype.withDirInsertAt = function (dir, parent, withDir, oppDir) { - var oldParent = this.parent; - this.parent = parent; - this[dir] = withDir; - this[-dir] = oppDir; - // by contract, .blur() is called after all has been said and done - // and the cursor has actually been moved - // FIXME pass cursor to .blur() so text can fix cursor pointers when removing itself - if (oldParent !== parent && oldParent.blur) oldParent.blur(this); - }; - /** Place the cursor before or after `el`, according the side specified by `dir`. */ - Cursor.prototype.insDirOf = function (dir, el) { - prayDirection(dir); - this.domFrag().insDirOf(dir, el.domFrag()); - this.withDirInsertAt(dir, el.parent, el[dir], el); - this.parent.domFrag().addClass('dcg-mq-hasCursor'); - return this; - }; - Cursor.prototype.insLeftOf = function (el) { - return this.insDirOf(L, el); - }; - Cursor.prototype.insRightOf = function (el) { - return this.insDirOf(R, el); - }; - /** Place the cursor inside `el` at either the left or right end, according the side specified by `dir`. */ - Cursor.prototype.insAtDirEnd = function (dir, el) { - prayDirection(dir); - this.domFrag().insAtDirEnd(dir, el.domFrag().oneElement()); - this.withDirInsertAt(dir, el, 0, el.getEnd(dir)); - el.focus(); - return this; - }; - Cursor.prototype.insAtLeftEnd = function (el) { - return this.insAtDirEnd(L, el); - }; - Cursor.prototype.insAtRightEnd = function (el) { - return this.insAtDirEnd(R, el); - }; - /** - * jump up or down from one block Node to another: - * - cache the current Point in the node we're jumping from - * - check if there's a Point in it cached for the node we're jumping to - * + if so put the cursor there, - * + if not seek a position in the node that is horizontally closest to - * the cursor's current position - */ - Cursor.prototype.jumpUpDown = function (from, to) { - var self = this; - self.upDownCache[from.id] = Point.copy(self); - var cached = self.upDownCache[to.id]; - if (cached) { - var cachedR = cached[R]; - if (cachedR) { - self.insLeftOf(cachedR); - } else { - self.insAtRightEnd(cached.parent); - } - } else { - var clientX = self.getBoundingClientRectWithoutMargin().left; - to.seek(clientX, self); - } - self.controller.aria.queue(to, true); - }; - Cursor.prototype.getBoundingClientRectWithoutMargin = function () { - //in Opera 11.62, .getBoundingClientRect() and hence jQuery::offset() - //returns all 0's on inline elements with negative margin-right (like - //the cursor) at the end of their parent, so temporarily remove the - //negative margin-right when calling jQuery::offset() - //Opera bug DSK-360043 - //http://bugs.jquery.com/ticket/11523 - //https://github.com/jquery/jquery/pull/717 - var frag = this.domFrag(); - frag.removeClass('dcg-mq-cursor'); - var _c = getBoundingClientRect(frag.oneElement()), - left = _c.left, - right = _c.right; - frag.addClass('dcg-mq-cursor'); - return { - left: left, - right: right, - }; - }; - Cursor.prototype.unwrapGramp = function () { - var gramp = this.parent.parent; - var greatgramp = gramp.parent; - var rightward = gramp[R]; - var cursor = this; - var leftward = gramp[L]; - gramp.disown().eachChild(function (uncle) { - if (uncle.isEmpty()) return true; - uncle - .children() - .adopt(greatgramp, leftward, rightward) - .each(function (cousin) { - cousin.domFrag().insertBefore(gramp.domFrag()); - return true; - }); - leftward = uncle.getEnd(R); - return true; - }); - if (!this[R]) { - //then find something to be rightward to insLeftOf - var thisL = this[L]; - if (thisL) this[R] = thisL[R]; - else { - while (!this[R]) { - var newParent = this.parent[R]; - if (newParent) { - this.parent = newParent; - this[R] = newParent.getEnd(L); - } else { - this[R] = gramp[R]; - this.parent = greatgramp; - break; - } - } - } - } - var thisR = this[R]; - if (thisR) this.insLeftOf(thisR); - else this.insAtRightEnd(greatgramp); - gramp.domFrag().remove(); - var grampL = gramp[L]; - var grampR = gramp[R]; - if (grampL) grampL.siblingDeleted(cursor.options, R); - if (grampR) grampR.siblingDeleted(cursor.options, L); - }; - Cursor.prototype.startSelection = function () { - var anticursor = (this.anticursor = Anticursor.fromCursor(this)); - var ancestors = anticursor.ancestors; - for (var ancestor = anticursor; ancestor.parent; ancestor = ancestor.parent) { - ancestors[ancestor.parent.id] = ancestor; - } - }; - Cursor.prototype.endSelection = function () { - delete this.anticursor; - }; - Cursor.prototype.select = function () { - var _lca; - var anticursor = this.anticursor; - if (this[L] === anticursor[L] && this.parent === anticursor.parent) return false; - // Find the lowest common ancestor (`lca`), and the ancestor of the cursor - // whose parent is the LCA (which'll be an end of the selection fragment). - for (var ancestor = this; ancestor.parent; ancestor = ancestor.parent) { - if (ancestor.parent.id in anticursor.ancestors) { - _lca = ancestor.parent; - break; - } - } - pray('cursor and anticursor in the same tree', _lca); - var lca = _lca; - // The cursor and the anticursor should be in the same tree, because the - // mousemove handler attached to the document, unlike the one attached to - // the root HTML DOM element, doesn't try to get the math tree node of the - // mousemove target, and Cursor::seek() based solely on coordinates stays - // within the tree of `this` cursor's root. - // The other end of the selection fragment, the ancestor of the anticursor - // whose parent is the LCA. - var antiAncestor = anticursor.ancestors[lca.id]; - // Now we have two either Nodes or Points, guaranteed to have a common - // parent and guaranteed that if both are Points, they are not the same, - // and we have to figure out which is the left end and which the right end - // of the selection. - var leftEnd, - rightEnd, - dir = R; - // This is an extremely subtle algorithm. - // As a special case, `ancestor` could be a Point and `antiAncestor` a Node - // immediately to `ancestor`'s left. - // In all other cases, - // - both Nodes - // - `ancestor` a Point and `antiAncestor` a Node - // - `ancestor` a Node and `antiAncestor` a Point - // `antiAncestor[R] === rightward[R]` for some `rightward` that is - // `ancestor` or to its right, if and only if `antiAncestor` is to - // the right of `ancestor`. - if (ancestor[L] !== antiAncestor) { - for (var rightward = ancestor; rightward; rightward = rightward[R]) { - if (rightward[R] === antiAncestor[R]) { - dir = L; - leftEnd = ancestor; - rightEnd = antiAncestor; - break; - } - } - } - if (dir === R) { - leftEnd = antiAncestor; - rightEnd = ancestor; - } - // only want to select Nodes up to Points, can't select Points themselves - if (leftEnd instanceof Point) leftEnd = leftEnd[R]; - if (rightEnd instanceof Point) rightEnd = rightEnd[L]; - this.hide().selection = lca.selectChildren(leftEnd, rightEnd); - var insEl = this.selection.getEnd(dir); - this.insDirOf(dir, insEl); - this.selectionChanged(); - return true; - }; - Cursor.prototype.resetToEnd = function (controller) { - this.clearSelection(); - var root = controller.root; - this[R] = 0; - this[L] = root.getEnd(R); - this.parent = root; - }; - Cursor.prototype.clearSelection = function () { - if (this.selection) { - this.selection.clear(); - delete this.selection; - this.selectionChanged(); - } - return this; - }; - Cursor.prototype.deleteSelection = function () { - var selection = this.selection; - if (!selection) return; - this[L] = selection.getEnd(L)[L]; - this[R] = selection.getEnd(R)[R]; - selection.remove(); - this.selectionChanged(); - delete this.selection; - }; - Cursor.prototype.replaceSelection = function () { - var seln = this.selection; - if (seln) { - this[L] = seln.getEnd(L)[L]; - this[R] = seln.getEnd(R)[R]; - delete this.selection; - } - return seln; - }; - Cursor.prototype.depth = function () { - var node = this; - var depth = 0; - while ((node = node.parent)) { - depth += node instanceof MathBlock ? 1 : 0; - } - return depth; - }; - Cursor.prototype.isTooDeep = function (offset) { - if (this.options.maxDepth !== undefined) { - return this.depth() + (offset || 0) > this.options.maxDepth; - } else { - return false; - } - }; - // can be overridden - Cursor.prototype.selectionChanged = function () {}; - return Cursor; - })(Point); - var MQSelection = /** @class */ (function (_super) { - __extends(MQSelection, _super); - function MQSelection(withDir, oppDir, dir) { - var _this_1 = _super.call(this, withDir, oppDir, dir) || this; - _this_1._el = h('span', { class: 'dcg-mq-selection' }); - _this_1.getDOMFragFromEnds().wrapAll(_this_1._el); - return _this_1; - } - MQSelection.prototype.isCleared = function () { - return this._el === undefined; - }; - MQSelection.prototype.domFrag = function () { - return this.isCleared() ? this.getDOMFragFromEnds() : domFrag(this._el); - }; - MQSelection.prototype.setEnds = function (ends) { - pray('Selection ends are never empty', ends[L] && ends[R]); - this.ends = ends; - }; - MQSelection.prototype.getEnd = function (dir) { - return this.ends[dir]; - }; - MQSelection.prototype.adopt = function (parent, leftward, rightward) { - this.clear(); - return _super.prototype.adopt.call(this, parent, leftward, rightward); - }; - MQSelection.prototype.clear = function () { - // NOTE it's important here that DOMFragment::children includes all - // child nodes (including Text nodes), and not just Element nodes. - // This makes it more similar to the native DOM childNodes property - // and jQuery's .collection() method than jQuery's .children() method - var childFrag = this.getDOMFragFromEnds(); - this.domFrag().replaceWith(childFrag); - this._el = undefined; - return this; - }; - MQSelection.prototype.join = function (methodName, separator) { - if (separator === void 0) { - separator = ''; - } - return this.fold('', function (fold, child) { - return fold + separator + child[methodName](); - }); - }; - return MQSelection; - })(Fragment); - var ControllerBase = /** @class */ (function () { - function ControllerBase(root, container, options) { - this.textareaEventListeners = {}; - this.id = root.id; - this.data = {}; - this.root = root; - this.container = container; - this.options = options; - this.aria = new Aria(this.getControllerSelf()); - this.ariaLabel = 'Math Input'; - this.ariaPostLabel = ''; - root.controller = this.getControllerSelf(); - this.cursor = root.cursor = new Cursor(root, options, this.getControllerSelf()); - // TODO: stop depending on root.cursor, and rm it - } - ControllerBase.prototype.getControllerSelf = function () { - // dance we have to do to tell this thing it's a full controller - return this; - }; - ControllerBase.prototype.handle = function (name, dir) { - var _c; - var handlers = this.options.handlers; - var handler = (_c = this.options.handlers) === null || _c === void 0 ? void 0 : _c.fns[name]; - if (handler) { - var APIClass = - handlers === null || handlers === void 0 ? void 0 : handlers.APIClasses[this.KIND_OF_MQ]; - pray('APIClass is defined', APIClass); - var mq = new APIClass(this); // cast to any bedcause APIClass needs the final Controller subclass. - if (dir === L || dir === R) handler(dir, mq); - else handler(mq); - } - }; - ControllerBase.onNotify = function (f) { - ControllerBase.notifyees.push(f); - }; - ControllerBase.prototype.notify = function (e) { - for (var i = 0; i < ControllerBase.notifyees.length; i += 1) { - ControllerBase.notifyees[i](this.cursor, e); - } - return this; - }; - ControllerBase.prototype.setAriaLabel = function (ariaLabel) { - var oldAriaLabel = this.getAriaLabel(); - if (ariaLabel && typeof ariaLabel === 'string' && ariaLabel !== '') { - this.ariaLabel = ariaLabel; - } else if (this.editable) { - this.ariaLabel = 'Math Input'; - } else { - this.ariaLabel = ''; - } - // If this field doesn't have focus, update its computed mathspeak value. - // We check for focus because updating the aria-label attribute of a focused element will cause most screen readers to announce the new value (in our case, label along with the expression's mathspeak). - // If the field does have focus at the time, it will be updated once a blur event occurs. - // Unless we stop using fake text inputs and emulating screen reader behavior, this is going to remain a problem. - if (this.ariaLabel !== oldAriaLabel && !this.containerHasFocus()) { - this.updateMathspeak(); - } - return this; - }; - ControllerBase.prototype.getAriaLabel = function () { - if (this.ariaLabel !== 'Math Input') { - return this.ariaLabel; - } else if (this.editable) { - return 'Math Input'; - } else { - return ''; - } - }; - ControllerBase.prototype.setAriaPostLabel = function (ariaPostLabel, timeout) { - var _this_1 = this; - if (ariaPostLabel && typeof ariaPostLabel === 'string' && ariaPostLabel !== '') { - if (ariaPostLabel !== this.ariaPostLabel && typeof timeout === 'number') { - if (this._ariaAlertTimeout) clearTimeout(this._ariaAlertTimeout); - this._ariaAlertTimeout = setTimeout(function () { - if (_this_1.containerHasFocus()) { - // Voice the new label, but do not update content mathspeak to prevent double-speech. - _this_1.aria.alert(_this_1.root.mathspeak().trim() + ' ' + ariaPostLabel.trim()); - } else { - // This mathquill does not have focus, so update its mathspeak. - _this_1.updateMathspeak(); - } - }, timeout); - } - this.ariaPostLabel = ariaPostLabel; - } else { - if (this._ariaAlertTimeout) clearTimeout(this._ariaAlertTimeout); - this.ariaPostLabel = ''; - } - return this; - }; - ControllerBase.prototype.getAriaPostLabel = function () { - return this.ariaPostLabel || ''; - }; - ControllerBase.prototype.containerHasFocus = function () { - return document.activeElement && this.container.contains(document.activeElement); - }; - ControllerBase.prototype.getTextareaOrThrow = function () { - var textarea = this.textarea; - if (!textarea) throw new Error('expected a textarea'); - return textarea; - }; - ControllerBase.prototype.getTextareaSpanOrThrow = function () { - var textareaSpan = this.textareaSpan; - if (!textareaSpan) throw new Error('expected a textareaSpan'); - return textareaSpan; - }; - /** Add the given event listeners on this.textarea, replacing the existing listener for that event if it exists. */ - ControllerBase.prototype.addTextareaEventListeners = function (listeners) { - if (!this.textarea) return; - for (var key_2 in listeners) { - var event = key_2; - this.removeTextareaEventListener(event); - this.textarea.addEventListener(event, listeners[event]); - } - }; - ControllerBase.prototype.removeTextareaEventListener = function (event) { - if (!this.textarea) return; - var listener = this.textareaEventListeners[event]; - if (!listener) return; - this.textarea.removeEventListener(event, listener); - }; - // based on http://www.gh-mathspeak.com/examples/quick-tutorial/ - // and http://www.gh-mathspeak.com/examples/grammar-rules/ - ControllerBase.prototype.exportMathSpeak = function () { - return this.root.mathspeak(); - }; - // overridden - ControllerBase.prototype.updateMathspeak = function () {}; - ControllerBase.prototype.scrollHoriz = function () {}; - ControllerBase.prototype.selectionChanged = function () {}; - ControllerBase.prototype.setOverflowClasses = function () {}; - ControllerBase.notifyees = []; - return ControllerBase; - })(); - var API = {}; - var EMBEDS = {}; - var processedOptions = { - handlers: true, - autoCommands: true, - quietEmptyDelimiters: true, - autoParenthesizedFunctions: true, - autoOperatorNames: true, - leftRightIntoCmdGoes: true, - maxDepth: true, - interpretTildeAsSim: true, - }; - var baseOptionProcessors = {}; - var Options = /** @class */ (function () { - function Options(version) { - this.version = version; - } - Options.prototype.assertJquery = function () { - pray('Interface versions > 2 do not depend on JQuery', this.version <= 2); - pray('JQuery is set for interface v < 3', this.jQuery); - return this.jQuery; - }; - return Options; - })(); - var Progenote = /** @class */ (function () { - function Progenote() {} - return Progenote; - })(); - /** - * Interface Versioning (#459, #495) to allow us to virtually guarantee - * backcompat. v0.10.x introduces it, so for now, don't completely break the - * API for people who don't know about it, just complain with console.warn(). - * - * The methods are shimmed in outro.js so that MQ.MathField.prototype etc can - * be accessed. - */ - var insistOnInterVer = function () { - if (window.console) - console.warn( - 'You are using the MathQuill API without specifying an interface version, ' + - 'which will fail in v1.0.0. Easiest fix is to do the following before ' + - 'doing anything else:\n' + - '\n' + - ' MathQuill = MathQuill.getInterface(1);\n' + - ' // now MathQuill.MathField() works like it used to\n' + - '\n' + - 'See also the "`dev` branch (2014\u20132015) \u2192 v0.10.0 Migration Guide" at\n' + - ' https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide' - ); - }; - // globally exported API object - var MQ1; - function MathQuill(el) { - insistOnInterVer(); - if (!MQ1) { - MQ1 = getInterface(1); - } - return MQ1(el); - } - MathQuill.prototype = Progenote.prototype; - MathQuill.VERSION = 'v0.10.1'; - MathQuill.interfaceVersion = function (v) { - // shim for #459-era interface versioning (ended with #495) - if (v !== 1) throw 'Only interface version 1 supported. You specified: ' + v; - insistOnInterVer = function () { - if (window.console) - console.warn( - 'You called MathQuill.interfaceVersion(1); to specify the interface ' + - 'version, which will fail in v1.0.0. You can fix this easily by doing ' + - 'this before doing anything else:\n' + - '\n' + - ' MathQuill = MathQuill.getInterface(1);\n' + - ' // now MathQuill.MathField() works like it used to\n' + - '\n' + - 'See also the "`dev` branch (2014\u20132015) \u2192 v0.10.0 Migration Guide" at\n' + - ' https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide' - ); - }; - insistOnInterVer(); - return MathQuill; - }; - MathQuill.getInterface = getInterface; - var MIN = (getInterface.MIN = 1), - MAX = (getInterface.MAX = 3); - function getInterface(v) { - if (v !== 1 && v !== 2 && v !== 3) - throw 'Only interface versions between ' + MIN + ' and ' + MAX + ' supported. You specified: ' + v; - var version = v; - if (version < 3) { - var jQuery = window.jQuery; - if (!jQuery) - throw 'MathQuill interface version '.concat(version, ' requires jQuery 1.5.2+ to be loaded first'); - Options.prototype.jQuery = jQuery; - } - var optionProcessors = __assign(__assign({}, baseOptionProcessors), { - handlers: function (handlers) { - return { - // casting to the v3 version of this type - fns: handlers || {}, - APIClasses: APIClasses, - }; - }, - }); - function config(currentOptions, newOptions) { - for (var name in newOptions) { - if (newOptions.hasOwnProperty(name)) { - if (name === 'substituteKeyboardEvents' && version >= 3) { - throw new Error( - [ - "As of interface version 3, the 'substituteKeyboardEvents'", - "option is no longer supported. Use 'overrideTypedText' and", - "'overrideKeystroke' instead.", - ].join(' ') - ); - } - var value = newOptions[name]; // TODO - think about typing this better - var processor = optionProcessors[name]; // TODO - validate option processors better - currentOptions[name] = processor ? processor(value) : value; // TODO - think about typing better - } - } - } - var BaseOptions = - version < 3 - ? Options - : /** @class */ (function (_super) { - __extends(BaseOptions, _super); - function BaseOptions() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - return BaseOptions; - })(Options); - var AbstractMathQuill = /** @class */ (function (_super) { - __extends(AbstractMathQuill, _super); - function AbstractMathQuill(ctrlr) { - var _this_1 = _super.call(this) || this; - _this_1.__controller = ctrlr; - _this_1.__options = ctrlr.options; - _this_1.id = ctrlr.id; - _this_1.data = ctrlr.data; - return _this_1; - } - AbstractMathQuill.prototype.mathquillify = function (classNames) { - var ctrlr = this.__controller, - root = ctrlr.root, - el = ctrlr.container; - ctrlr.createTextarea(); - var contents = domFrag(el).addClass(classNames).children().detach(); - root.setDOM( - domFrag(h('span', { class: 'dcg-mq-root-block', 'aria-hidden': true })) - .appendTo(el) - .oneElement() - ); - NodeBase.linkElementByBlockNode(root.domFrag().oneElement(), root); - this.latex(contents.text()); - this.revert = function () { - ctrlr.removeMouseEventListener(); - domFrag(el) - .removeClass('dcg-mq-editable-field dcg-mq-math-mode dcg-mq-text-mode') - .empty() - .append(contents); - return version < 3 ? this.__options.assertJquery()(el) : el; - }; - }; - AbstractMathQuill.prototype.setAriaLabel = function (ariaLabel) { - this.__controller.setAriaLabel(ariaLabel); - return this; - }; - AbstractMathQuill.prototype.getAriaLabel = function () { - return this.__controller.getAriaLabel(); - }; - AbstractMathQuill.prototype.config = function (opts) { - config(this.__options, opts); - return this; - }; - AbstractMathQuill.prototype.el = function () { - return this.__controller.container; - }; - AbstractMathQuill.prototype.text = function () { - return this.__controller.exportText(); - }; - AbstractMathQuill.prototype.mathspeak = function () { - return this.__controller.exportMathSpeak(); - }; - AbstractMathQuill.prototype.latex = function (latex) { - if (arguments.length > 0) { - this.__controller.renderLatexMath(latex); - var cursor = this.__controller.cursor; - if (this.__controller.blurred) cursor.hide().parent.blur(cursor); - return this; - } - return this.__controller.exportLatex(); - }; - AbstractMathQuill.prototype.selection = function () { - return this.__controller.exportLatexSelection(); - }; - AbstractMathQuill.prototype.html = function () { - return this.__controller.root - .domFrag() - .oneElement() - .innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, '') // TODO remove when jQuery is completely gone - .replace(/ mathquill-(?:command|block)-id="?\d+"?/g, '') - .replace(/.?<\/span>/i, '') - .replace(/ dcg-mq-hasCursor|dcg-mq-hasCursor ?/, '') - .replace(/ class=(""|(?= |>))/g, ''); - }; - AbstractMathQuill.prototype.reflow = function () { - this.__controller.root.postOrder(function (node) { - node.reflow(); - }); - return this; - }; - return AbstractMathQuill; - })(Progenote); - var EditableField = /** @class */ (function (_super) { - __extends(EditableField, _super); - function EditableField() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - EditableField.prototype.mathquillify = function (classNames) { - _super.prototype.mathquillify.call(this, classNames); - this.__controller.editable = true; - this.__controller.addMouseEventListener(); - this.__controller.editablesTextareaEvents(); - return this; - }; - EditableField.prototype.focus = function () { - this.__controller.getTextareaOrThrow().focus(); - this.__controller.scrollHoriz(); - return this; - }; - EditableField.prototype.blur = function () { - this.__controller.getTextareaOrThrow().blur(); - return this; - }; - EditableField.prototype.write = function (latex) { - this.__controller.writeLatex(latex); - this.__controller.scrollHoriz(); - var cursor = this.__controller.cursor; - if (this.__controller.blurred) cursor.hide().parent.blur(cursor); - return this; - }; - EditableField.prototype.empty = function () { - var _c; - var root = this.__controller.root, - cursor = this.__controller.cursor; - root.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); - root.domFrag().empty(); - delete cursor.selection; - cursor.insAtRightEnd(root); - return this; - }; - EditableField.prototype.cmd = function (cmd) { - var ctrlr = this.__controller.notify(undefined), - cursor = ctrlr.cursor; - if (/^\\[a-z]+$/i.test(cmd) && !cursor.isTooDeep()) { - cmd = cmd.slice(1); - var klass = LatexCmds[cmd]; - var node; - if (klass) { - if (klass.constructor) { - node = new klass(cmd); - } else { - node = klass(cmd); - } - if (cursor.selection) node.replaces(cursor.replaceSelection()); - node.createLeftOf(cursor.show()); - } /* TODO: API needs better error reporting */ else; - } else cursor.parent.write(cursor, cmd); - ctrlr.scrollHoriz(); - if (ctrlr.blurred) cursor.hide().parent.blur(cursor); - return this; - }; - EditableField.prototype.select = function () { - this.__controller.selectAll(); - return this; - }; - EditableField.prototype.clearSelection = function () { - this.__controller.cursor.clearSelection(); - return this; - }; - EditableField.prototype.moveToDirEnd = function (dir) { - this.__controller.notify('move').cursor.insAtDirEnd(dir, this.__controller.root); - return this; - }; - EditableField.prototype.moveToLeftEnd = function () { - return this.moveToDirEnd(L); - }; - EditableField.prototype.moveToRightEnd = function () { - return this.moveToDirEnd(R); - }; - EditableField.prototype.keystroke = function (keysString, evt) { - var keys = keysString.replace(/^\s+|\s+$/g, '').split(/\s+/); - for (var i = 0; i < keys.length; i += 1) { - this.__controller.keystroke(keys[i], evt); - } - return this; - }; - EditableField.prototype.typedText = function (text) { - for (var i = 0; i < text.length; i += 1) this.__controller.typedText(text.charAt(i)); - return this; - }; - EditableField.prototype.dropEmbedded = function (pageX, pageY, options) { - var clientX = pageX - getScrollX(); - var clientY = pageY - getScrollY(); - var el = document.elementFromPoint(clientX, clientY); - this.__controller.seek(el, clientX, clientY); - var cmd = new EmbedNode().setOptions(options); - cmd.createLeftOf(this.__controller.cursor); - }; - EditableField.prototype.setAriaPostLabel = function (ariaPostLabel, timeout) { - this.__controller.setAriaPostLabel(ariaPostLabel, timeout); - return this; - }; - EditableField.prototype.getAriaPostLabel = function () { - return this.__controller.getAriaPostLabel(); - }; - EditableField.prototype.clickAt = function (clientX, clientY, target) { - target = target || document.elementFromPoint(clientX, clientY); - var ctrlr = this.__controller, - root = ctrlr.root; - var rootElement = root.domFrag().oneElement(); - if (!rootElement.contains(target)) target = rootElement; - ctrlr.seek(target, clientX, clientY); - if (ctrlr.blurred) this.focus(); - return this; - }; - EditableField.prototype.ignoreNextMousedown = function (fn) { - this.__controller.cursor.options.ignoreNextMousedown = fn; - return this; - }; - return EditableField; - })(AbstractMathQuill); - var APIClasses = { - AbstractMathQuill: AbstractMathQuill, - EditableField: EditableField, - }; - pray('API.StaticMath defined', API.StaticMath); - APIClasses.StaticMath = API.StaticMath(APIClasses); - pray('API.MathField defined', API.MathField); - APIClasses.MathField = API.MathField(APIClasses); - pray('API.InnerMathField defined', API.InnerMathField); - APIClasses.InnerMathField = API.InnerMathField(APIClasses); - if (API.TextField) { - APIClasses.TextField = API.TextField(APIClasses); - } - /** - * Function that takes an HTML element and, if it's the root HTML element of a - * static math or math or text field, returns an API object for it (else, null). - * - * var mathfield = MQ.MathField(mathFieldSpan); - * assert(MQ(mathFieldSpan).id === mathfield.id); - * assert(MQ(mathFieldSpan).id === MQ(mathFieldSpan).id); - * - */ - var MQ = function (el) { - if (!el || !el.nodeType) return null; // check that `el` is a HTML element, using the - // same technique as jQuery: https://github.com/jquery/jquery/blob/679536ee4b7a92ae64a5f58d90e9cc38c001e807/src/core/init.js#L92 - var blockElement; - var childArray = domFrag(el).children().toElementArray(); - for (var _i = 0, childArray_1 = childArray; _i < childArray_1.length; _i++) { - var child = childArray_1[_i]; - if (child.classList.contains('dcg-mq-root-block')) { - blockElement = child; - break; - } - } - var blockNode = NodeBase.getNodeOfElement(blockElement); // TODO - assumng it's a MathBlock - var ctrlr = blockNode && blockNode.controller; - var APIClass = ctrlr && APIClasses[ctrlr.KIND_OF_MQ]; - return ctrlr && APIClass ? new APIClass(ctrlr) : null; - }; - MQ.L = L; - MQ.R = R; - MQ.config = function (opts) { - config(BaseOptions.prototype, opts); - return this; - }; - MQ.registerEmbed = function (name, options) { - if (!/^[a-z][a-z0-9]*$/i.test(name)) { - throw 'Embed name must start with letter and be only letters and digits'; - } - EMBEDS[name] = options; - }; - /* - * Export the API functions that MathQuill-ify an HTML element into API objects - * of each class. If the element had already been MathQuill-ified but into a - * different kind (or it's not an HTML element), return null. - */ - MQ.StaticMath = createEntrypoint('StaticMath', APIClasses.StaticMath); - MQ.MathField = createEntrypoint('MathField', APIClasses.MathField); - MQ.InnerMathField = createEntrypoint('InnerMathField', APIClasses.InnerMathField); - if (APIClasses.TextField) { - MQ.TextField = createEntrypoint('TextField', APIClasses.TextField); - } - MQ.prototype = AbstractMathQuill.prototype; - MQ.EditableField = function () { - throw "wtf don't call me, I'm 'abstract'"; - }; - MQ.EditableField.prototype = EditableField.prototype; - if (version < 3) { - MQ.saneKeyboardEvents = defaultSubstituteKeyboardEvents; - } - function createEntrypoint(kind, APIClass) { - pray(kind + ' is defined', APIClass); - function mqEntrypoint(el, opts) { - if (!el || !el.nodeType) return null; - var mq = MQ(el); - if (mq instanceof APIClass) return mq; - var ctrlr = new Controller(new APIClass.RootBlock(), el, new BaseOptions(version)); - ctrlr.KIND_OF_MQ = kind; - return new APIClass(ctrlr).__mathquillify(opts || {}, version); - } - mqEntrypoint.prototype = APIClass.prototype; - return mqEntrypoint; - } - return MQ; - } - MathQuill.noConflict = function () { - window.MathQuill = origMathQuill; - return MathQuill; - }; - var origMathQuill = window.MathQuill; - window.MathQuill = MathQuill; - function RootBlockMixin(_) { - _.moveOutOf = function (dir) { - pray('controller is defined', this.controller); - this.controller.handle('moveOutOf', dir); - }; - _.deleteOutOf = function (dir) { - pray('controller is defined', this.controller); - this.controller.handle('deleteOutOf', dir); - }; - _.selectOutOf = function (dir) { - pray('controller is defined', this.controller); - this.controller.handle('selectOutOf', dir); - }; - _.upOutOf = function () { - pray('controller is defined', this.controller); - this.controller.handle('upOutOf'); - return undefined; - }; - _.downOutOf = function () { - pray('controller is defined', this.controller); - this.controller.handle('downOutOf'); - return undefined; - }; - _.reflow = function () { - pray('controller is defined', this.controller); - this.controller.handle('reflow'); - this.controller.handle('edited'); - this.controller.handle('edit'); - }; - } - function parseError(stream, message) { - if (stream) { - stream = "'" + stream + "'"; - } else { - stream = 'EOF'; - } - throw 'Parse Error: ' + message + ' at ' + stream; - } - var Parser = /** @class */ (function () { - // The Parser object is a wrapper for a parser function. - // Externally, you use one to parse a string by calling - // var result = SomeParser.parse('Me Me Me! Parse Me!'); - // You should never call the constructor, rather you should - // construct your Parser from the base parsers and the - // parser combinator methods. - function Parser(body) { - this._ = body; - } - Parser.prototype.parse = function (stream) { - return this.skip(Parser.eof)._('' + stream, success, parseError); - function success(_stream, result) { - return result; - } - }; - // -*- primitive combinators -*- // - Parser.prototype.or = function (alternative) { - pray('or is passed a parser', alternative instanceof Parser); - var self = this; - return new Parser(function (stream, onSuccess, onFailure) { - return self._(stream, onSuccess, failure); - function failure(_newStream) { - return alternative._(stream, onSuccess, onFailure); - } - }); - }; - Parser.prototype.then = function (next) { - var self = this; - return new Parser(function (stream, onSuccess, onFailure) { - return self._(stream, success, onFailure); - function success(newStream, result) { - var nextParser = next instanceof Parser ? next : next(result); - pray('a parser is returned', nextParser instanceof Parser); - return nextParser._(newStream, onSuccess, onFailure); - } - }); - }; - // -*- optimized iterative combinators -*- // - Parser.prototype.many = function () { - var self = this; - return new Parser(function (stream, onSuccess, _onFailure) { - var xs = []; - while (self._(stream, success, failure)); - return onSuccess(stream, xs); - function success(newStream, x) { - stream = newStream; - xs.push(x); - return true; - } - function failure() { - return false; - } - }); - }; - Parser.prototype.times = function (min, max) { - if (arguments.length < 2) max = min; - var self = this; - return new Parser(function (stream, onSuccess, onFailure) { - var xs = []; - var result = true; - var failure; - for (var i = 0; i < min; i += 1) { - // TODO, this may be incorrect for parsers that return boolean - // (or generally, falsey) values - result = !!self._(stream, success, firstFailure); - if (!result) return onFailure(stream, failure); - } - for (; i < max && result; i += 1) { - self._(stream, success, secondFailure); - } - return onSuccess(stream, xs); - function success(newStream, x) { - xs.push(x); - stream = newStream; - return true; - } - function firstFailure(newStream, msg) { - failure = msg; - stream = newStream; - return false; - } - function secondFailure(_newStream, _msg) { - return false; - } - }); - }; - // -*- higher-level combinators -*- // - Parser.prototype.result = function (res) { - return this.then(Parser.succeed(res)); - }; - Parser.prototype.atMost = function (n) { - return this.times(0, n); - }; - Parser.prototype.atLeast = function (n) { - var self = this; - return self.times(n).then(function (start) { - return self.many().map(function (end) { - return start.concat(end); - }); - }); - }; - Parser.prototype.map = function (fn) { - return this.then(function (result) { - return Parser.succeed(fn(result)); - }); - }; - Parser.prototype.skip = function (two) { - return this.then(function (result) { - return two.result(result); - }); - }; - // -*- primitive parsers -*- // - Parser.string = function (str) { - var len = str.length; - var expected = "expected '" + str + "'"; - return new Parser(function (stream, onSuccess, onFailure) { - var head = stream.slice(0, len); - if (head === str) { - return onSuccess(stream.slice(len), head); - } else { - return onFailure(stream, expected); - } - }); - }; - Parser.regex = function (re) { - pray('regexp parser is anchored', re.toString().charAt(1) === '^'); - var expected = 'expected ' + re; - return new Parser(function (stream, onSuccess, onFailure) { - var match = re.exec(stream); - if (match) { - var result = match[0]; - return onSuccess(stream.slice(result.length), result); - } else { - return onFailure(stream, expected); - } - }); - }; - Parser.succeed = function (result) { - return new Parser(function (stream, onSuccess) { - return onSuccess(stream, result); - }); - }; - Parser.fail = function (msg) { - return new Parser(function (stream, _, onFailure) { - return onFailure(stream, msg); - }); - }; - Parser.letter = Parser.regex(/^[a-z]/i); - Parser.letters = Parser.regex(/^[a-z]*/i); - Parser.digit = Parser.regex(/^[0-9]/); - Parser.digits = Parser.regex(/^[0-9]*/); - Parser.whitespace = Parser.regex(/^\s+/); - Parser.optWhitespace = Parser.regex(/^\s*/); - Parser.any = new Parser(function (stream, onSuccess, onFailure) { - if (!stream) return onFailure(stream, 'expected any character'); - return onSuccess(stream.slice(1), stream.charAt(0)); - }); - Parser.all = new Parser(function (stream, onSuccess, _onFailure) { - return onSuccess('', stream); - }); - Parser.eof = new Parser(function (stream, onSuccess, onFailure) { - if (stream) return onFailure(stream, 'expected EOF'); - return onSuccess(stream, stream); - }); - return Parser; - })(); - /** Poller that fires once every tick. */ - var EveryTick = /** @class */ (function () { - function EveryTick() { - this.fn = noop; - } - EveryTick.prototype.listen = function (fn) { - this.fn = fn; - clearTimeout(this.timeoutId); - this.timeoutId = setTimeout(this.fn); - }; - EveryTick.prototype.listenOnce = function (fn) { - var _this_1 = this; - this.listen(function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - _this_1.clearListener(); - fn.apply(void 0, args); - }); - }; - EveryTick.prototype.clearListener = function () { - this.fn = noop; - clearTimeout(this.timeoutId); - }; - EveryTick.prototype.trigger = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - this.fn.apply(this, args); - }; - return EveryTick; - })(); - /************************************************* - * Sane Keyboard Events Shim - * - * An abstraction layer over the raw browser browser events - * on the textarea that hides all the nasty cross- - * browser incompatibilities behind a uniform API. - * - * Design goal: This is a *HARD* internal - * abstraction barrier. Cross-browser - * inconsistencies are not allowed to leak through - * and be dealt with by event handlers. All future - * cross-browser issues that arise must be dealt - * with here, and if necessary, the API updated. - ************************************************/ - var saneKeyboardEvents = (function () { - // The following [key values][1] map was compiled from the - // [DOM3 Events appendix section on key codes][2] and - // [a widely cited report on cross-browser tests of key codes][3], - // except for 10: 'Enter', which I've empirically observed in Safari on iOS - // and doesn't appear to conflict with any other known key codes. - // - // [1]: http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120614/#keys-keyvalues - // [2]: http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120614/#fixed-virtual-key-codes - // [3]: http://unixpapa.com/js/key.html - var WHICH_TO_MQ_KEY_STEM = { - 8: 'Backspace', - 9: 'Tab', - 10: 'Enter', - 13: 'Enter', - 16: 'Shift', - 17: 'Control', - 18: 'Alt', - 20: 'CapsLock', - 27: 'Esc', - 32: 'Spacebar', - 33: 'PageUp', - 34: 'PageDown', - 35: 'End', - 36: 'Home', - 37: 'Left', - 38: 'Up', - 39: 'Right', - 40: 'Down', - 45: 'Insert', - 46: 'Del', - 144: 'NumLock', - }; - var KEY_TO_MQ_KEY_STEM = { - ArrowRight: 'Right', - ArrowLeft: 'Left', - ArrowDown: 'Down', - ArrowUp: 'Up', - Delete: 'Del', - Escape: 'Esc', - ' ': 'Spacebar', - }; - function isArrowKey(e) { - // The keyPress event in FF reports which=0 for some reason. The new - // .key property seems to report reasonable results, so we're using that - switch (getMQKeyStem(e)) { - case 'Right': - case 'Left': - case 'Down': - case 'Up': - return true; - } - return false; - } - function isLowercaseAlphaCharacter(s) { - return s.length === 1 && s >= 'a' && s <= 'z'; - } - function getMQKeyStem(evt) { - var _c; - // Translate browser key names to MQ's internal naming system - // - // Ref: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values - if (evt.key === undefined) { - var which = evt.which || evt.keyCode; - return WHICH_TO_MQ_KEY_STEM[which] || String.fromCharCode(which); - } - if (isLowercaseAlphaCharacter(evt.key)) return evt.key.toUpperCase(); - return (_c = KEY_TO_MQ_KEY_STEM[evt.key]) !== null && _c !== void 0 ? _c : evt.key; - } - /** To the extent possible, create a normalized string representation - * of the key combo (i.e., key code and modifier keys). */ - function getMQKeyName(evt) { - var key = getMQKeyStem(evt); - var modifiers = []; - if (evt.ctrlKey) modifiers.push('Ctrl'); - if (evt.metaKey) modifiers.push('Meta'); - if (evt.altKey) modifiers.push('Alt'); - if (evt.shiftKey) modifiers.push('Shift'); - if (!modifiers.length) return key; - modifiers.push(key); - return modifiers.join('-'); - } - return function saneKeyboardEvents( - /** Usually the textarea associated with a MQ instance, but can be another kind of element if `substituteTextarea` was used to replace it with something else. */ - textarea, - controller - ) { - var keydown = null; - var keypress = null; - // everyTick.listen() is called after key or clipboard events to - // say "Hey, I think something was just typed" or "pasted" etc, - // so that at all subsequent opportune times (next event or timeout), - // will check for expected typed or pasted text. - // Need to check repeatedly because #135: in Safari 5.1 (at least), - // after selecting something and then typing, the textarea is - // incorrectly reported as selected during the input event (but not - // subsequently). - var everyTick = new EveryTick(); - function guardedTextareaSelect() { - try { - // IE can throw an 'Incorrect Function' error if you - // try to select a textarea that is hidden. It seems - // likely that we don't really care if the selection - // fails to happen in this case. Why would the textarea - // be hidden? And who would even be able to tell? - if (textarea instanceof HTMLTextAreaElement) textarea.select(); - } catch (e) {} - } - // -*- public methods -*- // - function select(text) { - // check textarea at least once/one last time before munging (so - // no race condition if selection happens after keypress/paste but - // before checkTextarea), then never again ('cos it's been munged) - everyTick.trigger(); - everyTick.clearListener(); - if (textarea instanceof HTMLTextAreaElement) textarea.value = text; - if (text) guardedTextareaSelect(); - shouldBeSelected = !!text; - } - var shouldBeSelected = false; - // -*- helper subroutines -*- // - // Determine whether there's a selection in the textarea. - // This will always return false in IE < 9, which don't support - // HTMLTextareaElement::selection{Start,End}. - function hasSelection() { - if (!('selectionStart' in textarea)) return false; - if (!(textarea instanceof HTMLTextAreaElement)) return false; - return textarea.selectionStart !== textarea.selectionEnd; - } - function handleKey() { - if (controller.options && controller.options.overrideKeystroke) { - controller.options.overrideKeystroke(getMQKeyName(keydown), keydown); - } else { - controller.keystroke(getMQKeyName(keydown), keydown); - } - } - // -*- event handlers -*- // - function onKeydown(e) { - everyTick.trigger(e); - if (e.target !== textarea) return; - keydown = e; - keypress = null; - if (shouldBeSelected) - everyTick.listenOnce(function (e) { - if (!(e && e.type === 'focusout')) { - // re-select textarea in case it's an unrecognized key that clears - // the selection, then never again, 'cos next thing might be blur - guardedTextareaSelect(); - } - }); - handleKey(); - } - function onKeypress(e) { - everyTick.trigger(e); - if (e.target !== textarea) return; - // call the key handler for repeated keypresses. - // This excludes keypresses that happen directly - // after keydown. In that case, there will be - // no previous keypress, so we skip it here - if (keydown && keypress) handleKey(); - keypress = e; - // only check for typed text if this key can type text. Otherwise - // you can end up with mathquill thinking text was typed if you - // use the mq.keystroke('Right') command while a single character - // is selected. Only detected in FF. - if (!isArrowKey(e)) { - everyTick.listen(typedText); - } else { - everyTick.listenOnce(maybeReselect); - } - } - function onKeyup(e) { - everyTick.trigger(e); - if (e.target !== textarea) return; - // Handle case of no keypress event being sent - if (!!keydown && !keypress) { - // only check for typed text if this key can type text. Otherwise - // you can end up with mathquill thinking text was typed if you - // use the mq.keystroke('Right') command while a single character - // is selected. Only detected in FF. - if (!isArrowKey(e)) { - everyTick.listen(typedText); - } else { - everyTick.listenOnce(maybeReselect); - } - } - } - function typedText() { - // If there is a selection, the contents of the textarea couldn't - // possibly have just been typed in. - // This happens in browsers like Firefox and Opera that fire - // keypress for keystrokes that are not text entry and leave the - // selection in the textarea alone, such as Ctrl-C. - // Note: we assume that browsers that don't support hasSelection() - // also never fire keypress on keystrokes that are not text entry. - // This seems reasonably safe because: - // - all modern browsers including IE 9+ support hasSelection(), - // making it extremely unlikely any browser besides IE < 9 won't - // - as far as we know IE < 9 never fires keypress on keystrokes - // that aren't text entry, which is only as reliable as our - // tests are comprehensive, but the IE < 9 way to do - // hasSelection() is poorly documented and is also only as - // reliable as our tests are comprehensive - // If anything like #40 or #71 is reported in IE < 9, see - // b1318e5349160b665003e36d4eedd64101ceacd8 - if (hasSelection()) return; - if (!(textarea instanceof HTMLTextAreaElement)) return; - var text = textarea.value; - if (text.length === 1) { - textarea.value = ''; - if (controller.options && controller.options.overrideTypedText) { - controller.options.overrideTypedText(text); - } else { - controller.typedText(text); - } - } // in Firefox, keys that don't type text, just clear seln, fire keypress - // https://github.com/mathquill/mathquill/issues/293#issuecomment-40997668 - else maybeReselect(); // re-select if that's why we're here - } - function maybeReselect() { - if (!(textarea instanceof HTMLTextAreaElement)) return; - if (textarea.value.length > 1) { - guardedTextareaSelect(); - } - } - function onBlur() { - keydown = null; - keypress = null; - everyTick.clearListener(); - if (textarea instanceof HTMLTextAreaElement) textarea.value = ''; - } - function onPaste(e) { - everyTick.trigger(); - if (e.target !== textarea) return; - // browsers are dumb. - // - // In Linux, middle-click pasting causes onPaste to be called, - // when the textarea is not necessarily focused. We focus it - // here to ensure that the pasted text actually ends up in the - // textarea. - // - // It's pretty nifty that by changing focus in this handler, - // we can change the target of the default action. (This works - // on keydown too, FWIW). - // - // And by nifty, we mean dumb (but useful sometimes). - if (document.activeElement !== textarea) { - textarea.focus(); - } - everyTick.listen(function pastedText() { - if (!(textarea instanceof HTMLTextAreaElement)) return; - var text = textarea.value; - textarea.value = ''; - if (text) controller.paste(text); - }); - } - function onInput(e) { - everyTick.trigger(e); - } - if (controller.options && controller.options.disableCopyPaste) { - controller.addTextareaEventListeners({ - keydown: onKeydown, - keypress: onKeypress, - keyup: onKeyup, - focusout: onBlur, - copy: function (e) { - e.preventDefault(); - }, - cut: function (e) { - e.preventDefault(); - }, - paste: function (e) { - everyTick.trigger(); - e.preventDefault(); - }, - input: onInput, - }); - } else { - controller.addTextareaEventListeners({ - keydown: onKeydown, - keypress: onKeypress, - keyup: onKeyup, - focusout: onBlur, - cut: function () { - everyTick.listenOnce(function () { - controller.cut(); - }); - }, - copy: function () { - everyTick.listenOnce(function () { - controller.copy(); - }); - }, - paste: onPaste, - input: onInput, - }); - } - // -*- export public methods -*- // - return { select: select }; - }; - })(); - /*********************************************** - * Export math in a human-readable text format - * As you can see, only half-baked so far. - **********************************************/ - var Controller_exportText = /** @class */ (function (_super) { - __extends(Controller_exportText, _super); - function Controller_exportText() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - Controller_exportText.prototype.exportText = function () { - return this.root.foldChildren('', function (text, child) { - return text + child.text(); - }); - }; - return Controller_exportText; - })(ControllerBase); - ControllerBase.onNotify(function (cursor, e) { - // these try to cover all ways that mathquill can be modified - if (e === 'edit' || e === 'replace' || e === undefined) { - var controller = cursor.controller; - if (!controller) return; - if (!controller.options.enableDigitGrouping) return; - // TODO - maybe reconsider these 3 states and drop down to only 2 - // - // blurred === false means we are focused. blurred === true or - // blurred === undefined means we are not focused. - if (controller.blurred !== false) return; - controller.disableGroupingForSeconds(1); - } - }); - var Controller_focusBlur = /** @class */ (function (_super) { - __extends(Controller_focusBlur, _super); - function Controller_focusBlur() { - var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; - _this_1.handleTextareaFocusEditable = function () { - var cursor = _this_1.cursor; - _this_1.updateMathspeak(); - _this_1.blurred = false; - clearTimeout(_this_1.blurTimeout); - domFrag(_this_1.container).addClass('dcg-mq-focused'); - if (!cursor.parent) cursor.insAtRightEnd(_this_1.root); - if (cursor.selection) { - cursor.selection.domFrag().removeClass('dcg-mq-blur'); - _this_1.selectionChanged(); //re-select textarea contents after tabbing away and back - } else { - cursor.show(); - } - _this_1.setOverflowClasses(); - }; - _this_1.handleTextareaBlurEditable = function () { - if (_this_1.textareaSelectionTimeout) { - clearTimeout(_this_1.textareaSelectionTimeout); - _this_1.textareaSelectionTimeout = 0; - } - _this_1.disableGroupingForSeconds(0); - _this_1.blurred = true; - _this_1.blurTimeout = setTimeout(function () { - // wait for blur on window; if - _this_1.root.postOrder(function (node) { - node.intentionalBlur(); - }); // none, intentional blur: #264 - _this_1.cursor.clearSelection().endSelection(); - _this_1.blur(); - _this_1.updateMathspeak(); - _this_1.scrollHoriz(); - }); - window.addEventListener('blur', _this_1.handleWindowBlur); - }; - _this_1.handleTextareaFocusStatic = function () { - _this_1.blurred = false; - }; - _this_1.handleTextareaBlurStatic = function () { - if (_this_1.cursor.selection) { - _this_1.cursor.selection.clear(); - } - //detaching during blur explodes in WebKit - setTimeout(function () { - domFrag(_this_1.getTextareaSpanOrThrow()).detach(); - _this_1.blurred = true; - }); - }; - _this_1.handleWindowBlur = function () { - // blur event also fired on window, just switching - clearTimeout(_this_1.blurTimeout); // tabs/windows, not intentional blur - if (_this_1.cursor.selection) _this_1.cursor.selection.domFrag().addClass('dcg-mq-blur'); - _this_1.blur(); - _this_1.updateMathspeak(); - }; - return _this_1; - } - Controller_focusBlur.prototype.disableGroupingForSeconds = function (seconds) { - var _this_1 = this; - clearTimeout(this.__disableGroupingTimeout); - if (seconds === 0) { - this.root.domFrag().removeClass('dcg-mq-suppress-grouping'); - } else { - this.root.domFrag().addClass('dcg-mq-suppress-grouping'); - this.__disableGroupingTimeout = setTimeout(function () { - _this_1.root.domFrag().removeClass('dcg-mq-suppress-grouping'); - }, seconds * 1000); - } - }; - Controller_focusBlur.prototype.blur = function () { - // not directly in the textarea blur handler so as to be - this.cursor.hide().parent.blur(this.cursor); // synchronous with/in the same frame as - domFrag(this.container).removeClass('dcg-mq-focused'); // clearing/blurring selection - window.removeEventListener('blur', this.handleWindowBlur); - if (this.options && this.options.resetCursorOnBlur) { - this.cursor.resetToEnd(this); - } - }; - Controller_focusBlur.prototype.addEditableFocusBlurListeners = function () { - var ctrlr = this, - cursor = ctrlr.cursor; - this.addTextareaEventListeners({ - focus: this.handleTextareaFocusEditable, - blur: this.handleTextareaBlurEditable, - }); - ctrlr.blurred = true; - cursor.hide().parent.blur(cursor); - }; - Controller_focusBlur.prototype.addStaticFocusBlurListeners = function () { - this.addTextareaEventListeners({ - focus: this.handleTextareaFocusStatic, - blur: this.handleTextareaBlurStatic, - }); - }; - return Controller_focusBlur; - })(Controller_exportText); - /** - * TODO: I wanted to move MathBlock::focus and blur here, it would clean - * up lots of stuff like, TextBlock::focus is set to MathBlock::focus - * and TextBlock::blur calls MathBlock::blur, when instead they could - * use inheritance and super_. - * - * Problem is, there's lots of calls to .focus()/.blur() on nodes - * outside Controller::focusBlurEvents(), such as .postOrder('blur') on - * insertion, which if MathBlock::blur becomes MQNode::blur, would add the - * 'blur' CSS class to all MQSymbol's (because .isEmpty() is true for all - * of them). - * - * I'm not even sure there aren't other troublesome calls to .focus() or - * .blur(), so this is TODO for now. - */ - /***************************************** - * Deals with the browser DOM events from - * interaction with the typist. - ****************************************/ - /** - * Only one incremental selection may be open at a time. Track whether - * an incremental selection is open to help enforce this invariant. - */ - var INCREMENTAL_SELECTION_OPEN = false; - var MQNode = /** @class */ (function (_super) { - __extends(MQNode, _super); - function MQNode() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - MQNode.prototype.keystroke = function (key, e, ctrlr) { - var cursor = ctrlr.cursor; - switch (key) { - case 'Ctrl-Shift-Backspace': - case 'Ctrl-Backspace': - ctrlr.ctrlDeleteDir(L); - break; - case 'Shift-Backspace': - case 'Backspace': - ctrlr.backspace(); - break; - // Tab or Esc -> go one block right if it exists, else escape right. - case 'Esc': - case 'Tab': - ctrlr.escapeDir(R, key, e); - return; - // Shift-Tab -> go one block left if it exists, else escape left. - case 'Shift-Tab': - case 'Shift-Esc': - ctrlr.escapeDir(L, key, e); - return; - // End -> move to the end of the current block. - case 'End': - ctrlr.notify('move').cursor.insAtRightEnd(cursor.parent); - ctrlr.aria.queue('end of').queue(cursor.parent, true); - break; - // Ctrl-End -> move all the way to the end of the root block. - case 'Ctrl-End': - ctrlr.notify('move').cursor.insAtRightEnd(ctrlr.root); - ctrlr.aria.queue('end of').queue(ctrlr.ariaLabel).queue(ctrlr.root).queue(ctrlr.ariaPostLabel); - break; - // Shift-End -> select to the end of the current block. - case 'Shift-End': - ctrlr.selectToBlockEndInDir(R); - break; - // Ctrl-Shift-End -> select all the way to the end of the root block. - case 'Ctrl-Shift-End': - ctrlr.selectToRootEndInDir(R); - break; - // Home -> move to the start of the current block. - case 'Home': - ctrlr.notify('move').cursor.insAtLeftEnd(cursor.parent); - ctrlr.aria.queue('beginning of').queue(cursor.parent, true); - break; - // Ctrl-Home -> move all the way to the start of the root block. - case 'Ctrl-Home': - ctrlr.notify('move').cursor.insAtLeftEnd(ctrlr.root); - ctrlr.aria - .queue('beginning of') - .queue(ctrlr.ariaLabel) - .queue(ctrlr.root) - .queue(ctrlr.ariaPostLabel); - break; - // Shift-Home -> select to the start of the current block. - case 'Shift-Home': - ctrlr.selectToBlockEndInDir(L); - break; - // Ctrl-Shift-Home -> select all the way to the start of the root block. - case 'Ctrl-Shift-Home': - ctrlr.selectToRootEndInDir(L); - break; - case 'Left': - ctrlr.moveLeft(); - break; - case 'Shift-Left': - ctrlr.selectLeft(); - break; - case 'Ctrl-Left': - break; - case 'Right': - ctrlr.moveRight(); - break; - case 'Shift-Right': - ctrlr.selectRight(); - break; - case 'Ctrl-Right': - break; - case 'Up': - ctrlr.moveUp(); - break; - case 'Down': - ctrlr.moveDown(); - break; - case 'Shift-Up': - ctrlr.withIncrementalSelection(function (selectDir) { - if (cursor[L]) { - while (cursor[L]) selectDir(L); - } else { - selectDir(L); - } - }); - break; - case 'Shift-Down': - ctrlr.withIncrementalSelection(function (selectDir) { - if (cursor[R]) { - while (cursor[R]) selectDir(R); - } else { - selectDir(R); - } - }); - break; - case 'Ctrl-Up': - break; - case 'Ctrl-Down': - break; - case 'Ctrl-Shift-Del': - case 'Ctrl-Del': - ctrlr.ctrlDeleteDir(R); - break; - case 'Shift-Del': - case 'Del': - ctrlr.deleteForward(); - break; - case 'Meta-A': - case 'Ctrl-A': - ctrlr.selectAll(); - break; - // These remaining hotkeys are only of benefit to people running screen readers. - case 'Ctrl-Alt-Up': // speak parent block that has focus - if (cursor.parent.parent && cursor.parent.parent instanceof MQNode) - ctrlr.aria.queue(cursor.parent.parent); - else ctrlr.aria.queue('nothing above'); - break; - case 'Ctrl-Alt-Down': // speak current block that has focus - if (cursor.parent && cursor.parent instanceof MQNode) ctrlr.aria.queue(cursor.parent); - else ctrlr.aria.queue('block is empty'); - break; - case 'Ctrl-Alt-Left': // speak left-adjacent block - if (cursor.parent.parent && cursor.parent.parent.getEnd(L)) { - ctrlr.aria.queue(cursor.parent.parent.getEnd(L)); - } else { - ctrlr.aria.queue('nothing to the left'); - } - break; - case 'Ctrl-Alt-Right': // speak right-adjacent block - if (cursor.parent.parent && cursor.parent.parent.getEnd(R)) { - ctrlr.aria.queue(cursor.parent.parent.getEnd(R)); - } else { - ctrlr.aria.queue('nothing to the right'); - } - break; - case 'Ctrl-Alt-Shift-Down': // speak selection - if (cursor.selection) - ctrlr.aria.queue(cursor.selection.join('mathspeak', ' ').trim() + ' selected'); - else ctrlr.aria.queue('nothing selected'); - break; - case 'Ctrl-Alt-=': - case 'Ctrl-Alt-Shift-Right': // speak ARIA post label (evaluation or error) - if (ctrlr.ariaPostLabel.length) ctrlr.aria.queue(ctrlr.ariaPostLabel); - else ctrlr.aria.queue('no answer'); - break; - default: - return; - } - ctrlr.aria.alert(); - e === null || e === void 0 ? void 0 : e.preventDefault(); - ctrlr.scrollHoriz(); - }; - MQNode.prototype.moveOutOf = function (_dir, _cursor, _updown) { - pray('overridden or never called on this node', false); - }; // called by Controller::escapeDir, moveDir - MQNode.prototype.moveTowards = function (_dir, _cursor, _updown) { - pray('overridden or never called on this node', false); - }; // called by Controller::moveDir - MQNode.prototype.deleteOutOf = function (_dir, _cursor) { - pray('overridden or never called on this node', false); - }; // called by Controller::deleteDir - MQNode.prototype.deleteTowards = function (_dir, _cursor) { - pray('overridden or never called on this node', false); - }; // called by Controller::deleteDir - MQNode.prototype.unselectInto = function (_dir, _cursor) { - pray('overridden or never called on this node', false); - }; // called by Controller::selectDir - MQNode.prototype.selectOutOf = function (_dir, _cursor) { - pray('overridden or never called on this node', false); - }; // called by Controller::selectDir - MQNode.prototype.selectTowards = function (_dir, _cursor) { - pray('overridden or never called on this node', false); - }; // called by Controller::selectDir - return MQNode; - })(NodeBase); - ControllerBase.onNotify(function (cursor, e) { - if (e === 'move' || e === 'upDown') cursor.show().clearSelection(); - }); - baseOptionProcessors.leftRightIntoCmdGoes = function (updown) { - if (updown && updown !== 'up' && updown !== 'down') { - throw '"up" or "down" required for leftRightIntoCmdGoes option, ' + 'got "' + updown + '"'; - } - return updown; - }; - ControllerBase.onNotify(function (cursor, e) { - if (e !== 'upDown') cursor.upDownCache = {}; - }); - ControllerBase.onNotify(function (cursor, e) { - if (e === 'edit') cursor.show().deleteSelection(); - }); - ControllerBase.onNotify(function (cursor, e) { - if (e !== 'select') cursor.endSelection(); - }); - var Controller_keystroke = /** @class */ (function (_super) { - __extends(Controller_keystroke, _super); - function Controller_keystroke() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - Controller_keystroke.prototype.keystroke = function (key, evt) { - this.cursor.parent.keystroke(key, evt, this.getControllerSelf()); - }; - Controller_keystroke.prototype.escapeDir = function (dir, _key, e) { - prayDirection(dir); - var cursor = this.cursor; - // only prevent default of Tab if not in the root editable - if (cursor.parent !== this.root) e === null || e === void 0 ? void 0 : e.preventDefault(); - // want to be a noop if in the root editable (in fact, Tab has an unrelated - // default browser action if so) - if (cursor.parent === this.root) return; - cursor.clearSelection(); - cursor.parent.moveOutOf(dir, cursor); - cursor.controller.aria.alert(); - return this.notify('move'); - }; - Controller_keystroke.prototype.moveDir = function (dir) { - prayDirection(dir); - var cursor = this.cursor, - updown = cursor.options.leftRightIntoCmdGoes; - var cursorDir = cursor[dir]; - if (cursor.selection) { - cursor.insDirOf(dir, cursor.selection.getEnd(dir)); - } else if (cursorDir) cursorDir.moveTowards(dir, cursor, updown); - else cursor.parent.moveOutOf(dir, cursor, updown); - return this.notify('move'); - }; - Controller_keystroke.prototype.moveLeft = function () { - return this.moveDir(L); - }; - Controller_keystroke.prototype.moveRight = function () { - return this.moveDir(R); - }; - /** - * moveUp and moveDown have almost identical algorithms: - * - first check left and right, if so insAtLeft/RightEnd of them - * - else check the parent's 'upOutOf'/'downOutOf' property: - * + if it's a function, call it with the cursor as the sole argument and - * use the return value as if it were the value of the property - * + if it's a Node, jump up or down into it: - * - if there is a cached Point in the block, insert there - * - else, seekHoriz within the block to the current x-coordinate (to be - * as close to directly above/below the current position as possible) - * + unless it's exactly `true`, stop bubbling - */ - Controller_keystroke.prototype.moveUp = function () { - return this.moveUpDown('up'); - }; - Controller_keystroke.prototype.moveDown = function () { - return this.moveUpDown('down'); - }; - Controller_keystroke.prototype.moveUpDown = function (dir) { - var self = this; - var cursor = self.notify('upDown').cursor; - var dirInto; - var dirOutOf; - if (dir === 'up') { - dirInto = 'upInto'; - dirOutOf = 'upOutOf'; - } else { - dirInto = 'downInto'; - dirOutOf = 'downOutOf'; - } - var cursorL = cursor[L]; - var cursorR = cursor[R]; - var cursorR_dirInto = cursorR && cursorR[dirInto]; - var cursorL_dirInto = cursorL && cursorL[dirInto]; - if (cursorR_dirInto) cursor.insAtLeftEnd(cursorR_dirInto); - else if (cursorL_dirInto) cursor.insAtRightEnd(cursorL_dirInto); - else { - cursor.parent.bubble(function (ancestor) { - // TODO - revist this - var prop = ancestor[dirOutOf]; - if (prop) { - if (typeof prop === 'function') prop = prop.call(ancestor, cursor); // TODO - figure out if we need to assign to prop - if (prop instanceof MQNode) cursor.jumpUpDown(ancestor, prop); - if (prop !== true) return false; // TODO - figure out how this can return true - } - return undefined; - }); - } - return self; - }; - Controller_keystroke.prototype.deleteDir = function (dir) { - prayDirection(dir); - var cursor = this.cursor; - var cursorEl = cursor[dir]; - var cursorElParent = cursor.parent.parent; - var ctrlr = cursor.controller; - if (cursorEl && cursorEl instanceof MQNode) { - if (cursorEl.sides) { - ctrlr.aria.queue( - cursorEl.parent.chToCmd(cursorEl.sides[-dir].ch).mathspeak({ createdLeftOf: cursor }) - ); - // generally, speak the current element if it has no blocks, - // but don't for text block commands as the deleteTowards method - // in the TextCommand class is responsible for speaking the new character under the cursor. - } else if (!cursorEl.blocks && cursorEl.parent.ctrlSeq !== '\\text') { - ctrlr.aria.queue(cursorEl); - } - } else if (cursorElParent && cursorElParent instanceof MQNode) { - if (cursorElParent.sides) { - ctrlr.aria.queue( - cursorElParent.parent - .chToCmd(cursorElParent.sides[dir].ch) - .mathspeak({ createdLeftOf: cursor }) - ); - } else if (cursorElParent.blocks && cursorElParent.mathspeakTemplate) { - if (cursorElParent.upInto && cursorElParent.downInto) { - // likely a fraction, and we just backspaced over the slash - ctrlr.aria.queue(cursorElParent.mathspeakTemplate[1]); - } else { - var mst = cursorElParent.mathspeakTemplate; - var textToQueue = dir === L ? mst[0] : mst[mst.length - 1]; - ctrlr.aria.queue(textToQueue); - } - } else { - ctrlr.aria.queue(cursorElParent); - } - } - var hadSelection = cursor.selection; - this.notify('edit'); // deletes selection if present - if (!hadSelection) { - var cursorDir = cursor[dir]; - if (cursorDir) cursorDir.deleteTowards(dir, cursor); - else cursor.parent.deleteOutOf(dir, cursor); - } - var cursorL = cursor[L]; - var cursorR = cursor[R]; - if (cursorL.siblingDeleted) cursorL.siblingDeleted(cursor.options, R); - if (cursorR.siblingDeleted) cursorR.siblingDeleted(cursor.options, L); - cursor.parent.bubble(function (node) { - node.reflow(); - return undefined; - }); - return this; - }; - Controller_keystroke.prototype.ctrlDeleteDir = function (dir) { - prayDirection(dir); - var cursor = this.cursor; - if (!cursor[dir] || cursor.selection) return this.deleteDir(dir); - this.notify('edit'); - var fragRemoved; - if (dir === L) { - fragRemoved = new Fragment(cursor.parent.getEnd(L), cursor[L]); - } else { - fragRemoved = new Fragment(cursor[R], cursor.parent.getEnd(R)); - } - cursor.controller.aria.queue(fragRemoved); - fragRemoved.remove(); - cursor.insAtDirEnd(dir, cursor.parent); - var cursorL = cursor[L]; - var cursorR = cursor[R]; - if (cursorL) cursorL.siblingDeleted(cursor.options, R); - if (cursorR) cursorR.siblingDeleted(cursor.options, L); - cursor.parent.bubble(function (node) { - node.reflow(); - return undefined; - }); - return this; - }; - Controller_keystroke.prototype.backspace = function () { - return this.deleteDir(L); - }; - Controller_keystroke.prototype.deleteForward = function () { - return this.deleteDir(R); - }; - /** - * startIncrementalSelection, selectDirIncremental, and finishIncrementalSelection - * should only be called by withIncrementalSelection because they must - * be called in sequence. - */ - Controller_keystroke.prototype.startIncrementalSelection = function () { - pray("Multiple selections can't be simultaneously open", !INCREMENTAL_SELECTION_OPEN); - INCREMENTAL_SELECTION_OPEN = true; - this.notify('select'); - var cursor = this.cursor; - if (!cursor.anticursor) cursor.startSelection(); - }; - /** - * Update the selection model, stored in cursor, without modifying - * selection DOM. - * - * startIncrementalSelection, selectDirIncremental, and finishIncrementalSelection - * should only be called by withIncrementalSelection because they must - * be called in sequence. - */ - Controller_keystroke.prototype.selectDirIncremental = function (dir) { - pray('A selection is open', INCREMENTAL_SELECTION_OPEN); - INCREMENTAL_SELECTION_OPEN = true; - var cursor = this.cursor, - seln = cursor.selection; - prayDirection(dir); - var node = cursor[dir]; - if (node) { - // "if node we're selecting towards is inside selection (hence retracting) - // and is on the *far side* of the selection (hence is only node selected) - // and the anticursor is *inside* that node, not just on the other side" - if (seln && seln.getEnd(dir) === node && cursor.anticursor[-dir] !== node) { - node.unselectInto(dir, cursor); - } else node.selectTowards(dir, cursor); - } else cursor.parent.selectOutOf(dir, cursor); - }; - /** - * Update selection DOM to match cursor model - * - * startIncrementalSelection, selectDirIncremental, and finishIncrementalSelection - * should only be called by withIncrementalSelection because they must - * be called in sequence. - */ - Controller_keystroke.prototype.finishIncrementalSelection = function () { - pray('A selection is open', INCREMENTAL_SELECTION_OPEN); - var cursor = this.cursor; - cursor.clearSelection(); - cursor.select() || cursor.show(); - var selection = cursor.selection; - if (selection) { - cursor.controller.aria.clear().queue(selection.join('mathspeak', ' ').trim() + ' selected'); // clearing first because selection fires several times, and we don't want repeated speech. - } - INCREMENTAL_SELECTION_OPEN = false; - }; - /** - * Used to build a selection incrementally in a loop. Calls the passed - * callback with a selectDir function that may be called many times, - * and defers updating the view until the incremental selection is - * complete - * - * Wraps up calling - * - * this.startSelection() - * this.selectDirIncremental(dir) // possibly many times - * this.finishSelection() - * - * with extra error handling and invariant enforcement - */ - Controller_keystroke.prototype.withIncrementalSelection = function (cb) { - var _this_1 = this; - try { - this.startIncrementalSelection(); - try { - cb(function (dir) { - return _this_1.selectDirIncremental(dir); - }); - } finally { - // Since we have started a selection, attempt to finish it even - // if the callback throws an error - this.finishIncrementalSelection(); - } - } finally { - // Mark selection as closed even if finishSelection throws an - // error. Makes a possible error in finishSelection more - // recoverable - INCREMENTAL_SELECTION_OPEN = false; - } - }; - /** - * Grow selection one unit in the given direction - * - * Note, this should not be called in a loop. To incrementally grow a - * selection, use withIncrementalSelection - */ - Controller_keystroke.prototype.selectDir = function (dir) { - this.withIncrementalSelection(function (selectDir) { - return selectDir(dir); - }); - }; - Controller_keystroke.prototype.selectLeft = function () { - return this.selectDir(L); - }; - Controller_keystroke.prototype.selectRight = function () { - return this.selectDir(R); - }; - Controller_keystroke.prototype.selectAll = function () { - this.notify('move'); - var cursor = this.cursor; - cursor.insAtRightEnd(this.root); - this.withIncrementalSelection(function (selectDir) { - while (cursor[L]) selectDir(L); - }); - }; - Controller_keystroke.prototype.selectToBlockEndInDir = function (dir) { - var cursor = this.cursor; - this.withIncrementalSelection(function (selectDir) { - while (cursor[dir]) selectDir(dir); - }); - }; - Controller_keystroke.prototype.selectToRootEndInDir = function (dir) { - var _this_1 = this; - var cursor = this.cursor; - this.withIncrementalSelection(function (selectDir) { - while (cursor[dir] || cursor.parent !== _this_1.root) { - selectDir(dir); - } - }); - }; - return Controller_keystroke; - })(Controller_focusBlur); - var TempSingleCharNode = /** @class */ (function (_super) { - __extends(TempSingleCharNode, _super); - function TempSingleCharNode(_char) { - return _super.call(this) || this; - } - return TempSingleCharNode; - })(MQNode); - // Parser MathBlock - var latexMathParser = (function () { - function commandToBlock(cmd) { - // can also take in a Fragment - var block = new MathBlock(); - cmd.adopt(block, 0, 0); - return block; - } - function joinBlocks(blocks) { - var firstBlock = blocks[0] || new MathBlock(); - for (var i = 1; i < blocks.length; i += 1) { - blocks[i].children().adopt(firstBlock, firstBlock.getEnd(R), 0); - } - return firstBlock; - } - var string = Parser.string; - var regex = Parser.regex; - var letter = Parser.letter; - var digit = Parser.digit; - var any = Parser.any; - var optWhitespace = Parser.optWhitespace; - var succeed = Parser.succeed; - var fail = Parser.fail; - // Parsers yielding either MathCommands, or Fragments of MathCommands - // (either way, something that can be adopted by a MathBlock) - var variable = letter.map(function (c) { - return new Letter(c); - }); - var number = digit.map(function (c) { - return new Digit(c); - }); - var symbol = regex(/^[^${}\\_^]/).map(function (c) { - return new VanillaSymbol(c); - }); - var controlSequence = regex(/^[^\\a-eg-zA-Z]/) // hotfix #164; match MathBlock::write - .or( - string('\\').then( - regex(/^[a-z]+/i) - .or(regex(/^\s+/).result(' ')) - .or(any) - ) - ) - .then(function (ctrlSeq) { - // TODO - is Parser correct? - var cmdKlass = LatexCmds[ctrlSeq]; - if (cmdKlass) { - if (cmdKlass.constructor) { - var actualClass = cmdKlass; // TODO - figure out how to know the difference - return new actualClass(ctrlSeq).parser(); - } else { - var builder = cmdKlass; // TODO - figure out how to know the difference - return builder(ctrlSeq).parser(); - } - } else { - return fail('unknown command: \\' + ctrlSeq); - } - }); - var command = controlSequence.or(variable).or(number).or(symbol); - // Parsers yielding MathBlocks - var mathGroup = string('{') - .then(function () { - return mathSequence; - }) - .skip(string('}')); - var mathBlock = optWhitespace.then(mathGroup.or(command.map(commandToBlock))); - var mathSequence = mathBlock.many().map(joinBlocks).skip(optWhitespace); - var optMathBlock = string('[') - .then( - mathBlock - .then(function (block) { - return block.join('latex') !== ']' ? succeed(block) : fail(''); - }) - .many() - .map(joinBlocks) - .skip(optWhitespace) - ) - .skip(string(']')); - var latexMath = mathSequence; - latexMath.block = mathBlock; - latexMath.optBlock = optMathBlock; - return latexMath; - })(); - baseOptionProcessors.maxDepth = function (depth) { - return typeof depth === 'number' ? depth : undefined; - }; - var Controller_latex = /** @class */ (function (_super) { - __extends(Controller_latex, _super); - function Controller_latex() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - Controller_latex.prototype.cleanLatex = function (latex) { - //prune unnecessary spaces - return latex.replace(/(\\[a-z]+) (?![a-z])/gi, '$1'); - }; - Controller_latex.prototype.exportLatex = function () { - return this.cleanLatex(this.root.latex()); - }; - Controller_latex.prototype.writeLatex = function (latex) { - var cursor = this.notify('edit').cursor; - cursor.parent.writeLatex(cursor, latex); - return this; - }; - Controller_latex.prototype.exportLatexSelection = function () { - var ctx = { - latex: '', - startIndex: -1, - endIndex: -1, - }; - var selection = this.cursor.selection; - if (selection) { - ctx.startSelectionBefore = selection.getEnd(L); - ctx.endSelectionAfter = selection.getEnd(R); - } else { - var cursorL = this.cursor[L]; - if (cursorL) { - ctx.startSelectionAfter = cursorL; - } else { - ctx.startSelectionBefore = this.cursor.parent; - } - var cursorR = this.cursor[R]; - if (cursorR) { - ctx.endSelectionBefore = cursorR; - } else { - ctx.endSelectionAfter = this.cursor.parent; - } - } - this.root.latexRecursive(ctx); - // need to clean the latex - var originalLatex = ctx.latex; - var cleanLatex = this.cleanLatex(originalLatex); - var startIndex = ctx.startIndex; - var endIndex = ctx.endIndex; - // assumes that the cleaning process will only remove characters. We - // run through the originalLatex and cleanLatex to find differences. - // when we find differences we see how many characters are dropped until - // we sync back up. While detecting missing characters we decrement the - // startIndex and endIndex if appropriate. - var j = 0; - for (var i = 0; i < ctx.endIndex; i++) { - if (originalLatex[i] !== cleanLatex[j]) { - if (i < ctx.startIndex) { - startIndex -= 1; - } - endIndex -= 1; - // do not increment j. We wan to keep looking at this same - // cleanLatex character until we find it in the originalLatex - } else { - j += 1; //move to next cleanLatex character - } - } - return { - latex: cleanLatex, - startIndex: startIndex, - endIndex: endIndex, - }; - }; - Controller_latex.prototype.classifyLatexForEfficientUpdate = function (latex) { - if (typeof latex !== 'string') return; - var matches = latex.match(/-?[0-9.]+$/g); - if (matches && matches.length === 1) { - return { - latex: latex, - prefix: latex.substr(0, latex.length - matches[0].length), - digits: matches[0], - }; - } - return; - }; - Controller_latex.prototype.updateLatexMathEfficiently = function (latex, oldLatex) { - var _c, _d, _e, _f; - // Note, benchmark/update.html is useful for measuring the - // performance of renderLatexMathEfficiently - var root = this.root; - var oldClassification; - var classification = this.classifyLatexForEfficientUpdate(latex); - if (classification) { - oldClassification = this.classifyLatexForEfficientUpdate(oldLatex); - if (!oldClassification || oldClassification.prefix !== classification.prefix) { - return false; - } - } else { - return false; - } - // check if minus sign is changing - var oldDigits = oldClassification.digits; - var newDigits = classification.digits; - var oldMinusSign = false; - var newMinusSign = false; - if (oldDigits[0] === '-') { - oldMinusSign = true; - oldDigits = oldDigits.substr(1); - } - if (newDigits[0] === '-') { - newMinusSign = true; - newDigits = newDigits.substr(1); - } - // start at the very end - var charNode = this.root.getEnd(R); - var oldCharNodes = []; - for (var i = oldDigits.length - 1; i >= 0; i--) { - // the tree does not match what we expect - if (!charNode || charNode.ctrlSeq !== oldDigits[i]) { - return false; - } - // the trailing digits are not just under the root. We require the root - // to be the parent so that we can be sure we do not need a reflow to - // grow parens. - if (charNode.parent !== root) { - return false; - } - // push to the start. We're traversing backwards - oldCharNodes.unshift(charNode); - // move left one character - charNode = charNode[L]; - } - // remove the minus sign - if (oldMinusSign && !newMinusSign) { - var oldMinusNode = charNode; - if (!oldMinusNode) return false; - if (oldMinusNode.ctrlSeq !== '-') return false; - if (oldMinusNode[R] !== oldCharNodes[0]) return false; - if (oldMinusNode.parent !== root) return false; - var oldMinusNodeL = oldMinusNode[L]; - if (oldMinusNodeL && oldMinusNodeL.parent !== root) return false; - oldCharNodes[0][L] = oldMinusNode[L]; - if (root.getEnd(L) === oldMinusNode) { - root.setEnds(((_c = {}), (_c[L] = oldCharNodes[0]), (_c[R] = root.getEnd(R)), _c)); - } - if (oldMinusNodeL) oldMinusNodeL[R] = oldCharNodes[0]; - oldMinusNode.domFrag().remove(); - } - // add a minus sign - if (!oldMinusSign && newMinusSign) { - var newMinusNode = new PlusMinus('-'); - var minusSpan = document.createElement('span'); - minusSpan.textContent = '-'; - newMinusNode.setDOM(minusSpan); - var oldCharNodes0L = oldCharNodes[0][L]; - if (oldCharNodes0L) oldCharNodes0L[R] = newMinusNode; - if (root.getEnd(L) === oldCharNodes[0]) { - root.setEnds(((_d = {}), (_d[L] = newMinusNode), (_d[R] = root.getEnd(R)), _d)); - } - newMinusNode.parent = root; - newMinusNode[L] = oldCharNodes[0][L]; - newMinusNode[R] = oldCharNodes[0]; - oldCharNodes[0][L] = newMinusNode; - newMinusNode.contactWeld(this.cursor); // decide if binary operator - newMinusNode.domFrag().insertBefore(oldCharNodes[0].domFrag()); - } - // update the text of the current nodes - var commonLength = Math.min(oldDigits.length, newDigits.length); - for (i = 0; i < commonLength; i++) { - var newText = newDigits[i]; - charNode = oldCharNodes[i]; - if (charNode.ctrlSeq !== newText) { - charNode.ctrlSeq = newText; - charNode.domFrag().oneElement().textContent = newText; - charNode.mathspeakName = newText; - } - } - // remove the extra digits at the end - if (oldDigits.length > newDigits.length) { - charNode = oldCharNodes[newDigits.length - 1]; - root.setEnds(((_e = {}), (_e[L] = root.getEnd(L)), (_e[R] = charNode), _e)); - charNode[R] = 0; - for (i = oldDigits.length - 1; i >= commonLength; i--) { - oldCharNodes[i].domFrag().remove(); - } - } - // add new digits after the existing ones - if (newDigits.length > oldDigits.length) { - var frag = document.createDocumentFragment(); - for (i = commonLength; i < newDigits.length; i++) { - var span = document.createElement('span'); - span.className = 'dcg-mq-digit'; - span.textContent = newDigits[i]; - var newNode = new Digit(newDigits[i]); - newNode.parent = root; - newNode.setDOM(span); - frag.appendChild(span); - // splice this node in - newNode[L] = root.getEnd(R); - newNode[R] = 0; - var newNodeL = newNode[L]; - newNodeL[R] = newNode; - root.setEnds(((_f = {}), (_f[L] = root.getEnd(L)), (_f[R] = newNode), _f)); - } - root.domFrag().oneElement().appendChild(frag); - } - var currentLatex = this.exportLatex(); - if (currentLatex !== latex) { - console.warn( - 'tried updating latex efficiently but did not work. Attempted: ' + - latex + - ' but wrote: ' + - currentLatex - ); - return false; - } - var rightMost = root.getEnd(R); - if (rightMost) { - rightMost.fixDigitGrouping(this.cursor.options); - } - return true; - }; - Controller_latex.prototype.renderLatexMathFromScratch = function (latex) { - var _c; - var root = this.root, - cursor = this.cursor; - var all = Parser.all; - var eof = Parser.eof; - var block = latexMathParser.skip(eof).or(all.result(false)).parse(latex); - root.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); - if (block) { - block.children().adopt(root, 0, 0); - } - if (block) { - var frag = root.domFrag(); - frag.children().remove(); - frag.oneElement().appendChild(block.html()); - root.finalizeInsert(cursor.options, cursor); - } else { - root.domFrag().empty(); - } - }; - Controller_latex.prototype.renderLatexMath = function (latex) { - var cursor = this.cursor; - var root = this.root; - this.notify('replace'); - cursor.clearSelection(); - var oldLatex = this.exportLatex(); - if (!root.getEnd(L) || !root.getEnd(R) || oldLatex !== latex) { - this.updateLatexMathEfficiently(latex, oldLatex) || this.renderLatexMathFromScratch(latex); - this.updateMathspeak(); - } - cursor.insAtRightEnd(root); - }; - Controller_latex.prototype.renderLatexText = function (latex) { - var _c; - var root = this.root, - cursor = this.cursor; - root.domFrag().children().slice(1).remove(); - root.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); - delete cursor.selection; - cursor.show().insAtRightEnd(root); - var regex = Parser.regex; - var string = Parser.string; - var eof = Parser.eof; - var all = Parser.all; - // Parser RootMathCommand - var mathMode = string('$') - .then(latexMathParser) - // because TeX is insane, math mode doesn't necessarily - // have to end. So we allow for the case that math mode - // continues to the end of the stream. - .skip(string('$').or(eof)) - .map(function (block) { - // HACK FIXME: this shouldn't have to have access to cursor - var rootMathCommand = new RootMathCommand(cursor); - rootMathCommand.createBlocks(); - var rootMathBlock = rootMathCommand.getEnd(L); - block.children().adopt(rootMathBlock, 0, 0); - return rootMathCommand; - }); - var escapedDollar = string('\\$').result('$'); - var textChar = escapedDollar.or(regex(/^[^$]/)).map(function (ch) { - return new VanillaSymbol(ch); - }); - var latexText = mathMode.or(textChar).many(); - var commands = latexText.skip(eof).or(all.result(false)).parse(latex); - if (commands) { - for (var i = 0; i < commands.length; i += 1) { - commands[i].adopt(root, root.getEnd(R), 0); - } - domFrag(root.html()).appendTo(root.domFrag().oneElement()); - root.finalizeInsert(cursor.options, cursor); - } - }; - return Controller_latex; - })(Controller_keystroke); - /******************************************************** - * Deals with mouse events for clicking, drag-to-select - *******************************************************/ - var ignoreNextMouseDownNoop = function (_el) { - return false; - }; - Options.prototype.ignoreNextMousedown = ignoreNextMouseDownNoop; - // Whenever edits to the tree occur, in-progress selection events - // must be invalidated and selection changes must not be applied to - // the edited tree. cancelSelectionOnEdit takes care of this. - var cancelSelectionOnEdit; - (function () { - ControllerBase.onNotify(function (cursor, e) { - if (e === 'edit' || e === 'replace') { - // this will be called any time ANY mathquill is edited. We only want - // to cancel selection if the selection is happening within the mathquill - // that dispatched the notify. Otherwise you won't be able to select any - // mathquills while a slider is playing. - if (cancelSelectionOnEdit && cancelSelectionOnEdit.cursor === cursor) { - cancelSelectionOnEdit.cb(); - } - } - }); - })(); - var Controller_mouse = /** @class */ (function (_super) { - __extends(Controller_mouse, _super); - function Controller_mouse() { - var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; - _this_1.handleMouseDown = function (e) { - var rootElement = closest(e.target, '.dcg-mq-root-block'); - var root = - (rootElement && NodeBase.getNodeOfElement(rootElement)) || - NodeBase.getNodeOfElement(_this_1.root.domFrag().oneElement()); - var ownerDocument = root.domFrag().firstNode().ownerDocument; - var ctrlr = root.controller, - cursor = ctrlr.cursor, - blink = cursor.blink; - var textareaSpan = ctrlr.getTextareaSpanOrThrow(); - var textarea = ctrlr.getTextareaOrThrow(); - e.preventDefault(); // doesn't work in IE\u22648, but it's a one-line fix: - e.target.unselectable = true; // http://jsbin.com/yagekiji/1 // TODO - no idea what this unselectable property is - if (cursor.options.ignoreNextMousedown(e)) return; - else cursor.options.ignoreNextMousedown = ignoreNextMouseDownNoop; - var lastMousemoveTarget = null; - function mousemove(e) { - lastMousemoveTarget = e.target; - } - function onDocumentMouseMove(e) { - if (!cursor.anticursor) cursor.startSelection(); - ctrlr.seek(lastMousemoveTarget, e.clientX, e.clientY).cursor.select(); - if (cursor.selection) - cursor.controller.aria - .clear() - .queue(cursor.selection.join('mathspeak') + ' selected') - .alert(); - lastMousemoveTarget = null; - } - // outside rootElement, the MathQuill node corresponding to the target (if any) - // won't be inside this root, so don't mislead Controller::seek with it - function unbindListeners() { - // delete the mouse handlers now that we're not dragging anymore - rootElement === null || rootElement === void 0 - ? void 0 - : rootElement.removeEventListener('mousemove', mousemove); - ownerDocument === null || ownerDocument === void 0 - ? void 0 - : ownerDocument.removeEventListener('mousemove', onDocumentMouseMove); - ownerDocument === null || ownerDocument === void 0 - ? void 0 - : ownerDocument.removeEventListener('mouseup', onDocumentMouseUp); - cancelSelectionOnEdit = undefined; - } - function updateCursor() { - if (ctrlr.editable) { - cursor.show(); - cursor.controller.aria.queue(cursor.parent).alert(); - } else { - domFrag(textareaSpan).detach(); - } - } - function onDocumentMouseUp() { - cursor.blink = blink; - if (!cursor.selection) updateCursor(); - unbindListeners(); - } - var wasEdited; - cancelSelectionOnEdit = { - cursor: cursor, - cb: function () { - // If an edit happens while the mouse is down, the existing - // selection is no longer valid. Clear it and unbind listeners, - // similar to what happens on mouseup. - wasEdited = true; - cursor.blink = blink; - cursor.clearSelection(); - updateCursor(); - unbindListeners(); - }, - }; - if (ctrlr.blurred) { - if (rootElement && !ctrlr.editable) { - domFrag(rootElement).prepend(domFrag(textareaSpan)); - } - textarea.focus(); - // focus call may bubble to clients, who may then write to - // mathquill, triggering cancelSelectionOnEdit. If that happens, we - // don't want to stop the cursor blink or bind listeners, - // so return early. - if (wasEdited) return; - } - cursor.blink = noop; - ctrlr.seek(e.target, e.clientX, e.clientY).cursor.startSelection(); - rootElement === null || rootElement === void 0 - ? void 0 - : rootElement.addEventListener('mousemove', mousemove); - ownerDocument === null || ownerDocument === void 0 - ? void 0 - : ownerDocument.addEventListener('mousemove', onDocumentMouseMove); - ownerDocument === null || ownerDocument === void 0 - ? void 0 - : ownerDocument.addEventListener('mouseup', onDocumentMouseUp); - // listen on document not just body to not only hear about mousemove and - // mouseup on page outside field, but even outside page, except iframes: https://github.com/mathquill/mathquill/commit/8c50028afcffcace655d8ae2049f6e02482346c5#commitcomment-6175800 - }; - return _this_1; - } - Controller_mouse.prototype.addMouseEventListener = function () { - //drag-to-select event handling - this.container.addEventListener('mousedown', this.handleMouseDown); - }; - Controller_mouse.prototype.removeMouseEventListener = function () { - this.container.removeEventListener('mousedown', this.handleMouseDown); - }; - Controller_mouse.prototype.seek = function (targetElm, clientX, _clientY) { - var cursor = this.notify('select').cursor; - var node; - // we can click on an element that is deeply nested past the point - // that mathquill knows about. We need to traverse up to the first - // node that mathquill is aware of - while (targetElm) { - // try to find the MQ Node associated with the DOM Element - node = NodeBase.getNodeOfElement(targetElm); - if (node) break; - // must be too deep, traverse up to the parent DOM Element - targetElm = targetElm.parentElement; - } - // Could not find any nodes, just use the root - if (!node) { - node = this.root; - } - // don't clear selection until after getting node from target, in case - // target was selection span, otherwise target will have no parent and will - // seek from root, which is less accurate (e.g. fraction) - cursor.clearSelection().show(); - node.seek(clientX, cursor); - this.scrollHoriz(); // before .selectFrom when mouse-selecting, so - // always hits no-selection case in scrollHoriz and scrolls slower - return this; - }; - return Controller_mouse; - })(Controller_latex); - /*********************************************** - * Horizontal panning for editable fields that - * overflow their width - **********************************************/ - var Controller_scrollHoriz = /** @class */ (function (_super) { - __extends(Controller_scrollHoriz, _super); - function Controller_scrollHoriz() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - Controller_scrollHoriz.prototype.setOverflowClasses = function () { - var root = this.root.domFrag().oneElement(); - var shouldHaveOverflowRight = false; - var shouldHaveOverflowLeft = false; - if (!this.blurred) { - var width = getBoundingClientRect(root).width; - var scrollWidth = root.scrollWidth; - var scroll = root.scrollLeft; - shouldHaveOverflowRight = scrollWidth > width + scroll; - shouldHaveOverflowLeft = scroll > 0; - } - if (root.classList.contains('dcg-mq-editing-overflow-right') !== shouldHaveOverflowRight) - root.classList.toggle('dcg-mq-editing-overflow-right'); - if (root.classList.contains('dcg-mq-editing-overflow-left') !== shouldHaveOverflowLeft) - root.classList.toggle('dcg-mq-editing-overflow-left'); - }; - Controller_scrollHoriz.prototype.scrollHoriz = function () { - var _this_1 = this; - var cursor = this.cursor, - seln = cursor.selection; - var rootRect = getBoundingClientRect(this.root.domFrag().oneElement()); - if (cursor.domFrag().isEmpty() && !seln) { - if (this.cancelScrollHoriz) { - this.cancelScrollHoriz(); - this.cancelScrollHoriz = undefined; - } - var rootElt_1 = this.root.domFrag().oneElement(); - var start_1 = rootElt_1.scrollLeft; - animate(this.getScrollAnimationDuration(), function (progress, scheduleNext, cancel) { - if (progress >= 1) { - _this_1.cancelScrollHoriz = undefined; - rootElt_1.scrollLeft = 0; - _this_1.setOverflowClasses(); - } else { - _this_1.cancelScrollHoriz = cancel; - scheduleNext(); - rootElt_1.scrollLeft = Math.round((1 - progress) * start_1); - } - }); - return; - } else if (!seln) { - var x = getBoundingClientRect(cursor.domFrag().oneElement()).left; - if (x > rootRect.right - 20) var scrollBy = x - (rootRect.right - 20); - else if (x < rootRect.left + 20) var scrollBy = x - (rootRect.left + 20); - else return; - } else { - var rect = getBoundingClientRect(seln.domFrag().oneElement()); - var overLeft = rect.left - (rootRect.left + 20); - var overRight = rect.right - (rootRect.right - 20); - if (seln.getEnd(L) === cursor[R]) { - if (overLeft < 0) var scrollBy = overLeft; - else if (overRight > 0) { - if (rect.left - overRight < rootRect.left + 20) var scrollBy = overLeft; - else var scrollBy = overRight; - } else return; - } else { - if (overRight > 0) var scrollBy = overRight; - else if (overLeft < 0) { - if (rect.right - overLeft > rootRect.right - 20) var scrollBy = overRight; - else var scrollBy = overLeft; - } else return; - } - } - var root = this.root.domFrag().oneElement(); - if (scrollBy < 0 && root.scrollLeft === 0) return; - if (scrollBy > 0 && root.scrollWidth <= root.scrollLeft + rootRect.width) return; - if (this.cancelScrollHoriz) { - this.cancelScrollHoriz(); - this.cancelScrollHoriz = undefined; - } - var rootElt = this.root.domFrag().oneElement(); - var start = rootElt.scrollLeft; - animate(this.getScrollAnimationDuration(), function (progress, scheduleNext, cancel) { - if (progress >= 1) { - _this_1.cancelScrollHoriz = undefined; - rootElt.scrollLeft = Math.round(start + scrollBy); - _this_1.setOverflowClasses(); - } else { - _this_1.cancelScrollHoriz = cancel; - scheduleNext(); - rootElt.scrollLeft = Math.round(start + progress * scrollBy); - } - }); - }; - Controller_scrollHoriz.prototype.getScrollAnimationDuration = function () { - var _c; - return (_c = this.options.scrollAnimationDuration) !== null && _c !== void 0 ? _c : 100; - }; - return Controller_scrollHoriz; - })(Controller_mouse); - /********************************************* - * Manage the MathQuill instance's textarea - * (as owned by the Controller) - ********************************************/ - Options.prototype.substituteTextarea = function () { - return h('textarea', { - autocapitalize: 'off', - autocomplete: 'off', - autocorrect: 'off', - spellcheck: false, - 'x-palm-disable-ste-all': true, - }); - }; - function defaultSubstituteKeyboardEvents(jq, controller) { - return saneKeyboardEvents(jq[0], controller); - } - Options.prototype.substituteKeyboardEvents = defaultSubstituteKeyboardEvents; - var Controller = /** @class */ (function (_super) { - __extends(Controller, _super); - function Controller() { - var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; - _this_1.selectFn = noop; - return _this_1; - } - Controller.prototype.createTextarea = function () { - this.textareaSpan = h('span', { class: 'dcg-mq-textarea' }); - var textarea = this.options.substituteTextarea(); - if (!textarea.nodeType) { - throw 'substituteTextarea() must return a DOM element, got ' + textarea; - } - this.textarea = domFrag(textarea).appendTo(this.textareaSpan).oneElement(); - var ctrlr = this; - ctrlr.cursor.selectionChanged = function () { - ctrlr.selectionChanged(); - }; - }; - Controller.prototype.selectionChanged = function () { - var ctrlr = this; - // throttle calls to setTextareaSelection(), because setting textarea.value - // and/or calling textarea.select() can have anomalously bad performance: - // https://github.com/mathquill/mathquill/issues/43#issuecomment-1399080 - // - // Note, this timeout may be cleared by the blur handler in focusBlur.js - if (!ctrlr.textareaSelectionTimeout) { - ctrlr.textareaSelectionTimeout = setTimeout(function () { - ctrlr.setTextareaSelection(); - }); - } - }; - Controller.prototype.setTextareaSelection = function () { - this.textareaSelectionTimeout = 0; - var latex = ''; - if (this.cursor.selection) { - //cleanLatex prunes unnecessary spaces. defined in latex.js - latex = this.cleanLatex(this.cursor.selection.join('latex')); - if (this.options.statelessClipboard) { - // FIXME: like paste, only this works for math fields; should ask parent - latex = '$' + latex + '$'; - } - } - this.selectFn(latex); - }; - Controller.prototype.staticMathTextareaEvents = function () { - var ctrlr = this; - this.removeTextareaEventListener('cut'); - this.removeTextareaEventListener('paste'); - if (ctrlr.options.disableCopyPaste) { - this.removeTextareaEventListener('copy'); - } else { - this.addTextareaEventListeners({ - copy: function () { - ctrlr.setTextareaSelection(); - }, - }); - } - this.addStaticFocusBlurListeners(); - ctrlr.selectFn = function (text) { - var textarea = ctrlr.getTextareaOrThrow(); - if (!(textarea instanceof HTMLTextAreaElement)) return; - textarea.value = text; - if (text) textarea.select(); - }; - }; - Controller.prototype.editablesTextareaEvents = function () { - var ctrlr = this; - var textarea = ctrlr.getTextareaOrThrow(); - var textareaSpan = ctrlr.getTextareaSpanOrThrow(); - if (this.options.version < 3) { - var $ = this.options.assertJquery(); - var keyboardEventsShim = this.options.substituteKeyboardEvents($(textarea), this); - this.selectFn = function (text) { - keyboardEventsShim.select(text); - }; - } else { - var select = saneKeyboardEvents(textarea, this).select; - this.selectFn = select; - } - domFrag(this.container).prepend(domFrag(textareaSpan)); - this.addEditableFocusBlurListeners(); - this.updateMathspeak(); - }; - Controller.prototype.unbindEditablesEvents = function () { - var ctrlr = this; - var textarea = ctrlr.getTextareaOrThrow(); - var textareaSpan = ctrlr.getTextareaSpanOrThrow(); - this.selectFn = function (text) { - if (!(textarea instanceof HTMLTextAreaElement)) return; - textarea.value = text; - if (text) textarea.select(); - }; - domFrag(textareaSpan).remove(); - this.removeTextareaEventListener('focus'); - this.removeTextareaEventListener('blur'); - ctrlr.blurred = true; - this.removeTextareaEventListener('cut'); - this.removeTextareaEventListener('paste'); - }; - Controller.prototype.typedText = function (ch) { - if (ch === '\n') return this.handle('enter'); - var cursor = this.notify(undefined).cursor; - cursor.parent.write(cursor, ch); - this.scrollHoriz(); - }; - Controller.prototype.cut = function () { - var ctrlr = this, - cursor = ctrlr.cursor; - if (cursor.selection) { - setTimeout(function () { - ctrlr.notify('edit'); // deletes selection if present - cursor.parent.bubble(function (node) { - node.reflow(); - return undefined; - }); - if (ctrlr.options && ctrlr.options.onCut) { - ctrlr.options.onCut(); - } - }); - } - }; - Controller.prototype.copy = function () { - this.setTextareaSelection(); - }; - Controller.prototype.paste = function (text) { - // TODO: document `statelessClipboard` config option in README, after - // making it work like it should, that is, in both text and math mode - // (currently only works in math fields, so worse than pointless, it - // only gets in the way by \text{}-ifying pasted stuff and $-ifying - // cut/copied LaTeX) - if (this.options.statelessClipboard) { - if (text.slice(0, 1) === '$' && text.slice(-1) === '$') { - text = text.slice(1, -1); - } else { - text = '\\text{' + text + '}'; - } - } - // FIXME: this always inserts math or a TextBlock, even in a RootTextBlock - this.writeLatex(text).cursor.show(); - this.scrollHoriz(); - if (this.options && this.options.onPaste) { - this.options.onPaste(); - } - }; - /** Set up for a static MQ field (i.e., create and attach the mathspeak element and initialize the focus state to blurred) */ - Controller.prototype.setupStaticField = function () { - this.mathspeakSpan = h('span', { class: 'dcg-mq-mathspeak' }); - domFrag(this.container).prepend(domFrag(this.mathspeakSpan)); - this.updateMathspeak(); - this.blurred = true; - this.cursor.hide().parent.blur(this.cursor); - }; - Controller.prototype.updateMathspeak = function () { - var ctrlr = this; - // If the controller's ARIA label doesn't end with a punctuation mark, add a colon by default to better separate it from mathspeak. - var ariaLabel = ctrlr.getAriaLabel(); - var labelWithSuffix = /[A-Za-z0-9]$/.test(ariaLabel) ? ariaLabel + ':' : ariaLabel; - var mathspeak = ctrlr.root.mathspeak().trim(); - this.aria.clear(); - var textarea = ctrlr.getTextareaOrThrow(); - // For static math, provide mathspeak in a visually hidden span to allow screen readers and other AT to traverse the content. - // For editable math, assign the mathspeak to the textarea's ARIA label (AT can use text navigation to interrogate the content). - // Be certain to include the mathspeak for only one of these, though, as we don't want to include outdated labels if a field's editable state changes. - // By design, also take careful note that the ariaPostLabel is meant to exist only for editable math (e.g. to serve as an evaluation or error message) - // so it is not included for static math mathspeak calculations. - // The mathspeakSpan should exist only for static math, so we use its presence to decide which approach to take. - if (!!ctrlr.mathspeakSpan) { - textarea.setAttribute('aria-label', ''); - ctrlr.mathspeakSpan.textContent = (labelWithSuffix + ' ' + mathspeak).trim(); - } else { - textarea.setAttribute( - 'aria-label', - (labelWithSuffix + ' ' + mathspeak + ' ' + ctrlr.ariaPostLabel).trim() - ); - } - }; - return Controller; - })(Controller_scrollHoriz); - /************************************************* - * Abstract classes of math blocks and commands. - ************************************************/ - /** - * Math tree node base class. - * Some math-tree-specific extensions to MQNode. - * Both MathBlock's and MathCommand's descend from it. - */ - var MathElement = /** @class */ (function (_super) { - __extends(MathElement, _super); - function MathElement() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - MathElement.prototype.finalizeInsert = function (options, cursor) { - var self = this; - self.postOrder(function (node) { - node.finalizeTree(options); - }); - self.postOrder(function (node) { - node.contactWeld(cursor); - }); - // note: this order is important. - // empty elements need the empty box provided by blur to - // be present in order for their dimensions to be measured - // correctly by 'reflow' handlers. - self.postOrder(function (node) { - node.blur(cursor); - }); - self.postOrder(function (node) { - node.reflow(); - }); - var selfR = self[R]; - var selfL = self[L]; - if (selfR) selfR.siblingCreated(options, L); - if (selfL) selfL.siblingCreated(options, R); - self.bubble(function (node) { - node.reflow(); - return undefined; - }); - }; - // If the maxDepth option is set, make sure - // deeply nested content is truncated. Just return - // false if the cursor is already too deep. - MathElement.prototype.prepareInsertionAt = function (cursor) { - var maxDepth = cursor.options.maxDepth; - if (maxDepth !== undefined) { - var cursorDepth = cursor.depth(); - if (cursorDepth > maxDepth) { - return false; - } - this.removeNodesDeeperThan(maxDepth - cursorDepth); - } - return true; - }; - // Remove nodes that are more than `cutoff` - // blocks deep from this node. - MathElement.prototype.removeNodesDeeperThan = function (cutoff) { - var depth = 0; - var queue = [[this, depth]]; - var current; - // Do a breadth-first search of this node's descendants - // down to cutoff, removing anything deeper. - while ((current = queue.shift())) { - var c = current; - c[0].children().each(function (child) { - var i = child instanceof MathBlock ? 1 : 0; - depth = c[1] + i; - if (depth <= cutoff) { - queue.push([child, depth]); - } else { - (i ? child.children() : child).remove(); - } - return undefined; - }); - } - }; - return MathElement; - })(MQNode); - var DOMView = /** @class */ (function () { - function DOMView(childCount, render) { - this.childCount = childCount; - this.render = render; - } - return DOMView; - })(); - /** - * Commands and operators, like subscripts, exponents, or fractions. - * Descendant commands are organized into blocks. - */ - var MathCommand = /** @class */ (function (_super) { - __extends(MathCommand, _super); - function MathCommand(ctrlSeq, domView, textTemplate) { - var _this_1 = _super.call(this) || this; - _this_1.textTemplate = ['']; - _this_1.mathspeakTemplate = ['']; - _this_1.setCtrlSeqHtmlAndText(ctrlSeq, domView, textTemplate); - return _this_1; - } - MathCommand.prototype.setEnds = function (ends) { - pray('MathCommand ends are never empty', ends[L] && ends[R]); - this.ends = ends; - }; - MathCommand.prototype.getEnd = function (dir) { - return this.ends[dir]; - }; - MathCommand.prototype.setCtrlSeqHtmlAndText = function (ctrlSeq, domView, textTemplate) { - if (!this.ctrlSeq) this.ctrlSeq = ctrlSeq; - if (domView) this.domView = domView; - if (textTemplate) this.textTemplate = textTemplate; - }; - // obvious methods - MathCommand.prototype.replaces = function (replacedFragment) { - replacedFragment.disown(); - this.replacedFragment = replacedFragment; - }; - MathCommand.prototype.isEmpty = function () { - return this.foldChildren(true, function (isEmpty, child) { - return isEmpty && child.isEmpty(); - }); - }; - MathCommand.prototype.parser = function () { - var _this_1 = this; - var block = latexMathParser.block; - return block.times(this.numBlocks()).map(function (blocks) { - _this_1.blocks = blocks; - for (var i = 0; i < blocks.length; i += 1) { - blocks[i].adopt(_this_1, _this_1.getEnd(R), 0); - } - return _this_1; - }); - }; - // createLeftOf(cursor) and the methods it calls - MathCommand.prototype.createLeftOf = function (cursor) { - var cmd = this; - var replacedFragment = cmd.replacedFragment; - cmd.createBlocks(); - _super.prototype.createLeftOf.call(this, cursor); - if (replacedFragment) { - var cmdEndsL = cmd.getEnd(L); - replacedFragment.adopt(cmdEndsL, 0, 0); - replacedFragment.domFrag().appendTo(cmdEndsL.domFrag().oneElement()); - cmd.placeCursor(cursor); - cmd.prepareInsertionAt(cursor); - } - cmd.finalizeInsert(cursor.options, cursor); - cmd.placeCursor(cursor); - }; - MathCommand.prototype.createBlocks = function () { - var cmd = this, - numBlocks = cmd.numBlocks(), - blocks = (cmd.blocks = Array(numBlocks)); - for (var i = 0; i < numBlocks; i += 1) { - var newBlock = (blocks[i] = new MathBlock()); - newBlock.adopt(cmd, cmd.getEnd(R), 0); - } - }; - MathCommand.prototype.placeCursor = function (cursor) { - //insert the cursor at the right end of the first empty child, searching - //left-to-right, or if none empty, the right end child - cursor.insAtRightEnd( - this.foldChildren(this.getEnd(L), function (leftward, child) { - return leftward.isEmpty() ? leftward : child; - }) - ); - }; - // editability methods: called by the cursor for editing, cursor movements, - // and selection of the MathQuill tree, these all take in a direction and - // the cursor - MathCommand.prototype.moveTowards = function (dir, cursor, updown) { - var updownInto; - if (updown === 'up') { - updownInto = this.upInto; - } else if (updown === 'down') { - updownInto = this.downInto; - } - var el = updownInto || this.getEnd(-dir); - cursor.insAtDirEnd(-dir, el); - cursor.controller.aria.queueDirEndOf(-dir).queue(cursor.parent, true); - }; - MathCommand.prototype.deleteTowards = function (dir, cursor) { - if (this.isEmpty()) cursor[dir] = this.remove()[dir]; - else this.moveTowards(dir, cursor); - }; - MathCommand.prototype.selectTowards = function (dir, cursor) { - cursor[-dir] = this; - cursor[dir] = this[dir]; - }; - MathCommand.prototype.selectChildren = function () { - return new MQSelection(this, this); - }; - MathCommand.prototype.unselectInto = function (dir, cursor) { - var antiCursor = cursor.anticursor; - var ancestor = antiCursor.ancestors[this.id]; - cursor.insAtDirEnd(-dir, ancestor); - }; - MathCommand.prototype.seek = function (clientX, cursor) { - function getBounds(node) { - var _c; - var el = node.domFrag().oneElement(); - var l = getBoundingClientRect(el).left; - var r = l + el.offsetWidth; - return (_c = {}), (_c[L] = l), (_c[R] = r), _c; - } - var cmd = this; - var cmdBounds = getBounds(cmd); - if (clientX < cmdBounds[L]) return cursor.insLeftOf(cmd); - if (clientX > cmdBounds[R]) return cursor.insRightOf(cmd); - var leftLeftBound = cmdBounds[L]; - cmd.eachChild(function (block) { - var blockBounds = getBounds(block); - if (clientX < blockBounds[L]) { - // closer to this block's left bound, or the bound left of that? - if (clientX - leftLeftBound < blockBounds[L] - clientX) { - if (block[L]) cursor.insAtRightEnd(block[L]); - else cursor.insLeftOf(cmd); - } else cursor.insAtLeftEnd(block); - return false; - } else if (clientX > blockBounds[R]) { - if (block[R]) leftLeftBound = blockBounds[R]; - // continue to next block - else { - // last (rightmost) block - // closer to this block's right bound, or the cmd's right bound? - if (cmdBounds[R] - clientX < clientX - blockBounds[R]) { - cursor.insRightOf(cmd); - } else cursor.insAtRightEnd(block); - } - return undefined; - } else { - block.seek(clientX, cursor); - return false; - } - }); - return undefined; - }; - MathCommand.prototype.numBlocks = function () { - return this.domView.childCount; - }; - /** - * Render the entire math subtree rooted at this command to a DOM node. Assumes `this.domView` is defined. - * - * See dom.test.js for example templates and intended outputs. - */ - MathCommand.prototype.html = function () { - var blocks = this.blocks; - pray('domView is defined', this.domView); - var template = this.domView; - var dom = template.render(blocks || []); - this.setDOM(dom); - NodeBase.linkElementByCmdNode(dom, this); - return dom; - }; - // methods to export a string representation of the math tree - MathCommand.prototype.latexRecursive = function (ctx) { - this.checkCursorContextOpen(ctx); - ctx.latex += this.ctrlSeq || ''; - this.eachChild(function (child) { - ctx.latex += '{'; - var beforeLength = ctx.latex.length; - child.latexRecursive(ctx); - var afterLength = ctx.latex.length; - if (beforeLength === afterLength) { - // nothing was written so we write a space - ctx.latex += ' '; - } - ctx.latex += '}'; - }); - this.checkCursorContextClose(ctx); - }; - MathCommand.prototype.text = function () { - var cmd = this, - i = 0; - return cmd.foldChildren(cmd.textTemplate[i], function (text, child) { - i += 1; - var child_text = child.text(); - if (text && cmd.textTemplate[i] === '(' && child_text[0] === '(' && child_text.slice(-1) === ')') - return text + child_text.slice(1, -1) + cmd.textTemplate[i]; - return text + child_text + (cmd.textTemplate[i] || ''); - }); - }; - MathCommand.prototype.mathspeak = function () { - var cmd = this, - i = 0; - return cmd.foldChildren( - cmd.mathspeakTemplate[i] || 'Start' + cmd.ctrlSeq + ' ', - function (speech, block) { - i += 1; - return ( - speech + - ' ' + - block.mathspeak() + - ' ' + - (cmd.mathspeakTemplate[i] + ' ' || 'End' + cmd.ctrlSeq + ' ') - ); - } - ); - }; - return MathCommand; - })(MathElement); - /** - * Lightweight command without blocks or children. - */ - var MQSymbol = /** @class */ (function (_super) { - __extends(MQSymbol, _super); - function MQSymbol(ctrlSeq, html, text, mathspeak) { - var _this_1 = _super.call(this) || this; - _this_1.setCtrlSeqHtmlTextAndMathspeak( - ctrlSeq, - html - ? new DOMView(0, function () { - return html.cloneNode(true); - }) - : undefined, - text, - mathspeak - ); - return _this_1; - } - MQSymbol.prototype.setCtrlSeqHtmlTextAndMathspeak = function (ctrlSeq, html, text, mathspeak) { - if (!text && !!ctrlSeq) { - text = ctrlSeq.replace(/^\\/, ''); - } - this.mathspeakName = mathspeak || text; - _super.prototype.setCtrlSeqHtmlAndText.call(this, ctrlSeq, html, [text || '']); - }; - MQSymbol.prototype.parser = function () { - return Parser.succeed(this); - }; - MQSymbol.prototype.numBlocks = function () { - return 0; - }; - MQSymbol.prototype.replaces = function (replacedFragment) { - replacedFragment.remove(); - }; - MQSymbol.prototype.createBlocks = function () {}; - MQSymbol.prototype.moveTowards = function (dir, cursor) { - cursor.domFrag().insDirOf(dir, this.domFrag()); - cursor[-dir] = this; - cursor[dir] = this[dir]; - cursor.controller.aria.queue(this); - }; - MQSymbol.prototype.deleteTowards = function (dir, cursor) { - cursor[dir] = this.remove()[dir]; - }; - MQSymbol.prototype.seek = function (clientX, cursor) { - // insert at whichever side the click was closer to - var el = this.domFrag().oneElement(); - var left = getBoundingClientRect(el).left; - if (clientX - left < el.offsetWidth / 2) cursor.insLeftOf(this); - else cursor.insRightOf(this); - return cursor; - }; - MQSymbol.prototype.latexRecursive = function (ctx) { - this.checkCursorContextOpen(ctx); - ctx.latex += this.ctrlSeq || ''; - this.checkCursorContextClose(ctx); - }; - MQSymbol.prototype.text = function () { - return this.textTemplate.join(''); - }; - MQSymbol.prototype.mathspeak = function (_opts) { - return this.mathspeakName || ''; - }; - MQSymbol.prototype.placeCursor = function () {}; - MQSymbol.prototype.isEmpty = function () { - return true; - }; - return MQSymbol; - })(MathCommand); - var VanillaSymbol = /** @class */ (function (_super) { - __extends(VanillaSymbol, _super); - function VanillaSymbol(ch, html, mathspeak) { - return _super.call(this, ch, h('span', {}, [html || h.text(ch)]), undefined, mathspeak) || this; - } - return VanillaSymbol; - })(MQSymbol); - function bindVanillaSymbol(ch, htmlEntity, mathspeak) { - return function () { - return new VanillaSymbol(ch, htmlEntity ? h.entityText(htmlEntity) : undefined, mathspeak); - }; - } - var BinaryOperator = /** @class */ (function (_super) { - __extends(BinaryOperator, _super); - function BinaryOperator(ctrlSeq, html, text, mathspeak, treatLikeSymbol) { - var _this_1 = this; - if (treatLikeSymbol) { - _this_1 = - _super.call( - this, - ctrlSeq, - h('span', {}, [html || h.text(ctrlSeq || '')]), - undefined, - mathspeak - ) || this; - } else { - _this_1 = - _super.call( - this, - ctrlSeq, - h('span', { class: 'dcg-mq-binary-operator' }, html ? [html] : []), - text, - mathspeak - ) || this; - } - return _this_1; - } - return BinaryOperator; - })(MQSymbol); - function bindBinaryOperator(ctrlSeq, htmlEntity, text, mathspeak) { - return function () { - return new BinaryOperator(ctrlSeq, htmlEntity ? h.entityText(htmlEntity) : undefined, text, mathspeak); - }; - } - /** - * Children and parent of MathCommand's. Basically partitions all the - * symbols and operators that descend (in the Math DOM tree) from - * ancestor operators. - */ - var MathBlock = /** @class */ (function (_super) { - __extends(MathBlock, _super); - function MathBlock() { - var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; - _this_1.ariaLabel = 'block'; - return _this_1; - } - MathBlock.prototype.join = function (methodName) { - return this.foldChildren('', function (fold, child) { - return fold + child[methodName](); - }); - }; - MathBlock.prototype.html = function () { - var fragment = document.createDocumentFragment(); - this.eachChild(function (el) { - var childHtml = el.html(); - fragment.appendChild(childHtml); - return undefined; - }); - return fragment; - }; - MathBlock.prototype.latexRecursive = function (ctx) { - this.checkCursorContextOpen(ctx); - this.eachChild(function (child) { - return child.latexRecursive(ctx); - }); - this.checkCursorContextClose(ctx); - }; - MathBlock.prototype.text = function () { - var endsL = this.getEnd(L); - var endsR = this.getEnd(R); - return endsL === endsR && endsL !== 0 ? endsL.text() : this.join('text'); - }; - MathBlock.prototype.mathspeak = function () { - var tempOp = ''; - var autoOps = {}; - if (this.controller) autoOps = this.controller.options.autoOperatorNames; - return ( - this.foldChildren([], function (speechArray, cmd) { - if (cmd.isPartOfOperator) { - tempOp += cmd.mathspeak(); - } else { - if (tempOp !== '') { - if (autoOps._maxLength > 0) { - var x = autoOps[tempOp.toLowerCase()]; - if (typeof x === 'string') tempOp = x; - } - speechArray.push(tempOp + ' '); - tempOp = ''; - } - var mathspeakText = cmd.mathspeak(); - var cmdText = cmd.ctrlSeq; - if ( - isNaN(cmdText) && // TODO - revisit this to improve the isNumber() check - cmdText !== '.' && - (!cmd.parent || !cmd.parent.parent || !cmd.parent.parent.isTextBlock()) - ) { - mathspeakText = ' ' + mathspeakText + ' '; - } - speechArray.push(mathspeakText); - } - return speechArray; - }) - .join('') - .replace(/ +(?= )/g, '') - // For Apple devices in particular, split out digits after a decimal point so they aren't read aloud as whole words. - // Not doing so makes 123.456 potentially spoken as "one hundred twenty-three point four hundred fifty-six." - // Instead, add spaces so it is spoken as "one hundred twenty-three point four five six." - .replace(/(\.)([0-9]+)/g, function (_match, p1, p2) { - return p1 + p2.split('').join(' ').trim(); - }) - ); - }; - MathBlock.prototype.keystroke = function (key, e, ctrlr) { - if (ctrlr.options.spaceBehavesLikeTab && (key === 'Spacebar' || key === 'Shift-Spacebar')) { - e === null || e === void 0 ? void 0 : e.preventDefault(); - ctrlr.escapeDir(key === 'Shift-Spacebar' ? L : R, key, e); - return; - } - return _super.prototype.keystroke.call(this, key, e, ctrlr); - }; - // editability methods: called by the cursor for editing, cursor movements, - // and selection of the MathQuill tree, these all take in a direction and - // the cursor - MathBlock.prototype.moveOutOf = function (dir, cursor, updown) { - var updownInto; - if (updown === 'up') { - updownInto = this.parent.upInto; - } else if (updown === 'down') { - updownInto = this.parent.downInto; - } - if (!updownInto && this[dir]) { - var otherDir = -dir; - cursor.insAtDirEnd(otherDir, this[dir]); - cursor.controller.aria.queueDirEndOf(otherDir).queue(cursor.parent, true); - } else { - cursor.insDirOf(dir, this.parent); - cursor.controller.aria.queueDirOf(dir).queue(this.parent); - } - }; - MathBlock.prototype.selectOutOf = function (dir, cursor) { - cursor.insDirOf(dir, this.parent); - }; - MathBlock.prototype.deleteOutOf = function (_dir, cursor) { - cursor.unwrapGramp(); - }; - MathBlock.prototype.seek = function (clientX, cursor) { - var node = this.getEnd(R); - if (!node) return cursor.insAtRightEnd(this); - var el = node.domFrag().oneElement(); - var left = getBoundingClientRect(el).left; - if (left + el.offsetWidth < clientX) { - return cursor.insAtRightEnd(this); - } - var endsL = this.getEnd(L); - if (clientX < getBoundingClientRect(endsL.domFrag().oneElement()).left) - return cursor.insAtLeftEnd(this); - while (clientX < getBoundingClientRect(node.domFrag().oneElement()).left) node = node[L]; - return node.seek(clientX, cursor); - }; - MathBlock.prototype.chToCmd = function (ch, options) { - var cons; - // exclude f because it gets a dedicated command with more spacing - if (ch.match(/^[a-eg-zA-Z]$/)) return new Letter(ch); - else if (/^\d$/.test(ch)) return new Digit(ch); - else if (options && options.typingSlashWritesDivisionSymbol && ch === '/') - return LatexCmds['\u00f7'](ch); - else if (options && options.typingAsteriskWritesTimesSymbol && ch === '*') - return LatexCmds['\u00d7'](ch); - else if (options && options.typingPercentWritesPercentOf && ch === '%') return LatexCmds.percentof(ch); - else if ((cons = CharCmds[ch] || LatexCmds[ch])) { - if (cons.constructor) { - return new cons(ch); - } else { - return cons(ch); - } - } else return new VanillaSymbol(ch); - }; - MathBlock.prototype.write = function (cursor, ch) { - var cmd = this.chToCmd(ch, cursor.options); - if (cursor.selection) cmd.replaces(cursor.replaceSelection()); - if (!cursor.isTooDeep()) { - cmd.createLeftOf(cursor.show()); - // special-case the slash so that fractions are voiced while typing - if (ch === '/') { - cursor.controller.aria.alert('over'); - } else { - cursor.controller.aria.alert(cmd.mathspeak({ createdLeftOf: cursor })); - } - } - }; - MathBlock.prototype.writeLatex = function (cursor, latex) { - var all = Parser.all; - var eof = Parser.eof; - var block = latexMathParser.skip(eof).or(all.result(false)).parse(latex); - if (block && !block.isEmpty() && block.prepareInsertionAt(cursor)) { - block.children().adopt(cursor.parent, cursor[L], cursor[R]); // TODO - masking undefined. should be 0 - domFrag(block.html()).insertBefore(cursor.domFrag()); - cursor[L] = block.getEnd(R); - block.finalizeInsert(cursor.options, cursor); - var blockEndsR = block.getEnd(R); - var blockEndsL = block.getEnd(L); - var blockEndsRR = blockEndsR[R]; - var blockEndsLL = blockEndsL[L]; - if (blockEndsRR) blockEndsRR.siblingCreated(cursor.options, L); - if (blockEndsLL) blockEndsLL.siblingCreated(cursor.options, R); - cursor.parent.bubble(function (node) { - node.reflow(); - return undefined; - }); - } - }; - MathBlock.prototype.focus = function () { - this.domFrag().addClass('dcg-mq-hasCursor'); - this.domFrag().removeClass('dcg-mq-empty'); - return this; - }; - MathBlock.prototype.blur = function (cursor) { - this.domFrag().removeClass('dcg-mq-hasCursor'); - if (this.isEmpty()) { - this.domFrag().addClass('dcg-mq-empty'); - if (cursor && this.isQuietEmptyDelimiter(cursor.options.quietEmptyDelimiters)) { - this.domFrag().addClass('dcg-mq-quiet-delimiter'); - } - } - return this; - }; - return MathBlock; - })(MathElement); - Options.prototype.mouseEvents = true; - API.StaticMath = function (APIClasses) { - var _c; - return ( - (_c = /** @class */ (function (_super) { - __extends(StaticMath, _super); - function StaticMath(el) { - var _this_1 = _super.call(this, el) || this; - var innerFields = (_this_1.innerFields = []); - _this_1.__controller.root.postOrder(function (node) { - node.registerInnerField(innerFields, APIClasses.InnerMathField); - }); - return _this_1; - } - StaticMath.prototype.__mathquillify = function (opts, _interfaceVersion) { - this.config(opts); - _super.prototype.mathquillify.call(this, 'dcg-mq-math-mode'); - this.__controller.setupStaticField(); - if (this.__options.mouseEvents) { - this.__controller.addMouseEventListener(); - this.__controller.staticMathTextareaEvents(); - } - return this; - }; - StaticMath.prototype.latex = function (_latex) { - var returned = _super.prototype.latex.apply(this, arguments); - if (arguments.length > 0) { - var innerFields = (this.innerFields = []); - this.__controller.root.postOrder(function (node) { - node.registerInnerField(innerFields, APIClasses.InnerMathField); - }); - // Force an ARIA label update to remain in sync with the new LaTeX value. - this.__controller.updateMathspeak(); - } - return returned; - }; - StaticMath.prototype.setAriaLabel = function (ariaLabel) { - this.__controller.setAriaLabel(ariaLabel); - return this; - }; - StaticMath.prototype.getAriaLabel = function () { - return this.__controller.getAriaLabel(); - }; - return StaticMath; - })(APIClasses.AbstractMathQuill)), - (_c.RootBlock = MathBlock), - _c - ); - }; - var RootMathBlock = /** @class */ (function (_super) { - __extends(RootMathBlock, _super); - function RootMathBlock() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - return RootMathBlock; - })(MathBlock); - RootBlockMixin(RootMathBlock.prototype); // adds methods to RootMathBlock - API.MathField = function (APIClasses) { - var _c; - return ( - (_c = /** @class */ (function (_super) { - __extends(MathField, _super); - function MathField() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - MathField.prototype.__mathquillify = function (opts, interfaceVersion) { - this.config(opts); - if (interfaceVersion > 1) this.__controller.root.reflow = noop; - _super.prototype.mathquillify.call(this, 'dcg-mq-editable-field dcg-mq-math-mode'); - // TODO: Why does this need to be deleted (contrary to the type definition)? Could we set it to `noop` instead? - delete this.__controller.root.reflow; - return this; - }; - return MathField; - })(APIClasses.EditableField)), - (_c.RootBlock = RootMathBlock), - _c - ); - }; - API.InnerMathField = function (APIClasses) { - pray('MathField class is defined', APIClasses.MathField); - return /** @class */ (function (_super) { - __extends(class_1, _super); - function class_1() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - class_1.prototype.makeStatic = function () { - this.__controller.editable = false; - this.__controller.root.blur(); - this.__controller.unbindEditablesEvents(); - domFrag(this.__controller.container).removeClass('dcg-mq-editable-field'); - }; - class_1.prototype.makeEditable = function () { - this.__controller.editable = true; - this.__controller.editablesTextareaEvents(); - this.__controller.cursor.insAtRightEnd(this.__controller.root); - domFrag(this.__controller.container).addClass('dcg-mq-editable-field'); - }; - return class_1; - })(APIClasses.MathField); - }; - /************************************************* - * Abstract classes of text blocks - ************************************************/ - /** - * Blocks of plain text, with one or two TextPiece's as children. - * Represents flat strings of typically serif-font Roman characters, as - * opposed to hierchical, nested, tree-structured math. - * Wraps a single HTMLSpanElement. - */ - var TextBlock = /** @class */ (function (_super) { - __extends(TextBlock, _super); - function TextBlock() { - var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; - _this_1.ctrlSeq = '\\text'; - _this_1.ariaLabel = 'Text'; - _this_1.mathspeakTemplate = ['StartText', 'EndText']; - return _this_1; - } - TextBlock.prototype.replaces = function (replacedText) { - if (replacedText instanceof Fragment) { - this.replacedText = replacedText.remove().domFrag().text(); - } else if (typeof replacedText === 'string') this.replacedText = replacedText; - }; - TextBlock.prototype.setDOMFrag = function (el) { - _super.prototype.setDOM.call(this, el); - var endsL = this.getEnd(L); - if (endsL) { - var children = this.domFrag().children(); - if (!children.isEmpty()) { - endsL.setDOM(children.oneText()); - } - } - return this; - }; - TextBlock.prototype.createLeftOf = function (cursor) { - var textBlock = this; - _super.prototype.createLeftOf.call(this, cursor); - cursor.insAtRightEnd(textBlock); - if (textBlock.replacedText) - for (var i = 0; i < textBlock.replacedText.length; i += 1) - textBlock.write(cursor, textBlock.replacedText.charAt(i)); - var textBlockR = textBlock[R]; - if (textBlockR) textBlockR.siblingCreated(cursor.options, L); - var textBlockL = textBlock[L]; - if (textBlockL) textBlockL.siblingCreated(cursor.options, R); - textBlock.bubble(function (node) { - node.reflow(); - return undefined; - }); - }; - TextBlock.prototype.parser = function () { - var textBlock = this; - // TODO: correctly parse text mode - var string = Parser.string; - var regex = Parser.regex; - var optWhitespace = Parser.optWhitespace; - return optWhitespace - .then(string('{')) - .then(regex(/^[^}]*/)) - .skip(string('}')) - .map(function (text) { - if (text.length === 0) return new Fragment(0, 0); - new TextPiece(text).adopt(textBlock, 0, 0); - return textBlock; - }); - }; - TextBlock.prototype.textContents = function () { - return this.foldChildren('', function (text, child) { - return text + child.textStr; - }); - }; - TextBlock.prototype.text = function () { - return '"' + this.textContents() + '"'; - }; - TextBlock.prototype.latexRecursive = function (ctx) { - this.checkCursorContextOpen(ctx); - var contents = this.textContents(); - if (contents.length > 0) { - ctx.latex += this.ctrlSeq + '{'; - ctx.latex += contents.replace(/\\/g, '\\backslash ').replace(/[{}]/g, '\\$&'); - ctx.latex += '}'; - } - this.checkCursorContextClose(ctx); - }; - TextBlock.prototype.html = function () { - var out = h('span', { class: 'dcg-mq-text-mode' }, [h.text(this.textContents())]); - this.setDOM(out); - NodeBase.linkElementByCmdNode(out, this); - return out; - }; - TextBlock.prototype.mathspeak = function (opts) { - if (opts && opts.ignoreShorthand) { - return this.mathspeakTemplate[0] + ', ' + this.textContents() + ', ' + this.mathspeakTemplate[1]; - } else { - return this.textContents(); - } - }; - TextBlock.prototype.isTextBlock = function () { - return true; - }; - // editability methods: called by the cursor for editing, cursor movements, - // and selection of the MathQuill tree, these all take in a direction and - // the cursor - TextBlock.prototype.moveTowards = function (dir, cursor) { - cursor.insAtDirEnd(-dir, this); - cursor.controller.aria.queueDirEndOf(-dir).queue(cursor.parent, true); - }; - TextBlock.prototype.moveOutOf = function (dir, cursor) { - cursor.insDirOf(dir, this); - cursor.controller.aria.queueDirOf(dir).queue(this); - }; - TextBlock.prototype.unselectInto = function (dir, cursor) { - this.moveTowards(dir, cursor); - }; - // TODO: make these methods part of a shared mixin or something. - TextBlock.prototype.selectTowards = function (dir, cursor) { - MathCommand.prototype.selectTowards.call(this, dir, cursor); - }; - TextBlock.prototype.deleteTowards = function (dir, cursor) { - MathCommand.prototype.deleteTowards.call(this, dir, cursor); - }; - TextBlock.prototype.selectOutOf = function (dir, cursor) { - cursor.insDirOf(dir, this); - }; - TextBlock.prototype.deleteOutOf = function (_dir, cursor) { - // backspace and delete at ends of block don't unwrap - if (this.isEmpty()) cursor.insRightOf(this); - }; - TextBlock.prototype.write = function (cursor, ch) { - cursor.show().deleteSelection(); - if (ch !== '$') { - var cursorL = cursor[L]; - if (!cursorL) new TextPiece(ch).createLeftOf(cursor); - else if (cursorL instanceof TextPiece) cursorL.appendText(ch); - } else if (this.isEmpty()) { - cursor.insRightOf(this); - new VanillaSymbol('\\$', h.text('$')).createLeftOf(cursor); - } else if (!cursor[R]) cursor.insRightOf(this); - else if (!cursor[L]) cursor.insLeftOf(this); - else { - // split apart - var leftBlock = new TextBlock(); - var leftPc = this.getEnd(L); - if (leftPc) { - leftPc.disown().domFrag().detach(); - leftPc.adopt(leftBlock, 0, 0); - } - cursor.insLeftOf(this); - _super.prototype.createLeftOf.call(leftBlock, cursor); // micro-optimization, not for correctness - } - this.bubble(function (node) { - node.reflow(); - return undefined; - }); - // TODO needs tests - cursor.controller.aria.alert(ch); - }; - TextBlock.prototype.writeLatex = function (cursor, latex) { - var cursorL = cursor[L]; - if (!cursorL) new TextPiece(latex).createLeftOf(cursor); - else if (cursorL instanceof TextPiece) cursorL.appendText(latex); - this.bubble(function (node) { - node.reflow(); - return undefined; - }); - }; - TextBlock.prototype.seek = function (clientX, cursor) { - cursor.hide(); - var textPc = TextBlockFuseChildren(this); - if (!textPc) return; - // insert cursor at approx position in DOMTextNode - var textNode = this.domFrag().children().oneText(); - var range = document.createRange(); - range.selectNodeContents(textNode); - var rects = range.getClientRects(); - if (rects.length === 1) { - var _c = rects[0], - width = _c.width, - left = _c.left; - var avgChWidth = width / this.textContents().length; - var approxPosition = Math.round((clientX - left) / avgChWidth); - if (approxPosition <= 0) { - cursor.insAtLeftEnd(this); - } else if (approxPosition >= textPc.textStr.length) { - cursor.insAtRightEnd(this); - } else { - cursor.insLeftOf(textPc.splitRight(approxPosition)); - } - } else { - cursor.insAtLeftEnd(this); - } - // move towards mousedown (clientX) - var displ = clientX - cursor.show().getBoundingClientRectWithoutMargin().left; // displacement - var dir = displ && displ < 0 ? L : R; - var prevDispl = dir; - // displ * prevDispl > 0 iff displacement direction === previous direction - while (cursor[dir] && displ * prevDispl > 0) { - cursor[dir].moveTowards(dir, cursor); - prevDispl = displ; - displ = clientX - cursor.getBoundingClientRectWithoutMargin().left; - } - if (dir * displ < -dir * prevDispl) cursor[-dir].moveTowards(-dir, cursor); - if (!cursor.anticursor) { - // about to start mouse-selecting, the anticursor is gonna get put here - var cursorL = cursor[L]; - this.anticursorPosition = cursorL && cursorL.textStr.length; - // ^ get it? 'cos if there's no cursor[L], it's 0... I'm a terrible person. - } else if (cursor.anticursor.parent === this) { - // mouse-selecting within this TextBlock, re-insert the anticursor - var cursorL = cursor[L]; - var cursorPosition = cursorL && cursorL.textStr.length; - if (this.anticursorPosition === cursorPosition) { - cursor.anticursor = Anticursor.fromCursor(cursor); - } else { - if (this.anticursorPosition < cursorPosition) { - var newTextPc = cursorL.splitRight(this.anticursorPosition); - cursor[L] = newTextPc; - } else { - var cursorR = cursor[R]; - var newTextPc = cursorR.splitRight(this.anticursorPosition - cursorPosition); - } - cursor.anticursor = new Anticursor(this, newTextPc[L], newTextPc); - } - } - }; - TextBlock.prototype.blur = function (cursor) { - MathBlock.prototype.blur.call(this, cursor); - if (!cursor) return; - if (this.textContents() === '') { - this.remove(); - if (cursor[L] === this) cursor[L] = this[L]; - else if (cursor[R] === this) cursor[R] = this[R]; - } else TextBlockFuseChildren(this); - }; - TextBlock.prototype.focus = function () { - MathBlock.prototype.focus.call(this); - }; - return TextBlock; - })(MQNode); - function TextBlockFuseChildren(self) { - self.domFrag().oneElement().normalize(); - var children = self.domFrag().children(); - if (children.isEmpty()) return; - var textPcDom = children.oneText(); - pray('only node in TextBlock span is Text node', textPcDom.nodeType === 3); - // nodeType === 3 has meant a Text node since ancient times: - // http://reference.sitepoint.com/javascript/Node/nodeType - var textPc = new TextPiece(textPcDom.data); - textPc.setDOM(textPcDom); - self.children().disown(); - textPc.adopt(self, 0, 0); - return textPc; - } - /** - * Piece of plain text, with a TextBlock as a parent and no children. - * Wraps a single DOMTextNode. - * For convenience, has a .textStr property that's just a JavaScript string - * mirroring the text contents of the DOMTextNode. - * Text contents must always be nonempty. - */ - var TextPiece = /** @class */ (function (_super) { - __extends(TextPiece, _super); - function TextPiece(text) { - var _this_1 = _super.call(this) || this; - _this_1.textStr = text; - return _this_1; - } - TextPiece.prototype.html = function () { - var out = h.text(this.textStr); - this.setDOM(out); - return out; - }; - TextPiece.prototype.appendText = function (text) { - this.textStr += text; - this.domFrag().oneText().appendData(text); - }; - TextPiece.prototype.prependText = function (text) { - this.textStr = text + this.textStr; - this.domFrag().oneText().insertData(0, text); - }; - TextPiece.prototype.insTextAtDirEnd = function (text, dir) { - prayDirection(dir); - if (dir === R) this.appendText(text); - else this.prependText(text); - }; - TextPiece.prototype.splitRight = function (i) { - var newPc = new TextPiece(this.textStr.slice(i)).adopt(this.parent, this, this[R]); - newPc.setDOM(this.domFrag().oneText().splitText(i)); - this.textStr = this.textStr.slice(0, i); - return newPc; - }; - TextPiece.prototype.endChar = function (dir, text) { - return text.charAt(dir === L ? 0 : -1 + text.length); - }; - TextPiece.prototype.moveTowards = function (dir, cursor) { - prayDirection(dir); - var ch = this.endChar(-dir, this.textStr); - var from = this[-dir]; - if (from instanceof TextPiece) from.insTextAtDirEnd(ch, dir); - else new TextPiece(ch).createDir(-dir, cursor); - return this.deleteTowards(dir, cursor); - }; - TextPiece.prototype.mathspeak = function () { - return this.textStr; - }; - TextPiece.prototype.latexRecursive = function (ctx) { - this.checkCursorContextOpen(ctx); - ctx.latex += this.textStr; - this.checkCursorContextClose(ctx); - }; - TextPiece.prototype.deleteTowards = function (dir, cursor) { - if (this.textStr.length > 1) { - var deletedChar; - if (dir === R) { - this.domFrag().oneText().deleteData(0, 1); - deletedChar = this.textStr[0]; - this.textStr = this.textStr.slice(1); - } else { - // note that the order of these 2 lines is annoyingly important - // (the second line mutates this.textStr.length) - this.domFrag() - .oneText() - .deleteData(-1 + this.textStr.length, 1); - deletedChar = this.textStr[this.textStr.length - 1]; - this.textStr = this.textStr.slice(0, -1); - } - cursor.controller.aria.queue(deletedChar); - } else { - this.remove(); - cursor[dir] = this[dir]; - cursor.controller.aria.queue(this.textStr); - } - }; - TextPiece.prototype.selectTowards = function (dir, cursor) { - prayDirection(dir); - var anticursor = cursor.anticursor; - if (!anticursor) return; - var ch = this.endChar(-dir, this.textStr); - if (anticursor[dir] === this) { - var newPc = new TextPiece(ch).createDir(dir, cursor); - anticursor[dir] = newPc; - cursor.insDirOf(dir, newPc); - } else { - var from = this[-dir]; - if (from instanceof TextPiece) from.insTextAtDirEnd(ch, dir); - else { - var newPc = new TextPiece(ch).createDir(-dir, cursor); - var selection = cursor.selection; - if (selection) { - newPc.domFrag().insDirOf(-dir, selection.domFrag()); - } - } - if (this.textStr.length === 1 && anticursor[-dir] === this) { - anticursor[-dir] = this[-dir]; // `this` will be removed in deleteTowards - } - } - return this.deleteTowards(dir, cursor); - }; - return TextPiece; - })(MQNode); - LatexCmds.text = LatexCmds.textnormal = LatexCmds.textrm = LatexCmds.textup = LatexCmds.textmd = TextBlock; - function makeTextBlock(latex, ariaLabel, tagName, attrs) { - return /** @class */ (function (_super) { - __extends(class_2, _super); - function class_2() { - var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; - _this_1.ctrlSeq = latex; - _this_1.mathspeakTemplate = ['Start' + ariaLabel, 'End' + ariaLabel]; - _this_1.ariaLabel = ariaLabel; - return _this_1; - } - class_2.prototype.html = function () { - var out = h(tagName, attrs, [h.text(this.textContents())]); - this.setDOM(out); - NodeBase.linkElementByCmdNode(out, this); - return out; - }; - return class_2; - })(TextBlock); - } - LatexCmds.em = LatexCmds.italic = LatexCmds.italics = LatexCmds.emph = LatexCmds.textit = LatexCmds.textsl = makeTextBlock( - '\\textit', - 'Italic', - 'i', - { class: 'dcg-mq-text-mode' } - ); - LatexCmds.strong = LatexCmds.bold = LatexCmds.textbf = makeTextBlock('\\textbf', 'Bold', 'b', { - class: 'dcg-mq-text-mode', - }); - LatexCmds.sf = LatexCmds.textsf = makeTextBlock('\\textsf', 'Sans serif font', 'span', { - class: 'dcg-mq-sans-serif dcg-mq-text-mode', - }); - LatexCmds.tt = LatexCmds.texttt = makeTextBlock('\\texttt', 'Mono space font', 'span', { - class: 'dcg-mq-monospace dcg-mq-text-mode', - }); - LatexCmds.textsc = makeTextBlock('\\textsc', 'Variable font', 'span', { - style: 'font-variant:small-caps', - class: 'dcg-mq-text-mode', - }); - LatexCmds.uppercase = makeTextBlock('\\uppercase', 'Uppercase', 'span', { - style: 'text-transform:uppercase', - class: 'dcg-mq-text-mode', - }); - LatexCmds.lowercase = makeTextBlock('\\lowercase', 'Lowercase', 'span', { - style: 'text-transform:lowercase', - class: 'dcg-mq-text-mode', - }); - var RootMathCommand = /** @class */ (function (_super) { - __extends(RootMathCommand, _super); - function RootMathCommand(cursor) { - var _this_1 = _super.call(this, '$') || this; - _this_1.domView = new DOMView(1, function (blocks) { - return h.block('span', { class: 'dcg-mq-math-mode' }, blocks[0]); - }); - _this_1.cursor = cursor; - return _this_1; - } - RootMathCommand.prototype.createBlocks = function () { - _super.prototype.createBlocks.call(this); - var endsL = this.getEnd(L); // TODO - how do we know this is a RootMathCommand? - endsL.cursor = this.cursor; - endsL.write = function (cursor, ch) { - if (ch !== '$') MathBlock.prototype.write.call(this, cursor, ch); - else if (this.isEmpty()) { - cursor.insRightOf(this.parent); - this.parent.deleteTowards(undefined, cursor); - new VanillaSymbol('\\$', h.text('$')).createLeftOf(cursor.show()); - } else if (!cursor[R]) cursor.insRightOf(this.parent); - else if (!cursor[L]) cursor.insLeftOf(this.parent); - else MathBlock.prototype.write.call(this, cursor, ch); - }; - }; - RootMathCommand.prototype.latexRecursive = function (ctx) { - this.checkCursorContextOpen(ctx); - ctx.latex += '$'; - this.getEnd(L).latexRecursive(ctx); - ctx.latex += '$'; - this.checkCursorContextClose(ctx); - }; - return RootMathCommand; - })(MathCommand); - var RootTextBlock = /** @class */ (function (_super) { - __extends(RootTextBlock, _super); - function RootTextBlock() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - RootTextBlock.prototype.keystroke = function (key, e, ctrlr) { - if (key === 'Spacebar' || key === 'Shift-Spacebar') return; - return _super.prototype.keystroke.call(this, key, e, ctrlr); - }; - RootTextBlock.prototype.write = function (cursor, ch) { - cursor.show().deleteSelection(); - if (ch === '$') new RootMathCommand(cursor).createLeftOf(cursor); - else { - var html; - if (ch === '<') html = h.entityText('<'); - else if (ch === '>') html = h.entityText('>'); - new VanillaSymbol(ch, html).createLeftOf(cursor); - } - }; - return RootTextBlock; - })(RootMathBlock); - API.TextField = function (APIClasses) { - var _c; - return ( - (_c = /** @class */ (function (_super) { - __extends(TextField, _super); - function TextField() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - TextField.prototype.__mathquillify = function () { - _super.prototype.mathquillify.call(this, 'dcg-mq-editable-field dcg-mq-text-mode'); - return this; - }; - TextField.prototype.latex = function (latex) { - if (latex) { - this.__controller.renderLatexText(latex); - if (this.__controller.blurred) this.__controller.cursor.hide().parent.blur(); - var _this = this; // just to help help TS out - return _this; - } - return this.__controller.exportLatex(); - }; - return TextField; - })(APIClasses.EditableField)), - (_c.RootBlock = RootTextBlock), - _c - ); - }; - /************************************ - * Symbols for Advanced Mathematics - ***********************************/ - LatexCmds.notin = LatexCmds.cong = LatexCmds.equiv = LatexCmds.oplus = LatexCmds.otimes = function (latex) { - return new BinaryOperator('\\' + latex + ' ', h.entityText('&' + latex + ';')); - }; - LatexCmds['\u2217'] = LatexCmds.ast = LatexCmds.star = LatexCmds.loast = LatexCmds.lowast = bindBinaryOperator( - '\\ast ', - '∗', - 'low asterisk' - ); - LatexCmds.therefor = LatexCmds.therefore = bindBinaryOperator('\\therefore ', '∴', 'therefore'); - LatexCmds.cuz = LatexCmds.because = bindBinaryOperator( - // l33t - '\\because ', - '∵', - 'because' - ); - LatexCmds.prop = LatexCmds.propto = bindBinaryOperator('\\propto ', '∝', 'proportional to'); - LatexCmds['\u2248'] = LatexCmds.asymp = LatexCmds.approx = bindBinaryOperator( - '\\approx ', - '≈', - 'approximately equal to' - ); - LatexCmds.isin = LatexCmds['in'] = bindBinaryOperator('\\in ', '∈', 'is in'); - LatexCmds.ni = LatexCmds.contains = bindBinaryOperator('\\ni ', '∋', 'is not in'); - LatexCmds.notni = LatexCmds.niton = LatexCmds.notcontains = LatexCmds.doesnotcontain = bindBinaryOperator( - '\\not\\ni ', - '∌', - 'does not contain' - ); - LatexCmds.sub = LatexCmds.subset = bindBinaryOperator('\\subset ', '⊂', 'subset'); - LatexCmds.sup = LatexCmds.supset = LatexCmds.superset = bindBinaryOperator('\\supset ', '⊃', 'superset'); - LatexCmds.nsub = LatexCmds.notsub = LatexCmds.nsubset = LatexCmds.notsubset = bindBinaryOperator( - '\\not\\subset ', - '⊄', - 'not a subset' - ); - LatexCmds.nsup = LatexCmds.notsup = LatexCmds.nsupset = LatexCmds.notsupset = LatexCmds.nsuperset = LatexCmds.notsuperset = bindBinaryOperator( - '\\not\\supset ', - '⊅', - 'not a superset' - ); - LatexCmds.sube = LatexCmds.subeq = LatexCmds.subsete = LatexCmds.subseteq = bindBinaryOperator( - '\\subseteq ', - '⊆', - 'subset or equal to' - ); - LatexCmds.supe = LatexCmds.supeq = LatexCmds.supsete = LatexCmds.supseteq = LatexCmds.supersete = LatexCmds.superseteq = bindBinaryOperator( - '\\supseteq ', - '⊇', - 'superset or equal to' - ); - LatexCmds.nsube = LatexCmds.nsubeq = LatexCmds.notsube = LatexCmds.notsubeq = LatexCmds.nsubsete = LatexCmds.nsubseteq = LatexCmds.notsubsete = LatexCmds.notsubseteq = bindBinaryOperator( - '\\not\\subseteq ', - '⊈', - 'not subset or equal to' - ); - LatexCmds.nsupe = LatexCmds.nsupeq = LatexCmds.notsupe = LatexCmds.notsupeq = LatexCmds.nsupsete = LatexCmds.nsupseteq = LatexCmds.notsupsete = LatexCmds.notsupseteq = LatexCmds.nsupersete = LatexCmds.nsuperseteq = LatexCmds.notsupersete = LatexCmds.notsuperseteq = bindBinaryOperator( - '\\not\\supseteq ', - '⊉', - 'not superset or equal to' - ); - //the canonical sets of numbers - LatexCmds.mathbb = /** @class */ (function (_super) { - __extends(class_3, _super); - function class_3() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - class_3.prototype.createLeftOf = function (_cursor) {}; - class_3.prototype.numBlocks = function () { - return 1; - }; - class_3.prototype.parser = function () { - var string = Parser.string; - var regex = Parser.regex; - var optWhitespace = Parser.optWhitespace; - return optWhitespace - .then(string('{')) - .then(optWhitespace) - .then(regex(/^[NPZQRCH]/)) - .skip(optWhitespace) - .skip(string('}')) - .map(function (c) { - // instantiate the class for the matching char - var cmd = LatexCmds[c]; - if (isMQNodeClass(cmd)) { - return new cmd(); - } else { - return cmd(); - } - }); - }; - return class_3; - })(MathCommand); - LatexCmds.N = LatexCmds.naturals = LatexCmds.Naturals = bindVanillaSymbol('\\mathbb{N}', 'ℕ', 'naturals'); - LatexCmds.P = LatexCmds.primes = LatexCmds.Primes = LatexCmds.projective = LatexCmds.Projective = LatexCmds.probability = LatexCmds.Probability = bindVanillaSymbol( - '\\mathbb{P}', - 'ℙ', - 'P' - ); - LatexCmds.Z = LatexCmds.integers = LatexCmds.Integers = bindVanillaSymbol('\\mathbb{Z}', 'ℤ', 'integers'); - LatexCmds.Q = LatexCmds.rationals = LatexCmds.Rationals = bindVanillaSymbol( - '\\mathbb{Q}', - 'ℚ', - 'rationals' - ); - LatexCmds.R = LatexCmds.reals = LatexCmds.Reals = bindVanillaSymbol('\\mathbb{R}', 'ℝ', 'reals'); - LatexCmds.C = LatexCmds.complex = LatexCmds.Complex = LatexCmds.complexes = LatexCmds.Complexes = LatexCmds.complexplane = LatexCmds.Complexplane = LatexCmds.ComplexPlane = bindVanillaSymbol( - '\\mathbb{C}', - 'ℂ', - 'complexes' - ); - LatexCmds.H = LatexCmds.Hamiltonian = LatexCmds.quaternions = LatexCmds.Quaternions = bindVanillaSymbol( - '\\mathbb{H}', - 'ℍ', - 'quaternions' - ); - //spacing - LatexCmds.quad = LatexCmds.emsp = bindVanillaSymbol('\\quad ', ' ', '4 spaces'); - LatexCmds.qquad = bindVanillaSymbol('\\qquad ', ' ', '8 spaces'); - /* spacing special characters, gonna have to implement this in LatexCommandInput::onText somehow - case ',': - return VanillaSymbol('\\, ',' ', 'comma'); - case ':': - return VanillaSymbol('\\: ',' ', 'colon'); - case ';': - return VanillaSymbol('\\; ',' ', 'semicolon'); - case '!': - return MQSymbol('\\! ','', 'exclamation point'); - */ - //binary operators - LatexCmds.diamond = bindVanillaSymbol('\\diamond ', '◇', 'diamond'); - LatexCmds.bigtriangleup = bindVanillaSymbol('\\bigtriangleup ', '△', 'triangle up'); - LatexCmds.ominus = bindVanillaSymbol('\\ominus ', '⊖', 'o minus'); - LatexCmds.uplus = bindVanillaSymbol('\\uplus ', '⊎', 'disjoint union'); - LatexCmds.bigtriangledown = bindVanillaSymbol('\\bigtriangledown ', '▽', 'triangle down'); - LatexCmds.sqcap = bindVanillaSymbol('\\sqcap ', '⊓', 'greatest lower bound'); - LatexCmds.triangleleft = bindVanillaSymbol('\\triangleleft ', '⊲', 'triangle left'); - LatexCmds.sqcup = bindVanillaSymbol('\\sqcup ', '⊔', 'least upper bound'); - LatexCmds.triangleright = bindVanillaSymbol('\\triangleright ', '⊳', 'triangle right'); - //circledot is not a not real LaTex command see https://github.com/mathquill/mathquill/pull/552 for more details - LatexCmds.odot = LatexCmds.circledot = bindVanillaSymbol('\\odot ', '⊙', 'circle dot'); - LatexCmds.bigcirc = bindVanillaSymbol('\\bigcirc ', '◯', 'circle'); - LatexCmds.dagger = bindVanillaSymbol('\\dagger ', '†', 'dagger'); - LatexCmds.ddagger = bindVanillaSymbol('\\ddagger ', '‡', 'big dagger'); - LatexCmds.wr = bindVanillaSymbol('\\wr ', '≀', 'wreath'); - LatexCmds.amalg = bindVanillaSymbol('\\amalg ', '∐', 'amalgam'); - //relationship symbols - LatexCmds.models = bindVanillaSymbol('\\models ', '⊨', 'models'); - LatexCmds.prec = bindVanillaSymbol('\\prec ', '≺', 'precedes'); - LatexCmds.succ = bindVanillaSymbol('\\succ ', '≻', 'succeeds'); - LatexCmds.preceq = bindVanillaSymbol('\\preceq ', '≼', 'precedes or equals'); - LatexCmds.succeq = bindVanillaSymbol('\\succeq ', '≽', 'succeeds or equals'); - LatexCmds.simeq = bindVanillaSymbol('\\simeq ', '≃', 'similar or equal to'); - LatexCmds.mid = bindVanillaSymbol('\\mid ', '∣', 'divides'); - LatexCmds.ll = bindVanillaSymbol('\\ll ', '≪', 'll'); - LatexCmds.gg = bindVanillaSymbol('\\gg ', '≫', 'gg'); - LatexCmds.parallel = bindVanillaSymbol('\\parallel ', '∥', 'parallel with'); - LatexCmds.nparallel = bindVanillaSymbol('\\nparallel ', '∦', 'not parallel with'); - LatexCmds.bowtie = bindVanillaSymbol('\\bowtie ', '⋈', 'bowtie'); - LatexCmds.sqsubset = bindVanillaSymbol('\\sqsubset ', '⊏', 'square subset'); - LatexCmds.sqsupset = bindVanillaSymbol('\\sqsupset ', '⊐', 'square superset'); - LatexCmds.smile = bindVanillaSymbol('\\smile ', '⌣', 'smile'); - LatexCmds.sqsubseteq = bindVanillaSymbol('\\sqsubseteq ', '⊑', 'square subset or equal to'); - LatexCmds.sqsupseteq = bindVanillaSymbol('\\sqsupseteq ', '⊒', 'square superset or equal to'); - LatexCmds.doteq = bindVanillaSymbol('\\doteq ', '≐', 'dotted equals'); - LatexCmds.frown = bindVanillaSymbol('\\frown ', '⌢', 'frown'); - LatexCmds.vdash = bindVanillaSymbol('\\vdash ', '⊦', 'v dash'); - LatexCmds.dashv = bindVanillaSymbol('\\dashv ', '⊣', 'dash v'); - LatexCmds.nless = bindVanillaSymbol('\\nless ', '≮', 'not less than'); - LatexCmds.ngtr = bindVanillaSymbol('\\ngtr ', '≯', 'not greater than'); - //arrows - LatexCmds.longleftarrow = bindVanillaSymbol('\\longleftarrow ', '←', 'left arrow'); - LatexCmds.longrightarrow = bindVanillaSymbol('\\longrightarrow ', '→', 'right arrow'); - LatexCmds.Longleftarrow = bindVanillaSymbol('\\Longleftarrow ', '⇐', 'left arrow'); - LatexCmds.Longrightarrow = bindVanillaSymbol('\\Longrightarrow ', '⇒', 'right arrow'); - LatexCmds.longleftrightarrow = bindVanillaSymbol('\\longleftrightarrow ', '↔', 'left and right arrow'); - LatexCmds.updownarrow = bindVanillaSymbol('\\updownarrow ', '↕', 'up and down arrow'); - LatexCmds.Longleftrightarrow = bindVanillaSymbol('\\Longleftrightarrow ', '⇔', 'left and right arrow'); - LatexCmds.Updownarrow = bindVanillaSymbol('\\Updownarrow ', '⇕', 'up and down arrow'); - LatexCmds.mapsto = bindVanillaSymbol('\\mapsto ', '↦', 'maps to'); - LatexCmds.nearrow = bindVanillaSymbol('\\nearrow ', '↗', 'northeast arrow'); - LatexCmds.hookleftarrow = bindVanillaSymbol('\\hookleftarrow ', '↩', 'hook left arrow'); - LatexCmds.hookrightarrow = bindVanillaSymbol('\\hookrightarrow ', '↪', 'hook right arrow'); - LatexCmds.searrow = bindVanillaSymbol('\\searrow ', '↘', 'southeast arrow'); - LatexCmds.leftharpoonup = bindVanillaSymbol('\\leftharpoonup ', '↼', 'left harpoon up'); - LatexCmds.rightharpoonup = bindVanillaSymbol('\\rightharpoonup ', '⇀', 'right harpoon up'); - LatexCmds.swarrow = bindVanillaSymbol('\\swarrow ', '↙', 'southwest arrow'); - LatexCmds.leftharpoondown = bindVanillaSymbol('\\leftharpoondown ', '↽', 'left harpoon down'); - LatexCmds.rightharpoondown = bindVanillaSymbol('\\rightharpoondown ', '⇁', 'right harpoon down'); - LatexCmds.nwarrow = bindVanillaSymbol('\\nwarrow ', '↖', 'northwest arrow'); - //Misc - LatexCmds.ldots = bindVanillaSymbol('\\ldots ', '…', 'l dots'); - LatexCmds.cdots = bindVanillaSymbol('\\cdots ', '⋯', 'c dots'); - LatexCmds.vdots = bindVanillaSymbol('\\vdots ', '⋮', 'v dots'); - LatexCmds.ddots = bindVanillaSymbol('\\ddots ', '⋱', 'd dots'); - LatexCmds.surd = bindVanillaSymbol('\\surd ', '√', 'unresolved root'); - LatexCmds.triangle = bindVanillaSymbol('\\triangle ', '△', 'triangle'); - LatexCmds.ell = bindVanillaSymbol('\\ell ', 'ℓ', 'ell'); - LatexCmds.top = bindVanillaSymbol('\\top ', '⊤', 'top'); - LatexCmds.flat = bindVanillaSymbol('\\flat ', '♭', 'flat'); - LatexCmds.natural = bindVanillaSymbol('\\natural ', '♮', 'natural'); - LatexCmds.sharp = bindVanillaSymbol('\\sharp ', '♯', 'sharp'); - LatexCmds.wp = bindVanillaSymbol('\\wp ', '℘', 'wp'); - LatexCmds.bot = bindVanillaSymbol('\\bot ', '⊥', 'bot'); - LatexCmds.clubsuit = bindVanillaSymbol('\\clubsuit ', '♣', 'club suit'); - LatexCmds.diamondsuit = bindVanillaSymbol('\\diamondsuit ', '♢', 'diamond suit'); - LatexCmds.heartsuit = bindVanillaSymbol('\\heartsuit ', '♡', 'heart suit'); - LatexCmds.spadesuit = bindVanillaSymbol('\\spadesuit ', '♠', 'spade suit'); - //not real LaTex command see https://github.com/mathquill/mathquill/pull/552 for more details - LatexCmds.parallelogram = bindVanillaSymbol('\\parallelogram ', '▱', 'parallelogram'); - LatexCmds.square = bindVanillaSymbol('\\square ', '⬜', 'square'); - //variable-sized - LatexCmds.oint = bindVanillaSymbol('\\oint ', '∮', 'o int'); - LatexCmds.bigcap = bindVanillaSymbol('\\bigcap ', '∩', 'big cap'); - LatexCmds.bigcup = bindVanillaSymbol('\\bigcup ', '∪', 'big cup'); - LatexCmds.bigsqcup = bindVanillaSymbol('\\bigsqcup ', '⊔', 'big square cup'); - LatexCmds.bigvee = bindVanillaSymbol('\\bigvee ', '∨', 'big vee'); - LatexCmds.bigwedge = bindVanillaSymbol('\\bigwedge ', '∧', 'big wedge'); - LatexCmds.bigodot = bindVanillaSymbol('\\bigodot ', '⊙', 'big o dot'); - LatexCmds.bigotimes = bindVanillaSymbol('\\bigotimes ', '⊗', 'big o times'); - LatexCmds.bigoplus = bindVanillaSymbol('\\bigoplus ', '⊕', 'big o plus'); - LatexCmds.biguplus = bindVanillaSymbol('\\biguplus ', '⊎', 'big u plus'); - //delimiters - LatexCmds.lfloor = bindVanillaSymbol('\\lfloor ', '⌊', 'left floor'); - LatexCmds.rfloor = bindVanillaSymbol('\\rfloor ', '⌋', 'right floor'); - LatexCmds.lceil = bindVanillaSymbol('\\lceil ', '⌈', 'left ceiling'); - LatexCmds.rceil = bindVanillaSymbol('\\rceil ', '⌉', 'right ceiling'); - LatexCmds.opencurlybrace = LatexCmds.lbrace = bindVanillaSymbol('\\lbrace ', '{', 'left brace'); - LatexCmds.closecurlybrace = LatexCmds.rbrace = bindVanillaSymbol('\\rbrace ', '}', 'right brace'); - LatexCmds.lbrack = bindVanillaSymbol('[', 'left bracket'); - LatexCmds.rbrack = bindVanillaSymbol(']', 'right bracket'); - //various symbols - LatexCmds.slash = bindVanillaSymbol('/', 'slash'); - LatexCmds.vert = bindVanillaSymbol('|', 'vertical bar'); - LatexCmds.perp = LatexCmds.perpendicular = bindVanillaSymbol('\\perp ', '⊥', 'perpendicular'); - LatexCmds.nabla = LatexCmds.del = bindVanillaSymbol('\\nabla ', '∇'); - LatexCmds.hbar = bindVanillaSymbol('\\hbar ', 'ℏ', 'horizontal bar'); - LatexCmds.AA = LatexCmds.Angstrom = LatexCmds.angstrom = bindVanillaSymbol('\\text\\AA ', 'Å', 'AA'); - LatexCmds.ring = LatexCmds.circ = LatexCmds.circle = bindVanillaSymbol('\\circ ', '∘', 'circle'); - LatexCmds.bull = LatexCmds.bullet = bindVanillaSymbol('\\bullet ', '•', 'bullet'); - LatexCmds.setminus = LatexCmds.smallsetminus = bindVanillaSymbol('\\setminus ', '∖', 'set minus'); - LatexCmds.not = LatexCmds['\u00ac'] = LatexCmds.neg = bindVanillaSymbol('\\neg ', '¬', 'not'); //bind(MQSymbol,'\\not ','/', 'not'); - LatexCmds[ - '\u2026' - ] = LatexCmds.dots = LatexCmds.ellip = LatexCmds.hellip = LatexCmds.ellipsis = LatexCmds.hellipsis = bindVanillaSymbol( - '\\dots ', - '…', - 'ellipsis' - ); - LatexCmds.converges = LatexCmds.darr = LatexCmds.dnarr = LatexCmds.dnarrow = LatexCmds.downarrow = bindVanillaSymbol( - '\\downarrow ', - '↓', - 'converges with' - ); - LatexCmds.dArr = LatexCmds.dnArr = LatexCmds.dnArrow = LatexCmds.Downarrow = bindVanillaSymbol( - '\\Downarrow ', - '⇓', - 'down arrow' - ); - LatexCmds.diverges = LatexCmds.uarr = LatexCmds.uparrow = bindVanillaSymbol( - '\\uparrow ', - '↑', - 'diverges from' - ); - LatexCmds.uArr = LatexCmds.Uparrow = bindVanillaSymbol('\\Uparrow ', '⇑', 'up arrow'); - LatexCmds.rarr = LatexCmds.rightarrow = bindVanillaSymbol('\\rightarrow ', '→', 'right arrow'); - LatexCmds.implies = bindBinaryOperator('\\Rightarrow ', '⇒', 'implies'); - LatexCmds.rArr = LatexCmds.Rightarrow = bindVanillaSymbol('\\Rightarrow ', '⇒', 'right arrow'); - LatexCmds.gets = bindBinaryOperator('\\gets ', '←', 'gets'); - LatexCmds.larr = LatexCmds.leftarrow = bindVanillaSymbol('\\leftarrow ', '←', 'left arrow'); - LatexCmds.impliedby = bindBinaryOperator('\\Leftarrow ', '⇐', 'implied by'); - LatexCmds.lArr = LatexCmds.Leftarrow = bindVanillaSymbol('\\Leftarrow ', '⇐', 'left arrow'); - LatexCmds.harr = LatexCmds.lrarr = LatexCmds.leftrightarrow = bindVanillaSymbol( - '\\leftrightarrow ', - '↔', - 'left and right arrow' - ); - LatexCmds.iff = bindBinaryOperator('\\Leftrightarrow ', '⇔', 'if and only if'); - LatexCmds.hArr = LatexCmds.lrArr = LatexCmds.Leftrightarrow = bindVanillaSymbol( - '\\Leftrightarrow ', - '⇔', - 'left and right arrow' - ); - LatexCmds.Re = LatexCmds.Real = LatexCmds.real = bindVanillaSymbol('\\Re ', 'ℜ', 'real'); - LatexCmds.Im = LatexCmds.imag = LatexCmds.image = LatexCmds.imagin = LatexCmds.imaginary = LatexCmds.Imaginary = bindVanillaSymbol( - '\\Im ', - 'ℑ', - 'imaginary' - ); - LatexCmds.part = LatexCmds.partial = bindVanillaSymbol('\\partial ', '∂', 'partial'); - LatexCmds.pounds = bindVanillaSymbol('\\pounds ', '£'); - LatexCmds.alef = LatexCmds.alefsym = LatexCmds.aleph = LatexCmds.alephsym = bindVanillaSymbol( - '\\aleph ', - 'ℵ', - 'alef sym' - ); - LatexCmds.xist = LatexCmds.xists = LatexCmds.exist = LatexCmds.exists = bindVanillaSymbol( //LOL - '\\exists ', - '∃', - 'there exists at least 1' - ); - LatexCmds.nexists = LatexCmds.nexist = bindVanillaSymbol('\\nexists ', '∄', 'there is no'); - LatexCmds.and = LatexCmds.land = LatexCmds.wedge = bindBinaryOperator('\\wedge ', '∧', 'and'); - LatexCmds.or = LatexCmds.lor = LatexCmds.vee = bindBinaryOperator('\\vee ', '∨', 'or'); - LatexCmds.o = LatexCmds.O = LatexCmds.empty = LatexCmds.emptyset = LatexCmds.oslash = LatexCmds.Oslash = LatexCmds.nothing = LatexCmds.varnothing = bindBinaryOperator( - '\\varnothing ', - '∅', - 'nothing' - ); - LatexCmds.cup = LatexCmds.union = bindBinaryOperator('\\cup ', '∪', 'union'); - LatexCmds.cap = LatexCmds.intersect = LatexCmds.intersection = bindBinaryOperator( - '\\cap ', - '∩', - 'intersection' - ); - // FIXME: the correct LaTeX would be ^\circ but we can't parse that - LatexCmds.deg = LatexCmds.degree = bindVanillaSymbol('\\degree ', '°', 'degrees'); - LatexCmds.ang = LatexCmds.angle = bindVanillaSymbol('\\angle ', '∠', 'angle'); - LatexCmds.measuredangle = bindVanillaSymbol('\\measuredangle ', '∡', 'measured angle'); - /********************************* - * Symbols for Basic Mathematics - ********************************/ - var DigitGroupingChar = /** @class */ (function (_super) { - __extends(DigitGroupingChar, _super); - function DigitGroupingChar() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - DigitGroupingChar.prototype.finalizeTree = function (opts, dir) { - this.sharedSiblingMethod(opts, dir); - }; - DigitGroupingChar.prototype.siblingDeleted = function (opts, dir) { - this.sharedSiblingMethod(opts, dir); - }; - DigitGroupingChar.prototype.siblingCreated = function (opts, dir) { - this.sharedSiblingMethod(opts, dir); - }; - DigitGroupingChar.prototype.sharedSiblingMethod = function (opts, dir) { - // don't try to fix digit grouping if the sibling to my right changed (dir === R or - // undefined) and it's now a DigitGroupingChar, it will try to fix grouping - if (dir !== L && this[R] instanceof DigitGroupingChar) return; - this.fixDigitGrouping(opts); - }; - DigitGroupingChar.prototype.fixDigitGrouping = function (opts) { - if (!opts.enableDigitGrouping) return; - var left = this; - var right = this; - var spacesFound = 0; - var dots = []; - var SPACE = '\\ '; - var DOT = '.'; - // traverse left as far as possible (starting at this char) - var node = left; - do { - if (/^[0-9]$/.test(node.ctrlSeq)) { - left = node; - } else if (node.ctrlSeq === SPACE) { - left = node; - spacesFound += 1; - } else if (node.ctrlSeq === DOT) { - left = node; - dots.push(node); - } else { - break; - } - } while ((node = left[L])); - // traverse right as far as possible (starting to right of this char) - while ((node = right[R])) { - if (/^[0-9]$/.test(node.ctrlSeq)) { - right = node; - } else if (node.ctrlSeq === SPACE) { - right = node; - spacesFound += 1; - } else if (node.ctrlSeq === DOT) { - right = node; - dots.push(node); - } else { - break; - } - } - // trim the leading spaces - while (right !== left && left && left.ctrlSeq === SPACE) { - left = left[R]; - spacesFound -= 1; - } - // trim the trailing spaces - while (right !== left && right && right.ctrlSeq === SPACE) { - right = right[L]; - spacesFound -= 1; - } - // happens when you only have a space - if (left === right && left && left.ctrlSeq === SPACE) return; - var disableFormatting = spacesFound > 0 || dots.length > 1; - if (disableFormatting) { - this.removeGroupingBetween(left, right); - } else if (dots[0]) { - if (dots[0] !== left) { - this.addGroupingBetween(dots[0][L], left); - } - if (dots[0] !== right) { - // we do not show grouping to the right of a decimal place #yet - this.removeGroupingBetween(dots[0][R], right); - } - } else { - this.addGroupingBetween(right, left); - } - }; - DigitGroupingChar.prototype.removeGroupingBetween = function (left, right) { - var node = left; - do { - if (node instanceof DigitGroupingChar) { - node.setGroupingClass(undefined); - } - if (!node || node === right) break; - } while ((node = node[R])); - }; - DigitGroupingChar.prototype.addGroupingBetween = function (start, end) { - var node = start; - var count = 0; - var totalDigits = 0; - var node = start; - while (node) { - totalDigits += 1; - if (node === end) break; - node = node[L]; - } - var numDigitsInFirstGroup = totalDigits % 3; - if (numDigitsInFirstGroup === 0) numDigitsInFirstGroup = 3; - var node = start; - while (node) { - count += 1; - var cls = undefined; - // only do grouping if we have at least 4 numbers - if (totalDigits >= 4) { - if (count === totalDigits) { - cls = 'dcg-mq-group-leading-' + numDigitsInFirstGroup; - } else if (count % 3 === 0) { - if (count !== totalDigits) { - cls = 'dcg-mq-group-start'; - } - } - if (!cls) { - cls = 'dcg-mq-group-other'; - } - } - if (node instanceof DigitGroupingChar) { - node.setGroupingClass(cls); - } - if (node === end) break; - node = node[L]; - } - }; - DigitGroupingChar.prototype.setGroupingClass = function (cls) { - // nothing changed (either class is the same or it's still undefined) - if (this._groupingClass === cls) return; - // remove existing class - if (this._groupingClass) this.domFrag().removeClass(this._groupingClass); - // add new class - if (cls) this.domFrag().addClass(cls); - // cache the groupingClass - this._groupingClass = cls; - }; - return DigitGroupingChar; - })(MQSymbol); - var Digit = /** @class */ (function (_super) { - __extends(Digit, _super); - function Digit(ch, mathspeak) { - return ( - _super.call(this, ch, h('span', { class: 'dcg-mq-digit' }, [h.text(ch)]), undefined, mathspeak) || - this - ); - } - Digit.prototype.createLeftOf = function (cursor) { - var cursorL = cursor[L]; - var cursorLL = cursorL && cursorL[L]; - var cursorParentParentSub = - cursor.parent.parent instanceof SupSub ? cursor.parent.parent.sub : undefined; - if ( - cursor.options.autoSubscriptNumerals && - cursor.parent !== cursorParentParentSub && - ((cursorL instanceof Variable && cursorL.isItalic !== false) || - (cursorL instanceof SupSub && cursorLL instanceof Variable && cursorLL.isItalic !== false)) - ) { - new SubscriptCommand().createLeftOf(cursor); - _super.prototype.createLeftOf.call(this, cursor); - cursor.insRightOf(cursor.parent.parent); - } else _super.prototype.createLeftOf.call(this, cursor); - }; - Digit.prototype.mathspeak = function (opts) { - if (opts && opts.createdLeftOf) { - var cursor = opts.createdLeftOf; - var cursorL = cursor[L]; - var cursorLL = cursorL && cursorL[L]; - var cursorParentParentSub = - cursor.parent.parent instanceof SupSub ? cursor.parent.parent.sub : undefined; - if ( - cursor.options.autoSubscriptNumerals && - cursor.parent !== cursorParentParentSub && - ((cursorL instanceof Variable && cursorL.isItalic !== false) || - (cursor[L] instanceof SupSub && - cursorLL instanceof Variable && - cursorLL.isItalic !== false)) - ) { - return 'Subscript ' + _super.prototype.mathspeak.call(this) + ' Baseline'; - } - } - return _super.prototype.mathspeak.call(this); - }; - return Digit; - })(DigitGroupingChar); - var Variable = /** @class */ (function (_super) { - __extends(Variable, _super); - function Variable(chOrCtrlSeq, html) { - return _super.call(this, chOrCtrlSeq, h('var', {}, [html || h.text(chOrCtrlSeq)])) || this; - } - Variable.prototype.text = function () { - var text = this.ctrlSeq || ''; - if (this.isPartOfOperator) { - if (text[0] == '\\') { - text = text.slice(1, text.length); - } else if (text[text.length - 1] == ' ') { - text = text.slice(0, -1); - } - } else { - if ( - this[L] && - !(this[L] instanceof Variable) && - !(this[L] instanceof BinaryOperator) && - this[L].ctrlSeq !== '\\ ' - ) - text = '*' + text; - if (this[R] && !(this[R] instanceof BinaryOperator) && !(this[R] instanceof SupSub)) text += '*'; - } - return text; - }; - Variable.prototype.mathspeak = function () { - var text = this.ctrlSeq || ''; - if ( - this.isPartOfOperator || - text.length > 1 || - (this.parent && this.parent.parent && this.parent.parent.isTextBlock()) - ) { - return _super.prototype.mathspeak.call(this); - } else { - // Apple voices in VoiceOver (such as Alex, Bruce, and Victoria) do - // some strange pronunciation given certain expressions, - // e.g. "y-2" is spoken as "ee minus 2" (as if the y is short). - // Not an ideal solution, but surrounding non-numeric text blocks with quotation marks works. - // This bug has been acknowledged by Apple. - return '"' + text + '"'; - } - }; - return Variable; - })(MQSymbol); - function bindVariable(ch, htmlEntity, _unusedMathspeak) { - return function () { - return new Variable(ch, h.entityText(htmlEntity)); - }; - } - Options.prototype.autoCommands = { - _maxLength: 0, - }; - baseOptionProcessors.autoCommands = function (cmds) { - if (typeof cmds !== 'string' || !/^[a-z]+(?: [a-z]+)*$/i.test(cmds)) { - throw '"' + cmds + '" not a space-delimited list of only letters'; - } - var list = cmds.split(' '); - var dict = {}; - var maxLength = 0; - for (var i = 0; i < list.length; i += 1) { - var cmd = list[i]; - if (cmd.length < 2) { - throw 'autocommand "' + cmd + '" not minimum length of 2'; - } - if (LatexCmds[cmd] === OperatorName) { - throw '"' + cmd + '" is a built-in operator name'; - } - dict[cmd] = 1; - maxLength = max(maxLength, cmd.length); - } - dict._maxLength = maxLength; - return dict; - }; - Options.prototype.quietEmptyDelimiters = {}; - baseOptionProcessors.quietEmptyDelimiters = function (dlms) { - if (dlms === void 0) { - dlms = ''; - } - var list = dlms.split(' '); - var dict = {}; - for (var i = 0; i < list.length; i += 1) { - var dlm = list[i]; - dict[dlm] = 1; - } - return dict; - }; - Options.prototype.autoParenthesizedFunctions = { _maxLength: 0 }; - baseOptionProcessors.autoParenthesizedFunctions = function (cmds) { - if (typeof cmds !== 'string' || !/^[a-z]+(?: [a-z]+)*$/i.test(cmds)) { - throw '"' + cmds + '" not a space-delimited list of only letters'; - } - var list = cmds.split(' '); - var dict = {}; - var maxLength = 0; - for (var i = 0; i < list.length; i += 1) { - var cmd = list[i]; - if (cmd.length < 2) { - throw 'autocommand "' + cmd + '" not minimum length of 2'; - } - dict[cmd] = 1; - maxLength = max(maxLength, cmd.length); - } - dict._maxLength = maxLength; - return dict; - }; - var Letter = /** @class */ (function (_super) { - __extends(Letter, _super); - function Letter(ch) { - var _this_1 = _super.call(this, ch) || this; - _this_1.letter = ch; - return _this_1; - } - Letter.prototype.checkAutoCmds = function (cursor) { - //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. - if (this.shouldIgnoreSubstitutionInSimpleSubscript(cursor.options)) { - return; - } - //handle autoCommands - var autoCmds = cursor.options.autoCommands; - var maxLength = autoCmds._maxLength || 0; - if (maxLength > 0) { - // want longest possible autocommand, so join together longest - // sequence of letters - var str = ''; - var l = this; - var i = 0; - // FIXME: l.ctrlSeq === l.letter checks if first or last in an operator name - while (l instanceof Letter && l.ctrlSeq === l.letter && i < maxLength) { - str = l.letter + str; - l = l[L]; - i += 1; - } - // check for an autocommand, going thru substrings longest to shortest - while (str.length) { - if (autoCmds.hasOwnProperty(str)) { - l = this; - for (i = 1; l && i < str.length; i += 1, l = l[L]); - new Fragment(l, this).remove(); - cursor[L] = l[L]; - var cmd = LatexCmds[str]; - var node; - if (isMQNodeClass(cmd)) { - node = new cmd(str); // TODO - How do we know that this class expects a single str input? - } else { - node = cmd(str); - } - return node.createLeftOf(cursor); - } - str = str.slice(1); - } - } - }; - Letter.prototype.autoParenthesize = function (cursor) { - //exit early if already parenthesized - var right = cursor.parent.getEnd(R); - if (right && right instanceof Bracket && right.ctrlSeq === '\\left(') { - return; - } - //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. - if (this.shouldIgnoreSubstitutionInSimpleSubscript(cursor.options)) { - return; - } - //handle autoParenthesized functions - var str = ''; - var l = this; - var i = 0; - var autoParenthesizedFunctions = cursor.options.autoParenthesizedFunctions; - var maxLength = autoParenthesizedFunctions._maxLength || 0; - var autoOperatorNames = cursor.options.autoOperatorNames; - while (l instanceof Letter && i < maxLength) { - (str = l.letter + str), (l = l[L]), (i += 1); - } - // check for an autoParenthesized functions, going thru substrings longest to shortest - // only allow autoParenthesized functions that are also autoOperatorNames - while (str.length) { - if (autoParenthesizedFunctions.hasOwnProperty(str) && autoOperatorNames.hasOwnProperty(str)) { - return cursor.parent.write(cursor, '('); - } - str = str.slice(1); - } - }; - Letter.prototype.createLeftOf = function (cursor) { - _super.prototype.createLeftOf.call(this, cursor); - this.checkAutoCmds(cursor); - this.autoParenthesize(cursor); - }; - Letter.prototype.italicize = function (bool) { - this.isItalic = bool; - this.isPartOfOperator = !bool; - this.domFrag().toggleClass('dcg-mq-operator-name', !bool); - return this; - }; - Letter.prototype.finalizeTree = function (opts, dir) { - this.sharedSiblingMethod(opts, dir); - }; - Letter.prototype.siblingDeleted = function (opts, dir) { - this.sharedSiblingMethod(opts, dir); - }; - Letter.prototype.siblingCreated = function (opts, dir) { - this.sharedSiblingMethod(opts, dir); - }; - Letter.prototype.sharedSiblingMethod = function (opts, dir) { - // don't auto-un-italicize if the sibling to my right changed (dir === R or - // undefined) and it's now a Letter, it will un-italicize everyone - if (dir !== L && this[R] instanceof Letter) return; - this.autoUnItalicize(opts); - }; - Letter.prototype.autoUnItalicize = function (opts) { - var autoOps = opts.autoOperatorNames; - if (autoOps._maxLength === 0) return; - //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. - if (this.shouldIgnoreSubstitutionInSimpleSubscript(opts)) { - return; - } - // want longest possible operator names, so join together entire contiguous - // sequence of letters - var str = this.letter; - for (var l = this[L]; l instanceof Letter; l = l[L]) str = l.letter + str; - for (var r = this[R]; r instanceof Letter; r = r[R]) str += r.letter; - // removeClass and delete flags from all letters before figuring out - // which, if any, are part of an operator name - var lR = l && l[R]; - var rL = r && r[L]; - new Fragment(lR || this.parent.getEnd(L), rL || this.parent.getEnd(R)).each(function (el) { - if (el instanceof Letter) { - el.italicize(true).domFrag().removeClass('dcg-mq-first dcg-mq-last dcg-mq-followed-by-supsub'); - el.ctrlSeq = el.letter; - } - return undefined; - }); - var autoOpsLength = autoOps._maxLength || 0; - // check for operator names: at each position from left to right, check - // substrings from longest to shortest - outer: for ( - var i = 0, first = l[R] || this.parent.getEnd(L); - first && i < str.length; - i += 1, first = first[R] - ) { - for (var len = min(autoOpsLength, str.length - i); len > 0; len -= 1) { - var word = str.slice(i, i + len); - var last = undefined; // TODO - TS complaining that we use last before assigning to it - if (autoOps.hasOwnProperty(word)) { - for (var j = 0, letter = first; j < len; j += 1, letter = letter[R]) { - if (letter instanceof Letter) { - letter.italicize(false); - last = letter; - } - } - var isBuiltIn = BuiltInOpNames.hasOwnProperty(word); - first.ctrlSeq = (isBuiltIn ? '\\' : '\\operatorname{') + first.ctrlSeq; - last.ctrlSeq += isBuiltIn ? ' ' : '}'; - if (TwoWordOpNames.hasOwnProperty(word)) { - var lastL = last[L]; - var lastLL = lastL && lastL[L]; - var lastLLL = lastLL && lastLL[L]; - lastLLL.domFrag().addClass('dcg-mq-last'); - } - if (!this.shouldOmitPadding(first[L])) first.domFrag().addClass('dcg-mq-first'); - if (!this.shouldOmitPadding(last[R])) { - if (last[R] instanceof SupSub) { - var supsub = last[R]; // XXX monkey-patching, but what's the right thing here? - // Have operatorname-specific code in SupSub? A CSS-like language to style the - // math tree, but which ignores cursor and selection (which CSS can't)? - var respace = (supsub.siblingCreated = supsub.siblingDeleted = function () { - supsub - .domFrag() - .toggleClass('dcg-mq-after-operator-name', !(supsub[R] instanceof Bracket)); - }); - respace(); - } else { - last.domFrag().toggleClass('dcg-mq-last', !(last[R] instanceof Bracket)); - } - } - i += len - 1; - first = last; - continue outer; - } - } - } - }; - Letter.prototype.shouldOmitPadding = function (node) { - // omit padding if no node - if (!node) return true; - // do not add padding between letter and '.' - if (node.ctrlSeq === '.') return true; - // do not add padding between letter and binary operator. The - // binary operator already has padding - if (node instanceof BinaryOperator) return true; - if (node instanceof SummationNotation) return true; - return false; - }; - return Letter; - })(Variable); - var BuiltInOpNames = {}; // the set of operator names like \sin, \cos, etc that - // are built-into LaTeX, see Section 3.17 of the Short Math Guide: http://tinyurl.com/jm9okjc - // MathQuill auto-unitalicizes some operator names not in that set, like 'hcf' - // and 'arsinh', which must be exported as \operatorname{hcf} and - // \operatorname{arsinh}. Note: over/under line/arrow \lim variants like - // \varlimsup are not supported - // the set of operator names that MathQuill auto-unitalicizes by default; overridable - Options.prototype.autoOperatorNames = defaultAutoOpNames(); - var TwoWordOpNames = { limsup: 1, liminf: 1, projlim: 1, injlim: 1 }; - function defaultAutoOpNames() { - var AutoOpNames = { - _maxLength: 9, - }; - var mostOps = ( - 'arg deg det dim exp gcd hom inf ker lg lim ln log max min sup' + ' limsup liminf injlim projlim Pr' - ).split(' '); - for (var i = 0; i < mostOps.length; i += 1) { - BuiltInOpNames[mostOps[i]] = AutoOpNames[mostOps[i]] = 1; - } - var builtInTrigs = 'sin cos tan arcsin arccos arctan sinh cosh tanh sec csc cot coth'.split( - // why coth but not sech and csch, LaTeX? - ' ' - ); - for (var i = 0; i < builtInTrigs.length; i += 1) { - BuiltInOpNames[builtInTrigs[i]] = 1; - } - var autoTrigs = 'sin cos tan sec cosec csc cotan cot ctg'.split(' '); - for (var i = 0; i < autoTrigs.length; i += 1) { - AutoOpNames[autoTrigs[i]] = AutoOpNames['arc' + autoTrigs[i]] = AutoOpNames[ - autoTrigs[i] + 'h' - ] = AutoOpNames['ar' + autoTrigs[i] + 'h'] = AutoOpNames['arc' + autoTrigs[i] + 'h'] = 1; - } - // compat with some of the nonstandard LaTeX exported by MathQuill - // before #247. None of these are real LaTeX commands so, seems safe - var moreNonstandardOps = 'gcf hcf lcm proj span'.split(' '); - for (var i = 0; i < moreNonstandardOps.length; i += 1) { - AutoOpNames[moreNonstandardOps[i]] = 1; - } - return AutoOpNames; - } - baseOptionProcessors.autoOperatorNames = function (cmds) { - if (typeof cmds !== 'string') { - throw '"' + cmds + '" not a space-delimited list'; - } - if (!/^[a-z\|\-]+(?: [a-z\|\-]+)*$/i.test(cmds)) { - throw '"' + cmds + '" not a space-delimited list of letters or "|"'; - } - var list = cmds.split(' '); - var dict = {}; - var maxLength = 0; - for (var i = 0; i < list.length; i += 1) { - var cmd = list[i]; - if (cmd.length < 2) { - throw '"' + cmd + '" not minimum length of 2'; - } - if (cmd.indexOf('|') < 0) { - // normal auto operator - dict[cmd] = cmd; - maxLength = max(maxLength, cmd.length); - } else { - // this item has a speech-friendly alternative - var cmdArray = cmd.split('|'); - if (cmdArray.length > 2) { - throw '"' + cmd + '" has more than 1 mathspeak delimiter'; - } - if (cmdArray[0].length < 2) { - throw '"' + cmd[0] + '" not minimum length of 2'; - } - dict[cmdArray[0]] = cmdArray[1].replace(/-/g, ' '); // convert dashes to spaces for the sake of speech - maxLength = max(maxLength, cmdArray[0].length); - } - } - dict._maxLength = maxLength; - return dict; - }; - var OperatorName = /** @class */ (function (_super) { - __extends(OperatorName, _super); - function OperatorName(fn) { - return _super.call(this, fn || '') || this; - } - OperatorName.prototype.createLeftOf = function (cursor) { - var fn = this.ctrlSeq; - for (var i = 0; i < fn.length; i += 1) { - new Letter(fn.charAt(i)).createLeftOf(cursor); - } - }; - OperatorName.prototype.parser = function () { - var fn = this.ctrlSeq; - var block = new MathBlock(); - for (var i = 0; i < fn.length; i += 1) { - new Letter(fn.charAt(i)).adopt(block, block.getEnd(R), 0); - } - return Parser.succeed(block.children()); - }; - return OperatorName; - })(MQSymbol); - for (var fn in Options.prototype.autoOperatorNames) - if (Options.prototype.autoOperatorNames.hasOwnProperty(fn)) { - LatexCmds[fn] = OperatorName; - } - LatexCmds.operatorname = /** @class */ (function (_super) { - __extends(class_4, _super); - function class_4() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - class_4.prototype.createLeftOf = function () {}; - class_4.prototype.numBlocks = function () { - return 1; - }; - class_4.prototype.parser = function () { - return latexMathParser.block.map(function (b) { - // Check for the special case of \operatorname{ans}, which has - // a special html representation - var isAllLetters = true; - var str = ''; - var children = b.children(); - children.each(function (child) { - if (child instanceof Letter) { - str += child.letter; - } else { - isAllLetters = false; - } - return undefined; - }); - if (isAllLetters && str === 'ans') { - return AnsBuilder(); - } - // In cases other than `ans`, just return the children directly - return children; - }); - }; - return class_4; - })(MathCommand); - LatexCmds.f = /** @class */ (function (_super) { - __extends(class_5, _super); - function class_5() { - var _this_1 = this; - var letter = 'f'; - _this_1 = _super.call(this, letter) || this; - _this_1.letter = letter; - _this_1.domView = new DOMView(0, function () { - return h('var', { class: 'dcg-mq-f' }, [h.text('f')]); - }); - return _this_1; - } - class_5.prototype.italicize = function (bool) { - // Why is this necesssary? Does someone replace the `f` at some - // point? - this.domFrag().eachElement(function (el) { - return (el.textContent = 'f'); - }); - this.domFrag().toggleClass('dcg-mq-f', bool); - return _super.prototype.italicize.call(this, bool); - }; - return class_5; - })(Letter); - // VanillaSymbol's - LatexCmds[' '] = LatexCmds.space = function () { - return new DigitGroupingChar('\\ ', h('span', {}, [h.text(U_NO_BREAK_SPACE)]), ' '); - }; - LatexCmds['.'] = function () { - return new DigitGroupingChar('.', h('span', { class: 'dcg-mq-digit' }, [h.text('.')]), '.'); - }; - LatexCmds["'"] = LatexCmds.prime = bindVanillaSymbol("'", '′', 'prime'); - LatexCmds['\u2033'] = LatexCmds.dprime = bindVanillaSymbol('\u2033', '″', 'double prime'); - LatexCmds.backslash = bindVanillaSymbol('\\backslash ', '\\', 'backslash'); - if (!CharCmds['\\']) CharCmds['\\'] = LatexCmds.backslash; - LatexCmds.$ = bindVanillaSymbol('\\$', '$', 'dollar'); - LatexCmds.square = bindVanillaSymbol('\\square ', '\u25A1', 'square'); - LatexCmds.mid = bindVanillaSymbol('\\mid ', '\u2223', 'mid'); - // does not use Symbola font - var NonSymbolaSymbol = /** @class */ (function (_super) { - __extends(NonSymbolaSymbol, _super); - function NonSymbolaSymbol(ch, html, _unusedMathspeak) { - return _super.call(this, ch, h('span', { class: 'dcg-mq-nonSymbola' }, [html || h.text(ch)])) || this; - } - return NonSymbolaSymbol; - })(MQSymbol); - LatexCmds['@'] = function () { - return new NonSymbolaSymbol('@'); - }; - LatexCmds['&'] = function () { - return new NonSymbolaSymbol('\\&', h.entityText('&'), 'and'); - }; - LatexCmds['%'] = /** @class */ (function (_super) { - __extends(class_6, _super); - function class_6() { - return _super.call(this, '\\%', h.text('%'), 'percent') || this; - } - class_6.prototype.parser = function () { - var optWhitespace = Parser.optWhitespace; - var string = Parser.string; - // Parse `\%\operatorname{of}` as special `percentof` node so that - // it will be serialized properly and deleted as a unit. - return optWhitespace - .then( - string('\\operatorname{of}').map(function () { - return PercentOfBuilder(); - }) - ) - .or(_super.prototype.parser.call(this)); - }; - return class_6; - })(NonSymbolaSymbol); - LatexCmds['\u2225'] = LatexCmds.parallel = bindVanillaSymbol('\\parallel ', '∥', 'parallel'); - LatexCmds['\u2226'] = LatexCmds.nparallel = bindVanillaSymbol('\\nparallel ', '∦', 'not parallel'); - LatexCmds['\u27c2'] = LatexCmds.perp = bindVanillaSymbol('\\perp ', '⟂', 'perpendicular'); - //the following are all Greek to me, but this helped a lot: http://www.ams.org/STIX/ion/stixsig03.html - //lowercase Greek letter variables - LatexCmds.alpha = LatexCmds.beta = LatexCmds.gamma = LatexCmds.delta = LatexCmds.zeta = LatexCmds.eta = LatexCmds.theta = LatexCmds.iota = LatexCmds.kappa = LatexCmds.mu = LatexCmds.nu = LatexCmds.xi = LatexCmds.rho = LatexCmds.sigma = LatexCmds.tau = LatexCmds.chi = LatexCmds.psi = LatexCmds.omega = function ( - latex - ) { - return new Variable('\\' + latex + ' ', h.entityText('&' + latex + ';')); - }; - //why can't anybody FUCKING agree on these - LatexCmds.phi = bindVariable('\\phi ', 'ϕ', 'phi'); //W3C or Unicode? - LatexCmds.phiv = LatexCmds.varphi = bindVariable('\\varphi ', 'φ', 'phi'); //Elsevier and 9573-13 //AMS and LaTeX - LatexCmds.epsilon = bindVariable('\\epsilon ', 'ϵ', 'epsilon'); //W3C or Unicode? - LatexCmds.epsiv = LatexCmds.varepsilon = bindVariable( - //Elsevier and 9573-13 //AMS and LaTeX - '\\varepsilon ', - 'ε', - 'epsilon' - ); - LatexCmds.piv = LatexCmds.varpi = bindVariable('\\varpi ', 'ϖ', 'piv'); //W3C/Unicode and Elsevier and 9573-13 //AMS and LaTeX - LatexCmds.sigmaf = LatexCmds.sigmav = LatexCmds.varsigma = bindVariable('\\varsigma ', 'ς', 'sigma'); //W3C/Unicode //Elsevier //LaTeX - LatexCmds.thetav = LatexCmds.vartheta = LatexCmds.thetasym = bindVariable('\\vartheta ', 'ϑ', 'theta'); //Elsevier and 9573-13 //AMS and LaTeX //W3C/Unicode - LatexCmds.upsilon = LatexCmds.upsi = bindVariable( - //AMS and LaTeX and W3C/Unicode //Elsevier and 9573-13 - '\\upsilon ', - 'υ', - 'upsilon' - ); - //these aren't even mentioned in the HTML character entity references - LatexCmds.gammad = LatexCmds.Gammad = LatexCmds.digamma = bindVariable('\\digamma ', 'ϝ', 'gamma'); //Elsevier //9573-13 -- WTF, right? I dunno if this was a typo in the reference (see above) //LaTeX - LatexCmds.kappav = LatexCmds.varkappa = bindVariable( - //Elsevier //AMS and LaTeX - '\\varkappa ', - 'ϰ', - 'kappa' - ); - LatexCmds.rhov = LatexCmds.varrho = bindVariable('\\varrho ', 'ϱ', 'rho'); //Elsevier and 9573-13 //AMS and LaTeX - //Greek constants, look best in non-italicized Times New Roman - LatexCmds.pi = LatexCmds['\u03c0'] = function () { - return new NonSymbolaSymbol('\\pi ', h.entityText('π'), 'pi'); - }; - LatexCmds.lambda = function () { - return new NonSymbolaSymbol('\\lambda ', h.entityText('λ'), 'lambda'); - }; - //uppercase greek letters - LatexCmds.Upsilon = LatexCmds.Upsi = LatexCmds.upsih = LatexCmds.Upsih = function () { //LaTeX //Elsevier and 9573-13 //W3C/Unicode "upsilon with hook" //'cos it makes sense to me - return new MQSymbol( - '\\Upsilon ', - h('var', { style: 'font-family: serif' }, [h.entityText('ϒ')]), - 'capital upsilon' - ); - }; //Symbola's 'upsilon with a hook' is a capital Y without hooks :( - //other symbols with the same LaTeX command and HTML character entity reference - LatexCmds.Gamma = LatexCmds.Delta = LatexCmds.Theta = LatexCmds.Lambda = LatexCmds.Xi = LatexCmds.Pi = LatexCmds.Sigma = LatexCmds.Phi = LatexCmds.Psi = LatexCmds.Omega = LatexCmds.forall = function ( - latex - ) { - return new VanillaSymbol('\\' + latex + ' ', h.entityText('&' + latex + ';')); - }; - // symbols that aren't a single MathCommand, but are instead a whole - // Fragment. Creates the Fragment from a LaTeX string - var LatexFragment = /** @class */ (function (_super) { - __extends(LatexFragment, _super); - function LatexFragment(latex) { - var _this_1 = _super.call(this) || this; - _this_1.latexStr = latex; - return _this_1; - } - LatexFragment.prototype.createLeftOf = function (cursor) { - var block = latexMathParser.parse(this.latexStr); - block.children().adopt(cursor.parent, cursor[L], cursor[R]); - cursor[L] = block.getEnd(R); - domFrag(block.html()).insertBefore(cursor.domFrag()); - block.finalizeInsert(cursor.options, cursor); - var blockEndsR = block.getEnd(R); - var blockEndsRR = blockEndsR && blockEndsR[R]; - if (blockEndsRR) blockEndsRR.siblingCreated(cursor.options, L); - var blockEndsL = block.getEnd(L); - var blockEndsLL = blockEndsL && blockEndsL[L]; - if (blockEndsLL) blockEndsLL.siblingCreated(cursor.options, R); - cursor.parent.bubble(function (node) { - node.reflow(); - return undefined; - }); - }; - LatexFragment.prototype.mathspeak = function () { - return latexMathParser.parse(this.latexStr).mathspeak(); - }; - LatexFragment.prototype.parser = function () { - var frag = latexMathParser.parse(this.latexStr).children(); - return Parser.succeed(frag); - }; - return LatexFragment; - })(MathCommand); - // for what seems to me like [stupid reasons][1], Unicode provides - // subscripted and superscripted versions of all ten Arabic numerals, - // as well as [so-called "vulgar fractions"][2]. - // Nobody really cares about most of them, but some of them actually - // predate Unicode, dating back to [ISO-8859-1][3], apparently also - // known as "Latin-1", which among other things [Windows-1252][4] - // largely coincides with, so Microsoft Word sometimes inserts them - // and they get copy-pasted into MathQuill. - // - // (Irrelevant but funny story: though not a superset of Latin-1 aka - // ISO-8859-1, Windows-1252 **is** a strict superset of the "closely - // related but distinct"[3] "ISO 8859-1" -- see the lack of a dash - // after "ISO"? Completely different character set, like elephants vs - // elephant seals, or "Zombies" vs "Zombie Redneck Torture Family". - // What kind of idiot would get them confused. - // People in fact got them confused so much, it was so common to - // mislabel Windows-1252 text as ISO-8859-1, that most modern web - // browsers and email clients treat the MIME charset of ISO-8859-1 - // as actually Windows-1252, behavior now standard in the HTML5 spec.) - // - // [1]: http://en.wikipedia.org/wiki/Unicode_subscripts_andsuper_scripts - // [2]: http://en.wikipedia.org/wiki/Number_Forms - // [3]: http://en.wikipedia.org/wiki/ISO/IEC_8859-1 - // [4]: http://en.wikipedia.org/wiki/Windows-1252 - LatexCmds['\u2070'] = function () { - return new LatexFragment('^0'); - }; - LatexCmds['\u00b9'] = function () { - return new LatexFragment('^1'); - }; - LatexCmds['\u00b2'] = function () { - return new LatexFragment('^2'); - }; - LatexCmds['\u00b3'] = function () { - return new LatexFragment('^3'); - }; - LatexCmds['\u2074'] = function () { - return new LatexFragment('^4'); - }; - LatexCmds['\u2075'] = function () { - return new LatexFragment('^5'); - }; - LatexCmds['\u2076'] = function () { - return new LatexFragment('^6'); - }; - LatexCmds['\u2077'] = function () { - return new LatexFragment('^7'); - }; - LatexCmds['\u2078'] = function () { - return new LatexFragment('^8'); - }; - LatexCmds['\u2079'] = function () { - return new LatexFragment('^9'); - }; - LatexCmds['\u00bc'] = function () { - return new LatexFragment('\\frac14'); - }; - LatexCmds['\u00bd'] = function () { - return new LatexFragment('\\frac12'); - }; - LatexCmds['\u00be'] = function () { - return new LatexFragment('\\frac34'); - }; - // this is a hack to make pasting the \u221a symbol - // actually insert a sqrt command. This isn't ideal, - // but it's way better than what we have now. I think - // before we invest any more time into this single character - // we should consider how to make the pipe (|) automatically - // insert absolute value. We also will want the percent (%) - // to expand to '% of'. I've always just thought mathquill's - // ability to handle pasted latex magical until I started actually - // testing it. It's a lot more buggy that I previously thought. - // - // KNOWN ISSUES: - // 1) pasting \u221a does not put focus in side the sqrt symbol - // 2) pasting \u221a2 puts the 2 outside of the sqrt symbol. - // - // The first issue seems like we could invest more time into this to - // fix it, but doesn't feel worth special casing. I think we'd want - // to address it by addressing ALL pasting issues. - // - // The second issue seems like it might go away too if you fix paste to - // act more like simply typing the characters out. I'd be scared to try - // to make that change because I'm fairly confident I'd break something - // around handling valid latex as latex rather than treating it as keystrokes. - LatexCmds['\u221a'] = function () { - return new LatexFragment('\\sqrt{}'); - }; - // Binary operator determination is used in several contexts for PlusMinus nodes and their descendants. - // For instance, we set the item's class name based on this factor, and also assign different mathspeak values (plus vs positive, negative vs minus). - function isBinaryOperator(node) { - if (!node) return false; - var nodeL = node[L]; - if (nodeL) { - // If the left sibling is a binary operator or a separator (comma, semicolon, colon, space) - // or an open bracket (open parenthesis, open square bracket) - // consider the operator to be unary - if (nodeL instanceof BinaryOperator || /^(\\ )|[,;:\(\[]$/.test(nodeL.ctrlSeq)) { - return false; - } - } else if (node.parent && node.parent.parent && node.parent.parent.isStyleBlock()) { - //if we are in a style block at the leftmost edge, determine unary/binary based on - //the style block - //this allows style blocks to be transparent for unary/binary purposes - return isBinaryOperator(node.parent.parent); - } else { - return false; - } - return true; - } - var PlusMinus = /** @class */ (function (_super) { - __extends(class_7, _super); - function class_7(ch, html, mathspeak) { - return _super.call(this, ch, html, undefined, mathspeak, true) || this; - } - class_7.prototype.contactWeld = function (cursor, dir) { - this.sharedSiblingMethod(cursor.options, dir); - }; - class_7.prototype.siblingCreated = function (opts, dir) { - this.sharedSiblingMethod(opts, dir); - }; - class_7.prototype.siblingDeleted = function (opts, dir) { - this.sharedSiblingMethod(opts, dir); - }; - class_7.prototype.sharedSiblingMethod = function (_opts, dir) { - if (dir === R) return; // ignore if sibling only changed on the right - this.domFrag().oneElement().className = isBinaryOperator(this) ? 'dcg-mq-binary-operator' : ''; - return this; - }; - return class_7; - })(BinaryOperator); - LatexCmds['+'] = /** @class */ (function (_super) { - __extends(class_8, _super); - function class_8() { - return _super.call(this, '+', h.text('+')) || this; - } - class_8.prototype.mathspeak = function () { - return isBinaryOperator(this) ? 'plus' : 'positive'; - }; - return class_8; - })(PlusMinus); - //yes, these are different dashes, en-dash, em-dash, unicode minus, actual dash - var MinusNode = /** @class */ (function (_super) { - __extends(MinusNode, _super); - function MinusNode() { - return _super.call(this, '-', h.entityText('−')) || this; - } - MinusNode.prototype.mathspeak = function () { - return isBinaryOperator(this) ? 'minus' : 'negative'; - }; - return MinusNode; - })(PlusMinus); - LatexCmds['\u2212'] = LatexCmds['\u2014'] = LatexCmds['\u2013'] = LatexCmds['-'] = MinusNode; - LatexCmds['\u00b1'] = LatexCmds.pm = LatexCmds.plusmn = LatexCmds.plusminus = function () { - return new PlusMinus('\\pm ', h.entityText('±'), 'plus-or-minus'); - }; - LatexCmds.mp = LatexCmds.mnplus = LatexCmds.minusplus = function () { - return new PlusMinus('\\mp ', h.entityText('∓'), 'minus-or-plus'); - }; - CharCmds['*'] = LatexCmds.sdot = LatexCmds.cdot = bindBinaryOperator('\\cdot ', '·', '*', 'times'); //semantically should be ⋅, but · looks better - var To = /** @class */ (function (_super) { - __extends(To, _super); - function To() { - return _super.call(this, '\\to ', h.entityText('→'), 'to') || this; - } - To.prototype.deleteTowards = function (dir, cursor) { - if (dir === L) { - var l = cursor[L]; - new Fragment(l, this).remove(); - cursor[L] = l[L]; - new MinusNode().createLeftOf(cursor); - cursor[L].bubble(function (node) { - node.reflow(); - return undefined; - }); - return; - } - _super.prototype.deleteTowards.call(this, dir, cursor); - }; - return To; - })(BinaryOperator); - LatexCmds['\u2192'] = LatexCmds.to = To; - var Inequality = /** @class */ (function (_super) { - __extends(Inequality, _super); - function Inequality(data, strict) { - var _this_1 = this; - var strictness = strict ? 'Strict' : ''; - _this_1 = - _super.call( - this, - data['ctrlSeq'.concat(strictness)], - h.entityText(data['htmlEntity'.concat(strictness)]), - data['text'.concat(strictness)], - data['mathspeak'.concat(strictness)] - ) || this; - _this_1.data = data; - _this_1.strict = strict; - return _this_1; - } - Inequality.prototype.swap = function (strict) { - this.strict = strict; - var strictness = strict ? 'Strict' : ''; - this.ctrlSeq = this.data['ctrlSeq'.concat(strictness)]; - this.domFrag() - .children() - .replaceWith(domFrag(h.entityText(this.data['htmlEntity'.concat(strictness)]))); - this.textTemplate = [this.data['text'.concat(strictness)]]; - this.mathspeakName = this.data['mathspeak'.concat(strictness)]; - }; - Inequality.prototype.deleteTowards = function (dir, cursor) { - if (dir === L && !this.strict) { - this.swap(true); - this.bubble(function (node) { - node.reflow(); - return undefined; - }); - return; - } - _super.prototype.deleteTowards.call(this, dir, cursor); - }; - return Inequality; - })(BinaryOperator); - var less = { - ctrlSeq: '\\le ', - htmlEntity: '≤', - text: '\u2264', - mathspeak: 'less than or equal to', - ctrlSeqStrict: '<', - htmlEntityStrict: '<', - textStrict: '<', - mathspeakStrict: 'less than', - }; - var greater = { - ctrlSeq: '\\ge ', - htmlEntity: '≥', - text: '\u2265', - mathspeak: 'greater than or equal to', - ctrlSeqStrict: '>', - htmlEntityStrict: '>', - textStrict: '>', - mathspeakStrict: 'greater than', - }; - var Greater = /** @class */ (function (_super) { - __extends(Greater, _super); - function Greater() { - return _super.call(this, greater, true) || this; - } - Greater.prototype.createLeftOf = function (cursor) { - var cursorL = cursor[L]; - if (cursorL instanceof BinaryOperator && cursorL.ctrlSeq === '-') { - var l = cursorL; - cursor[L] = l[L]; - l.remove(); - new To().createLeftOf(cursor); - cursor[L].bubble(function (node) { - node.reflow(); - return undefined; - }); - return; - } - _super.prototype.createLeftOf.call(this, cursor); - }; - return Greater; - })(Inequality); - LatexCmds['<'] = LatexCmds.lt = function () { - return new Inequality(less, true); - }; - LatexCmds['>'] = LatexCmds.gt = Greater; - LatexCmds['\u2264'] = LatexCmds.le = LatexCmds.leq = function () { - return new Inequality(less, false); - }; - LatexCmds['\u2265'] = LatexCmds.ge = LatexCmds.geq = function () { - return new Inequality(greater, false); - }; - LatexCmds.infty = LatexCmds.infin = LatexCmds.infinity = bindVanillaSymbol('\\infty ', '∞', 'infinity'); - LatexCmds['\u2260'] = LatexCmds.ne = LatexCmds.neq = bindBinaryOperator('\\ne ', '≠', 'not equal'); - var Equality = /** @class */ (function (_super) { - __extends(Equality, _super); - function Equality() { - return _super.call(this, '=', h.text('='), '=', 'equals') || this; - } - Equality.prototype.createLeftOf = function (cursor) { - var cursorL = cursor[L]; - if (cursorL instanceof Inequality && cursorL.strict) { - cursorL.swap(false); - cursorL.bubble(function (node) { - node.reflow(); - return undefined; - }); - return; - } - _super.prototype.createLeftOf.call(this, cursor); - }; - return Equality; - })(BinaryOperator); - LatexCmds['='] = Equality; - LatexCmds['\u00d7'] = LatexCmds.times = bindBinaryOperator('\\times ', '×', '[x]', 'times'); - LatexCmds['\u00f7'] = LatexCmds.div = LatexCmds.divide = LatexCmds.divides = bindBinaryOperator( - '\\div ', - '÷', - '[/]', - 'over' - ); - var Sim = /** @class */ (function (_super) { - __extends(Sim, _super); - function Sim() { - return _super.call(this, '\\sim ', h.text('~'), '~', 'tilde') || this; - } - Sim.prototype.createLeftOf = function (cursor) { - if (cursor[L] instanceof Sim) { - var l = cursor[L]; - cursor[L] = l[L]; - l.remove(); - new Approx().createLeftOf(cursor); - cursor[L].bubble(function (node) { - node.reflow(); - return undefined; - }); - return; - } - _super.prototype.createLeftOf.call(this, cursor); - }; - return Sim; - })(BinaryOperator); - var Approx = /** @class */ (function (_super) { - __extends(Approx, _super); - function Approx() { - return ( - _super.call(this, '\\approx ', h.entityText('≈'), '\u2248', 'approximately equal') || this - ); - } - Approx.prototype.deleteTowards = function (dir, cursor) { - if (dir === L) { - var l = cursor[L]; - new Fragment(l, this).remove(); - cursor[L] = l[L]; - new Sim().createLeftOf(cursor); - cursor[L].bubble(function (node) { - node.reflow(); - return undefined; - }); - return; - } - _super.prototype.deleteTowards.call(this, dir, cursor); - }; - return Approx; - })(BinaryOperator); - LatexCmds.tildeNbsp = bindVanillaSymbol('~', U_NO_BREAK_SPACE, ' '); - LatexCmds.sim = Sim; - LatexCmds['\u2248'] = LatexCmds.approx = Approx; - // When interpreting raw LaTeX, we can either evaluate the tilde as its standard nonbreaking space - // or transform it to the \sim operator depending on whether the "interpretTildeAsSim" configuration option is set. - // Tilde symbols input from a keyboard will always be transformed to \sim. - CharCmds['~'] = LatexCmds.sim; - LatexCmds['~'] = LatexCmds.tildeNbsp; - baseOptionProcessors.interpretTildeAsSim = function (val) { - var interpretAsSim = !!val; - if (interpretAsSim) { - LatexCmds['~'] = LatexCmds.sim; - } else { - LatexCmds['~'] = LatexCmds.tildeNbsp; - } - return interpretAsSim; - }; - /*************************** - * Commands and Operators. - **************************/ - var SVG_SYMBOLS = { - sqrt: { - width: '', - html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 32 54' }, [ - h('path', { - d: 'M0 33 L7 27 L12.5 47 L13 47 L30 0 L32 0 L13 54 L11 54 L4.5 31 L0 33', - }), - ]); - }, - }, - '|': { - width: '.4em', - html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ - h('path', { d: 'M4.4 0 L4.4 54 L5.6 54 L5.6 0' }), - ]); - }, - }, - '[': { - width: '.55em', - html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 11 24' }, [ - h('path', { d: 'M8 0 L3 0 L3 24 L8 24 L8 23 L4 23 L4 1 L8 1' }), - ]); - }, - }, - ']': { - width: '.55em', - html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 11 24' }, [ - h('path', { d: 'M3 0 L8 0 L8 24 L3 24 L3 23 L7 23 L7 1 L3 1' }), - ]); - }, - }, - '(': { - width: '.55em', - html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '3 0 106 186' }, [ - h('path', { - d: 'M85 0 A61 101 0 0 0 85 186 L75 186 A75 101 0 0 1 75 0', - }), - ]); - }, - }, - ')': { - width: '.55em', - html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '3 0 106 186' }, [ - h('path', { - d: 'M24 0 A61 101 0 0 1 24 186 L34 186 A75 101 0 0 0 34 0', - }), - ]); - }, - }, - '{': { - width: '.7em', - html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '10 0 210 350' }, [ - h('path', { - d: - 'M170 0 L170 6 A47 52 0 0 0 123 60 L123 127 A35 48 0 0 1 88 175 A35 48 0 0 1 123 223 L123 290 A47 52 0 0 0 170 344 L170 350 L160 350 A58 49 0 0 1 102 301 L103 220 A45 40 0 0 0 58 180 L58 170 A45 40 0 0 0 103 130 L103 49 A58 49 0 0 1 161 0', - }), - ]); - }, - }, - '}': { - width: '.7em', - html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '10 0 210 350' }, [ - h('path', { - d: - 'M60 0 L60 6 A47 52 0 0 1 107 60 L107 127 A35 48 0 0 0 142 175 A35 48 0 0 0 107 223 L107 290 A47 52 0 0 1 60 344 L60 350 L70 350 A58 49 0 0 0 128 301 L127 220 A45 40 0 0 1 172 180 L172 170 A45 40 0 0 1 127 130 L127 49 A58 49 0 0 0 70 0', - }), - ]); - }, - }, - '∥': { - width: '.7em', - html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ - h('path', { d: 'M3.2 0 L3.2 54 L4 54 L4 0 M6.8 0 L6.8 54 L6 54 L6 0' }), - ]); - }, - }, - '⟨': { - width: '.55em', - html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ - h('path', { d: 'M6.8 0 L3.2 27 L6.8 54 L7.8 54 L4.2 27 L7.8 0' }), - ]); - }, - }, - '⟩': { - width: '.55em', - html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ - h('path', { d: 'M3.2 0 L6.8 27 L3.2 54 L2.2 54 L5.8 27 L2.2 0' }), - ]); - }, - }, - }; - var Style = /** @class */ (function (_super) { - __extends(Style, _super); - function Style(ctrlSeq, tagName, attrs, ariaLabel, opts) { - var _this_1 = - _super.call( - this, - ctrlSeq, - new DOMView(1, function (blocks) { - return h.block(tagName, attrs, blocks[0]); - }) - ) || this; - _this_1.ariaLabel = ariaLabel || ctrlSeq.replace(/^\\/, ''); - _this_1.mathspeakTemplate = ['Start' + _this_1.ariaLabel + ',', 'End' + _this_1.ariaLabel]; - // In most cases, mathspeak should announce the start and end of style blocks. - // There is one exception currently (mathrm). - _this_1.shouldNotSpeakDelimiters = opts && opts.shouldNotSpeakDelimiters; - return _this_1; - } - Style.prototype.mathspeak = function (opts) { - if (!this.shouldNotSpeakDelimiters || (opts && opts.ignoreShorthand)) { - return _super.prototype.mathspeak.call(this); - } - return this.foldChildren('', function (speech, block) { - return speech + ' ' + block.mathspeak(opts); - }).trim(); - }; - return Style; - })(MathCommand); - //fonts - LatexCmds.mathrm = /** @class */ (function (_super) { - __extends(mathrm, _super); - function mathrm() { - return ( - _super.call(this, '\\mathrm', 'span', { class: 'dcg-mq-roman dcg-mq-font' }, 'Roman Font', { - shouldNotSpeakDelimiters: true, - }) || this - ); - } - mathrm.prototype.isTextBlock = function () { - return true; - }; - return mathrm; - })(Style); - LatexCmds.mathit = function () { - return new Style('\\mathit', 'i', { class: 'dcg-mq-font' }, 'Italic Font'); - }; - LatexCmds.mathbf = function () { - return new Style('\\mathbf', 'b', { class: 'dcg-mq-font' }, 'Bold Font'); - }; - LatexCmds.mathsf = function () { - return new Style('\\mathsf', 'span', { class: 'dcg-mq-sans-serif dcg-mq-font' }, 'Serif Font'); - }; - LatexCmds.mathtt = function () { - return new Style('\\mathtt', 'span', { class: 'dcg-mq-monospace dcg-mq-font' }, 'Math Text'); - }; - //text-decoration - LatexCmds.underline = function () { - return new Style('\\underline', 'span', { class: 'dcg-mq-non-leaf dcg-mq-underline' }, 'Underline'); - }; - LatexCmds.overline = LatexCmds.bar = function () { - return new Style('\\overline', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overline' }, 'Overline'); - }; - LatexCmds.overrightarrow = function () { - return new Style( - '\\overrightarrow', - 'span', - { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-right' }, - 'Over Right Arrow' - ); - }; - LatexCmds.overleftarrow = function () { - return new Style( - '\\overleftarrow', - 'span', - { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-left' }, - 'Over Left Arrow' - ); - }; - LatexCmds.overleftrightarrow = function () { - return new Style( - '\\overleftrightarrow ', - 'span', - { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-leftright' }, - 'Over Left and Right Arrow' - ); - }; - LatexCmds.overarc = function () { - return new Style('\\overarc', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overarc' }, 'Over Arc'); - }; - LatexCmds.dot = function () { - return new MathCommand( - '\\dot', - new DOMView(1, function (blocks) { - return h('span', { class: 'dcg-mq-non-leaf' }, [ - h('span', { class: 'dcg-mq-dot-recurring-inner' }, [ - h('span', { class: 'dcg-mq-dot-recurring' }, [h.text(U_DOT_ABOVE)]), - h.block('span', { class: 'dcg-mq-empty-box' }, blocks[0]), - ]), - ]); - }) - ); - }; - // `\textcolor{color}{math}` will apply a color to the given math content, where - // `color` is any valid CSS Color Value (see [SitePoint docs][] (recommended), - // [Mozilla docs][], or [W3C spec][]). - // - // [SitePoint docs]: http://reference.sitepoint.com/css/colorvalues - // [Mozilla docs]: https://developer.mozilla.org/en-US/docs/CSS/color_value#Values - // [W3C spec]: http://dev.w3.org/csswg/css3-color/#colorunits - LatexCmds.textcolor = /** @class */ (function (_super) { - __extends(class_9, _super); - function class_9() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - class_9.prototype.setColor = function (color) { - this.color = color; - this.domView = new DOMView(1, function (blocks) { - return h.block('span', { class: 'dcg-mq-textcolor', style: 'color:' + color }, blocks[0]); - }); - this.ariaLabel = color.replace(/^\\/, ''); - this.mathspeakTemplate = ['Start ' + this.ariaLabel + ',', 'End ' + this.ariaLabel]; - }; - class_9.prototype.latexRecursive = function (ctx) { - this.checkCursorContextOpen(ctx); - var blocks0 = this.blocks[0]; - ctx.latex += '\\textcolor{' + this.color + '}{'; - blocks0.latexRecursive(ctx); - ctx.latex += '}'; - this.checkCursorContextClose(ctx); - }; - class_9.prototype.parser = function () { - var _this_1 = this; - var optWhitespace = Parser.optWhitespace; - var string = Parser.string; - var regex = Parser.regex; - return optWhitespace - .then(string('{')) - .then(regex(/^[#\w\s.,()%-]*/)) - .skip(string('}')) - .then(function (color) { - _this_1.setColor(color); - return _super.prototype.parser.call(_this_1); - }); - }; - class_9.prototype.isStyleBlock = function () { - return true; - }; - return class_9; - })(MathCommand); - // Very similar to the \textcolor command, but will add the given CSS class. - // Usage: \class{classname}{math} - // Note regex that whitelists valid CSS classname characters: - // https://github.com/mathquill/mathquill/pull/191#discussion_r4327442 - var Class = (LatexCmds['class'] = /** @class */ (function (_super) { - __extends(class_10, _super); - function class_10() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - class_10.prototype.parser = function () { - var _this_1 = this; - var string = Parser.string, - regex = Parser.regex; - return Parser.optWhitespace - .then(string('{')) - .then(regex(/^[-\w\s\\\xA0-\xFF]*/)) - .skip(string('}')) - .then(function (cls) { - _this_1.cls = cls || ''; - _this_1.domView = new DOMView(1, function (blocks) { - return h.block('span', { class: 'dcg-mq-class '.concat(cls) }, blocks[0]); - }); - _this_1.ariaLabel = cls + ' class'; - _this_1.mathspeakTemplate = ['Start ' + _this_1.ariaLabel + ',', 'End ' + _this_1.ariaLabel]; - return _super.prototype.parser.call(_this_1); - }); - }; - class_10.prototype.latexRecursive = function (ctx) { - this.checkCursorContextOpen(ctx); - var blocks0 = this.blocks[0]; - ctx.latex += '\\class{' + this.cls + '}{'; - blocks0.latexRecursive(ctx); - ctx.latex += '}'; - this.checkCursorContextClose(ctx); - }; - class_10.prototype.isStyleBlock = function () { - return true; - }; - return class_10; - })(MathCommand)); - // This test is used to determine whether an item may be treated as a whole number - // for shortening the verbalized (mathspeak) forms of some fractions and superscripts. - var intRgx = /^[\+\-]?[\d]+$/; - // Traverses the top level of the passed block's children and returns the concatenation of their ctrlSeq properties. - // Used in shortened mathspeak computations as a block's .text() method can be potentially expensive. - // - function getCtrlSeqsFromBlock(block) { - if (!block) return ''; - var chars = ''; - block.eachChild(function (child) { - if (child.ctrlSeq !== undefined) chars += child.ctrlSeq; - }); - return chars; - } - Options.prototype.charsThatBreakOutOfSupSub = ''; - var SupSub = /** @class */ (function (_super) { - __extends(SupSub, _super); - function SupSub() { - var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; - _this_1.ctrlSeq = '_{...}^{...}'; - return _this_1; - } - SupSub.prototype.setEnds = function (ends) { - pray('SupSub ends must be MathBlocks', ends[L] instanceof MathBlock && ends[R] instanceof MathBlock); - this.ends = ends; - }; - SupSub.prototype.getEnd = function (dir) { - return this.ends[dir]; - }; - SupSub.prototype.createLeftOf = function (cursor) { - if (!this.replacedFragment && !cursor[L] && cursor.options.supSubsRequireOperand) return; - return _super.prototype.createLeftOf.call(this, cursor); - }; - SupSub.prototype.contactWeld = function (cursor) { - // Look on either side for a SupSub, if one is found compare my - // .sub, .sup with its .sub, .sup. If I have one that it doesn't, - // then call .addBlock() on it with my block; if I have one that - // it also has, then insert my block's children into its block, - // unless my block has none, in which case insert the cursor into - // its block (and not mine, I'm about to remove myself) in the case - // I was just typed. - // TODO: simplify - // equiv. to [L, R].forEach(function(dir) { ... }); - for (var dir = L; dir; dir = dir === L ? R : false) { - var thisDir = this[dir]; - var pt = void 0; - if (thisDir instanceof SupSub) { - // equiv. to 'sub sup'.split(' ').forEach(function(supsub) { ... }); - for (var supsub = 'sub'; supsub; supsub = supsub === 'sub' ? 'sup' : false) { - var src = this[supsub], - dest = thisDir[supsub]; - if (!src) continue; - if (!dest) thisDir.addBlock(src.disown()); - else if (!src.isEmpty()) { - // ins src children at -dir end of dest - src.domFrag().children().insAtDirEnd(-dir, dest.domFrag().oneElement()); - var children = src.children().disown(); - pt = new Point(dest, children.getEnd(R), dest.getEnd(L)); - if (dir === L) children.adopt(dest, dest.getEnd(R), 0); - else children.adopt(dest, 0, dest.getEnd(L)); - } else { - pt = new Point(dest, 0, dest.getEnd(L)); - } - this.placeCursor = (function (dest, src) { - // TODO: don't monkey-patch - return function (cursor) { - cursor.insAtDirEnd(-dir, dest || src); - }; - })(dest, src); - } - this.remove(); - if (cursor && cursor[L] === this) { - if (dir === R && pt) { - if (pt[L]) { - cursor.insRightOf(pt[L]); - } else { - cursor.insAtLeftEnd(pt.parent); - } - } else cursor.insRightOf(thisDir); - } - break; - } - } - }; - SupSub.prototype.finalizeTree = function () { - var endsL = this.getEnd(L); - endsL.write = function (cursor, ch) { - if (cursor.options.autoSubscriptNumerals && this === this.parent.sub) { - if (ch === '_') return; - var cmd = this.chToCmd(ch, cursor.options); - if (cmd instanceof MQSymbol) cursor.deleteSelection(); - else cursor.clearSelection().insRightOf(this.parent); - cmd.createLeftOf(cursor.show()); - cursor.controller.aria.queue('Baseline').alert(cmd.mathspeak({ createdLeftOf: cursor })); - return; - } - if ( - cursor[L] && - !cursor[R] && - !cursor.selection && - cursor.options.charsThatBreakOutOfSupSub.indexOf(ch) > -1 - ) { - cursor.insRightOf(this.parent); - cursor.controller.aria.queue('Baseline'); - } - MathBlock.prototype.write.call(this, cursor, ch); - }; - }; - SupSub.prototype.moveTowards = function (dir, cursor, updown) { - if (cursor.options.autoSubscriptNumerals && !this.sup) { - cursor.insDirOf(dir, this); - } else _super.prototype.moveTowards.call(this, dir, cursor, updown); - }; - SupSub.prototype.deleteTowards = function (dir, cursor) { - if (cursor.options.autoSubscriptNumerals && this.sub) { - var cmd = this.sub.getEnd(-dir); - if (cmd instanceof MQSymbol) cmd.remove(); - else if (cmd) cmd.deleteTowards(dir, cursor.insAtDirEnd(-dir, this.sub)); - // TODO: factor out a .removeBlock() or something - if (this.sub.isEmpty()) { - this.sub.deleteOutOf(L, cursor.insAtLeftEnd(this.sub)); - if (this.sup) cursor.insDirOf(-dir, this); - // Note `-dir` because in e.g. x_1^2| want backspacing (leftward) - // to delete the 1 but to end up rightward of x^2; with non-negated - // `dir` (try it), the cursor appears to have gone "through" the ^2. - } - } else _super.prototype.deleteTowards.call(this, dir, cursor); - }; - SupSub.prototype.latexRecursive = function (ctx) { - this.checkCursorContextOpen(ctx); - if (this.sub) { - ctx.latex += '_{'; - var beforeLength = ctx.latex.length; - this.sub.latexRecursive(ctx); - var afterLength = ctx.latex.length; - if (beforeLength === afterLength) { - // nothing was written. so we write a space - ctx.latex += ' '; - } - ctx.latex += '}'; - } - if (this.sup) { - ctx.latex += '^{'; - var beforeLength = ctx.latex.length; - this.sup.latexRecursive(ctx); - var afterLength = ctx.latex.length; - if (beforeLength === afterLength) { - // nothing was written. so we write a space - ctx.latex += ' '; - } - ctx.latex += '}'; - } - this.checkCursorContextClose(ctx); - }; - SupSub.prototype.text = function () { - function text(prefix, block) { - var l = (block && block.text()) || ''; - return block ? prefix + (l.length === 1 ? l : '(' + (l || ' ') + ')') : ''; - } - return text('_', this.sub) + text('^', this.sup); - }; - SupSub.prototype.addBlock = function (block) { - if (this.supsub === 'sub') { - this.sup = this.upInto = this.sub.upOutOf = block; - block.adopt(this, this.sub, 0).downOutOf = this.sub; - block.setDOM( - domFrag(h('span', { class: 'dcg-mq-sup' })) - .append(block.domFrag().children()) - .prependTo(this.domFrag().oneElement()) - .oneElement() - ); - NodeBase.linkElementByBlockNode(block.domFrag().oneElement(), block); - } else { - this.sub = this.downInto = this.sup.downOutOf = block; - block.adopt(this, 0, this.sup).upOutOf = this.sup; - this.domFrag().removeClass('dcg-mq-sup-only'); - block.setDOM( - domFrag(h('span', { class: 'dcg-mq-sub' })) - .append(block.domFrag().children()) - .appendTo(this.domFrag().oneElement()) - .oneElement() - ); - NodeBase.linkElementByBlockNode(block.domFrag().oneElement(), block); - this.domFrag().append( - domFrag(h('span', { style: 'display:inline-block;width:0' }, [h.text(U_ZERO_WIDTH_SPACE)])) - ); - } - // like 'sub sup'.split(' ').forEach(function(supsub) { ... }); - for (var i = 0; i < 2; i += 1) - (function (cmd, supsub, oppositeSupsub, updown) { - var cmdSubSub = cmd[supsub]; - cmdSubSub.deleteOutOf = function (dir, cursor) { - cursor.insDirOf(this[dir] ? -dir : dir, this.parent); - if (!this.isEmpty()) { - var end = this.getEnd(dir); - this.children() - .disown() - .withDirAdopt(dir, cursor.parent, cursor[dir], cursor[-dir]) - .domFrag() - .insDirOf(-dir, cursor.domFrag()); - cursor[-dir] = end; - } - cmd.supsub = oppositeSupsub; - delete cmd[supsub]; - delete cmd[''.concat(updown, 'Into')]; - var cmdOppositeSupsub = cmd[oppositeSupsub]; - cmdOppositeSupsub[''.concat(updown, 'OutOf')] = insLeftOfMeUnlessAtEnd; - delete cmdOppositeSupsub.deleteOutOf; // TODO - refactor so this method can be optional - if (supsub === 'sub') { - cmd.domFrag().addClass('dcg-mq-sup-only').children().last().remove(); - } - this.remove(); - }; - })(this, 'sub sup'.split(' ')[i], 'sup sub'.split(' ')[i], 'down up'.split(' ')[i]); - }; - return SupSub; - })(MathCommand); - function insLeftOfMeUnlessAtEnd(cursor) { - // cursor.insLeftOf(cmd), unless cursor at the end of block, and every - // ancestor cmd is at the end of every ancestor block - var cmd = this.parent; - var ancestorCmd = cursor; - do { - if (ancestorCmd[R]) return cursor.insLeftOf(cmd); - ancestorCmd = ancestorCmd.parent.parent; - } while (ancestorCmd !== cmd); - cursor.insRightOf(cmd); - return undefined; - } - var SubscriptCommand = /** @class */ (function (_super) { - __extends(SubscriptCommand, _super); - function SubscriptCommand() { - var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; - _this_1.supsub = 'sub'; - _this_1.domView = new DOMView(1, function (blocks) { - return h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf' }, [ - h.block('span', { class: 'dcg-mq-sub' }, blocks[0]), - h('span', { style: 'display:inline-block;width:0' }, [h.text(U_ZERO_WIDTH_SPACE)]), - ]); - }); - _this_1.textTemplate = ['_']; - _this_1.mathspeakTemplate = ['Subscript,', ', Baseline']; - _this_1.ariaLabel = 'subscript'; - return _this_1; - } - SubscriptCommand.prototype.finalizeTree = function () { - this.downInto = this.sub = this.getEnd(L); - this.sub.upOutOf = insLeftOfMeUnlessAtEnd; - _super.prototype.finalizeTree.call(this); - }; - return SubscriptCommand; - })(SupSub); - LatexCmds.subscript = LatexCmds._ = SubscriptCommand; - LatexCmds.superscript = LatexCmds.supscript = LatexCmds['^'] = /** @class */ (function (_super) { - __extends(SuperscriptCommand, _super); - function SuperscriptCommand() { - var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; - _this_1.supsub = 'sup'; - _this_1.domView = new DOMView(1, function (blocks) { - return h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf dcg-mq-sup-only' }, [ - h.block('span', { class: 'dcg-mq-sup' }, blocks[0]), - ]); - }); - _this_1.textTemplate = ['^(', ')']; - _this_1.ariaLabel = 'superscript'; - _this_1.mathspeakTemplate = ['Superscript,', ', Baseline']; - return _this_1; - } - SuperscriptCommand.prototype.mathspeak = function (opts) { - // Simplify basic exponent speech for common whole numbers. - var child = this.upInto; - if (child !== undefined) { - // Calculate this item's inner text to determine whether to shorten the returned speech. - // Do not calculate its inner mathspeak now until we know that the speech is to be truncated. - // Since the mathspeak computation is recursive, we want to call it only once in this function to avoid performance bottlenecks. - var innerText = getCtrlSeqsFromBlock(child); - // If the superscript is a whole number, shorten the speech that is returned. - if ((!opts || !opts.ignoreShorthand) && intRgx.test(innerText)) { - // Simple cases - if (innerText === '0') { - return 'to the 0 power'; - } else if (innerText === '2') { - return 'squared'; - } else if (innerText === '3') { - return 'cubed'; - } - // More complex cases. - var suffix = ''; - // Limit suffix addition to exponents < 1000. - if (/^[+-]?\d{1,3}$/.test(innerText)) { - if (/(11|12|13|4|5|6|7|8|9|0)$/.test(innerText)) { - suffix = 'th'; - } else if (/1$/.test(innerText)) { - suffix = 'st'; - } else if (/2$/.test(innerText)) { - suffix = 'nd'; - } else if (/3$/.test(innerText)) { - suffix = 'rd'; - } - } - var innerMathspeak = typeof child === 'object' ? child.mathspeak() : innerText; - return 'to the ' + innerMathspeak + suffix + ' power'; - } - } - return _super.prototype.mathspeak.call(this); - }; - SuperscriptCommand.prototype.finalizeTree = function () { - this.upInto = this.sup = this.getEnd(R); - this.sup.downOutOf = insLeftOfMeUnlessAtEnd; - _super.prototype.finalizeTree.call(this); - }; - return SuperscriptCommand; - })(SupSub); - var SummationNotation = /** @class */ (function (_super) { - __extends(SummationNotation, _super); - function SummationNotation(ch, symbol, ariaLabel) { - var _this_1 = _super.call(this) || this; - _this_1.ariaLabel = ariaLabel || ch.replace(/^\\/, ''); - var domView = new DOMView(2, function (blocks) { - return h('span', { class: 'dcg-mq-large-operator dcg-mq-non-leaf' }, [ - h('span', { class: 'dcg-mq-to' }, [h.block('span', {}, blocks[1])]), - h('big', {}, [h.text(symbol)]), - h('span', { class: 'dcg-mq-from' }, [h.block('span', {}, blocks[0])]), - ]); - }); - MQSymbol.prototype.setCtrlSeqHtmlTextAndMathspeak.call(_this_1, ch, domView); - return _this_1; - } - SummationNotation.prototype.createLeftOf = function (cursor) { - _super.prototype.createLeftOf.call(this, cursor); - if (cursor.options.sumStartsWithNEquals) { - new Letter('n').createLeftOf(cursor); - new Equality().createLeftOf(cursor); - } - }; - SummationNotation.prototype.latexRecursive = function (ctx) { - this.checkCursorContextOpen(ctx); - ctx.latex += this.ctrlSeq + '_{'; - var beforeLength = ctx.latex.length; - this.getEnd(L).latexRecursive(ctx); - var afterLength = ctx.latex.length; - if (afterLength === beforeLength) { - // nothing was written so we write a space - ctx.latex += ' '; - } - ctx.latex += '}^{'; - beforeLength = ctx.latex.length; - this.getEnd(R).latexRecursive(ctx); - afterLength = ctx.latex.length; - if (beforeLength === afterLength) { - // nothing was written so we write a space - ctx.latex += ' '; - } - ctx.latex += '}'; - this.checkCursorContextClose(ctx); - }; - SummationNotation.prototype.mathspeak = function () { - return ( - 'Start ' + - this.ariaLabel + - ' from ' + - this.getEnd(L).mathspeak() + - ' to ' + - this.getEnd(R).mathspeak() + - ', end ' + - this.ariaLabel + - ', ' - ); - }; - SummationNotation.prototype.parser = function () { - var string = Parser.string; - var optWhitespace = Parser.optWhitespace; - var succeed = Parser.succeed; - var block = latexMathParser.block; - var self = this; - var blocks = (self.blocks = [new MathBlock(), new MathBlock()]); - for (var i = 0; i < blocks.length; i += 1) { - blocks[i].adopt(self, self.getEnd(R), 0); - } - return optWhitespace - .then(string('_').or(string('^'))) - .then(function (supOrSub) { - var child = blocks[supOrSub === '_' ? 0 : 1]; - return block.then(function (block) { - block.children().adopt(child, child.getEnd(R), 0); - return succeed(self); - }); - }) - .many() - .result(self); - }; - SummationNotation.prototype.finalizeTree = function () { - var endsL = this.getEnd(L); - var endsR = this.getEnd(R); - endsL.ariaLabel = 'lower bound'; - endsR.ariaLabel = 'upper bound'; - this.downInto = endsL; - this.upInto = endsR; - endsL.upOutOf = endsR; - endsR.downOutOf = endsL; - }; - return SummationNotation; - })(MathCommand); - LatexCmds['\u2211'] = LatexCmds.sum = LatexCmds.summation = function () { - return new SummationNotation('\\sum ', U_NARY_SUMMATION, 'sum'); - }; - LatexCmds['\u220f'] = LatexCmds.prod = LatexCmds.product = function () { - return new SummationNotation('\\prod ', U_NARY_PRODUCT, 'product'); - }; - LatexCmds.coprod = LatexCmds.coproduct = function () { - return new SummationNotation('\\coprod ', U_NARY_COPRODUCT, 'co product'); - }; - LatexCmds['\u222b'] = LatexCmds['int'] = LatexCmds.integral = /** @class */ (function (_super) { - __extends(class_11, _super); - function class_11() { - var _this_1 = _super.call(this, '\\int ', '', 'integral') || this; - _this_1.ariaLabel = 'integral'; - _this_1.domView = new DOMView(2, function (blocks) { - return h('span', { class: 'dcg-mq-int dcg-mq-non-leaf' }, [ - h('big', {}, [h.text(U_INTEGRAL)]), - h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf' }, [ - h('span', { class: 'dcg-mq-sup' }, [ - h.block('span', { class: 'dcg-mq-sup-inner' }, blocks[1]), - ]), - h.block('span', { class: 'dcg-mq-sub' }, blocks[0]), - h('span', { style: 'display:inline-block;width:0' }, [h.text(U_ZERO_WIDTH_SPACE)]), - ]), - ]); - }); - return _this_1; - } - class_11.prototype.createLeftOf = function (cursor) { - // FIXME: refactor rather than overriding - MathCommand.prototype.createLeftOf.call(this, cursor); - }; - return class_11; - })(SummationNotation); - //window.LatexCmds = LatexCmds; - //console.log(LatexCmds); - //console.log(window); - var Fraction = (LatexCmds.frac = LatexCmds.dfrac = LatexCmds.cfrac = LatexCmds.fraction = /** @class */ (function ( - _super - ) { - __extends(FracNode, _super); - function FracNode() { - var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; - _this_1.ctrlSeq = '\\frac'; - _this_1.domView = new DOMView(2, function (blocks) { - return h('span', { class: 'dcg-mq-fraction dcg-mq-non-leaf' }, [ - h.block('span', { class: 'dcg-mq-numerator' }, blocks[0]), - h.block('span', { class: 'dcg-mq-denominator' }, blocks[1]), - h('span', { style: 'display:inline-block;width:0' }, [h.text(U_ZERO_WIDTH_SPACE)]), - ]); - }); - _this_1.textTemplate = ['(', ')/(', ')']; - return _this_1; - } - FracNode.prototype.finalizeTree = function () { - var endsL = this.getEnd(L); - var endsR = this.getEnd(R); - this.upInto = endsR.upOutOf = endsL; - this.downInto = endsL.downOutOf = endsR; - endsL.ariaLabel = 'numerator'; - endsR.ariaLabel = 'denominator'; - if (this.getFracDepth() > 1) { - this.mathspeakTemplate = ['StartNestedFraction,', 'NestedOver', ', EndNestedFraction']; - } else { - this.mathspeakTemplate = ['StartFraction,', 'Over', ', EndFraction']; - } - }; - FracNode.prototype.mathspeak = function (opts) { - if (opts && opts.createdLeftOf) { - var cursor = opts.createdLeftOf; - return cursor.parent.mathspeak(); - } - var numText = getCtrlSeqsFromBlock(this.getEnd(L)); - var denText = getCtrlSeqsFromBlock(this.getEnd(R)); - // Shorten mathspeak value for whole number fractions whose denominator is less than 10. - if ((!opts || !opts.ignoreShorthand) && intRgx.test(numText) && intRgx.test(denText)) { - var isSingular = numText === '1' || numText === '-1'; - var newDenSpeech = ''; - if (denText === '2') { - newDenSpeech = isSingular ? 'half' : 'halves'; - } else if (denText === '3') { - newDenSpeech = isSingular ? 'third' : 'thirds'; - } else if (denText === '4') { - newDenSpeech = isSingular ? 'quarter' : 'quarters'; - } else if (denText === '5') { - newDenSpeech = isSingular ? 'fifth' : 'fifths'; - } else if (denText === '6') { - newDenSpeech = isSingular ? 'sixth' : 'sixths'; - } else if (denText === '7') { - newDenSpeech = isSingular ? 'seventh' : 'sevenths'; - } else if (denText === '8') { - newDenSpeech = isSingular ? 'eighth' : 'eighths'; - } else if (denText === '9') { - newDenSpeech = isSingular ? 'ninth' : 'ninths'; - } - if (newDenSpeech !== '') { - var output = ''; - // Handle the case of an integer followed by a simplified fraction such as 1\frac{1}{2}. - // Such combinations should be spoken aloud as "1 and 1 half." - // Start at the left sibling of the fraction and continue leftward until something other than a digit or whitespace is found. - var precededByInteger = false; - for (var sibling = this[L]; sibling && sibling[L] !== undefined; sibling = sibling[L]) { - // Ignore whitespace - if (sibling.ctrlSeq === '\\ ') { - continue; - } else if (intRgx.test(sibling.ctrlSeq || '')) { - precededByInteger = true; - } else { - precededByInteger = false; - break; - } - } - if (precededByInteger) { - output += 'and '; - } - output += this.getEnd(L).mathspeak() + ' ' + newDenSpeech; - return output; - } - } - return _super.prototype.mathspeak.call(this); - }; - FracNode.prototype.getFracDepth = function () { - var level = 0; - var walkUp = function (item, level) { - if (item instanceof MQNode && item.ctrlSeq && item.ctrlSeq.toLowerCase().search('frac') >= 0) - level += 1; - if (item && item.parent) return walkUp(item.parent, level); - else return level; - }; - return walkUp(this, level); - }; - return FracNode; - })(MathCommand)); - var LiveFraction = (LatexCmds.over = CharCmds['/'] = /** @class */ (function (_super) { - __extends(class_12, _super); - function class_12() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - class_12.prototype.createLeftOf = function (cursor) { - if (!this.replacedFragment) { - var leftward = cursor[L]; - if (!cursor.options.typingSlashCreatesNewFraction) { - while ( - leftward && - !( - leftward instanceof BinaryOperator || - leftward instanceof (LatexCmds.text || noop) || - leftward instanceof SummationNotation || - leftward.ctrlSeq === '\\ ' || - /^[,;:]$/.test(leftward.ctrlSeq) - ) //lookbehind for operator - ) - leftward = leftward[L]; - } - if (leftward instanceof SummationNotation && leftward[R] instanceof SupSub) { - leftward = leftward[R]; - var leftwardR = leftward[R]; - if (leftwardR instanceof SupSub && leftwardR.ctrlSeq != leftward.ctrlSeq) - leftward = leftward[R]; - } - if (leftward !== cursor[L] && !cursor.isTooDeep(1)) { - var leftwardR = leftward[R]; - var cursorL = cursor[L]; - this.replaces(new Fragment(leftwardR || cursor.parent.getEnd(L), cursorL)); - cursor[L] = leftward; - } - } - _super.prototype.createLeftOf.call(this, cursor); - }; - return class_12; - })(Fraction)); - var AnsBuilder = function () { - return new MQSymbol('\\operatorname{ans}', h('span', { class: 'dcg-mq-ans' }, [h.text('ans')]), 'ans'); - }; - LatexCmds.ans = AnsBuilder; - var PercentOfBuilder = function () { - return new MQSymbol( - '\\%\\operatorname{of}', - h('span', { class: 'dcg-mq-nonSymbola dcg-mq-operator-name' }, [h.text('% of ')]), - 'percent of' - ); - }; - LatexCmds.percent = LatexCmds.percentof = PercentOfBuilder; - var SquareRoot = /** @class */ (function (_super) { - __extends(SquareRoot, _super); - function SquareRoot() { - var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; - _this_1.ctrlSeq = '\\sqrt'; - _this_1.domView = new DOMView(1, function (blocks) { - return h('span', { class: 'dcg-mq-non-leaf dcg-mq-sqrt-container' }, [ - h('span', { class: 'dcg-mq-scaled dcg-mq-sqrt-prefix' }, [SVG_SYMBOLS.sqrt.html()]), - h.block('span', { class: 'dcg-mq-non-leaf dcg-mq-sqrt-stem' }, blocks[0]), - ]); - }); - _this_1.textTemplate = ['sqrt(', ')']; - _this_1.mathspeakTemplate = ['StartRoot,', ', EndRoot']; - _this_1.ariaLabel = 'root'; - return _this_1; - } - SquareRoot.prototype.parser = function () { - return latexMathParser.optBlock - .then(function (optBlock) { - return latexMathParser.block.map(function (block) { - var nthroot = new NthRoot(); - nthroot.blocks = [optBlock, block]; - optBlock.adopt(nthroot, 0, 0); - block.adopt(nthroot, optBlock, 0); - return nthroot; - }); - }) - .or(_super.prototype.parser.call(this)); - }; - return SquareRoot; - })(MathCommand); - LatexCmds.sqrt = SquareRoot; - LatexCmds.hat = /** @class */ (function (_super) { - __extends(Hat, _super); - function Hat() { - var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; - _this_1.ctrlSeq = '\\hat'; - _this_1.domView = new DOMView(1, function (blocks) { - return h('span', { class: 'dcg-mq-non-leaf' }, [ - h('span', { class: 'dcg-mq-hat-prefix' }, [h.text('^')]), - h.block('span', { class: 'dcg-mq-hat-stem' }, blocks[0]), - ]); - }); - _this_1.textTemplate = ['hat(', ')']; - return _this_1; - } - return Hat; - })(MathCommand); - var NthRoot = /** @class */ (function (_super) { - __extends(NthRoot, _super); - function NthRoot() { - var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; - _this_1.domView = new DOMView(2, function (blocks) { - return h('span', { class: 'dcg-mq-nthroot-container dcg-mq-non-leaf' }, [ - h.block('sup', { class: 'dcg-mq-nthroot dcg-mq-non-leaf' }, blocks[0]), - h('span', { class: 'dcg-mq-scaled dcg-mq-sqrt-container' }, [ - h('span', { class: 'dcg-mq-sqrt-prefix dcg-mq-scaled' }, [SVG_SYMBOLS.sqrt.html()]), - h.block('span', { class: 'dcg-mq-sqrt-stem dcg-mq-non-leaf' }, blocks[1]), - ]), - ]); - }); - _this_1.textTemplate = ['sqrt[', '](', ')']; - return _this_1; - } - NthRoot.prototype.latexRecursive = function (ctx) { - this.checkCursorContextOpen(ctx); - ctx.latex += '\\sqrt['; - this.getEnd(L).latexRecursive(ctx); - ctx.latex += ']{'; - this.getEnd(R).latexRecursive(ctx); - ctx.latex += '}'; - this.checkCursorContextClose(ctx); - }; - NthRoot.prototype.mathspeak = function () { - var indexMathspeak = this.getEnd(L).mathspeak(); - var radicandMathspeak = this.getEnd(R).mathspeak(); - this.getEnd(L).ariaLabel = 'Index'; - this.getEnd(R).ariaLabel = 'Radicand'; - if (indexMathspeak === '3') { - // cube root - return 'Start Cube Root, ' + radicandMathspeak + ', End Cube Root'; - } else { - return 'Root Index ' + indexMathspeak + ', Start Root, ' + radicandMathspeak + ', End Root'; - } - }; - return NthRoot; - })(SquareRoot); - LatexCmds.nthroot = NthRoot; - LatexCmds.cbrt = /** @class */ (function (_super) { - __extends(class_13, _super); - function class_13() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - class_13.prototype.createLeftOf = function (cursor) { - _super.prototype.createLeftOf.call(this, cursor); - new Digit('3').createLeftOf(cursor); - cursor.controller.moveRight(); - }; - return class_13; - })(NthRoot); - var DiacriticAbove = /** @class */ (function (_super) { - __extends(DiacriticAbove, _super); - function DiacriticAbove(ctrlSeq, html, textTemplate) { - var _this_1 = this; - var domView = new DOMView(1, function (blocks) { - return h('span', { class: 'dcg-mq-non-leaf' }, [ - h('span', { class: 'dcg-mq-diacritic-above' }, [html]), - h.block('span', { class: 'dcg-mq-diacritic-stem' }, blocks[0]), - ]); - }); - _this_1 = _super.call(this, ctrlSeq, domView, textTemplate) || this; - return _this_1; - } - return DiacriticAbove; - })(MathCommand); - LatexCmds.vec = function () { - return new DiacriticAbove('\\vec', h.entityText('→'), ['vec(', ')']); - }; - LatexCmds.tilde = function () { - return new DiacriticAbove('\\tilde', h.text('~'), ['tilde(', ')']); - }; - var DelimsNode = /** @class */ (function (_super) { - __extends(DelimsNode, _super); - function DelimsNode() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - DelimsNode.prototype.setDOM = function (el) { - var _c; - _super.prototype.setDOM.call(this, el); - var children = this.domFrag().children(); - if (!children.isEmpty()) { - this.delimFrags = ((_c = {}), (_c[L] = children.first()), (_c[R] = children.last()), _c); - } - return this; - }; - return DelimsNode; - })(MathCommand); - // Round/Square/Curly/Angle Brackets (aka Parens/Brackets/Braces) - // first typed as one-sided bracket with matching "ghost" bracket at - // far end of current block, until you type an opposing one - var Bracket = /** @class */ (function (_super) { - __extends(Bracket, _super); - function Bracket(side, open, close, ctrlSeq, end) { - var _c; - var _this_1 = _super.call(this, '\\left' + ctrlSeq, undefined, [open, close]) || this; - _this_1.side = side; - _this_1.sides = - ((_c = {}), (_c[L] = { ch: open, ctrlSeq: ctrlSeq }), (_c[R] = { ch: close, ctrlSeq: end }), _c); - return _this_1; - } - Bracket.prototype.numBlocks = function () { - return 1; - }; - Bracket.prototype.html = function () { - var _this_1 = this; - var leftSymbol = this.getSymbol(L); - var rightSymbol = this.getSymbol(R); - // wait until now so that .side may - this.domView = new DOMView(1, function (blocks) { - return h( - // be set by createLeftOf or parser - 'span', - { class: 'dcg-mq-non-leaf dcg-mq-bracket-container' }, - [ - h( - 'span', - { - style: 'width:' + leftSymbol.width, - class: - 'dcg-mq-scaled dcg-mq-bracket-l dcg-mq-paren' + - (_this_1.side === R ? ' dcg-mq-ghost' : ''), - }, - [leftSymbol.html()] - ), - h.block( - 'span', - { - style: 'margin-left:' + leftSymbol.width + ';margin-right:' + rightSymbol.width, - class: 'dcg-mq-bracket-middle dcg-mq-non-leaf', - }, - blocks[0] - ), - h( - 'span', - { - style: 'width:' + rightSymbol.width, - class: - 'dcg-mq-scaled dcg-mq-bracket-r dcg-mq-paren' + - (_this_1.side === L ? ' dcg-mq-ghost' : ''), - }, - [rightSymbol.html()] - ), - ] - ); - }); - return _super.prototype.html.call(this); - }; - Bracket.prototype.getSymbol = function (side) { - var ch = this.sides[side || R].ch; - return SVG_SYMBOLS[ch] || { width: '0', html: '' }; - }; - Bracket.prototype.latexRecursive = function (ctx) { - this.checkCursorContextOpen(ctx); - ctx.latex += '\\left' + this.sides[L].ctrlSeq; - this.getEnd(L).latexRecursive(ctx); - ctx.latex += '\\right' + this.sides[R].ctrlSeq; - this.checkCursorContextClose(ctx); - }; - Bracket.prototype.mathspeak = function (opts) { - var open = this.sides[L].ch, - close = this.sides[R].ch; - if (open === '|' && close === '|') { - this.mathspeakTemplate = ['StartAbsoluteValue,', ', EndAbsoluteValue']; - this.ariaLabel = 'absolute value'; - } else if (opts && opts.createdLeftOf && this.side) { - var ch = ''; - if (this.side === L) ch = this.textTemplate[0]; - else if (this.side === R) ch = this.textTemplate[1]; - return (this.side === L ? 'left ' : 'right ') + BRACKET_NAMES[ch]; - } else { - this.mathspeakTemplate = ['left ' + BRACKET_NAMES[open] + ',', ', right ' + BRACKET_NAMES[close]]; - this.ariaLabel = BRACKET_NAMES[open] + ' block'; - } - return _super.prototype.mathspeak.call(this); - }; - Bracket.prototype.matchBrack = function (opts, expectedSide, node) { - // return node iff it's a matching 1-sided bracket of expected side (if any) - return ( - node instanceof Bracket && - node.side && - node.side !== -expectedSide && - (!opts.restrictMismatchedBrackets || - OPP_BRACKS[this.sides[this.side].ch] === node.sides[node.side].ch || - { '(': ']', '[': ')' }[this.sides[L].ch] === node.sides[R].ch) && - node - ); - }; - Bracket.prototype.closeOpposing = function (brack) { - brack.side = 0; - brack.sides[this.side] = this.sides[this.side]; // copy over my info (may be - var brackFrag = brack.delimFrags[this.side === L ? L : R] // mismatched, like [a, b)) - .removeClass('dcg-mq-ghost'); - this.replaceBracket(brackFrag, this.side); - }; - Bracket.prototype.createLeftOf = function (cursor) { - var brack; - if (!this.replacedFragment) { - // unless wrapping seln in brackets, - // check if next to or inside an opposing one-sided bracket - var opts = cursor.options; - if (this.sides[L].ch === '|') { - // check both sides if I'm a pipe - brack = - this.matchBrack(opts, R, cursor[R]) || - this.matchBrack(opts, L, cursor[L]) || - this.matchBrack(opts, 0, cursor.parent.parent); - } else { - brack = - this.matchBrack(opts, -this.side, cursor[-this.side]) || - this.matchBrack(opts, -this.side, cursor.parent.parent); - } - } - if (brack) { - var side = (this.side = -brack.side); // may be pipe with .side not yet set - this.closeOpposing(brack); - if (brack === cursor.parent.parent && cursor[side]) { - // move the stuff between - new Fragment(cursor[side], cursor.parent.getEnd(side), -side) // me and ghost outside - .disown() - .withDirAdopt(-side, brack.parent, brack, brack[side]) - .domFrag() - .insDirOf(side, brack.domFrag()); - } - brack.bubble(function (node) { - node.reflow(); - return undefined; - }); - } else { - (brack = this), (side = brack.side); - if (brack.replacedFragment) brack.side = 0; - // wrapping seln, don't be one-sided - else if (cursor[-side]) { - // elsewise, auto-expand so ghost is at far end - brack.replaces(new Fragment(cursor[-side], cursor.parent.getEnd(-side), side)); - cursor[-side] = 0; - } - _super.prototype.createLeftOf.call(this, cursor); - } - if (side === L) cursor.insAtLeftEnd(brack.getEnd(L)); - else cursor.insRightOf(brack); - }; - Bracket.prototype.placeCursor = function () {}; - Bracket.prototype.unwrap = function () { - this.getEnd(L) - .children() - .disown() - .adopt(this.parent, this, this[R]) - .domFrag() - .insertAfter(this.domFrag()); - this.remove(); - }; - Bracket.prototype.deleteSide = function (side, outward, cursor) { - var parent = this.parent, - sib = this[side], - farEnd = parent.getEnd(side); - if (side === this.side) { - // deleting non-ghost of one-sided bracket, unwrap - this.unwrap(); - sib ? cursor.insDirOf(-side, sib) : cursor.insAtDirEnd(side, parent); - return; - } - var opts = cursor.options, - wasSolid = !this.side; - this.side = -side; - // if deleting like, outer close-brace of [(1+2)+3} where inner open-paren - if (this.matchBrack(opts, side, this.getEnd(L).getEnd(this.side))) { - // is ghost, - this.closeOpposing(this.getEnd(L).getEnd(this.side)); // then become [1+2)+3 - var origEnd = this.getEnd(L).getEnd(side); - this.unwrap(); - if (origEnd) origEnd.siblingCreated(cursor.options, side); - if (sib) { - cursor.insDirOf(-side, sib); - } else { - cursor.insAtDirEnd(side, parent); - } - } else { - // if deleting like, inner close-brace of ([1+2}+3) where outer - if (this.matchBrack(opts, side, this.parent.parent)) { - // open-paren is - this.parent.parent.closeOpposing(this); // ghost, then become [1+2+3) - this.parent.parent.unwrap(); - } // else if deleting outward from a solid pair, unwrap - else if (outward && wasSolid) { - this.unwrap(); - sib ? cursor.insDirOf(-side, sib) : cursor.insAtDirEnd(side, parent); - return; - } else { - // else deleting just one of a pair of brackets, become one-sided - this.sides[side] = getOppBracketSide(this); - this.delimFrags[L].removeClass('dcg-mq-ghost'); - this.delimFrags[R].removeClass('dcg-mq-ghost'); - var brackFrag = this.delimFrags[side].addClass('dcg-mq-ghost'); - this.replaceBracket(brackFrag, side); - } - if (sib) { - // auto-expand so ghost is at far end - var leftEnd = this.getEnd(L); - var origEnd = leftEnd.getEnd(side); - leftEnd.domFrag().removeClass('dcg-mq-empty'); - new Fragment(sib, farEnd, -side) - .disown() - .withDirAdopt(-side, leftEnd, origEnd, 0) - .domFrag() - .insAtDirEnd(side, leftEnd.domFrag().oneElement()); - if (origEnd) origEnd.siblingCreated(cursor.options, side); - cursor.insDirOf(-side, sib); - } // didn't auto-expand, cursor goes just outside or just inside parens - else outward ? cursor.insDirOf(side, this) : cursor.insAtDirEnd(side, this.getEnd(L)); - } - }; - Bracket.prototype.replaceBracket = function (brackFrag, side) { - var symbol = this.getSymbol(side); - brackFrag.children().replaceWith(domFrag(symbol.html())); - brackFrag.oneElement().style.width = symbol.width; - if (side === L) { - var next = brackFrag.next(); - if (!next.isEmpty()) { - next.oneElement().style.marginLeft = symbol.width; - } - } else { - var prev = brackFrag.prev(); - if (!prev.isEmpty()) { - prev.oneElement().style.marginRight = symbol.width; - } - } - }; - Bracket.prototype.deleteTowards = function (dir, cursor) { - this.deleteSide(-dir, false, cursor); - }; - Bracket.prototype.finalizeTree = function () { - this.getEnd(L).deleteOutOf = function (dir, cursor) { - this.parent.deleteSide(dir, true, cursor); - }; - // FIXME HACK: after initial creation/insertion, finalizeTree would only be - // called if the paren is selected and replaced, e.g. by LiveFraction - this.finalizeTree = this.intentionalBlur = function () { - this.delimFrags[this.side === L ? R : L].removeClass('dcg-mq-ghost'); - this.side = 0; - }; - }; - Bracket.prototype.siblingCreated = function (_opts, dir) { - // if something typed between ghost and far - if (dir === -this.side) this.finalizeTree(); // end of its block, solidify - }; - return Bracket; - })(DelimsNode); - function getOppBracketSide(bracket) { - var side = bracket.side; - var data = bracket.sides[side]; - return { - ch: OPP_BRACKS[data.ch], - ctrlSeq: OPP_BRACKS[data.ctrlSeq], - }; - } - var OPP_BRACKS = { - '(': ')', - ')': '(', - '[': ']', - ']': '[', - '{': '}', - '}': '{', - '\\{': '\\}', - '\\}': '\\{', - '⟨': '⟩', - '⟩': '⟨', - '\\langle ': '\\rangle ', - '\\rangle ': '\\langle ', - '|': '|', - '\\lVert ': '\\rVert ', - '\\rVert ': '\\lVert ', - }; - var BRACKET_NAMES = { - '⟨': 'angle-bracket', - '⟩': 'angle-bracket', - '|': 'pipe', - }; - function bindCharBracketPair(open, ctrlSeq, name) { - var ctrlSeq = ctrlSeq || open; - var close = OPP_BRACKS[open]; - var end = OPP_BRACKS[ctrlSeq]; - CharCmds[open] = function () { - return new Bracket(L, open, close, ctrlSeq, end); - }; - CharCmds[close] = function () { - return new Bracket(R, open, close, ctrlSeq, end); - }; - BRACKET_NAMES[open] = BRACKET_NAMES[close] = name; - } - bindCharBracketPair('(', '', 'parenthesis'); - bindCharBracketPair('[', '', 'bracket'); - bindCharBracketPair('{', '\\{', 'brace'); - LatexCmds.langle = function () { - return new Bracket(L, '⟨', '⟩', '\\langle ', '\\rangle '); - }; - LatexCmds.rangle = function () { - return new Bracket(R, '⟨', '⟩', '\\langle ', '\\rangle '); - }; - CharCmds['|'] = function () { - return new Bracket(L, '|', '|', '|', '|'); - }; - LatexCmds.lVert = function () { - return new Bracket(L, '∥', '∥', '\\lVert ', '\\rVert '); - }; - LatexCmds.rVert = function () { - return new Bracket(R, '∥', '∥', '\\lVert ', '\\rVert '); - }; - LatexCmds.left = /** @class */ (function (_super) { - __extends(left, _super); - function left() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - left.prototype.parser = function () { - var regex = Parser.regex; - var string = Parser.string; - var optWhitespace = Parser.optWhitespace; - return optWhitespace - .then(regex(/^(?:[([|]|\\\{|\\langle(?![a-zA-Z])|\\lVert(?![a-zA-Z]))/)) - .then(function (ctrlSeq) { - var open = ctrlSeq.replace(/^\\/, ''); - if (ctrlSeq == '\\langle') { - open = '⟨'; - ctrlSeq = ctrlSeq + ' '; - } - if (ctrlSeq == '\\lVert') { - open = '∥'; - ctrlSeq = ctrlSeq + ' '; - } - return latexMathParser.then(function (block) { - return string('\\right') - .skip(optWhitespace) - .then(regex(/^(?:[\])|]|\\\}|\\rangle(?![a-zA-Z])|\\rVert(?![a-zA-Z]))/)) - .map(function (end) { - var close = end.replace(/^\\/, ''); - if (end == '\\rangle') { - close = '⟩'; - end = end + ' '; - } - if (end == '\\rVert') { - close = '∥'; - end = end + ' '; - } - var cmd = new Bracket(0, open, close, ctrlSeq, end); - cmd.blocks = [block]; - block.adopt(cmd, 0, 0); - return cmd; - }); - }); - }); - }; - return left; - })(MathCommand); - LatexCmds.right = /** @class */ (function (_super) { - __extends(right, _super); - function right() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - right.prototype.parser = function () { - return Parser.fail('unmatched \\right'); - }; - return right; - })(MathCommand); - var leftBinomialSymbol = SVG_SYMBOLS['(']; - var rightBinomialSymbol = SVG_SYMBOLS[')']; - var Binomial = /** @class */ (function (_super) { - __extends(Binomial, _super); - function Binomial() { - var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; - _this_1.ctrlSeq = '\\binom'; - _this_1.domView = new DOMView(2, function (blocks) { - return h('span', { class: 'dcg-mq-non-leaf dcg-mq-bracket-container' }, [ - h( - 'span', - { - style: 'width:' + leftBinomialSymbol.width, - class: 'dcg-mq-paren dcg-mq-bracket-l dcg-mq-scaled', - }, - [leftBinomialSymbol.html()] - ), - h( - 'span', - { - style: - 'margin-left:' + - leftBinomialSymbol.width + - '; margin-right:' + - rightBinomialSymbol.width, - class: 'dcg-mq-non-leaf dcg-mq-bracket-middle', - }, - [ - h('span', { class: 'dcg-mq-array dcg-mq-non-leaf' }, [ - h.block('span', {}, blocks[0]), - h.block('span', {}, blocks[1]), - ]), - ] - ), - h( - 'span', - { - style: 'width:' + rightBinomialSymbol.width, - class: 'dcg-mq-paren dcg-mq-bracket-r dcg-mq-scaled', - }, - [rightBinomialSymbol.html()] - ), - ]); - }); - _this_1.textTemplate = ['choose(', ',', ')']; - _this_1.mathspeakTemplate = ['StartBinomial,', 'Choose', ', EndBinomial']; - _this_1.ariaLabel = 'binomial'; - return _this_1; - } - return Binomial; - })(DelimsNode); - LatexCmds.binom = LatexCmds.binomial = Binomial; - LatexCmds.choose = /** @class */ (function (_super) { - __extends(class_14, _super); - function class_14() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - class_14.prototype.createLeftOf = function (cursor) { - LiveFraction.prototype.createLeftOf(cursor); - }; - return class_14; - })(Binomial); - var MathFieldNode = /** @class */ (function (_super) { - __extends(MathFieldNode, _super); - function MathFieldNode() { - var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; - _this_1.ctrlSeq = '\\MathQuillMathField'; - _this_1.domView = new DOMView(1, function (blocks) { - return h('span', { class: 'dcg-mq-editable-field' }, [ - h.block('span', { class: 'dcg-mq-root-block', 'aria-hidden': 'true' }, blocks[0]), - ]); - }); - return _this_1; - } - MathFieldNode.prototype.parser = function () { - var self = this, - string = Parser.string, - regex = Parser.regex, - succeed = Parser.succeed; - return string('[') - .then(regex(/^[a-z][a-z0-9]*/i)) - .skip(string(']')) - .map(function (name) { - self.name = name; - }) - .or(succeed(undefined)) - .then(_super.prototype.parser.call(this)); - }; - MathFieldNode.prototype.finalizeTree = function (options) { - var ctrlr = new Controller(this.getEnd(L), this.domFrag().oneElement(), options); - ctrlr.KIND_OF_MQ = 'MathField'; - ctrlr.editable = true; - ctrlr.createTextarea(); - ctrlr.editablesTextareaEvents(); - ctrlr.cursor.insAtRightEnd(ctrlr.root); - RootBlockMixin(ctrlr.root); - // MathQuill applies aria-hidden to .dcg-mq-root-block containers - // because these contain math notation that screen readers can't - // interpret directly. MathQuill use an aria-live region as a - // sibling of these block containers to provide an alternative - // representation for screen readers - // - // MathFieldNodes have their own focusable text aria and aria live - // region, so it is incorrect for any parent of the editable field - // to have an aria-hidden property - // - // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden - // - // Handle this by recursively walking the parents of this element - // until we hit a root block, and if we hit any parent with - // aria-hidden="true", removing the property from the parent and - // pushing it down to each of the parents children. This should - // result in no parent of this node having aria-hidden="true", but - // should keep as much of what was previously hidden hidden as - // possible while obeying this constraint - function pushDownAriaHidden(node) { - if (node.parentNode && !domFrag(node).hasClass('dcg-mq-root-block')) { - pushDownAriaHidden(node.parentNode); - } - if (node.nodeType === Node.ELEMENT_NODE) { - var element = node; - if (element.getAttribute('aria-hidden') === 'true') { - element.removeAttribute('aria-hidden'); - domFrag(node) - .children() - .eachElement(function (child) { - child.setAttribute('aria-hidden', 'true'); - }); - } - } - } - pushDownAriaHidden(this.domFrag().parent().oneElement()); - this.domFrag().oneElement().removeAttribute('aria-hidden'); - }; - MathFieldNode.prototype.registerInnerField = function (innerFields, MathField) { - var controller = this.getEnd(L).controller; - var newField = new MathField(controller); - innerFields[this.name] = newField; - innerFields.push(newField); - }; - MathFieldNode.prototype.latexRecursive = function (ctx) { - this.checkCursorContextOpen(ctx); - this.getEnd(L).latexRecursive(ctx); - this.checkCursorContextClose(ctx); - }; - MathFieldNode.prototype.text = function () { - return this.getEnd(L).text(); - }; - return MathFieldNode; - })(MathCommand); - LatexCmds.editable = LatexCmds.MathQuillMathField = MathFieldNode; // backcompat with before cfd3620 on #233 - // Embed arbitrary things - // Probably the closest DOM analogue would be an iframe? - // From MathQuill's perspective, it's a MQSymbol, it can be - // anywhere and the cursor can go around it but never in it. - // Create by calling public API method .dropEmbedded(), - // or by calling the global public API method .registerEmbed() - // and rendering LaTeX like \embed{registeredName} (see test). - var EmbedNode = /** @class */ (function (_super) { - __extends(EmbedNode, _super); - function EmbedNode() { - return (_super !== null && _super.apply(this, arguments)) || this; - } - EmbedNode.prototype.setOptions = function (options) { - function noop() { - return ''; - } - this.text = options.text || noop; - this.domView = new DOMView(0, function () { - return h('span', {}, [parseHTML(options.htmlString || '')]); - }); - this.latex = options.latex || noop; - return this; - }; - EmbedNode.prototype.latexRecursive = function (ctx) { - this.checkCursorContextOpen(ctx); - ctx.latex += this.latex(); - this.checkCursorContextClose(ctx); - }; - EmbedNode.prototype.parser = function () { - var self = this, - string = Parser.string, - regex = Parser.regex, - succeed = Parser.succeed; - return string('{') - .then(regex(/^[a-z][a-z0-9]*/i)) - .skip(string('}')) - .then(function (name) { - // the chars allowed in the optional data block are arbitrary other than - // excluding curly braces and square brackets (which'd be too confusing) - return string('[') - .then(regex(/^[-\w\s]*/)) - .skip(string(']')) - .or(succeed(undefined)) - .map(function (data) { - return self.setOptions(EMBEDS[name](data)); - }); - }); - }; - return EmbedNode; - })(MQSymbol); - LatexCmds.embed = EmbedNode; - /**************************************** - * Input box to type backslash commands - ***************************************/ - CharCmds['\\'] = /** @class */ (function (_super) { - __extends(LatexCommandInput, _super); - function LatexCommandInput() { - var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; - _this_1.ctrlSeq = '\\'; - _this_1.domView = new DOMView(1, function (blocks) { - return h('span', { class: 'dcg-mq-latex-command-input-wrapper dcg-mq-non-leaf' }, [ - h('span', { class: 'dcg-mq-latex-command-input dcg-mq-non-leaf' }, [ - h.text('\\'), - h.block('span', {}, blocks[0]), - ]), - ]); - }); - _this_1.textTemplate = ['\\']; - return _this_1; - } - LatexCommandInput.prototype.replaces = function (replacedFragment) { - this._replacedFragment = replacedFragment.disown(); - this.isEmpty = function () { - return false; - }; - }; - LatexCommandInput.prototype.createBlocks = function () { - _super.prototype.createBlocks.call(this); - var endsL = this.getEnd(L); - endsL.focus = function () { - this.parent.domFrag().addClass('dcg-mq-hasCursor'); - if (this.isEmpty()) this.parent.domFrag().removeClass('dcg-mq-empty'); - return this; - }; - endsL.blur = function () { - this.parent.domFrag().removeClass('dcg-mq-hasCursor'); - if (this.isEmpty()) this.parent.domFrag().addClass('dcg-mq-empty'); - return this; - }; - endsL.write = function (cursor, ch) { - cursor.show().deleteSelection(); - if (ch.match(/[a-z]/i)) { - new VanillaSymbol(ch).createLeftOf(cursor); - // TODO needs tests - cursor.controller.aria.alert(ch); - } else { - var cmd = this.parent.renderCommand(cursor); - // TODO needs tests - cursor.controller.aria.queue(cmd.mathspeak({ createdLeftOf: cursor })); - if (ch !== '\\' || !this.isEmpty()) cursor.parent.write(cursor, ch); - else cursor.controller.aria.alert(); - } - }; - var originalKeystroke = endsL.keystroke; - endsL.keystroke = function (key, e, ctrlr) { - if (key === 'Tab' || key === 'Enter' || key === 'Spacebar') { - var cmd = this.parent.renderCommand(ctrlr.cursor); - // TODO needs tests - ctrlr.aria.alert(cmd.mathspeak({ createdLeftOf: ctrlr.cursor })); - e === null || e === void 0 ? void 0 : e.preventDefault(); - return; - } - return originalKeystroke.call(this, key, e, ctrlr); - }; - }; - LatexCommandInput.prototype.createLeftOf = function (cursor) { - _super.prototype.createLeftOf.call(this, cursor); - if (this._replacedFragment) { - var frag = this.domFrag(); - var el_1 = frag.oneElement(); - this._replacedFragment.domFrag().addClass('dcg-mq-blur'); - //FIXME: is monkey-patching the mousedown and mousemove handlers the right way to do this? - var rewriteMousedownEventTarget = function (e) { - { - // TODO - overwritting e.target - e.target = el_1; - el_1.dispatchEvent(e); - return false; - } - }; - el_1.addEventListener('mousedown', rewriteMousedownEventTarget); - el_1.addEventListener('mouseup', rewriteMousedownEventTarget); - this._replacedFragment.domFrag().insertBefore(frag.children().first()); - } - }; - LatexCommandInput.prototype.latexRecursive = function (ctx) { - this.checkCursorContextOpen(ctx); - ctx.latex += '\\'; - this.getEnd(L).latexRecursive(ctx); - ctx.latex += ' '; - this.checkCursorContextClose(ctx); - }; - LatexCommandInput.prototype.renderCommand = function (cursor) { - this.setDOM(this.domFrag().children().lastElement()); - this.remove(); - if (this[R]) { - cursor.insLeftOf(this[R]); - } else { - cursor.insAtRightEnd(this.parent); - } - var latex = this.getEnd(L).latex(); - if (!latex) latex = ' '; - var cmd = LatexCmds[latex]; - if (cmd) { - //console.log(cmd); - var node = void 0; - if (isMQNodeClass(cmd)) { - node = new cmd(latex); - } else { - node = cmd(latex); - } - if (this._replacedFragment) node.replaces(this._replacedFragment); - node.createLeftOf(cursor); - return node; - } else { - var node = new TextBlock(); - node.replaces(latex); - node.createLeftOf(cursor); - cursor.insRightOf(node); - if (this._replacedFragment) { - this._replacedFragment.remove(); - } - return node; - } - }; - return LatexCommandInput; - })(MathCommand); - // For backwards compatibility, set up the global MathQuill object as an instance of API interface v1 - if (window.jQuery) { - MQ1 = getInterface(1); - for (var key in MQ1) - (function (key, val) { - if (typeof val === 'function') { - MathQuill[key] = function () { - insistOnInterVer(); - return val.apply(this, arguments); - }; - MathQuill[key].prototype = val.prototype; - } else MathQuill[key] = val; - })(key, MQ1[key]); - } - //console.log(MathQuill); - })(); -} - diff --git a/tsconfig.json b/tsconfig.json index f2c27e8..38662cb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,20 +1,19 @@ { "compilerOptions": { - "module": "ES6", - "target": "es6", + "outDir": "./dist/", + "sourceMap": true, + "strictNullChecks": false, + "module": "es6", "moduleResolution": "node", - "esModuleInterop": true, - "noImplicitAny": false, - "sourceMap": false, - "rootDir": "src", - "outDir": "dist/js", - "noEmitOnError": true, - "typeRoots": [ - "node_modules/@types", - "node_modules/web-ext-types" - ], - "types": [ - "node" - ] - } + "allowSyntheticDefaultImports": true, + "jsx": "react", + "jsxFactory": "DCGView.jsx", + "target": "es2020", + "allowJs": true, + "strict": true, + "baseUrl": "src", + "noImplicitAny": false + }, + "include": ["./src/"] } + diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index 4bc48ad..8eb9e69 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -11,7 +11,7 @@ module.exports = { background: path.join(__dirname, `../${SRC_DIR_NAME}/background/${browser}/background.ts`), contentscript: path.join(__dirname, `../${SRC_DIR_NAME}/contentscript.ts`), inject: path.join(__dirname, `../${SRC_DIR_NAME}/inject.ts`), - extend_mathquill: path.join(__dirname, `../${SRC_DIR_NAME}/extend_mathquill.ts`), + extend_mathquill: path.join(__dirname, `../${SRC_DIR_NAME}/extend_mathquill.js`), preload_content: path.join(__dirname, `../${SRC_DIR_NAME}/preload_content.ts`), preload_inject: path.join(__dirname, `../${SRC_DIR_NAME}/preload_inject.ts`), }, @@ -19,12 +19,6 @@ module.exports = { path: path.join(__dirname, `../${BUILD_DIR_NAME}`), filename: '[name].js', }, - optimization: { - splitChunks: { - name: 'vendor', - chunks: 'initial', - }, - }, module: { rules: [ { From b1ef3af68720d87381f42772a062b0c14a292e35 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Sun, 10 Jul 2022 10:28:42 -0500 Subject: [PATCH 04/32] Add global types and utils --- .eslintrc.json | 11 ++++++++++- src/globals/window.ts | 17 +++++++++++++++++ src/inject.ts | 5 +++-- src/preload_inject.ts | 25 ++++++------------------- src/utils/utils.ts | 20 ++++++++++++++++++++ 5 files changed, 56 insertions(+), 22 deletions(-) create mode 100644 src/globals/window.ts create mode 100644 src/utils/utils.ts diff --git a/.eslintrc.json b/.eslintrc.json index a94a273..15c2bf1 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -31,7 +31,16 @@ "no-console": 1, "@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/no-inferrable-types": "off", - "@typescript-eslint/no-unused-vars": "error" + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/ban-types": [ + "off", + { + "types": { + "Function": "" + } + } + ] }, "settings": { "import/resolver": { diff --git a/src/globals/window.ts b/src/globals/window.ts new file mode 100644 index 0000000..3b5a3ce --- /dev/null +++ b/src/globals/window.ts @@ -0,0 +1,17 @@ +interface windowConfig extends Window { + require(s: string[], callback: Function): void; + require(s: string): any; + DesModder: any; + define( + moduleName: string, + dependencies: string[], + definition: Function + ): void; + ALMOND_OVERRIDES: { [key: string]: Function }; + Desmos: any; +} + +declare let window: windowConfig; + +export default window; + diff --git a/src/inject.ts b/src/inject.ts index 830ae68..38382c7 100644 --- a/src/inject.ts +++ b/src/inject.ts @@ -1,10 +1,11 @@ /// +import window from './globals/window'; function waitForDesmosLoaded(commands: string) { const interval = 10; // ms window.setTimeout(function () { - if ((window as any).Desmos?.MathQuill?.config && (window as any).Desmos?.Calculator) { - (window as any).Desmos.MathQuill.config({ + if (window.Desmos?.MathQuill?.config && window.Desmos?.Calculator) { + window.Desmos.MathQuill.config({ autoCommands: commands, }); } else { diff --git a/src/preload_inject.ts b/src/preload_inject.ts index f5c5ea2..a552548 100644 --- a/src/preload_inject.ts +++ b/src/preload_inject.ts @@ -1,4 +1,6 @@ +import window from './globals/window'; import extendMathQuill from './extend_mathquill'; +import { pollForValue } from './utils/utils'; console.log('Preload injected'); @@ -18,12 +20,12 @@ newDefine.amd = { }; // trick to override `define`s -(window as any).ALMOND_OVERRIDES = new Proxy( +window.ALMOND_OVERRIDES = new Proxy( {}, { get(target, prop, receiver) { if (prop === 'define') { - oldDefine = (window as any).define; + oldDefine = window.define; return newDefine; } else { return Reflect.get(target, prop, receiver); @@ -36,7 +38,7 @@ function runCalculator() { /* The following script should have failed earlier because we blocked calculator_desktop.js. We copy it verbatim here to actually load the calculator. */ - (window as any).require( + window.require( ['toplevel/calculator_desktop', 'testbridge', 'jquery'], function (calcPromise: any, TestBridge: any, $: any) { $('.dcg-loading-div-container').hide(); @@ -47,28 +49,13 @@ function runCalculator() { if (calc === undefined) { console.error('No calc'); } - (window as any).Calc = calc; + window.Calc = calc; TestBridge.ready(); }); } ); } -async function pollForValue(func: any) { - return await _pollForValue(func); -} - -function _pollForValue(func: () => T) { - return new Promise((resolve) => { - const interval = setInterval(() => { - const val = func(); - if (val !== null && val !== undefined) { - clearInterval(interval); - resolve(val); - } - }, 50); - }); -} diff --git a/src/utils/utils.ts b/src/utils/utils.ts new file mode 100644 index 0000000..dc4e3d1 --- /dev/null +++ b/src/utils/utils.ts @@ -0,0 +1,20 @@ +interface FuncAny { + (): any; +} + +export async function pollForValue(func: FuncAny) { + return await _pollForValue(func); +} + +function _pollForValue(func: () => T) { + return new Promise((resolve) => { + const interval = setInterval(() => { + const val = func(); + if (val !== null && val !== undefined) { + clearInterval(interval); + resolve(val); + } + }, 50); + }); +} + From df8b42c1d77a643cd79145ca47b8c147a58a8ef4 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Sun, 10 Jul 2022 12:34:26 -0500 Subject: [PATCH 05/32] Update config, remove console logs --- src/contentscript.ts | 10 ---------- src/globals/window.ts | 1 + src/inject.ts | 6 +++--- src/preload_inject.ts | 3 --- tsconfig.json | 2 +- 5 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/contentscript.ts b/src/contentscript.ts index 9294494..e57813a 100644 --- a/src/contentscript.ts +++ b/src/contentscript.ts @@ -15,13 +15,3 @@ async function updateAutoCommands() { updateAutoCommands(); browser.storage.onChanged.addListener(updateAutoCommands); -//function extendMathquill() { - //const script = document.createElement('script'); - //script.src = browser.runtime.getURL('extend_mathquill.js'); - //script.onload = function() { - //script.remove(); - //}; - //(document.head || document.documentElement).appendChild(script); -//} - -//extendMathquill(); diff --git a/src/globals/window.ts b/src/globals/window.ts index 3b5a3ce..68b451a 100644 --- a/src/globals/window.ts +++ b/src/globals/window.ts @@ -1,6 +1,7 @@ interface windowConfig extends Window { require(s: string[], callback: Function): void; require(s: string): any; + Calc: any; DesModder: any; define( moduleName: string, diff --git a/src/inject.ts b/src/inject.ts index 38382c7..f9d6bf3 100644 --- a/src/inject.ts +++ b/src/inject.ts @@ -1,11 +1,11 @@ /// -import window from './globals/window'; +//import window from './globals/window'; function waitForDesmosLoaded(commands: string) { const interval = 10; // ms window.setTimeout(function () { - if (window.Desmos?.MathQuill?.config && window.Desmos?.Calculator) { - window.Desmos.MathQuill.config({ + if ((window as any).Desmos?.MathQuill?.config && (window as any).Desmos?.Calculator) { + (window as any).Desmos.MathQuill.config({ autoCommands: commands, }); } else { diff --git a/src/preload_inject.ts b/src/preload_inject.ts index a552548..bd2d70a 100644 --- a/src/preload_inject.ts +++ b/src/preload_inject.ts @@ -2,14 +2,11 @@ import window from './globals/window'; import extendMathQuill from './extend_mathquill'; import { pollForValue } from './utils/utils'; -console.log('Preload injected'); - let oldDefine!: any; function newDefine(moduleName: string, dependencies: any, definition: any) { if (moduleName === 'mathquill_src') { // override should either be `{dependencies, definition}` or just `definition` dependencies = extendMathQuill; - console.log(dependencies); } return oldDefine(moduleName, dependencies, definition); } diff --git a/tsconfig.json b/tsconfig.json index 38662cb..f88809d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "outDir": "./dist/", "sourceMap": true, - "strictNullChecks": false, + "strictNullChecks": true, "module": "es6", "moduleResolution": "node", "allowSyntheticDefaultImports": true, From 9747f31ce54efd9a6ec4b5ecfa1a9720ef731cf5 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Sun, 10 Jul 2022 23:01:14 -0500 Subject: [PATCH 06/32] Rework injection timing, remove js blocking --- src/background/firefox/background.ts | 11 +++- src/preload_content.ts | 20 ++++--- src/preload_inject.ts | 88 ++++++++++++++-------------- tsconfig.json | 2 +- 4 files changed, 66 insertions(+), 55 deletions(-) diff --git a/src/background/firefox/background.ts b/src/background/firefox/background.ts index b757252..8d172ee 100644 --- a/src/background/firefox/background.ts +++ b/src/background/firefox/background.ts @@ -10,9 +10,14 @@ browser.runtime.onInstalled.addListener(function () { }); browser.webRequest.onBeforeRequest.addListener( - ({ url }) => ({ - cancel: url.endsWith('.js') || url.endsWith('.js?'), - }), + function () { + browser.tabs.query({ active: true, currentWindow: true }).then(function (tabs) { + browser.tabs.sendMessage(tabs[0].id, { injectPreload: true }).then(function () { + console.log('Response received'); + }); + }); + return { cancel: false }; + }, { urls: [ 'https://www.desmos.com/assets/build/calculator_desktop-*.js', diff --git a/src/preload_content.ts b/src/preload_content.ts index cddfaa2..3e6e643 100644 --- a/src/preload_content.ts +++ b/src/preload_content.ts @@ -1,10 +1,16 @@ console.log('Preload running...'); -const script = document.createElement('script'); -script.src = browser.runtime.getURL('preload_inject.js'); -script.onload = function () { - (this as any).remove(); -}; -(document.head || document.documentElement).appendChild(script); - +let ranAlready = false; +browser.runtime.onMessage.addListener(function (request, sender, sendResponse) { + if (request.injectPreload && !ranAlready) { + ranAlready = true; + const script = document.createElement('script'); + script.src = browser.runtime.getURL('preload_inject.js'); + script.onload = function () { + (this as any).remove(); + sendResponse({ farewell: 'goodbye' }); + }; + (document.head || document.documentElement).appendChild(script); + } +}); diff --git a/src/preload_inject.ts b/src/preload_inject.ts index bd2d70a..7bd87d3 100644 --- a/src/preload_inject.ts +++ b/src/preload_inject.ts @@ -1,6 +1,6 @@ import window from './globals/window'; import extendMathQuill from './extend_mathquill'; -import { pollForValue } from './utils/utils'; +//import { pollForValue } from './utils/utils'; let oldDefine!: any; function newDefine(moduleName: string, dependencies: any, definition: any) { @@ -31,52 +31,52 @@ window.ALMOND_OVERRIDES = new Proxy( } ); -function runCalculator() { - /* The following script should have failed earlier because we blocked calculator_desktop.js. - We copy it verbatim here to actually load the calculator. */ +//function runCalculator() { + //[> The following script should have failed earlier because we blocked calculator_desktop.js. + //We copy it verbatim here to actually load the calculator. */ - window.require( - ['toplevel/calculator_desktop', 'testbridge', 'jquery'], - function (calcPromise: any, TestBridge: any, $: any) { - $('.dcg-loading-div-container').hide(); - if (calcPromise === undefined) { - console.error('No calc promise'); - } - calcPromise.then(function (calc: any) { - if (calc === undefined) { - console.error('No calc'); - } - window.Calc = calc; - TestBridge.ready(); - }); - } - ); -} + //window.require( + //['toplevel/calculator_desktop', 'testbridge', 'jquery'], + //function (calcPromise: any, TestBridge: any, $: any) { + //$('.dcg-loading-div-container').hide(); + //if (calcPromise === undefined) { + //console.error('No calc promise'); + //} + //calcPromise.then(function (calc: any) { + //if (calc === undefined) { + //console.error('No calc'); + //} + //window.Calc = calc; + //TestBridge.ready(); + //}); + //} + //); +//} -pollForValue( - () => - ( - document.querySelector( - 'script[src^=\'/assets/build/calculator_desktop\']' - ) as HTMLScriptElement - )?.src -).then((src) => { - /* we blocked calculator_desktop.js earlier to ensure that the preload/override script runs first. - Now we load it, but with '?' appended to prevent the web request rules from blocking it */ - const script = document.createElement('script'); - script.src = src + '??'; - script.async = false; - script.onload = () => { - // remove from DOM - script.remove(); - runCalculator(); - }; - script.onerror = () => { - console.error('Injected script onerror'); - }; - document.body.appendChild(script); -}); +//pollForValue( + //() => + //( + //document.querySelector( + //'script[src^=\'/assets/build/calculator_desktop\']' + //) as HTMLScriptElement + //)?.src +//).then((src) => { + //[> we blocked calculator_desktop.js earlier to ensure that the preload/override script runs first. + //Now we load it, but with '?' appended to prevent the web request rules from blocking it */ + //const script = document.createElement('script'); + //script.src = src + '??'; + //script.async = false; + //script.onload = () => { + //// remove from DOM + //script.remove(); + //runCalculator(); + //}; + //script.onerror = () => { + //console.error('Injected script onerror'); + //}; + //document.body.appendChild(script); +//}); diff --git a/tsconfig.json b/tsconfig.json index f88809d..38662cb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "outDir": "./dist/", "sourceMap": true, - "strictNullChecks": true, + "strictNullChecks": false, "module": "es6", "moduleResolution": "node", "allowSyntheticDefaultImports": true, From 4a0ef9b8ddaa32d5a4e6469b86753a1f01177323 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Mon, 11 Jul 2022 12:21:33 -0500 Subject: [PATCH 07/32] Add DesModder compatibility --- src/background/firefox/background.ts | 13 ++-- src/globals/window.ts | 3 +- src/preload_content.ts | 4 +- src/preload_inject.ts | 96 ++++++++++------------------ 4 files changed, 42 insertions(+), 74 deletions(-) diff --git a/src/background/firefox/background.ts b/src/background/firefox/background.ts index 8d172ee..179b1f7 100644 --- a/src/background/firefox/background.ts +++ b/src/background/firefox/background.ts @@ -10,17 +10,14 @@ browser.runtime.onInstalled.addListener(function () { }); browser.webRequest.onBeforeRequest.addListener( - function () { - browser.tabs.query({ active: true, currentWindow: true }).then(function (tabs) { - browser.tabs.sendMessage(tabs[0].id, { injectPreload: true }).then(function () { - console.log('Response received'); - }); - }); - return { cancel: false }; + async function () { + const tabs = await browser.tabs.query({ active: true, currentWindow: true }); + await browser.tabs.sendMessage(tabs[0].id, { injectPreload: true }); + await new Promise(r => setTimeout(r, 500)); // FIXME: fix race condiiton + return { cancel : false }; }, { urls: [ - 'https://www.desmos.com/assets/build/calculator_desktop-*.js', 'https://www.desmos.com/assets/build/calculator_desktop-*.js?', ], }, diff --git a/src/globals/window.ts b/src/globals/window.ts index 68b451a..7acf306 100644 --- a/src/globals/window.ts +++ b/src/globals/window.ts @@ -8,8 +8,9 @@ interface windowConfig extends Window { dependencies: string[], definition: Function ): void; - ALMOND_OVERRIDES: { [key: string]: Function }; + ALMOND_OVERRIDES: any; Desmos: any; + dsu_proxy: any; } declare let window: windowConfig; diff --git a/src/preload_content.ts b/src/preload_content.ts index 3e6e643..5871ee8 100644 --- a/src/preload_content.ts +++ b/src/preload_content.ts @@ -2,14 +2,14 @@ console.log('Preload running...'); let ranAlready = false; -browser.runtime.onMessage.addListener(function (request, sender, sendResponse) { +browser.runtime.onMessage.addListener(function (request) { if (request.injectPreload && !ranAlready) { ranAlready = true; const script = document.createElement('script'); script.src = browser.runtime.getURL('preload_inject.js'); script.onload = function () { (this as any).remove(); - sendResponse({ farewell: 'goodbye' }); + return Promise.resolve({ farewell: 'goodbye' }); }; (document.head || document.documentElement).appendChild(script); } diff --git a/src/preload_inject.ts b/src/preload_inject.ts index 7bd87d3..5e08fea 100644 --- a/src/preload_inject.ts +++ b/src/preload_inject.ts @@ -16,67 +16,37 @@ newDefine.amd = { jQuery: true, }; -// trick to override `define`s -window.ALMOND_OVERRIDES = new Proxy( - {}, - { - get(target, prop, receiver) { - if (prop === 'define') { - oldDefine = window.define; - return newDefine; - } else { - return Reflect.get(target, prop, receiver); - } - }, - } -); - -//function runCalculator() { - //[> The following script should have failed earlier because we blocked calculator_desktop.js. - //We copy it verbatim here to actually load the calculator. */ - - //window.require( - //['toplevel/calculator_desktop', 'testbridge', 'jquery'], - //function (calcPromise: any, TestBridge: any, $: any) { - //$('.dcg-loading-div-container').hide(); - //if (calcPromise === undefined) { - //console.error('No calc promise'); - //} - //calcPromise.then(function (calc: any) { - //if (calc === undefined) { - //console.error('No calc'); - //} - //window.Calc = calc; - //TestBridge.ready(); - //}); - //} - //); -//} - - - - -//pollForValue( - //() => - //( - //document.querySelector( - //'script[src^=\'/assets/build/calculator_desktop\']' - //) as HTMLScriptElement - //)?.src -//).then((src) => { - //[> we blocked calculator_desktop.js earlier to ensure that the preload/override script runs first. - //Now we load it, but with '?' appended to prevent the web request rules from blocking it */ - //const script = document.createElement('script'); - //script.src = src + '??'; - //script.async = false; - //script.onload = () => { - //// remove from DOM - //script.remove(); - //runCalculator(); - //}; - //script.onerror = () => { - //console.error('Injected script onerror'); - //}; - //document.body.appendChild(script); -//}); +console.log(window.ALMOND_OVERRIDES); +if (window.ALMOND_OVERRIDES === undefined) { + window.ALMOND_OVERRIDES = new Proxy( + {}, + { + get(target, prop, receiver) { + if (prop === 'define') { + oldDefine = window.define; + return newDefine; + } else { + return Reflect.get(target, prop, receiver); + } + }, + } + ); +} else { + window.dsu_proxy = new Proxy( + window.ALMOND_OVERRIDES, + { + get(target, prop, receiver) { + console.log('dsu_proxy working'); + if (prop === 'define') { + oldDefine = window.define; + return newDefine; + } else { + return Reflect.get(target, prop, receiver); + } + }, + } + ); + window.ALMOND_OVERRIDES = window.dsu_proxy; + delete window.dsu_proxy; +} From db4c764f06976af818fcdcc64d4078e25f3029f2 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Mon, 11 Jul 2022 12:47:47 -0500 Subject: [PATCH 08/32] Clean up proxy initialization --- src/globals/window.ts | 2 +- src/preload_inject.ts | 49 ++++++++++++++----------------------------- 2 files changed, 17 insertions(+), 34 deletions(-) diff --git a/src/globals/window.ts b/src/globals/window.ts index 7acf306..6e83bf8 100644 --- a/src/globals/window.ts +++ b/src/globals/window.ts @@ -10,7 +10,7 @@ interface windowConfig extends Window { ): void; ALMOND_OVERRIDES: any; Desmos: any; - dsu_proxy: any; + dsuProxy: any; } declare let window: windowConfig; diff --git a/src/preload_inject.ts b/src/preload_inject.ts index 5e08fea..fe910d1 100644 --- a/src/preload_inject.ts +++ b/src/preload_inject.ts @@ -16,37 +16,20 @@ newDefine.amd = { jQuery: true, }; -console.log(window.ALMOND_OVERRIDES); -if (window.ALMOND_OVERRIDES === undefined) { - window.ALMOND_OVERRIDES = new Proxy( - {}, - { - get(target, prop, receiver) { - if (prop === 'define') { - oldDefine = window.define; - return newDefine; - } else { - return Reflect.get(target, prop, receiver); - } - }, - } - ); -} else { - window.dsu_proxy = new Proxy( - window.ALMOND_OVERRIDES, - { - get(target, prop, receiver) { - console.log('dsu_proxy working'); - if (prop === 'define') { - oldDefine = window.define; - return newDefine; - } else { - return Reflect.get(target, prop, receiver); - } - }, - } - ); - window.ALMOND_OVERRIDES = window.dsu_proxy; - delete window.dsu_proxy; -} +window.dsuProxy = new Proxy( + window.ALMOND_OVERRIDES ? window.ALMOND_OVERRIDES : {}, + { + get(target, prop, receiver) { + console.log('dsuProxy working'); + if (prop === 'define') { + oldDefine = window.define; + return newDefine; + } else { + return Reflect.get(target, prop, receiver); + } + }, + } +); +window.ALMOND_OVERRIDES = window.dsuProxy; +delete window.dsuProxy; From c482c247d307278e2698f4e31c153587a08f3c94 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Mon, 11 Jul 2022 19:36:10 -0500 Subject: [PATCH 09/32] Complete DesModder compability for preload --- src/background/firefox/background.ts | 25 ++++++++++++++--- src/preload_content.ts | 42 ++++++++++++++++++++-------- 2 files changed, 51 insertions(+), 16 deletions(-) diff --git a/src/background/firefox/background.ts b/src/background/firefox/background.ts index 179b1f7..ecc8351 100644 --- a/src/background/firefox/background.ts +++ b/src/background/firefox/background.ts @@ -10,14 +10,31 @@ browser.runtime.onInstalled.addListener(function () { }); browser.webRequest.onBeforeRequest.addListener( - async function () { + async function ({ url }) { + if (url === 'https://www.desmos.com/assets/build/calculator_desktop-this_does_not_exist.js') { + return { cancel: false }; + } + const tabs = await browser.tabs.query({ active: true, currentWindow: true }); - await browser.tabs.sendMessage(tabs[0].id, { injectPreload: true }); - await new Promise(r => setTimeout(r, 500)); // FIXME: fix race condiiton - return { cancel : false }; + if (url.endsWith('.js')) { + console.log(url); + const response = await browser.tabs.sendMessage(tabs[0].id, { checkDesmodder: true }); + console.log('Message from the content script:'); + console.log((response as any).response); + if (!(response as any).response) { + await browser.tabs.sendMessage(tabs[0].id, { injectPreload: true }); + } + return { cancel: false }; + } + + if (url.endsWith('.js?')) { + await browser.tabs.sendMessage(tabs[0].id, { injectPreload: true }); + return { cancel: false }; + } }, { urls: [ + 'https://www.desmos.com/assets/build/calculator_desktop-*.js', 'https://www.desmos.com/assets/build/calculator_desktop-*.js?', ], }, diff --git a/src/preload_content.ts b/src/preload_content.ts index 5871ee8..db3698a 100644 --- a/src/preload_content.ts +++ b/src/preload_content.ts @@ -1,16 +1,34 @@ console.log('Preload running...'); -let ranAlready = false; - -browser.runtime.onMessage.addListener(function (request) { - if (request.injectPreload && !ranAlready) { - ranAlready = true; - const script = document.createElement('script'); - script.src = browser.runtime.getURL('preload_inject.js'); - script.onload = function () { - (this as any).remove(); - return Promise.resolve({ farewell: 'goodbye' }); - }; - (document.head || document.documentElement).appendChild(script); +browser.runtime.onMessage.addListener(async function (request) { + if (request.injectPreload) { + console.log('injectPreload Message from the background script:'); + console.log(request); + await new Promise(function (resolve) { + const script = document.createElement('script'); + script.src = browser.runtime.getURL('preload_inject.js'); + script.onload = function () { + (this as any).remove(); + resolve(); + }; + script.onerror = (e) => console.log(e); + (document.head || document.documentElement).appendChild(script); + }); + return Promise.resolve({ response: 'goodbye' }); + } + if (request.checkDesmodder) { + console.log('checkDesmodder Message from the background script:'); + console.log(request); + let isDesmodderActive: boolean; + try { + await fetch('https://www.desmos.com/assets/build/calculator_desktop-this_does_not_exist.js'); + isDesmodderActive = false; + console.log('Preload reports DesModder is NOT active'); + } catch { + isDesmodderActive = true; + console.log('Preload reports DesModder is active'); + } + return Promise.resolve({ response: isDesmodderActive }); } }); + From 0c6824acb4604c943b235eca9291b556574bdc7c Mon Sep 17 00:00:00 2001 From: SinclaM Date: Tue, 12 Jul 2022 14:02:23 -0500 Subject: [PATCH 10/32] Clean up and comment --- .eslintrc.json | 1 + src/background/firefox/background.ts | 27 ++++++++++---- src/globals/window.ts | 1 - src/preload_content.ts | 56 ++++++++++++++-------------- src/preload_inject.ts | 6 +-- tsconfig.json | 2 +- 6 files changed, 51 insertions(+), 42 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 15c2bf1..97ba77a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -33,6 +33,7 @@ "@typescript-eslint/no-inferrable-types": "off", "@typescript-eslint/no-unused-vars": "error", "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/ban-types": [ "off", { diff --git a/src/background/firefox/background.ts b/src/background/firefox/background.ts index ecc8351..240c39c 100644 --- a/src/background/firefox/background.ts +++ b/src/background/firefox/background.ts @@ -11,25 +11,36 @@ browser.runtime.onInstalled.addListener(function () { browser.webRequest.onBeforeRequest.addListener( async function ({ url }) { + // This url is used by preload_content to check for DesModder activity. + // We ignore it here to avoid an infinite recursion. if (url === 'https://www.desmos.com/assets/build/calculator_desktop-this_does_not_exist.js') { - return { cancel: false }; + return; } const tabs = await browser.tabs.query({ active: true, currentWindow: true }); + if (url.endsWith('.js')) { console.log(url); - const response = await browser.tabs.sendMessage(tabs[0].id, { checkDesmodder: true }); + const isDesmodderActive: boolean | void = await browser.tabs.sendMessage(tabs[0].id, { + message: 'check-desmodder', + }); console.log('Message from the content script:'); - console.log((response as any).response); - if (!(response as any).response) { - await browser.tabs.sendMessage(tabs[0].id, { injectPreload: true }); + console.log(isDesmodderActive); + + // If DesModder is not active, then we should immediately inject the preload script + // and begin overrides. There won't be another opportunity. + // If DesModder is active, then we know that DesModder's own webRequest rules will + // block this script anyway, and we don't want to define ALMOND_OVERRIDES before + // DesModder does, so we can wait until DesModder makes another request. + if (!isDesmodderActive) { + await browser.tabs.sendMessage(tabs[0].id, { message: 'inject-preload' }); } - return { cancel: false }; } + // This url being requested means DesModder is active and trying to load the calculator. + // Now is the time to inject the preload. if (url.endsWith('.js?')) { - await browser.tabs.sendMessage(tabs[0].id, { injectPreload: true }); - return { cancel: false }; + await browser.tabs.sendMessage(tabs[0].id, { message: 'inject-preload' }); } }, { diff --git a/src/globals/window.ts b/src/globals/window.ts index 6e83bf8..be8d0ad 100644 --- a/src/globals/window.ts +++ b/src/globals/window.ts @@ -10,7 +10,6 @@ interface windowConfig extends Window { ): void; ALMOND_OVERRIDES: any; Desmos: any; - dsuProxy: any; } declare let window: windowConfig; diff --git a/src/preload_content.ts b/src/preload_content.ts index db3698a..eb3b284 100644 --- a/src/preload_content.ts +++ b/src/preload_content.ts @@ -1,34 +1,34 @@ console.log('Preload running...'); browser.runtime.onMessage.addListener(async function (request) { - if (request.injectPreload) { - console.log('injectPreload Message from the background script:'); - console.log(request); - await new Promise(function (resolve) { - const script = document.createElement('script'); - script.src = browser.runtime.getURL('preload_inject.js'); - script.onload = function () { - (this as any).remove(); - resolve(); - }; - script.onerror = (e) => console.log(e); - (document.head || document.documentElement).appendChild(script); - }); - return Promise.resolve({ response: 'goodbye' }); - } - if (request.checkDesmodder) { - console.log('checkDesmodder Message from the background script:'); - console.log(request); - let isDesmodderActive: boolean; - try { - await fetch('https://www.desmos.com/assets/build/calculator_desktop-this_does_not_exist.js'); - isDesmodderActive = false; - console.log('Preload reports DesModder is NOT active'); - } catch { - isDesmodderActive = true; - console.log('Preload reports DesModder is active'); - } - return Promise.resolve({ response: isDesmodderActive }); + let isDesmodderActive: boolean; + switch (request.message) { + case 'check-desmodder': + console.log(`preload_content heard message: ${request.message}`); + try { + await fetch('https://www.desmos.com/assets/build/calculator_desktop-this_does_not_exist.js'); + isDesmodderActive = false; + console.log('preload_content reports DesModder is NOT active'); + } catch { + isDesmodderActive = true; + console.log('preload_content reports DesModder is active'); + } + return Promise.resolve(isDesmodderActive); + break; + case 'inject-preload': + console.log(`preload_content heard message: ${request.message}`); + await new Promise(function (resolve) { + const script = document.createElement('script'); + script.src = browser.runtime.getURL('preload_inject.js'); + script.onload = function () { + (this as any).remove(); + resolve(); + }; + script.onerror = (e) => console.log(e); + (document.head || document.documentElement).appendChild(script); + }); + return Promise.resolve(); + break; } }); diff --git a/src/preload_inject.ts b/src/preload_inject.ts index fe910d1..e8f60a4 100644 --- a/src/preload_inject.ts +++ b/src/preload_inject.ts @@ -16,11 +16,11 @@ newDefine.amd = { jQuery: true, }; -window.dsuProxy = new Proxy( +window.ALMOND_OVERRIDES = new Proxy( window.ALMOND_OVERRIDES ? window.ALMOND_OVERRIDES : {}, { get(target, prop, receiver) { - console.log('dsuProxy working'); + console.log('ALMOND_OVERRIDES proxy success'); if (prop === 'define') { oldDefine = window.define; return newDefine; @@ -30,6 +30,4 @@ window.dsuProxy = new Proxy( }, } ); -window.ALMOND_OVERRIDES = window.dsuProxy; -delete window.dsuProxy; diff --git a/tsconfig.json b/tsconfig.json index 38662cb..3c7a605 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,7 @@ "allowSyntheticDefaultImports": true, "jsx": "react", "jsxFactory": "DCGView.jsx", - "target": "es2020", + "target": "es6", "allowJs": true, "strict": true, "baseUrl": "src", From a44c34a6a035490b9daeb22bb165c027d55dead3 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Tue, 12 Jul 2022 23:03:59 -0500 Subject: [PATCH 11/32] Begin Chrome support --- public/chrome_manifest.json | 20 ++++++++++-- public/net_request_rules.json | 14 +++++++++ src/background/chrome/background.ts | 13 ++++++++ src/intercept.ts | 1 + src/preload_content.ts | 25 +++++++++++++++ src/run_calculator.ts | 49 +++++++++++++++++++++++++++++ tsconfig.json | 2 +- webpack/webpack.common.js | 7 +++++ 8 files changed, 127 insertions(+), 4 deletions(-) create mode 100644 public/net_request_rules.json create mode 100644 src/intercept.ts create mode 100644 src/run_calculator.ts diff --git a/public/chrome_manifest.json b/public/chrome_manifest.json index 709af4c..ccf9cf9 100644 --- a/public/chrome_manifest.json +++ b/public/chrome_manifest.json @@ -2,7 +2,7 @@ "name": "Desmos Unlocked", "version": "1.0.3", "description": "Browser extension for better user control of the Desmos graphing calculator configuration", - "permissions": ["storage"], + "permissions": ["storage", "declarativeNetRequest", "declarativeNetRequestWithHostAccess", "webRequest"], "manifest_version": 3, "background": { "service_worker": "background.js" @@ -12,12 +12,17 @@ "js": ["browser-polyfill.js", "contentscript.js"], "matches": ["https://www.desmos.com/calculator/*"], "run_at": "document_idle" + }, + { + "js": ["browser-polyfill.js", "preload_content.js"], + "matches": ["https://www.desmos.com/calculator*"], + "run_at": "document_start" } ], - + "host_permissions": ["*://www.desmos.com/calculator/*"], "web_accessible_resources": [ { - "resources": ["browser-polyfill.js", "inject.js"], + "resources": ["browser-polyfill.js", "inject.js", "preload_inject.js", "run_calculator.js", "intercept.js"], "matches": [""] } ], @@ -30,6 +35,15 @@ "128": "images/logo/128.png" } }, + "declarative_net_request": { + "rule_resources": [ + { + "id": "ruleset_1", + "enabled": true, + "path": "net_request_rules.json" + } + ] + }, "icons": { "16": "images/logo/16.png", "32": "images/logo/32.png", diff --git a/public/net_request_rules.json b/public/net_request_rules.json new file mode 100644 index 0000000..ed976cd --- /dev/null +++ b/public/net_request_rules.json @@ -0,0 +1,14 @@ +[ + { + "id": 1, + "priority": 1, + "action": { + "type": "redirect", + "redirect": {"extensionPath": "/intercept.js"} + }, + "condition": { + "urlFilter": "https://www.desmos.com/assets/build/calculator_desktop-*.js|" + } + } +] + diff --git a/src/background/chrome/background.ts b/src/background/chrome/background.ts index bccbd34..90c90f6 100644 --- a/src/background/chrome/background.ts +++ b/src/background/chrome/background.ts @@ -8,3 +8,16 @@ chrome.runtime.onInstalled.addListener(function () { 'keepmeKEEPME alpha beta sqrt theta Theta phi Phi pi Pi tau nthroot cbrt sum prod int ans percent infinity infty gamma Gamma delta Delta epsilon epsiv zeta eta kappa lambda Lambda mu xi Xi rho sigma Sigma chi Psi omega Omega digamma iota nu upsilon Upsilon Psi square mid parallel nparallel perp to times div approx', }); }); + +chrome.webRequest.onBeforeRedirect.addListener( + async function ({ url }) { + const tabs = await chrome.tabs.query({ active: true, currentWindow: true }); + chrome.tabs.sendMessage(tabs[0].id, { message: 'redirect-detected', url: url }); + }, + { + urls: [ + 'https://www.desmos.com/assets/build/calculator_desktop-*.js', + 'https://www.desmos.com/assets/build/calculator_desktop-*.js?', + ], + } +); diff --git a/src/intercept.ts b/src/intercept.ts new file mode 100644 index 0000000..16173a5 --- /dev/null +++ b/src/intercept.ts @@ -0,0 +1 @@ +// This is a brick wall diff --git a/src/preload_content.ts b/src/preload_content.ts index eb3b284..dac0dea 100644 --- a/src/preload_content.ts +++ b/src/preload_content.ts @@ -29,6 +29,31 @@ browser.runtime.onMessage.addListener(async function (request) { }); return Promise.resolve(); break; + case 'redirect-detected': + console.log(`preload_content heard message: ${request.message}`); + console.log(`url detected is ${request.url}`); + await new Promise(function (resolve) { + const script = document.createElement('script'); + script.src = browser.runtime.getURL('preload_inject.js'); + script.onload = function () { + (this as any).remove(); + resolve(); + }; + script.onerror = (e) => console.log(e); + (document.head || document.documentElement).appendChild(script); + }); + await new Promise(function (resolve) { + const script = document.createElement('script'); + script.src = browser.runtime.getURL('run_calculator.js'); + script.onload = function () { + (this as any).remove(); + resolve(); + }; + script.onerror = (e) => console.log(e); + (document.head || document.documentElement).appendChild(script); + }); + return Promise.resolve(); + break; } }); diff --git a/src/run_calculator.ts b/src/run_calculator.ts new file mode 100644 index 0000000..6b107fa --- /dev/null +++ b/src/run_calculator.ts @@ -0,0 +1,49 @@ +import window from './globals/window'; +import { pollForValue } from './utils/utils'; + +function runCalculator() { + /* The following script should have failed earlier because we blocked calculator_desktop.js. + We copy it verbatim here to actually load the calculator. */ + + window.require( + ['toplevel/calculator_desktop', 'testbridge', 'jquery'], + function (calcPromise: any, TestBridge: any, $: any) { + $('.dcg-loading-div-container').hide(); + if (calcPromise === undefined) { + console.error('No calc promise'); + } + calcPromise.then(function (calc: any) { + if (calc === undefined) { + console.error('No calc'); + } + window.Calc = calc; + TestBridge.ready(); + }); + } + ); +} + +pollForValue( + () => + ( + document.querySelector( + 'script[src^=\'/assets/build/calculator_desktop\']' + ) as HTMLScriptElement + )?.src +).then((src) => { + /* we blocked calculator_desktop.js earlier to ensure that the preload/override script runs first. + Now we load it, but with '?' appended to prevent the web request rules from blocking it */ + const script = document.createElement('script'); + script.src = src + '??'; + console.log(src); + script.async = false; + script.onload = () => { + // remove from DOM + script.remove(); + runCalculator(); + }; + script.onerror = () => { + console.error('Injected script onerror'); + }; + document.body.appendChild(script); +}); diff --git a/tsconfig.json b/tsconfig.json index 3c7a605..1be2b95 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ "outDir": "./dist/", "sourceMap": true, "strictNullChecks": false, - "module": "es6", + "module": "esnext", "moduleResolution": "node", "allowSyntheticDefaultImports": true, "jsx": "react", diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index 8eb9e69..10cda7a 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -14,6 +14,8 @@ module.exports = { extend_mathquill: path.join(__dirname, `../${SRC_DIR_NAME}/extend_mathquill.js`), preload_content: path.join(__dirname, `../${SRC_DIR_NAME}/preload_content.ts`), preload_inject: path.join(__dirname, `../${SRC_DIR_NAME}/preload_inject.ts`), + intercept: path.join(__dirname, `../${SRC_DIR_NAME}/intercept.ts`), + run_calculator: path.join(__dirname, `../${SRC_DIR_NAME}/run_calculator.ts`), }, output: { path: path.join(__dirname, `../${BUILD_DIR_NAME}`), @@ -48,6 +50,11 @@ module.exports = { { from: './popup.html', to: `../${BUILD_DIR_NAME}/popup.html`, context: 'public' }, { from: './popup.css', to: `../${BUILD_DIR_NAME}/popup.css`, context: 'public' }, { from: `${browser}_manifest.json`, to: `../${BUILD_DIR_NAME}/manifest.json`, context: 'public' }, + { + from: 'net_request_rules.json', + to: `../${BUILD_DIR_NAME}/net_request_rules.json`, + context: 'public', + }, ], }), ], From ff389f078f2dd61a138331de0033ad4fd443833b Mon Sep 17 00:00:00 2001 From: SinclaM Date: Wed, 13 Jul 2022 13:56:35 -0500 Subject: [PATCH 12/32] Support Chrome + Desmodder --- .eslintrc.json | 1 + public/net_request_rules.json | 11 ++++ src/background/chrome/background.ts | 18 +++++- src/preload_content.ts | 3 - src/run_calculator.ts | 48 +++++++++------ src/utils/injectScript.ts | 12 ++++ src/utils/messages.ts | 94 +++++++++++++++++++++++++++++ 7 files changed, 163 insertions(+), 24 deletions(-) create mode 100644 src/utils/injectScript.ts create mode 100644 src/utils/messages.ts diff --git a/.eslintrc.json b/.eslintrc.json index 97ba77a..0fd52ec 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -29,6 +29,7 @@ "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/explicit-module-boundary-types": "off", "no-console": 1, + "no-constant-condition": 1, "@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/no-inferrable-types": "off", "@typescript-eslint/no-unused-vars": "error", diff --git a/public/net_request_rules.json b/public/net_request_rules.json index ed976cd..f429c1f 100644 --- a/public/net_request_rules.json +++ b/public/net_request_rules.json @@ -9,6 +9,17 @@ "condition": { "urlFilter": "https://www.desmos.com/assets/build/calculator_desktop-*.js|" } + }, + { + "id": 2, + "priority": 2, + "action": { + "type": "redirect", + "redirect": {"extensionPath": "/intercept.js"} + }, + "condition": { + "urlFilter": "https://www.desmos.com/assets/build/calculator_desktop-*.js?|" + } } ] diff --git a/src/background/chrome/background.ts b/src/background/chrome/background.ts index 90c90f6..a3519cc 100644 --- a/src/background/chrome/background.ts +++ b/src/background/chrome/background.ts @@ -11,8 +11,24 @@ chrome.runtime.onInstalled.addListener(function () { chrome.webRequest.onBeforeRedirect.addListener( async function ({ url }) { + console.log(url.endsWith('?')); const tabs = await chrome.tabs.query({ active: true, currentWindow: true }); - chrome.tabs.sendMessage(tabs[0].id, { message: 'redirect-detected', url: url }); + while (true) { + // The request to calculator_desktop (and the following redirect) may happen + // before preload_content is loaded at document_start. To avoid a race condition, + // we keep trying to send the message until the "no receiving end" exception + // is gone. + try { + // TODO: Figure out why tsserver thinks that sendMessage returns void and not + // a promise. tsserver says await has no effect on the expression below but it's + // actual critical to resolve the promise and catch the error. + await chrome.tabs.sendMessage(tabs[0].id, { message: 'redirect-detected', url: url }); + break; + } + catch { + await new Promise((r) => setTimeout(r, 10)); + } + } }, { urls: [ diff --git a/src/preload_content.ts b/src/preload_content.ts index dac0dea..b9491a4 100644 --- a/src/preload_content.ts +++ b/src/preload_content.ts @@ -14,7 +14,6 @@ browser.runtime.onMessage.addListener(async function (request) { console.log('preload_content reports DesModder is active'); } return Promise.resolve(isDesmodderActive); - break; case 'inject-preload': console.log(`preload_content heard message: ${request.message}`); await new Promise(function (resolve) { @@ -28,7 +27,6 @@ browser.runtime.onMessage.addListener(async function (request) { (document.head || document.documentElement).appendChild(script); }); return Promise.resolve(); - break; case 'redirect-detected': console.log(`preload_content heard message: ${request.message}`); console.log(`url detected is ${request.url}`); @@ -53,7 +51,6 @@ browser.runtime.onMessage.addListener(async function (request) { (document.head || document.documentElement).appendChild(script); }); return Promise.resolve(); - break; } }); diff --git a/src/run_calculator.ts b/src/run_calculator.ts index 6b107fa..390e276 100644 --- a/src/run_calculator.ts +++ b/src/run_calculator.ts @@ -1,4 +1,6 @@ import window from './globals/window'; +import { postMessageUp, listenToMessageDown } from './utils/messages'; +import injectScript from './utils/injectScript'; import { pollForValue } from './utils/utils'; function runCalculator() { @@ -18,32 +20,38 @@ function runCalculator() { } window.Calc = calc; TestBridge.ready(); + // following lines added + listenToMessageDown((message) => { + if (message.type === 'set-script-url') { + injectScript(message.value); + // cancel listener + return true; + } + }); + postMessageUp({ + type: 'get-script-url', + }); }); } ); } pollForValue( - () => - ( - document.querySelector( - 'script[src^=\'/assets/build/calculator_desktop\']' - ) as HTMLScriptElement - )?.src + () => (document.querySelector("script[src^='/assets/build/calculator_desktop']") as HTMLScriptElement)?.src ).then((src) => { - /* we blocked calculator_desktop.js earlier to ensure that the preload/override script runs first. + /* we blocked calculator_desktop.js earlier to ensure that the preload/override script runs first. Now we load it, but with '?' appended to prevent the web request rules from blocking it */ - const script = document.createElement('script'); - script.src = src + '??'; - console.log(src); - script.async = false; - script.onload = () => { - // remove from DOM - script.remove(); - runCalculator(); - }; - script.onerror = () => { - console.error('Injected script onerror'); - }; - document.body.appendChild(script); + const script = document.createElement('script'); + script.src = src + '??'; + console.log(src); + script.async = false; + script.onload = () => { + // remove from DOM + script.remove(); + runCalculator(); + }; + script.onerror = () => { + console.error('Injected script onerror'); + }; + document.body.appendChild(script); }); diff --git a/src/utils/injectScript.ts b/src/utils/injectScript.ts new file mode 100644 index 0000000..77cf525 --- /dev/null +++ b/src/utils/injectScript.ts @@ -0,0 +1,12 @@ +export default function injectScript(url: string) { + const s = document.createElement('script'); + s.src = url; + s.onload = function () { + // remove the script so it doesn't appear in the DOM tree + s.remove(); + }; + const head = document.head || document.documentElement; + if (head !== null) { + head.appendChild(s); + } +} diff --git a/src/utils/messages.ts b/src/utils/messages.ts new file mode 100644 index 0000000..3187889 --- /dev/null +++ b/src/utils/messages.ts @@ -0,0 +1,94 @@ +/* +Post message conventions: + Always have a type + Start type with an underscore (e.g. "_plugins-enabled") for DesModder + (leaves non-underscore namespace free for plugins) + apply-* = message from content script to page, applying some data + set-* = message from page to content script, asking to store data in chrome.storage + get-* = message from page to content script, asking to get data in chrome.storage +*/ + +type MessageWindowToContent = + | { + type: 'enable-script'; + scriptName: string; + } + | { + type: 'set-plugins-enabled'; + value: { [id: string]: boolean }; + } + | { + type: 'set-plugin-settings'; + value: { [id: string]: any }; + } + | { + type: 'get-initial-data'; + } + | { + type: 'get-preload-enabled'; + } + | { + type: 'get-script-url'; + } + | { + type: 'get-worker-append-url'; + }; + +type MessageContentToWindow = + | { + type: 'apply-preload-enabled'; + value: { [key: string]: boolean }; + } + | { + type: 'apply-plugins-enabled'; + value: { [key: string]: boolean }; + } + | { + type: 'apply-plugin-settings'; + value: { [id: string]: { [key: string]: boolean } }; + } + | { + type: 'set-script-url'; + value: string; + } + | { + type: 'set-worker-append-url'; + value: string; + }; + +function postMessage(message: T) { + window.postMessage(message, '*'); +} + +export function postMessageUp(message: MessageWindowToContent) { + postMessage(message); +} + +export function postMessageDown(message: MessageContentToWindow) { + postMessage(message); +} + +type ShouldCancel = boolean | void; + +// https://stackoverflow.com/a/11431812/7481517 +function listenToMessage(callback: (message: T) => ShouldCancel) { + const wrappedCallback = (event: MessageEvent) => { + if (event.source !== window) { + return; + } + const cancel = callback(event.data); + if (cancel) { + window.removeEventListener('message', wrappedCallback, false); + } + }; + window.addEventListener('message', wrappedCallback, false); + return wrappedCallback; +} + +export function listenToMessageUp(callback: (message: MessageWindowToContent) => ShouldCancel) { + listenToMessage(callback); +} + +export function listenToMessageDown(callback: (message: MessageContentToWindow) => ShouldCancel) { + listenToMessage(callback); +} From 11546f8e445817bc173e3bf7a93f70f23754ee27 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Wed, 13 Jul 2022 20:16:40 -0500 Subject: [PATCH 13/32] Add comments and clean up throughout code base --- public/chrome_manifest.json | 2 +- public/net_request_rules.json | 4 ++-- src/background/chrome/background.ts | 3 +++ src/empty.ts | 5 +++++ src/extend_mathquill.js | 3 +++ src/intercept.ts | 1 - src/preload_content.ts | 13 +++++++++++++ src/preload_inject.ts | 1 - src/run_calculator.ts | 11 +++++------ src/utils/messages.ts | 2 ++ webpack/webpack.common.js | 2 +- 11 files changed, 35 insertions(+), 12 deletions(-) create mode 100644 src/empty.ts delete mode 100644 src/intercept.ts diff --git a/public/chrome_manifest.json b/public/chrome_manifest.json index ccf9cf9..ce5652a 100644 --- a/public/chrome_manifest.json +++ b/public/chrome_manifest.json @@ -22,7 +22,7 @@ "host_permissions": ["*://www.desmos.com/calculator/*"], "web_accessible_resources": [ { - "resources": ["browser-polyfill.js", "inject.js", "preload_inject.js", "run_calculator.js", "intercept.js"], + "resources": ["browser-polyfill.js", "inject.js", "preload_inject.js", "run_calculator.js", "empty.js"], "matches": [""] } ], diff --git a/public/net_request_rules.json b/public/net_request_rules.json index f429c1f..d18ffd7 100644 --- a/public/net_request_rules.json +++ b/public/net_request_rules.json @@ -4,7 +4,7 @@ "priority": 1, "action": { "type": "redirect", - "redirect": {"extensionPath": "/intercept.js"} + "redirect": {"extensionPath": "/empty.js"} }, "condition": { "urlFilter": "https://www.desmos.com/assets/build/calculator_desktop-*.js|" @@ -15,7 +15,7 @@ "priority": 2, "action": { "type": "redirect", - "redirect": {"extensionPath": "/intercept.js"} + "redirect": {"extensionPath": "/empty.js"} }, "condition": { "urlFilter": "https://www.desmos.com/assets/build/calculator_desktop-*.js?|" diff --git a/src/background/chrome/background.ts b/src/background/chrome/background.ts index a3519cc..53fc44a 100644 --- a/src/background/chrome/background.ts +++ b/src/background/chrome/background.ts @@ -9,6 +9,9 @@ chrome.runtime.onInstalled.addListener(function () { }); }); +// Listen for redirects from the a request to calculator_desktop. When this redirect happends, +// we want to send a message to the preload content script to begin module overrides and +// initialize the calculator. chrome.webRequest.onBeforeRedirect.addListener( async function ({ url }) { console.log(url.endsWith('?')); diff --git a/src/empty.ts b/src/empty.ts new file mode 100644 index 0000000..d2e348a --- /dev/null +++ b/src/empty.ts @@ -0,0 +1,5 @@ +// This file is intentionally left empty. This file is the target of redirection +// from requests to calculator_desktop, which is used by the net request rules to +// effectively block these requests without triggering a script load error. +// This is only needed for the manifest v3 requiring browsers (Chrome and Edge); +// manifest v2 provides a cleaner way of handling net requests. diff --git a/src/extend_mathquill.js b/src/extend_mathquill.js index 383df0c..0784a51 100644 --- a/src/extend_mathquill.js +++ b/src/extend_mathquill.js @@ -1,4 +1,7 @@ /* eslint-disable */ + +/* Taken from the (Desmos fork of) MathQuill source code */ + export default function() { var L = -1; var R = 1; diff --git a/src/intercept.ts b/src/intercept.ts deleted file mode 100644 index 16173a5..0000000 --- a/src/intercept.ts +++ /dev/null @@ -1 +0,0 @@ -// This is a brick wall diff --git a/src/preload_content.ts b/src/preload_content.ts index b9491a4..edd0c62 100644 --- a/src/preload_content.ts +++ b/src/preload_content.ts @@ -3,6 +3,12 @@ console.log('Preload running...'); browser.runtime.onMessage.addListener(async function (request) { let isDesmodderActive: boolean; switch (request.message) { + + // Check if DesModder is enabled by making a request to a non-existent file. + // If DesModder is not enabled, this fetch will not throw an exception (just + // a 404 response). If DesModder is enabled, DesModder's own net request rules + // will block this request, result in an exception being thrown. + // Note: this case only applies to the manifest v2 versions of this extension. case 'check-desmodder': console.log(`preload_content heard message: ${request.message}`); try { @@ -14,6 +20,9 @@ browser.runtime.onMessage.addListener(async function (request) { console.log('preload_content reports DesModder is active'); } return Promise.resolve(isDesmodderActive); + + // Inject the script which sets up ALMOND_OVERRIDES and wait for it to finish. + // Note: this case only applies to the manifest v2 versions of this extension. case 'inject-preload': console.log(`preload_content heard message: ${request.message}`); await new Promise(function (resolve) { @@ -27,6 +36,10 @@ browser.runtime.onMessage.addListener(async function (request) { (document.head || document.documentElement).appendChild(script); }); return Promise.resolve(); + + // Inject the script which sets up ALMOND_OVERRIDES and wait for it to finish. + // Then, inject the script which loads in the calculator and wait for it to finish. + // Note: this case only applies to the manifest v3 versions of this extension. case 'redirect-detected': console.log(`preload_content heard message: ${request.message}`); console.log(`url detected is ${request.url}`); diff --git a/src/preload_inject.ts b/src/preload_inject.ts index e8f60a4..5fa5402 100644 --- a/src/preload_inject.ts +++ b/src/preload_inject.ts @@ -1,6 +1,5 @@ import window from './globals/window'; import extendMathQuill from './extend_mathquill'; -//import { pollForValue } from './utils/utils'; let oldDefine!: any; function newDefine(moduleName: string, dependencies: any, definition: any) { diff --git a/src/run_calculator.ts b/src/run_calculator.ts index 390e276..94dbb6c 100644 --- a/src/run_calculator.ts +++ b/src/run_calculator.ts @@ -3,10 +3,9 @@ import { postMessageUp, listenToMessageDown } from './utils/messages'; import injectScript from './utils/injectScript'; import { pollForValue } from './utils/utils'; +// The function to initialize the calculator, copied almost verbatim from +// the a script on desmos.com/calculator which we've blocked. function runCalculator() { - /* The following script should have failed earlier because we blocked calculator_desktop.js. - We copy it verbatim here to actually load the calculator. */ - window.require( ['toplevel/calculator_desktop', 'testbridge', 'jquery'], function (calcPromise: any, TestBridge: any, $: any) { @@ -20,7 +19,7 @@ function runCalculator() { } window.Calc = calc; TestBridge.ready(); - // following lines added + // DesModder needs the following lines added listenToMessageDown((message) => { if (message.type === 'set-script-url') { injectScript(message.value); @@ -37,10 +36,10 @@ function runCalculator() { } pollForValue( - () => (document.querySelector("script[src^='/assets/build/calculator_desktop']") as HTMLScriptElement)?.src + () => (document.querySelector('script[src^=\'/assets/build/calculator_desktop\']') as HTMLScriptElement)?.src ).then((src) => { /* we blocked calculator_desktop.js earlier to ensure that the preload/override script runs first. - Now we load it, but with '?' appended to prevent the web request rules from blocking it */ + Now we load it, but with '??' appended to prevent the web request rules from blocking it */ const script = document.createElement('script'); script.src = src + '??'; console.log(src); diff --git a/src/utils/messages.ts b/src/utils/messages.ts index 3187889..a05a193 100644 --- a/src/utils/messages.ts +++ b/src/utils/messages.ts @@ -1,3 +1,5 @@ +/* Taken from the DesModder repo and needed for DesModder compatibility */ + /* Post message conventions: Always have a type diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index 10cda7a..edba7f9 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -14,7 +14,7 @@ module.exports = { extend_mathquill: path.join(__dirname, `../${SRC_DIR_NAME}/extend_mathquill.js`), preload_content: path.join(__dirname, `../${SRC_DIR_NAME}/preload_content.ts`), preload_inject: path.join(__dirname, `../${SRC_DIR_NAME}/preload_inject.ts`), - intercept: path.join(__dirname, `../${SRC_DIR_NAME}/intercept.ts`), + empty: path.join(__dirname, `../${SRC_DIR_NAME}/empty.ts`), run_calculator: path.join(__dirname, `../${SRC_DIR_NAME}/run_calculator.ts`), }, output: { From aa2277b6935977b0c59eac7ef17f9222391acd07 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Wed, 13 Jul 2022 20:22:51 -0500 Subject: [PATCH 14/32] Update webpack config --- webpack/webpack.common.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index edba7f9..daaba94 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -42,11 +42,6 @@ module.exports = { to: `../${BUILD_DIR_NAME}/browser-polyfill.js`, context: 'public', }, - { - from: '../node_modules/webextension-polyfill/dist/browser-polyfill.js.map', - to: `../${BUILD_DIR_NAME}/browser-polyfill.js.map`, - context: 'public', - }, { from: './popup.html', to: `../${BUILD_DIR_NAME}/popup.html`, context: 'public' }, { from: './popup.css', to: `../${BUILD_DIR_NAME}/popup.css`, context: 'public' }, { from: `${browser}_manifest.json`, to: `../${BUILD_DIR_NAME}/manifest.json`, context: 'public' }, From 94c0ab86acba9cc017620372718f19100808b783 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Fri, 15 Jul 2022 09:33:55 -0500 Subject: [PATCH 15/32] Refactor popup --- public/popup.css | 4 + src/inject.ts | 7 +- src/popup.ts | 187 +------------------------------------- src/utils/autoCommands.ts | 97 ++++++++++++++++++++ src/utils/utils.ts | 83 ++++++++++++++--- 5 files changed, 183 insertions(+), 195 deletions(-) create mode 100644 src/utils/autoCommands.ts diff --git a/public/popup.css b/public/popup.css index bcf23e7..4bbbee6 100644 --- a/public/popup.css +++ b/public/popup.css @@ -202,3 +202,7 @@ h2 { .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch { right: 0px; } + +.latex-item#mathrm .symbol { + font-family: 'Times New Roman', Times, serif; +} diff --git a/src/inject.ts b/src/inject.ts index f9d6bf3..b152d4f 100644 --- a/src/inject.ts +++ b/src/inject.ts @@ -14,7 +14,10 @@ function waitForDesmosLoaded(commands: string) { }, interval); } -document.addEventListener('sendConfig', function (e) { +document.addEventListener('sendConfig', handler); + +function handler (e) { const data = (e as any).detail; waitForDesmosLoaded(data); -}); + document.removeEventListener('sendConfig', handler); +} diff --git a/src/popup.ts b/src/popup.ts index 4f6d835..97c0b04 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -1,3 +1,6 @@ +import {desmosDefualtAutoCommands, basicAutoCommands, advancedAutoCommands} from './utils/autoCommands'; +import {massSet, storeConfig, populateGrid} from './utils/utils'; + const setToDefault = document.getElementById('set-to-default'); const setToDesmosDefault = document.getElementById('set-to-desmos-default'); @@ -29,191 +32,9 @@ setToDesmosDefault.onclick = function () { // } // }); -// Set many sliders at once. Used when the user presses a reset-to-default button. -// toSet is an array of all the autoCommands to be set. -function massSet(toSet, opt) { - document.querySelectorAll('.grid .latex-item').forEach(function (item) { - item.querySelector('.onoffswitch-checkbox').checked = toSet.includes(item.id); - }); - - // MathQuill requires autoCommands to be a non-empty space-delimited list of - // commands. So keepmeKEEPME should always remain in storage to avoid MathQuill - // throwing errors if the user disables all shortucts. - if (opt === 'autoCommands'){ - toSet = 'keepmeKEEPME ' + toSet.join(' '); - } - - // [opt] because otherwise it will assign the literal string 'opt' as the field name. - browser.storage.local.set({ [opt]: toSet }); -} - -// Create the DOM node for the items that will be placed in the grid. -// e.g. 'α alpha [slider]' -// Using templates allows the html for the popup to be much more concise, -// but then javascript must dynamically insert these into the DOM. -// Not sure what best practices are. -function createGridItem(templateID, symbol, shortcut, commands) { - let html = document.getElementById(templateID).innerHTML; - html = html.replace(/#symbol#/g, symbol); - html = html.replace(/#shortcut#/g, shortcut); - const node = new DOMParser().parseFromString(html, 'text/html').body.firstElementChild as HTMLElement; - node.querySelector('.onoffswitch-checkbox').checked = commands.includes(shortcut); - - // Stop overflow of long shortcuts by letting them span both columns. - // This feels like a bad way of styling this but oh well. - if (shortcut.length > 9) { - node.style.gridColumn = '1 / span 2'; - } - - return node; -} - -// Populate the grid with fancy sliders for all the symbols -> shortcuts in dict. -async function populateGrid(templateID, gridID, dict) { - let commands = await getStorageData('autoCommands'); - commands = commands.autoCommands.split(' '); - const grid = document.getElementById(gridID); - for (const shortcut in dict) { - grid.append(createGridItem(templateID, dict[shortcut], shortcut, commands)); - } -} - -// Function to retreive the user config data corresponding to the given key -// e.g. getStorageData('autoCommands') -> 'alpha beta gamma' -//const getStorageData = (key) => -//new Promise((resolve, reject) => -//browser.storage.local.get(key, (result) => -//browser.runtime.lastError -//? reject(Error(browser.runtime.lastError.message)) -//: resolve(result) -//) -//); - -async function getStorageData(key) { - const value = await browser.storage.local.get(key); - return value; -} - -// Function to add/remove user config data corresponding to a slider that was -// just clicked. -async function storeConfig(this: HTMLInputElement) { - let wordToStore = this.parentElement.parentElement.id; - const opt = this.parentElement.parentElement.getAttribute('opt'); - let currentlyStored = await getStorageData(opt); - currentlyStored = currentlyStored.autoCommands; - if (this.checked) { - if (currentlyStored !== '') { - wordToStore = ' ' + wordToStore; - } - browser.storage.local.set({ autoCommands: currentlyStored + wordToStore }); - } else { - const newStorage = currentlyStored - .split(' ') - .filter((word) => word != wordToStore) - .join(' '); - browser.storage.local.set({ autoCommands: newStorage }); - } -} - // Add all the dynamically loaded nodes to the DOM using templates and give // sliders their funcionality async function initialize() { - // Desmos default symbols and their shortcuts - const desmosDefualtAutoCommands = { - sqrt: '√', - cbrt: '∛', - nthroot: '∜', - sum: 'Σ', - prod: '∏', - int: '∫', - percent: '%', - infinity: '∞', - infty: '∞', - alpha: 'α', - beta: 'β', - theta: 'θ', - pi: 'π', - tau: 'τ', - phi: 'ϕ', - }; - - // basic shortucts and their symbols - const basicAutoCommands = { - gamma: 'γ', - digamma: 'ϝ', - Gamma: 'Γ', - delta: 'δ', - Delta: 'Δ', - epsilon: 'ϵ', - //varepsilon: 'ε', - zeta: 'ζ', - eta: 'η', - iota: 'ι', - kappa: 'κ', - //varkappa: 'ϰ', - lambda: 'λ', - Lambda: 'Λ', - mu: 'μ', - nu: 'ν', - xi: 'ξ', - //varpi: 'ϖ', - Pi: 'Π', - rho: 'ρ', - //varrho: 'ϱ', - sigma: 'σ', - //varsigma: 'ς', - Sigma: 'Σ', - upsilon: 'υ', - Upsilon: 'Υ', - //varphi: 'φ', - Phi: 'Φ', - chi: 'χ', - psi: 'ψ', - Psi: 'Ψ', - omega: 'ω', - Omega: 'Ω', - square: '□', - mid: '|', - parallel: '∥', - nparallel: '∦', - perp: '⊥', - pm: '±', - mp: '∓', - to: '→', - le: '≤', - ge: '≥', - ne: '≠', - times: '×', - div: '÷', - approx: '≈', - }; - - const advancedAutoCommands = { - dot: ' ̇', - hat: 'ˆ', - vec: ' ⃗', - bar: '¯', - tidle: ' ̃', - langle: '⟨', - rangle: '⟩', - lVert: '||', - rVert: '||', - binom: '( )', - coprod: '', - frac: '', - underline: '⎯', - overline: '¯', - overarc: '⌒', - mathrm: '', - mathit: '', - mathbf: '', - mathsf: '', - overrightarrow: '→', - overleftarrow: '←', - overleftrightarrow: '⟷', - MathQuillMathField: '', - }; - await populateGrid('grid-item-template', 'desmos-default', desmosDefualtAutoCommands); await populateGrid('grid-item-template', 'basic', basicAutoCommands); await populateGrid('grid-item-template', 'advanced', advancedAutoCommands); @@ -225,3 +46,5 @@ async function initialize() { } document.addEventListener('DOMContentLoaded', initialize); + + diff --git a/src/utils/autoCommands.ts b/src/utils/autoCommands.ts new file mode 100644 index 0000000..631338c --- /dev/null +++ b/src/utils/autoCommands.ts @@ -0,0 +1,97 @@ +export interface AutoCommandsToSymbols { + [index: string]: string; +} + +export const desmosDefualtAutoCommands: AutoCommandsToSymbols = { + sqrt: '√', + cbrt: '∛', + nthroot: '∜', + sum: 'Σ', + prod: '∏', + int: '∫', + percent: '%', + infinity: '∞', + infty: '∞', + alpha: 'α', + beta: 'β', + theta: 'θ', + pi: 'π', + tau: 'τ', + phi: 'ϕ', +}; + +export const basicAutoCommands: AutoCommandsToSymbols = { + gamma: 'γ', + digamma: 'ϝ', + Gamma: 'Γ', + delta: 'δ', + Delta: 'Δ', + epsilon: 'ϵ', + //varepsilon: 'ε', + zeta: 'ζ', + eta: 'η', + iota: 'ι', + kappa: 'κ', + //varkappa: 'ϰ', + lambda: 'λ', + Lambda: 'Λ', + mu: 'μ', + nu: 'ν', + xi: 'ξ', + //varpi: 'ϖ', + Pi: 'Π', + rho: 'ρ', + //varrho: 'ϱ', + sigma: 'σ', + //varsigma: 'ς', + Sigma: 'Σ', + upsilon: 'υ', + Upsilon: 'Υ', + //varphi: 'φ', + Phi: 'Φ', + chi: 'χ', + psi: 'ψ', + Psi: 'Ψ', + omega: 'ω', + Omega: 'Ω', + square: '□', + mid: '|', + parallel: '∥', + nparallel: '∦', + perp: '⊥', + pm: '±', + mp: '∓', + to: '→', + le: '≤', + ge: '≥', + ne: '≠', + times: '×', + div: '÷', + approx: '≈', +}; + +export const advancedAutoCommands = { + dot: ' ̇', + hat: 'ˆ', + vec: ' ⃗', + bar: '¯', + tidle: ' ̃', + langle: '⟨', + rangle: '⟩', + lVert: '||', + rVert: '||', + binom: '( )', + coprod: '∐', + frac: '½', + underline: '⎯', + overline: '¯', + overarc: '⌒', + mathrm: 'rm', + mathit: '𝑖𝑡', + mathbf: '𝐛𝐟', + mathsf: 'sf', + overrightarrow: '→', + overleftarrow: '←', + overleftrightarrow: '⟷', + MathQuillMathField: '▭', +}; diff --git a/src/utils/utils.ts b/src/utils/utils.ts index dc4e3d1..aa301d0 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -1,20 +1,81 @@ +import { AutoCommandsToSymbols } from './autoCommands'; + interface FuncAny { - (): any; + (): any; } export async function pollForValue(func: FuncAny) { - return await _pollForValue(func); + return await _pollForValue(func); } function _pollForValue(func: () => T) { - return new Promise((resolve) => { - const interval = setInterval(() => { - const val = func(); - if (val !== null && val !== undefined) { - clearInterval(interval); - resolve(val); - } - }, 50); - }); + return new Promise((resolve) => { + const interval = setInterval(() => { + const val = func(); + if (val !== null && val !== undefined) { + clearInterval(interval); + resolve(val); + } + }, 50); + }); +} + +// Set many sliders at once. Used when the user presses a reset-to-default button. +// toSet is an array of all the strings for the option 'opt' to be set. +export function massSet(toSet: string[], opt: string) { + document.querySelectorAll('.grid .latex-item').forEach(function (item) { + item.querySelector('.onoffswitch-checkbox').checked = toSet.includes(item.id); + }); + + // MathQuill requires autoCommands to be a non-empty space-delimited list of + // commands. So keepmeKEEPME should always remain in storage for autoCommands + // to avoid MathQuill throwing errors if the user disables all shortucts. + // [opt] because otherwise it will assign the literal string 'opt' as the field name. + browser.storage.local.set({ [opt]: opt === 'autoCommands' ? 'keepmeKEEPME ' + toSet.join(' ') : toSet.join(' ') }); } +// Create the DOM node for the items that will be placed in the grid. +// e.g. 'α alpha [slider]' +function createGridItem(templateID: string, symbol: string, shortcut: string, commands: string[]) { + let html = document.getElementById(templateID).innerHTML; + html = html.replace(/#symbol#/g, symbol); + html = html.replace(/#shortcut#/g, shortcut); + const node = new DOMParser().parseFromString(html, 'text/html').body.firstElementChild as HTMLElement; + node.querySelector('.onoffswitch-checkbox').checked = commands.includes(shortcut); + + // Stop overflow of long shortcuts by letting them span both columns. + // This feels like a bad way of styling this but oh well. + if (shortcut.length > 9) { + node.style.gridColumn = '1 / span 2'; + } + + return node; +} + +// Populate the grid with fancy sliders for all the symbols -> shortcuts in dict. +export async function populateGrid(templateID: string, gridID: string, dict: AutoCommandsToSymbols) { + const { autoCommands } = await browser.storage.local.get('autoCommands'); + const grid = document.getElementById(gridID); + for (const shortcut in dict) { + grid.append(createGridItem(templateID, dict[shortcut], shortcut, (autoCommands as string).split(' '))); + } +} + +export async function storeConfig(this: HTMLInputElement) { + let wordToStore = this.parentElement.parentElement.id; + const opt = this.parentElement.parentElement.getAttribute('opt'); + const storageObj = await browser.storage.local.get(opt); + const currentlyStored = storageObj[opt].toString(); + if (this.checked) { + if (currentlyStored !== '') { + wordToStore = ' ' + wordToStore; + } + browser.storage.local.set({ autoCommands: currentlyStored + wordToStore }); + } else { + const newStorage = currentlyStored + .split(' ') + .filter((word) => word != wordToStore) + .join(' '); + browser.storage.local.set({ autoCommands: newStorage }); + } +} From a45680de5b83d86311e2669eee86bb6bbcbad187 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Fri, 15 Jul 2022 10:14:24 -0500 Subject: [PATCH 16/32] Update wepback config to reduce unneeded files --- .eslintrc.json | 1 + package-lock.json | 2 +- package.json | 2 +- webpack/webpack.common.js | 43 ++++++++++++++++++++++++++------------- 4 files changed, 32 insertions(+), 16 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 0fd52ec..43e5241 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -15,6 +15,7 @@ "sourceType": "module" }, "plugins": ["@typescript-eslint", "import"], + "ignorePatterns": ["dist/*", "webpack/*"], "rules": { "linebreak-style": ["error", "unix"], "quotes": ["error", "single"], diff --git a/package-lock.json b/package-lock.json index 8ae83a9..1208d69 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "eslint-plugin-import": "2.22.1", "git-hooks-plus": "1.0.1", "prettier": "2.2.1", - "rimraf": "3.0.2", + "rimraf": "^3.0.2", "sinon": "^10.0.0", "terser-webpack-plugin": "5.1.1", "ts-loader": "^9.1.1", diff --git a/package.json b/package.json index ffab4a5..0700868 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "eslint-plugin-import": "2.22.1", "git-hooks-plus": "1.0.1", "prettier": "2.2.1", - "rimraf": "3.0.2", + "rimraf": "^3.0.2", "sinon": "^10.0.0", "terser-webpack-plugin": "5.1.1", "ts-loader": "^9.1.1", diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index daaba94..cce5571 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -1,21 +1,19 @@ const path = require('path'); const CopyPlugin = require('copy-webpack-plugin'); +const { merge } = require('webpack-merge'); const browser = process.env.BROWSER; const BUILD_DIR_NAME = 'dist'; const SRC_DIR_NAME = 'src'; -module.exports = { +baseConfig = { entry: { popup: path.join(__dirname, `../${SRC_DIR_NAME}/popup.ts`), background: path.join(__dirname, `../${SRC_DIR_NAME}/background/${browser}/background.ts`), contentscript: path.join(__dirname, `../${SRC_DIR_NAME}/contentscript.ts`), inject: path.join(__dirname, `../${SRC_DIR_NAME}/inject.ts`), - extend_mathquill: path.join(__dirname, `../${SRC_DIR_NAME}/extend_mathquill.js`), preload_content: path.join(__dirname, `../${SRC_DIR_NAME}/preload_content.ts`), preload_inject: path.join(__dirname, `../${SRC_DIR_NAME}/preload_inject.ts`), - empty: path.join(__dirname, `../${SRC_DIR_NAME}/empty.ts`), - run_calculator: path.join(__dirname, `../${SRC_DIR_NAME}/run_calculator.ts`), }, output: { path: path.join(__dirname, `../${BUILD_DIR_NAME}`), @@ -37,20 +35,37 @@ module.exports = { new CopyPlugin({ patterns: [ { from: './images', to: `../${BUILD_DIR_NAME}/images`, context: 'public' }, - { - from: '../node_modules/webextension-polyfill/dist/browser-polyfill.js', - to: `../${BUILD_DIR_NAME}/browser-polyfill.js`, - context: 'public', - }, { from: './popup.html', to: `../${BUILD_DIR_NAME}/popup.html`, context: 'public' }, { from: './popup.css', to: `../${BUILD_DIR_NAME}/popup.css`, context: 'public' }, { from: `${browser}_manifest.json`, to: `../${BUILD_DIR_NAME}/manifest.json`, context: 'public' }, - { - from: 'net_request_rules.json', - to: `../${BUILD_DIR_NAME}/net_request_rules.json`, - context: 'public', - }, ], }), ], }; + +if (browser === 'firefox') { + module.exports = baseConfig; +} else { + module.exports = merge(baseConfig, { + entry: { + empty: path.join(__dirname, `../${SRC_DIR_NAME}/empty.ts`), + run_calculator: path.join(__dirname, `../${SRC_DIR_NAME}/run_calculator.ts`), + }, + plugins: [ + new CopyPlugin({ + patterns: [ + { + from: 'net_request_rules.json', + to: `../${BUILD_DIR_NAME}/net_request_rules.json`, + context: 'public', + }, + { + from: '../node_modules/webextension-polyfill/dist/browser-polyfill.js', + to: `../${BUILD_DIR_NAME}/browser-polyfill.js`, + context: 'public', + }, + ], + }), + ], + }); +} From fdaf5d6fcfed0fb340aab8d750ea0e5948fb3e34 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Fri, 15 Jul 2022 12:31:50 -0500 Subject: [PATCH 17/32] Restructure and rename files --- public/chrome_manifest.json | 6 ++--- public/edge_manifest.json | 22 +++++++++++++++---- src/{contentscript.ts => content.ts} | 2 +- .../content.ts} | 4 ++-- src/{ => preload}/empty.ts | 0 src/{ => preload}/extend_mathquill.js | 0 src/{ => preload}/run_calculator.ts | 8 +++---- src/{preload_inject.ts => preload/script.ts} | 2 +- src/{inject.ts => script.ts} | 0 webpack/webpack.common.js | 12 +++++----- 10 files changed, 35 insertions(+), 21 deletions(-) rename src/{contentscript.ts => content.ts} (91%) rename src/{preload_content.ts => preload/content.ts} (95%) rename src/{ => preload}/empty.ts (100%) rename src/{ => preload}/extend_mathquill.js (100%) rename src/{ => preload}/run_calculator.ts (90%) rename src/{preload_inject.ts => preload/script.ts} (95%) rename src/{inject.ts => script.ts} (100%) diff --git a/public/chrome_manifest.json b/public/chrome_manifest.json index ce5652a..6bd5ff5 100644 --- a/public/chrome_manifest.json +++ b/public/chrome_manifest.json @@ -9,12 +9,12 @@ }, "content_scripts": [ { - "js": ["browser-polyfill.js", "contentscript.js"], + "js": ["browser-polyfill.js", "content.js"], "matches": ["https://www.desmos.com/calculator/*"], "run_at": "document_idle" }, { - "js": ["browser-polyfill.js", "preload_content.js"], + "js": ["browser-polyfill.js", "preloadContent.js"], "matches": ["https://www.desmos.com/calculator*"], "run_at": "document_start" } @@ -22,7 +22,7 @@ "host_permissions": ["*://www.desmos.com/calculator/*"], "web_accessible_resources": [ { - "resources": ["browser-polyfill.js", "inject.js", "preload_inject.js", "run_calculator.js", "empty.js"], + "resources": ["browser-polyfill.js", "script.js", "preloadScript.js", "run_calculator.js", "empty.js"], "matches": [""] } ], diff --git a/public/edge_manifest.json b/public/edge_manifest.json index 709af4c..6bd5ff5 100644 --- a/public/edge_manifest.json +++ b/public/edge_manifest.json @@ -2,22 +2,27 @@ "name": "Desmos Unlocked", "version": "1.0.3", "description": "Browser extension for better user control of the Desmos graphing calculator configuration", - "permissions": ["storage"], + "permissions": ["storage", "declarativeNetRequest", "declarativeNetRequestWithHostAccess", "webRequest"], "manifest_version": 3, "background": { "service_worker": "background.js" }, "content_scripts": [ { - "js": ["browser-polyfill.js", "contentscript.js"], + "js": ["browser-polyfill.js", "content.js"], "matches": ["https://www.desmos.com/calculator/*"], "run_at": "document_idle" + }, + { + "js": ["browser-polyfill.js", "preloadContent.js"], + "matches": ["https://www.desmos.com/calculator*"], + "run_at": "document_start" } ], - + "host_permissions": ["*://www.desmos.com/calculator/*"], "web_accessible_resources": [ { - "resources": ["browser-polyfill.js", "inject.js"], + "resources": ["browser-polyfill.js", "script.js", "preloadScript.js", "run_calculator.js", "empty.js"], "matches": [""] } ], @@ -30,6 +35,15 @@ "128": "images/logo/128.png" } }, + "declarative_net_request": { + "rule_resources": [ + { + "id": "ruleset_1", + "enabled": true, + "path": "net_request_rules.json" + } + ] + }, "icons": { "16": "images/logo/16.png", "32": "images/logo/32.png", diff --git a/src/contentscript.ts b/src/content.ts similarity index 91% rename from src/contentscript.ts rename to src/content.ts index e57813a..b909812 100644 --- a/src/contentscript.ts +++ b/src/content.ts @@ -1,7 +1,7 @@ async function updateAutoCommands() { const commands = await browser.storage.local.get('autoCommands'); const script = document.createElement('script'); - script.src = browser.runtime.getURL('inject.js'); + script.src = browser.runtime.getURL('script.js'); const cmdString = commands.autoCommands.toString(); script.onload = function () { const data = cmdString; diff --git a/src/preload_content.ts b/src/preload/content.ts similarity index 95% rename from src/preload_content.ts rename to src/preload/content.ts index edd0c62..5966545 100644 --- a/src/preload_content.ts +++ b/src/preload/content.ts @@ -27,7 +27,7 @@ browser.runtime.onMessage.addListener(async function (request) { console.log(`preload_content heard message: ${request.message}`); await new Promise(function (resolve) { const script = document.createElement('script'); - script.src = browser.runtime.getURL('preload_inject.js'); + script.src = browser.runtime.getURL('preloadInject.js'); script.onload = function () { (this as any).remove(); resolve(); @@ -45,7 +45,7 @@ browser.runtime.onMessage.addListener(async function (request) { console.log(`url detected is ${request.url}`); await new Promise(function (resolve) { const script = document.createElement('script'); - script.src = browser.runtime.getURL('preload_inject.js'); + script.src = browser.runtime.getURL('preloadScript.js'); script.onload = function () { (this as any).remove(); resolve(); diff --git a/src/empty.ts b/src/preload/empty.ts similarity index 100% rename from src/empty.ts rename to src/preload/empty.ts diff --git a/src/extend_mathquill.js b/src/preload/extend_mathquill.js similarity index 100% rename from src/extend_mathquill.js rename to src/preload/extend_mathquill.js diff --git a/src/run_calculator.ts b/src/preload/run_calculator.ts similarity index 90% rename from src/run_calculator.ts rename to src/preload/run_calculator.ts index 94dbb6c..50752e3 100644 --- a/src/run_calculator.ts +++ b/src/preload/run_calculator.ts @@ -1,7 +1,7 @@ -import window from './globals/window'; -import { postMessageUp, listenToMessageDown } from './utils/messages'; -import injectScript from './utils/injectScript'; -import { pollForValue } from './utils/utils'; +import window from '../globals/window'; +import { postMessageUp, listenToMessageDown } from '../utils/messages'; +import injectScript from '../utils/injectScript'; +import { pollForValue } from '../utils/utils'; // The function to initialize the calculator, copied almost verbatim from // the a script on desmos.com/calculator which we've blocked. diff --git a/src/preload_inject.ts b/src/preload/script.ts similarity index 95% rename from src/preload_inject.ts rename to src/preload/script.ts index 5fa5402..a1fc057 100644 --- a/src/preload_inject.ts +++ b/src/preload/script.ts @@ -1,4 +1,4 @@ -import window from './globals/window'; +import window from '../globals/window'; import extendMathQuill from './extend_mathquill'; let oldDefine!: any; diff --git a/src/inject.ts b/src/script.ts similarity index 100% rename from src/inject.ts rename to src/script.ts diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index cce5571..e57ecda 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -10,10 +10,10 @@ baseConfig = { entry: { popup: path.join(__dirname, `../${SRC_DIR_NAME}/popup.ts`), background: path.join(__dirname, `../${SRC_DIR_NAME}/background/${browser}/background.ts`), - contentscript: path.join(__dirname, `../${SRC_DIR_NAME}/contentscript.ts`), - inject: path.join(__dirname, `../${SRC_DIR_NAME}/inject.ts`), - preload_content: path.join(__dirname, `../${SRC_DIR_NAME}/preload_content.ts`), - preload_inject: path.join(__dirname, `../${SRC_DIR_NAME}/preload_inject.ts`), + content: path.join(__dirname, `../${SRC_DIR_NAME}/content.ts`), + script: path.join(__dirname, `../${SRC_DIR_NAME}/script.ts`), + preloadContent: path.join(__dirname, `../${SRC_DIR_NAME}/preload/content.ts`), + preloadScript: path.join(__dirname, `../${SRC_DIR_NAME}/preload/script.ts`), }, output: { path: path.join(__dirname, `../${BUILD_DIR_NAME}`), @@ -48,8 +48,8 @@ if (browser === 'firefox') { } else { module.exports = merge(baseConfig, { entry: { - empty: path.join(__dirname, `../${SRC_DIR_NAME}/empty.ts`), - run_calculator: path.join(__dirname, `../${SRC_DIR_NAME}/run_calculator.ts`), + empty: path.join(__dirname, `../${SRC_DIR_NAME}/preload/empty.ts`), + run_calculator: path.join(__dirname, `../${SRC_DIR_NAME}/preload/run_calculator.ts`), }, plugins: [ new CopyPlugin({ From 1ed85f8ba672ad0a0948a76cb20b88b08afc4ffd Mon Sep 17 00:00:00 2001 From: SinclaM Date: Fri, 15 Jul 2022 12:42:47 -0500 Subject: [PATCH 18/32] Update firefox manifest, reflect new files --- public/firefox_manifest.json | 6 +++--- src/preload/content.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/firefox_manifest.json b/public/firefox_manifest.json index 232d8c9..7cdd564 100644 --- a/public/firefox_manifest.json +++ b/public/firefox_manifest.json @@ -10,12 +10,12 @@ }, "content_scripts": [ { - "js": ["contentscript.js"], + "js": ["content.js"], "matches": ["https://www.desmos.com/calculator*"], "run_at": "document_idle" }, { - "js": ["preload_content.js"], + "js": ["preloadContent.js"], "matches": ["https://www.desmos.com/calculator*"], "run_at": "document_start" } @@ -36,5 +36,5 @@ "48": "images/logo/48.png", "128": "images/logo/128.png" }, - "web_accessible_resources": ["inject.js"] + "web_accessible_resources": ["script.js", "preloadScript.js"] } diff --git a/src/preload/content.ts b/src/preload/content.ts index 5966545..5166ac1 100644 --- a/src/preload/content.ts +++ b/src/preload/content.ts @@ -27,7 +27,7 @@ browser.runtime.onMessage.addListener(async function (request) { console.log(`preload_content heard message: ${request.message}`); await new Promise(function (resolve) { const script = document.createElement('script'); - script.src = browser.runtime.getURL('preloadInject.js'); + script.src = browser.runtime.getURL('preloadScript.js'); script.onload = function () { (this as any).remove(); resolve(); From 9d074bc1f495521a4f5eac129f1619e3458a21b9 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Fri, 15 Jul 2022 12:45:47 -0500 Subject: [PATCH 19/32] Updata opera manifest --- public/firefox_manifest.json | 3 +-- public/opera_manifest.json | 14 ++++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/public/firefox_manifest.json b/public/firefox_manifest.json index 7cdd564..c6bb872 100644 --- a/public/firefox_manifest.json +++ b/public/firefox_manifest.json @@ -27,8 +27,7 @@ "32": "images/logo/32.png", "48": "images/logo/48.png", "128": "images/logo/128.png" - }, - "default_title": "Getting Started Example" + } }, "icons": { "16": "images/logo/16.png", diff --git a/public/opera_manifest.json b/public/opera_manifest.json index 98e3ea4..0721c73 100644 --- a/public/opera_manifest.json +++ b/public/opera_manifest.json @@ -2,20 +2,26 @@ "name": "Desmos Unlocked", "version": "1.0.3", "description": "Browser extension for better user control of the Desmos graphing calculator configuration", - "permissions": ["storage"], + "permissions": ["https://*.desmos.com/*", "storage", "webRequest", "webRequestBlocking"], "manifest_version": 2, "background": { - "scripts": ["background.js"] + "scripts": ["background.js"], + "persistent": true }, "content_scripts": [ { - "js": ["browser-polyfill.js", "contentscript.js"], + "js": ["browser-polyfill.js", "content.js"], "matches": ["https://www.desmos.com/calculator/*"], "run_at": "document_idle" + }, + { + "js": ["browser-polyfill.js", "preloadContent.js"], + "matches": ["https://www.desmos.com/calculator*"], + "run_at": "document_start" } ], - "web_accessible_resources": ["inject.js"], + "web_accessible_resources": ["script.js", "preloadScript.js"], "browser_action": { "default_popup": "popup.html", From 3329f6544e6408a6053e5edd3ddc94867d705383 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Fri, 15 Jul 2022 14:09:48 -0500 Subject: [PATCH 20/32] Use webRequestBlocking in opera, fix typos --- public/opera_manifest.json | 2 +- src/background/chrome/background.ts | 2 +- src/background/edge/background.ts | 32 +++++++++++++++++++ src/background/opera/background.ts | 49 +++++++++++++++++++++++++++-- 4 files changed, 80 insertions(+), 5 deletions(-) diff --git a/public/opera_manifest.json b/public/opera_manifest.json index 0721c73..ba2b64b 100644 --- a/public/opera_manifest.json +++ b/public/opera_manifest.json @@ -5,7 +5,7 @@ "permissions": ["https://*.desmos.com/*", "storage", "webRequest", "webRequestBlocking"], "manifest_version": 2, "background": { - "scripts": ["background.js"], + "scripts": ["browser-polyfill.js", "background.js"], "persistent": true }, "content_scripts": [ diff --git a/src/background/chrome/background.ts b/src/background/chrome/background.ts index 53fc44a..f7616c2 100644 --- a/src/background/chrome/background.ts +++ b/src/background/chrome/background.ts @@ -9,7 +9,7 @@ chrome.runtime.onInstalled.addListener(function () { }); }); -// Listen for redirects from the a request to calculator_desktop. When this redirect happends, +// Listen for redirects from the a request to calculator_desktop. When this redirect happens, // we want to send a message to the preload content script to begin module overrides and // initialize the calculator. chrome.webRequest.onBeforeRedirect.addListener( diff --git a/src/background/edge/background.ts b/src/background/edge/background.ts index bccbd34..f7616c2 100644 --- a/src/background/edge/background.ts +++ b/src/background/edge/background.ts @@ -8,3 +8,35 @@ chrome.runtime.onInstalled.addListener(function () { 'keepmeKEEPME alpha beta sqrt theta Theta phi Phi pi Pi tau nthroot cbrt sum prod int ans percent infinity infty gamma Gamma delta Delta epsilon epsiv zeta eta kappa lambda Lambda mu xi Xi rho sigma Sigma chi Psi omega Omega digamma iota nu upsilon Upsilon Psi square mid parallel nparallel perp to times div approx', }); }); + +// Listen for redirects from the a request to calculator_desktop. When this redirect happens, +// we want to send a message to the preload content script to begin module overrides and +// initialize the calculator. +chrome.webRequest.onBeforeRedirect.addListener( + async function ({ url }) { + console.log(url.endsWith('?')); + const tabs = await chrome.tabs.query({ active: true, currentWindow: true }); + while (true) { + // The request to calculator_desktop (and the following redirect) may happen + // before preload_content is loaded at document_start. To avoid a race condition, + // we keep trying to send the message until the "no receiving end" exception + // is gone. + try { + // TODO: Figure out why tsserver thinks that sendMessage returns void and not + // a promise. tsserver says await has no effect on the expression below but it's + // actual critical to resolve the promise and catch the error. + await chrome.tabs.sendMessage(tabs[0].id, { message: 'redirect-detected', url: url }); + break; + } + catch { + await new Promise((r) => setTimeout(r, 10)); + } + } + }, + { + urls: [ + 'https://www.desmos.com/assets/build/calculator_desktop-*.js', + 'https://www.desmos.com/assets/build/calculator_desktop-*.js?', + ], + } +); diff --git a/src/background/opera/background.ts b/src/background/opera/background.ts index bccbd34..240c39c 100644 --- a/src/background/opera/background.ts +++ b/src/background/opera/background.ts @@ -1,10 +1,53 @@ -/// +/// -chrome.runtime.onInstalled.addListener(function () { - chrome.storage.local.set({ +browser.runtime.onInstalled.addListener(function () { + browser.storage.local.set({ // keepmeKEEPME should always remain in autoCommands, since MathQuill requires a nonempty // space-delimited list of commands. autoCommands: 'keepmeKEEPME alpha beta sqrt theta Theta phi Phi pi Pi tau nthroot cbrt sum prod int ans percent infinity infty gamma Gamma delta Delta epsilon epsiv zeta eta kappa lambda Lambda mu xi Xi rho sigma Sigma chi Psi omega Omega digamma iota nu upsilon Upsilon Psi square mid parallel nparallel perp to times div approx', }); }); + +browser.webRequest.onBeforeRequest.addListener( + async function ({ url }) { + // This url is used by preload_content to check for DesModder activity. + // We ignore it here to avoid an infinite recursion. + if (url === 'https://www.desmos.com/assets/build/calculator_desktop-this_does_not_exist.js') { + return; + } + + const tabs = await browser.tabs.query({ active: true, currentWindow: true }); + + if (url.endsWith('.js')) { + console.log(url); + const isDesmodderActive: boolean | void = await browser.tabs.sendMessage(tabs[0].id, { + message: 'check-desmodder', + }); + console.log('Message from the content script:'); + console.log(isDesmodderActive); + + // If DesModder is not active, then we should immediately inject the preload script + // and begin overrides. There won't be another opportunity. + // If DesModder is active, then we know that DesModder's own webRequest rules will + // block this script anyway, and we don't want to define ALMOND_OVERRIDES before + // DesModder does, so we can wait until DesModder makes another request. + if (!isDesmodderActive) { + await browser.tabs.sendMessage(tabs[0].id, { message: 'inject-preload' }); + } + } + + // This url being requested means DesModder is active and trying to load the calculator. + // Now is the time to inject the preload. + if (url.endsWith('.js?')) { + await browser.tabs.sendMessage(tabs[0].id, { message: 'inject-preload' }); + } + }, + { + urls: [ + 'https://www.desmos.com/assets/build/calculator_desktop-*.js', + 'https://www.desmos.com/assets/build/calculator_desktop-*.js?', + ], + }, + ['blocking'] +); From 786e11b6eac8c70ed1e2e3e0fcc000bb2bd34d7d Mon Sep 17 00:00:00 2001 From: SinclaM Date: Fri, 15 Jul 2022 14:37:29 -0500 Subject: [PATCH 21/32] Incorporate preload/run_calculator.ts into preload/script.ts --- public/chrome_manifest.json | 2 +- public/edge_manifest.json | 2 +- src/preload/content.ts | 15 +++---- src/preload/run_calculator.ts | 56 ------------------------- src/preload/script.ts | 77 +++++++++++++++++++++++++++++------ src/utils/utils.ts | 4 +- webpack/webpack.common.js | 1 - 7 files changed, 73 insertions(+), 84 deletions(-) delete mode 100644 src/preload/run_calculator.ts diff --git a/public/chrome_manifest.json b/public/chrome_manifest.json index 6bd5ff5..2767f8e 100644 --- a/public/chrome_manifest.json +++ b/public/chrome_manifest.json @@ -22,7 +22,7 @@ "host_permissions": ["*://www.desmos.com/calculator/*"], "web_accessible_resources": [ { - "resources": ["browser-polyfill.js", "script.js", "preloadScript.js", "run_calculator.js", "empty.js"], + "resources": ["browser-polyfill.js", "script.js", "preloadScript.js", "empty.js"], "matches": [""] } ], diff --git a/public/edge_manifest.json b/public/edge_manifest.json index 6bd5ff5..2767f8e 100644 --- a/public/edge_manifest.json +++ b/public/edge_manifest.json @@ -22,7 +22,7 @@ "host_permissions": ["*://www.desmos.com/calculator/*"], "web_accessible_resources": [ { - "resources": ["browser-polyfill.js", "script.js", "preloadScript.js", "run_calculator.js", "empty.js"], + "resources": ["browser-polyfill.js", "script.js", "preloadScript.js", "empty.js"], "matches": [""] } ], diff --git a/src/preload/content.ts b/src/preload/content.ts index 5166ac1..4137cba 100644 --- a/src/preload/content.ts +++ b/src/preload/content.ts @@ -46,16 +46,11 @@ browser.runtime.onMessage.addListener(async function (request) { await new Promise(function (resolve) { const script = document.createElement('script'); script.src = browser.runtime.getURL('preloadScript.js'); - script.onload = function () { - (this as any).remove(); - resolve(); - }; - script.onerror = (e) => console.log(e); - (document.head || document.documentElement).appendChild(script); - }); - await new Promise(function (resolve) { - const script = document.createElement('script'); - script.src = browser.runtime.getURL('run_calculator.js'); + + // Tell the injected script to initialize the calculator after finishing + // its module overrides. + // The attribute just needs a truthy value. + script.setAttribute('run-calculator', 'run-calculator'); script.onload = function () { (this as any).remove(); resolve(); diff --git a/src/preload/run_calculator.ts b/src/preload/run_calculator.ts deleted file mode 100644 index 50752e3..0000000 --- a/src/preload/run_calculator.ts +++ /dev/null @@ -1,56 +0,0 @@ -import window from '../globals/window'; -import { postMessageUp, listenToMessageDown } from '../utils/messages'; -import injectScript from '../utils/injectScript'; -import { pollForValue } from '../utils/utils'; - -// The function to initialize the calculator, copied almost verbatim from -// the a script on desmos.com/calculator which we've blocked. -function runCalculator() { - window.require( - ['toplevel/calculator_desktop', 'testbridge', 'jquery'], - function (calcPromise: any, TestBridge: any, $: any) { - $('.dcg-loading-div-container').hide(); - if (calcPromise === undefined) { - console.error('No calc promise'); - } - calcPromise.then(function (calc: any) { - if (calc === undefined) { - console.error('No calc'); - } - window.Calc = calc; - TestBridge.ready(); - // DesModder needs the following lines added - listenToMessageDown((message) => { - if (message.type === 'set-script-url') { - injectScript(message.value); - // cancel listener - return true; - } - }); - postMessageUp({ - type: 'get-script-url', - }); - }); - } - ); -} - -pollForValue( - () => (document.querySelector('script[src^=\'/assets/build/calculator_desktop\']') as HTMLScriptElement)?.src -).then((src) => { - /* we blocked calculator_desktop.js earlier to ensure that the preload/override script runs first. - Now we load it, but with '??' appended to prevent the web request rules from blocking it */ - const script = document.createElement('script'); - script.src = src + '??'; - console.log(src); - script.async = false; - script.onload = () => { - // remove from DOM - script.remove(); - runCalculator(); - }; - script.onerror = () => { - console.error('Injected script onerror'); - }; - document.body.appendChild(script); -}); diff --git a/src/preload/script.ts b/src/preload/script.ts index a1fc057..30e6e2d 100644 --- a/src/preload/script.ts +++ b/src/preload/script.ts @@ -1,5 +1,8 @@ import window from '../globals/window'; import extendMathQuill from './extend_mathquill'; +import { pollForValue } from '../utils/utils'; +import injectScript from '../utils/injectScript'; +import { postMessageUp, listenToMessageDown } from '../utils/messages'; let oldDefine!: any; function newDefine(moduleName: string, dependencies: any, definition: any) { @@ -15,18 +18,66 @@ newDefine.amd = { jQuery: true, }; -window.ALMOND_OVERRIDES = new Proxy( - window.ALMOND_OVERRIDES ? window.ALMOND_OVERRIDES : {}, - { - get(target, prop, receiver) { - console.log('ALMOND_OVERRIDES proxy success'); - if (prop === 'define') { - oldDefine = window.define; - return newDefine; - } else { - return Reflect.get(target, prop, receiver); +window.ALMOND_OVERRIDES = new Proxy(window.ALMOND_OVERRIDES ? window.ALMOND_OVERRIDES : {}, { + get(target, prop, receiver) { + console.log('ALMOND_OVERRIDES proxy success'); + if (prop === 'define') { + oldDefine = window.define; + return newDefine; + } else { + return Reflect.get(target, prop, receiver); + } + }, +}); + +function runCalculator() { + window.require( + ['toplevel/calculator_desktop', 'testbridge', 'jquery'], + function (calcPromise: any, TestBridge: any, $: any) { + $('.dcg-loading-div-container').hide(); + if (calcPromise === undefined) { + console.error('No calc promise'); } - }, - } -); + calcPromise.then(function (calc: any) { + if (calc === undefined) { + console.error('No calc'); + } + window.Calc = calc; + TestBridge.ready(); + // DesModder needs the following lines added + listenToMessageDown((message) => { + if (message.type === 'set-script-url') { + injectScript(message.value); + // cancel listener + return true; + } + }); + postMessageUp({ + type: 'get-script-url', + }); + }); + } + ); +} +if (document.currentScript.getAttribute('run-calculator')) { + pollForValue( + () => (document.querySelector('script[src^=\'/assets/build/calculator_desktop\']') as HTMLScriptElement)?.src + ).then((src) => { + /* we blocked calculator_desktop.js earlier to ensure that the preload/override script runs first. + Now we load it, but with '??' appended to prevent the web request rules from blocking it */ + const script = document.createElement('script'); + script.src = src + '??'; + console.log(src); + script.async = false; + script.onload = () => { + // remove from DOM + script.remove(); + runCalculator(); + }; + script.onerror = () => { + console.error('Injected script onerror'); + }; + document.body.appendChild(script); + }); +} diff --git a/src/utils/utils.ts b/src/utils/utils.ts index aa301d0..ee85b24 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -70,12 +70,12 @@ export async function storeConfig(this: HTMLInputElement) { if (currentlyStored !== '') { wordToStore = ' ' + wordToStore; } - browser.storage.local.set({ autoCommands: currentlyStored + wordToStore }); + browser.storage.local.set({ [opt]: currentlyStored + wordToStore }); } else { const newStorage = currentlyStored .split(' ') .filter((word) => word != wordToStore) .join(' '); - browser.storage.local.set({ autoCommands: newStorage }); + browser.storage.local.set({ [opt]: newStorage }); } } diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index e57ecda..81c24c5 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -49,7 +49,6 @@ if (browser === 'firefox') { module.exports = merge(baseConfig, { entry: { empty: path.join(__dirname, `../${SRC_DIR_NAME}/preload/empty.ts`), - run_calculator: path.join(__dirname, `../${SRC_DIR_NAME}/preload/run_calculator.ts`), }, plugins: [ new CopyPlugin({ From 5d5455032a2dd17b68958d4c9403ca1d3524f44e Mon Sep 17 00:00:00 2001 From: SinclaM Date: Fri, 15 Jul 2022 15:43:48 -0500 Subject: [PATCH 22/32] Improve readability --- src/content.ts | 4 ++-- src/preload/content.ts | 4 ++-- src/script.ts | 11 +++++------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/content.ts b/src/content.ts index b909812..b65d019 100644 --- a/src/content.ts +++ b/src/content.ts @@ -5,9 +5,9 @@ async function updateAutoCommands() { const cmdString = commands.autoCommands.toString(); script.onload = function () { const data = cmdString; - document.dispatchEvent(new CustomEvent('sendConfig', { detail: data })); + document.dispatchEvent(new CustomEvent('send-config', { detail: data })); - (this as any).remove(); + script.remove(); }; (document.head || document.documentElement).appendChild(script); } diff --git a/src/preload/content.ts b/src/preload/content.ts index 4137cba..e90118e 100644 --- a/src/preload/content.ts +++ b/src/preload/content.ts @@ -29,7 +29,7 @@ browser.runtime.onMessage.addListener(async function (request) { const script = document.createElement('script'); script.src = browser.runtime.getURL('preloadScript.js'); script.onload = function () { - (this as any).remove(); + script.remove(); resolve(); }; script.onerror = (e) => console.log(e); @@ -52,7 +52,7 @@ browser.runtime.onMessage.addListener(async function (request) { // The attribute just needs a truthy value. script.setAttribute('run-calculator', 'run-calculator'); script.onload = function () { - (this as any).remove(); + script.remove(); resolve(); }; script.onerror = (e) => console.log(e); diff --git a/src/script.ts b/src/script.ts index b152d4f..d609e75 100644 --- a/src/script.ts +++ b/src/script.ts @@ -14,10 +14,9 @@ function waitForDesmosLoaded(commands: string) { }, interval); } -document.addEventListener('sendConfig', handler); +const handler = (({ detail }: CustomEvent) => { + waitForDesmosLoaded(detail); + document.removeEventListener('send-config', handler); +}) as EventListener; -function handler (e) { - const data = (e as any).detail; - waitForDesmosLoaded(data); - document.removeEventListener('sendConfig', handler); -} +document.addEventListener('send-config', handler); From 867798729a9d51768884e1e1e9c18ee70a0b26ea Mon Sep 17 00:00:00 2001 From: SinclaM Date: Fri, 15 Jul 2022 16:08:16 -0500 Subject: [PATCH 23/32] Minor changes --- src/script.ts | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/script.ts b/src/script.ts index d609e75..6702758 100644 --- a/src/script.ts +++ b/src/script.ts @@ -1,22 +1,15 @@ /// -//import window from './globals/window'; - -function waitForDesmosLoaded(commands: string) { - const interval = 10; // ms - window.setTimeout(function () { - if ((window as any).Desmos?.MathQuill?.config && (window as any).Desmos?.Calculator) { - (window as any).Desmos.MathQuill.config({ - autoCommands: commands, - }); - } else { - waitForDesmosLoaded(commands); - } - }, interval); -} +import { pollForValue } from './utils/utils'; +import window from './globals/window'; const handler = (({ detail }: CustomEvent) => { - waitForDesmosLoaded(detail); - document.removeEventListener('send-config', handler); + // Have to wait for all the preload modifications to finish + pollForValue(() => window.Desmos?.MathQuill?.config).then(() => { + (window as any).Desmos.MathQuill.config({ + autoCommands: detail, + }); + document.removeEventListener('send-config', handler); + }); }) as EventListener; document.addEventListener('send-config', handler); From d38b88eea1a829c74ce67fc92117da7ccbd383f7 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Fri, 15 Jul 2022 21:28:55 -0500 Subject: [PATCH 24/32] Fix ALMOND_OVERRIDES proxy behavior to work with DesModder plugins --- src/preload/script.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/preload/script.ts b/src/preload/script.ts index 30e6e2d..2156ea9 100644 --- a/src/preload/script.ts +++ b/src/preload/script.ts @@ -18,11 +18,21 @@ newDefine.amd = { jQuery: true, }; -window.ALMOND_OVERRIDES = new Proxy(window.ALMOND_OVERRIDES ? window.ALMOND_OVERRIDES : {}, { +// If ALMOND_OVERRIDES is already defined, DesModder must be enabled. +const isDesmodderActive: boolean = window.ALMOND_OVERRIDES; + + +// Layer a proxy over DesModder's ALMOND_OVERRIDES proxy, if it's enabled. +window.ALMOND_OVERRIDES = new Proxy(isDesmodderActive ? window.ALMOND_OVERRIDES : {}, { get(target, prop, receiver) { - console.log('ALMOND_OVERRIDES proxy success'); if (prop === 'define') { - oldDefine = window.define; + console.log('ALMOND_OVERRIDES proxy success'); + + // If DesModder is enabled, we have to make sure to forward the operation + // to DesModder's own ALMOND_OVERRIDES proxy. If we use ALMOND_OVERRIDES.define, + // we'll get infinite recursion. And if we just use window.define, then we'll + // overwrite DesModder's module overrides. + oldDefine = isDesmodderActive ? Reflect.get(target, prop, receiver) : window.define; return newDefine; } else { return Reflect.get(target, prop, receiver); From 87b2aec878829929fc6c973ddbee8929bbd83764 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Sun, 17 Jul 2022 20:01:47 -0500 Subject: [PATCH 25/32] Convert code base to double quotes --- .eslintrc.json | 2 +- .prettierignore | 3 +- .prettierrc | 2 +- babel.config.js | 2 +- public/popup.css | 14 +- src/background/chrome/background.ts | 13 +- src/background/edge/background.ts | 13 +- src/background/firefox/background.ts | 22 +- src/background/opera/background.ts | 22 +- src/content.ts | 9 +- src/globals/window.ts | 19 +- src/popup.ts | 32 +- src/preload/content.ts | 26 +- src/preload/extend_mathquill.js | 5635 ++++++++++++-------------- src/preload/script.ts | 39 +- src/script.ts | 8 +- src/utils/autoCommands.ts | 158 +- src/utils/injectScript.ts | 2 +- src/utils/messages.ts | 30 +- src/utils/utils.ts | 28 +- webpack/webpack.common.js | 34 +- webpack/webpack.dev.js | 8 +- webpack/webpack.prod.js | 8 +- 23 files changed, 2823 insertions(+), 3306 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 43e5241..6b1967e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -18,7 +18,7 @@ "ignorePatterns": ["dist/*", "webpack/*"], "rules": { "linebreak-style": ["error", "unix"], - "quotes": ["error", "single"], + "quotes": ["error", "double"], "semi": ["error", "always"], "eol-last": ["error", "always"], "import/newline-after-import": [ diff --git a/.prettierignore b/.prettierignore index 40b878d..b947077 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,2 @@ -node_modules/ \ No newline at end of file +node_modules/ +dist/ diff --git a/.prettierrc b/.prettierrc index c7fdd36..9f72bcd 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1,6 @@ { "printWidth": 120, - "singleQuote": true, + "singleQuote": false, "trailingComma": "es5", "tabWidth": 4 } diff --git a/babel.config.js b/babel.config.js index cac3ccd..cd57e3d 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,4 +1,4 @@ // babel.config.js module.exports = { - presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'], + presets: [["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-typescript"], }; diff --git a/public/popup.css b/public/popup.css index 4bbbee6..f6bb961 100644 --- a/public/popup.css +++ b/public/popup.css @@ -1,5 +1,5 @@ body { - font-family: 'Roboto', sans-serif; + font-family: "Roboto", sans-serif; font-size: 0.9em; width: 360px; height: 600px; @@ -50,7 +50,7 @@ button { color: rgba(0, 0, 0, 0.85); cursor: pointer; display: inline-flex; - font-family: system-ui, -apple-system, system-ui, 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-family: system-ui, -apple-system, system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 15px; font-weight: 600; justify-content: center; @@ -121,12 +121,12 @@ h2 { } .symbol { - font-family: 'Noto Sans Math', sans-serif; + font-family: "Noto Sans Math", sans-serif; } .shortcut { display: inline; - font-family: 'Fira Code', monospace; + font-family: "Fira Code", monospace; } .onoffswitch { @@ -171,13 +171,13 @@ h2 { box-sizing: border-box; } .onoffswitch-inner:before { - content: ''; + content: ""; padding-left: 10px; background-color: #0094ff; color: #ffffff; } .onoffswitch-inner:after { - content: ''; + content: ""; padding-right: 10px; background-color: #eeeeee; color: #999999; @@ -204,5 +204,5 @@ h2 { } .latex-item#mathrm .symbol { - font-family: 'Times New Roman', Times, serif; + font-family: "Times New Roman", Times, serif; } diff --git a/src/background/chrome/background.ts b/src/background/chrome/background.ts index f7616c2..6518704 100644 --- a/src/background/chrome/background.ts +++ b/src/background/chrome/background.ts @@ -5,7 +5,7 @@ chrome.runtime.onInstalled.addListener(function () { // keepmeKEEPME should always remain in autoCommands, since MathQuill requires a nonempty // space-delimited list of commands. autoCommands: - 'keepmeKEEPME alpha beta sqrt theta Theta phi Phi pi Pi tau nthroot cbrt sum prod int ans percent infinity infty gamma Gamma delta Delta epsilon epsiv zeta eta kappa lambda Lambda mu xi Xi rho sigma Sigma chi Psi omega Omega digamma iota nu upsilon Upsilon Psi square mid parallel nparallel perp to times div approx', + "keepmeKEEPME alpha beta sqrt theta Theta phi Phi pi Pi tau nthroot cbrt sum prod int ans percent infinity infty gamma Gamma delta Delta epsilon epsiv zeta eta kappa lambda Lambda mu xi Xi rho sigma Sigma chi Psi omega Omega digamma iota nu upsilon Upsilon Psi square mid parallel nparallel perp to times div approx", }); }); @@ -14,7 +14,7 @@ chrome.runtime.onInstalled.addListener(function () { // initialize the calculator. chrome.webRequest.onBeforeRedirect.addListener( async function ({ url }) { - console.log(url.endsWith('?')); + console.log(url.endsWith("?")); const tabs = await chrome.tabs.query({ active: true, currentWindow: true }); while (true) { // The request to calculator_desktop (and the following redirect) may happen @@ -25,18 +25,17 @@ chrome.webRequest.onBeforeRedirect.addListener( // TODO: Figure out why tsserver thinks that sendMessage returns void and not // a promise. tsserver says await has no effect on the expression below but it's // actual critical to resolve the promise and catch the error. - await chrome.tabs.sendMessage(tabs[0].id, { message: 'redirect-detected', url: url }); + await chrome.tabs.sendMessage(tabs[0].id, { message: "redirect-detected", url: url }); break; - } - catch { + } catch { await new Promise((r) => setTimeout(r, 10)); } } }, { urls: [ - 'https://www.desmos.com/assets/build/calculator_desktop-*.js', - 'https://www.desmos.com/assets/build/calculator_desktop-*.js?', + "https://www.desmos.com/assets/build/calculator_desktop-*.js", + "https://www.desmos.com/assets/build/calculator_desktop-*.js?", ], } ); diff --git a/src/background/edge/background.ts b/src/background/edge/background.ts index f7616c2..6518704 100644 --- a/src/background/edge/background.ts +++ b/src/background/edge/background.ts @@ -5,7 +5,7 @@ chrome.runtime.onInstalled.addListener(function () { // keepmeKEEPME should always remain in autoCommands, since MathQuill requires a nonempty // space-delimited list of commands. autoCommands: - 'keepmeKEEPME alpha beta sqrt theta Theta phi Phi pi Pi tau nthroot cbrt sum prod int ans percent infinity infty gamma Gamma delta Delta epsilon epsiv zeta eta kappa lambda Lambda mu xi Xi rho sigma Sigma chi Psi omega Omega digamma iota nu upsilon Upsilon Psi square mid parallel nparallel perp to times div approx', + "keepmeKEEPME alpha beta sqrt theta Theta phi Phi pi Pi tau nthroot cbrt sum prod int ans percent infinity infty gamma Gamma delta Delta epsilon epsiv zeta eta kappa lambda Lambda mu xi Xi rho sigma Sigma chi Psi omega Omega digamma iota nu upsilon Upsilon Psi square mid parallel nparallel perp to times div approx", }); }); @@ -14,7 +14,7 @@ chrome.runtime.onInstalled.addListener(function () { // initialize the calculator. chrome.webRequest.onBeforeRedirect.addListener( async function ({ url }) { - console.log(url.endsWith('?')); + console.log(url.endsWith("?")); const tabs = await chrome.tabs.query({ active: true, currentWindow: true }); while (true) { // The request to calculator_desktop (and the following redirect) may happen @@ -25,18 +25,17 @@ chrome.webRequest.onBeforeRedirect.addListener( // TODO: Figure out why tsserver thinks that sendMessage returns void and not // a promise. tsserver says await has no effect on the expression below but it's // actual critical to resolve the promise and catch the error. - await chrome.tabs.sendMessage(tabs[0].id, { message: 'redirect-detected', url: url }); + await chrome.tabs.sendMessage(tabs[0].id, { message: "redirect-detected", url: url }); break; - } - catch { + } catch { await new Promise((r) => setTimeout(r, 10)); } } }, { urls: [ - 'https://www.desmos.com/assets/build/calculator_desktop-*.js', - 'https://www.desmos.com/assets/build/calculator_desktop-*.js?', + "https://www.desmos.com/assets/build/calculator_desktop-*.js", + "https://www.desmos.com/assets/build/calculator_desktop-*.js?", ], } ); diff --git a/src/background/firefox/background.ts b/src/background/firefox/background.ts index 240c39c..f54f1db 100644 --- a/src/background/firefox/background.ts +++ b/src/background/firefox/background.ts @@ -5,7 +5,7 @@ browser.runtime.onInstalled.addListener(function () { // keepmeKEEPME should always remain in autoCommands, since MathQuill requires a nonempty // space-delimited list of commands. autoCommands: - 'keepmeKEEPME alpha beta sqrt theta Theta phi Phi pi Pi tau nthroot cbrt sum prod int ans percent infinity infty gamma Gamma delta Delta epsilon epsiv zeta eta kappa lambda Lambda mu xi Xi rho sigma Sigma chi Psi omega Omega digamma iota nu upsilon Upsilon Psi square mid parallel nparallel perp to times div approx', + "keepmeKEEPME alpha beta sqrt theta Theta phi Phi pi Pi tau nthroot cbrt sum prod int ans percent infinity infty gamma Gamma delta Delta epsilon epsiv zeta eta kappa lambda Lambda mu xi Xi rho sigma Sigma chi Psi omega Omega digamma iota nu upsilon Upsilon Psi square mid parallel nparallel perp to times div approx", }); }); @@ -13,18 +13,18 @@ browser.webRequest.onBeforeRequest.addListener( async function ({ url }) { // This url is used by preload_content to check for DesModder activity. // We ignore it here to avoid an infinite recursion. - if (url === 'https://www.desmos.com/assets/build/calculator_desktop-this_does_not_exist.js') { + if (url === "https://www.desmos.com/assets/build/calculator_desktop-this_does_not_exist.js") { return; } const tabs = await browser.tabs.query({ active: true, currentWindow: true }); - if (url.endsWith('.js')) { + if (url.endsWith(".js")) { console.log(url); const isDesmodderActive: boolean | void = await browser.tabs.sendMessage(tabs[0].id, { - message: 'check-desmodder', + message: "check-desmodder", }); - console.log('Message from the content script:'); + console.log("Message from the content script:"); console.log(isDesmodderActive); // If DesModder is not active, then we should immediately inject the preload script @@ -33,21 +33,21 @@ browser.webRequest.onBeforeRequest.addListener( // block this script anyway, and we don't want to define ALMOND_OVERRIDES before // DesModder does, so we can wait until DesModder makes another request. if (!isDesmodderActive) { - await browser.tabs.sendMessage(tabs[0].id, { message: 'inject-preload' }); + await browser.tabs.sendMessage(tabs[0].id, { message: "inject-preload" }); } } // This url being requested means DesModder is active and trying to load the calculator. // Now is the time to inject the preload. - if (url.endsWith('.js?')) { - await browser.tabs.sendMessage(tabs[0].id, { message: 'inject-preload' }); + if (url.endsWith(".js?")) { + await browser.tabs.sendMessage(tabs[0].id, { message: "inject-preload" }); } }, { urls: [ - 'https://www.desmos.com/assets/build/calculator_desktop-*.js', - 'https://www.desmos.com/assets/build/calculator_desktop-*.js?', + "https://www.desmos.com/assets/build/calculator_desktop-*.js", + "https://www.desmos.com/assets/build/calculator_desktop-*.js?", ], }, - ['blocking'] + ["blocking"] ); diff --git a/src/background/opera/background.ts b/src/background/opera/background.ts index 240c39c..f54f1db 100644 --- a/src/background/opera/background.ts +++ b/src/background/opera/background.ts @@ -5,7 +5,7 @@ browser.runtime.onInstalled.addListener(function () { // keepmeKEEPME should always remain in autoCommands, since MathQuill requires a nonempty // space-delimited list of commands. autoCommands: - 'keepmeKEEPME alpha beta sqrt theta Theta phi Phi pi Pi tau nthroot cbrt sum prod int ans percent infinity infty gamma Gamma delta Delta epsilon epsiv zeta eta kappa lambda Lambda mu xi Xi rho sigma Sigma chi Psi omega Omega digamma iota nu upsilon Upsilon Psi square mid parallel nparallel perp to times div approx', + "keepmeKEEPME alpha beta sqrt theta Theta phi Phi pi Pi tau nthroot cbrt sum prod int ans percent infinity infty gamma Gamma delta Delta epsilon epsiv zeta eta kappa lambda Lambda mu xi Xi rho sigma Sigma chi Psi omega Omega digamma iota nu upsilon Upsilon Psi square mid parallel nparallel perp to times div approx", }); }); @@ -13,18 +13,18 @@ browser.webRequest.onBeforeRequest.addListener( async function ({ url }) { // This url is used by preload_content to check for DesModder activity. // We ignore it here to avoid an infinite recursion. - if (url === 'https://www.desmos.com/assets/build/calculator_desktop-this_does_not_exist.js') { + if (url === "https://www.desmos.com/assets/build/calculator_desktop-this_does_not_exist.js") { return; } const tabs = await browser.tabs.query({ active: true, currentWindow: true }); - if (url.endsWith('.js')) { + if (url.endsWith(".js")) { console.log(url); const isDesmodderActive: boolean | void = await browser.tabs.sendMessage(tabs[0].id, { - message: 'check-desmodder', + message: "check-desmodder", }); - console.log('Message from the content script:'); + console.log("Message from the content script:"); console.log(isDesmodderActive); // If DesModder is not active, then we should immediately inject the preload script @@ -33,21 +33,21 @@ browser.webRequest.onBeforeRequest.addListener( // block this script anyway, and we don't want to define ALMOND_OVERRIDES before // DesModder does, so we can wait until DesModder makes another request. if (!isDesmodderActive) { - await browser.tabs.sendMessage(tabs[0].id, { message: 'inject-preload' }); + await browser.tabs.sendMessage(tabs[0].id, { message: "inject-preload" }); } } // This url being requested means DesModder is active and trying to load the calculator. // Now is the time to inject the preload. - if (url.endsWith('.js?')) { - await browser.tabs.sendMessage(tabs[0].id, { message: 'inject-preload' }); + if (url.endsWith(".js?")) { + await browser.tabs.sendMessage(tabs[0].id, { message: "inject-preload" }); } }, { urls: [ - 'https://www.desmos.com/assets/build/calculator_desktop-*.js', - 'https://www.desmos.com/assets/build/calculator_desktop-*.js?', + "https://www.desmos.com/assets/build/calculator_desktop-*.js", + "https://www.desmos.com/assets/build/calculator_desktop-*.js?", ], }, - ['blocking'] + ["blocking"] ); diff --git a/src/content.ts b/src/content.ts index b65d019..f9126f3 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1,11 +1,11 @@ async function updateAutoCommands() { - const commands = await browser.storage.local.get('autoCommands'); - const script = document.createElement('script'); - script.src = browser.runtime.getURL('script.js'); + const commands = await browser.storage.local.get("autoCommands"); + const script = document.createElement("script"); + script.src = browser.runtime.getURL("script.js"); const cmdString = commands.autoCommands.toString(); script.onload = function () { const data = cmdString; - document.dispatchEvent(new CustomEvent('send-config', { detail: data })); + document.dispatchEvent(new CustomEvent("send-config", { detail: data })); script.remove(); }; @@ -14,4 +14,3 @@ async function updateAutoCommands() { updateAutoCommands(); browser.storage.onChanged.addListener(updateAutoCommands); - diff --git a/src/globals/window.ts b/src/globals/window.ts index be8d0ad..2ea5903 100644 --- a/src/globals/window.ts +++ b/src/globals/window.ts @@ -1,18 +1,13 @@ interface windowConfig extends Window { - require(s: string[], callback: Function): void; - require(s: string): any; - Calc: any; - DesModder: any; - define( - moduleName: string, - dependencies: string[], - definition: Function - ): void; - ALMOND_OVERRIDES: any; - Desmos: any; + require(s: string[], callback: Function): void; + require(s: string): any; + Calc: any; + DesModder: any; + define(moduleName: string, dependencies: string[], definition: Function): void; + ALMOND_OVERRIDES: any; + Desmos: any; } declare let window: windowConfig; export default window; - diff --git a/src/popup.ts b/src/popup.ts index 97c0b04..c9ae209 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -1,24 +1,24 @@ -import {desmosDefualtAutoCommands, basicAutoCommands, advancedAutoCommands} from './utils/autoCommands'; -import {massSet, storeConfig, populateGrid} from './utils/utils'; +import { desmosDefualtAutoCommands, basicAutoCommands, advancedAutoCommands } from "./utils/autoCommands"; +import { massSet, storeConfig, populateGrid } from "./utils/utils"; -const setToDefault = document.getElementById('set-to-default'); -const setToDesmosDefault = document.getElementById('set-to-desmos-default'); +const setToDefault = document.getElementById("set-to-default"); +const setToDesmosDefault = document.getElementById("set-to-desmos-default"); setToDefault.onclick = function () { massSet( - Array.from(document.querySelectorAll('#desmos-default .latex-item, #basic .latex-item')) + Array.from(document.querySelectorAll("#desmos-default .latex-item, #basic .latex-item")) .map((item) => item.id) .filter(function (item) { - return item !== 'ge' && item !== 'le' && item !== 'ne' && item !== 'pm' && item !== 'mp'; + return item !== "ge" && item !== "le" && item !== "ne" && item !== "pm" && item !== "mp"; }), - 'autoCommands' + "autoCommands" ); }; setToDesmosDefault.onclick = function () { massSet( - Array.from(document.querySelectorAll('#desmos-default .latex-item')).map((item) => item.id), - 'autoCommands' + Array.from(document.querySelectorAll("#desmos-default .latex-item")).map((item) => item.id), + "autoCommands" ); }; @@ -35,16 +35,14 @@ setToDesmosDefault.onclick = function () { // Add all the dynamically loaded nodes to the DOM using templates and give // sliders their funcionality async function initialize() { - await populateGrid('grid-item-template', 'desmos-default', desmosDefualtAutoCommands); - await populateGrid('grid-item-template', 'basic', basicAutoCommands); - await populateGrid('grid-item-template', 'advanced', advancedAutoCommands); + await populateGrid("grid-item-template", "desmos-default", desmosDefualtAutoCommands); + await populateGrid("grid-item-template", "basic", basicAutoCommands); + await populateGrid("grid-item-template", "advanced", advancedAutoCommands); // Make the sliders actually update user configs when clicked - document.querySelectorAll('.latex-item').forEach(function (item) { - item.querySelector('.onoffswitch-checkbox').addEventListener('click', storeConfig); + document.querySelectorAll(".latex-item").forEach(function (item) { + item.querySelector(".onoffswitch-checkbox").addEventListener("click", storeConfig); }); } -document.addEventListener('DOMContentLoaded', initialize); - - +document.addEventListener("DOMContentLoaded", initialize); diff --git a/src/preload/content.ts b/src/preload/content.ts index e90118e..156856a 100644 --- a/src/preload/content.ts +++ b/src/preload/content.ts @@ -1,33 +1,32 @@ -console.log('Preload running...'); +console.log("Preload running..."); browser.runtime.onMessage.addListener(async function (request) { let isDesmodderActive: boolean; switch (request.message) { - // Check if DesModder is enabled by making a request to a non-existent file. // If DesModder is not enabled, this fetch will not throw an exception (just // a 404 response). If DesModder is enabled, DesModder's own net request rules // will block this request, result in an exception being thrown. // Note: this case only applies to the manifest v2 versions of this extension. - case 'check-desmodder': + case "check-desmodder": console.log(`preload_content heard message: ${request.message}`); try { - await fetch('https://www.desmos.com/assets/build/calculator_desktop-this_does_not_exist.js'); + await fetch("https://www.desmos.com/assets/build/calculator_desktop-this_does_not_exist.js"); isDesmodderActive = false; - console.log('preload_content reports DesModder is NOT active'); + console.log("preload_content reports DesModder is NOT active"); } catch { isDesmodderActive = true; - console.log('preload_content reports DesModder is active'); + console.log("preload_content reports DesModder is active"); } return Promise.resolve(isDesmodderActive); // Inject the script which sets up ALMOND_OVERRIDES and wait for it to finish. // Note: this case only applies to the manifest v2 versions of this extension. - case 'inject-preload': + case "inject-preload": console.log(`preload_content heard message: ${request.message}`); await new Promise(function (resolve) { - const script = document.createElement('script'); - script.src = browser.runtime.getURL('preloadScript.js'); + const script = document.createElement("script"); + script.src = browser.runtime.getURL("preloadScript.js"); script.onload = function () { script.remove(); resolve(); @@ -40,17 +39,17 @@ browser.runtime.onMessage.addListener(async function (request) { // Inject the script which sets up ALMOND_OVERRIDES and wait for it to finish. // Then, inject the script which loads in the calculator and wait for it to finish. // Note: this case only applies to the manifest v3 versions of this extension. - case 'redirect-detected': + case "redirect-detected": console.log(`preload_content heard message: ${request.message}`); console.log(`url detected is ${request.url}`); await new Promise(function (resolve) { - const script = document.createElement('script'); - script.src = browser.runtime.getURL('preloadScript.js'); + const script = document.createElement("script"); + script.src = browser.runtime.getURL("preloadScript.js"); // Tell the injected script to initialize the calculator after finishing // its module overrides. // The attribute just needs a truthy value. - script.setAttribute('run-calculator', 'run-calculator'); + script.setAttribute("run-calculator", "run-calculator"); script.onload = function () { script.remove(); resolve(); @@ -61,4 +60,3 @@ browser.runtime.onMessage.addListener(async function (request) { return Promise.resolve(); } }); - diff --git a/src/preload/extend_mathquill.js b/src/preload/extend_mathquill.js index 0784a51..4fd6292 100644 --- a/src/preload/extend_mathquill.js +++ b/src/preload/extend_mathquill.js @@ -2,12 +2,12 @@ /* Taken from the (Desmos fork of) MathQuill source code */ -export default function() { +export default function () { var L = -1; var R = 1; var min = Math.min; var max = Math.max; - function noop() { } + function noop() {} /** * a development-only debug method. This definition and all * calls to `pray` will be stripped from the minified @@ -19,19 +19,17 @@ export default function() { * name. */ function pray(message, cond) { - if (!cond) - throw new Error('prayer failed: ' + message); + if (!cond) throw new Error("prayer failed: " + message); } function prayDirection(dir) { - pray('a direction was passed', dir === L || dir === R); + pray("a direction was passed", dir === L || dir === R); } var urlParams = new URLSearchParams(window.location.search); function parseHTML(s) { // https://youmightnotneedjquery.com/#parse_html - var tmp = document.implementation.createHTMLDocument(''); + var tmp = document.implementation.createHTMLDocument(""); tmp.body.innerHTML = s; - if (tmp.body.children.length === 1) - return tmp.body.children[0]; + if (tmp.body.children.length === 1) return tmp.body.children[0]; var frag = document.createDocumentFragment(); while (tmp.body.firstChild) { frag.appendChild(tmp.body.firstChild); @@ -41,18 +39,17 @@ export default function() { var h = function h(type, attributes, children) { var el; switch (type) { - case 'svg': - case 'path': - el = document.createElementNS('http://www.w3.org/2000/svg', type); + case "svg": + case "path": + el = document.createElementNS("http://www.w3.org/2000/svg", type); break; default: el = document.createElement(type); } for (var key_1 in attributes) { var value = attributes[key_1]; - if (value === undefined) - continue; - el.setAttribute(key_1, typeof value === 'string' ? value : String(value)); + if (value === undefined) continue; + el.setAttribute(key_1, typeof value === "string" ? value : String(value)); } if (children) { for (var i = 0; i < children.length; i++) { @@ -61,7 +58,9 @@ export default function() { } return el; }; - h.text = function (s) { return document.createTextNode(s); }; + h.text = function (s) { + return document.createTextNode(s); + }; h.block = function (type, attributes, block) { var out = h(type, attributes, [block.html()]); block.setDOM(out); @@ -71,37 +70,43 @@ export default function() { h.entityText = function (s) { // TODO: replace with h.text(U_BLAHBLAH) or maybe a named entity->unicode lookup var val = parseHTML(s); - pray('entity parses to a single text node', val instanceof DocumentFragment && - val.childNodes.length === 1 && - val.childNodes[0] instanceof Text); + pray( + "entity parses to a single text node", + val instanceof DocumentFragment && val.childNodes.length === 1 && val.childNodes[0] instanceof Text + ); return val.childNodes[0]; }; function closest(el, s) { var _a, _b, _c; - if (typeof ((_a = el) === null || _a === void 0 ? void 0 : _a.closest) === 'function') { + if (typeof ((_a = el) === null || _a === void 0 ? void 0 : _a.closest) === "function") { return el.closest(s); } - if (!(el instanceof HTMLElement)) - return null; + if (!(el instanceof HTMLElement)) return null; // https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#polyfill - var matches = Element.prototype.matches || - Element.prototype.msMatchesSelector || - Element.prototype.webkitMatchesSelector; + var matches = + Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; var match = el; do { - if (matches.call(match, s)) - return match; - match = (_c = (_b = match === null || match === void 0 ? void 0 : match.parentElement) !== null && _b !== void 0 ? _b : match === null || match === void 0 ? void 0 : match.parentNode) !== null && _c !== void 0 ? _c : null; + if (matches.call(match, s)) return match; + match = + (_c = + (_b = match === null || match === void 0 ? void 0 : match.parentElement) !== null && _b !== void 0 + ? _b + : match === null || match === void 0 + ? void 0 + : match.parentNode) !== null && _c !== void 0 + ? _c + : null; } while (match !== null && match.nodeType === 1); return null; } - var U_NO_BREAK_SPACE = '\u00A0'; - var U_ZERO_WIDTH_SPACE = '\u200B'; - var U_DOT_ABOVE = '\u02D9'; - var U_NARY_SUMMATION = '\u2211'; - var U_NARY_PRODUCT = '\u220F'; - var U_NARY_COPRODUCT = '\u2210'; - var U_INTEGRAL = '\u222B'; + var U_NO_BREAK_SPACE = "\u00A0"; + var U_ZERO_WIDTH_SPACE = "\u200B"; + var U_DOT_ABOVE = "\u02D9"; + var U_NARY_SUMMATION = "\u2211"; + var U_NARY_PRODUCT = "\u220F"; + var U_NARY_COPRODUCT = "\u2210"; + var U_INTEGRAL = "\u222B"; /** * Like `el.getBoundingClientRect()` but avoids throwing for * disconnected and hidden elements in IE <= 11. @@ -135,8 +140,7 @@ export default function() { // https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX#notes return window.pageXOffset !== undefined ? window.pageXOffset - : (document.documentElement || document.body.parentNode || document.body) - .scrollLeft; + : (document.documentElement || document.body.parentNode || document.body).scrollLeft; } /** * Returns the number of pixels that the document is currently scrolled @@ -149,8 +153,7 @@ export default function() { // https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX#notes return window.pageYOffset !== undefined ? window.pageYOffset - : (document.documentElement || document.body.parentNode || document.body) - .scrollTop; + : (document.documentElement || document.body.parentNode || document.body).scrollTop; } /** * Given `duration` in ms and callback `cb`, immediately calls `cb(progress, scheduleNext, cancel)` with: @@ -181,13 +184,13 @@ export default function() { // IIFE exists just to hang on to configured rafShim and cancelShim // functions var rafShim, cancelShim; - if (typeof requestAnimationFrame === 'function' && - typeof cancelAnimationFrame === 'function') { + if (typeof requestAnimationFrame === "function" && typeof cancelAnimationFrame === "function") { rafShim = requestAnimationFrame; cancelShim = cancelAnimationFrame; - } - else { - rafShim = function (cb) { return setTimeout(cb, 13); }; + } else { + rafShim = function (cb) { + return setTimeout(cb, 13); + }; cancelShim = clearTimeout; } return function (duration, cb) { @@ -199,15 +202,13 @@ export default function() { // Enforce that progress is strictly monotonic if (proposedProgress <= progress) { scheduleNext(); - } - else { + } else { progress = proposedProgress; } cb(progress, scheduleNext, cancel); } function cancel() { - if (cancelToken !== undefined) - cancelShim(cancelToken); + if (cancelToken !== undefined) cancelShim(cancelToken); cancelToken = undefined; } function scheduleNext() { @@ -223,12 +224,12 @@ export default function() { })(); var Aria = /** @class */ (function () { function Aria(controller) { - this.span = h('span', { - class: 'dcg-mq-aria-alert', - 'aria-live': 'assertive', - 'aria-atomic': 'true', + this.span = h("span", { + class: "dcg-mq-aria-alert", + "aria-live": "assertive", + "aria-atomic": "true", }); - this.msg = ''; + this.msg = ""; this.items = []; this.controller = controller; } @@ -239,8 +240,10 @@ export default function() { } }; Aria.prototype.queue = function (item, shouldDescribe) { - if (shouldDescribe === void 0) { shouldDescribe = false; } - var output = ''; + if (shouldDescribe === void 0) { + shouldDescribe = false; + } + var output = ""; if (item instanceof MQNode) { // Some constructs include verbal shorthand (such as simple fractions and exponents). // Since ARIA alerts relate to moving through interactive content, we don't want to use that shorthand if it exists @@ -248,45 +251,40 @@ export default function() { var itemMathspeak = item.mathspeak({ ignoreShorthand: true }); if (shouldDescribe) { // used to ensure item is described when cursor reaches block boundaries - if (item.parent && - item.parent.ariaLabel && - item.ariaLabel === 'block') { - output = item.parent.ariaLabel + ' ' + itemMathspeak; - } - else if (item.ariaLabel) { - output = item.ariaLabel + ' ' + itemMathspeak; + if (item.parent && item.parent.ariaLabel && item.ariaLabel === "block") { + output = item.parent.ariaLabel + " " + itemMathspeak; + } else if (item.ariaLabel) { + output = item.ariaLabel + " " + itemMathspeak; } } - if (output === '') { + if (output === "") { output = itemMathspeak; } - } - else { - output = item || ''; + } else { + output = item || ""; } this.items.push(output); return this; }; Aria.prototype.queueDirOf = function (dir) { prayDirection(dir); - return this.queue(dir === L ? 'before' : 'after'); + return this.queue(dir === L ? "before" : "after"); }; Aria.prototype.queueDirEndOf = function (dir) { prayDirection(dir); - return this.queue(dir === L ? 'beginning of' : 'end of'); + return this.queue(dir === L ? "beginning of" : "end of"); }; Aria.prototype.alert = function (t) { this.attach(); - if (t) - this.queue(t); + if (t) this.queue(t); if (this.items.length) { // To cut down on potential verbiage from multiple Mathquills firing near-simultaneous ARIA alerts, // update the text of this instance if its container also has keyboard focus. // If it does not, leave the DOM unchanged but flush the queue regardless. // Note: updating the msg variable regardless of focus for unit tests. this.msg = this.items - .join(' ') - .replace(/ +(?= )/g, '') + .join(" ") + .replace(/ +(?= )/g, "") .trim(); if (this.controller.containerHasFocus()) { this.span.textContent = this.msg; @@ -299,7 +297,7 @@ export default function() { return this; }; return Aria; - }()); + })(); /** * A `DOMFragment` represents a contiguous span of sibling DOM Nodes, * which may include both Element nodes and other nodes like Text and @@ -349,11 +347,9 @@ export default function() { */ function DOMFragment(first, last) { var _a; - if (arguments.length === 1) - last = first; - if (!first || !last) - return; - this.ends = (_a = {}, _a[L] = first, _a[R] = last, _a); + if (arguments.length === 1) last = first; + if (!first || !last) return; + this.ends = ((_a = {}), (_a[L] = first), (_a[R] = last), _a); } /** * Returns a `DOMFragment` representing the contiguous span of sibling @@ -366,11 +362,10 @@ export default function() { * O(n) in the total number of nodes in the fragment */ DOMFragment.create = function (first, last) { - if (arguments.length === 1) - last = first; - pray('No half-empty DOMFragments', !!first === !!last); + if (arguments.length === 1) last = first; + pray("No half-empty DOMFragments", !!first === !!last); var out = new DOMFragment(first, last); - pray('last is a forward sibling of first', out.isValid()); + pray("last is a forward sibling of first", out.isValid()); return out; }; DOMFragment.prototype.isEmpty = function () { @@ -390,12 +385,12 @@ export default function() { * O(n). */ DOMFragment.prototype.isValid = function () { - if (!this.ends) - return true; - if (this.ends[L] === this.ends[R]) - return true; + if (!this.ends) return true; + if (this.ends[L] === this.ends[R]) return true; var maybeLast; - this.eachNode(function (el) { return (maybeLast = el); }); + this.eachNode(function (el) { + return (maybeLast = el); + }); return maybeLast === this.ends[R]; }; /** @@ -405,7 +400,7 @@ export default function() { * Asserts fragment is not empty. */ DOMFragment.prototype.firstNode = function () { - pray('Fragment is not empty', this.ends); + pray("Fragment is not empty", this.ends); return this.ends[L]; }; /** @@ -415,7 +410,7 @@ export default function() { * Asserts fragment is not empty. */ DOMFragment.prototype.lastNode = function () { - pray('Fragment is not empty', this.ends); + pray("Fragment is not empty", this.ends); return this.ends[R]; }; /** @@ -442,10 +437,8 @@ export default function() { * this fragment */ DOMFragment.prototype.join = function (sibling) { - if (!this.ends) - return sibling; - if (!sibling.ends) - return this; + if (!this.ends) return sibling; + if (!sibling.ends) return this; // Check if sibling is actually a sibling of this span var found = false; var current = this.ends[R].nextSibling; @@ -456,7 +449,7 @@ export default function() { } current = current.nextSibling; } - pray('sibling must be a forward DOM sibling of this fragment', found); + pray("sibling must be a forward DOM sibling of this fragment", found); return new DOMFragment(this.ends[L], sibling.ends[R]); }; /** @@ -465,7 +458,7 @@ export default function() { * Asserts that this fragment contains exactly one Node. */ DOMFragment.prototype.oneNode = function () { - pray('Fragment has a single node', this.ends && this.ends[L] === this.ends[R]); + pray("Fragment has a single node", this.ends && this.ends[L] === this.ends[R]); return this.ends[L]; }; /** @@ -476,7 +469,7 @@ export default function() { */ DOMFragment.prototype.oneElement = function () { var el = this.oneNode(); - pray('Node is an Element', el.nodeType === Node.ELEMENT_NODE); + pray("Node is an Element", el.nodeType === Node.ELEMENT_NODE); return el; }; /** @@ -487,7 +480,7 @@ export default function() { */ DOMFragment.prototype.oneText = function () { var el = this.oneNode(); - pray('Node is Text', el.nodeType === Node.TEXT_NODE); + pray("Node is Text", el.nodeType === Node.TEXT_NODE); return el; }; /** @@ -496,8 +489,7 @@ export default function() { * nodes. */ DOMFragment.prototype.eachNode = function (cb) { - if (!this.ends) - return this; + if (!this.ends) return this; var stop = this.ends[R]; for (var node = this.ends[L], next = void 0; node; node = next) { // Note, this loop is organized in a slightly tricky way in order @@ -511,8 +503,7 @@ export default function() { // too dangerous to have as a public method. next = node.nextSibling; cb(node); - if (node === stop) - break; + if (node === stop) break; } return this; }; @@ -523,8 +514,7 @@ export default function() { */ DOMFragment.prototype.eachElement = function (cb) { this.eachNode(function (el) { - if (el.nodeType === Node.ELEMENT_NODE) - cb(el); + if (el.nodeType === Node.ELEMENT_NODE) cb(el); }); return this; }; @@ -533,9 +523,9 @@ export default function() { * fragment. */ DOMFragment.prototype.text = function () { - var accum = ''; + var accum = ""; this.eachNode(function (node) { - accum += node.textContent || ''; + accum += node.textContent || ""; }); return accum; }; @@ -545,7 +535,9 @@ export default function() { */ DOMFragment.prototype.toNodeArray = function () { var accum = []; - this.eachNode(function (el) { return accum.push(el); }); + this.eachNode(function (el) { + return accum.push(el); + }); return accum; }; /** @@ -555,7 +547,9 @@ export default function() { */ DOMFragment.prototype.toElementArray = function () { var accum = []; - this.eachElement(function (el) { return accum.push(el); }); + this.eachElement(function (el) { + return accum.push(el); + }); return accum; }; /** @@ -565,7 +559,9 @@ export default function() { */ DOMFragment.prototype.toDocumentFragment = function () { var frag = document.createDocumentFragment(); - this.eachNode(function (el) { return frag.appendChild(el); }); + this.eachNode(function (el) { + return frag.appendChild(el); + }); return frag; }; /** @@ -636,11 +632,9 @@ export default function() { * does not have a parent node. */ DOMFragment.prototype.parent = function () { - if (!this.ends) - return this; + if (!this.ends) return this; var parent = this.ends[L].parentNode; - if (!parent) - return new DOMFragment(); + if (!parent) return new DOMFragment(); return new DOMFragment(parent); }; /** @@ -649,9 +643,8 @@ export default function() { * fragment. */ DOMFragment.prototype.wrapAll = function (el) { - el.textContent = ''; // First empty the wrapping element - if (!this.ends) - return this; + el.textContent = ""; // First empty the wrapping element + if (!this.ends) return this; var parent = this.ends[L].parentNode; var next = this.ends[R].nextSibling; this.appendTo(el); @@ -685,8 +678,7 @@ export default function() { // they can't be reinserted because this fragment is empty or has no // parent var childDocumentFragment = children.toDocumentFragment(); - if (!rightEnd || !parent) - return this; + if (!rightEnd || !parent) return this; parent.insertBefore(childDocumentFragment, nextSibling || null); return this; }; @@ -699,20 +691,16 @@ export default function() { * with positive arguments. */ DOMFragment.prototype.nthElement = function (n) { - if (!this.ends) - return undefined; - if (n < 0 || n !== Math.floor(n)) - return undefined; + if (!this.ends) return undefined; + if (n < 0 || n !== Math.floor(n)) return undefined; var current = this.ends[L]; while (current) { // Only count element nodes if (current.nodeType === Node.ELEMENT_NODE) { - if (n <= 0) - return current; + if (n <= 0) return current; n -= 1; } - if (current === this.ends[R]) - return undefined; + if (current === this.ends[R]) return undefined; current = current.nextSibling; } return undefined; @@ -731,16 +719,14 @@ export default function() { * Text and Comment nodes). */ DOMFragment.prototype.lastElement = function () { - if (!this.ends) - return undefined; + if (!this.ends) return undefined; var current = this.ends[R]; while (current) { // Only count element nodes if (current.nodeType === Node.ELEMENT_NODE) { return current; } - if (current === this.ends[L]) - return undefined; + if (current === this.ends[L]) return undefined; current = current.previousSibling; } return undefined; @@ -779,11 +765,9 @@ export default function() { DOMFragment.prototype.slice = function (n) { // Note, would be reasonable to extend this to take a second // argument if we ever find we need this - if (!this.ends) - return this; + if (!this.ends) return this; var el = this.nthElement(n); - if (!el) - return new DOMFragment(); + if (!el) return new DOMFragment(); return new DOMFragment(el, this.ends[R]); }; /** @@ -798,8 +782,7 @@ export default function() { var current = this.oneNode(); while (current) { current = current.nextSibling; - if (current && current.nodeType === Node.ELEMENT_NODE) - return new DOMFragment(current); + if (current && current.nodeType === Node.ELEMENT_NODE) return new DOMFragment(current); } return new DOMFragment(); }; @@ -815,8 +798,7 @@ export default function() { var current = this.oneNode(); while (current) { current = current.previousSibling; - if (current && current.nodeType === Node.ELEMENT_NODE) - return new DOMFragment(current); + if (current && current.nodeType === Node.ELEMENT_NODE) return new DOMFragment(current); } return new DOMFragment(); }; @@ -830,7 +812,7 @@ export default function() { // matter once jQuery is totally gone, but until then, this may // introduce memory leaks this.eachElement(function (el) { - el.textContent = ''; + el.textContent = ""; }); return this; }; @@ -879,11 +861,9 @@ export default function() { */ DOMFragment.prototype.insDirOf = function (dir, sibling) { var _a; - if (!this.ends) - return this; + if (!this.ends) return this; var el = (_a = sibling.ends) === null || _a === void 0 ? void 0 : _a[dir]; - if (!el || !el.parentNode) - return this.detach(); + if (!el || !el.parentNode) return this.detach(); _insDirOf(dir, el.parentNode, this.toDocumentFragment(), el); return this; }; @@ -892,8 +872,7 @@ export default function() { * its children, according to the direction specified by `dir`. */ DOMFragment.prototype.insAtDirEnd = function (dir, el) { - if (!this.ends) - return this; + if (!this.ends) return this; _insAtDirEnd(dir, this.toDocumentFragment(), el); return this; }; @@ -904,8 +883,7 @@ export default function() { DOMFragment.prototype.hasClass = function (className) { var out = false; this.eachElement(function (el) { - if (el.classList.contains(className)) - out = true; + if (el.classList.contains(className)) out = true; }); return out; }; @@ -915,8 +893,7 @@ export default function() { */ DOMFragment.prototype.addClass = function (classNames) { var _loop_1 = function (className) { - if (!className) - return "continue"; + if (!className) return "continue"; this_1.eachElement(function (el) { el.classList.add(className); }); @@ -934,8 +911,7 @@ export default function() { */ DOMFragment.prototype.removeClass = function (classNames) { var _loop_2 = function (className) { - if (!className) - return "continue"; + if (!className) return "continue"; this_2.eachElement(function (el) { el.classList.remove(className); }); @@ -955,13 +931,10 @@ export default function() { * If second arg `on` is passed as `false`, always toggle classes off. */ DOMFragment.prototype.toggleClass = function (classNames, on) { - if (on === true) - return this.addClass(classNames); - if (on === false) - return this.removeClass(classNames); + if (on === true) return this.addClass(classNames); + if (on === false) return this.removeClass(classNames); var _loop_3 = function (className) { - if (!className) - return "continue"; + if (!className) return "continue"; this_3.eachElement(function (el) { el.classList.toggle(className); }); @@ -974,7 +947,7 @@ export default function() { return this; }; return DOMFragment; - }()); + })(); var domFrag = DOMFragment.create; /** * Insert `source` before or after `target` child of `parent` denending @@ -990,8 +963,7 @@ export default function() { function _insAtDirEnd(dir, source, parent) { if (dir === L) { parent.insertBefore(source, parent.firstChild); - } - else { + } else { parent.appendChild(source); } } @@ -1017,14 +989,12 @@ export default function() { return new Point(pt.parent, pt[L], pt[R]); }; return Point; - }()); + })(); function eachNode(ends, yield_) { var el = ends[L]; - if (!el) - return; + if (!el) return; var stop = ends[R]; - if (!stop) - return; //shouldn't happen because ends[L] is defined; + if (!stop) return; //shouldn't happen because ends[L] is defined; stop = stop[R]; // TODO - this cast as MQNode is actually important to keep tests passing. I went to // fix this code to gracefully handle an undefined el and there are tests that actually @@ -1032,17 +1002,14 @@ export default function() { // type error. for (; el !== stop; el = el[R]) { var result = yield_(el); // TODO - might be passing in 0 intead of a MQNode, but tests want this - if (result === false) - break; + if (result === false) break; } } function foldNodes(ends, fold, yield_) { var el = ends[L]; - if (!el) - return fold; + if (!el) return fold; var stop = ends[R]; - if (!stop) - return fold; //shouldn't happen because ends[L] is defined; + if (!stop) return fold; //shouldn't happen because ends[L] is defined; stop = stop[R]; // TODO - this cast as MQNode is actually important to keep tests passing. I went to // fix this code to gracefully handle an undefined el and there are tests that actually @@ -1075,7 +1042,7 @@ export default function() { * invariants, which are expected to be restored by a subsequent call * to `Fragment::adopt`. * */ - this.ends = (_c = {}, _c[L] = 0, _c[R] = 0, _c); + this.ends = ((_c = {}), (_c[L] = 0), (_c[R] = 0), _c); this.id = NodeBase.uniqueNodeId(); } NodeBase.uniqueNodeId = function () { @@ -1086,10 +1053,8 @@ export default function() { // them. This is useful for looking up MQNodes in event handlers and // in the mq(elt) public API method NodeBase.getNodeOfElement = function (el) { - if (!el) - return; - if (!el.nodeType) - throw new Error('must pass an Element to NodeBase.getNodeOfElement'); + if (!el) return; + if (!el.nodeType) throw new Error("must pass an Element to NodeBase.getNodeOfElement"); var elTrackingNode = el; return elTrackingNode.mqBlockNode || elTrackingNode.mqCmdNode; }; @@ -1101,17 +1066,20 @@ export default function() { }; NodeBase.prototype.setEnds = function (ends) { this.ends = ends; - pray('No half-empty node ends', !!this.ends[L] === !!this.ends[R]); + pray("No half-empty node ends", !!this.ends[L] === !!this.ends[R]); }; NodeBase.prototype.getEnd = function (dir) { return this.ends[dir]; }; NodeBase.prototype.toString = function () { - return '{{ MathQuill Node #' + this.id + ' }}'; + return "{{ MathQuill Node #" + this.id + " }}"; }; NodeBase.prototype.setDOM = function (el) { if (el) { - pray('DOM is an element or a text node', el.nodeType === Node.ELEMENT_NODE || el.nodeType === Node.TEXT_NODE); + pray( + "DOM is an element or a text node", + el.nodeType === Node.ELEMENT_NODE || el.nodeType === Node.TEXT_NODE + ); } this._el = el; return this; @@ -1137,16 +1105,14 @@ export default function() { var self = this.getSelfNode(); for (var ancestor = self; ancestor; ancestor = ancestor.parent) { var result = yield_(ancestor); - if (result === false) - break; + if (result === false) break; } return this; }; NodeBase.prototype.postOrder = function (yield_) { var self = this.getSelfNode(); (function recurse(descendant) { - if (!descendant) - return false; + if (!descendant) return false; descendant.eachChild(recurse); yield_(descendant); return true; @@ -1157,14 +1123,11 @@ export default function() { return this.ends[L] === 0 && this.ends[R] === 0; }; NodeBase.prototype.isQuietEmptyDelimiter = function (dlms) { - if (!this.isEmpty()) - return false; - if (!dlms) - return false; - if (!this.parent || this.parent.ctrlSeq === undefined) - return false; + if (!this.isEmpty()) return false; + if (!dlms) return false; + if (!this.parent || this.parent.ctrlSeq === undefined) return false; // Remove any leading \left or \right from the ctrl sequence before looking it up. - var key = this.parent.ctrlSeq.replace(/^\\(left|right)?/, ''); + var key = this.parent.ctrlSeq.replace(/^\\(left|right)?/, ""); return dlms.hasOwnProperty(key); }; NodeBase.prototype.isStyleBlock = function () { @@ -1208,12 +1171,9 @@ export default function() { return this.disown(); }; NodeBase.prototype.shouldIgnoreSubstitutionInSimpleSubscript = function (options) { - if (!options.disableAutoSubstitutionInSubscripts) - return false; - if (!this.parent) - return false; - if (!(this.parent.parent instanceof SupSub)) - return false; + if (!options.disableAutoSubstitutionInSubscripts) return false; + if (!this.parent) return false; + if (!(this.parent.parent instanceof SupSub)) return false; // Mathquill is gross. There are many different paths that // create subscripts and sometimes we don't even construct // true instances of `LatexCmds._`. Another problem is that @@ -1223,8 +1183,7 @@ export default function() { // but that check doesn't always work. This seems to be the only // check that always works. I'd rather live with this than try // to change the init order of things. - if (!this.parent.domFrag().hasClass('dcg-mq-sub')) - return false; + if (!this.parent.domFrag().hasClass("dcg-mq-sub")) return false; return true; }; NodeBase.prototype.getSelfNode = function () { @@ -1233,21 +1192,21 @@ export default function() { }; // Overridden by child classes NodeBase.prototype.parser = function () { - pray('Abstract parser() method is never called', false); + pray("Abstract parser() method is never called", false); }; /** Render this node to DOM */ NodeBase.prototype.html = function () { - throw new Error('html() unimplemented in NodeBase'); + throw new Error("html() unimplemented in NodeBase"); }; NodeBase.prototype.text = function () { - return ''; + return ""; }; NodeBase.prototype.latex = function () { - var ctx = { latex: '', startIndex: -1, endIndex: -1 }; + var ctx = { latex: "", startIndex: -1, endIndex: -1 }; this.latexRecursive(ctx); return ctx.latex; }; - NodeBase.prototype.latexRecursive = function (_ctx) { }; + NodeBase.prototype.latexRecursive = function (_ctx) {}; NodeBase.prototype.checkCursorContextOpen = function (ctx) { if (ctx.startSelectionBefore === this) { ctx.startIndex = ctx.latex.length; @@ -1264,47 +1223,51 @@ export default function() { ctx.endIndex = ctx.latex.length; } }; - NodeBase.prototype.finalizeTree = function (_options, _dir) { }; - NodeBase.prototype.contactWeld = function (_cursor, _dir) { }; - NodeBase.prototype.blur = function (_cursor) { }; - NodeBase.prototype.focus = function () { }; - NodeBase.prototype.intentionalBlur = function () { }; - NodeBase.prototype.reflow = function () { }; - NodeBase.prototype.registerInnerField = function (_innerFields, _mathField) { }; + NodeBase.prototype.finalizeTree = function (_options, _dir) {}; + NodeBase.prototype.contactWeld = function (_cursor, _dir) {}; + NodeBase.prototype.blur = function (_cursor) {}; + NodeBase.prototype.focus = function () {}; + NodeBase.prototype.intentionalBlur = function () {}; + NodeBase.prototype.reflow = function () {}; + NodeBase.prototype.registerInnerField = function (_innerFields, _mathField) {}; NodeBase.prototype.chToCmd = function (_ch, _options) { - pray('Abstract chToCmd() method is never called', false); + pray("Abstract chToCmd() method is never called", false); }; NodeBase.prototype.mathspeak = function (_options) { - return ''; - }; - NodeBase.prototype.seek = function (_clientX, _cursor) { }; - NodeBase.prototype.siblingDeleted = function (_options, _dir) { }; - NodeBase.prototype.siblingCreated = function (_options, _dir) { }; - NodeBase.prototype.finalizeInsert = function (_options, _cursor) { }; - NodeBase.prototype.fixDigitGrouping = function (_opts) { }; - NodeBase.prototype.writeLatex = function (_cursor, _latex) { }; - NodeBase.prototype.write = function (_cursor, _ch) { }; + return ""; + }; + NodeBase.prototype.seek = function (_clientX, _cursor) {}; + NodeBase.prototype.siblingDeleted = function (_options, _dir) {}; + NodeBase.prototype.siblingCreated = function (_options, _dir) {}; + NodeBase.prototype.finalizeInsert = function (_options, _cursor) {}; + NodeBase.prototype.fixDigitGrouping = function (_opts) {}; + NodeBase.prototype.writeLatex = function (_cursor, _latex) {}; + NodeBase.prototype.write = function (_cursor, _ch) {}; var _a, _b; - _a = L, _b = R; + (_a = L), (_b = R); NodeBase.idCounter = 0; return NodeBase; - }()); + })(); function prayWellFormed(parent, leftward, rightward) { - pray('a parent is always present', parent); - pray('leftward is properly set up', (function () { - // either it's empty and `rightward` is the left end child (possibly empty) - if (!leftward) - return parent.getEnd(L) === rightward; - // or it's there and its [R] and .parent are properly set up - return leftward[R] === rightward && leftward.parent === parent; - })()); - pray('rightward is properly set up', (function () { - // either it's empty and `leftward` is the right end child (possibly empty) - if (!rightward) - return parent.getEnd(R) === leftward; - // or it's there and its [L] and .parent are properly set up - return rightward[L] === leftward && rightward.parent === parent; - })()); + pray("a parent is always present", parent); + pray( + "leftward is properly set up", + (function () { + // either it's empty and `rightward` is the left end child (possibly empty) + if (!leftward) return parent.getEnd(L) === rightward; + // or it's there and its [R] and .parent are properly set up + return leftward[R] === rightward && leftward.parent === parent; + })() + ); + pray( + "rightward is properly set up", + (function () { + // either it's empty and `leftward` is the right end child (possibly empty) + if (!rightward) return parent.getEnd(R) === leftward; + // or it's there and its [L] and .parent are properly set up + return rightward[L] === leftward && rightward.parent === parent; + })() + ); } /** * An entity outside the virtual tree with one-way pointers (so it's only a @@ -1322,40 +1285,34 @@ export default function() { function Fragment(withDir, oppDir, dir) { var _c, _d; this.disowned = false; - if (dir === undefined) - dir = L; + if (dir === undefined) dir = L; prayDirection(dir); - pray('no half-empty fragments', !withDir === !oppDir); + pray("no half-empty fragments", !withDir === !oppDir); if (!withDir || !oppDir) { - this.setEnds((_c = {}, _c[L] = 0, _c[R] = 0, _c)); + this.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); return; } - pray('withDir is passed to Fragment', withDir instanceof MQNode); - pray('oppDir is passed to Fragment', oppDir instanceof MQNode); - pray('withDir and oppDir have the same parent', withDir.parent === oppDir.parent); - var ends = (_d = {}, - _d[dir] = withDir, - _d[-dir] = oppDir, - _d); + pray("withDir is passed to Fragment", withDir instanceof MQNode); + pray("oppDir is passed to Fragment", oppDir instanceof MQNode); + pray("withDir and oppDir have the same parent", withDir.parent === oppDir.parent); + var ends = ((_d = {}), (_d[dir] = withDir), (_d[-dir] = oppDir), _d); this.setEnds(ends); var maybeRightEnd = 0; this.each(function (el) { maybeRightEnd = el; }); - pray('following direction siblings from start reaches end', maybeRightEnd === ends[R]); + pray("following direction siblings from start reaches end", maybeRightEnd === ends[R]); } Fragment.prototype.getDOMFragFromEnds = function () { var left = this.ends[L]; var right = this.ends[R]; if (left === 0 || right === 0) { return domFrag(); - } - else if (left === right) { + } else if (left === right) { // Note, joining a DOMFragment to itself is not allowed, so // don't attempt to join the end fragments if the ends are equal return left.domFrag(); - } - else { + } else { return left.domFrag().join(right.domFrag()); } }; @@ -1375,9 +1332,7 @@ export default function() { }; // like Cursor::withDirInsertAt(dir, parent, withDir, oppDir) Fragment.prototype.withDirAdopt = function (dir, parent, withDir, oppDir) { - return dir === L - ? this.adopt(parent, withDir, oppDir) - : this.adopt(parent, oppDir, withDir); + return dir === L ? this.adopt(parent, withDir, oppDir) : this.adopt(parent, oppDir, withDir); }; /** * Splice this fragment into the given parent node's children, at the position between the adjacent @@ -1391,23 +1346,19 @@ export default function() { var self = this; this.disowned = false; var leftEnd = self.ends[L]; - if (!leftEnd) - return this; + if (!leftEnd) return this; var rightEnd = self.ends[R]; - if (!rightEnd) - return this; - var ends = (_c = {}, _c[L] = parent.getEnd(L), _c[R] = parent.getEnd(R), _c); + if (!rightEnd) return this; + var ends = ((_c = {}), (_c[L] = parent.getEnd(L)), (_c[R] = parent.getEnd(R)), _c); if (leftward) { // NB: this is handled in the ::each() block // leftward[R] = leftEnd - } - else { + } else { ends[L] = leftEnd; } if (rightward) { rightward[L] = rightEnd; - } - else { + } else { ends[R] = rightEnd; } parent.setEnds(ends); @@ -1415,8 +1366,7 @@ export default function() { self.each(function (el) { el[L] = leftward; el.parent = parent; - if (leftward) - leftward[R] = el; + if (leftward) leftward[R] = el; leftward = el; return true; }); @@ -1430,34 +1380,29 @@ export default function() { var self = this; var leftEnd = self.ends[L]; // guard for empty and already-disowned fragments - if (!leftEnd || self.disowned) - return self; + if (!leftEnd || self.disowned) return self; this.disowned = true; var rightEnd = self.ends[R]; - if (!rightEnd) - return self; + if (!rightEnd) return self; var parent = leftEnd.parent; prayWellFormed(parent, leftEnd[L], leftEnd); prayWellFormed(parent, rightEnd, rightEnd[R]); - var ends = (_c = {}, _c[L] = parent.getEnd(L), _c[R] = parent.getEnd(R), _c); + var ends = ((_c = {}), (_c[L] = parent.getEnd(L)), (_c[R] = parent.getEnd(R)), _c); if (leftEnd[L]) { var leftLeftEnd = leftEnd[L]; leftLeftEnd[R] = rightEnd[R]; - } - else { + } else { ends[L] = rightEnd[R]; } if (rightEnd[R]) { var rightRightEnd = rightEnd[R]; rightRightEnd[L] = leftEnd[L]; - } - else { + } else { ends[R] = leftEnd[L]; } if (ends[L] && ends[R]) { parent.setEnds(ends); - } - else { + } else { // some child classes of MQNode try to enforce that their ends // are never empty through the type system. However, disown may // temporarily break this invariant in which case it's expected @@ -1482,7 +1427,7 @@ export default function() { return foldNodes(this.ends, fold, yield_); }; return Fragment; - }()); + })(); /** * Registry of LaTeX commands and commands created when typing * a single character. @@ -1514,7 +1459,7 @@ export default function() { return new Anticursor(cursor.parent, cursor[L], cursor[R]); }; return Anticursor; - }(Point)); + })(Point); var Cursor = /** @class */ (function (_super) { __extends(Cursor, _super); function Cursor(initParent, options, controller) { @@ -1523,14 +1468,14 @@ export default function() { * point in that node when moving up and down among blocks. */ _this_1.upDownCache = {}; - _this_1.cursorElement = h('span', { class: 'dcg-mq-cursor' }, [h.text(U_ZERO_WIDTH_SPACE)]); + _this_1.cursorElement = h("span", { class: "dcg-mq-cursor" }, [h.text(U_ZERO_WIDTH_SPACE)]); _this_1._domFrag = domFrag(); _this_1.controller = controller; _this_1.options = options; _this_1.setDOMFrag(domFrag(_this_1.cursorElement)); //closured for setInterval _this_1.blink = function () { - domFrag(_this_1.cursorElement).toggleClass('dcg-mq-blink'); + domFrag(_this_1.cursorElement).toggleClass("dcg-mq-blink"); }; return _this_1; } @@ -1542,7 +1487,7 @@ export default function() { return this._domFrag; }; Cursor.prototype.show = function () { - domFrag(this.cursorElement).removeClass('dcg-mq-blink'); + domFrag(this.cursorElement).removeClass("dcg-mq-blink"); this.setDOMFrag(domFrag(this.cursorElement)); if (this.intervalId) //already was shown, just restart interval @@ -1554,19 +1499,15 @@ export default function() { var selection = this.selection; if (selection && selection.getEnd(L)[L] === this[L]) this.domFrag().insertBefore(selection.domFrag()); - else - this.domFrag().insertBefore(right.domFrag()); - } - else - this.domFrag().appendTo(this.parent.domFrag().oneElement()); + else this.domFrag().insertBefore(right.domFrag()); + } else this.domFrag().appendTo(this.parent.domFrag().oneElement()); this.parent.focus(); } this.intervalId = setInterval(this.blink, 500); return this; }; Cursor.prototype.hide = function () { - if (this.intervalId) - clearInterval(this.intervalId); + if (this.intervalId) clearInterval(this.intervalId); this.intervalId = 0; this.domFrag().detach(); this.setDOMFrag(domFrag()); @@ -1580,15 +1521,14 @@ export default function() { // by contract, .blur() is called after all has been said and done // and the cursor has actually been moved // FIXME pass cursor to .blur() so text can fix cursor pointers when removing itself - if (oldParent !== parent && oldParent.blur) - oldParent.blur(this); + if (oldParent !== parent && oldParent.blur) oldParent.blur(this); }; /** Place the cursor before or after `el`, according the side specified by `dir`. */ Cursor.prototype.insDirOf = function (dir, el) { prayDirection(dir); this.domFrag().insDirOf(dir, el.domFrag()); this.withDirInsertAt(dir, el.parent, el[dir], el); - this.parent.domFrag().addClass('dcg-mq-hasCursor'); + this.parent.domFrag().addClass("dcg-mq-hasCursor"); return this; }; Cursor.prototype.insLeftOf = function (el) { @@ -1627,12 +1567,10 @@ export default function() { var cachedR = cached[R]; if (cachedR) { self.insLeftOf(cachedR); - } - else { + } else { self.insAtRightEnd(cached.parent); } - } - else { + } else { var clientX = self.getBoundingClientRectWithoutMargin().left; to.seek(clientX, self); } @@ -1647,9 +1585,11 @@ export default function() { //http://bugs.jquery.com/ticket/11523 //https://github.com/jquery/jquery/pull/717 var frag = this.domFrag(); - frag.removeClass('dcg-mq-cursor'); - var _c = getBoundingClientRect(frag.oneElement()), left = _c.left, right = _c.right; - frag.addClass('dcg-mq-cursor'); + frag.removeClass("dcg-mq-cursor"); + var _c = getBoundingClientRect(frag.oneElement()), + left = _c.left, + right = _c.right; + frag.addClass("dcg-mq-cursor"); return { left: left, right: right, @@ -1662,31 +1602,28 @@ export default function() { var cursor = this; var leftward = gramp[L]; gramp.disown().eachChild(function (uncle) { - if (uncle.isEmpty()) - return true; + if (uncle.isEmpty()) return true; uncle .children() .adopt(greatgramp, leftward, rightward) .each(function (cousin) { - cousin.domFrag().insertBefore(gramp.domFrag()); - return true; - }); + cousin.domFrag().insertBefore(gramp.domFrag()); + return true; + }); leftward = uncle.getEnd(R); return true; }); if (!this[R]) { //then find something to be rightward to insLeftOf var thisL = this[L]; - if (thisL) - this[R] = thisL[R]; + if (thisL) this[R] = thisL[R]; else { while (!this[R]) { var newParent = this.parent[R]; if (newParent) { this.parent = newParent; this[R] = newParent.getEnd(L); - } - else { + } else { this[R] = gramp[R]; this.parent = greatgramp; break; @@ -1695,17 +1632,13 @@ export default function() { } } var thisR = this[R]; - if (thisR) - this.insLeftOf(thisR); - else - this.insAtRightEnd(greatgramp); + if (thisR) this.insLeftOf(thisR); + else this.insAtRightEnd(greatgramp); gramp.domFrag().remove(); var grampL = gramp[L]; var grampR = gramp[R]; - if (grampL) - grampL.siblingDeleted(cursor.options, R); - if (grampR) - grampR.siblingDeleted(cursor.options, L); + if (grampL) grampL.siblingDeleted(cursor.options, R); + if (grampR) grampR.siblingDeleted(cursor.options, L); }; Cursor.prototype.startSelection = function () { var anticursor = (this.anticursor = Anticursor.fromCursor(this)); @@ -1720,8 +1653,7 @@ export default function() { Cursor.prototype.select = function () { var _lca; var anticursor = this.anticursor; - if (this[L] === anticursor[L] && this.parent === anticursor.parent) - return false; + if (this[L] === anticursor[L] && this.parent === anticursor.parent) return false; // Find the lowest common ancestor (`lca`), and the ancestor of the cursor // whose parent is the LCA (which'll be an end of the selection fragment). for (var ancestor = this; ancestor.parent; ancestor = ancestor.parent) { @@ -1730,7 +1662,7 @@ export default function() { break; } } - pray('cursor and anticursor in the same tree', _lca); + pray("cursor and anticursor in the same tree", _lca); var lca = _lca; // The cursor and the anticursor should be in the same tree, because the // mousemove handler attached to the document, unlike the one attached to @@ -1744,7 +1676,9 @@ export default function() { // parent and guaranteed that if both are Points, they are not the same, // and we have to figure out which is the left end and which the right end // of the selection. - var leftEnd, rightEnd, dir = R; + var leftEnd, + rightEnd, + dir = R; // This is an extremely subtle algorithm. // As a special case, `ancestor` could be a Point and `antiAncestor` a Node // immediately to `ancestor`'s left. @@ -1770,10 +1704,8 @@ export default function() { rightEnd = ancestor; } // only want to select Nodes up to Points, can't select Points themselves - if (leftEnd instanceof Point) - leftEnd = leftEnd[R]; - if (rightEnd instanceof Point) - rightEnd = rightEnd[L]; + if (leftEnd instanceof Point) leftEnd = leftEnd[R]; + if (rightEnd instanceof Point) rightEnd = rightEnd[L]; this.hide().selection = lca.selectChildren(leftEnd, rightEnd); var insEl = this.selection.getEnd(dir); this.insDirOf(dir, insEl); @@ -1797,8 +1729,7 @@ export default function() { }; Cursor.prototype.deleteSelection = function () { var selection = this.selection; - if (!selection) - return; + if (!selection) return; this[L] = selection.getEnd(L)[L]; this[R] = selection.getEnd(R)[R]; selection.remove(); @@ -1825,20 +1756,19 @@ export default function() { Cursor.prototype.isTooDeep = function (offset) { if (this.options.maxDepth !== undefined) { return this.depth() + (offset || 0) > this.options.maxDepth; - } - else { + } else { return false; } }; // can be overridden - Cursor.prototype.selectionChanged = function () { }; + Cursor.prototype.selectionChanged = function () {}; return Cursor; - }(Point)); + })(Point); var MQSelection = /** @class */ (function (_super) { __extends(MQSelection, _super); function MQSelection(withDir, oppDir, dir) { var _this_1 = _super.call(this, withDir, oppDir, dir) || this; - _this_1._el = h('span', { class: 'dcg-mq-selection' }); + _this_1._el = h("span", { class: "dcg-mq-selection" }); _this_1.getDOMFragFromEnds().wrapAll(_this_1._el); return _this_1; } @@ -1849,7 +1779,7 @@ export default function() { return this.isCleared() ? this.getDOMFragFromEnds() : domFrag(this._el); }; MQSelection.prototype.setEnds = function (ends) { - pray('Selection ends are never empty', ends[L] && ends[R]); + pray("Selection ends are never empty", ends[L] && ends[R]); this.ends = ends; }; MQSelection.prototype.getEnd = function (dir) { @@ -1870,13 +1800,15 @@ export default function() { return this; }; MQSelection.prototype.join = function (methodName, separator) { - if (separator === void 0) { separator = ''; } - return this.fold('', function (fold, child) { + if (separator === void 0) { + separator = ""; + } + return this.fold("", function (fold, child) { return fold + separator + child[methodName](); }); }; return MQSelection; - }(Fragment)); + })(Fragment); var ControllerBase = /** @class */ (function () { function ControllerBase(root, container, options) { this.textareaEventListeners = {}; @@ -1886,8 +1818,8 @@ export default function() { this.container = container; this.options = options; this.aria = new Aria(this.getControllerSelf()); - this.ariaLabel = 'Math Input'; - this.ariaPostLabel = ''; + this.ariaLabel = "Math Input"; + this.ariaPostLabel = ""; root.controller = this.getControllerSelf(); this.cursor = root.cursor = new Cursor(root, options, this.getControllerSelf()); // TODO: stop depending on root.cursor, and rm it @@ -1902,12 +1834,10 @@ export default function() { var handler = (_c = this.options.handlers) === null || _c === void 0 ? void 0 : _c.fns[name]; if (handler) { var APIClass = handlers === null || handlers === void 0 ? void 0 : handlers.APIClasses[this.KIND_OF_MQ]; - pray('APIClass is defined', APIClass); + pray("APIClass is defined", APIClass); var mq = new APIClass(this); // cast to any bedcause APIClass needs the final Controller subclass. - if (dir === L || dir === R) - handler(dir, mq); - else - handler(mq); + if (dir === L || dir === R) handler(dir, mq); + else handler(mq); } }; ControllerBase.onNotify = function (f) { @@ -1921,14 +1851,12 @@ export default function() { }; ControllerBase.prototype.setAriaLabel = function (ariaLabel) { var oldAriaLabel = this.getAriaLabel(); - if (ariaLabel && typeof ariaLabel === 'string' && ariaLabel !== '') { + if (ariaLabel && typeof ariaLabel === "string" && ariaLabel !== "") { this.ariaLabel = ariaLabel; - } - else if (this.editable) { - this.ariaLabel = 'Math Input'; - } - else { - this.ariaLabel = ''; + } else if (this.editable) { + this.ariaLabel = "Math Input"; + } else { + this.ariaLabel = ""; } // If this field doesn't have focus, update its computed mathspeak value. // We check for focus because updating the aria-label attribute of a focused element will cause most screen readers to announce the new value (in our case, label along with the expression's mathspeak). @@ -1940,66 +1868,55 @@ export default function() { return this; }; ControllerBase.prototype.getAriaLabel = function () { - if (this.ariaLabel !== 'Math Input') { + if (this.ariaLabel !== "Math Input") { return this.ariaLabel; - } - else if (this.editable) { - return 'Math Input'; - } - else { - return ''; + } else if (this.editable) { + return "Math Input"; + } else { + return ""; } }; ControllerBase.prototype.setAriaPostLabel = function (ariaPostLabel, timeout) { var _this_1 = this; - if (ariaPostLabel && - typeof ariaPostLabel === 'string' && - ariaPostLabel !== '') { - if (ariaPostLabel !== this.ariaPostLabel && typeof timeout === 'number') { - if (this._ariaAlertTimeout) - clearTimeout(this._ariaAlertTimeout); + if (ariaPostLabel && typeof ariaPostLabel === "string" && ariaPostLabel !== "") { + if (ariaPostLabel !== this.ariaPostLabel && typeof timeout === "number") { + if (this._ariaAlertTimeout) clearTimeout(this._ariaAlertTimeout); this._ariaAlertTimeout = setTimeout(function () { if (_this_1.containerHasFocus()) { // Voice the new label, but do not update content mathspeak to prevent double-speech. - _this_1.aria.alert(_this_1.root.mathspeak().trim() + ' ' + ariaPostLabel.trim()); - } - else { + _this_1.aria.alert(_this_1.root.mathspeak().trim() + " " + ariaPostLabel.trim()); + } else { // This mathquill does not have focus, so update its mathspeak. _this_1.updateMathspeak(); } }, timeout); } this.ariaPostLabel = ariaPostLabel; - } - else { - if (this._ariaAlertTimeout) - clearTimeout(this._ariaAlertTimeout); - this.ariaPostLabel = ''; + } else { + if (this._ariaAlertTimeout) clearTimeout(this._ariaAlertTimeout); + this.ariaPostLabel = ""; } return this; }; ControllerBase.prototype.getAriaPostLabel = function () { - return this.ariaPostLabel || ''; + return this.ariaPostLabel || ""; }; ControllerBase.prototype.containerHasFocus = function () { - return (document.activeElement && this.container.contains(document.activeElement)); + return document.activeElement && this.container.contains(document.activeElement); }; ControllerBase.prototype.getTextareaOrThrow = function () { var textarea = this.textarea; - if (!textarea) - throw new Error('expected a textarea'); + if (!textarea) throw new Error("expected a textarea"); return textarea; }; ControllerBase.prototype.getTextareaSpanOrThrow = function () { var textareaSpan = this.textareaSpan; - if (!textareaSpan) - throw new Error('expected a textareaSpan'); + if (!textareaSpan) throw new Error("expected a textareaSpan"); return textareaSpan; }; /** Add the given event listeners on this.textarea, replacing the existing listener for that event if it exists. */ ControllerBase.prototype.addTextareaEventListeners = function (listeners) { - if (!this.textarea) - return; + if (!this.textarea) return; for (var key_2 in listeners) { var event = key_2; this.removeTextareaEventListener(event); @@ -2007,11 +1924,9 @@ export default function() { } }; ControllerBase.prototype.removeTextareaEventListener = function (event) { - if (!this.textarea) - return; + if (!this.textarea) return; var listener = this.textareaEventListeners[event]; - if (!listener) - return; + if (!listener) return; this.textarea.removeEventListener(event, listener); }; // based on http://www.gh-mathspeak.com/examples/quick-tutorial/ @@ -2020,13 +1935,13 @@ export default function() { return this.root.mathspeak(); }; // overridden - ControllerBase.prototype.updateMathspeak = function () { }; - ControllerBase.prototype.scrollHoriz = function () { }; - ControllerBase.prototype.selectionChanged = function () { }; - ControllerBase.prototype.setOverflowClasses = function () { }; + ControllerBase.prototype.updateMathspeak = function () {}; + ControllerBase.prototype.scrollHoriz = function () {}; + ControllerBase.prototype.selectionChanged = function () {}; + ControllerBase.prototype.setOverflowClasses = function () {}; ControllerBase.notifyees = []; return ControllerBase; - }()); + })(); var API = {}; var EMBEDS = {}; var processedOptions = { @@ -2045,17 +1960,16 @@ export default function() { this.version = version; } Options.prototype.assertJquery = function () { - pray('Interface versions > 2 do not depend on JQuery', this.version <= 2); - pray('JQuery is set for interface v < 3', this.jQuery); + pray("Interface versions > 2 do not depend on JQuery", this.version <= 2); + pray("JQuery is set for interface v < 3", this.jQuery); return this.jQuery; }; return Options; - }()); + })(); var Progenote = /** @class */ (function () { - function Progenote() { - } + function Progenote() {} return Progenote; - }()); + })(); /** * Interface Versioning (#459, #495) to allow us to virtually guarantee * backcompat. v0.10.x introduces it, so for now, don't completely break the @@ -2066,15 +1980,17 @@ export default function() { */ var insistOnInterVer = function () { if (window.console) - console.warn('You are using the MathQuill API without specifying an interface version, ' + - 'which will fail in v1.0.0. Easiest fix is to do the following before ' + - 'doing anything else:\n' + - '\n' + - ' MathQuill = MathQuill.getInterface(1);\n' + - ' // now MathQuill.MathField() works like it used to\n' + - '\n' + - 'See also the "`dev` branch (2014\u20132015) \u2192 v0.10.0 Migration Guide" at\n' + - ' https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide'); + console.warn( + "You are using the MathQuill API without specifying an interface version, " + + "which will fail in v1.0.0. Easiest fix is to do the following before " + + "doing anything else:\n" + + "\n" + + " MathQuill = MathQuill.getInterface(1);\n" + + " // now MathQuill.MathField() works like it used to\n" + + "\n" + + 'See also the "`dev` branch (2014\u20132015) \u2192 v0.10.0 Migration Guide" at\n' + + " https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide" + ); }; // globally exported API object var MQ1; @@ -2086,36 +2002,33 @@ export default function() { return MQ1(el); } MathQuill.prototype = Progenote.prototype; - MathQuill.VERSION = 'v0.10.1'; + MathQuill.VERSION = "v0.10.1"; MathQuill.interfaceVersion = function (v) { // shim for #459-era interface versioning (ended with #495) - if (v !== 1) - throw 'Only interface version 1 supported. You specified: ' + v; + if (v !== 1) throw "Only interface version 1 supported. You specified: " + v; insistOnInterVer = function () { if (window.console) - console.warn('You called MathQuill.interfaceVersion(1); to specify the interface ' + - 'version, which will fail in v1.0.0. You can fix this easily by doing ' + - 'this before doing anything else:\n' + - '\n' + - ' MathQuill = MathQuill.getInterface(1);\n' + - ' // now MathQuill.MathField() works like it used to\n' + - '\n' + - 'See also the "`dev` branch (2014\u20132015) \u2192 v0.10.0 Migration Guide" at\n' + - ' https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide'); + console.warn( + "You called MathQuill.interfaceVersion(1); to specify the interface " + + "version, which will fail in v1.0.0. You can fix this easily by doing " + + "this before doing anything else:\n" + + "\n" + + " MathQuill = MathQuill.getInterface(1);\n" + + " // now MathQuill.MathField() works like it used to\n" + + "\n" + + 'See also the "`dev` branch (2014\u20132015) \u2192 v0.10.0 Migration Guide" at\n' + + " https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide" + ); }; insistOnInterVer(); return MathQuill; }; MathQuill.getInterface = getInterface; - var MIN = (getInterface.MIN = 1), MAX = (getInterface.MAX = 3); + var MIN = (getInterface.MIN = 1), + MAX = (getInterface.MAX = 3); function getInterface(v) { if (v !== 1 && v !== 2 && v !== 3) - throw ('Only interface versions between ' + - MIN + - ' and ' + - MAX + - ' supported. You specified: ' + - v); + throw "Only interface versions between " + MIN + " and " + MAX + " supported. You specified: " + v; var version = v; if (version < 3) { var jQuery = window.jQuery; @@ -2123,20 +2036,26 @@ export default function() { throw "MathQuill interface version ".concat(version, " requires jQuery 1.5.2+ to be loaded first"); Options.prototype.jQuery = jQuery; } - var optionProcessors = __assign(__assign({}, baseOptionProcessors), { handlers: function (handlers) { return ({ - // casting to the v3 version of this type - fns: handlers || {}, - APIClasses: APIClasses, - }); } }); + var optionProcessors = __assign(__assign({}, baseOptionProcessors), { + handlers: function (handlers) { + return { + // casting to the v3 version of this type + fns: handlers || {}, + APIClasses: APIClasses, + }; + }, + }); function config(currentOptions, newOptions) { for (var name in newOptions) { if (newOptions.hasOwnProperty(name)) { - if (name === 'substituteKeyboardEvents' && version >= 3) { - throw new Error([ - "As of interface version 3, the 'substituteKeyboardEvents'", - "option is no longer supported. Use 'overrideTypedText' and", - "'overrideKeystroke' instead.", - ].join(' ')); + if (name === "substituteKeyboardEvents" && version >= 3) { + throw new Error( + [ + "As of interface version 3, the 'substituteKeyboardEvents'", + "option is no longer supported. Use 'overrideTypedText' and", + "'overrideKeystroke' instead.", + ].join(" ") + ); } var value = newOptions[name]; // TODO - think about typing this better var processor = optionProcessors[name]; // TODO - validate option processors better @@ -2144,13 +2063,16 @@ export default function() { } } } - var BaseOptions = version < 3 ? Options : /** @class */ (function (_super) { - __extends(BaseOptions, _super); - function BaseOptions() { - return _super !== null && _super.apply(this, arguments) || this; - } - return BaseOptions; - }(Options)); + var BaseOptions = + version < 3 + ? Options + : /** @class */ (function (_super) { + __extends(BaseOptions, _super); + function BaseOptions() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + return BaseOptions; + })(Options); var AbstractMathQuill = /** @class */ (function (_super) { __extends(AbstractMathQuill, _super); function AbstractMathQuill(ctrlr) { @@ -2162,18 +2084,22 @@ export default function() { return _this_1; } AbstractMathQuill.prototype.mathquillify = function (classNames) { - var ctrlr = this.__controller, root = ctrlr.root, el = ctrlr.container; + var ctrlr = this.__controller, + root = ctrlr.root, + el = ctrlr.container; ctrlr.createTextarea(); var contents = domFrag(el).addClass(classNames).children().detach(); - root.setDOM(domFrag(h('span', { class: 'dcg-mq-root-block', 'aria-hidden': true })) - .appendTo(el) - .oneElement()); + root.setDOM( + domFrag(h("span", { class: "dcg-mq-root-block", "aria-hidden": true })) + .appendTo(el) + .oneElement() + ); NodeBase.linkElementByBlockNode(root.domFrag().oneElement(), root); this.latex(contents.text()); this.revert = function () { ctrlr.removeMouseEventListener(); domFrag(el) - .removeClass('dcg-mq-editable-field dcg-mq-math-mode dcg-mq-text-mode') + .removeClass("dcg-mq-editable-field dcg-mq-math-mode dcg-mq-text-mode") .empty() .append(contents); return version < 3 ? this.__options.assertJquery()(el) : el; @@ -2203,8 +2129,7 @@ export default function() { if (arguments.length > 0) { this.__controller.renderLatexMath(latex); var cursor = this.__controller.cursor; - if (this.__controller.blurred) - cursor.hide().parent.blur(cursor); + if (this.__controller.blurred) cursor.hide().parent.blur(cursor); return this; } return this.__controller.exportLatex(); @@ -2216,11 +2141,11 @@ export default function() { return this.__controller.root .domFrag() .oneElement() - .innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, '') // TODO remove when jQuery is completely gone - .replace(/ mathquill-(?:command|block)-id="?\d+"?/g, '') - .replace(/.?<\/span>/i, '') - .replace(/ dcg-mq-hasCursor|dcg-mq-hasCursor ?/, '') - .replace(/ class=(""|(?= |>))/g, ''); + .innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") // TODO remove when jQuery is completely gone + .replace(/ mathquill-(?:command|block)-id="?\d+"?/g, "") + .replace(/.?<\/span>/i, "") + .replace(/ dcg-mq-hasCursor|dcg-mq-hasCursor ?/, "") + .replace(/ class=(""|(?= |>))/g, ""); }; AbstractMathQuill.prototype.reflow = function () { this.__controller.root.postOrder(function (node) { @@ -2229,11 +2154,11 @@ export default function() { return this; }; return AbstractMathQuill; - }(Progenote)); + })(Progenote); var EditableField = /** @class */ (function (_super) { __extends(EditableField, _super); function EditableField() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } EditableField.prototype.mathquillify = function (classNames) { _super.prototype.mathquillify.call(this, classNames); @@ -2255,21 +2180,22 @@ export default function() { this.__controller.writeLatex(latex); this.__controller.scrollHoriz(); var cursor = this.__controller.cursor; - if (this.__controller.blurred) - cursor.hide().parent.blur(cursor); + if (this.__controller.blurred) cursor.hide().parent.blur(cursor); return this; }; EditableField.prototype.empty = function () { var _c; - var root = this.__controller.root, cursor = this.__controller.cursor; - root.setEnds((_c = {}, _c[L] = 0, _c[R] = 0, _c)); + var root = this.__controller.root, + cursor = this.__controller.cursor; + root.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); root.domFrag().empty(); delete cursor.selection; cursor.insAtRightEnd(root); return this; }; EditableField.prototype.cmd = function (cmd) { - var ctrlr = this.__controller.notify(undefined), cursor = ctrlr.cursor; + var ctrlr = this.__controller.notify(undefined), + cursor = ctrlr.cursor; if (/^\\[a-z]+$/i.test(cmd) && !cursor.isTooDeep()) { cmd = cmd.slice(1); var klass = LatexCmds[cmd]; @@ -2277,22 +2203,15 @@ export default function() { if (klass) { if (klass.constructor) { node = new klass(cmd); - } - else { + } else { node = klass(cmd); } - if (cursor.selection) - node.replaces(cursor.replaceSelection()); + if (cursor.selection) node.replaces(cursor.replaceSelection()); node.createLeftOf(cursor.show()); - } /* TODO: API needs better error reporting */ - else - ; - } - else - cursor.parent.write(cursor, cmd); + } /* TODO: API needs better error reporting */ else; + } else cursor.parent.write(cursor, cmd); ctrlr.scrollHoriz(); - if (ctrlr.blurred) - cursor.hide().parent.blur(cursor); + if (ctrlr.blurred) cursor.hide().parent.blur(cursor); return this; }; EditableField.prototype.select = function () { @@ -2304,9 +2223,7 @@ export default function() { return this; }; EditableField.prototype.moveToDirEnd = function (dir) { - this.__controller - .notify('move') - .cursor.insAtDirEnd(dir, this.__controller.root); + this.__controller.notify("move").cursor.insAtDirEnd(dir, this.__controller.root); return this; }; EditableField.prototype.moveToLeftEnd = function () { @@ -2316,15 +2233,14 @@ export default function() { return this.moveToDirEnd(R); }; EditableField.prototype.keystroke = function (keysString, evt) { - var keys = keysString.replace(/^\s+|\s+$/g, '').split(/\s+/); + var keys = keysString.replace(/^\s+|\s+$/g, "").split(/\s+/); for (var i = 0; i < keys.length; i += 1) { this.__controller.keystroke(keys[i], evt); } return this; }; EditableField.prototype.typedText = function (text) { - for (var i = 0; i < text.length; i += 1) - this.__controller.typedText(text.charAt(i)); + for (var i = 0; i < text.length; i += 1) this.__controller.typedText(text.charAt(i)); return this; }; EditableField.prototype.dropEmbedded = function (pageX, pageY, options) { @@ -2344,13 +2260,12 @@ export default function() { }; EditableField.prototype.clickAt = function (clientX, clientY, target) { target = target || document.elementFromPoint(clientX, clientY); - var ctrlr = this.__controller, root = ctrlr.root; + var ctrlr = this.__controller, + root = ctrlr.root; var rootElement = root.domFrag().oneElement(); - if (!rootElement.contains(target)) - target = rootElement; + if (!rootElement.contains(target)) target = rootElement; ctrlr.seek(target, clientX, clientY); - if (ctrlr.blurred) - this.focus(); + if (ctrlr.blurred) this.focus(); return this; }; EditableField.prototype.ignoreNextMousedown = function (fn) { @@ -2358,16 +2273,16 @@ export default function() { return this; }; return EditableField; - }(AbstractMathQuill)); + })(AbstractMathQuill); var APIClasses = { AbstractMathQuill: AbstractMathQuill, EditableField: EditableField, }; - pray('API.StaticMath defined', API.StaticMath); + pray("API.StaticMath defined", API.StaticMath); APIClasses.StaticMath = API.StaticMath(APIClasses); - pray('API.MathField defined', API.MathField); + pray("API.MathField defined", API.MathField); APIClasses.MathField = API.MathField(APIClasses); - pray('API.InnerMathField defined', API.InnerMathField); + pray("API.InnerMathField defined", API.InnerMathField); APIClasses.InnerMathField = API.InnerMathField(APIClasses); if (API.TextField) { APIClasses.TextField = API.TextField(APIClasses); @@ -2382,14 +2297,13 @@ export default function() { * */ var MQ = function (el) { - if (!el || !el.nodeType) - return null; // check that `el` is a HTML element, using the + if (!el || !el.nodeType) return null; // check that `el` is a HTML element, using the // same technique as jQuery: https://github.com/jquery/jquery/blob/679536ee4b7a92ae64a5f58d90e9cc38c001e807/src/core/init.js#L92 var blockElement; var childArray = domFrag(el).children().toElementArray(); for (var _i = 0, childArray_1 = childArray; _i < childArray_1.length; _i++) { var child = childArray_1[_i]; - if (child.classList.contains('dcg-mq-root-block')) { + if (child.classList.contains("dcg-mq-root-block")) { blockElement = child; break; } @@ -2407,7 +2321,7 @@ export default function() { }; MQ.registerEmbed = function (name, options) { if (!/^[a-z][a-z0-9]*$/i.test(name)) { - throw 'Embed name must start with letter and be only letters and digits'; + throw "Embed name must start with letter and be only letters and digits"; } EMBEDS[name] = options; }; @@ -2416,11 +2330,11 @@ export default function() { * of each class. If the element had already been MathQuill-ified but into a * different kind (or it's not an HTML element), return null. */ - MQ.StaticMath = createEntrypoint('StaticMath', APIClasses.StaticMath); - MQ.MathField = createEntrypoint('MathField', APIClasses.MathField); - MQ.InnerMathField = createEntrypoint('InnerMathField', APIClasses.InnerMathField); + MQ.StaticMath = createEntrypoint("StaticMath", APIClasses.StaticMath); + MQ.MathField = createEntrypoint("MathField", APIClasses.MathField); + MQ.InnerMathField = createEntrypoint("InnerMathField", APIClasses.InnerMathField); if (APIClasses.TextField) { - MQ.TextField = createEntrypoint('TextField', APIClasses.TextField); + MQ.TextField = createEntrypoint("TextField", APIClasses.TextField); } MQ.prototype = AbstractMathQuill.prototype; MQ.EditableField = function () { @@ -2431,13 +2345,11 @@ export default function() { MQ.saneKeyboardEvents = defaultSubstituteKeyboardEvents; } function createEntrypoint(kind, APIClass) { - pray(kind + ' is defined', APIClass); + pray(kind + " is defined", APIClass); function mqEntrypoint(el, opts) { - if (!el || !el.nodeType) - return null; + if (!el || !el.nodeType) return null; var mq = MQ(el); - if (mq instanceof APIClass) - return mq; + if (mq instanceof APIClass) return mq; var ctrlr = new Controller(new APIClass.RootBlock(), el, new BaseOptions(version)); ctrlr.KIND_OF_MQ = kind; return new APIClass(ctrlr).__mathquillify(opts || {}, version); @@ -2455,42 +2367,41 @@ export default function() { window.MathQuill = MathQuill; function RootBlockMixin(_) { _.moveOutOf = function (dir) { - pray('controller is defined', this.controller); - this.controller.handle('moveOutOf', dir); + pray("controller is defined", this.controller); + this.controller.handle("moveOutOf", dir); }; _.deleteOutOf = function (dir) { - pray('controller is defined', this.controller); - this.controller.handle('deleteOutOf', dir); + pray("controller is defined", this.controller); + this.controller.handle("deleteOutOf", dir); }; _.selectOutOf = function (dir) { - pray('controller is defined', this.controller); - this.controller.handle('selectOutOf', dir); + pray("controller is defined", this.controller); + this.controller.handle("selectOutOf", dir); }; _.upOutOf = function () { - pray('controller is defined', this.controller); - this.controller.handle('upOutOf'); + pray("controller is defined", this.controller); + this.controller.handle("upOutOf"); return undefined; }; _.downOutOf = function () { - pray('controller is defined', this.controller); - this.controller.handle('downOutOf'); + pray("controller is defined", this.controller); + this.controller.handle("downOutOf"); return undefined; }; _.reflow = function () { - pray('controller is defined', this.controller); - this.controller.handle('reflow'); - this.controller.handle('edited'); - this.controller.handle('edit'); + pray("controller is defined", this.controller); + this.controller.handle("reflow"); + this.controller.handle("edited"); + this.controller.handle("edit"); }; } function parseError(stream, message) { if (stream) { stream = "'" + stream + "'"; + } else { + stream = "EOF"; } - else { - stream = 'EOF'; - } - throw 'Parse Error: ' + message + ' at ' + stream; + throw "Parse Error: " + message + " at " + stream; } var Parser = /** @class */ (function () { // The Parser object is a wrapper for a parser function. @@ -2503,14 +2414,14 @@ export default function() { this._ = body; } Parser.prototype.parse = function (stream) { - return this.skip(Parser.eof)._('' + stream, success, parseError); + return this.skip(Parser.eof)._("" + stream, success, parseError); function success(_stream, result) { return result; } }; // -*- primitive combinators -*- // Parser.prototype.or = function (alternative) { - pray('or is passed a parser', alternative instanceof Parser); + pray("or is passed a parser", alternative instanceof Parser); var self = this; return new Parser(function (stream, onSuccess, onFailure) { return self._(stream, onSuccess, failure); @@ -2525,7 +2436,7 @@ export default function() { return self._(stream, success, onFailure); function success(newStream, result) { var nextParser = next instanceof Parser ? next : next(result); - pray('a parser is returned', nextParser instanceof Parser); + pray("a parser is returned", nextParser instanceof Parser); return nextParser._(newStream, onSuccess, onFailure); } }); @@ -2535,8 +2446,7 @@ export default function() { var self = this; return new Parser(function (stream, onSuccess, _onFailure) { var xs = []; - while (self._(stream, success, failure)) - ; + while (self._(stream, success, failure)); return onSuccess(stream, xs); function success(newStream, x) { stream = newStream; @@ -2549,8 +2459,7 @@ export default function() { }); }; Parser.prototype.times = function (min, max) { - if (arguments.length < 2) - max = min; + if (arguments.length < 2) max = min; var self = this; return new Parser(function (stream, onSuccess, onFailure) { var xs = []; @@ -2560,8 +2469,7 @@ export default function() { // TODO, this may be incorrect for parsers that return boolean // (or generally, falsey) values result = !!self._(stream, success, firstFailure); - if (!result) - return onFailure(stream, failure); + if (!result) return onFailure(stream, failure); } for (; i < max && result; i += 1) { self._(stream, success, secondFailure); @@ -2615,22 +2523,20 @@ export default function() { var head = stream.slice(0, len); if (head === str) { return onSuccess(stream.slice(len), head); - } - else { + } else { return onFailure(stream, expected); } }); }; Parser.regex = function (re) { - pray('regexp parser is anchored', re.toString().charAt(1) === '^'); - var expected = 'expected ' + re; + pray("regexp parser is anchored", re.toString().charAt(1) === "^"); + var expected = "expected " + re; return new Parser(function (stream, onSuccess, onFailure) { var match = re.exec(stream); if (match) { var result = match[0]; return onSuccess(stream.slice(result.length), result); - } - else { + } else { return onFailure(stream, expected); } }); @@ -2652,20 +2558,18 @@ export default function() { Parser.whitespace = Parser.regex(/^\s+/); Parser.optWhitespace = Parser.regex(/^\s*/); Parser.any = new Parser(function (stream, onSuccess, onFailure) { - if (!stream) - return onFailure(stream, 'expected any character'); + if (!stream) return onFailure(stream, "expected any character"); return onSuccess(stream.slice(1), stream.charAt(0)); }); Parser.all = new Parser(function (stream, onSuccess, _onFailure) { - return onSuccess('', stream); + return onSuccess("", stream); }); Parser.eof = new Parser(function (stream, onSuccess, onFailure) { - if (stream) - return onFailure(stream, 'expected EOF'); + if (stream) return onFailure(stream, "expected EOF"); return onSuccess(stream, stream); }); return Parser; - }()); + })(); /** Poller that fires once every tick. */ var EveryTick = /** @class */ (function () { function EveryTick() { @@ -2699,7 +2603,7 @@ export default function() { this.fn.apply(this, args); }; return EveryTick; - }()); + })(); /************************************************* * Sane Keyboard Events Shim * @@ -2725,51 +2629,51 @@ export default function() { // [2]: http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120614/#fixed-virtual-key-codes // [3]: http://unixpapa.com/js/key.html var WHICH_TO_MQ_KEY_STEM = { - 8: 'Backspace', - 9: 'Tab', - 10: 'Enter', - 13: 'Enter', - 16: 'Shift', - 17: 'Control', - 18: 'Alt', - 20: 'CapsLock', - 27: 'Esc', - 32: 'Spacebar', - 33: 'PageUp', - 34: 'PageDown', - 35: 'End', - 36: 'Home', - 37: 'Left', - 38: 'Up', - 39: 'Right', - 40: 'Down', - 45: 'Insert', - 46: 'Del', - 144: 'NumLock', + 8: "Backspace", + 9: "Tab", + 10: "Enter", + 13: "Enter", + 16: "Shift", + 17: "Control", + 18: "Alt", + 20: "CapsLock", + 27: "Esc", + 32: "Spacebar", + 33: "PageUp", + 34: "PageDown", + 35: "End", + 36: "Home", + 37: "Left", + 38: "Up", + 39: "Right", + 40: "Down", + 45: "Insert", + 46: "Del", + 144: "NumLock", }; var KEY_TO_MQ_KEY_STEM = { - ArrowRight: 'Right', - ArrowLeft: 'Left', - ArrowDown: 'Down', - ArrowUp: 'Up', - Delete: 'Del', - Escape: 'Esc', - ' ': 'Spacebar', + ArrowRight: "Right", + ArrowLeft: "Left", + ArrowDown: "Down", + ArrowUp: "Up", + Delete: "Del", + Escape: "Esc", + " ": "Spacebar", }; function isArrowKey(e) { // The keyPress event in FF reports which=0 for some reason. The new // .key property seems to report reasonable results, so we're using that switch (getMQKeyStem(e)) { - case 'Right': - case 'Left': - case 'Down': - case 'Up': + case "Right": + case "Left": + case "Down": + case "Up": return true; } return false; } function isLowercaseAlphaCharacter(s) { - return s.length === 1 && s >= 'a' && s <= 'z'; + return s.length === 1 && s >= "a" && s <= "z"; } function getMQKeyStem(evt) { var _c; @@ -2780,8 +2684,7 @@ export default function() { var which = evt.which || evt.keyCode; return WHICH_TO_MQ_KEY_STEM[which] || String.fromCharCode(which); } - if (isLowercaseAlphaCharacter(evt.key)) - return evt.key.toUpperCase(); + if (isLowercaseAlphaCharacter(evt.key)) return evt.key.toUpperCase(); return (_c = KEY_TO_MQ_KEY_STEM[evt.key]) !== null && _c !== void 0 ? _c : evt.key; } /** To the extent possible, create a normalized string representation @@ -2789,22 +2692,19 @@ export default function() { function getMQKeyName(evt) { var key = getMQKeyStem(evt); var modifiers = []; - if (evt.ctrlKey) - modifiers.push('Ctrl'); - if (evt.metaKey) - modifiers.push('Meta'); - if (evt.altKey) - modifiers.push('Alt'); - if (evt.shiftKey) - modifiers.push('Shift'); - if (!modifiers.length) - return key; + if (evt.ctrlKey) modifiers.push("Ctrl"); + if (evt.metaKey) modifiers.push("Meta"); + if (evt.altKey) modifiers.push("Alt"); + if (evt.shiftKey) modifiers.push("Shift"); + if (!modifiers.length) return key; modifiers.push(key); - return modifiers.join('-'); + return modifiers.join("-"); } return function saneKeyboardEvents( - /** Usually the textarea associated with a MQ instance, but can be another kind of element if `substituteTextarea` was used to replace it with something else. */ - textarea, controller) { + /** Usually the textarea associated with a MQ instance, but can be another kind of element if `substituteTextarea` was used to replace it with something else. */ + textarea, + controller + ) { var keydown = null; var keypress = null; // everyTick.listen() is called after key or clipboard events to @@ -2823,10 +2723,8 @@ export default function() { // likely that we don't really care if the selection // fails to happen in this case. Why would the textarea // be hidden? And who would even be able to tell? - if (textarea instanceof HTMLTextAreaElement) - textarea.select(); - } - catch (e) { } + if (textarea instanceof HTMLTextAreaElement) textarea.select(); + } catch (e) {} } // -*- public methods -*- // function select(text) { @@ -2835,10 +2733,8 @@ export default function() { // before checkTextarea), then never again ('cos it's been munged) everyTick.trigger(); everyTick.clearListener(); - if (textarea instanceof HTMLTextAreaElement) - textarea.value = text; - if (text) - guardedTextareaSelect(); + if (textarea instanceof HTMLTextAreaElement) textarea.value = text; + if (text) guardedTextareaSelect(); shouldBeSelected = !!text; } var shouldBeSelected = false; @@ -2847,30 +2743,26 @@ export default function() { // This will always return false in IE < 9, which don't support // HTMLTextareaElement::selection{Start,End}. function hasSelection() { - if (!('selectionStart' in textarea)) - return false; - if (!(textarea instanceof HTMLTextAreaElement)) - return false; + if (!("selectionStart" in textarea)) return false; + if (!(textarea instanceof HTMLTextAreaElement)) return false; return textarea.selectionStart !== textarea.selectionEnd; } function handleKey() { if (controller.options && controller.options.overrideKeystroke) { controller.options.overrideKeystroke(getMQKeyName(keydown), keydown); - } - else { + } else { controller.keystroke(getMQKeyName(keydown), keydown); } } // -*- event handlers -*- // function onKeydown(e) { everyTick.trigger(e); - if (e.target !== textarea) - return; + if (e.target !== textarea) return; keydown = e; keypress = null; if (shouldBeSelected) everyTick.listenOnce(function (e) { - if (!(e && e.type === 'focusout')) { + if (!(e && e.type === "focusout")) { // re-select textarea in case it's an unrecognized key that clears // the selection, then never again, 'cos next thing might be blur guardedTextareaSelect(); @@ -2880,14 +2772,12 @@ export default function() { } function onKeypress(e) { everyTick.trigger(e); - if (e.target !== textarea) - return; + if (e.target !== textarea) return; // call the key handler for repeated keypresses. // This excludes keypresses that happen directly // after keydown. In that case, there will be // no previous keypress, so we skip it here - if (keydown && keypress) - handleKey(); + if (keydown && keypress) handleKey(); keypress = e; // only check for typed text if this key can type text. Otherwise // you can end up with mathquill thinking text was typed if you @@ -2895,15 +2785,13 @@ export default function() { // is selected. Only detected in FF. if (!isArrowKey(e)) { everyTick.listen(typedText); - } - else { + } else { everyTick.listenOnce(maybeReselect); } } function onKeyup(e) { everyTick.trigger(e); - if (e.target !== textarea) - return; + if (e.target !== textarea) return; // Handle case of no keypress event being sent if (!!keydown && !keypress) { // only check for typed text if this key can type text. Otherwise @@ -2912,8 +2800,7 @@ export default function() { // is selected. Only detected in FF. if (!isArrowKey(e)) { everyTick.listen(typedText); - } - else { + } else { everyTick.listenOnce(maybeReselect); } } @@ -2936,27 +2823,22 @@ export default function() { // reliable as our tests are comprehensive // If anything like #40 or #71 is reported in IE < 9, see // b1318e5349160b665003e36d4eedd64101ceacd8 - if (hasSelection()) - return; - if (!(textarea instanceof HTMLTextAreaElement)) - return; + if (hasSelection()) return; + if (!(textarea instanceof HTMLTextAreaElement)) return; var text = textarea.value; if (text.length === 1) { - textarea.value = ''; + textarea.value = ""; if (controller.options && controller.options.overrideTypedText) { controller.options.overrideTypedText(text); - } - else { + } else { controller.typedText(text); } } // in Firefox, keys that don't type text, just clear seln, fire keypress // https://github.com/mathquill/mathquill/issues/293#issuecomment-40997668 - else - maybeReselect(); // re-select if that's why we're here + else maybeReselect(); // re-select if that's why we're here } function maybeReselect() { - if (!(textarea instanceof HTMLTextAreaElement)) - return; + if (!(textarea instanceof HTMLTextAreaElement)) return; if (textarea.value.length > 1) { guardedTextareaSelect(); } @@ -2965,13 +2847,11 @@ export default function() { keydown = null; keypress = null; everyTick.clearListener(); - if (textarea instanceof HTMLTextAreaElement) - textarea.value = ''; + if (textarea instanceof HTMLTextAreaElement) textarea.value = ""; } function onPaste(e) { everyTick.trigger(); - if (e.target !== textarea) - return; + if (e.target !== textarea) return; // browsers are dumb. // // In Linux, middle-click pasting causes onPaste to be called, @@ -2988,12 +2868,10 @@ export default function() { textarea.focus(); } everyTick.listen(function pastedText() { - if (!(textarea instanceof HTMLTextAreaElement)) - return; + if (!(textarea instanceof HTMLTextAreaElement)) return; var text = textarea.value; - textarea.value = ''; - if (text) - controller.paste(text); + textarea.value = ""; + if (text) controller.paste(text); }); } function onInput(e) { @@ -3017,8 +2895,7 @@ export default function() { }, input: onInput, }); - } - else { + } else { controller.addTextareaEventListeners({ keydown: onKeydown, keypress: onKeypress, @@ -3049,49 +2926,44 @@ export default function() { var Controller_exportText = /** @class */ (function (_super) { __extends(Controller_exportText, _super); function Controller_exportText() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } Controller_exportText.prototype.exportText = function () { - return this.root.foldChildren('', function (text, child) { + return this.root.foldChildren("", function (text, child) { return text + child.text(); }); }; return Controller_exportText; - }(ControllerBase)); + })(ControllerBase); ControllerBase.onNotify(function (cursor, e) { // these try to cover all ways that mathquill can be modified - if (e === 'edit' || e === 'replace' || e === undefined) { + if (e === "edit" || e === "replace" || e === undefined) { var controller = cursor.controller; - if (!controller) - return; - if (!controller.options.enableDigitGrouping) - return; + if (!controller) return; + if (!controller.options.enableDigitGrouping) return; // TODO - maybe reconsider these 3 states and drop down to only 2 // // blurred === false means we are focused. blurred === true or // blurred === undefined means we are not focused. - if (controller.blurred !== false) - return; + if (controller.blurred !== false) return; controller.disableGroupingForSeconds(1); } }); var Controller_focusBlur = /** @class */ (function (_super) { __extends(Controller_focusBlur, _super); function Controller_focusBlur() { - var _this_1 = _super !== null && _super.apply(this, arguments) || this; + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; _this_1.handleTextareaFocusEditable = function () { var cursor = _this_1.cursor; _this_1.updateMathspeak(); _this_1.blurred = false; clearTimeout(_this_1.blurTimeout); - domFrag(_this_1.container).addClass('dcg-mq-focused'); - if (!cursor.parent) - cursor.insAtRightEnd(_this_1.root); + domFrag(_this_1.container).addClass("dcg-mq-focused"); + if (!cursor.parent) cursor.insAtRightEnd(_this_1.root); if (cursor.selection) { - cursor.selection.domFrag().removeClass('dcg-mq-blur'); + cursor.selection.domFrag().removeClass("dcg-mq-blur"); _this_1.selectionChanged(); //re-select textarea contents after tabbing away and back - } - else { + } else { cursor.show(); } _this_1.setOverflowClasses(); @@ -3113,7 +2985,7 @@ export default function() { _this_1.updateMathspeak(); _this_1.scrollHoriz(); }); - window.addEventListener('blur', _this_1.handleWindowBlur); + window.addEventListener("blur", _this_1.handleWindowBlur); }; _this_1.handleTextareaFocusStatic = function () { _this_1.blurred = false; @@ -3131,8 +3003,7 @@ export default function() { _this_1.handleWindowBlur = function () { // blur event also fired on window, just switching clearTimeout(_this_1.blurTimeout); // tabs/windows, not intentional blur - if (_this_1.cursor.selection) - _this_1.cursor.selection.domFrag().addClass('dcg-mq-blur'); + if (_this_1.cursor.selection) _this_1.cursor.selection.domFrag().addClass("dcg-mq-blur"); _this_1.blur(); _this_1.updateMathspeak(); }; @@ -3142,26 +3013,26 @@ export default function() { var _this_1 = this; clearTimeout(this.__disableGroupingTimeout); if (seconds === 0) { - this.root.domFrag().removeClass('dcg-mq-suppress-grouping'); - } - else { - this.root.domFrag().addClass('dcg-mq-suppress-grouping'); + this.root.domFrag().removeClass("dcg-mq-suppress-grouping"); + } else { + this.root.domFrag().addClass("dcg-mq-suppress-grouping"); this.__disableGroupingTimeout = setTimeout(function () { - _this_1.root.domFrag().removeClass('dcg-mq-suppress-grouping'); + _this_1.root.domFrag().removeClass("dcg-mq-suppress-grouping"); }, seconds * 1000); } }; Controller_focusBlur.prototype.blur = function () { // not directly in the textarea blur handler so as to be this.cursor.hide().parent.blur(this.cursor); // synchronous with/in the same frame as - domFrag(this.container).removeClass('dcg-mq-focused'); // clearing/blurring selection - window.removeEventListener('blur', this.handleWindowBlur); + domFrag(this.container).removeClass("dcg-mq-focused"); // clearing/blurring selection + window.removeEventListener("blur", this.handleWindowBlur); if (this.options && this.options.resetCursorOnBlur) { this.cursor.resetToEnd(this); } }; Controller_focusBlur.prototype.addEditableFocusBlurListeners = function () { - var ctrlr = this, cursor = ctrlr.cursor; + var ctrlr = this, + cursor = ctrlr.cursor; this.addTextareaEventListeners({ focus: this.handleTextareaFocusEditable, blur: this.handleTextareaBlurEditable, @@ -3176,7 +3047,7 @@ export default function() { }); }; return Controller_focusBlur; - }(Controller_exportText)); + })(Controller_exportText); /** * TODO: I wanted to move MathBlock::focus and blur here, it would clean * up lots of stuff like, TextBlock::focus is set to MathBlock::focus @@ -3204,174 +3075,158 @@ export default function() { var MQNode = /** @class */ (function (_super) { __extends(MQNode, _super); function MQNode() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } MQNode.prototype.keystroke = function (key, e, ctrlr) { var cursor = ctrlr.cursor; switch (key) { - case 'Ctrl-Shift-Backspace': - case 'Ctrl-Backspace': + case "Ctrl-Shift-Backspace": + case "Ctrl-Backspace": ctrlr.ctrlDeleteDir(L); break; - case 'Shift-Backspace': - case 'Backspace': + case "Shift-Backspace": + case "Backspace": ctrlr.backspace(); break; // Tab or Esc -> go one block right if it exists, else escape right. - case 'Esc': - case 'Tab': + case "Esc": + case "Tab": ctrlr.escapeDir(R, key, e); return; // Shift-Tab -> go one block left if it exists, else escape left. - case 'Shift-Tab': - case 'Shift-Esc': + case "Shift-Tab": + case "Shift-Esc": ctrlr.escapeDir(L, key, e); return; // End -> move to the end of the current block. - case 'End': - ctrlr.notify('move').cursor.insAtRightEnd(cursor.parent); - ctrlr.aria.queue('end of').queue(cursor.parent, true); + case "End": + ctrlr.notify("move").cursor.insAtRightEnd(cursor.parent); + ctrlr.aria.queue("end of").queue(cursor.parent, true); break; // Ctrl-End -> move all the way to the end of the root block. - case 'Ctrl-End': - ctrlr.notify('move').cursor.insAtRightEnd(ctrlr.root); - ctrlr.aria - .queue('end of') - .queue(ctrlr.ariaLabel) - .queue(ctrlr.root) - .queue(ctrlr.ariaPostLabel); + case "Ctrl-End": + ctrlr.notify("move").cursor.insAtRightEnd(ctrlr.root); + ctrlr.aria.queue("end of").queue(ctrlr.ariaLabel).queue(ctrlr.root).queue(ctrlr.ariaPostLabel); break; // Shift-End -> select to the end of the current block. - case 'Shift-End': + case "Shift-End": ctrlr.selectToBlockEndInDir(R); break; // Ctrl-Shift-End -> select all the way to the end of the root block. - case 'Ctrl-Shift-End': + case "Ctrl-Shift-End": ctrlr.selectToRootEndInDir(R); break; // Home -> move to the start of the current block. - case 'Home': - ctrlr.notify('move').cursor.insAtLeftEnd(cursor.parent); - ctrlr.aria.queue('beginning of').queue(cursor.parent, true); + case "Home": + ctrlr.notify("move").cursor.insAtLeftEnd(cursor.parent); + ctrlr.aria.queue("beginning of").queue(cursor.parent, true); break; // Ctrl-Home -> move all the way to the start of the root block. - case 'Ctrl-Home': - ctrlr.notify('move').cursor.insAtLeftEnd(ctrlr.root); + case "Ctrl-Home": + ctrlr.notify("move").cursor.insAtLeftEnd(ctrlr.root); ctrlr.aria - .queue('beginning of') + .queue("beginning of") .queue(ctrlr.ariaLabel) .queue(ctrlr.root) .queue(ctrlr.ariaPostLabel); break; // Shift-Home -> select to the start of the current block. - case 'Shift-Home': + case "Shift-Home": ctrlr.selectToBlockEndInDir(L); break; // Ctrl-Shift-Home -> select all the way to the start of the root block. - case 'Ctrl-Shift-Home': + case "Ctrl-Shift-Home": ctrlr.selectToRootEndInDir(L); break; - case 'Left': + case "Left": ctrlr.moveLeft(); break; - case 'Shift-Left': + case "Shift-Left": ctrlr.selectLeft(); break; - case 'Ctrl-Left': + case "Ctrl-Left": break; - case 'Right': + case "Right": ctrlr.moveRight(); break; - case 'Shift-Right': + case "Shift-Right": ctrlr.selectRight(); break; - case 'Ctrl-Right': + case "Ctrl-Right": break; - case 'Up': + case "Up": ctrlr.moveUp(); break; - case 'Down': + case "Down": ctrlr.moveDown(); break; - case 'Shift-Up': + case "Shift-Up": ctrlr.withIncrementalSelection(function (selectDir) { if (cursor[L]) { - while (cursor[L]) - selectDir(L); - } - else { + while (cursor[L]) selectDir(L); + } else { selectDir(L); } }); break; - case 'Shift-Down': + case "Shift-Down": ctrlr.withIncrementalSelection(function (selectDir) { if (cursor[R]) { - while (cursor[R]) - selectDir(R); - } - else { + while (cursor[R]) selectDir(R); + } else { selectDir(R); } }); break; - case 'Ctrl-Up': + case "Ctrl-Up": break; - case 'Ctrl-Down': + case "Ctrl-Down": break; - case 'Ctrl-Shift-Del': - case 'Ctrl-Del': + case "Ctrl-Shift-Del": + case "Ctrl-Del": ctrlr.ctrlDeleteDir(R); break; - case 'Shift-Del': - case 'Del': + case "Shift-Del": + case "Del": ctrlr.deleteForward(); break; - case 'Meta-A': - case 'Ctrl-A': + case "Meta-A": + case "Ctrl-A": ctrlr.selectAll(); break; // These remaining hotkeys are only of benefit to people running screen readers. - case 'Ctrl-Alt-Up': // speak parent block that has focus + case "Ctrl-Alt-Up": // speak parent block that has focus if (cursor.parent.parent && cursor.parent.parent instanceof MQNode) ctrlr.aria.queue(cursor.parent.parent); - else - ctrlr.aria.queue('nothing above'); + else ctrlr.aria.queue("nothing above"); break; - case 'Ctrl-Alt-Down': // speak current block that has focus - if (cursor.parent && cursor.parent instanceof MQNode) - ctrlr.aria.queue(cursor.parent); - else - ctrlr.aria.queue('block is empty'); + case "Ctrl-Alt-Down": // speak current block that has focus + if (cursor.parent && cursor.parent instanceof MQNode) ctrlr.aria.queue(cursor.parent); + else ctrlr.aria.queue("block is empty"); break; - case 'Ctrl-Alt-Left': // speak left-adjacent block + case "Ctrl-Alt-Left": // speak left-adjacent block if (cursor.parent.parent && cursor.parent.parent.getEnd(L)) { ctrlr.aria.queue(cursor.parent.parent.getEnd(L)); - } - else { - ctrlr.aria.queue('nothing to the left'); + } else { + ctrlr.aria.queue("nothing to the left"); } break; - case 'Ctrl-Alt-Right': // speak right-adjacent block + case "Ctrl-Alt-Right": // speak right-adjacent block if (cursor.parent.parent && cursor.parent.parent.getEnd(R)) { ctrlr.aria.queue(cursor.parent.parent.getEnd(R)); - } - else { - ctrlr.aria.queue('nothing to the right'); + } else { + ctrlr.aria.queue("nothing to the right"); } break; - case 'Ctrl-Alt-Shift-Down': // speak selection + case "Ctrl-Alt-Shift-Down": // speak selection if (cursor.selection) - ctrlr.aria.queue(cursor.selection.join('mathspeak', ' ').trim() + ' selected'); - else - ctrlr.aria.queue('nothing selected'); + ctrlr.aria.queue(cursor.selection.join("mathspeak", " ").trim() + " selected"); + else ctrlr.aria.queue("nothing selected"); break; - case 'Ctrl-Alt-=': - case 'Ctrl-Alt-Shift-Right': // speak ARIA post label (evaluation or error) - if (ctrlr.ariaPostLabel.length) - ctrlr.aria.queue(ctrlr.ariaPostLabel); - else - ctrlr.aria.queue('no answer'); + case "Ctrl-Alt-=": + case "Ctrl-Alt-Shift-Right": // speak ARIA post label (evaluation or error) + if (ctrlr.ariaPostLabel.length) ctrlr.aria.queue(ctrlr.ariaPostLabel); + else ctrlr.aria.queue("no answer"); break; default: return; @@ -3381,57 +3236,50 @@ export default function() { ctrlr.scrollHoriz(); }; MQNode.prototype.moveOutOf = function (_dir, _cursor, _updown) { - pray('overridden or never called on this node', false); + pray("overridden or never called on this node", false); }; // called by Controller::escapeDir, moveDir MQNode.prototype.moveTowards = function (_dir, _cursor, _updown) { - pray('overridden or never called on this node', false); + pray("overridden or never called on this node", false); }; // called by Controller::moveDir MQNode.prototype.deleteOutOf = function (_dir, _cursor) { - pray('overridden or never called on this node', false); + pray("overridden or never called on this node", false); }; // called by Controller::deleteDir MQNode.prototype.deleteTowards = function (_dir, _cursor) { - pray('overridden or never called on this node', false); + pray("overridden or never called on this node", false); }; // called by Controller::deleteDir MQNode.prototype.unselectInto = function (_dir, _cursor) { - pray('overridden or never called on this node', false); + pray("overridden or never called on this node", false); }; // called by Controller::selectDir MQNode.prototype.selectOutOf = function (_dir, _cursor) { - pray('overridden or never called on this node', false); + pray("overridden or never called on this node", false); }; // called by Controller::selectDir MQNode.prototype.selectTowards = function (_dir, _cursor) { - pray('overridden or never called on this node', false); + pray("overridden or never called on this node", false); }; // called by Controller::selectDir return MQNode; - }(NodeBase)); + })(NodeBase); ControllerBase.onNotify(function (cursor, e) { - if (e === 'move' || e === 'upDown') - cursor.show().clearSelection(); + if (e === "move" || e === "upDown") cursor.show().clearSelection(); }); baseOptionProcessors.leftRightIntoCmdGoes = function (updown) { - if (updown && updown !== 'up' && updown !== 'down') { - throw ('"up" or "down" required for leftRightIntoCmdGoes option, ' + - 'got "' + - updown + - '"'); + if (updown && updown !== "up" && updown !== "down") { + throw '"up" or "down" required for leftRightIntoCmdGoes option, ' + 'got "' + updown + '"'; } return updown; }; ControllerBase.onNotify(function (cursor, e) { - if (e !== 'upDown') - cursor.upDownCache = {}; + if (e !== "upDown") cursor.upDownCache = {}; }); ControllerBase.onNotify(function (cursor, e) { - if (e === 'edit') - cursor.show().deleteSelection(); + if (e === "edit") cursor.show().deleteSelection(); }); ControllerBase.onNotify(function (cursor, e) { - if (e !== 'select') - cursor.endSelection(); + if (e !== "select") cursor.endSelection(); }); var Controller_keystroke = /** @class */ (function (_super) { __extends(Controller_keystroke, _super); function Controller_keystroke() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } Controller_keystroke.prototype.keystroke = function (key, evt) { this.cursor.parent.keystroke(key, evt, this.getControllerSelf()); @@ -3440,29 +3288,25 @@ export default function() { prayDirection(dir); var cursor = this.cursor; // only prevent default of Tab if not in the root editable - if (cursor.parent !== this.root) - e === null || e === void 0 ? void 0 : e.preventDefault(); + if (cursor.parent !== this.root) e === null || e === void 0 ? void 0 : e.preventDefault(); // want to be a noop if in the root editable (in fact, Tab has an unrelated // default browser action if so) - if (cursor.parent === this.root) - return; + if (cursor.parent === this.root) return; cursor.clearSelection(); cursor.parent.moveOutOf(dir, cursor); cursor.controller.aria.alert(); - return this.notify('move'); + return this.notify("move"); }; Controller_keystroke.prototype.moveDir = function (dir) { prayDirection(dir); - var cursor = this.cursor, updown = cursor.options.leftRightIntoCmdGoes; + var cursor = this.cursor, + updown = cursor.options.leftRightIntoCmdGoes; var cursorDir = cursor[dir]; if (cursor.selection) { cursor.insDirOf(dir, cursor.selection.getEnd(dir)); - } - else if (cursorDir) - cursorDir.moveTowards(dir, cursor, updown); - else - cursor.parent.moveOutOf(dir, cursor, updown); - return this.notify('move'); + } else if (cursorDir) cursorDir.moveTowards(dir, cursor, updown); + else cursor.parent.moveOutOf(dir, cursor, updown); + return this.notify("move"); }; Controller_keystroke.prototype.moveLeft = function () { return this.moveDir(L); @@ -3483,43 +3327,37 @@ export default function() { * + unless it's exactly `true`, stop bubbling */ Controller_keystroke.prototype.moveUp = function () { - return this.moveUpDown('up'); + return this.moveUpDown("up"); }; Controller_keystroke.prototype.moveDown = function () { - return this.moveUpDown('down'); + return this.moveUpDown("down"); }; Controller_keystroke.prototype.moveUpDown = function (dir) { var self = this; - var cursor = self.notify('upDown').cursor; + var cursor = self.notify("upDown").cursor; var dirInto; var dirOutOf; - if (dir === 'up') { - dirInto = 'upInto'; - dirOutOf = 'upOutOf'; - } - else { - dirInto = 'downInto'; - dirOutOf = 'downOutOf'; + if (dir === "up") { + dirInto = "upInto"; + dirOutOf = "upOutOf"; + } else { + dirInto = "downInto"; + dirOutOf = "downOutOf"; } var cursorL = cursor[L]; var cursorR = cursor[R]; var cursorR_dirInto = cursorR && cursorR[dirInto]; var cursorL_dirInto = cursorL && cursorL[dirInto]; - if (cursorR_dirInto) - cursor.insAtLeftEnd(cursorR_dirInto); - else if (cursorL_dirInto) - cursor.insAtRightEnd(cursorL_dirInto); + if (cursorR_dirInto) cursor.insAtLeftEnd(cursorR_dirInto); + else if (cursorL_dirInto) cursor.insAtRightEnd(cursorL_dirInto); else { cursor.parent.bubble(function (ancestor) { // TODO - revist this var prop = ancestor[dirOutOf]; if (prop) { - if (typeof prop === 'function') - prop = prop.call(ancestor, cursor); // TODO - figure out if we need to assign to prop - if (prop instanceof MQNode) - cursor.jumpUpDown(ancestor, prop); - if (prop !== true) - return false; // TODO - figure out how this can return true + if (typeof prop === "function") prop = prop.call(ancestor, cursor); // TODO - figure out if we need to assign to prop + if (prop instanceof MQNode) cursor.jumpUpDown(ancestor, prop); + if (prop !== true) return false; // TODO - figure out how this can return true } return undefined; }); @@ -3534,53 +3372,44 @@ export default function() { var ctrlr = cursor.controller; if (cursorEl && cursorEl instanceof MQNode) { if (cursorEl.sides) { - ctrlr.aria.queue(cursorEl.parent - .chToCmd(cursorEl.sides[-dir].ch) - .mathspeak({ createdLeftOf: cursor })); + ctrlr.aria.queue( + cursorEl.parent.chToCmd(cursorEl.sides[-dir].ch).mathspeak({ createdLeftOf: cursor }) + ); // generally, speak the current element if it has no blocks, // but don't for text block commands as the deleteTowards method // in the TextCommand class is responsible for speaking the new character under the cursor. - } - else if (!cursorEl.blocks && cursorEl.parent.ctrlSeq !== '\\text') { + } else if (!cursorEl.blocks && cursorEl.parent.ctrlSeq !== "\\text") { ctrlr.aria.queue(cursorEl); } - } - else if (cursorElParent && cursorElParent instanceof MQNode) { + } else if (cursorElParent && cursorElParent instanceof MQNode) { if (cursorElParent.sides) { - ctrlr.aria.queue(cursorElParent.parent - .chToCmd(cursorElParent.sides[dir].ch) - .mathspeak({ createdLeftOf: cursor })); - } - else if (cursorElParent.blocks && cursorElParent.mathspeakTemplate) { + ctrlr.aria.queue( + cursorElParent.parent.chToCmd(cursorElParent.sides[dir].ch).mathspeak({ createdLeftOf: cursor }) + ); + } else if (cursorElParent.blocks && cursorElParent.mathspeakTemplate) { if (cursorElParent.upInto && cursorElParent.downInto) { // likely a fraction, and we just backspaced over the slash ctrlr.aria.queue(cursorElParent.mathspeakTemplate[1]); - } - else { + } else { var mst = cursorElParent.mathspeakTemplate; var textToQueue = dir === L ? mst[0] : mst[mst.length - 1]; ctrlr.aria.queue(textToQueue); } - } - else { + } else { ctrlr.aria.queue(cursorElParent); } } var hadSelection = cursor.selection; - this.notify('edit'); // deletes selection if present + this.notify("edit"); // deletes selection if present if (!hadSelection) { var cursorDir = cursor[dir]; - if (cursorDir) - cursorDir.deleteTowards(dir, cursor); - else - cursor.parent.deleteOutOf(dir, cursor); + if (cursorDir) cursorDir.deleteTowards(dir, cursor); + else cursor.parent.deleteOutOf(dir, cursor); } var cursorL = cursor[L]; var cursorR = cursor[R]; - if (cursorL.siblingDeleted) - cursorL.siblingDeleted(cursor.options, R); - if (cursorR.siblingDeleted) - cursorR.siblingDeleted(cursor.options, L); + if (cursorL.siblingDeleted) cursorL.siblingDeleted(cursor.options, R); + if (cursorR.siblingDeleted) cursorR.siblingDeleted(cursor.options, L); cursor.parent.bubble(function (node) { node.reflow(); return undefined; @@ -3590,14 +3419,12 @@ export default function() { Controller_keystroke.prototype.ctrlDeleteDir = function (dir) { prayDirection(dir); var cursor = this.cursor; - if (!cursor[dir] || cursor.selection) - return this.deleteDir(dir); - this.notify('edit'); + if (!cursor[dir] || cursor.selection) return this.deleteDir(dir); + this.notify("edit"); var fragRemoved; if (dir === L) { fragRemoved = new Fragment(cursor.parent.getEnd(L), cursor[L]); - } - else { + } else { fragRemoved = new Fragment(cursor[R], cursor.parent.getEnd(R)); } cursor.controller.aria.queue(fragRemoved); @@ -3605,10 +3432,8 @@ export default function() { cursor.insAtDirEnd(dir, cursor.parent); var cursorL = cursor[L]; var cursorR = cursor[R]; - if (cursorL) - cursorL.siblingDeleted(cursor.options, R); - if (cursorR) - cursorR.siblingDeleted(cursor.options, L); + if (cursorL) cursorL.siblingDeleted(cursor.options, R); + if (cursorR) cursorR.siblingDeleted(cursor.options, L); cursor.parent.bubble(function (node) { node.reflow(); return undefined; @@ -3629,10 +3454,9 @@ export default function() { Controller_keystroke.prototype.startIncrementalSelection = function () { pray("Multiple selections can't be simultaneously open", !INCREMENTAL_SELECTION_OPEN); INCREMENTAL_SELECTION_OPEN = true; - this.notify('select'); + this.notify("select"); var cursor = this.cursor; - if (!cursor.anticursor) - cursor.startSelection(); + if (!cursor.anticursor) cursor.startSelection(); }; /** * Update the selection model, stored in cursor, without modifying @@ -3643,25 +3467,20 @@ export default function() { * be called in sequence. */ Controller_keystroke.prototype.selectDirIncremental = function (dir) { - pray('A selection is open', INCREMENTAL_SELECTION_OPEN); + pray("A selection is open", INCREMENTAL_SELECTION_OPEN); INCREMENTAL_SELECTION_OPEN = true; - var cursor = this.cursor, seln = cursor.selection; + var cursor = this.cursor, + seln = cursor.selection; prayDirection(dir); var node = cursor[dir]; if (node) { // "if node we're selecting towards is inside selection (hence retracting) // and is on the *far side* of the selection (hence is only node selected) // and the anticursor is *inside* that node, not just on the other side" - if (seln && - seln.getEnd(dir) === node && - cursor.anticursor[-dir] !== node) { + if (seln && seln.getEnd(dir) === node && cursor.anticursor[-dir] !== node) { node.unselectInto(dir, cursor); - } - else - node.selectTowards(dir, cursor); - } - else - cursor.parent.selectOutOf(dir, cursor); + } else node.selectTowards(dir, cursor); + } else cursor.parent.selectOutOf(dir, cursor); }; /** * Update selection DOM to match cursor model @@ -3671,15 +3490,13 @@ export default function() { * be called in sequence. */ Controller_keystroke.prototype.finishIncrementalSelection = function () { - pray('A selection is open', INCREMENTAL_SELECTION_OPEN); + pray("A selection is open", INCREMENTAL_SELECTION_OPEN); var cursor = this.cursor; cursor.clearSelection(); cursor.select() || cursor.show(); var selection = cursor.selection; if (selection) { - cursor.controller.aria - .clear() - .queue(selection.join('mathspeak', ' ').trim() + ' selected'); // clearing first because selection fires several times, and we don't want repeated speech. + cursor.controller.aria.clear().queue(selection.join("mathspeak", " ").trim() + " selected"); // clearing first because selection fires several times, and we don't want repeated speech. } INCREMENTAL_SELECTION_OPEN = false; }; @@ -3702,15 +3519,15 @@ export default function() { try { this.startIncrementalSelection(); try { - cb(function (dir) { return _this_1.selectDirIncremental(dir); }); - } - finally { + cb(function (dir) { + return _this_1.selectDirIncremental(dir); + }); + } finally { // Since we have started a selection, attempt to finish it even // if the callback throws an error this.finishIncrementalSelection(); } - } - finally { + } finally { // Mark selection as closed even if finishSelection throws an // error. Makes a possible error in finishSelection more // recoverable @@ -3724,7 +3541,9 @@ export default function() { * selection, use withIncrementalSelection */ Controller_keystroke.prototype.selectDir = function (dir) { - this.withIncrementalSelection(function (selectDir) { return selectDir(dir); }); + this.withIncrementalSelection(function (selectDir) { + return selectDir(dir); + }); }; Controller_keystroke.prototype.selectLeft = function () { return this.selectDir(L); @@ -3733,19 +3552,17 @@ export default function() { return this.selectDir(R); }; Controller_keystroke.prototype.selectAll = function () { - this.notify('move'); + this.notify("move"); var cursor = this.cursor; cursor.insAtRightEnd(this.root); this.withIncrementalSelection(function (selectDir) { - while (cursor[L]) - selectDir(L); + while (cursor[L]) selectDir(L); }); }; Controller_keystroke.prototype.selectToBlockEndInDir = function (dir) { var cursor = this.cursor; this.withIncrementalSelection(function (selectDir) { - while (cursor[dir]) - selectDir(dir); + while (cursor[dir]) selectDir(dir); }); }; Controller_keystroke.prototype.selectToRootEndInDir = function (dir) { @@ -3758,14 +3575,14 @@ export default function() { }); }; return Controller_keystroke; - }(Controller_focusBlur)); + })(Controller_focusBlur); var TempSingleCharNode = /** @class */ (function (_super) { __extends(TempSingleCharNode, _super); function TempSingleCharNode(_char) { return _super.call(this) || this; } return TempSingleCharNode; - }(MQNode)); + })(MQNode); // Parser MathBlock var latexMathParser = (function () { function commandToBlock(cmd) { @@ -3801,72 +3618,76 @@ export default function() { return new VanillaSymbol(c); }); var controlSequence = regex(/^[^\\a-eg-zA-Z]/) // hotfix #164; match MathBlock::write - .or(string('\\').then(regex(/^[a-z]+/i) - .or(regex(/^\s+/).result(' ')) - .or(any))) + .or( + string("\\").then( + regex(/^[a-z]+/i) + .or(regex(/^\s+/).result(" ")) + .or(any) + ) + ) .then(function (ctrlSeq) { - // TODO - is Parser correct? - var cmdKlass = LatexCmds[ctrlSeq]; - if (cmdKlass) { - if (cmdKlass.constructor) { - var actualClass = cmdKlass; // TODO - figure out how to know the difference - return new actualClass(ctrlSeq).parser(); - } - else { - var builder = cmdKlass; // TODO - figure out how to know the difference - return builder(ctrlSeq).parser(); + // TODO - is Parser correct? + var cmdKlass = LatexCmds[ctrlSeq]; + if (cmdKlass) { + if (cmdKlass.constructor) { + var actualClass = cmdKlass; // TODO - figure out how to know the difference + return new actualClass(ctrlSeq).parser(); + } else { + var builder = cmdKlass; // TODO - figure out how to know the difference + return builder(ctrlSeq).parser(); + } + } else { + return fail("unknown command: \\" + ctrlSeq); } - } - else { - return fail('unknown command: \\' + ctrlSeq); - } - }); + }); var command = controlSequence.or(variable).or(number).or(symbol); // Parsers yielding MathBlocks - var mathGroup = string('{') + var mathGroup = string("{") .then(function () { - return mathSequence; - }) - .skip(string('}')); + return mathSequence; + }) + .skip(string("}")); var mathBlock = optWhitespace.then(mathGroup.or(command.map(commandToBlock))); var mathSequence = mathBlock.many().map(joinBlocks).skip(optWhitespace); - var optMathBlock = string('[') - .then(mathBlock - .then(function (block) { - return block.join('latex') !== ']' ? succeed(block) : fail(''); - }) - .many() - .map(joinBlocks) - .skip(optWhitespace)) - .skip(string(']')); + var optMathBlock = string("[") + .then( + mathBlock + .then(function (block) { + return block.join("latex") !== "]" ? succeed(block) : fail(""); + }) + .many() + .map(joinBlocks) + .skip(optWhitespace) + ) + .skip(string("]")); var latexMath = mathSequence; latexMath.block = mathBlock; latexMath.optBlock = optMathBlock; return latexMath; })(); baseOptionProcessors.maxDepth = function (depth) { - return typeof depth === 'number' ? depth : undefined; + return typeof depth === "number" ? depth : undefined; }; var Controller_latex = /** @class */ (function (_super) { __extends(Controller_latex, _super); function Controller_latex() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } Controller_latex.prototype.cleanLatex = function (latex) { //prune unnecessary spaces - return latex.replace(/(\\[a-z]+) (?![a-z])/gi, '$1'); + return latex.replace(/(\\[a-z]+) (?![a-z])/gi, "$1"); }; Controller_latex.prototype.exportLatex = function () { return this.cleanLatex(this.root.latex()); }; Controller_latex.prototype.writeLatex = function (latex) { - var cursor = this.notify('edit').cursor; + var cursor = this.notify("edit").cursor; cursor.parent.writeLatex(cursor, latex); return this; }; Controller_latex.prototype.exportLatexSelection = function () { var ctx = { - latex: '', + latex: "", startIndex: -1, endIndex: -1, }; @@ -3874,20 +3695,17 @@ export default function() { if (selection) { ctx.startSelectionBefore = selection.getEnd(L); ctx.endSelectionAfter = selection.getEnd(R); - } - else { + } else { var cursorL = this.cursor[L]; if (cursorL) { ctx.startSelectionAfter = cursorL; - } - else { + } else { ctx.startSelectionBefore = this.cursor.parent; } var cursorR = this.cursor[R]; if (cursorR) { ctx.endSelectionBefore = cursorR; - } - else { + } else { ctx.endSelectionAfter = this.cursor.parent; } } @@ -3911,8 +3729,7 @@ export default function() { endIndex -= 1; // do not increment j. We wan to keep looking at this same // cleanLatex character until we find it in the originalLatex - } - else { + } else { j += 1; //move to next cleanLatex character } } @@ -3923,8 +3740,7 @@ export default function() { }; }; Controller_latex.prototype.classifyLatexForEfficientUpdate = function (latex) { - if (typeof latex !== 'string') - return; + if (typeof latex !== "string") return; var matches = latex.match(/-?[0-9.]+$/g); if (matches && matches.length === 1) { return { @@ -3944,12 +3760,10 @@ export default function() { var classification = this.classifyLatexForEfficientUpdate(latex); if (classification) { oldClassification = this.classifyLatexForEfficientUpdate(oldLatex); - if (!oldClassification || - oldClassification.prefix !== classification.prefix) { + if (!oldClassification || oldClassification.prefix !== classification.prefix) { return false; } - } - else { + } else { return false; } // check if minus sign is changing @@ -3957,11 +3771,11 @@ export default function() { var newDigits = classification.digits; var oldMinusSign = false; var newMinusSign = false; - if (oldDigits[0] === '-') { + if (oldDigits[0] === "-") { oldMinusSign = true; oldDigits = oldDigits.substr(1); } - if (newDigits[0] === '-') { + if (newDigits[0] === "-") { newMinusSign = true; newDigits = newDigits.substr(1); } @@ -3987,36 +3801,29 @@ export default function() { // remove the minus sign if (oldMinusSign && !newMinusSign) { var oldMinusNode = charNode; - if (!oldMinusNode) - return false; - if (oldMinusNode.ctrlSeq !== '-') - return false; - if (oldMinusNode[R] !== oldCharNodes[0]) - return false; - if (oldMinusNode.parent !== root) - return false; + if (!oldMinusNode) return false; + if (oldMinusNode.ctrlSeq !== "-") return false; + if (oldMinusNode[R] !== oldCharNodes[0]) return false; + if (oldMinusNode.parent !== root) return false; var oldMinusNodeL = oldMinusNode[L]; - if (oldMinusNodeL && oldMinusNodeL.parent !== root) - return false; + if (oldMinusNodeL && oldMinusNodeL.parent !== root) return false; oldCharNodes[0][L] = oldMinusNode[L]; if (root.getEnd(L) === oldMinusNode) { - root.setEnds((_c = {}, _c[L] = oldCharNodes[0], _c[R] = root.getEnd(R), _c)); + root.setEnds(((_c = {}), (_c[L] = oldCharNodes[0]), (_c[R] = root.getEnd(R)), _c)); } - if (oldMinusNodeL) - oldMinusNodeL[R] = oldCharNodes[0]; + if (oldMinusNodeL) oldMinusNodeL[R] = oldCharNodes[0]; oldMinusNode.domFrag().remove(); } // add a minus sign if (!oldMinusSign && newMinusSign) { - var newMinusNode = new PlusMinus('-'); - var minusSpan = document.createElement('span'); - minusSpan.textContent = '-'; + var newMinusNode = new PlusMinus("-"); + var minusSpan = document.createElement("span"); + minusSpan.textContent = "-"; newMinusNode.setDOM(minusSpan); var oldCharNodes0L = oldCharNodes[0][L]; - if (oldCharNodes0L) - oldCharNodes0L[R] = newMinusNode; + if (oldCharNodes0L) oldCharNodes0L[R] = newMinusNode; if (root.getEnd(L) === oldCharNodes[0]) { - root.setEnds((_d = {}, _d[L] = newMinusNode, _d[R] = root.getEnd(R), _d)); + root.setEnds(((_d = {}), (_d[L] = newMinusNode), (_d[R] = root.getEnd(R)), _d)); } newMinusNode.parent = root; newMinusNode[L] = oldCharNodes[0][L]; @@ -4039,7 +3846,7 @@ export default function() { // remove the extra digits at the end if (oldDigits.length > newDigits.length) { charNode = oldCharNodes[newDigits.length - 1]; - root.setEnds((_e = {}, _e[L] = root.getEnd(L), _e[R] = charNode, _e)); + root.setEnds(((_e = {}), (_e[L] = root.getEnd(L)), (_e[R] = charNode), _e)); charNode[R] = 0; for (i = oldDigits.length - 1; i >= commonLength; i--) { oldCharNodes[i].domFrag().remove(); @@ -4049,8 +3856,8 @@ export default function() { if (newDigits.length > oldDigits.length) { var frag = document.createDocumentFragment(); for (i = commonLength; i < newDigits.length; i++) { - var span = document.createElement('span'); - span.className = 'dcg-mq-digit'; + var span = document.createElement("span"); + span.className = "dcg-mq-digit"; span.textContent = newDigits[i]; var newNode = new Digit(newDigits[i]); newNode.parent = root; @@ -4061,16 +3868,18 @@ export default function() { newNode[R] = 0; var newNodeL = newNode[L]; newNodeL[R] = newNode; - root.setEnds((_f = {}, _f[L] = root.getEnd(L), _f[R] = newNode, _f)); + root.setEnds(((_f = {}), (_f[L] = root.getEnd(L)), (_f[R] = newNode), _f)); } root.domFrag().oneElement().appendChild(frag); } var currentLatex = this.exportLatex(); if (currentLatex !== latex) { - console.warn('tried updating latex efficiently but did not work. Attempted: ' + - latex + - ' but wrote: ' + - currentLatex); + console.warn( + "tried updating latex efficiently but did not work. Attempted: " + + latex + + " but wrote: " + + currentLatex + ); return false; } var rightMost = root.getEnd(R); @@ -4081,14 +3890,12 @@ export default function() { }; Controller_latex.prototype.renderLatexMathFromScratch = function (latex) { var _c; - var root = this.root, cursor = this.cursor; + var root = this.root, + cursor = this.cursor; var all = Parser.all; var eof = Parser.eof; - var block = latexMathParser - .skip(eof) - .or(all.result(false)) - .parse(latex); - root.setEnds((_c = {}, _c[L] = 0, _c[R] = 0, _c)); + var block = latexMathParser.skip(eof).or(all.result(false)).parse(latex); + root.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); if (block) { block.children().adopt(root, 0, 0); } @@ -4097,29 +3904,28 @@ export default function() { frag.children().remove(); frag.oneElement().appendChild(block.html()); root.finalizeInsert(cursor.options, cursor); - } - else { + } else { root.domFrag().empty(); } }; Controller_latex.prototype.renderLatexMath = function (latex) { var cursor = this.cursor; var root = this.root; - this.notify('replace'); + this.notify("replace"); cursor.clearSelection(); var oldLatex = this.exportLatex(); if (!root.getEnd(L) || !root.getEnd(R) || oldLatex !== latex) { - this.updateLatexMathEfficiently(latex, oldLatex) || - this.renderLatexMathFromScratch(latex); + this.updateLatexMathEfficiently(latex, oldLatex) || this.renderLatexMathFromScratch(latex); this.updateMathspeak(); } cursor.insAtRightEnd(root); }; Controller_latex.prototype.renderLatexText = function (latex) { var _c; - var root = this.root, cursor = this.cursor; + var root = this.root, + cursor = this.cursor; root.domFrag().children().slice(1).remove(); - root.setEnds((_c = {}, _c[L] = 0, _c[R] = 0, _c)); + root.setEnds(((_c = {}), (_c[L] = 0), (_c[R] = 0), _c)); delete cursor.selection; cursor.show().insAtRightEnd(root); var regex = Parser.regex; @@ -4127,29 +3933,26 @@ export default function() { var eof = Parser.eof; var all = Parser.all; // Parser RootMathCommand - var mathMode = string('$') + var mathMode = string("$") .then(latexMathParser) // because TeX is insane, math mode doesn't necessarily // have to end. So we allow for the case that math mode // continues to the end of the stream. - .skip(string('$').or(eof)) + .skip(string("$").or(eof)) .map(function (block) { - // HACK FIXME: this shouldn't have to have access to cursor - var rootMathCommand = new RootMathCommand(cursor); - rootMathCommand.createBlocks(); - var rootMathBlock = rootMathCommand.getEnd(L); - block.children().adopt(rootMathBlock, 0, 0); - return rootMathCommand; + // HACK FIXME: this shouldn't have to have access to cursor + var rootMathCommand = new RootMathCommand(cursor); + rootMathCommand.createBlocks(); + var rootMathBlock = rootMathCommand.getEnd(L); + block.children().adopt(rootMathBlock, 0, 0); + return rootMathCommand; + }); + var escapedDollar = string("\\$").result("$"); + var textChar = escapedDollar.or(regex(/^[^$]/)).map(function (ch) { + return new VanillaSymbol(ch); }); - var escapedDollar = string('\\$').result('$'); - var textChar = escapedDollar - .or(regex(/^[^$]/)) - .map(function (ch) { return new VanillaSymbol(ch); }); var latexText = mathMode.or(textChar).many(); - var commands = latexText - .skip(eof) - .or(all.result(false)) - .parse(latex); + var commands = latexText.skip(eof).or(all.result(false)).parse(latex); if (commands) { for (var i = 0; i < commands.length; i += 1) { commands[i].adopt(root, root.getEnd(R), 0); @@ -4159,7 +3962,7 @@ export default function() { } }; return Controller_latex; - }(Controller_keystroke)); + })(Controller_keystroke); /******************************************************** * Deals with mouse events for clicking, drag-to-select *******************************************************/ @@ -4173,7 +3976,7 @@ export default function() { var cancelSelectionOnEdit; (function () { ControllerBase.onNotify(function (cursor, e) { - if (e === 'edit' || e === 'replace') { + if (e === "edit" || e === "replace") { // this will be called any time ANY mathquill is edited. We only want // to cancel selection if the selection is happening within the mathquill // that dispatched the notify. Otherwise you won't be able to select any @@ -4187,33 +3990,33 @@ export default function() { var Controller_mouse = /** @class */ (function (_super) { __extends(Controller_mouse, _super); function Controller_mouse() { - var _this_1 = _super !== null && _super.apply(this, arguments) || this; + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; _this_1.handleMouseDown = function (e) { - var rootElement = closest(e.target, '.dcg-mq-root-block'); - var root = ((rootElement && NodeBase.getNodeOfElement(rootElement)) || - NodeBase.getNodeOfElement(_this_1.root.domFrag().oneElement())); + var rootElement = closest(e.target, ".dcg-mq-root-block"); + var root = + (rootElement && NodeBase.getNodeOfElement(rootElement)) || + NodeBase.getNodeOfElement(_this_1.root.domFrag().oneElement()); var ownerDocument = root.domFrag().firstNode().ownerDocument; - var ctrlr = root.controller, cursor = ctrlr.cursor, blink = cursor.blink; + var ctrlr = root.controller, + cursor = ctrlr.cursor, + blink = cursor.blink; var textareaSpan = ctrlr.getTextareaSpanOrThrow(); var textarea = ctrlr.getTextareaOrThrow(); e.preventDefault(); // doesn't work in IE\u22648, but it's a one-line fix: e.target.unselectable = true; // http://jsbin.com/yagekiji/1 // TODO - no idea what this unselectable property is - if (cursor.options.ignoreNextMousedown(e)) - return; - else - cursor.options.ignoreNextMousedown = ignoreNextMouseDownNoop; + if (cursor.options.ignoreNextMousedown(e)) return; + else cursor.options.ignoreNextMousedown = ignoreNextMouseDownNoop; var lastMousemoveTarget = null; function mousemove(e) { lastMousemoveTarget = e.target; } function onDocumentMouseMove(e) { - if (!cursor.anticursor) - cursor.startSelection(); + if (!cursor.anticursor) cursor.startSelection(); ctrlr.seek(lastMousemoveTarget, e.clientX, e.clientY).cursor.select(); if (cursor.selection) cursor.controller.aria .clear() - .queue(cursor.selection.join('mathspeak') + ' selected') + .queue(cursor.selection.join("mathspeak") + " selected") .alert(); lastMousemoveTarget = null; } @@ -4221,24 +4024,28 @@ export default function() { // won't be inside this root, so don't mislead Controller::seek with it function unbindListeners() { // delete the mouse handlers now that we're not dragging anymore - rootElement === null || rootElement === void 0 ? void 0 : rootElement.removeEventListener('mousemove', mousemove); - ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.removeEventListener('mousemove', onDocumentMouseMove); - ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.removeEventListener('mouseup', onDocumentMouseUp); + rootElement === null || rootElement === void 0 + ? void 0 + : rootElement.removeEventListener("mousemove", mousemove); + ownerDocument === null || ownerDocument === void 0 + ? void 0 + : ownerDocument.removeEventListener("mousemove", onDocumentMouseMove); + ownerDocument === null || ownerDocument === void 0 + ? void 0 + : ownerDocument.removeEventListener("mouseup", onDocumentMouseUp); cancelSelectionOnEdit = undefined; } function updateCursor() { if (ctrlr.editable) { cursor.show(); cursor.controller.aria.queue(cursor.parent).alert(); - } - else { + } else { domFrag(textareaSpan).detach(); } } function onDocumentMouseUp() { cursor.blink = blink; - if (!cursor.selection) - updateCursor(); + if (!cursor.selection) updateCursor(); unbindListeners(); } var wasEdited; @@ -4264,16 +4071,19 @@ export default function() { // mathquill, triggering cancelSelectionOnEdit. If that happens, we // don't want to stop the cursor blink or bind listeners, // so return early. - if (wasEdited) - return; + if (wasEdited) return; } cursor.blink = noop; - ctrlr - .seek(e.target, e.clientX, e.clientY) - .cursor.startSelection(); - rootElement === null || rootElement === void 0 ? void 0 : rootElement.addEventListener('mousemove', mousemove); - ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.addEventListener('mousemove', onDocumentMouseMove); - ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.addEventListener('mouseup', onDocumentMouseUp); + ctrlr.seek(e.target, e.clientX, e.clientY).cursor.startSelection(); + rootElement === null || rootElement === void 0 + ? void 0 + : rootElement.addEventListener("mousemove", mousemove); + ownerDocument === null || ownerDocument === void 0 + ? void 0 + : ownerDocument.addEventListener("mousemove", onDocumentMouseMove); + ownerDocument === null || ownerDocument === void 0 + ? void 0 + : ownerDocument.addEventListener("mouseup", onDocumentMouseUp); // listen on document not just body to not only hear about mousemove and // mouseup on page outside field, but even outside page, except iframes: https://github.com/mathquill/mathquill/commit/8c50028afcffcace655d8ae2049f6e02482346c5#commitcomment-6175800 }; @@ -4281,13 +4091,13 @@ export default function() { } Controller_mouse.prototype.addMouseEventListener = function () { //drag-to-select event handling - this.container.addEventListener('mousedown', this.handleMouseDown); + this.container.addEventListener("mousedown", this.handleMouseDown); }; Controller_mouse.prototype.removeMouseEventListener = function () { - this.container.removeEventListener('mousedown', this.handleMouseDown); + this.container.removeEventListener("mousedown", this.handleMouseDown); }; Controller_mouse.prototype.seek = function (targetElm, clientX, _clientY) { - var cursor = this.notify('select').cursor; + var cursor = this.notify("select").cursor; var node; // we can click on an element that is deeply nested past the point // that mathquill knows about. We need to traverse up to the first @@ -4295,8 +4105,7 @@ export default function() { while (targetElm) { // try to find the MQ Node associated with the DOM Element node = NodeBase.getNodeOfElement(targetElm); - if (node) - break; + if (node) break; // must be too deep, traverse up to the parent DOM Element targetElm = targetElm.parentElement; } @@ -4314,7 +4123,7 @@ export default function() { return this; }; return Controller_mouse; - }(Controller_latex)); + })(Controller_latex); /*********************************************** * Horizontal panning for editable fields that * overflow their width @@ -4322,7 +4131,7 @@ export default function() { var Controller_scrollHoriz = /** @class */ (function (_super) { __extends(Controller_scrollHoriz, _super); function Controller_scrollHoriz() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } Controller_scrollHoriz.prototype.setOverflowClasses = function () { var root = this.root.domFrag().oneElement(); @@ -4335,16 +4144,15 @@ export default function() { shouldHaveOverflowRight = scrollWidth > width + scroll; shouldHaveOverflowLeft = scroll > 0; } - if (root.classList.contains('dcg-mq-editing-overflow-right') !== - shouldHaveOverflowRight) - root.classList.toggle('dcg-mq-editing-overflow-right'); - if (root.classList.contains('dcg-mq-editing-overflow-left') !== - shouldHaveOverflowLeft) - root.classList.toggle('dcg-mq-editing-overflow-left'); + if (root.classList.contains("dcg-mq-editing-overflow-right") !== shouldHaveOverflowRight) + root.classList.toggle("dcg-mq-editing-overflow-right"); + if (root.classList.contains("dcg-mq-editing-overflow-left") !== shouldHaveOverflowLeft) + root.classList.toggle("dcg-mq-editing-overflow-left"); }; Controller_scrollHoriz.prototype.scrollHoriz = function () { var _this_1 = this; - var cursor = this.cursor, seln = cursor.selection; + var cursor = this.cursor, + seln = cursor.selection; var rootRect = getBoundingClientRect(this.root.domFrag().oneElement()); if (cursor.domFrag().isEmpty() && !seln) { if (this.cancelScrollHoriz) { @@ -4358,58 +4166,39 @@ export default function() { _this_1.cancelScrollHoriz = undefined; rootElt_1.scrollLeft = 0; _this_1.setOverflowClasses(); - } - else { + } else { _this_1.cancelScrollHoriz = cancel; scheduleNext(); rootElt_1.scrollLeft = Math.round((1 - progress) * start_1); } }); return; - } - else if (!seln) { + } else if (!seln) { var x = getBoundingClientRect(cursor.domFrag().oneElement()).left; - if (x > rootRect.right - 20) - var scrollBy = x - (rootRect.right - 20); - else if (x < rootRect.left + 20) - var scrollBy = x - (rootRect.left + 20); - else - return; - } - else { + if (x > rootRect.right - 20) var scrollBy = x - (rootRect.right - 20); + else if (x < rootRect.left + 20) var scrollBy = x - (rootRect.left + 20); + else return; + } else { var rect = getBoundingClientRect(seln.domFrag().oneElement()); var overLeft = rect.left - (rootRect.left + 20); var overRight = rect.right - (rootRect.right - 20); if (seln.getEnd(L) === cursor[R]) { - if (overLeft < 0) - var scrollBy = overLeft; + if (overLeft < 0) var scrollBy = overLeft; else if (overRight > 0) { - if (rect.left - overRight < rootRect.left + 20) - var scrollBy = overLeft; - else - var scrollBy = overRight; - } - else - return; - } - else { - if (overRight > 0) - var scrollBy = overRight; + if (rect.left - overRight < rootRect.left + 20) var scrollBy = overLeft; + else var scrollBy = overRight; + } else return; + } else { + if (overRight > 0) var scrollBy = overRight; else if (overLeft < 0) { - if (rect.right - overLeft > rootRect.right - 20) - var scrollBy = overRight; - else - var scrollBy = overLeft; - } - else - return; + if (rect.right - overLeft > rootRect.right - 20) var scrollBy = overRight; + else var scrollBy = overLeft; + } else return; } } var root = this.root.domFrag().oneElement(); - if (scrollBy < 0 && root.scrollLeft === 0) - return; - if (scrollBy > 0 && root.scrollWidth <= root.scrollLeft + rootRect.width) - return; + if (scrollBy < 0 && root.scrollLeft === 0) return; + if (scrollBy > 0 && root.scrollWidth <= root.scrollLeft + rootRect.width) return; if (this.cancelScrollHoriz) { this.cancelScrollHoriz(); this.cancelScrollHoriz = undefined; @@ -4421,8 +4210,7 @@ export default function() { _this_1.cancelScrollHoriz = undefined; rootElt.scrollLeft = Math.round(start + scrollBy); _this_1.setOverflowClasses(); - } - else { + } else { _this_1.cancelScrollHoriz = cancel; scheduleNext(); rootElt.scrollLeft = Math.round(start + progress * scrollBy); @@ -4434,18 +4222,18 @@ export default function() { return (_c = this.options.scrollAnimationDuration) !== null && _c !== void 0 ? _c : 100; }; return Controller_scrollHoriz; - }(Controller_mouse)); + })(Controller_mouse); /********************************************* * Manage the MathQuill instance's textarea * (as owned by the Controller) ********************************************/ Options.prototype.substituteTextarea = function () { - return h('textarea', { - autocapitalize: 'off', - autocomplete: 'off', - autocorrect: 'off', + return h("textarea", { + autocapitalize: "off", + autocomplete: "off", + autocorrect: "off", spellcheck: false, - 'x-palm-disable-ste-all': true, + "x-palm-disable-ste-all": true, }); }; function defaultSubstituteKeyboardEvents(jq, controller) { @@ -4455,19 +4243,17 @@ export default function() { var Controller = /** @class */ (function (_super) { __extends(Controller, _super); function Controller() { - var _this_1 = _super !== null && _super.apply(this, arguments) || this; + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; _this_1.selectFn = noop; return _this_1; } Controller.prototype.createTextarea = function () { - this.textareaSpan = h('span', { class: 'dcg-mq-textarea' }); + this.textareaSpan = h("span", { class: "dcg-mq-textarea" }); var textarea = this.options.substituteTextarea(); if (!textarea.nodeType) { - throw 'substituteTextarea() must return a DOM element, got ' + textarea; + throw "substituteTextarea() must return a DOM element, got " + textarea; } - this.textarea = domFrag(textarea) - .appendTo(this.textareaSpan) - .oneElement(); + this.textarea = domFrag(textarea).appendTo(this.textareaSpan).oneElement(); var ctrlr = this; ctrlr.cursor.selectionChanged = function () { ctrlr.selectionChanged(); @@ -4488,25 +4274,24 @@ export default function() { }; Controller.prototype.setTextareaSelection = function () { this.textareaSelectionTimeout = 0; - var latex = ''; + var latex = ""; if (this.cursor.selection) { //cleanLatex prunes unnecessary spaces. defined in latex.js - latex = this.cleanLatex(this.cursor.selection.join('latex')); + latex = this.cleanLatex(this.cursor.selection.join("latex")); if (this.options.statelessClipboard) { // FIXME: like paste, only this works for math fields; should ask parent - latex = '$' + latex + '$'; + latex = "$" + latex + "$"; } } this.selectFn(latex); }; Controller.prototype.staticMathTextareaEvents = function () { var ctrlr = this; - this.removeTextareaEventListener('cut'); - this.removeTextareaEventListener('paste'); + this.removeTextareaEventListener("cut"); + this.removeTextareaEventListener("paste"); if (ctrlr.options.disableCopyPaste) { - this.removeTextareaEventListener('copy'); - } - else { + this.removeTextareaEventListener("copy"); + } else { this.addTextareaEventListeners({ copy: function () { ctrlr.setTextareaSelection(); @@ -4516,11 +4301,9 @@ export default function() { this.addStaticFocusBlurListeners(); ctrlr.selectFn = function (text) { var textarea = ctrlr.getTextareaOrThrow(); - if (!(textarea instanceof HTMLTextAreaElement)) - return; + if (!(textarea instanceof HTMLTextAreaElement)) return; textarea.value = text; - if (text) - textarea.select(); + if (text) textarea.select(); }; }; Controller.prototype.editablesTextareaEvents = function () { @@ -4533,8 +4316,7 @@ export default function() { this.selectFn = function (text) { keyboardEventsShim.select(text); }; - } - else { + } else { var select = saneKeyboardEvents(textarea, this).select; this.selectFn = select; } @@ -4547,31 +4329,29 @@ export default function() { var textarea = ctrlr.getTextareaOrThrow(); var textareaSpan = ctrlr.getTextareaSpanOrThrow(); this.selectFn = function (text) { - if (!(textarea instanceof HTMLTextAreaElement)) - return; + if (!(textarea instanceof HTMLTextAreaElement)) return; textarea.value = text; - if (text) - textarea.select(); + if (text) textarea.select(); }; domFrag(textareaSpan).remove(); - this.removeTextareaEventListener('focus'); - this.removeTextareaEventListener('blur'); + this.removeTextareaEventListener("focus"); + this.removeTextareaEventListener("blur"); ctrlr.blurred = true; - this.removeTextareaEventListener('cut'); - this.removeTextareaEventListener('paste'); + this.removeTextareaEventListener("cut"); + this.removeTextareaEventListener("paste"); }; Controller.prototype.typedText = function (ch) { - if (ch === '\n') - return this.handle('enter'); + if (ch === "\n") return this.handle("enter"); var cursor = this.notify(undefined).cursor; cursor.parent.write(cursor, ch); this.scrollHoriz(); }; Controller.prototype.cut = function () { - var ctrlr = this, cursor = ctrlr.cursor; + var ctrlr = this, + cursor = ctrlr.cursor; if (cursor.selection) { setTimeout(function () { - ctrlr.notify('edit'); // deletes selection if present + ctrlr.notify("edit"); // deletes selection if present cursor.parent.bubble(function (node) { node.reflow(); return undefined; @@ -4592,11 +4372,10 @@ export default function() { // only gets in the way by \text{}-ifying pasted stuff and $-ifying // cut/copied LaTeX) if (this.options.statelessClipboard) { - if (text.slice(0, 1) === '$' && text.slice(-1) === '$') { + if (text.slice(0, 1) === "$" && text.slice(-1) === "$") { text = text.slice(1, -1); - } - else { - text = '\\text{' + text + '}'; + } else { + text = "\\text{" + text + "}"; } } // FIXME: this always inserts math or a TextBlock, even in a RootTextBlock @@ -4608,7 +4387,7 @@ export default function() { }; /** Set up for a static MQ field (i.e., create and attach the mathspeak element and initialize the focus state to blurred) */ Controller.prototype.setupStaticField = function () { - this.mathspeakSpan = h('span', { class: 'dcg-mq-mathspeak' }); + this.mathspeakSpan = h("span", { class: "dcg-mq-mathspeak" }); domFrag(this.container).prepend(domFrag(this.mathspeakSpan)); this.updateMathspeak(); this.blurred = true; @@ -4618,9 +4397,7 @@ export default function() { var ctrlr = this; // If the controller's ARIA label doesn't end with a punctuation mark, add a colon by default to better separate it from mathspeak. var ariaLabel = ctrlr.getAriaLabel(); - var labelWithSuffix = /[A-Za-z0-9]$/.test(ariaLabel) - ? ariaLabel + ':' - : ariaLabel; + var labelWithSuffix = /[A-Za-z0-9]$/.test(ariaLabel) ? ariaLabel + ":" : ariaLabel; var mathspeak = ctrlr.root.mathspeak().trim(); this.aria.clear(); var textarea = ctrlr.getTextareaOrThrow(); @@ -4631,17 +4408,17 @@ export default function() { // so it is not included for static math mathspeak calculations. // The mathspeakSpan should exist only for static math, so we use its presence to decide which approach to take. if (!!ctrlr.mathspeakSpan) { - textarea.setAttribute('aria-label', ''); - ctrlr.mathspeakSpan.textContent = (labelWithSuffix + - ' ' + - mathspeak).trim(); - } - else { - textarea.setAttribute('aria-label', (labelWithSuffix + ' ' + mathspeak + ' ' + ctrlr.ariaPostLabel).trim()); + textarea.setAttribute("aria-label", ""); + ctrlr.mathspeakSpan.textContent = (labelWithSuffix + " " + mathspeak).trim(); + } else { + textarea.setAttribute( + "aria-label", + (labelWithSuffix + " " + mathspeak + " " + ctrlr.ariaPostLabel).trim() + ); } }; return Controller; - }(Controller_scrollHoriz)); + })(Controller_scrollHoriz); /************************************************* * Abstract classes of math blocks and commands. ************************************************/ @@ -4653,7 +4430,7 @@ export default function() { var MathElement = /** @class */ (function (_super) { __extends(MathElement, _super); function MathElement() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } MathElement.prototype.finalizeInsert = function (options, cursor) { var self = this; @@ -4675,10 +4452,8 @@ export default function() { }); var selfR = self[R]; var selfL = self[L]; - if (selfR) - selfR.siblingCreated(options, L); - if (selfL) - selfL.siblingCreated(options, R); + if (selfR) selfR.siblingCreated(options, L); + if (selfL) selfL.siblingCreated(options, R); self.bubble(function (node) { node.reflow(); return undefined; @@ -4713,8 +4488,7 @@ export default function() { depth = c[1] + i; if (depth <= cutoff) { queue.push([child, depth]); - } - else { + } else { (i ? child.children() : child).remove(); } return undefined; @@ -4722,14 +4496,14 @@ export default function() { } }; return MathElement; - }(MQNode)); + })(MQNode); var DOMView = /** @class */ (function () { function DOMView(childCount, render) { this.childCount = childCount; this.render = render; } return DOMView; - }()); + })(); /** * Commands and operators, like subscripts, exponents, or fractions. * Descendant commands are organized into blocks. @@ -4738,25 +4512,22 @@ export default function() { __extends(MathCommand, _super); function MathCommand(ctrlSeq, domView, textTemplate) { var _this_1 = _super.call(this) || this; - _this_1.textTemplate = ['']; - _this_1.mathspeakTemplate = ['']; + _this_1.textTemplate = [""]; + _this_1.mathspeakTemplate = [""]; _this_1.setCtrlSeqHtmlAndText(ctrlSeq, domView, textTemplate); return _this_1; } MathCommand.prototype.setEnds = function (ends) { - pray('MathCommand ends are never empty', ends[L] && ends[R]); + pray("MathCommand ends are never empty", ends[L] && ends[R]); this.ends = ends; }; MathCommand.prototype.getEnd = function (dir) { return this.ends[dir]; }; MathCommand.prototype.setCtrlSeqHtmlAndText = function (ctrlSeq, domView, textTemplate) { - if (!this.ctrlSeq) - this.ctrlSeq = ctrlSeq; - if (domView) - this.domView = domView; - if (textTemplate) - this.textTemplate = textTemplate; + if (!this.ctrlSeq) this.ctrlSeq = ctrlSeq; + if (domView) this.domView = domView; + if (textTemplate) this.textTemplate = textTemplate; }; // obvious methods MathCommand.prototype.replaces = function (replacedFragment) { @@ -4796,7 +4567,9 @@ export default function() { cmd.placeCursor(cursor); }; MathCommand.prototype.createBlocks = function () { - var cmd = this, numBlocks = cmd.numBlocks(), blocks = (cmd.blocks = Array(numBlocks)); + var cmd = this, + numBlocks = cmd.numBlocks(), + blocks = (cmd.blocks = Array(numBlocks)); for (var i = 0; i < numBlocks; i += 1) { var newBlock = (blocks[i] = new MathBlock()); newBlock.adopt(cmd, cmd.getEnd(R), 0); @@ -4805,32 +4578,29 @@ export default function() { MathCommand.prototype.placeCursor = function (cursor) { //insert the cursor at the right end of the first empty child, searching //left-to-right, or if none empty, the right end child - cursor.insAtRightEnd(this.foldChildren(this.getEnd(L), function (leftward, child) { - return leftward.isEmpty() ? leftward : child; - })); + cursor.insAtRightEnd( + this.foldChildren(this.getEnd(L), function (leftward, child) { + return leftward.isEmpty() ? leftward : child; + }) + ); }; // editability methods: called by the cursor for editing, cursor movements, // and selection of the MathQuill tree, these all take in a direction and // the cursor MathCommand.prototype.moveTowards = function (dir, cursor, updown) { var updownInto; - if (updown === 'up') { + if (updown === "up") { updownInto = this.upInto; - } - else if (updown === 'down') { + } else if (updown === "down") { updownInto = this.downInto; } var el = updownInto || this.getEnd(-dir); cursor.insAtDirEnd(-dir, el); - cursor.controller.aria - .queueDirEndOf(-dir) - .queue(cursor.parent, true); + cursor.controller.aria.queueDirEndOf(-dir).queue(cursor.parent, true); }; MathCommand.prototype.deleteTowards = function (dir, cursor) { - if (this.isEmpty()) - cursor[dir] = this.remove()[dir]; - else - this.moveTowards(dir, cursor); + if (this.isEmpty()) cursor[dir] = this.remove()[dir]; + else this.moveTowards(dir, cursor); }; MathCommand.prototype.selectTowards = function (dir, cursor) { cursor[-dir] = this; @@ -4850,48 +4620,34 @@ export default function() { var el = node.domFrag().oneElement(); var l = getBoundingClientRect(el).left; var r = l + el.offsetWidth; - return _c = {}, - _c[L] = l, - _c[R] = r, - _c; + return (_c = {}), (_c[L] = l), (_c[R] = r), _c; } var cmd = this; var cmdBounds = getBounds(cmd); - if (clientX < cmdBounds[L]) - return cursor.insLeftOf(cmd); - if (clientX > cmdBounds[R]) - return cursor.insRightOf(cmd); + if (clientX < cmdBounds[L]) return cursor.insLeftOf(cmd); + if (clientX > cmdBounds[R]) return cursor.insRightOf(cmd); var leftLeftBound = cmdBounds[L]; cmd.eachChild(function (block) { var blockBounds = getBounds(block); if (clientX < blockBounds[L]) { // closer to this block's left bound, or the bound left of that? if (clientX - leftLeftBound < blockBounds[L] - clientX) { - if (block[L]) - cursor.insAtRightEnd(block[L]); - else - cursor.insLeftOf(cmd); - } - else - cursor.insAtLeftEnd(block); + if (block[L]) cursor.insAtRightEnd(block[L]); + else cursor.insLeftOf(cmd); + } else cursor.insAtLeftEnd(block); return false; - } - else if (clientX > blockBounds[R]) { - if (block[R]) - leftLeftBound = blockBounds[R]; + } else if (clientX > blockBounds[R]) { + if (block[R]) leftLeftBound = blockBounds[R]; // continue to next block else { // last (rightmost) block // closer to this block's right bound, or the cmd's right bound? if (cmdBounds[R] - clientX < clientX - blockBounds[R]) { cursor.insRightOf(cmd); - } - else - cursor.insAtRightEnd(block); + } else cursor.insAtRightEnd(block); } return undefined; - } - else { + } else { block.seek(clientX, cursor); return false; } @@ -4908,7 +4664,7 @@ export default function() { */ MathCommand.prototype.html = function () { var blocks = this.blocks; - pray('domView is defined', this.domView); + pray("domView is defined", this.domView); var template = this.domView; var dom = template.render(blocks || []); this.setDOM(dom); @@ -4918,46 +4674,47 @@ export default function() { // methods to export a string representation of the math tree MathCommand.prototype.latexRecursive = function (ctx) { this.checkCursorContextOpen(ctx); - ctx.latex += this.ctrlSeq || ''; + ctx.latex += this.ctrlSeq || ""; this.eachChild(function (child) { - ctx.latex += '{'; + ctx.latex += "{"; var beforeLength = ctx.latex.length; child.latexRecursive(ctx); var afterLength = ctx.latex.length; if (beforeLength === afterLength) { // nothing was written so we write a space - ctx.latex += ' '; + ctx.latex += " "; } - ctx.latex += '}'; + ctx.latex += "}"; }); this.checkCursorContextClose(ctx); }; MathCommand.prototype.text = function () { - var cmd = this, i = 0; + var cmd = this, + i = 0; return cmd.foldChildren(cmd.textTemplate[i], function (text, child) { i += 1; var child_text = child.text(); - if (text && - cmd.textTemplate[i] === '(' && - child_text[0] === '(' && - child_text.slice(-1) === ')') + if (text && cmd.textTemplate[i] === "(" && child_text[0] === "(" && child_text.slice(-1) === ")") return text + child_text.slice(1, -1) + cmd.textTemplate[i]; - return text + child_text + (cmd.textTemplate[i] || ''); + return text + child_text + (cmd.textTemplate[i] || ""); }); }; MathCommand.prototype.mathspeak = function () { - var cmd = this, i = 0; - return cmd.foldChildren(cmd.mathspeakTemplate[i] || 'Start' + cmd.ctrlSeq + ' ', function (speech, block) { + var cmd = this, + i = 0; + return cmd.foldChildren(cmd.mathspeakTemplate[i] || "Start" + cmd.ctrlSeq + " ", function (speech, block) { i += 1; - return (speech + - ' ' + + return ( + speech + + " " + block.mathspeak() + - ' ' + - (cmd.mathspeakTemplate[i] + ' ' || 'End' + cmd.ctrlSeq + ' ')); + " " + + (cmd.mathspeakTemplate[i] + " " || "End" + cmd.ctrlSeq + " ") + ); }); }; return MathCommand; - }(MathElement)); + })(MathElement); /** * Lightweight command without blocks or children. */ @@ -4965,17 +4722,24 @@ export default function() { __extends(MQSymbol, _super); function MQSymbol(ctrlSeq, html, text, mathspeak) { var _this_1 = _super.call(this) || this; - _this_1.setCtrlSeqHtmlTextAndMathspeak(ctrlSeq, html - ? new DOMView(0, function () { return html.cloneNode(true); }) - : undefined, text, mathspeak); + _this_1.setCtrlSeqHtmlTextAndMathspeak( + ctrlSeq, + html + ? new DOMView(0, function () { + return html.cloneNode(true); + }) + : undefined, + text, + mathspeak + ); return _this_1; } MQSymbol.prototype.setCtrlSeqHtmlTextAndMathspeak = function (ctrlSeq, html, text, mathspeak) { if (!text && !!ctrlSeq) { - text = ctrlSeq.replace(/^\\/, ''); + text = ctrlSeq.replace(/^\\/, ""); } this.mathspeakName = mathspeak || text; - _super.prototype.setCtrlSeqHtmlAndText.call(this, ctrlSeq, html, [text || '']); + _super.prototype.setCtrlSeqHtmlAndText.call(this, ctrlSeq, html, [text || ""]); }; MQSymbol.prototype.parser = function () { return Parser.succeed(this); @@ -4986,7 +4750,7 @@ export default function() { MQSymbol.prototype.replaces = function (replacedFragment) { replacedFragment.remove(); }; - MQSymbol.prototype.createBlocks = function () { }; + MQSymbol.prototype.createBlocks = function () {}; MQSymbol.prototype.moveTowards = function (dir, cursor) { cursor.domFrag().insDirOf(dir, this.domFrag()); cursor[-dir] = this; @@ -5000,36 +4764,34 @@ export default function() { // insert at whichever side the click was closer to var el = this.domFrag().oneElement(); var left = getBoundingClientRect(el).left; - if (clientX - left < el.offsetWidth / 2) - cursor.insLeftOf(this); - else - cursor.insRightOf(this); + if (clientX - left < el.offsetWidth / 2) cursor.insLeftOf(this); + else cursor.insRightOf(this); return cursor; }; MQSymbol.prototype.latexRecursive = function (ctx) { this.checkCursorContextOpen(ctx); - ctx.latex += this.ctrlSeq || ''; + ctx.latex += this.ctrlSeq || ""; this.checkCursorContextClose(ctx); }; MQSymbol.prototype.text = function () { - return this.textTemplate.join(''); + return this.textTemplate.join(""); }; MQSymbol.prototype.mathspeak = function (_opts) { - return this.mathspeakName || ''; + return this.mathspeakName || ""; }; - MQSymbol.prototype.placeCursor = function () { }; + MQSymbol.prototype.placeCursor = function () {}; MQSymbol.prototype.isEmpty = function () { return true; }; return MQSymbol; - }(MathCommand)); + })(MathCommand); var VanillaSymbol = /** @class */ (function (_super) { __extends(VanillaSymbol, _super); function VanillaSymbol(ch, html, mathspeak) { - return _super.call(this, ch, h('span', {}, [html || h.text(ch)]), undefined, mathspeak) || this; + return _super.call(this, ch, h("span", {}, [html || h.text(ch)]), undefined, mathspeak) || this; } return VanillaSymbol; - }(MQSymbol)); + })(MQSymbol); function bindVanillaSymbol(ch, htmlEntity, mathspeak) { return function () { return new VanillaSymbol(ch, htmlEntity ? h.entityText(htmlEntity) : undefined, mathspeak); @@ -5040,15 +4802,23 @@ export default function() { function BinaryOperator(ctrlSeq, html, text, mathspeak, treatLikeSymbol) { var _this_1 = this; if (treatLikeSymbol) { - _this_1 = _super.call(this, ctrlSeq, h('span', {}, [html || h.text(ctrlSeq || '')]), undefined, mathspeak) || this; - } - else { - _this_1 = _super.call(this, ctrlSeq, h('span', { class: 'dcg-mq-binary-operator' }, html ? [html] : []), text, mathspeak) || this; + _this_1 = + _super.call(this, ctrlSeq, h("span", {}, [html || h.text(ctrlSeq || "")]), undefined, mathspeak) || + this; + } else { + _this_1 = + _super.call( + this, + ctrlSeq, + h("span", { class: "dcg-mq-binary-operator" }, html ? [html] : []), + text, + mathspeak + ) || this; } return _this_1; } return BinaryOperator; - }(MQSymbol)); + })(MQSymbol); function bindBinaryOperator(ctrlSeq, htmlEntity, text, mathspeak) { return function () { return new BinaryOperator(ctrlSeq, htmlEntity ? h.entityText(htmlEntity) : undefined, text, mathspeak); @@ -5062,12 +4832,12 @@ export default function() { var MathBlock = /** @class */ (function (_super) { __extends(MathBlock, _super); function MathBlock() { - var _this_1 = _super !== null && _super.apply(this, arguments) || this; - _this_1.ariaLabel = 'block'; + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ariaLabel = "block"; return _this_1; } MathBlock.prototype.join = function (methodName) { - return this.foldChildren('', function (fold, child) { + return this.foldChildren("", function (fold, child) { return fold + child[methodName](); }); }; @@ -5082,60 +4852,60 @@ export default function() { }; MathBlock.prototype.latexRecursive = function (ctx) { this.checkCursorContextOpen(ctx); - this.eachChild(function (child) { return child.latexRecursive(ctx); }); + this.eachChild(function (child) { + return child.latexRecursive(ctx); + }); this.checkCursorContextClose(ctx); }; MathBlock.prototype.text = function () { var endsL = this.getEnd(L); var endsR = this.getEnd(R); - return endsL === endsR && endsL !== 0 ? endsL.text() : this.join('text'); + return endsL === endsR && endsL !== 0 ? endsL.text() : this.join("text"); }; MathBlock.prototype.mathspeak = function () { - var tempOp = ''; + var tempOp = ""; var autoOps = {}; - if (this.controller) - autoOps = this.controller.options.autoOperatorNames; - return (this.foldChildren([], function (speechArray, cmd) { - if (cmd.isPartOfOperator) { - tempOp += cmd.mathspeak(); - } - else { - if (tempOp !== '') { - if (autoOps._maxLength > 0) { - var x = autoOps[tempOp.toLowerCase()]; - if (typeof x === 'string') - tempOp = x; + if (this.controller) autoOps = this.controller.options.autoOperatorNames; + return ( + this.foldChildren([], function (speechArray, cmd) { + if (cmd.isPartOfOperator) { + tempOp += cmd.mathspeak(); + } else { + if (tempOp !== "") { + if (autoOps._maxLength > 0) { + var x = autoOps[tempOp.toLowerCase()]; + if (typeof x === "string") tempOp = x; + } + speechArray.push(tempOp + " "); + tempOp = ""; } - speechArray.push(tempOp + ' '); - tempOp = ''; - } - var mathspeakText = cmd.mathspeak(); - var cmdText = cmd.ctrlSeq; - if (isNaN(cmdText) && // TODO - revisit this to improve the isNumber() check - cmdText !== '.' && - (!cmd.parent || - !cmd.parent.parent || - !cmd.parent.parent.isTextBlock())) { - mathspeakText = ' ' + mathspeakText + ' '; + var mathspeakText = cmd.mathspeak(); + var cmdText = cmd.ctrlSeq; + if ( + isNaN(cmdText) && // TODO - revisit this to improve the isNumber() check + cmdText !== "." && + (!cmd.parent || !cmd.parent.parent || !cmd.parent.parent.isTextBlock()) + ) { + mathspeakText = " " + mathspeakText + " "; + } + speechArray.push(mathspeakText); } - speechArray.push(mathspeakText); - } - return speechArray; - }) - .join('') - .replace(/ +(?= )/g, '') - // For Apple devices in particular, split out digits after a decimal point so they aren't read aloud as whole words. - // Not doing so makes 123.456 potentially spoken as "one hundred twenty-three point four hundred fifty-six." - // Instead, add spaces so it is spoken as "one hundred twenty-three point four five six." - .replace(/(\.)([0-9]+)/g, function (_match, p1, p2) { - return p1 + p2.split('').join(' ').trim(); - })); + return speechArray; + }) + .join("") + .replace(/ +(?= )/g, "") + // For Apple devices in particular, split out digits after a decimal point so they aren't read aloud as whole words. + // Not doing so makes 123.456 potentially spoken as "one hundred twenty-three point four hundred fifty-six." + // Instead, add spaces so it is spoken as "one hundred twenty-three point four five six." + .replace(/(\.)([0-9]+)/g, function (_match, p1, p2) { + return p1 + p2.split("").join(" ").trim(); + }) + ); }; MathBlock.prototype.keystroke = function (key, e, ctrlr) { - if (ctrlr.options.spaceBehavesLikeTab && - (key === 'Spacebar' || key === 'Shift-Spacebar')) { + if (ctrlr.options.spaceBehavesLikeTab && (key === "Spacebar" || key === "Shift-Spacebar")) { e === null || e === void 0 ? void 0 : e.preventDefault(); - ctrlr.escapeDir(key === 'Shift-Spacebar' ? L : R, key, e); + ctrlr.escapeDir(key === "Shift-Spacebar" ? L : R, key, e); return; } return _super.prototype.keystroke.call(this, key, e, ctrlr); @@ -5145,18 +4915,16 @@ export default function() { // the cursor MathBlock.prototype.moveOutOf = function (dir, cursor, updown) { var updownInto; - if (updown === 'up') { + if (updown === "up") { updownInto = this.parent.upInto; - } - else if (updown === 'down') { + } else if (updown === "down") { updownInto = this.parent.downInto; } if (!updownInto && this[dir]) { var otherDir = -dir; cursor.insAtDirEnd(otherDir, this[dir]); cursor.controller.aria.queueDirEndOf(otherDir).queue(cursor.parent, true); - } - else { + } else { cursor.insDirOf(dir, this.parent); cursor.controller.aria.queueDirOf(dir).queue(this.parent); } @@ -5169,55 +4937,42 @@ export default function() { }; MathBlock.prototype.seek = function (clientX, cursor) { var node = this.getEnd(R); - if (!node) - return cursor.insAtRightEnd(this); + if (!node) return cursor.insAtRightEnd(this); var el = node.domFrag().oneElement(); var left = getBoundingClientRect(el).left; if (left + el.offsetWidth < clientX) { return cursor.insAtRightEnd(this); } var endsL = this.getEnd(L); - if (clientX < getBoundingClientRect(endsL.domFrag().oneElement()).left) - return cursor.insAtLeftEnd(this); - while (clientX < getBoundingClientRect(node.domFrag().oneElement()).left) - node = node[L]; + if (clientX < getBoundingClientRect(endsL.domFrag().oneElement()).left) return cursor.insAtLeftEnd(this); + while (clientX < getBoundingClientRect(node.domFrag().oneElement()).left) node = node[L]; return node.seek(clientX, cursor); }; MathBlock.prototype.chToCmd = function (ch, options) { var cons; // exclude f because it gets a dedicated command with more spacing - if (ch.match(/^[a-eg-zA-Z]$/)) - return new Letter(ch); - else if (/^\d$/.test(ch)) - return new Digit(ch); - else if (options && options.typingSlashWritesDivisionSymbol && ch === '/') - return LatexCmds['\u00f7'](ch); - else if (options && options.typingAsteriskWritesTimesSymbol && ch === '*') - return LatexCmds['\u00d7'](ch); - else if (options && options.typingPercentWritesPercentOf && ch === '%') - return LatexCmds.percentof(ch); + if (ch.match(/^[a-eg-zA-Z]$/)) return new Letter(ch); + else if (/^\d$/.test(ch)) return new Digit(ch); + else if (options && options.typingSlashWritesDivisionSymbol && ch === "/") return LatexCmds["\u00f7"](ch); + else if (options && options.typingAsteriskWritesTimesSymbol && ch === "*") return LatexCmds["\u00d7"](ch); + else if (options && options.typingPercentWritesPercentOf && ch === "%") return LatexCmds.percentof(ch); else if ((cons = CharCmds[ch] || LatexCmds[ch])) { if (cons.constructor) { return new cons(ch); - } - else { + } else { return cons(ch); } - } - else - return new VanillaSymbol(ch); + } else return new VanillaSymbol(ch); }; MathBlock.prototype.write = function (cursor, ch) { var cmd = this.chToCmd(ch, cursor.options); - if (cursor.selection) - cmd.replaces(cursor.replaceSelection()); + if (cursor.selection) cmd.replaces(cursor.replaceSelection()); if (!cursor.isTooDeep()) { cmd.createLeftOf(cursor.show()); // special-case the slash so that fractions are voiced while typing - if (ch === '/') { - cursor.controller.aria.alert('over'); - } - else { + if (ch === "/") { + cursor.controller.aria.alert("over"); + } else { cursor.controller.aria.alert(cmd.mathspeak({ createdLeftOf: cursor })); } } @@ -5225,14 +4980,9 @@ export default function() { MathBlock.prototype.writeLatex = function (cursor, latex) { var all = Parser.all; var eof = Parser.eof; - var block = latexMathParser - .skip(eof) - .or(all.result(false)) - .parse(latex); + var block = latexMathParser.skip(eof).or(all.result(false)).parse(latex); if (block && !block.isEmpty() && block.prepareInsertionAt(cursor)) { - block - .children() - .adopt(cursor.parent, cursor[L], cursor[R]); // TODO - masking undefined. should be 0 + block.children().adopt(cursor.parent, cursor[L], cursor[R]); // TODO - masking undefined. should be 0 domFrag(block.html()).insertBefore(cursor.domFrag()); cursor[L] = block.getEnd(R); block.finalizeInsert(cursor.options, cursor); @@ -5240,10 +4990,8 @@ export default function() { var blockEndsL = block.getEnd(L); var blockEndsRR = blockEndsR[R]; var blockEndsLL = blockEndsL[L]; - if (blockEndsRR) - blockEndsRR.siblingCreated(cursor.options, L); - if (blockEndsLL) - blockEndsLL.siblingCreated(cursor.options, R); + if (blockEndsRR) blockEndsRR.siblingCreated(cursor.options, L); + if (blockEndsLL) blockEndsLL.siblingCreated(cursor.options, R); cursor.parent.bubble(function (node) { node.reflow(); return undefined; @@ -5251,27 +4999,27 @@ export default function() { } }; MathBlock.prototype.focus = function () { - this.domFrag().addClass('dcg-mq-hasCursor'); - this.domFrag().removeClass('dcg-mq-empty'); + this.domFrag().addClass("dcg-mq-hasCursor"); + this.domFrag().removeClass("dcg-mq-empty"); return this; }; MathBlock.prototype.blur = function (cursor) { - this.domFrag().removeClass('dcg-mq-hasCursor'); + this.domFrag().removeClass("dcg-mq-hasCursor"); if (this.isEmpty()) { - this.domFrag().addClass('dcg-mq-empty'); - if (cursor && - this.isQuietEmptyDelimiter(cursor.options.quietEmptyDelimiters)) { - this.domFrag().addClass('dcg-mq-quiet-delimiter'); + this.domFrag().addClass("dcg-mq-empty"); + if (cursor && this.isQuietEmptyDelimiter(cursor.options.quietEmptyDelimiters)) { + this.domFrag().addClass("dcg-mq-quiet-delimiter"); } } return this; }; return MathBlock; - }(MathElement)); + })(MathElement); Options.prototype.mouseEvents = true; API.StaticMath = function (APIClasses) { var _c; - return _c = /** @class */ (function (_super) { + return ( + (_c = /** @class */ (function (_super) { __extends(StaticMath, _super); function StaticMath(el) { var _this_1 = _super.call(this, el) || this; @@ -5283,7 +5031,7 @@ export default function() { } StaticMath.prototype.__mathquillify = function (opts, _interfaceVersion) { this.config(opts); - _super.prototype.mathquillify.call(this, 'dcg-mq-math-mode'); + _super.prototype.mathquillify.call(this, "dcg-mq-math-mode"); this.__controller.setupStaticField(); if (this.__options.mouseEvents) { this.__controller.addMouseEventListener(); @@ -5311,60 +5059,62 @@ export default function() { return this.__controller.getAriaLabel(); }; return StaticMath; - }(APIClasses.AbstractMathQuill)), - _c.RootBlock = MathBlock, - _c; + })(APIClasses.AbstractMathQuill)), + (_c.RootBlock = MathBlock), + _c + ); }; var RootMathBlock = /** @class */ (function (_super) { __extends(RootMathBlock, _super); function RootMathBlock() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } return RootMathBlock; - }(MathBlock)); + })(MathBlock); RootBlockMixin(RootMathBlock.prototype); // adds methods to RootMathBlock API.MathField = function (APIClasses) { var _c; - return _c = /** @class */ (function (_super) { + return ( + (_c = /** @class */ (function (_super) { __extends(MathField, _super); function MathField() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } MathField.prototype.__mathquillify = function (opts, interfaceVersion) { this.config(opts); - if (interfaceVersion > 1) - this.__controller.root.reflow = noop; - _super.prototype.mathquillify.call(this, 'dcg-mq-editable-field dcg-mq-math-mode'); + if (interfaceVersion > 1) this.__controller.root.reflow = noop; + _super.prototype.mathquillify.call(this, "dcg-mq-editable-field dcg-mq-math-mode"); // TODO: Why does this need to be deleted (contrary to the type definition)? Could we set it to `noop` instead? delete this.__controller.root.reflow; return this; }; return MathField; - }(APIClasses.EditableField)), - _c.RootBlock = RootMathBlock, - _c; + })(APIClasses.EditableField)), + (_c.RootBlock = RootMathBlock), + _c + ); }; API.InnerMathField = function (APIClasses) { - pray('MathField class is defined', APIClasses.MathField); + pray("MathField class is defined", APIClasses.MathField); return /** @class */ (function (_super) { __extends(class_1, _super); function class_1() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } class_1.prototype.makeStatic = function () { this.__controller.editable = false; this.__controller.root.blur(); this.__controller.unbindEditablesEvents(); - domFrag(this.__controller.container).removeClass('dcg-mq-editable-field'); + domFrag(this.__controller.container).removeClass("dcg-mq-editable-field"); }; class_1.prototype.makeEditable = function () { this.__controller.editable = true; this.__controller.editablesTextareaEvents(); this.__controller.cursor.insAtRightEnd(this.__controller.root); - domFrag(this.__controller.container).addClass('dcg-mq-editable-field'); + domFrag(this.__controller.container).addClass("dcg-mq-editable-field"); }; return class_1; - }(APIClasses.MathField)); + })(APIClasses.MathField); }; /************************************************* * Abstract classes of text blocks @@ -5378,18 +5128,16 @@ export default function() { var TextBlock = /** @class */ (function (_super) { __extends(TextBlock, _super); function TextBlock() { - var _this_1 = _super !== null && _super.apply(this, arguments) || this; - _this_1.ctrlSeq = '\\text'; - _this_1.ariaLabel = 'Text'; - _this_1.mathspeakTemplate = ['StartText', 'EndText']; + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = "\\text"; + _this_1.ariaLabel = "Text"; + _this_1.mathspeakTemplate = ["StartText", "EndText"]; return _this_1; } TextBlock.prototype.replaces = function (replacedText) { if (replacedText instanceof Fragment) { this.replacedText = replacedText.remove().domFrag().text(); - } - else if (typeof replacedText === 'string') - this.replacedText = replacedText; + } else if (typeof replacedText === "string") this.replacedText = replacedText; }; TextBlock.prototype.setDOMFrag = function (el) { _super.prototype.setDOM.call(this, el); @@ -5410,11 +5158,9 @@ export default function() { for (var i = 0; i < textBlock.replacedText.length; i += 1) textBlock.write(cursor, textBlock.replacedText.charAt(i)); var textBlockR = textBlock[R]; - if (textBlockR) - textBlockR.siblingCreated(cursor.options, L); + if (textBlockR) textBlockR.siblingCreated(cursor.options, L); var textBlockL = textBlock[L]; - if (textBlockL) - textBlockL.siblingCreated(cursor.options, R); + if (textBlockL) textBlockL.siblingCreated(cursor.options, R); textBlock.bubble(function (node) { node.reflow(); return undefined; @@ -5427,18 +5173,17 @@ export default function() { var regex = Parser.regex; var optWhitespace = Parser.optWhitespace; return optWhitespace - .then(string('{')) + .then(string("{")) .then(regex(/^[^}]*/)) - .skip(string('}')) + .skip(string("}")) .map(function (text) { - if (text.length === 0) - return new Fragment(0, 0); - new TextPiece(text).adopt(textBlock, 0, 0); - return textBlock; - }); + if (text.length === 0) return new Fragment(0, 0); + new TextPiece(text).adopt(textBlock, 0, 0); + return textBlock; + }); }; TextBlock.prototype.textContents = function () { - return this.foldChildren('', function (text, child) { + return this.foldChildren("", function (text, child) { return text + child.textStr; }); }; @@ -5449,31 +5194,22 @@ export default function() { this.checkCursorContextOpen(ctx); var contents = this.textContents(); if (contents.length > 0) { - ctx.latex += this.ctrlSeq + '{'; - ctx.latex += contents - .replace(/\\/g, '\\backslash ') - .replace(/[{}]/g, '\\$&'); - ctx.latex += '}'; + ctx.latex += this.ctrlSeq + "{"; + ctx.latex += contents.replace(/\\/g, "\\backslash ").replace(/[{}]/g, "\\$&"); + ctx.latex += "}"; } this.checkCursorContextClose(ctx); }; TextBlock.prototype.html = function () { - var out = h('span', { class: 'dcg-mq-text-mode' }, [ - h.text(this.textContents()), - ]); + var out = h("span", { class: "dcg-mq-text-mode" }, [h.text(this.textContents())]); this.setDOM(out); NodeBase.linkElementByCmdNode(out, this); return out; }; TextBlock.prototype.mathspeak = function (opts) { if (opts && opts.ignoreShorthand) { - return (this.mathspeakTemplate[0] + - ', ' + - this.textContents() + - ', ' + - this.mathspeakTemplate[1]); - } - else { + return this.mathspeakTemplate[0] + ", " + this.textContents() + ", " + this.mathspeakTemplate[1]; + } else { return this.textContents(); } }; @@ -5485,9 +5221,7 @@ export default function() { // the cursor TextBlock.prototype.moveTowards = function (dir, cursor) { cursor.insAtDirEnd(-dir, this); - cursor.controller.aria - .queueDirEndOf(-dir) - .queue(cursor.parent, true); + cursor.controller.aria.queueDirEndOf(-dir).queue(cursor.parent, true); }; TextBlock.prototype.moveOutOf = function (dir, cursor) { cursor.insDirOf(dir, this); @@ -5508,26 +5242,19 @@ export default function() { }; TextBlock.prototype.deleteOutOf = function (_dir, cursor) { // backspace and delete at ends of block don't unwrap - if (this.isEmpty()) - cursor.insRightOf(this); + if (this.isEmpty()) cursor.insRightOf(this); }; TextBlock.prototype.write = function (cursor, ch) { cursor.show().deleteSelection(); - if (ch !== '$') { + if (ch !== "$") { var cursorL = cursor[L]; - if (!cursorL) - new TextPiece(ch).createLeftOf(cursor); - else if (cursorL instanceof TextPiece) - cursorL.appendText(ch); - } - else if (this.isEmpty()) { + if (!cursorL) new TextPiece(ch).createLeftOf(cursor); + else if (cursorL instanceof TextPiece) cursorL.appendText(ch); + } else if (this.isEmpty()) { cursor.insRightOf(this); - new VanillaSymbol('\\$', h.text('$')).createLeftOf(cursor); - } - else if (!cursor[R]) - cursor.insRightOf(this); - else if (!cursor[L]) - cursor.insLeftOf(this); + new VanillaSymbol("\\$", h.text("$")).createLeftOf(cursor); + } else if (!cursor[R]) cursor.insRightOf(this); + else if (!cursor[L]) cursor.insLeftOf(this); else { // split apart var leftBlock = new TextBlock(); @@ -5548,10 +5275,8 @@ export default function() { }; TextBlock.prototype.writeLatex = function (cursor, latex) { var cursorL = cursor[L]; - if (!cursorL) - new TextPiece(latex).createLeftOf(cursor); - else if (cursorL instanceof TextPiece) - cursorL.appendText(latex); + if (!cursorL) new TextPiece(latex).createLeftOf(cursor); + else if (cursorL instanceof TextPiece) cursorL.appendText(latex); this.bubble(function (node) { node.reflow(); return undefined; @@ -5560,28 +5285,26 @@ export default function() { TextBlock.prototype.seek = function (clientX, cursor) { cursor.hide(); var textPc = TextBlockFuseChildren(this); - if (!textPc) - return; + if (!textPc) return; // insert cursor at approx position in DOMTextNode var textNode = this.domFrag().children().oneText(); var range = document.createRange(); range.selectNodeContents(textNode); var rects = range.getClientRects(); if (rects.length === 1) { - var _c = rects[0], width = _c.width, left = _c.left; + var _c = rects[0], + width = _c.width, + left = _c.left; var avgChWidth = width / this.textContents().length; var approxPosition = Math.round((clientX - left) / avgChWidth); if (approxPosition <= 0) { cursor.insAtLeftEnd(this); - } - else if (approxPosition >= textPc.textStr.length) { + } else if (approxPosition >= textPc.textStr.length) { cursor.insAtRightEnd(this); - } - else { + } else { cursor.insLeftOf(textPc.splitRight(approxPosition)); } - } - else { + } else { cursor.insAtLeftEnd(this); } // move towards mousedown (clientX) @@ -5594,28 +5317,23 @@ export default function() { prevDispl = displ; displ = clientX - cursor.getBoundingClientRectWithoutMargin().left; } - if (dir * displ < -dir * prevDispl) - cursor[-dir].moveTowards(-dir, cursor); + if (dir * displ < -dir * prevDispl) cursor[-dir].moveTowards(-dir, cursor); if (!cursor.anticursor) { // about to start mouse-selecting, the anticursor is gonna get put here var cursorL = cursor[L]; - this.anticursorPosition = - cursorL && cursorL.textStr.length; + this.anticursorPosition = cursorL && cursorL.textStr.length; // ^ get it? 'cos if there's no cursor[L], it's 0... I'm a terrible person. - } - else if (cursor.anticursor.parent === this) { + } else if (cursor.anticursor.parent === this) { // mouse-selecting within this TextBlock, re-insert the anticursor var cursorL = cursor[L]; var cursorPosition = cursorL && cursorL.textStr.length; if (this.anticursorPosition === cursorPosition) { cursor.anticursor = Anticursor.fromCursor(cursor); - } - else { + } else { if (this.anticursorPosition < cursorPosition) { var newTextPc = cursorL.splitRight(this.anticursorPosition); cursor[L] = newTextPc; - } - else { + } else { var cursorR = cursor[R]; var newTextPc = cursorR.splitRight(this.anticursorPosition - cursorPosition); } @@ -5625,30 +5343,24 @@ export default function() { }; TextBlock.prototype.blur = function (cursor) { MathBlock.prototype.blur.call(this, cursor); - if (!cursor) - return; - if (this.textContents() === '') { + if (!cursor) return; + if (this.textContents() === "") { this.remove(); - if (cursor[L] === this) - cursor[L] = this[L]; - else if (cursor[R] === this) - cursor[R] = this[R]; - } - else - TextBlockFuseChildren(this); + if (cursor[L] === this) cursor[L] = this[L]; + else if (cursor[R] === this) cursor[R] = this[R]; + } else TextBlockFuseChildren(this); }; TextBlock.prototype.focus = function () { MathBlock.prototype.focus.call(this); }; return TextBlock; - }(MQNode)); + })(MQNode); function TextBlockFuseChildren(self) { self.domFrag().oneElement().normalize(); var children = self.domFrag().children(); - if (children.isEmpty()) - return; + if (children.isEmpty()) return; var textPcDom = children.oneText(); - pray('only node in TextBlock span is Text node', textPcDom.nodeType === 3); + pray("only node in TextBlock span is Text node", textPcDom.nodeType === 3); // nodeType === 3 has meant a Text node since ancient times: // http://reference.sitepoint.com/javascript/Node/nodeType var textPc = new TextPiece(textPcDom.data); @@ -5686,10 +5398,8 @@ export default function() { }; TextPiece.prototype.insTextAtDirEnd = function (text, dir) { prayDirection(dir); - if (dir === R) - this.appendText(text); - else - this.prependText(text); + if (dir === R) this.appendText(text); + else this.prependText(text); }; TextPiece.prototype.splitRight = function (i) { var newPc = new TextPiece(this.textStr.slice(i)).adopt(this.parent, this, this[R]); @@ -5704,10 +5414,8 @@ export default function() { prayDirection(dir); var ch = this.endChar(-dir, this.textStr); var from = this[-dir]; - if (from instanceof TextPiece) - from.insTextAtDirEnd(ch, dir); - else - new TextPiece(ch).createDir(-dir, cursor); + if (from instanceof TextPiece) from.insTextAtDirEnd(ch, dir); + else new TextPiece(ch).createDir(-dir, cursor); return this.deleteTowards(dir, cursor); }; TextPiece.prototype.mathspeak = function () { @@ -5725,8 +5433,7 @@ export default function() { this.domFrag().oneText().deleteData(0, 1); deletedChar = this.textStr[0]; this.textStr = this.textStr.slice(1); - } - else { + } else { // note that the order of these 2 lines is annoyingly important // (the second line mutates this.textStr.length) this.domFrag() @@ -5736,8 +5443,7 @@ export default function() { this.textStr = this.textStr.slice(0, -1); } cursor.controller.aria.queue(deletedChar); - } - else { + } else { this.remove(); cursor[dir] = this[dir]; cursor.controller.aria.queue(this.textStr); @@ -5746,18 +5452,15 @@ export default function() { TextPiece.prototype.selectTowards = function (dir, cursor) { prayDirection(dir); var anticursor = cursor.anticursor; - if (!anticursor) - return; + if (!anticursor) return; var ch = this.endChar(-dir, this.textStr); if (anticursor[dir] === this) { var newPc = new TextPiece(ch).createDir(dir, cursor); anticursor[dir] = newPc; cursor.insDirOf(dir, newPc); - } - else { + } else { var from = this[-dir]; - if (from instanceof TextPiece) - from.insTextAtDirEnd(ch, dir); + if (from instanceof TextPiece) from.insTextAtDirEnd(ch, dir); else { var newPc = new TextPiece(ch).createDir(-dir, cursor); var selection = cursor.selection; @@ -5772,20 +5475,15 @@ export default function() { return this.deleteTowards(dir, cursor); }; return TextPiece; - }(MQNode)); - LatexCmds.text = - LatexCmds.textnormal = - LatexCmds.textrm = - LatexCmds.textup = - LatexCmds.textmd = - TextBlock; + })(MQNode); + LatexCmds.text = LatexCmds.textnormal = LatexCmds.textrm = LatexCmds.textup = LatexCmds.textmd = TextBlock; function makeTextBlock(latex, ariaLabel, tagName, attrs) { return /** @class */ (function (_super) { __extends(class_2, _super); function class_2() { - var _this_1 = _super !== null && _super.apply(this, arguments) || this; + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; _this_1.ctrlSeq = latex; - _this_1.mathspeakTemplate = ['Start' + ariaLabel, 'End' + ariaLabel]; + _this_1.mathspeakTemplate = ["Start" + ariaLabel, "End" + ariaLabel]; _this_1.ariaLabel = ariaLabel; return _this_1; } @@ -5796,39 +5494,41 @@ export default function() { return out; }; return class_2; - }(TextBlock)); + })(TextBlock); } - LatexCmds.em = - LatexCmds.italic = - LatexCmds.italics = - LatexCmds.emph = - LatexCmds.textit = - LatexCmds.textsl = - makeTextBlock('\\textit', 'Italic', 'i', { class: 'dcg-mq-text-mode' }); - LatexCmds.strong = - LatexCmds.bold = - LatexCmds.textbf = - makeTextBlock('\\textbf', 'Bold', 'b', { class: 'dcg-mq-text-mode' }); - LatexCmds.sf = LatexCmds.textsf = makeTextBlock('\\textsf', 'Sans serif font', 'span', { class: 'dcg-mq-sans-serif dcg-mq-text-mode' }); - LatexCmds.tt = LatexCmds.texttt = makeTextBlock('\\texttt', 'Mono space font', 'span', { class: 'dcg-mq-monospace dcg-mq-text-mode' }); - LatexCmds.textsc = makeTextBlock('\\textsc', 'Variable font', 'span', { - style: 'font-variant:small-caps', - class: 'dcg-mq-text-mode', + LatexCmds.em = LatexCmds.italic = LatexCmds.italics = LatexCmds.emph = LatexCmds.textit = LatexCmds.textsl = makeTextBlock( + "\\textit", + "Italic", + "i", + { class: "dcg-mq-text-mode" } + ); + LatexCmds.strong = LatexCmds.bold = LatexCmds.textbf = makeTextBlock("\\textbf", "Bold", "b", { + class: "dcg-mq-text-mode", + }); + LatexCmds.sf = LatexCmds.textsf = makeTextBlock("\\textsf", "Sans serif font", "span", { + class: "dcg-mq-sans-serif dcg-mq-text-mode", }); - LatexCmds.uppercase = makeTextBlock('\\uppercase', 'Uppercase', 'span', { - style: 'text-transform:uppercase', - class: 'dcg-mq-text-mode', + LatexCmds.tt = LatexCmds.texttt = makeTextBlock("\\texttt", "Mono space font", "span", { + class: "dcg-mq-monospace dcg-mq-text-mode", }); - LatexCmds.lowercase = makeTextBlock('\\lowercase', 'Lowercase', 'span', { - style: 'text-transform:lowercase', - class: 'dcg-mq-text-mode', + LatexCmds.textsc = makeTextBlock("\\textsc", "Variable font", "span", { + style: "font-variant:small-caps", + class: "dcg-mq-text-mode", + }); + LatexCmds.uppercase = makeTextBlock("\\uppercase", "Uppercase", "span", { + style: "text-transform:uppercase", + class: "dcg-mq-text-mode", + }); + LatexCmds.lowercase = makeTextBlock("\\lowercase", "Lowercase", "span", { + style: "text-transform:lowercase", + class: "dcg-mq-text-mode", }); var RootMathCommand = /** @class */ (function (_super) { __extends(RootMathCommand, _super); function RootMathCommand(cursor) { - var _this_1 = _super.call(this, '$') || this; + var _this_1 = _super.call(this, "$") || this; _this_1.domView = new DOMView(1, function (blocks) { - return h.block('span', { class: 'dcg-mq-math-mode' }, blocks[0]); + return h.block("span", { class: "dcg-mq-math-mode" }, blocks[0]); }); _this_1.cursor = cursor; return _this_1; @@ -5838,172 +5538,143 @@ export default function() { var endsL = this.getEnd(L); // TODO - how do we know this is a RootMathCommand? endsL.cursor = this.cursor; endsL.write = function (cursor, ch) { - if (ch !== '$') - MathBlock.prototype.write.call(this, cursor, ch); + if (ch !== "$") MathBlock.prototype.write.call(this, cursor, ch); else if (this.isEmpty()) { cursor.insRightOf(this.parent); this.parent.deleteTowards(undefined, cursor); - new VanillaSymbol('\\$', h.text('$')).createLeftOf(cursor.show()); - } - else if (!cursor[R]) - cursor.insRightOf(this.parent); - else if (!cursor[L]) - cursor.insLeftOf(this.parent); - else - MathBlock.prototype.write.call(this, cursor, ch); + new VanillaSymbol("\\$", h.text("$")).createLeftOf(cursor.show()); + } else if (!cursor[R]) cursor.insRightOf(this.parent); + else if (!cursor[L]) cursor.insLeftOf(this.parent); + else MathBlock.prototype.write.call(this, cursor, ch); }; }; RootMathCommand.prototype.latexRecursive = function (ctx) { this.checkCursorContextOpen(ctx); - ctx.latex += '$'; + ctx.latex += "$"; this.getEnd(L).latexRecursive(ctx); - ctx.latex += '$'; + ctx.latex += "$"; this.checkCursorContextClose(ctx); }; return RootMathCommand; - }(MathCommand)); + })(MathCommand); var RootTextBlock = /** @class */ (function (_super) { __extends(RootTextBlock, _super); function RootTextBlock() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } RootTextBlock.prototype.keystroke = function (key, e, ctrlr) { - if (key === 'Spacebar' || key === 'Shift-Spacebar') - return; + if (key === "Spacebar" || key === "Shift-Spacebar") return; return _super.prototype.keystroke.call(this, key, e, ctrlr); }; RootTextBlock.prototype.write = function (cursor, ch) { cursor.show().deleteSelection(); - if (ch === '$') - new RootMathCommand(cursor).createLeftOf(cursor); + if (ch === "$") new RootMathCommand(cursor).createLeftOf(cursor); else { var html; - if (ch === '<') - html = h.entityText('<'); - else if (ch === '>') - html = h.entityText('>'); + if (ch === "<") html = h.entityText("<"); + else if (ch === ">") html = h.entityText(">"); new VanillaSymbol(ch, html).createLeftOf(cursor); } }; return RootTextBlock; - }(RootMathBlock)); + })(RootMathBlock); API.TextField = function (APIClasses) { var _c; - return _c = /** @class */ (function (_super) { + return ( + (_c = /** @class */ (function (_super) { __extends(TextField, _super); function TextField() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } TextField.prototype.__mathquillify = function () { - _super.prototype.mathquillify.call(this, 'dcg-mq-editable-field dcg-mq-text-mode'); + _super.prototype.mathquillify.call(this, "dcg-mq-editable-field dcg-mq-text-mode"); return this; }; TextField.prototype.latex = function (latex) { if (latex) { this.__controller.renderLatexText(latex); - if (this.__controller.blurred) - this.__controller.cursor.hide().parent.blur(); + if (this.__controller.blurred) this.__controller.cursor.hide().parent.blur(); var _this = this; // just to help help TS out return _this; } return this.__controller.exportLatex(); }; return TextField; - }(APIClasses.EditableField)), - _c.RootBlock = RootTextBlock, - _c; + })(APIClasses.EditableField)), + (_c.RootBlock = RootTextBlock), + _c + ); }; /************************************ * Symbols for Advanced Mathematics ***********************************/ - LatexCmds.notin = - LatexCmds.cong = - LatexCmds.equiv = - LatexCmds.oplus = - LatexCmds.otimes = - function (latex) { - return new BinaryOperator('\\' + latex + ' ', h.entityText('&' + latex + ';')); - }; - LatexCmds['\u2217'] = - LatexCmds.ast = - LatexCmds.star = - LatexCmds.loast = - LatexCmds.lowast = - bindBinaryOperator('\\ast ', '∗', 'low asterisk'); - LatexCmds.therefor = LatexCmds.therefore = bindBinaryOperator('\\therefore ', '∴', 'therefore'); + LatexCmds.notin = LatexCmds.cong = LatexCmds.equiv = LatexCmds.oplus = LatexCmds.otimes = function (latex) { + return new BinaryOperator("\\" + latex + " ", h.entityText("&" + latex + ";")); + }; + LatexCmds["\u2217"] = LatexCmds.ast = LatexCmds.star = LatexCmds.loast = LatexCmds.lowast = bindBinaryOperator( + "\\ast ", + "∗", + "low asterisk" + ); + LatexCmds.therefor = LatexCmds.therefore = bindBinaryOperator("\\therefore ", "∴", "therefore"); LatexCmds.cuz = LatexCmds.because = bindBinaryOperator( - // l33t - '\\because ', '∵', 'because'); - LatexCmds.prop = LatexCmds.propto = bindBinaryOperator('\\propto ', '∝', 'proportional to'); - LatexCmds['\u2248'] = - LatexCmds.asymp = - LatexCmds.approx = - bindBinaryOperator('\\approx ', '≈', 'approximately equal to'); - LatexCmds.isin = LatexCmds['in'] = bindBinaryOperator('\\in ', '∈', 'is in'); - LatexCmds.ni = LatexCmds.contains = bindBinaryOperator('\\ni ', '∋', 'is not in'); - LatexCmds.notni = - LatexCmds.niton = - LatexCmds.notcontains = - LatexCmds.doesnotcontain = - bindBinaryOperator('\\not\\ni ', '∌', 'does not contain'); - LatexCmds.sub = LatexCmds.subset = bindBinaryOperator('\\subset ', '⊂', 'subset'); - LatexCmds.sup = - LatexCmds.supset = - LatexCmds.superset = - bindBinaryOperator('\\supset ', '⊃', 'superset'); - LatexCmds.nsub = - LatexCmds.notsub = - LatexCmds.nsubset = - LatexCmds.notsubset = - bindBinaryOperator('\\not\\subset ', '⊄', 'not a subset'); - LatexCmds.nsup = - LatexCmds.notsup = - LatexCmds.nsupset = - LatexCmds.notsupset = - LatexCmds.nsuperset = - LatexCmds.notsuperset = - bindBinaryOperator('\\not\\supset ', '⊅', 'not a superset'); - LatexCmds.sube = - LatexCmds.subeq = - LatexCmds.subsete = - LatexCmds.subseteq = - bindBinaryOperator('\\subseteq ', '⊆', 'subset or equal to'); - LatexCmds.supe = - LatexCmds.supeq = - LatexCmds.supsete = - LatexCmds.supseteq = - LatexCmds.supersete = - LatexCmds.superseteq = - bindBinaryOperator('\\supseteq ', '⊇', 'superset or equal to'); - LatexCmds.nsube = - LatexCmds.nsubeq = - LatexCmds.notsube = - LatexCmds.notsubeq = - LatexCmds.nsubsete = - LatexCmds.nsubseteq = - LatexCmds.notsubsete = - LatexCmds.notsubseteq = - bindBinaryOperator('\\not\\subseteq ', '⊈', 'not subset or equal to'); - LatexCmds.nsupe = - LatexCmds.nsupeq = - LatexCmds.notsupe = - LatexCmds.notsupeq = - LatexCmds.nsupsete = - LatexCmds.nsupseteq = - LatexCmds.notsupsete = - LatexCmds.notsupseteq = - LatexCmds.nsupersete = - LatexCmds.nsuperseteq = - LatexCmds.notsupersete = - LatexCmds.notsuperseteq = - bindBinaryOperator('\\not\\supseteq ', '⊉', 'not superset or equal to'); + // l33t + "\\because ", + "∵", + "because" + ); + LatexCmds.prop = LatexCmds.propto = bindBinaryOperator("\\propto ", "∝", "proportional to"); + LatexCmds["\u2248"] = LatexCmds.asymp = LatexCmds.approx = bindBinaryOperator( + "\\approx ", + "≈", + "approximately equal to" + ); + LatexCmds.isin = LatexCmds["in"] = bindBinaryOperator("\\in ", "∈", "is in"); + LatexCmds.ni = LatexCmds.contains = bindBinaryOperator("\\ni ", "∋", "is not in"); + LatexCmds.notni = LatexCmds.niton = LatexCmds.notcontains = LatexCmds.doesnotcontain = bindBinaryOperator( + "\\not\\ni ", + "∌", + "does not contain" + ); + LatexCmds.sub = LatexCmds.subset = bindBinaryOperator("\\subset ", "⊂", "subset"); + LatexCmds.sup = LatexCmds.supset = LatexCmds.superset = bindBinaryOperator("\\supset ", "⊃", "superset"); + LatexCmds.nsub = LatexCmds.notsub = LatexCmds.nsubset = LatexCmds.notsubset = bindBinaryOperator( + "\\not\\subset ", + "⊄", + "not a subset" + ); + LatexCmds.nsup = LatexCmds.notsup = LatexCmds.nsupset = LatexCmds.notsupset = LatexCmds.nsuperset = LatexCmds.notsuperset = bindBinaryOperator( + "\\not\\supset ", + "⊅", + "not a superset" + ); + LatexCmds.sube = LatexCmds.subeq = LatexCmds.subsete = LatexCmds.subseteq = bindBinaryOperator( + "\\subseteq ", + "⊆", + "subset or equal to" + ); + LatexCmds.supe = LatexCmds.supeq = LatexCmds.supsete = LatexCmds.supseteq = LatexCmds.supersete = LatexCmds.superseteq = bindBinaryOperator( + "\\supseteq ", + "⊇", + "superset or equal to" + ); + LatexCmds.nsube = LatexCmds.nsubeq = LatexCmds.notsube = LatexCmds.notsubeq = LatexCmds.nsubsete = LatexCmds.nsubseteq = LatexCmds.notsubsete = LatexCmds.notsubseteq = bindBinaryOperator( + "\\not\\subseteq ", + "⊈", + "not subset or equal to" + ); + LatexCmds.nsupe = LatexCmds.nsupeq = LatexCmds.notsupe = LatexCmds.notsupeq = LatexCmds.nsupsete = LatexCmds.nsupseteq = LatexCmds.notsupsete = LatexCmds.notsupseteq = LatexCmds.nsupersete = LatexCmds.nsuperseteq = LatexCmds.notsupersete = LatexCmds.notsuperseteq = bindBinaryOperator( + "\\not\\supseteq ", + "⊉", + "not superset or equal to" + ); //the canonical sets of numbers LatexCmds.mathbb = /** @class */ (function (_super) { __extends(class_3, _super); function class_3() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } - class_3.prototype.createLeftOf = function (_cursor) { }; + class_3.prototype.createLeftOf = function (_cursor) {}; class_3.prototype.numBlocks = function () { return 1; }; @@ -6012,65 +5683,45 @@ export default function() { var regex = Parser.regex; var optWhitespace = Parser.optWhitespace; return optWhitespace - .then(string('{')) + .then(string("{")) .then(optWhitespace) .then(regex(/^[NPZQRCH]/)) .skip(optWhitespace) - .skip(string('}')) + .skip(string("}")) .map(function (c) { - // instantiate the class for the matching char - var cmd = LatexCmds[c]; - if (isMQNodeClass(cmd)) { - return new cmd(); - } - else { - return cmd(); - } - }); + // instantiate the class for the matching char + var cmd = LatexCmds[c]; + if (isMQNodeClass(cmd)) { + return new cmd(); + } else { + return cmd(); + } + }); }; return class_3; - }(MathCommand)); - LatexCmds.N = - LatexCmds.naturals = - LatexCmds.Naturals = - bindVanillaSymbol('\\mathbb{N}', 'ℕ', 'naturals'); - LatexCmds.P = - LatexCmds.primes = - LatexCmds.Primes = - LatexCmds.projective = - LatexCmds.Projective = - LatexCmds.probability = - LatexCmds.Probability = - bindVanillaSymbol('\\mathbb{P}', 'ℙ', 'P'); - LatexCmds.Z = - LatexCmds.integers = - LatexCmds.Integers = - bindVanillaSymbol('\\mathbb{Z}', 'ℤ', 'integers'); - LatexCmds.Q = - LatexCmds.rationals = - LatexCmds.Rationals = - bindVanillaSymbol('\\mathbb{Q}', 'ℚ', 'rationals'); - LatexCmds.R = - LatexCmds.reals = - LatexCmds.Reals = - bindVanillaSymbol('\\mathbb{R}', 'ℝ', 'reals'); - LatexCmds.C = - LatexCmds.complex = - LatexCmds.Complex = - LatexCmds.complexes = - LatexCmds.Complexes = - LatexCmds.complexplane = - LatexCmds.Complexplane = - LatexCmds.ComplexPlane = - bindVanillaSymbol('\\mathbb{C}', 'ℂ', 'complexes'); - LatexCmds.H = - LatexCmds.Hamiltonian = - LatexCmds.quaternions = - LatexCmds.Quaternions = - bindVanillaSymbol('\\mathbb{H}', 'ℍ', 'quaternions'); + })(MathCommand); + LatexCmds.N = LatexCmds.naturals = LatexCmds.Naturals = bindVanillaSymbol("\\mathbb{N}", "ℕ", "naturals"); + LatexCmds.P = LatexCmds.primes = LatexCmds.Primes = LatexCmds.projective = LatexCmds.Projective = LatexCmds.probability = LatexCmds.Probability = bindVanillaSymbol( + "\\mathbb{P}", + "ℙ", + "P" + ); + LatexCmds.Z = LatexCmds.integers = LatexCmds.Integers = bindVanillaSymbol("\\mathbb{Z}", "ℤ", "integers"); + LatexCmds.Q = LatexCmds.rationals = LatexCmds.Rationals = bindVanillaSymbol("\\mathbb{Q}", "ℚ", "rationals"); + LatexCmds.R = LatexCmds.reals = LatexCmds.Reals = bindVanillaSymbol("\\mathbb{R}", "ℝ", "reals"); + LatexCmds.C = LatexCmds.complex = LatexCmds.Complex = LatexCmds.complexes = LatexCmds.Complexes = LatexCmds.complexplane = LatexCmds.Complexplane = LatexCmds.ComplexPlane = bindVanillaSymbol( + "\\mathbb{C}", + "ℂ", + "complexes" + ); + LatexCmds.H = LatexCmds.Hamiltonian = LatexCmds.quaternions = LatexCmds.Quaternions = bindVanillaSymbol( + "\\mathbb{H}", + "ℍ", + "quaternions" + ); //spacing - LatexCmds.quad = LatexCmds.emsp = bindVanillaSymbol('\\quad ', ' ', '4 spaces'); - LatexCmds.qquad = bindVanillaSymbol('\\qquad ', ' ', '8 spaces'); + LatexCmds.quad = LatexCmds.emsp = bindVanillaSymbol("\\quad ", " ", "4 spaces"); + LatexCmds.qquad = bindVanillaSymbol("\\qquad ", " ", "8 spaces"); /* spacing special characters, gonna have to implement this in LatexCommandInput::onText somehow case ',': return VanillaSymbol('\\, ',' ', 'comma'); @@ -6082,223 +5733,203 @@ export default function() { return MQSymbol('\\! ','', 'exclamation point'); */ //binary operators - LatexCmds.diamond = bindVanillaSymbol('\\diamond ', '◇', 'diamond'); - LatexCmds.bigtriangleup = bindVanillaSymbol('\\bigtriangleup ', '△', 'triangle up'); - LatexCmds.ominus = bindVanillaSymbol('\\ominus ', '⊖', 'o minus'); - LatexCmds.uplus = bindVanillaSymbol('\\uplus ', '⊎', 'disjoint union'); - LatexCmds.bigtriangledown = bindVanillaSymbol('\\bigtriangledown ', '▽', 'triangle down'); - LatexCmds.sqcap = bindVanillaSymbol('\\sqcap ', '⊓', 'greatest lower bound'); - LatexCmds.triangleleft = bindVanillaSymbol('\\triangleleft ', '⊲', 'triangle left'); - LatexCmds.sqcup = bindVanillaSymbol('\\sqcup ', '⊔', 'least upper bound'); - LatexCmds.triangleright = bindVanillaSymbol('\\triangleright ', '⊳', 'triangle right'); + LatexCmds.diamond = bindVanillaSymbol("\\diamond ", "◇", "diamond"); + LatexCmds.bigtriangleup = bindVanillaSymbol("\\bigtriangleup ", "△", "triangle up"); + LatexCmds.ominus = bindVanillaSymbol("\\ominus ", "⊖", "o minus"); + LatexCmds.uplus = bindVanillaSymbol("\\uplus ", "⊎", "disjoint union"); + LatexCmds.bigtriangledown = bindVanillaSymbol("\\bigtriangledown ", "▽", "triangle down"); + LatexCmds.sqcap = bindVanillaSymbol("\\sqcap ", "⊓", "greatest lower bound"); + LatexCmds.triangleleft = bindVanillaSymbol("\\triangleleft ", "⊲", "triangle left"); + LatexCmds.sqcup = bindVanillaSymbol("\\sqcup ", "⊔", "least upper bound"); + LatexCmds.triangleright = bindVanillaSymbol("\\triangleright ", "⊳", "triangle right"); //circledot is not a not real LaTex command see https://github.com/mathquill/mathquill/pull/552 for more details - LatexCmds.odot = LatexCmds.circledot = bindVanillaSymbol('\\odot ', '⊙', 'circle dot'); - LatexCmds.bigcirc = bindVanillaSymbol('\\bigcirc ', '◯', 'circle'); - LatexCmds.dagger = bindVanillaSymbol('\\dagger ', '†', 'dagger'); - LatexCmds.ddagger = bindVanillaSymbol('\\ddagger ', '‡', 'big dagger'); - LatexCmds.wr = bindVanillaSymbol('\\wr ', '≀', 'wreath'); - LatexCmds.amalg = bindVanillaSymbol('\\amalg ', '∐', 'amalgam'); + LatexCmds.odot = LatexCmds.circledot = bindVanillaSymbol("\\odot ", "⊙", "circle dot"); + LatexCmds.bigcirc = bindVanillaSymbol("\\bigcirc ", "◯", "circle"); + LatexCmds.dagger = bindVanillaSymbol("\\dagger ", "†", "dagger"); + LatexCmds.ddagger = bindVanillaSymbol("\\ddagger ", "‡", "big dagger"); + LatexCmds.wr = bindVanillaSymbol("\\wr ", "≀", "wreath"); + LatexCmds.amalg = bindVanillaSymbol("\\amalg ", "∐", "amalgam"); //relationship symbols - LatexCmds.models = bindVanillaSymbol('\\models ', '⊨', 'models'); - LatexCmds.prec = bindVanillaSymbol('\\prec ', '≺', 'precedes'); - LatexCmds.succ = bindVanillaSymbol('\\succ ', '≻', 'succeeds'); - LatexCmds.preceq = bindVanillaSymbol('\\preceq ', '≼', 'precedes or equals'); - LatexCmds.succeq = bindVanillaSymbol('\\succeq ', '≽', 'succeeds or equals'); - LatexCmds.simeq = bindVanillaSymbol('\\simeq ', '≃', 'similar or equal to'); - LatexCmds.mid = bindVanillaSymbol('\\mid ', '∣', 'divides'); - LatexCmds.ll = bindVanillaSymbol('\\ll ', '≪', 'll'); - LatexCmds.gg = bindVanillaSymbol('\\gg ', '≫', 'gg'); - LatexCmds.parallel = bindVanillaSymbol('\\parallel ', '∥', 'parallel with'); - LatexCmds.nparallel = bindVanillaSymbol('\\nparallel ', '∦', 'not parallel with'); - LatexCmds.bowtie = bindVanillaSymbol('\\bowtie ', '⋈', 'bowtie'); - LatexCmds.sqsubset = bindVanillaSymbol('\\sqsubset ', '⊏', 'square subset'); - LatexCmds.sqsupset = bindVanillaSymbol('\\sqsupset ', '⊐', 'square superset'); - LatexCmds.smile = bindVanillaSymbol('\\smile ', '⌣', 'smile'); - LatexCmds.sqsubseteq = bindVanillaSymbol('\\sqsubseteq ', '⊑', 'square subset or equal to'); - LatexCmds.sqsupseteq = bindVanillaSymbol('\\sqsupseteq ', '⊒', 'square superset or equal to'); - LatexCmds.doteq = bindVanillaSymbol('\\doteq ', '≐', 'dotted equals'); - LatexCmds.frown = bindVanillaSymbol('\\frown ', '⌢', 'frown'); - LatexCmds.vdash = bindVanillaSymbol('\\vdash ', '⊦', 'v dash'); - LatexCmds.dashv = bindVanillaSymbol('\\dashv ', '⊣', 'dash v'); - LatexCmds.nless = bindVanillaSymbol('\\nless ', '≮', 'not less than'); - LatexCmds.ngtr = bindVanillaSymbol('\\ngtr ', '≯', 'not greater than'); + LatexCmds.models = bindVanillaSymbol("\\models ", "⊨", "models"); + LatexCmds.prec = bindVanillaSymbol("\\prec ", "≺", "precedes"); + LatexCmds.succ = bindVanillaSymbol("\\succ ", "≻", "succeeds"); + LatexCmds.preceq = bindVanillaSymbol("\\preceq ", "≼", "precedes or equals"); + LatexCmds.succeq = bindVanillaSymbol("\\succeq ", "≽", "succeeds or equals"); + LatexCmds.simeq = bindVanillaSymbol("\\simeq ", "≃", "similar or equal to"); + LatexCmds.mid = bindVanillaSymbol("\\mid ", "∣", "divides"); + LatexCmds.ll = bindVanillaSymbol("\\ll ", "≪", "ll"); + LatexCmds.gg = bindVanillaSymbol("\\gg ", "≫", "gg"); + LatexCmds.parallel = bindVanillaSymbol("\\parallel ", "∥", "parallel with"); + LatexCmds.nparallel = bindVanillaSymbol("\\nparallel ", "∦", "not parallel with"); + LatexCmds.bowtie = bindVanillaSymbol("\\bowtie ", "⋈", "bowtie"); + LatexCmds.sqsubset = bindVanillaSymbol("\\sqsubset ", "⊏", "square subset"); + LatexCmds.sqsupset = bindVanillaSymbol("\\sqsupset ", "⊐", "square superset"); + LatexCmds.smile = bindVanillaSymbol("\\smile ", "⌣", "smile"); + LatexCmds.sqsubseteq = bindVanillaSymbol("\\sqsubseteq ", "⊑", "square subset or equal to"); + LatexCmds.sqsupseteq = bindVanillaSymbol("\\sqsupseteq ", "⊒", "square superset or equal to"); + LatexCmds.doteq = bindVanillaSymbol("\\doteq ", "≐", "dotted equals"); + LatexCmds.frown = bindVanillaSymbol("\\frown ", "⌢", "frown"); + LatexCmds.vdash = bindVanillaSymbol("\\vdash ", "⊦", "v dash"); + LatexCmds.dashv = bindVanillaSymbol("\\dashv ", "⊣", "dash v"); + LatexCmds.nless = bindVanillaSymbol("\\nless ", "≮", "not less than"); + LatexCmds.ngtr = bindVanillaSymbol("\\ngtr ", "≯", "not greater than"); //arrows - LatexCmds.longleftarrow = bindVanillaSymbol('\\longleftarrow ', '←', 'left arrow'); - LatexCmds.longrightarrow = bindVanillaSymbol('\\longrightarrow ', '→', 'right arrow'); - LatexCmds.Longleftarrow = bindVanillaSymbol('\\Longleftarrow ', '⇐', 'left arrow'); - LatexCmds.Longrightarrow = bindVanillaSymbol('\\Longrightarrow ', '⇒', 'right arrow'); - LatexCmds.longleftrightarrow = bindVanillaSymbol('\\longleftrightarrow ', '↔', 'left and right arrow'); - LatexCmds.updownarrow = bindVanillaSymbol('\\updownarrow ', '↕', 'up and down arrow'); - LatexCmds.Longleftrightarrow = bindVanillaSymbol('\\Longleftrightarrow ', '⇔', 'left and right arrow'); - LatexCmds.Updownarrow = bindVanillaSymbol('\\Updownarrow ', '⇕', 'up and down arrow'); - LatexCmds.mapsto = bindVanillaSymbol('\\mapsto ', '↦', 'maps to'); - LatexCmds.nearrow = bindVanillaSymbol('\\nearrow ', '↗', 'northeast arrow'); - LatexCmds.hookleftarrow = bindVanillaSymbol('\\hookleftarrow ', '↩', 'hook left arrow'); - LatexCmds.hookrightarrow = bindVanillaSymbol('\\hookrightarrow ', '↪', 'hook right arrow'); - LatexCmds.searrow = bindVanillaSymbol('\\searrow ', '↘', 'southeast arrow'); - LatexCmds.leftharpoonup = bindVanillaSymbol('\\leftharpoonup ', '↼', 'left harpoon up'); - LatexCmds.rightharpoonup = bindVanillaSymbol('\\rightharpoonup ', '⇀', 'right harpoon up'); - LatexCmds.swarrow = bindVanillaSymbol('\\swarrow ', '↙', 'southwest arrow'); - LatexCmds.leftharpoondown = bindVanillaSymbol('\\leftharpoondown ', '↽', 'left harpoon down'); - LatexCmds.rightharpoondown = bindVanillaSymbol('\\rightharpoondown ', '⇁', 'right harpoon down'); - LatexCmds.nwarrow = bindVanillaSymbol('\\nwarrow ', '↖', 'northwest arrow'); + LatexCmds.longleftarrow = bindVanillaSymbol("\\longleftarrow ", "←", "left arrow"); + LatexCmds.longrightarrow = bindVanillaSymbol("\\longrightarrow ", "→", "right arrow"); + LatexCmds.Longleftarrow = bindVanillaSymbol("\\Longleftarrow ", "⇐", "left arrow"); + LatexCmds.Longrightarrow = bindVanillaSymbol("\\Longrightarrow ", "⇒", "right arrow"); + LatexCmds.longleftrightarrow = bindVanillaSymbol("\\longleftrightarrow ", "↔", "left and right arrow"); + LatexCmds.updownarrow = bindVanillaSymbol("\\updownarrow ", "↕", "up and down arrow"); + LatexCmds.Longleftrightarrow = bindVanillaSymbol("\\Longleftrightarrow ", "⇔", "left and right arrow"); + LatexCmds.Updownarrow = bindVanillaSymbol("\\Updownarrow ", "⇕", "up and down arrow"); + LatexCmds.mapsto = bindVanillaSymbol("\\mapsto ", "↦", "maps to"); + LatexCmds.nearrow = bindVanillaSymbol("\\nearrow ", "↗", "northeast arrow"); + LatexCmds.hookleftarrow = bindVanillaSymbol("\\hookleftarrow ", "↩", "hook left arrow"); + LatexCmds.hookrightarrow = bindVanillaSymbol("\\hookrightarrow ", "↪", "hook right arrow"); + LatexCmds.searrow = bindVanillaSymbol("\\searrow ", "↘", "southeast arrow"); + LatexCmds.leftharpoonup = bindVanillaSymbol("\\leftharpoonup ", "↼", "left harpoon up"); + LatexCmds.rightharpoonup = bindVanillaSymbol("\\rightharpoonup ", "⇀", "right harpoon up"); + LatexCmds.swarrow = bindVanillaSymbol("\\swarrow ", "↙", "southwest arrow"); + LatexCmds.leftharpoondown = bindVanillaSymbol("\\leftharpoondown ", "↽", "left harpoon down"); + LatexCmds.rightharpoondown = bindVanillaSymbol("\\rightharpoondown ", "⇁", "right harpoon down"); + LatexCmds.nwarrow = bindVanillaSymbol("\\nwarrow ", "↖", "northwest arrow"); //Misc - LatexCmds.ldots = bindVanillaSymbol('\\ldots ', '…', 'l dots'); - LatexCmds.cdots = bindVanillaSymbol('\\cdots ', '⋯', 'c dots'); - LatexCmds.vdots = bindVanillaSymbol('\\vdots ', '⋮', 'v dots'); - LatexCmds.ddots = bindVanillaSymbol('\\ddots ', '⋱', 'd dots'); - LatexCmds.surd = bindVanillaSymbol('\\surd ', '√', 'unresolved root'); - LatexCmds.triangle = bindVanillaSymbol('\\triangle ', '△', 'triangle'); - LatexCmds.ell = bindVanillaSymbol('\\ell ', 'ℓ', 'ell'); - LatexCmds.top = bindVanillaSymbol('\\top ', '⊤', 'top'); - LatexCmds.flat = bindVanillaSymbol('\\flat ', '♭', 'flat'); - LatexCmds.natural = bindVanillaSymbol('\\natural ', '♮', 'natural'); - LatexCmds.sharp = bindVanillaSymbol('\\sharp ', '♯', 'sharp'); - LatexCmds.wp = bindVanillaSymbol('\\wp ', '℘', 'wp'); - LatexCmds.bot = bindVanillaSymbol('\\bot ', '⊥', 'bot'); - LatexCmds.clubsuit = bindVanillaSymbol('\\clubsuit ', '♣', 'club suit'); - LatexCmds.diamondsuit = bindVanillaSymbol('\\diamondsuit ', '♢', 'diamond suit'); - LatexCmds.heartsuit = bindVanillaSymbol('\\heartsuit ', '♡', 'heart suit'); - LatexCmds.spadesuit = bindVanillaSymbol('\\spadesuit ', '♠', 'spade suit'); + LatexCmds.ldots = bindVanillaSymbol("\\ldots ", "…", "l dots"); + LatexCmds.cdots = bindVanillaSymbol("\\cdots ", "⋯", "c dots"); + LatexCmds.vdots = bindVanillaSymbol("\\vdots ", "⋮", "v dots"); + LatexCmds.ddots = bindVanillaSymbol("\\ddots ", "⋱", "d dots"); + LatexCmds.surd = bindVanillaSymbol("\\surd ", "√", "unresolved root"); + LatexCmds.triangle = bindVanillaSymbol("\\triangle ", "△", "triangle"); + LatexCmds.ell = bindVanillaSymbol("\\ell ", "ℓ", "ell"); + LatexCmds.top = bindVanillaSymbol("\\top ", "⊤", "top"); + LatexCmds.flat = bindVanillaSymbol("\\flat ", "♭", "flat"); + LatexCmds.natural = bindVanillaSymbol("\\natural ", "♮", "natural"); + LatexCmds.sharp = bindVanillaSymbol("\\sharp ", "♯", "sharp"); + LatexCmds.wp = bindVanillaSymbol("\\wp ", "℘", "wp"); + LatexCmds.bot = bindVanillaSymbol("\\bot ", "⊥", "bot"); + LatexCmds.clubsuit = bindVanillaSymbol("\\clubsuit ", "♣", "club suit"); + LatexCmds.diamondsuit = bindVanillaSymbol("\\diamondsuit ", "♢", "diamond suit"); + LatexCmds.heartsuit = bindVanillaSymbol("\\heartsuit ", "♡", "heart suit"); + LatexCmds.spadesuit = bindVanillaSymbol("\\spadesuit ", "♠", "spade suit"); //not real LaTex command see https://github.com/mathquill/mathquill/pull/552 for more details - LatexCmds.parallelogram = bindVanillaSymbol('\\parallelogram ', '▱', 'parallelogram'); - LatexCmds.square = bindVanillaSymbol('\\square ', '⬜', 'square'); + LatexCmds.parallelogram = bindVanillaSymbol("\\parallelogram ", "▱", "parallelogram"); + LatexCmds.square = bindVanillaSymbol("\\square ", "⬜", "square"); //variable-sized - LatexCmds.oint = bindVanillaSymbol('\\oint ', '∮', 'o int'); - LatexCmds.bigcap = bindVanillaSymbol('\\bigcap ', '∩', 'big cap'); - LatexCmds.bigcup = bindVanillaSymbol('\\bigcup ', '∪', 'big cup'); - LatexCmds.bigsqcup = bindVanillaSymbol('\\bigsqcup ', '⊔', 'big square cup'); - LatexCmds.bigvee = bindVanillaSymbol('\\bigvee ', '∨', 'big vee'); - LatexCmds.bigwedge = bindVanillaSymbol('\\bigwedge ', '∧', 'big wedge'); - LatexCmds.bigodot = bindVanillaSymbol('\\bigodot ', '⊙', 'big o dot'); - LatexCmds.bigotimes = bindVanillaSymbol('\\bigotimes ', '⊗', 'big o times'); - LatexCmds.bigoplus = bindVanillaSymbol('\\bigoplus ', '⊕', 'big o plus'); - LatexCmds.biguplus = bindVanillaSymbol('\\biguplus ', '⊎', 'big u plus'); + LatexCmds.oint = bindVanillaSymbol("\\oint ", "∮", "o int"); + LatexCmds.bigcap = bindVanillaSymbol("\\bigcap ", "∩", "big cap"); + LatexCmds.bigcup = bindVanillaSymbol("\\bigcup ", "∪", "big cup"); + LatexCmds.bigsqcup = bindVanillaSymbol("\\bigsqcup ", "⊔", "big square cup"); + LatexCmds.bigvee = bindVanillaSymbol("\\bigvee ", "∨", "big vee"); + LatexCmds.bigwedge = bindVanillaSymbol("\\bigwedge ", "∧", "big wedge"); + LatexCmds.bigodot = bindVanillaSymbol("\\bigodot ", "⊙", "big o dot"); + LatexCmds.bigotimes = bindVanillaSymbol("\\bigotimes ", "⊗", "big o times"); + LatexCmds.bigoplus = bindVanillaSymbol("\\bigoplus ", "⊕", "big o plus"); + LatexCmds.biguplus = bindVanillaSymbol("\\biguplus ", "⊎", "big u plus"); //delimiters - LatexCmds.lfloor = bindVanillaSymbol('\\lfloor ', '⌊', 'left floor'); - LatexCmds.rfloor = bindVanillaSymbol('\\rfloor ', '⌋', 'right floor'); - LatexCmds.lceil = bindVanillaSymbol('\\lceil ', '⌈', 'left ceiling'); - LatexCmds.rceil = bindVanillaSymbol('\\rceil ', '⌉', 'right ceiling'); - LatexCmds.opencurlybrace = LatexCmds.lbrace = bindVanillaSymbol('\\lbrace ', '{', 'left brace'); - LatexCmds.closecurlybrace = LatexCmds.rbrace = bindVanillaSymbol('\\rbrace ', '}', 'right brace'); - LatexCmds.lbrack = bindVanillaSymbol('[', 'left bracket'); - LatexCmds.rbrack = bindVanillaSymbol(']', 'right bracket'); + LatexCmds.lfloor = bindVanillaSymbol("\\lfloor ", "⌊", "left floor"); + LatexCmds.rfloor = bindVanillaSymbol("\\rfloor ", "⌋", "right floor"); + LatexCmds.lceil = bindVanillaSymbol("\\lceil ", "⌈", "left ceiling"); + LatexCmds.rceil = bindVanillaSymbol("\\rceil ", "⌉", "right ceiling"); + LatexCmds.opencurlybrace = LatexCmds.lbrace = bindVanillaSymbol("\\lbrace ", "{", "left brace"); + LatexCmds.closecurlybrace = LatexCmds.rbrace = bindVanillaSymbol("\\rbrace ", "}", "right brace"); + LatexCmds.lbrack = bindVanillaSymbol("[", "left bracket"); + LatexCmds.rbrack = bindVanillaSymbol("]", "right bracket"); //various symbols - LatexCmds.slash = bindVanillaSymbol('/', 'slash'); - LatexCmds.vert = bindVanillaSymbol('|', 'vertical bar'); - LatexCmds.perp = LatexCmds.perpendicular = bindVanillaSymbol('\\perp ', '⊥', 'perpendicular'); - LatexCmds.nabla = LatexCmds.del = bindVanillaSymbol('\\nabla ', '∇'); - LatexCmds.hbar = bindVanillaSymbol('\\hbar ', 'ℏ', 'horizontal bar'); - LatexCmds.AA = - LatexCmds.Angstrom = - LatexCmds.angstrom = - bindVanillaSymbol('\\text\\AA ', 'Å', 'AA'); - LatexCmds.ring = - LatexCmds.circ = - LatexCmds.circle = - bindVanillaSymbol('\\circ ', '∘', 'circle'); - LatexCmds.bull = LatexCmds.bullet = bindVanillaSymbol('\\bullet ', '•', 'bullet'); - LatexCmds.setminus = LatexCmds.smallsetminus = bindVanillaSymbol('\\setminus ', '∖', 'set minus'); - LatexCmds.not = //bind(MQSymbol,'\\not ','/', 'not'); - LatexCmds['\u00ac'] = - LatexCmds.neg = - bindVanillaSymbol('\\neg ', '¬', 'not'); - LatexCmds['\u2026'] = - LatexCmds.dots = - LatexCmds.ellip = - LatexCmds.hellip = - LatexCmds.ellipsis = - LatexCmds.hellipsis = - bindVanillaSymbol('\\dots ', '…', 'ellipsis'); - LatexCmds.converges = - LatexCmds.darr = - LatexCmds.dnarr = - LatexCmds.dnarrow = - LatexCmds.downarrow = - bindVanillaSymbol('\\downarrow ', '↓', 'converges with'); - LatexCmds.dArr = - LatexCmds.dnArr = - LatexCmds.dnArrow = - LatexCmds.Downarrow = - bindVanillaSymbol('\\Downarrow ', '⇓', 'down arrow'); - LatexCmds.diverges = - LatexCmds.uarr = - LatexCmds.uparrow = - bindVanillaSymbol('\\uparrow ', '↑', 'diverges from'); - LatexCmds.uArr = LatexCmds.Uparrow = bindVanillaSymbol('\\Uparrow ', '⇑', 'up arrow'); - LatexCmds.rarr = LatexCmds.rightarrow = bindVanillaSymbol('\\rightarrow ', '→', 'right arrow'); - LatexCmds.implies = bindBinaryOperator('\\Rightarrow ', '⇒', 'implies'); - LatexCmds.rArr = LatexCmds.Rightarrow = bindVanillaSymbol('\\Rightarrow ', '⇒', 'right arrow'); - LatexCmds.gets = bindBinaryOperator('\\gets ', '←', 'gets'); - LatexCmds.larr = LatexCmds.leftarrow = bindVanillaSymbol('\\leftarrow ', '←', 'left arrow'); - LatexCmds.impliedby = bindBinaryOperator('\\Leftarrow ', '⇐', 'implied by'); - LatexCmds.lArr = LatexCmds.Leftarrow = bindVanillaSymbol('\\Leftarrow ', '⇐', 'left arrow'); - LatexCmds.harr = - LatexCmds.lrarr = - LatexCmds.leftrightarrow = - bindVanillaSymbol('\\leftrightarrow ', '↔', 'left and right arrow'); - LatexCmds.iff = bindBinaryOperator('\\Leftrightarrow ', '⇔', 'if and only if'); - LatexCmds.hArr = - LatexCmds.lrArr = - LatexCmds.Leftrightarrow = - bindVanillaSymbol('\\Leftrightarrow ', '⇔', 'left and right arrow'); - LatexCmds.Re = - LatexCmds.Real = - LatexCmds.real = - bindVanillaSymbol('\\Re ', 'ℜ', 'real'); - LatexCmds.Im = - LatexCmds.imag = - LatexCmds.image = - LatexCmds.imagin = - LatexCmds.imaginary = - LatexCmds.Imaginary = - bindVanillaSymbol('\\Im ', 'ℑ', 'imaginary'); - LatexCmds.part = LatexCmds.partial = bindVanillaSymbol('\\partial ', '∂', 'partial'); - LatexCmds.pounds = bindVanillaSymbol('\\pounds ', '£'); - LatexCmds.alef = - LatexCmds.alefsym = - LatexCmds.aleph = - LatexCmds.alephsym = - bindVanillaSymbol('\\aleph ', 'ℵ', 'alef sym'); - LatexCmds.xist = //LOL - LatexCmds.xists = - LatexCmds.exist = - LatexCmds.exists = - bindVanillaSymbol('\\exists ', '∃', 'there exists at least 1'); - LatexCmds.nexists = LatexCmds.nexist = bindVanillaSymbol('\\nexists ', '∄', 'there is no'); - LatexCmds.and = - LatexCmds.land = - LatexCmds.wedge = - bindBinaryOperator('\\wedge ', '∧', 'and'); - LatexCmds.or = - LatexCmds.lor = - LatexCmds.vee = - bindBinaryOperator('\\vee ', '∨', 'or'); - LatexCmds.o = - LatexCmds.O = - LatexCmds.empty = - LatexCmds.emptyset = - LatexCmds.oslash = - LatexCmds.Oslash = - LatexCmds.nothing = - LatexCmds.varnothing = - bindBinaryOperator('\\varnothing ', '∅', 'nothing'); - LatexCmds.cup = LatexCmds.union = bindBinaryOperator('\\cup ', '∪', 'union'); - LatexCmds.cap = - LatexCmds.intersect = - LatexCmds.intersection = - bindBinaryOperator('\\cap ', '∩', 'intersection'); + LatexCmds.slash = bindVanillaSymbol("/", "slash"); + LatexCmds.vert = bindVanillaSymbol("|", "vertical bar"); + LatexCmds.perp = LatexCmds.perpendicular = bindVanillaSymbol("\\perp ", "⊥", "perpendicular"); + LatexCmds.nabla = LatexCmds.del = bindVanillaSymbol("\\nabla ", "∇"); + LatexCmds.hbar = bindVanillaSymbol("\\hbar ", "ℏ", "horizontal bar"); + LatexCmds.AA = LatexCmds.Angstrom = LatexCmds.angstrom = bindVanillaSymbol("\\text\\AA ", "Å", "AA"); + LatexCmds.ring = LatexCmds.circ = LatexCmds.circle = bindVanillaSymbol("\\circ ", "∘", "circle"); + LatexCmds.bull = LatexCmds.bullet = bindVanillaSymbol("\\bullet ", "•", "bullet"); + LatexCmds.setminus = LatexCmds.smallsetminus = bindVanillaSymbol("\\setminus ", "∖", "set minus"); + LatexCmds.not = LatexCmds["\u00ac"] = LatexCmds.neg = bindVanillaSymbol("\\neg ", "¬", "not"); //bind(MQSymbol,'\\not ','/', 'not'); + LatexCmds[ + "\u2026" + ] = LatexCmds.dots = LatexCmds.ellip = LatexCmds.hellip = LatexCmds.ellipsis = LatexCmds.hellipsis = bindVanillaSymbol( + "\\dots ", + "…", + "ellipsis" + ); + LatexCmds.converges = LatexCmds.darr = LatexCmds.dnarr = LatexCmds.dnarrow = LatexCmds.downarrow = bindVanillaSymbol( + "\\downarrow ", + "↓", + "converges with" + ); + LatexCmds.dArr = LatexCmds.dnArr = LatexCmds.dnArrow = LatexCmds.Downarrow = bindVanillaSymbol( + "\\Downarrow ", + "⇓", + "down arrow" + ); + LatexCmds.diverges = LatexCmds.uarr = LatexCmds.uparrow = bindVanillaSymbol( + "\\uparrow ", + "↑", + "diverges from" + ); + LatexCmds.uArr = LatexCmds.Uparrow = bindVanillaSymbol("\\Uparrow ", "⇑", "up arrow"); + LatexCmds.rarr = LatexCmds.rightarrow = bindVanillaSymbol("\\rightarrow ", "→", "right arrow"); + LatexCmds.implies = bindBinaryOperator("\\Rightarrow ", "⇒", "implies"); + LatexCmds.rArr = LatexCmds.Rightarrow = bindVanillaSymbol("\\Rightarrow ", "⇒", "right arrow"); + LatexCmds.gets = bindBinaryOperator("\\gets ", "←", "gets"); + LatexCmds.larr = LatexCmds.leftarrow = bindVanillaSymbol("\\leftarrow ", "←", "left arrow"); + LatexCmds.impliedby = bindBinaryOperator("\\Leftarrow ", "⇐", "implied by"); + LatexCmds.lArr = LatexCmds.Leftarrow = bindVanillaSymbol("\\Leftarrow ", "⇐", "left arrow"); + LatexCmds.harr = LatexCmds.lrarr = LatexCmds.leftrightarrow = bindVanillaSymbol( + "\\leftrightarrow ", + "↔", + "left and right arrow" + ); + LatexCmds.iff = bindBinaryOperator("\\Leftrightarrow ", "⇔", "if and only if"); + LatexCmds.hArr = LatexCmds.lrArr = LatexCmds.Leftrightarrow = bindVanillaSymbol( + "\\Leftrightarrow ", + "⇔", + "left and right arrow" + ); + LatexCmds.Re = LatexCmds.Real = LatexCmds.real = bindVanillaSymbol("\\Re ", "ℜ", "real"); + LatexCmds.Im = LatexCmds.imag = LatexCmds.image = LatexCmds.imagin = LatexCmds.imaginary = LatexCmds.Imaginary = bindVanillaSymbol( + "\\Im ", + "ℑ", + "imaginary" + ); + LatexCmds.part = LatexCmds.partial = bindVanillaSymbol("\\partial ", "∂", "partial"); + LatexCmds.pounds = bindVanillaSymbol("\\pounds ", "£"); + LatexCmds.alef = LatexCmds.alefsym = LatexCmds.aleph = LatexCmds.alephsym = bindVanillaSymbol( + "\\aleph ", + "ℵ", + "alef sym" + ); + LatexCmds.xist = LatexCmds.xists = LatexCmds.exist = LatexCmds.exists = bindVanillaSymbol( + //LOL + "\\exists ", + "∃", + "there exists at least 1" + ); + LatexCmds.nexists = LatexCmds.nexist = bindVanillaSymbol("\\nexists ", "∄", "there is no"); + LatexCmds.and = LatexCmds.land = LatexCmds.wedge = bindBinaryOperator("\\wedge ", "∧", "and"); + LatexCmds.or = LatexCmds.lor = LatexCmds.vee = bindBinaryOperator("\\vee ", "∨", "or"); + LatexCmds.o = LatexCmds.O = LatexCmds.empty = LatexCmds.emptyset = LatexCmds.oslash = LatexCmds.Oslash = LatexCmds.nothing = LatexCmds.varnothing = bindBinaryOperator( + "\\varnothing ", + "∅", + "nothing" + ); + LatexCmds.cup = LatexCmds.union = bindBinaryOperator("\\cup ", "∪", "union"); + LatexCmds.cap = LatexCmds.intersect = LatexCmds.intersection = bindBinaryOperator( + "\\cap ", + "∩", + "intersection" + ); // FIXME: the correct LaTeX would be ^\circ but we can't parse that - LatexCmds.deg = LatexCmds.degree = bindVanillaSymbol('\\degree ', '°', 'degrees'); - LatexCmds.ang = LatexCmds.angle = bindVanillaSymbol('\\angle ', '∠', 'angle'); - LatexCmds.measuredangle = bindVanillaSymbol('\\measuredangle ', '∡', 'measured angle'); + LatexCmds.deg = LatexCmds.degree = bindVanillaSymbol("\\degree ", "°", "degrees"); + LatexCmds.ang = LatexCmds.angle = bindVanillaSymbol("\\angle ", "∠", "angle"); + LatexCmds.measuredangle = bindVanillaSymbol("\\measuredangle ", "∡", "measured angle"); /********************************* * Symbols for Basic Mathematics ********************************/ var DigitGroupingChar = /** @class */ (function (_super) { __extends(DigitGroupingChar, _super); function DigitGroupingChar() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } DigitGroupingChar.prototype.finalizeTree = function (opts, dir) { this.sharedSiblingMethod(opts, dir); @@ -6312,34 +5943,29 @@ export default function() { DigitGroupingChar.prototype.sharedSiblingMethod = function (opts, dir) { // don't try to fix digit grouping if the sibling to my right changed (dir === R or // undefined) and it's now a DigitGroupingChar, it will try to fix grouping - if (dir !== L && this[R] instanceof DigitGroupingChar) - return; + if (dir !== L && this[R] instanceof DigitGroupingChar) return; this.fixDigitGrouping(opts); }; DigitGroupingChar.prototype.fixDigitGrouping = function (opts) { - if (!opts.enableDigitGrouping) - return; + if (!opts.enableDigitGrouping) return; var left = this; var right = this; var spacesFound = 0; var dots = []; - var SPACE = '\\ '; - var DOT = '.'; + var SPACE = "\\ "; + var DOT = "."; // traverse left as far as possible (starting at this char) var node = left; do { if (/^[0-9]$/.test(node.ctrlSeq)) { left = node; - } - else if (node.ctrlSeq === SPACE) { + } else if (node.ctrlSeq === SPACE) { left = node; spacesFound += 1; - } - else if (node.ctrlSeq === DOT) { + } else if (node.ctrlSeq === DOT) { left = node; dots.push(node); - } - else { + } else { break; } } while ((node = left[L])); @@ -6347,16 +5973,13 @@ export default function() { while ((node = right[R])) { if (/^[0-9]$/.test(node.ctrlSeq)) { right = node; - } - else if (node.ctrlSeq === SPACE) { + } else if (node.ctrlSeq === SPACE) { right = node; spacesFound += 1; - } - else if (node.ctrlSeq === DOT) { + } else if (node.ctrlSeq === DOT) { right = node; dots.push(node); - } - else { + } else { break; } } @@ -6371,13 +5994,11 @@ export default function() { spacesFound -= 1; } // happens when you only have a space - if (left === right && left && left.ctrlSeq === SPACE) - return; + if (left === right && left && left.ctrlSeq === SPACE) return; var disableFormatting = spacesFound > 0 || dots.length > 1; if (disableFormatting) { this.removeGroupingBetween(left, right); - } - else if (dots[0]) { + } else if (dots[0]) { if (dots[0] !== left) { this.addGroupingBetween(dots[0][L], left); } @@ -6385,8 +6006,7 @@ export default function() { // we do not show grouping to the right of a decimal place #yet this.removeGroupingBetween(dots[0][R], right); } - } - else { + } else { this.addGroupingBetween(right, left); } }; @@ -6396,8 +6016,7 @@ export default function() { if (node instanceof DigitGroupingChar) { node.setGroupingClass(undefined); } - if (!node || node === right) - break; + if (!node || node === right) break; } while ((node = node[R])); }; DigitGroupingChar.prototype.addGroupingBetween = function (start, end) { @@ -6407,13 +6026,11 @@ export default function() { var node = start; while (node) { totalDigits += 1; - if (node === end) - break; + if (node === end) break; node = node[L]; } var numDigitsInFirstGroup = totalDigits % 3; - if (numDigitsInFirstGroup === 0) - numDigitsInFirstGroup = 3; + if (numDigitsInFirstGroup === 0) numDigitsInFirstGroup = 3; var node = start; while (node) { count += 1; @@ -6421,121 +6038,111 @@ export default function() { // only do grouping if we have at least 4 numbers if (totalDigits >= 4) { if (count === totalDigits) { - cls = 'dcg-mq-group-leading-' + numDigitsInFirstGroup; - } - else if (count % 3 === 0) { + cls = "dcg-mq-group-leading-" + numDigitsInFirstGroup; + } else if (count % 3 === 0) { if (count !== totalDigits) { - cls = 'dcg-mq-group-start'; + cls = "dcg-mq-group-start"; } } if (!cls) { - cls = 'dcg-mq-group-other'; + cls = "dcg-mq-group-other"; } } if (node instanceof DigitGroupingChar) { node.setGroupingClass(cls); } - if (node === end) - break; + if (node === end) break; node = node[L]; } }; DigitGroupingChar.prototype.setGroupingClass = function (cls) { // nothing changed (either class is the same or it's still undefined) - if (this._groupingClass === cls) - return; + if (this._groupingClass === cls) return; // remove existing class - if (this._groupingClass) - this.domFrag().removeClass(this._groupingClass); + if (this._groupingClass) this.domFrag().removeClass(this._groupingClass); // add new class - if (cls) - this.domFrag().addClass(cls); + if (cls) this.domFrag().addClass(cls); // cache the groupingClass this._groupingClass = cls; }; return DigitGroupingChar; - }(MQSymbol)); + })(MQSymbol); var Digit = /** @class */ (function (_super) { __extends(Digit, _super); function Digit(ch, mathspeak) { - return _super.call(this, ch, h('span', { class: 'dcg-mq-digit' }, [h.text(ch)]), undefined, mathspeak) || this; + return ( + _super.call(this, ch, h("span", { class: "dcg-mq-digit" }, [h.text(ch)]), undefined, mathspeak) || this + ); } Digit.prototype.createLeftOf = function (cursor) { var cursorL = cursor[L]; var cursorLL = cursorL && cursorL[L]; - var cursorParentParentSub = cursor.parent.parent instanceof SupSub - ? cursor.parent.parent.sub - : undefined; - if (cursor.options.autoSubscriptNumerals && + var cursorParentParentSub = cursor.parent.parent instanceof SupSub ? cursor.parent.parent.sub : undefined; + if ( + cursor.options.autoSubscriptNumerals && cursor.parent !== cursorParentParentSub && ((cursorL instanceof Variable && cursorL.isItalic !== false) || - (cursorL instanceof SupSub && - cursorLL instanceof Variable && - cursorLL.isItalic !== false))) { + (cursorL instanceof SupSub && cursorLL instanceof Variable && cursorLL.isItalic !== false)) + ) { new SubscriptCommand().createLeftOf(cursor); _super.prototype.createLeftOf.call(this, cursor); cursor.insRightOf(cursor.parent.parent); - } - else - _super.prototype.createLeftOf.call(this, cursor); + } else _super.prototype.createLeftOf.call(this, cursor); }; Digit.prototype.mathspeak = function (opts) { if (opts && opts.createdLeftOf) { var cursor = opts.createdLeftOf; var cursorL = cursor[L]; var cursorLL = cursorL && cursorL[L]; - var cursorParentParentSub = cursor.parent.parent instanceof SupSub - ? cursor.parent.parent.sub - : undefined; - if (cursor.options.autoSubscriptNumerals && + var cursorParentParentSub = + cursor.parent.parent instanceof SupSub ? cursor.parent.parent.sub : undefined; + if ( + cursor.options.autoSubscriptNumerals && cursor.parent !== cursorParentParentSub && ((cursorL instanceof Variable && cursorL.isItalic !== false) || - (cursor[L] instanceof SupSub && - cursorLL instanceof Variable && - cursorLL.isItalic !== false))) { - return 'Subscript ' + _super.prototype.mathspeak.call(this) + ' Baseline'; + (cursor[L] instanceof SupSub && cursorLL instanceof Variable && cursorLL.isItalic !== false)) + ) { + return "Subscript " + _super.prototype.mathspeak.call(this) + " Baseline"; } } return _super.prototype.mathspeak.call(this); }; return Digit; - }(DigitGroupingChar)); + })(DigitGroupingChar); var Variable = /** @class */ (function (_super) { __extends(Variable, _super); function Variable(chOrCtrlSeq, html) { - return _super.call(this, chOrCtrlSeq, h('var', {}, [html || h.text(chOrCtrlSeq)])) || this; + return _super.call(this, chOrCtrlSeq, h("var", {}, [html || h.text(chOrCtrlSeq)])) || this; } Variable.prototype.text = function () { - var text = this.ctrlSeq || ''; + var text = this.ctrlSeq || ""; if (this.isPartOfOperator) { - if (text[0] == '\\') { + if (text[0] == "\\") { text = text.slice(1, text.length); - } - else if (text[text.length - 1] == ' ') { + } else if (text[text.length - 1] == " ") { text = text.slice(0, -1); } - } - else { - if (this[L] && + } else { + if ( + this[L] && !(this[L] instanceof Variable) && !(this[L] instanceof BinaryOperator) && - this[L].ctrlSeq !== '\\ ') - text = '*' + text; - if (this[R] && - !(this[R] instanceof BinaryOperator) && - !(this[R] instanceof SupSub)) - text += '*'; + this[L].ctrlSeq !== "\\ " + ) + text = "*" + text; + if (this[R] && !(this[R] instanceof BinaryOperator) && !(this[R] instanceof SupSub)) text += "*"; } return text; }; Variable.prototype.mathspeak = function () { - var text = this.ctrlSeq || ''; - if (this.isPartOfOperator || + var text = this.ctrlSeq || ""; + if ( + this.isPartOfOperator || text.length > 1 || - (this.parent && this.parent.parent && this.parent.parent.isTextBlock())) { + (this.parent && this.parent.parent && this.parent.parent.isTextBlock()) + ) { return _super.prototype.mathspeak.call(this); - } - else { + } else { // Apple voices in VoiceOver (such as Alex, Bruce, and Victoria) do // some strange pronunciation given certain expressions, // e.g. "y-2" is spoken as "ee minus 2" (as if the y is short). @@ -6545,18 +6152,20 @@ export default function() { } }; return Variable; - }(MQSymbol)); + })(MQSymbol); function bindVariable(ch, htmlEntity, _unusedMathspeak) { - return function () { return new Variable(ch, h.entityText(htmlEntity)); }; + return function () { + return new Variable(ch, h.entityText(htmlEntity)); + }; } Options.prototype.autoCommands = { _maxLength: 0, }; baseOptionProcessors.autoCommands = function (cmds) { - if (typeof cmds !== 'string' || !/^[a-z]+(?: [a-z]+)*$/i.test(cmds)) { + if (typeof cmds !== "string" || !/^[a-z]+(?: [a-z]+)*$/i.test(cmds)) { throw '"' + cmds + '" not a space-delimited list of only letters'; } - var list = cmds.split(' '); + var list = cmds.split(" "); var dict = {}; var maxLength = 0; for (var i = 0; i < list.length; i += 1) { @@ -6575,8 +6184,10 @@ export default function() { }; Options.prototype.quietEmptyDelimiters = {}; baseOptionProcessors.quietEmptyDelimiters = function (dlms) { - if (dlms === void 0) { dlms = ''; } - var list = dlms.split(' '); + if (dlms === void 0) { + dlms = ""; + } + var list = dlms.split(" "); var dict = {}; for (var i = 0; i < list.length; i += 1) { var dlm = list[i]; @@ -6586,10 +6197,10 @@ export default function() { }; Options.prototype.autoParenthesizedFunctions = { _maxLength: 0 }; baseOptionProcessors.autoParenthesizedFunctions = function (cmds) { - if (typeof cmds !== 'string' || !/^[a-z]+(?: [a-z]+)*$/i.test(cmds)) { + if (typeof cmds !== "string" || !/^[a-z]+(?: [a-z]+)*$/i.test(cmds)) { throw '"' + cmds + '" not a space-delimited list of only letters'; } - var list = cmds.split(' '); + var list = cmds.split(" "); var dict = {}; var maxLength = 0; for (var i = 0; i < list.length; i += 1) { @@ -6621,7 +6232,7 @@ export default function() { if (maxLength > 0) { // want longest possible autocommand, so join together longest // sequence of letters - var str = ''; + var str = ""; var l = this; var i = 0; // FIXME: l.ctrlSeq === l.letter checks if first or last in an operator name @@ -6634,16 +6245,14 @@ export default function() { while (str.length) { if (autoCmds.hasOwnProperty(str)) { l = this; - for (i = 1; l && i < str.length; i += 1, l = l[L]) - ; + for (i = 1; l && i < str.length; i += 1, l = l[L]); new Fragment(l, this).remove(); cursor[L] = l[L]; var cmd = LatexCmds[str]; var node; if (isMQNodeClass(cmd)) { node = new cmd(str); // TODO - How do we know that this class expects a single str input? - } - else { + } else { node = cmd(str); } return node.createLeftOf(cursor); @@ -6655,7 +6264,7 @@ export default function() { Letter.prototype.autoParenthesize = function (cursor) { //exit early if already parenthesized var right = cursor.parent.getEnd(R); - if (right && right instanceof Bracket && right.ctrlSeq === '\\left(') { + if (right && right instanceof Bracket && right.ctrlSeq === "\\left(") { return; } //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. @@ -6663,7 +6272,7 @@ export default function() { return; } //handle autoParenthesized functions - var str = ''; + var str = ""; var l = this; var i = 0; var autoParenthesizedFunctions = cursor.options.autoParenthesizedFunctions; @@ -6675,9 +6284,8 @@ export default function() { // check for an autoParenthesized functions, going thru substrings longest to shortest // only allow autoParenthesized functions that are also autoOperatorNames while (str.length) { - if (autoParenthesizedFunctions.hasOwnProperty(str) && - autoOperatorNames.hasOwnProperty(str)) { - return cursor.parent.write(cursor, '('); + if (autoParenthesizedFunctions.hasOwnProperty(str) && autoOperatorNames.hasOwnProperty(str)) { + return cursor.parent.write(cursor, "("); } str = str.slice(1); } @@ -6690,7 +6298,7 @@ export default function() { Letter.prototype.italicize = function (bool) { this.isItalic = bool; this.isPartOfOperator = !bool; - this.domFrag().toggleClass('dcg-mq-operator-name', !bool); + this.domFrag().toggleClass("dcg-mq-operator-name", !bool); return this; }; Letter.prototype.finalizeTree = function (opts, dir) { @@ -6705,14 +6313,12 @@ export default function() { Letter.prototype.sharedSiblingMethod = function (opts, dir) { // don't auto-un-italicize if the sibling to my right changed (dir === R or // undefined) and it's now a Letter, it will un-italicize everyone - if (dir !== L && this[R] instanceof Letter) - return; + if (dir !== L && this[R] instanceof Letter) return; this.autoUnItalicize(opts); }; Letter.prototype.autoUnItalicize = function (opts) { var autoOps = opts.autoOperatorNames; - if (autoOps._maxLength === 0) - return; + if (autoOps._maxLength === 0) return; //exit early if in simple subscript and disableAutoSubstitutionInSubscripts is set. if (this.shouldIgnoreSubstitutionInSimpleSubscript(opts)) { return; @@ -6720,19 +6326,15 @@ export default function() { // want longest possible operator names, so join together entire contiguous // sequence of letters var str = this.letter; - for (var l = this[L]; l instanceof Letter; l = l[L]) - str = l.letter + str; - for (var r = this[R]; r instanceof Letter; r = r[R]) - str += r.letter; + for (var l = this[L]; l instanceof Letter; l = l[L]) str = l.letter + str; + for (var r = this[R]; r instanceof Letter; r = r[R]) str += r.letter; // removeClass and delete flags from all letters before figuring out // which, if any, are part of an operator name var lR = l && l[R]; var rL = r && r[L]; new Fragment(lR || this.parent.getEnd(L), rL || this.parent.getEnd(R)).each(function (el) { if (el instanceof Letter) { - el.italicize(true) - .domFrag() - .removeClass('dcg-mq-first dcg-mq-last dcg-mq-followed-by-supsub'); + el.italicize(true).domFrag().removeClass("dcg-mq-first dcg-mq-last dcg-mq-followed-by-supsub"); el.ctrlSeq = el.letter; } return undefined; @@ -6740,7 +6342,11 @@ export default function() { var autoOpsLength = autoOps._maxLength || 0; // check for operator names: at each position from left to right, check // substrings from longest to shortest - outer: for (var i = 0, first = l[R] || this.parent.getEnd(L); first && i < str.length; i += 1, first = first[R]) { + outer: for ( + var i = 0, first = l[R] || this.parent.getEnd(L); + first && i < str.length; + i += 1, first = first[R] + ) { for (var len = min(autoOpsLength, str.length - i); len > 0; len -= 1) { var word = str.slice(i, i + len); var last = undefined; // TODO - TS complaining that we use last before assigning to it @@ -6752,35 +6358,28 @@ export default function() { } } var isBuiltIn = BuiltInOpNames.hasOwnProperty(word); - first.ctrlSeq = - (isBuiltIn ? '\\' : '\\operatorname{') + first.ctrlSeq; - last.ctrlSeq += isBuiltIn ? ' ' : '}'; + first.ctrlSeq = (isBuiltIn ? "\\" : "\\operatorname{") + first.ctrlSeq; + last.ctrlSeq += isBuiltIn ? " " : "}"; if (TwoWordOpNames.hasOwnProperty(word)) { var lastL = last[L]; var lastLL = lastL && lastL[L]; - var lastLLL = (lastLL && lastLL[L]); - lastLLL.domFrag().addClass('dcg-mq-last'); + var lastLLL = lastLL && lastLL[L]; + lastLLL.domFrag().addClass("dcg-mq-last"); } - if (!this.shouldOmitPadding(first[L])) - first.domFrag().addClass('dcg-mq-first'); + if (!this.shouldOmitPadding(first[L])) first.domFrag().addClass("dcg-mq-first"); if (!this.shouldOmitPadding(last[R])) { if (last[R] instanceof SupSub) { var supsub = last[R]; // XXX monkey-patching, but what's the right thing here? // Have operatorname-specific code in SupSub? A CSS-like language to style the // math tree, but which ignores cursor and selection (which CSS can't)? - var respace = (supsub.siblingCreated = - supsub.siblingDeleted = - function () { - supsub - .domFrag() - .toggleClass('dcg-mq-after-operator-name', !(supsub[R] instanceof Bracket)); - }); + var respace = (supsub.siblingCreated = supsub.siblingDeleted = function () { + supsub + .domFrag() + .toggleClass("dcg-mq-after-operator-name", !(supsub[R] instanceof Bracket)); + }); respace(); - } - else { - last - .domFrag() - .toggleClass('dcg-mq-last', !(last[R] instanceof Bracket)); + } else { + last.domFrag().toggleClass("dcg-mq-last", !(last[R] instanceof Bracket)); } } i += len - 1; @@ -6792,21 +6391,17 @@ export default function() { }; Letter.prototype.shouldOmitPadding = function (node) { // omit padding if no node - if (!node) - return true; + if (!node) return true; // do not add padding between letter and '.' - if (node.ctrlSeq === '.') - return true; + if (node.ctrlSeq === ".") return true; // do not add padding between letter and binary operator. The // binary operator already has padding - if (node instanceof BinaryOperator) - return true; - if (node instanceof SummationNotation) - return true; + if (node instanceof BinaryOperator) return true; + if (node instanceof SummationNotation) return true; return false; }; return Letter; - }(Variable)); + })(Variable); var BuiltInOpNames = {}; // the set of operator names like \sin, \cos, etc that // are built-into LaTeX, see Section 3.17 of the Short Math Guide: http://tinyurl.com/jm9okjc // MathQuill auto-unitalicizes some operator names not in that set, like 'hcf' @@ -6820,42 +6415,41 @@ export default function() { var AutoOpNames = { _maxLength: 9, }; - var mostOps = ('arg deg det dim exp gcd hom inf ker lg lim ln log max min sup' + - ' limsup liminf injlim projlim Pr').split(' '); + var mostOps = ( + "arg deg det dim exp gcd hom inf ker lg lim ln log max min sup" + " limsup liminf injlim projlim Pr" + ).split(" "); for (var i = 0; i < mostOps.length; i += 1) { BuiltInOpNames[mostOps[i]] = AutoOpNames[mostOps[i]] = 1; } - var builtInTrigs = 'sin cos tan arcsin arccos arctan sinh cosh tanh sec csc cot coth'.split( - // why coth but not sech and csch, LaTeX? - ' '); + var builtInTrigs = "sin cos tan arcsin arccos arctan sinh cosh tanh sec csc cot coth".split( + // why coth but not sech and csch, LaTeX? + " " + ); for (var i = 0; i < builtInTrigs.length; i += 1) { BuiltInOpNames[builtInTrigs[i]] = 1; } - var autoTrigs = 'sin cos tan sec cosec csc cotan cot ctg'.split(' '); + var autoTrigs = "sin cos tan sec cosec csc cotan cot ctg".split(" "); for (var i = 0; i < autoTrigs.length; i += 1) { - AutoOpNames[autoTrigs[i]] = - AutoOpNames['arc' + autoTrigs[i]] = - AutoOpNames[autoTrigs[i] + 'h'] = - AutoOpNames['ar' + autoTrigs[i] + 'h'] = - AutoOpNames['arc' + autoTrigs[i] + 'h'] = - 1; + AutoOpNames[autoTrigs[i]] = AutoOpNames["arc" + autoTrigs[i]] = AutoOpNames[ + autoTrigs[i] + "h" + ] = AutoOpNames["ar" + autoTrigs[i] + "h"] = AutoOpNames["arc" + autoTrigs[i] + "h"] = 1; } // compat with some of the nonstandard LaTeX exported by MathQuill // before #247. None of these are real LaTeX commands so, seems safe - var moreNonstandardOps = 'gcf hcf lcm proj span'.split(' '); + var moreNonstandardOps = "gcf hcf lcm proj span".split(" "); for (var i = 0; i < moreNonstandardOps.length; i += 1) { AutoOpNames[moreNonstandardOps[i]] = 1; } return AutoOpNames; } baseOptionProcessors.autoOperatorNames = function (cmds) { - if (typeof cmds !== 'string') { + if (typeof cmds !== "string") { throw '"' + cmds + '" not a space-delimited list'; } if (!/^[a-z\|\-]+(?: [a-z\|\-]+)*$/i.test(cmds)) { throw '"' + cmds + '" not a space-delimited list of letters or "|"'; } - var list = cmds.split(' '); + var list = cmds.split(" "); var dict = {}; var maxLength = 0; for (var i = 0; i < list.length; i += 1) { @@ -6863,21 +6457,20 @@ export default function() { if (cmd.length < 2) { throw '"' + cmd + '" not minimum length of 2'; } - if (cmd.indexOf('|') < 0) { + if (cmd.indexOf("|") < 0) { // normal auto operator dict[cmd] = cmd; maxLength = max(maxLength, cmd.length); - } - else { + } else { // this item has a speech-friendly alternative - var cmdArray = cmd.split('|'); + var cmdArray = cmd.split("|"); if (cmdArray.length > 2) { throw '"' + cmd + '" has more than 1 mathspeak delimiter'; } if (cmdArray[0].length < 2) { throw '"' + cmd[0] + '" not minimum length of 2'; } - dict[cmdArray[0]] = cmdArray[1].replace(/-/g, ' '); // convert dashes to spaces for the sake of speech + dict[cmdArray[0]] = cmdArray[1].replace(/-/g, " "); // convert dashes to spaces for the sake of speech maxLength = max(maxLength, cmdArray[0].length); } } @@ -6887,7 +6480,7 @@ export default function() { var OperatorName = /** @class */ (function (_super) { __extends(OperatorName, _super); function OperatorName(fn) { - return _super.call(this, fn || '') || this; + return _super.call(this, fn || "") || this; } OperatorName.prototype.createLeftOf = function (cursor) { var fn = this.ctrlSeq; @@ -6904,7 +6497,7 @@ export default function() { return Parser.succeed(block.children()); }; return OperatorName; - }(MQSymbol)); + })(MQSymbol); for (var fn in Options.prototype.autoOperatorNames) if (Options.prototype.autoOperatorNames.hasOwnProperty(fn)) { LatexCmds[fn] = OperatorName; @@ -6912,9 +6505,9 @@ export default function() { LatexCmds.operatorname = /** @class */ (function (_super) { __extends(class_4, _super); function class_4() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } - class_4.prototype.createLeftOf = function () { }; + class_4.prototype.createLeftOf = function () {}; class_4.prototype.numBlocks = function () { return 1; }; @@ -6923,18 +6516,17 @@ export default function() { // Check for the special case of \operatorname{ans}, which has // a special html representation var isAllLetters = true; - var str = ''; + var str = ""; var children = b.children(); children.each(function (child) { if (child instanceof Letter) { str += child.letter; - } - else { + } else { isAllLetters = false; } return undefined; }); - if (isAllLetters && str === 'ans') { + if (isAllLetters && str === "ans") { return AnsBuilder(); } // In cases other than `ans`, just return the children directly @@ -6942,59 +6534,62 @@ export default function() { }); }; return class_4; - }(MathCommand)); + })(MathCommand); LatexCmds.f = /** @class */ (function (_super) { __extends(class_5, _super); function class_5() { var _this_1 = this; - var letter = 'f'; + var letter = "f"; _this_1 = _super.call(this, letter) || this; _this_1.letter = letter; _this_1.domView = new DOMView(0, function () { - return h('var', { class: 'dcg-mq-f' }, [h.text('f')]); + return h("var", { class: "dcg-mq-f" }, [h.text("f")]); }); return _this_1; } class_5.prototype.italicize = function (bool) { // Why is this necesssary? Does someone replace the `f` at some // point? - this.domFrag().eachElement(function (el) { return (el.textContent = 'f'); }); - this.domFrag().toggleClass('dcg-mq-f', bool); + this.domFrag().eachElement(function (el) { + return (el.textContent = "f"); + }); + this.domFrag().toggleClass("dcg-mq-f", bool); return _super.prototype.italicize.call(this, bool); }; return class_5; - }(Letter)); + })(Letter); // VanillaSymbol's - LatexCmds[' '] = LatexCmds.space = function () { - return new DigitGroupingChar('\\ ', h('span', {}, [h.text(U_NO_BREAK_SPACE)]), ' '); + LatexCmds[" "] = LatexCmds.space = function () { + return new DigitGroupingChar("\\ ", h("span", {}, [h.text(U_NO_BREAK_SPACE)]), " "); }; - LatexCmds['.'] = function () { - return new DigitGroupingChar('.', h('span', { class: 'dcg-mq-digit' }, [h.text('.')]), '.'); + LatexCmds["."] = function () { + return new DigitGroupingChar(".", h("span", { class: "dcg-mq-digit" }, [h.text(".")]), "."); }; - LatexCmds["'"] = LatexCmds.prime = bindVanillaSymbol("'", '′', 'prime'); - LatexCmds['\u2033'] = LatexCmds.dprime = bindVanillaSymbol('\u2033', '″', 'double prime'); - LatexCmds.backslash = bindVanillaSymbol('\\backslash ', '\\', 'backslash'); - if (!CharCmds['\\']) - CharCmds['\\'] = LatexCmds.backslash; - LatexCmds.$ = bindVanillaSymbol('\\$', '$', 'dollar'); - LatexCmds.square = bindVanillaSymbol('\\square ', '\u25A1', 'square'); - LatexCmds.mid = bindVanillaSymbol('\\mid ', '\u2223', 'mid'); + LatexCmds["'"] = LatexCmds.prime = bindVanillaSymbol("'", "′", "prime"); + LatexCmds["\u2033"] = LatexCmds.dprime = bindVanillaSymbol("\u2033", "″", "double prime"); + LatexCmds.backslash = bindVanillaSymbol("\\backslash ", "\\", "backslash"); + if (!CharCmds["\\"]) CharCmds["\\"] = LatexCmds.backslash; + LatexCmds.$ = bindVanillaSymbol("\\$", "$", "dollar"); + LatexCmds.square = bindVanillaSymbol("\\square ", "\u25A1", "square"); + LatexCmds.mid = bindVanillaSymbol("\\mid ", "\u2223", "mid"); // does not use Symbola font var NonSymbolaSymbol = /** @class */ (function (_super) { __extends(NonSymbolaSymbol, _super); function NonSymbolaSymbol(ch, html, _unusedMathspeak) { - return _super.call(this, ch, h('span', { class: 'dcg-mq-nonSymbola' }, [html || h.text(ch)])) || this; + return _super.call(this, ch, h("span", { class: "dcg-mq-nonSymbola" }, [html || h.text(ch)])) || this; } return NonSymbolaSymbol; - }(MQSymbol)); - LatexCmds['@'] = function () { return new NonSymbolaSymbol('@'); }; - LatexCmds['&'] = function () { - return new NonSymbolaSymbol('\\&', h.entityText('&'), 'and'); + })(MQSymbol); + LatexCmds["@"] = function () { + return new NonSymbolaSymbol("@"); + }; + LatexCmds["&"] = function () { + return new NonSymbolaSymbol("\\&", h.entityText("&"), "and"); }; - LatexCmds['%'] = /** @class */ (function (_super) { + LatexCmds["%"] = /** @class */ (function (_super) { __extends(class_6, _super); function class_6() { - return _super.call(this, '\\%', h.text('%'), 'percent') || this; + return _super.call(this, "\\%", h.text("%"), "percent") || this; } class_6.prototype.parser = function () { var optWhitespace = Parser.optWhitespace; @@ -7002,97 +6597,75 @@ export default function() { // Parse `\%\operatorname{of}` as special `percentof` node so that // it will be serialized properly and deleted as a unit. return optWhitespace - .then(string('\\operatorname{of}').map(function () { - return PercentOfBuilder(); - })) + .then( + string("\\operatorname{of}").map(function () { + return PercentOfBuilder(); + }) + ) .or(_super.prototype.parser.call(this)); }; return class_6; - }(NonSymbolaSymbol)); - LatexCmds['\u2225'] = LatexCmds.parallel = bindVanillaSymbol('\\parallel ', '∥', 'parallel'); - LatexCmds['\u2226'] = LatexCmds.nparallel = bindVanillaSymbol('\\nparallel ', '∦', 'not parallel'); - LatexCmds['\u27c2'] = LatexCmds.perp = bindVanillaSymbol('\\perp ', '⟂', 'perpendicular'); + })(NonSymbolaSymbol); + LatexCmds["\u2225"] = LatexCmds.parallel = bindVanillaSymbol("\\parallel ", "∥", "parallel"); + LatexCmds["\u2226"] = LatexCmds.nparallel = bindVanillaSymbol("\\nparallel ", "∦", "not parallel"); + LatexCmds["\u27c2"] = LatexCmds.perp = bindVanillaSymbol("\\perp ", "⟂", "perpendicular"); //the following are all Greek to me, but this helped a lot: http://www.ams.org/STIX/ion/stixsig03.html //lowercase Greek letter variables - LatexCmds.alpha = - LatexCmds.beta = - LatexCmds.gamma = - LatexCmds.delta = - LatexCmds.zeta = - LatexCmds.eta = - LatexCmds.theta = - LatexCmds.iota = - LatexCmds.kappa = - LatexCmds.mu = - LatexCmds.nu = - LatexCmds.xi = - LatexCmds.rho = - LatexCmds.sigma = - LatexCmds.tau = - LatexCmds.chi = - LatexCmds.psi = - LatexCmds.omega = - function (latex) { - return new Variable('\\' + latex + ' ', h.entityText('&' + latex + ';')); - }; + LatexCmds.alpha = LatexCmds.beta = LatexCmds.gamma = LatexCmds.delta = LatexCmds.zeta = LatexCmds.eta = LatexCmds.theta = LatexCmds.iota = LatexCmds.kappa = LatexCmds.mu = LatexCmds.nu = LatexCmds.xi = LatexCmds.rho = LatexCmds.sigma = LatexCmds.tau = LatexCmds.chi = LatexCmds.psi = LatexCmds.omega = function ( + latex + ) { + return new Variable("\\" + latex + " ", h.entityText("&" + latex + ";")); + }; //why can't anybody FUCKING agree on these - LatexCmds.phi = bindVariable('\\phi ', 'ϕ', 'phi'); //W3C or Unicode? - LatexCmds.phiv = LatexCmds.varphi = bindVariable('\\varphi ', 'φ', 'phi'); //Elsevier and 9573-13 //AMS and LaTeX - LatexCmds.epsilon = bindVariable('\\epsilon ', 'ϵ', 'epsilon'); //W3C or Unicode? + LatexCmds.phi = bindVariable("\\phi ", "ϕ", "phi"); //W3C or Unicode? + LatexCmds.phiv = LatexCmds.varphi = bindVariable("\\varphi ", "φ", "phi"); //Elsevier and 9573-13 //AMS and LaTeX + LatexCmds.epsilon = bindVariable("\\epsilon ", "ϵ", "epsilon"); //W3C or Unicode? LatexCmds.epsiv = LatexCmds.varepsilon = bindVariable( - //Elsevier and 9573-13 //AMS and LaTeX - '\\varepsilon ', 'ε', 'epsilon'); - LatexCmds.piv = LatexCmds.varpi = bindVariable('\\varpi ', 'ϖ', 'piv'); //W3C/Unicode and Elsevier and 9573-13 //AMS and LaTeX - LatexCmds.sigmaf = //W3C/Unicode - LatexCmds.sigmav = //Elsevier - LatexCmds.varsigma = //LaTeX - bindVariable('\\varsigma ', 'ς', 'sigma'); - LatexCmds.thetav = //Elsevier and 9573-13 - LatexCmds.vartheta = //AMS and LaTeX - LatexCmds.thetasym = //W3C/Unicode - bindVariable('\\vartheta ', 'ϑ', 'theta'); + //Elsevier and 9573-13 //AMS and LaTeX + "\\varepsilon ", + "ε", + "epsilon" + ); + LatexCmds.piv = LatexCmds.varpi = bindVariable("\\varpi ", "ϖ", "piv"); //W3C/Unicode and Elsevier and 9573-13 //AMS and LaTeX + LatexCmds.sigmaf = LatexCmds.sigmav = LatexCmds.varsigma = bindVariable("\\varsigma ", "ς", "sigma"); //W3C/Unicode //Elsevier //LaTeX + LatexCmds.thetav = LatexCmds.vartheta = LatexCmds.thetasym = bindVariable("\\vartheta ", "ϑ", "theta"); //Elsevier and 9573-13 //AMS and LaTeX //W3C/Unicode LatexCmds.upsilon = LatexCmds.upsi = bindVariable( - //AMS and LaTeX and W3C/Unicode //Elsevier and 9573-13 - '\\upsilon ', 'υ', 'upsilon'); + //AMS and LaTeX and W3C/Unicode //Elsevier and 9573-13 + "\\upsilon ", + "υ", + "upsilon" + ); //these aren't even mentioned in the HTML character entity references - LatexCmds.gammad = //Elsevier - LatexCmds.Gammad = //9573-13 -- WTF, right? I dunno if this was a typo in the reference (see above) - LatexCmds.digamma = //LaTeX - bindVariable('\\digamma ', 'ϝ', 'gamma'); + LatexCmds.gammad = LatexCmds.Gammad = LatexCmds.digamma = bindVariable("\\digamma ", "ϝ", "gamma"); //Elsevier //9573-13 -- WTF, right? I dunno if this was a typo in the reference (see above) //LaTeX LatexCmds.kappav = LatexCmds.varkappa = bindVariable( - //Elsevier //AMS and LaTeX - '\\varkappa ', 'ϰ', 'kappa'); - LatexCmds.rhov = LatexCmds.varrho = bindVariable('\\varrho ', 'ϱ', 'rho'); //Elsevier and 9573-13 //AMS and LaTeX + //Elsevier //AMS and LaTeX + "\\varkappa ", + "ϰ", + "kappa" + ); + LatexCmds.rhov = LatexCmds.varrho = bindVariable("\\varrho ", "ϱ", "rho"); //Elsevier and 9573-13 //AMS and LaTeX //Greek constants, look best in non-italicized Times New Roman - LatexCmds.pi = LatexCmds['\u03c0'] = function () { - return new NonSymbolaSymbol('\\pi ', h.entityText('π'), 'pi'); + LatexCmds.pi = LatexCmds["\u03c0"] = function () { + return new NonSymbolaSymbol("\\pi ", h.entityText("π"), "pi"); }; LatexCmds.lambda = function () { - return new NonSymbolaSymbol('\\lambda ', h.entityText('λ'), 'lambda'); + return new NonSymbolaSymbol("\\lambda ", h.entityText("λ"), "lambda"); }; //uppercase greek letters - LatexCmds.Upsilon = //LaTeX - LatexCmds.Upsi = //Elsevier and 9573-13 - LatexCmds.upsih = //W3C/Unicode "upsilon with hook" - LatexCmds.Upsih = //'cos it makes sense to me - function () { - return new MQSymbol('\\Upsilon ', h('var', { style: 'font-family: serif' }, [h.entityText('ϒ')]), 'capital upsilon'); - }; //Symbola's 'upsilon with a hook' is a capital Y without hooks :( + LatexCmds.Upsilon = LatexCmds.Upsi = LatexCmds.upsih = LatexCmds.Upsih = function () { + //LaTeX //Elsevier and 9573-13 //W3C/Unicode "upsilon with hook" //'cos it makes sense to me + return new MQSymbol( + "\\Upsilon ", + h("var", { style: "font-family: serif" }, [h.entityText("ϒ")]), + "capital upsilon" + ); + }; //Symbola's 'upsilon with a hook' is a capital Y without hooks :( //other symbols with the same LaTeX command and HTML character entity reference - LatexCmds.Gamma = - LatexCmds.Delta = - LatexCmds.Theta = - LatexCmds.Lambda = - LatexCmds.Xi = - LatexCmds.Pi = - LatexCmds.Sigma = - LatexCmds.Phi = - LatexCmds.Psi = - LatexCmds.Omega = - LatexCmds.forall = - function (latex) { - return new VanillaSymbol('\\' + latex + ' ', h.entityText('&' + latex + ';')); - }; + LatexCmds.Gamma = LatexCmds.Delta = LatexCmds.Theta = LatexCmds.Lambda = LatexCmds.Xi = LatexCmds.Pi = LatexCmds.Sigma = LatexCmds.Phi = LatexCmds.Psi = LatexCmds.Omega = LatexCmds.forall = function ( + latex + ) { + return new VanillaSymbol("\\" + latex + " ", h.entityText("&" + latex + ";")); + }; // symbols that aren't a single MathCommand, but are instead a whole // Fragment. Creates the Fragment from a LaTeX string var LatexFragment = /** @class */ (function (_super) { @@ -7104,20 +6677,16 @@ export default function() { } LatexFragment.prototype.createLeftOf = function (cursor) { var block = latexMathParser.parse(this.latexStr); - block - .children() - .adopt(cursor.parent, cursor[L], cursor[R]); + block.children().adopt(cursor.parent, cursor[L], cursor[R]); cursor[L] = block.getEnd(R); domFrag(block.html()).insertBefore(cursor.domFrag()); block.finalizeInsert(cursor.options, cursor); var blockEndsR = block.getEnd(R); var blockEndsRR = blockEndsR && blockEndsR[R]; - if (blockEndsRR) - blockEndsRR.siblingCreated(cursor.options, L); + if (blockEndsRR) blockEndsRR.siblingCreated(cursor.options, L); var blockEndsL = block.getEnd(L); var blockEndsLL = blockEndsL && blockEndsL[L]; - if (blockEndsLL) - blockEndsLL.siblingCreated(cursor.options, R); + if (blockEndsLL) blockEndsLL.siblingCreated(cursor.options, R); cursor.parent.bubble(function (node) { node.reflow(); return undefined; @@ -7131,7 +6700,7 @@ export default function() { return Parser.succeed(frag); }; return LatexFragment; - }(MathCommand)); + })(MathCommand); // for what seems to me like [stupid reasons][1], Unicode provides // subscripted and superscripted versions of all ten Arabic numerals, // as well as [so-called "vulgar fractions"][2]. @@ -7156,19 +6725,45 @@ export default function() { // [2]: http://en.wikipedia.org/wiki/Number_Forms // [3]: http://en.wikipedia.org/wiki/ISO/IEC_8859-1 // [4]: http://en.wikipedia.org/wiki/Windows-1252 - LatexCmds['\u2070'] = function () { return new LatexFragment('^0'); }; - LatexCmds['\u00b9'] = function () { return new LatexFragment('^1'); }; - LatexCmds['\u00b2'] = function () { return new LatexFragment('^2'); }; - LatexCmds['\u00b3'] = function () { return new LatexFragment('^3'); }; - LatexCmds['\u2074'] = function () { return new LatexFragment('^4'); }; - LatexCmds['\u2075'] = function () { return new LatexFragment('^5'); }; - LatexCmds['\u2076'] = function () { return new LatexFragment('^6'); }; - LatexCmds['\u2077'] = function () { return new LatexFragment('^7'); }; - LatexCmds['\u2078'] = function () { return new LatexFragment('^8'); }; - LatexCmds['\u2079'] = function () { return new LatexFragment('^9'); }; - LatexCmds['\u00bc'] = function () { return new LatexFragment('\\frac14'); }; - LatexCmds['\u00bd'] = function () { return new LatexFragment('\\frac12'); }; - LatexCmds['\u00be'] = function () { return new LatexFragment('\\frac34'); }; + LatexCmds["\u2070"] = function () { + return new LatexFragment("^0"); + }; + LatexCmds["\u00b9"] = function () { + return new LatexFragment("^1"); + }; + LatexCmds["\u00b2"] = function () { + return new LatexFragment("^2"); + }; + LatexCmds["\u00b3"] = function () { + return new LatexFragment("^3"); + }; + LatexCmds["\u2074"] = function () { + return new LatexFragment("^4"); + }; + LatexCmds["\u2075"] = function () { + return new LatexFragment("^5"); + }; + LatexCmds["\u2076"] = function () { + return new LatexFragment("^6"); + }; + LatexCmds["\u2077"] = function () { + return new LatexFragment("^7"); + }; + LatexCmds["\u2078"] = function () { + return new LatexFragment("^8"); + }; + LatexCmds["\u2079"] = function () { + return new LatexFragment("^9"); + }; + LatexCmds["\u00bc"] = function () { + return new LatexFragment("\\frac14"); + }; + LatexCmds["\u00bd"] = function () { + return new LatexFragment("\\frac12"); + }; + LatexCmds["\u00be"] = function () { + return new LatexFragment("\\frac34"); + }; // this is a hack to make pasting the \u221a symbol // actually insert a sqrt command. This isn't ideal, // but it's way better than what we have now. I think @@ -7191,31 +6786,27 @@ export default function() { // act more like simply typing the characters out. I'd be scared to try // to make that change because I'm fairly confident I'd break something // around handling valid latex as latex rather than treating it as keystrokes. - LatexCmds['\u221a'] = function () { return new LatexFragment('\\sqrt{}'); }; + LatexCmds["\u221a"] = function () { + return new LatexFragment("\\sqrt{}"); + }; // Binary operator determination is used in several contexts for PlusMinus nodes and their descendants. // For instance, we set the item's class name based on this factor, and also assign different mathspeak values (plus vs positive, negative vs minus). function isBinaryOperator(node) { - if (!node) - return false; + if (!node) return false; var nodeL = node[L]; if (nodeL) { // If the left sibling is a binary operator or a separator (comma, semicolon, colon, space) // or an open bracket (open parenthesis, open square bracket) // consider the operator to be unary - if (nodeL instanceof BinaryOperator || - /^(\\ )|[,;:\(\[]$/.test(nodeL.ctrlSeq)) { + if (nodeL instanceof BinaryOperator || /^(\\ )|[,;:\(\[]$/.test(nodeL.ctrlSeq)) { return false; } - } - else if (node.parent && - node.parent.parent && - node.parent.parent.isStyleBlock()) { + } else if (node.parent && node.parent.parent && node.parent.parent.isStyleBlock()) { //if we are in a style block at the leftmost edge, determine unary/binary based on //the style block //this allows style blocks to be transparent for unary/binary purposes return isBinaryOperator(node.parent.parent); - } - else { + } else { return false; } return true; @@ -7235,54 +6826,45 @@ export default function() { this.sharedSiblingMethod(opts, dir); }; class_7.prototype.sharedSiblingMethod = function (_opts, dir) { - if (dir === R) - return; // ignore if sibling only changed on the right - this.domFrag().oneElement().className = isBinaryOperator(this) - ? 'dcg-mq-binary-operator' - : ''; + if (dir === R) return; // ignore if sibling only changed on the right + this.domFrag().oneElement().className = isBinaryOperator(this) ? "dcg-mq-binary-operator" : ""; return this; }; return class_7; - }(BinaryOperator)); - LatexCmds['+'] = /** @class */ (function (_super) { + })(BinaryOperator); + LatexCmds["+"] = /** @class */ (function (_super) { __extends(class_8, _super); function class_8() { - return _super.call(this, '+', h.text('+')) || this; + return _super.call(this, "+", h.text("+")) || this; } class_8.prototype.mathspeak = function () { - return isBinaryOperator(this) ? 'plus' : 'positive'; + return isBinaryOperator(this) ? "plus" : "positive"; }; return class_8; - }(PlusMinus)); + })(PlusMinus); //yes, these are different dashes, en-dash, em-dash, unicode minus, actual dash var MinusNode = /** @class */ (function (_super) { __extends(MinusNode, _super); function MinusNode() { - return _super.call(this, '-', h.entityText('−')) || this; + return _super.call(this, "-", h.entityText("−")) || this; } MinusNode.prototype.mathspeak = function () { - return isBinaryOperator(this) ? 'minus' : 'negative'; + return isBinaryOperator(this) ? "minus" : "negative"; }; return MinusNode; - }(PlusMinus)); - LatexCmds['\u2212'] = LatexCmds['\u2014'] = LatexCmds['\u2013'] = LatexCmds['-'] = MinusNode; - LatexCmds['\u00b1'] = - LatexCmds.pm = - LatexCmds.plusmn = - LatexCmds.plusminus = - function () { return new PlusMinus('\\pm ', h.entityText('±'), 'plus-or-minus'); }; - LatexCmds.mp = - LatexCmds.mnplus = - LatexCmds.minusplus = - function () { return new PlusMinus('\\mp ', h.entityText('∓'), 'minus-or-plus'); }; - CharCmds['*'] = - LatexCmds.sdot = - LatexCmds.cdot = - bindBinaryOperator('\\cdot ', '·', '*', 'times'); //semantically should be ⋅, but · looks better + })(PlusMinus); + LatexCmds["\u2212"] = LatexCmds["\u2014"] = LatexCmds["\u2013"] = LatexCmds["-"] = MinusNode; + LatexCmds["\u00b1"] = LatexCmds.pm = LatexCmds.plusmn = LatexCmds.plusminus = function () { + return new PlusMinus("\\pm ", h.entityText("±"), "plus-or-minus"); + }; + LatexCmds.mp = LatexCmds.mnplus = LatexCmds.minusplus = function () { + return new PlusMinus("\\mp ", h.entityText("∓"), "minus-or-plus"); + }; + CharCmds["*"] = LatexCmds.sdot = LatexCmds.cdot = bindBinaryOperator("\\cdot ", "·", "*", "times"); //semantically should be ⋅, but · looks better var To = /** @class */ (function (_super) { __extends(To, _super); function To() { - return _super.call(this, '\\to ', h.entityText('→'), 'to') || this; + return _super.call(this, "\\to ", h.entityText("→"), "to") || this; } To.prototype.deleteTowards = function (dir, cursor) { if (dir === L) { @@ -7299,21 +6881,28 @@ export default function() { _super.prototype.deleteTowards.call(this, dir, cursor); }; return To; - }(BinaryOperator)); - LatexCmds['\u2192'] = LatexCmds.to = To; + })(BinaryOperator); + LatexCmds["\u2192"] = LatexCmds.to = To; var Inequality = /** @class */ (function (_super) { __extends(Inequality, _super); function Inequality(data, strict) { var _this_1 = this; - var strictness = strict ? 'Strict' : ''; - _this_1 = _super.call(this, data["ctrlSeq".concat(strictness)], h.entityText(data["htmlEntity".concat(strictness)]), data["text".concat(strictness)], data["mathspeak".concat(strictness)]) || this; + var strictness = strict ? "Strict" : ""; + _this_1 = + _super.call( + this, + data["ctrlSeq".concat(strictness)], + h.entityText(data["htmlEntity".concat(strictness)]), + data["text".concat(strictness)], + data["mathspeak".concat(strictness)] + ) || this; _this_1.data = data; _this_1.strict = strict; return _this_1; } Inequality.prototype.swap = function (strict) { this.strict = strict; - var strictness = strict ? 'Strict' : ''; + var strictness = strict ? "Strict" : ""; this.ctrlSeq = this.data["ctrlSeq".concat(strictness)]; this.domFrag() .children() @@ -7333,26 +6922,26 @@ export default function() { _super.prototype.deleteTowards.call(this, dir, cursor); }; return Inequality; - }(BinaryOperator)); + })(BinaryOperator); var less = { - ctrlSeq: '\\le ', - htmlEntity: '≤', - text: '\u2264', - mathspeak: 'less than or equal to', - ctrlSeqStrict: '<', - htmlEntityStrict: '<', - textStrict: '<', - mathspeakStrict: 'less than', + ctrlSeq: "\\le ", + htmlEntity: "≤", + text: "\u2264", + mathspeak: "less than or equal to", + ctrlSeqStrict: "<", + htmlEntityStrict: "<", + textStrict: "<", + mathspeakStrict: "less than", }; var greater = { - ctrlSeq: '\\ge ', - htmlEntity: '≥', - text: '\u2265', - mathspeak: 'greater than or equal to', - ctrlSeqStrict: '>', - htmlEntityStrict: '>', - textStrict: '>', - mathspeakStrict: 'greater than', + ctrlSeq: "\\ge ", + htmlEntity: "≥", + text: "\u2265", + mathspeak: "greater than or equal to", + ctrlSeqStrict: ">", + htmlEntityStrict: ">", + textStrict: ">", + mathspeakStrict: "greater than", }; var Greater = /** @class */ (function (_super) { __extends(Greater, _super); @@ -7361,7 +6950,7 @@ export default function() { } Greater.prototype.createLeftOf = function (cursor) { var cursorL = cursor[L]; - if (cursorL instanceof BinaryOperator && cursorL.ctrlSeq === '-') { + if (cursorL instanceof BinaryOperator && cursorL.ctrlSeq === "-") { var l = cursorL; cursor[L] = l[L]; l.remove(); @@ -7375,29 +6964,23 @@ export default function() { _super.prototype.createLeftOf.call(this, cursor); }; return Greater; - }(Inequality)); - LatexCmds['<'] = LatexCmds.lt = function () { return new Inequality(less, true); }; - LatexCmds['>'] = LatexCmds.gt = Greater; - LatexCmds['\u2264'] = - LatexCmds.le = - LatexCmds.leq = - function () { return new Inequality(less, false); }; - LatexCmds['\u2265'] = - LatexCmds.ge = - LatexCmds.geq = - function () { return new Inequality(greater, false); }; - LatexCmds.infty = - LatexCmds.infin = - LatexCmds.infinity = - bindVanillaSymbol('\\infty ', '∞', 'infinity'); - LatexCmds['\u2260'] = - LatexCmds.ne = - LatexCmds.neq = - bindBinaryOperator('\\ne ', '≠', 'not equal'); + })(Inequality); + LatexCmds["<"] = LatexCmds.lt = function () { + return new Inequality(less, true); + }; + LatexCmds[">"] = LatexCmds.gt = Greater; + LatexCmds["\u2264"] = LatexCmds.le = LatexCmds.leq = function () { + return new Inequality(less, false); + }; + LatexCmds["\u2265"] = LatexCmds.ge = LatexCmds.geq = function () { + return new Inequality(greater, false); + }; + LatexCmds.infty = LatexCmds.infin = LatexCmds.infinity = bindVanillaSymbol("\\infty ", "∞", "infinity"); + LatexCmds["\u2260"] = LatexCmds.ne = LatexCmds.neq = bindBinaryOperator("\\ne ", "≠", "not equal"); var Equality = /** @class */ (function (_super) { __extends(Equality, _super); function Equality() { - return _super.call(this, '=', h.text('='), '=', 'equals') || this; + return _super.call(this, "=", h.text("="), "=", "equals") || this; } Equality.prototype.createLeftOf = function (cursor) { var cursorL = cursor[L]; @@ -7412,18 +6995,19 @@ export default function() { _super.prototype.createLeftOf.call(this, cursor); }; return Equality; - }(BinaryOperator)); - LatexCmds['='] = Equality; - LatexCmds['\u00d7'] = LatexCmds.times = bindBinaryOperator('\\times ', '×', '[x]', 'times'); - LatexCmds['\u00f7'] = - LatexCmds.div = - LatexCmds.divide = - LatexCmds.divides = - bindBinaryOperator('\\div ', '÷', '[/]', 'over'); + })(BinaryOperator); + LatexCmds["="] = Equality; + LatexCmds["\u00d7"] = LatexCmds.times = bindBinaryOperator("\\times ", "×", "[x]", "times"); + LatexCmds["\u00f7"] = LatexCmds.div = LatexCmds.divide = LatexCmds.divides = bindBinaryOperator( + "\\div ", + "÷", + "[/]", + "over" + ); var Sim = /** @class */ (function (_super) { __extends(Sim, _super); function Sim() { - return _super.call(this, '\\sim ', h.text('~'), '~', 'tilde') || this; + return _super.call(this, "\\sim ", h.text("~"), "~", "tilde") || this; } Sim.prototype.createLeftOf = function (cursor) { if (cursor[L] instanceof Sim) { @@ -7440,11 +7024,11 @@ export default function() { _super.prototype.createLeftOf.call(this, cursor); }; return Sim; - }(BinaryOperator)); + })(BinaryOperator); var Approx = /** @class */ (function (_super) { __extends(Approx, _super); function Approx() { - return _super.call(this, '\\approx ', h.entityText('≈'), '\u2248', 'approximately equal') || this; + return _super.call(this, "\\approx ", h.entityText("≈"), "\u2248", "approximately equal") || this; } Approx.prototype.deleteTowards = function (dir, cursor) { if (dir === L) { @@ -7461,22 +7045,21 @@ export default function() { _super.prototype.deleteTowards.call(this, dir, cursor); }; return Approx; - }(BinaryOperator)); - LatexCmds.tildeNbsp = bindVanillaSymbol('~', U_NO_BREAK_SPACE, ' '); + })(BinaryOperator); + LatexCmds.tildeNbsp = bindVanillaSymbol("~", U_NO_BREAK_SPACE, " "); LatexCmds.sim = Sim; - LatexCmds['\u2248'] = LatexCmds.approx = Approx; + LatexCmds["\u2248"] = LatexCmds.approx = Approx; // When interpreting raw LaTeX, we can either evaluate the tilde as its standard nonbreaking space // or transform it to the \sim operator depending on whether the "interpretTildeAsSim" configuration option is set. // Tilde symbols input from a keyboard will always be transformed to \sim. - CharCmds['~'] = LatexCmds.sim; - LatexCmds['~'] = LatexCmds.tildeNbsp; + CharCmds["~"] = LatexCmds.sim; + LatexCmds["~"] = LatexCmds.tildeNbsp; baseOptionProcessors.interpretTildeAsSim = function (val) { var interpretAsSim = !!val; if (interpretAsSim) { - LatexCmds['~'] = LatexCmds.sim; - } - else { - LatexCmds['~'] = LatexCmds.tildeNbsp; + LatexCmds["~"] = LatexCmds.sim; + } else { + LatexCmds["~"] = LatexCmds.tildeNbsp; } return interpretAsSim; }; @@ -7485,100 +7068,102 @@ export default function() { **************************/ var SVG_SYMBOLS = { sqrt: { - width: '', + width: "", html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 32 54' }, [ - h('path', { - d: 'M0 33 L7 27 L12.5 47 L13 47 L30 0 L32 0 L13 54 L11 54 L4.5 31 L0 33', + return h("svg", { preserveAspectRatio: "none", viewBox: "0 0 32 54" }, [ + h("path", { + d: "M0 33 L7 27 L12.5 47 L13 47 L30 0 L32 0 L13 54 L11 54 L4.5 31 L0 33", }), ]); }, }, - '|': { - width: '.4em', + "|": { + width: ".4em", html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ - h('path', { d: 'M4.4 0 L4.4 54 L5.6 54 L5.6 0' }), + return h("svg", { preserveAspectRatio: "none", viewBox: "0 0 10 54" }, [ + h("path", { d: "M4.4 0 L4.4 54 L5.6 54 L5.6 0" }), ]); }, }, - '[': { - width: '.55em', + "[": { + width: ".55em", html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 11 24' }, [ - h('path', { d: 'M8 0 L3 0 L3 24 L8 24 L8 23 L4 23 L4 1 L8 1' }), + return h("svg", { preserveAspectRatio: "none", viewBox: "0 0 11 24" }, [ + h("path", { d: "M8 0 L3 0 L3 24 L8 24 L8 23 L4 23 L4 1 L8 1" }), ]); }, }, - ']': { - width: '.55em', + "]": { + width: ".55em", html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 11 24' }, [ - h('path', { d: 'M3 0 L8 0 L8 24 L3 24 L3 23 L7 23 L7 1 L3 1' }), + return h("svg", { preserveAspectRatio: "none", viewBox: "0 0 11 24" }, [ + h("path", { d: "M3 0 L8 0 L8 24 L3 24 L3 23 L7 23 L7 1 L3 1" }), ]); }, }, - '(': { - width: '.55em', + "(": { + width: ".55em", html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '3 0 106 186' }, [ - h('path', { - d: 'M85 0 A61 101 0 0 0 85 186 L75 186 A75 101 0 0 1 75 0', + return h("svg", { preserveAspectRatio: "none", viewBox: "3 0 106 186" }, [ + h("path", { + d: "M85 0 A61 101 0 0 0 85 186 L75 186 A75 101 0 0 1 75 0", }), ]); }, }, - ')': { - width: '.55em', + ")": { + width: ".55em", html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '3 0 106 186' }, [ - h('path', { - d: 'M24 0 A61 101 0 0 1 24 186 L34 186 A75 101 0 0 0 34 0', + return h("svg", { preserveAspectRatio: "none", viewBox: "3 0 106 186" }, [ + h("path", { + d: "M24 0 A61 101 0 0 1 24 186 L34 186 A75 101 0 0 0 34 0", }), ]); }, }, - '{': { - width: '.7em', + "{": { + width: ".7em", html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '10 0 210 350' }, [ - h('path', { - d: 'M170 0 L170 6 A47 52 0 0 0 123 60 L123 127 A35 48 0 0 1 88 175 A35 48 0 0 1 123 223 L123 290 A47 52 0 0 0 170 344 L170 350 L160 350 A58 49 0 0 1 102 301 L103 220 A45 40 0 0 0 58 180 L58 170 A45 40 0 0 0 103 130 L103 49 A58 49 0 0 1 161 0', + return h("svg", { preserveAspectRatio: "none", viewBox: "10 0 210 350" }, [ + h("path", { + d: + "M170 0 L170 6 A47 52 0 0 0 123 60 L123 127 A35 48 0 0 1 88 175 A35 48 0 0 1 123 223 L123 290 A47 52 0 0 0 170 344 L170 350 L160 350 A58 49 0 0 1 102 301 L103 220 A45 40 0 0 0 58 180 L58 170 A45 40 0 0 0 103 130 L103 49 A58 49 0 0 1 161 0", }), ]); }, }, - '}': { - width: '.7em', + "}": { + width: ".7em", html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '10 0 210 350' }, [ - h('path', { - d: 'M60 0 L60 6 A47 52 0 0 1 107 60 L107 127 A35 48 0 0 0 142 175 A35 48 0 0 0 107 223 L107 290 A47 52 0 0 1 60 344 L60 350 L70 350 A58 49 0 0 0 128 301 L127 220 A45 40 0 0 1 172 180 L172 170 A45 40 0 0 1 127 130 L127 49 A58 49 0 0 0 70 0', + return h("svg", { preserveAspectRatio: "none", viewBox: "10 0 210 350" }, [ + h("path", { + d: + "M60 0 L60 6 A47 52 0 0 1 107 60 L107 127 A35 48 0 0 0 142 175 A35 48 0 0 0 107 223 L107 290 A47 52 0 0 1 60 344 L60 350 L70 350 A58 49 0 0 0 128 301 L127 220 A45 40 0 0 1 172 180 L172 170 A45 40 0 0 1 127 130 L127 49 A58 49 0 0 0 70 0", }), ]); }, }, - '∥': { - width: '.7em', + "∥": { + width: ".7em", html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ - h('path', { d: 'M3.2 0 L3.2 54 L4 54 L4 0 M6.8 0 L6.8 54 L6 54 L6 0' }), + return h("svg", { preserveAspectRatio: "none", viewBox: "0 0 10 54" }, [ + h("path", { d: "M3.2 0 L3.2 54 L4 54 L4 0 M6.8 0 L6.8 54 L6 54 L6 0" }), ]); }, }, - '⟨': { - width: '.55em', + "⟨": { + width: ".55em", html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ - h('path', { d: 'M6.8 0 L3.2 27 L6.8 54 L7.8 54 L4.2 27 L7.8 0' }), + return h("svg", { preserveAspectRatio: "none", viewBox: "0 0 10 54" }, [ + h("path", { d: "M6.8 0 L3.2 27 L6.8 54 L7.8 54 L4.2 27 L7.8 0" }), ]); }, }, - '⟩': { - width: '.55em', + "⟩": { + width: ".55em", html: function () { - return h('svg', { preserveAspectRatio: 'none', viewBox: '0 0 10 54' }, [ - h('path', { d: 'M3.2 0 L6.8 27 L3.2 54 L2.2 54 L5.8 27 L2.2 0' }), + return h("svg", { preserveAspectRatio: "none", viewBox: "0 0 10 54" }, [ + h("path", { d: "M3.2 0 L6.8 27 L3.2 54 L2.2 54 L5.8 27 L2.2 0" }), ]); }, }, @@ -7586,12 +7171,16 @@ export default function() { var Style = /** @class */ (function (_super) { __extends(Style, _super); function Style(ctrlSeq, tagName, attrs, ariaLabel, opts) { - var _this_1 = _super.call(this, ctrlSeq, new DOMView(1, function (blocks) { return h.block(tagName, attrs, blocks[0]); })) || this; - _this_1.ariaLabel = ariaLabel || ctrlSeq.replace(/^\\/, ''); - _this_1.mathspeakTemplate = [ - 'Start' + _this_1.ariaLabel + ',', - 'End' + _this_1.ariaLabel, - ]; + var _this_1 = + _super.call( + this, + ctrlSeq, + new DOMView(1, function (blocks) { + return h.block(tagName, attrs, blocks[0]); + }) + ) || this; + _this_1.ariaLabel = ariaLabel || ctrlSeq.replace(/^\\/, ""); + _this_1.mathspeakTemplate = ["Start" + _this_1.ariaLabel + ",", "End" + _this_1.ariaLabel]; // In most cases, mathspeak should announce the start and end of style blocks. // There is one exception currently (mathrm). _this_1.shouldNotSpeakDelimiters = opts && opts.shouldNotSpeakDelimiters; @@ -7601,65 +7190,85 @@ export default function() { if (!this.shouldNotSpeakDelimiters || (opts && opts.ignoreShorthand)) { return _super.prototype.mathspeak.call(this); } - return this.foldChildren('', function (speech, block) { - return speech + ' ' + block.mathspeak(opts); + return this.foldChildren("", function (speech, block) { + return speech + " " + block.mathspeak(opts); }).trim(); }; return Style; - }(MathCommand)); + })(MathCommand); //fonts LatexCmds.mathrm = /** @class */ (function (_super) { __extends(mathrm, _super); function mathrm() { - return _super.call(this, '\\mathrm', 'span', { class: 'dcg-mq-roman dcg-mq-font' }, 'Roman Font', { - shouldNotSpeakDelimiters: true, - }) || this; + return ( + _super.call(this, "\\mathrm", "span", { class: "dcg-mq-roman dcg-mq-font" }, "Roman Font", { + shouldNotSpeakDelimiters: true, + }) || this + ); } mathrm.prototype.isTextBlock = function () { return true; }; return mathrm; - }(Style)); + })(Style); LatexCmds.mathit = function () { - return new Style('\\mathit', 'i', { class: 'dcg-mq-font' }, 'Italic Font'); + return new Style("\\mathit", "i", { class: "dcg-mq-font" }, "Italic Font"); }; LatexCmds.mathbf = function () { - return new Style('\\mathbf', 'b', { class: 'dcg-mq-font' }, 'Bold Font'); + return new Style("\\mathbf", "b", { class: "dcg-mq-font" }, "Bold Font"); }; LatexCmds.mathsf = function () { - return new Style('\\mathsf', 'span', { class: 'dcg-mq-sans-serif dcg-mq-font' }, 'Serif Font'); + return new Style("\\mathsf", "span", { class: "dcg-mq-sans-serif dcg-mq-font" }, "Serif Font"); }; LatexCmds.mathtt = function () { - return new Style('\\mathtt', 'span', { class: 'dcg-mq-monospace dcg-mq-font' }, 'Math Text'); + return new Style("\\mathtt", "span", { class: "dcg-mq-monospace dcg-mq-font" }, "Math Text"); }; //text-decoration LatexCmds.underline = function () { - return new Style('\\underline', 'span', { class: 'dcg-mq-non-leaf dcg-mq-underline' }, 'Underline'); + return new Style("\\underline", "span", { class: "dcg-mq-non-leaf dcg-mq-underline" }, "Underline"); }; LatexCmds.overline = LatexCmds.bar = function () { - return new Style('\\overline', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overline' }, 'Overline'); + return new Style("\\overline", "span", { class: "dcg-mq-non-leaf dcg-mq-overline" }, "Overline"); }; LatexCmds.overrightarrow = function () { - return new Style('\\overrightarrow', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-right' }, 'Over Right Arrow'); + return new Style( + "\\overrightarrow", + "span", + { class: "dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-right" }, + "Over Right Arrow" + ); }; LatexCmds.overleftarrow = function () { - return new Style('\\overleftarrow', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-left' }, 'Over Left Arrow'); + return new Style( + "\\overleftarrow", + "span", + { class: "dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-left" }, + "Over Left Arrow" + ); }; LatexCmds.overleftrightarrow = function () { - return new Style('\\overleftrightarrow ', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-leftright' }, 'Over Left and Right Arrow'); + return new Style( + "\\overleftrightarrow ", + "span", + { class: "dcg-mq-non-leaf dcg-mq-overarrow dcg-mq-arrow-leftright" }, + "Over Left and Right Arrow" + ); }; LatexCmds.overarc = function () { - return new Style('\\overarc', 'span', { class: 'dcg-mq-non-leaf dcg-mq-overarc' }, 'Over Arc'); + return new Style("\\overarc", "span", { class: "dcg-mq-non-leaf dcg-mq-overarc" }, "Over Arc"); }; LatexCmds.dot = function () { - return new MathCommand('\\dot', new DOMView(1, function (blocks) { - return h('span', { class: 'dcg-mq-non-leaf' }, [ - h('span', { class: 'dcg-mq-dot-recurring-inner' }, [ - h('span', { class: 'dcg-mq-dot-recurring' }, [h.text(U_DOT_ABOVE)]), - h.block('span', { class: 'dcg-mq-empty-box' }, blocks[0]), - ]), - ]); - })); + return new MathCommand( + "\\dot", + new DOMView(1, function (blocks) { + return h("span", { class: "dcg-mq-non-leaf" }, [ + h("span", { class: "dcg-mq-dot-recurring-inner" }, [ + h("span", { class: "dcg-mq-dot-recurring" }, [h.text(U_DOT_ABOVE)]), + h.block("span", { class: "dcg-mq-empty-box" }, blocks[0]), + ]), + ]); + }) + ); }; // `\textcolor{color}{math}` will apply a color to the given math content, where // `color` is any valid CSS Color Value (see [SitePoint docs][] (recommended), @@ -7671,25 +7280,22 @@ export default function() { LatexCmds.textcolor = /** @class */ (function (_super) { __extends(class_9, _super); function class_9() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } class_9.prototype.setColor = function (color) { this.color = color; this.domView = new DOMView(1, function (blocks) { - return h.block('span', { class: 'dcg-mq-textcolor', style: 'color:' + color }, blocks[0]); + return h.block("span", { class: "dcg-mq-textcolor", style: "color:" + color }, blocks[0]); }); - this.ariaLabel = color.replace(/^\\/, ''); - this.mathspeakTemplate = [ - 'Start ' + this.ariaLabel + ',', - 'End ' + this.ariaLabel, - ]; + this.ariaLabel = color.replace(/^\\/, ""); + this.mathspeakTemplate = ["Start " + this.ariaLabel + ",", "End " + this.ariaLabel]; }; class_9.prototype.latexRecursive = function (ctx) { this.checkCursorContextOpen(ctx); var blocks0 = this.blocks[0]; - ctx.latex += '\\textcolor{' + this.color + '}{'; + ctx.latex += "\\textcolor{" + this.color + "}{"; blocks0.latexRecursive(ctx); - ctx.latex += '}'; + ctx.latex += "}"; this.checkCursorContextClose(ctx); }; class_9.prototype.parser = function () { @@ -7698,61 +7304,59 @@ export default function() { var string = Parser.string; var regex = Parser.regex; return optWhitespace - .then(string('{')) + .then(string("{")) .then(regex(/^[#\w\s.,()%-]*/)) - .skip(string('}')) + .skip(string("}")) .then(function (color) { - _this_1.setColor(color); - return _super.prototype.parser.call(_this_1); - }); + _this_1.setColor(color); + return _super.prototype.parser.call(_this_1); + }); }; class_9.prototype.isStyleBlock = function () { return true; }; return class_9; - }(MathCommand)); + })(MathCommand); // Very similar to the \textcolor command, but will add the given CSS class. // Usage: \class{classname}{math} // Note regex that whitelists valid CSS classname characters: // https://github.com/mathquill/mathquill/pull/191#discussion_r4327442 - var Class = (LatexCmds['class'] = /** @class */ (function (_super) { + var Class = (LatexCmds["class"] = /** @class */ (function (_super) { __extends(class_10, _super); function class_10() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } class_10.prototype.parser = function () { var _this_1 = this; - var string = Parser.string, regex = Parser.regex; + var string = Parser.string, + regex = Parser.regex; return Parser.optWhitespace - .then(string('{')) + .then(string("{")) .then(regex(/^[-\w\s\\\xA0-\xFF]*/)) - .skip(string('}')) + .skip(string("}")) .then(function (cls) { - _this_1.cls = cls || ''; - _this_1.domView = new DOMView(1, function (blocks) { - return h.block('span', { class: "dcg-mq-class ".concat(cls) }, blocks[0]); + _this_1.cls = cls || ""; + _this_1.domView = new DOMView(1, function (blocks) { + return h.block("span", { class: "dcg-mq-class ".concat(cls) }, blocks[0]); + }); + _this_1.ariaLabel = cls + " class"; + _this_1.mathspeakTemplate = ["Start " + _this_1.ariaLabel + ",", "End " + _this_1.ariaLabel]; + return _super.prototype.parser.call(_this_1); }); - _this_1.ariaLabel = cls + ' class'; - _this_1.mathspeakTemplate = [ - 'Start ' + _this_1.ariaLabel + ',', - 'End ' + _this_1.ariaLabel, - ]; - return _super.prototype.parser.call(_this_1); - }); }; class_10.prototype.latexRecursive = function (ctx) { this.checkCursorContextOpen(ctx); var blocks0 = this.blocks[0]; - ctx.latex += '\\class{' + this.cls + '}{'; + ctx.latex += "\\class{" + this.cls + "}{"; blocks0.latexRecursive(ctx); - ctx.latex += '}'; + ctx.latex += "}"; this.checkCursorContextClose(ctx); }; class_10.prototype.isStyleBlock = function () { return true; }; return class_10; - }(MathCommand))); + })(MathCommand)); // This test is used to determine whether an item may be treated as a whole number // for shortening the verbalized (mathspeak) forms of some fractions and superscripts. var intRgx = /^[\+\-]?[\d]+$/; @@ -7760,35 +7364,30 @@ export default function() { // Used in shortened mathspeak computations as a block's .text() method can be potentially expensive. // function getCtrlSeqsFromBlock(block) { - if (!block) - return ''; - var chars = ''; + if (!block) return ""; + var chars = ""; block.eachChild(function (child) { - if (child.ctrlSeq !== undefined) - chars += child.ctrlSeq; + if (child.ctrlSeq !== undefined) chars += child.ctrlSeq; }); return chars; } - Options.prototype.charsThatBreakOutOfSupSub = ''; + Options.prototype.charsThatBreakOutOfSupSub = ""; var SupSub = /** @class */ (function (_super) { __extends(SupSub, _super); function SupSub() { - var _this_1 = _super !== null && _super.apply(this, arguments) || this; - _this_1.ctrlSeq = '_{...}^{...}'; + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = "_{...}^{...}"; return _this_1; } SupSub.prototype.setEnds = function (ends) { - pray('SupSub ends must be MathBlocks', ends[L] instanceof MathBlock && ends[R] instanceof MathBlock); + pray("SupSub ends must be MathBlocks", ends[L] instanceof MathBlock && ends[R] instanceof MathBlock); this.ends = ends; }; SupSub.prototype.getEnd = function (dir) { return this.ends[dir]; }; SupSub.prototype.createLeftOf = function (cursor) { - if (!this.replacedFragment && - !cursor[L] && - cursor.options.supSubsRequireOperand) - return; + if (!this.replacedFragment && !cursor[L] && cursor.options.supSubsRequireOperand) return; return _super.prototype.createLeftOf.call(this, cursor); }; SupSub.prototype.contactWeld = function (cursor) { @@ -7806,26 +7405,19 @@ export default function() { var pt = void 0; if (thisDir instanceof SupSub) { // equiv. to 'sub sup'.split(' ').forEach(function(supsub) { ... }); - for (var supsub = 'sub'; supsub; supsub = supsub === 'sub' ? 'sup' : false) { - var src = this[supsub], dest = thisDir[supsub]; - if (!src) - continue; - if (!dest) - thisDir.addBlock(src.disown()); + for (var supsub = "sub"; supsub; supsub = supsub === "sub" ? "sup" : false) { + var src = this[supsub], + dest = thisDir[supsub]; + if (!src) continue; + if (!dest) thisDir.addBlock(src.disown()); else if (!src.isEmpty()) { // ins src children at -dir end of dest - src - .domFrag() - .children() - .insAtDirEnd(-dir, dest.domFrag().oneElement()); + src.domFrag().children().insAtDirEnd(-dir, dest.domFrag().oneElement()); var children = src.children().disown(); pt = new Point(dest, children.getEnd(R), dest.getEnd(L)); - if (dir === L) - children.adopt(dest, dest.getEnd(R), 0); - else - children.adopt(dest, 0, dest.getEnd(L)); - } - else { + if (dir === L) children.adopt(dest, dest.getEnd(R), 0); + else children.adopt(dest, 0, dest.getEnd(L)); + } else { pt = new Point(dest, 0, dest.getEnd(L)); } this.placeCursor = (function (dest, src) { @@ -7840,13 +7432,10 @@ export default function() { if (dir === R && pt) { if (pt[L]) { cursor.insRightOf(pt[L]); - } - else { + } else { cursor.insAtLeftEnd(pt.parent); } - } - else - cursor.insRightOf(thisDir); + } else cursor.insRightOf(thisDir); } break; } @@ -7855,27 +7444,23 @@ export default function() { SupSub.prototype.finalizeTree = function () { var endsL = this.getEnd(L); endsL.write = function (cursor, ch) { - if (cursor.options.autoSubscriptNumerals && - this === this.parent.sub) { - if (ch === '_') - return; + if (cursor.options.autoSubscriptNumerals && this === this.parent.sub) { + if (ch === "_") return; var cmd = this.chToCmd(ch, cursor.options); - if (cmd instanceof MQSymbol) - cursor.deleteSelection(); - else - cursor.clearSelection().insRightOf(this.parent); + if (cmd instanceof MQSymbol) cursor.deleteSelection(); + else cursor.clearSelection().insRightOf(this.parent); cmd.createLeftOf(cursor.show()); - cursor.controller.aria - .queue('Baseline') - .alert(cmd.mathspeak({ createdLeftOf: cursor })); + cursor.controller.aria.queue("Baseline").alert(cmd.mathspeak({ createdLeftOf: cursor })); return; } - if (cursor[L] && + if ( + cursor[L] && !cursor[R] && !cursor.selection && - cursor.options.charsThatBreakOutOfSupSub.indexOf(ch) > -1) { + cursor.options.charsThatBreakOutOfSupSub.indexOf(ch) > -1 + ) { cursor.insRightOf(this.parent); - cursor.controller.aria.queue('Baseline'); + cursor.controller.aria.queue("Baseline"); } MathBlock.prototype.write.call(this, cursor, ch); }; @@ -7883,87 +7468,81 @@ export default function() { SupSub.prototype.moveTowards = function (dir, cursor, updown) { if (cursor.options.autoSubscriptNumerals && !this.sup) { cursor.insDirOf(dir, this); - } - else - _super.prototype.moveTowards.call(this, dir, cursor, updown); + } else _super.prototype.moveTowards.call(this, dir, cursor, updown); }; SupSub.prototype.deleteTowards = function (dir, cursor) { if (cursor.options.autoSubscriptNumerals && this.sub) { var cmd = this.sub.getEnd(-dir); - if (cmd instanceof MQSymbol) - cmd.remove(); - else if (cmd) - cmd.deleteTowards(dir, cursor.insAtDirEnd(-dir, this.sub)); + if (cmd instanceof MQSymbol) cmd.remove(); + else if (cmd) cmd.deleteTowards(dir, cursor.insAtDirEnd(-dir, this.sub)); // TODO: factor out a .removeBlock() or something if (this.sub.isEmpty()) { this.sub.deleteOutOf(L, cursor.insAtLeftEnd(this.sub)); - if (this.sup) - cursor.insDirOf(-dir, this); + if (this.sup) cursor.insDirOf(-dir, this); // Note `-dir` because in e.g. x_1^2| want backspacing (leftward) // to delete the 1 but to end up rightward of x^2; with non-negated // `dir` (try it), the cursor appears to have gone "through" the ^2. } - } - else - _super.prototype.deleteTowards.call(this, dir, cursor); + } else _super.prototype.deleteTowards.call(this, dir, cursor); }; SupSub.prototype.latexRecursive = function (ctx) { this.checkCursorContextOpen(ctx); if (this.sub) { - ctx.latex += '_{'; + ctx.latex += "_{"; var beforeLength = ctx.latex.length; this.sub.latexRecursive(ctx); var afterLength = ctx.latex.length; if (beforeLength === afterLength) { // nothing was written. so we write a space - ctx.latex += ' '; + ctx.latex += " "; } - ctx.latex += '}'; + ctx.latex += "}"; } if (this.sup) { - ctx.latex += '^{'; + ctx.latex += "^{"; var beforeLength = ctx.latex.length; this.sup.latexRecursive(ctx); var afterLength = ctx.latex.length; if (beforeLength === afterLength) { // nothing was written. so we write a space - ctx.latex += ' '; + ctx.latex += " "; } - ctx.latex += '}'; + ctx.latex += "}"; } this.checkCursorContextClose(ctx); }; SupSub.prototype.text = function () { function text(prefix, block) { - var l = (block && block.text()) || ''; - return block - ? prefix + (l.length === 1 ? l : '(' + (l || ' ') + ')') - : ''; + var l = (block && block.text()) || ""; + return block ? prefix + (l.length === 1 ? l : "(" + (l || " ") + ")") : ""; } - return text('_', this.sub) + text('^', this.sup); + return text("_", this.sub) + text("^", this.sup); }; SupSub.prototype.addBlock = function (block) { - if (this.supsub === 'sub') { + if (this.supsub === "sub") { this.sup = this.upInto = this.sub.upOutOf = block; block.adopt(this, this.sub, 0).downOutOf = this.sub; - block.setDOM(domFrag(h('span', { class: 'dcg-mq-sup' })) - .append(block.domFrag().children()) - .prependTo(this.domFrag().oneElement()) - .oneElement()); + block.setDOM( + domFrag(h("span", { class: "dcg-mq-sup" })) + .append(block.domFrag().children()) + .prependTo(this.domFrag().oneElement()) + .oneElement() + ); NodeBase.linkElementByBlockNode(block.domFrag().oneElement(), block); - } - else { + } else { this.sub = this.downInto = this.sup.downOutOf = block; block.adopt(this, 0, this.sup).upOutOf = this.sup; - this.domFrag().removeClass('dcg-mq-sup-only'); - block.setDOM(domFrag(h('span', { class: 'dcg-mq-sub' })) - .append(block.domFrag().children()) - .appendTo(this.domFrag().oneElement()) - .oneElement()); + this.domFrag().removeClass("dcg-mq-sup-only"); + block.setDOM( + domFrag(h("span", { class: "dcg-mq-sub" })) + .append(block.domFrag().children()) + .appendTo(this.domFrag().oneElement()) + .oneElement() + ); NodeBase.linkElementByBlockNode(block.domFrag().oneElement(), block); - this.domFrag().append(domFrag(h('span', { style: 'display:inline-block;width:0' }, [ - h.text(U_ZERO_WIDTH_SPACE), - ]))); + this.domFrag().append( + domFrag(h("span", { style: "display:inline-block;width:0" }, [h.text(U_ZERO_WIDTH_SPACE)])) + ); } // like 'sub sup'.split(' ').forEach(function(supsub) { ... }); for (var i = 0; i < 2; i += 1) @@ -7986,23 +7565,22 @@ export default function() { var cmdOppositeSupsub = cmd[oppositeSupsub]; cmdOppositeSupsub["".concat(updown, "OutOf")] = insLeftOfMeUnlessAtEnd; delete cmdOppositeSupsub.deleteOutOf; // TODO - refactor so this method can be optional - if (supsub === 'sub') { - cmd.domFrag().addClass('dcg-mq-sup-only').children().last().remove(); + if (supsub === "sub") { + cmd.domFrag().addClass("dcg-mq-sup-only").children().last().remove(); } this.remove(); }; - })(this, 'sub sup'.split(' ')[i], 'sup sub'.split(' ')[i], 'down up'.split(' ')[i]); + })(this, "sub sup".split(" ")[i], "sup sub".split(" ")[i], "down up".split(" ")[i]); }; return SupSub; - }(MathCommand)); + })(MathCommand); function insLeftOfMeUnlessAtEnd(cursor) { // cursor.insLeftOf(cmd), unless cursor at the end of block, and every // ancestor cmd is at the end of every ancestor block var cmd = this.parent; var ancestorCmd = cursor; do { - if (ancestorCmd[R]) - return cursor.insLeftOf(cmd); + if (ancestorCmd[R]) return cursor.insLeftOf(cmd); ancestorCmd = ancestorCmd.parent.parent; } while (ancestorCmd !== cmd); cursor.insRightOf(cmd); @@ -8011,19 +7589,17 @@ export default function() { var SubscriptCommand = /** @class */ (function (_super) { __extends(SubscriptCommand, _super); function SubscriptCommand() { - var _this_1 = _super !== null && _super.apply(this, arguments) || this; - _this_1.supsub = 'sub'; + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.supsub = "sub"; _this_1.domView = new DOMView(1, function (blocks) { - return h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf' }, [ - h.block('span', { class: 'dcg-mq-sub' }, blocks[0]), - h('span', { style: 'display:inline-block;width:0' }, [ - h.text(U_ZERO_WIDTH_SPACE), - ]), + return h("span", { class: "dcg-mq-supsub dcg-mq-non-leaf" }, [ + h.block("span", { class: "dcg-mq-sub" }, blocks[0]), + h("span", { style: "display:inline-block;width:0" }, [h.text(U_ZERO_WIDTH_SPACE)]), ]); }); - _this_1.textTemplate = ['_']; - _this_1.mathspeakTemplate = ['Subscript,', ', Baseline']; - _this_1.ariaLabel = 'subscript'; + _this_1.textTemplate = ["_"]; + _this_1.mathspeakTemplate = ["Subscript,", ", Baseline"]; + _this_1.ariaLabel = "subscript"; return _this_1; } SubscriptCommand.prototype.finalizeTree = function () { @@ -8032,85 +7608,78 @@ export default function() { _super.prototype.finalizeTree.call(this); }; return SubscriptCommand; - }(SupSub)); + })(SupSub); LatexCmds.subscript = LatexCmds._ = SubscriptCommand; - LatexCmds.superscript = - LatexCmds.supscript = - LatexCmds['^'] = /** @class */ (function (_super) { - __extends(SuperscriptCommand, _super); - function SuperscriptCommand() { - var _this_1 = _super !== null && _super.apply(this, arguments) || this; - _this_1.supsub = 'sup'; - _this_1.domView = new DOMView(1, function (blocks) { - return h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf dcg-mq-sup-only' }, [ - h.block('span', { class: 'dcg-mq-sup' }, blocks[0]), - ]); - }); - _this_1.textTemplate = ['^(', ')']; - _this_1.ariaLabel = 'superscript'; - _this_1.mathspeakTemplate = ['Superscript,', ', Baseline']; - return _this_1; - } - SuperscriptCommand.prototype.mathspeak = function (opts) { - // Simplify basic exponent speech for common whole numbers. - var child = this.upInto; - if (child !== undefined) { - // Calculate this item's inner text to determine whether to shorten the returned speech. - // Do not calculate its inner mathspeak now until we know that the speech is to be truncated. - // Since the mathspeak computation is recursive, we want to call it only once in this function to avoid performance bottlenecks. - var innerText = getCtrlSeqsFromBlock(child); - // If the superscript is a whole number, shorten the speech that is returned. - if ((!opts || !opts.ignoreShorthand) && intRgx.test(innerText)) { - // Simple cases - if (innerText === '0') { - return 'to the 0 power'; - } - else if (innerText === '2') { - return 'squared'; - } - else if (innerText === '3') { - return 'cubed'; - } - // More complex cases. - var suffix = ''; - // Limit suffix addition to exponents < 1000. - if (/^[+-]?\d{1,3}$/.test(innerText)) { - if (/(11|12|13|4|5|6|7|8|9|0)$/.test(innerText)) { - suffix = 'th'; - } - else if (/1$/.test(innerText)) { - suffix = 'st'; - } - else if (/2$/.test(innerText)) { - suffix = 'nd'; - } - else if (/3$/.test(innerText)) { - suffix = 'rd'; - } - } - var innerMathspeak = typeof child === 'object' ? child.mathspeak() : innerText; - return 'to the ' + innerMathspeak + suffix + ' power'; + LatexCmds.superscript = LatexCmds.supscript = LatexCmds["^"] = /** @class */ (function (_super) { + __extends(SuperscriptCommand, _super); + function SuperscriptCommand() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.supsub = "sup"; + _this_1.domView = new DOMView(1, function (blocks) { + return h("span", { class: "dcg-mq-supsub dcg-mq-non-leaf dcg-mq-sup-only" }, [ + h.block("span", { class: "dcg-mq-sup" }, blocks[0]), + ]); + }); + _this_1.textTemplate = ["^(", ")"]; + _this_1.ariaLabel = "superscript"; + _this_1.mathspeakTemplate = ["Superscript,", ", Baseline"]; + return _this_1; + } + SuperscriptCommand.prototype.mathspeak = function (opts) { + // Simplify basic exponent speech for common whole numbers. + var child = this.upInto; + if (child !== undefined) { + // Calculate this item's inner text to determine whether to shorten the returned speech. + // Do not calculate its inner mathspeak now until we know that the speech is to be truncated. + // Since the mathspeak computation is recursive, we want to call it only once in this function to avoid performance bottlenecks. + var innerText = getCtrlSeqsFromBlock(child); + // If the superscript is a whole number, shorten the speech that is returned. + if ((!opts || !opts.ignoreShorthand) && intRgx.test(innerText)) { + // Simple cases + if (innerText === "0") { + return "to the 0 power"; + } else if (innerText === "2") { + return "squared"; + } else if (innerText === "3") { + return "cubed"; + } + // More complex cases. + var suffix = ""; + // Limit suffix addition to exponents < 1000. + if (/^[+-]?\d{1,3}$/.test(innerText)) { + if (/(11|12|13|4|5|6|7|8|9|0)$/.test(innerText)) { + suffix = "th"; + } else if (/1$/.test(innerText)) { + suffix = "st"; + } else if (/2$/.test(innerText)) { + suffix = "nd"; + } else if (/3$/.test(innerText)) { + suffix = "rd"; } } - return _super.prototype.mathspeak.call(this); - }; - SuperscriptCommand.prototype.finalizeTree = function () { - this.upInto = this.sup = this.getEnd(R); - this.sup.downOutOf = insLeftOfMeUnlessAtEnd; - _super.prototype.finalizeTree.call(this); - }; - return SuperscriptCommand; - }(SupSub)); + var innerMathspeak = typeof child === "object" ? child.mathspeak() : innerText; + return "to the " + innerMathspeak + suffix + " power"; + } + } + return _super.prototype.mathspeak.call(this); + }; + SuperscriptCommand.prototype.finalizeTree = function () { + this.upInto = this.sup = this.getEnd(R); + this.sup.downOutOf = insLeftOfMeUnlessAtEnd; + _super.prototype.finalizeTree.call(this); + }; + return SuperscriptCommand; + })(SupSub); var SummationNotation = /** @class */ (function (_super) { __extends(SummationNotation, _super); function SummationNotation(ch, symbol, ariaLabel) { var _this_1 = _super.call(this) || this; - _this_1.ariaLabel = ariaLabel || ch.replace(/^\\/, ''); + _this_1.ariaLabel = ariaLabel || ch.replace(/^\\/, ""); var domView = new DOMView(2, function (blocks) { - return h('span', { class: 'dcg-mq-large-operator dcg-mq-non-leaf' }, [ - h('span', { class: 'dcg-mq-to' }, [h.block('span', {}, blocks[1])]), - h('big', {}, [h.text(symbol)]), - h('span', { class: 'dcg-mq-from' }, [h.block('span', {}, blocks[0])]), + return h("span", { class: "dcg-mq-large-operator dcg-mq-non-leaf" }, [ + h("span", { class: "dcg-mq-to" }, [h.block("span", {}, blocks[1])]), + h("big", {}, [h.text(symbol)]), + h("span", { class: "dcg-mq-from" }, [h.block("span", {}, blocks[0])]), ]); }); MQSymbol.prototype.setCtrlSeqHtmlTextAndMathspeak.call(_this_1, ch, domView); @@ -8119,41 +7688,43 @@ export default function() { SummationNotation.prototype.createLeftOf = function (cursor) { _super.prototype.createLeftOf.call(this, cursor); if (cursor.options.sumStartsWithNEquals) { - new Letter('n').createLeftOf(cursor); + new Letter("n").createLeftOf(cursor); new Equality().createLeftOf(cursor); } }; SummationNotation.prototype.latexRecursive = function (ctx) { this.checkCursorContextOpen(ctx); - ctx.latex += this.ctrlSeq + '_{'; + ctx.latex += this.ctrlSeq + "_{"; var beforeLength = ctx.latex.length; this.getEnd(L).latexRecursive(ctx); var afterLength = ctx.latex.length; if (afterLength === beforeLength) { // nothing was written so we write a space - ctx.latex += ' '; + ctx.latex += " "; } - ctx.latex += '}^{'; + ctx.latex += "}^{"; beforeLength = ctx.latex.length; this.getEnd(R).latexRecursive(ctx); afterLength = ctx.latex.length; if (beforeLength === afterLength) { // nothing was written so we write a space - ctx.latex += ' '; + ctx.latex += " "; } - ctx.latex += '}'; + ctx.latex += "}"; this.checkCursorContextClose(ctx); }; SummationNotation.prototype.mathspeak = function () { - return ('Start ' + + return ( + "Start " + this.ariaLabel + - ' from ' + + " from " + this.getEnd(L).mathspeak() + - ' to ' + + " to " + this.getEnd(R).mathspeak() + - ', end ' + + ", end " + this.ariaLabel + - ', '); + ", " + ); }; SummationNotation.prototype.parser = function () { var string = Parser.string; @@ -8166,386 +7737,346 @@ export default function() { blocks[i].adopt(self, self.getEnd(R), 0); } return optWhitespace - .then(string('_').or(string('^'))) + .then(string("_").or(string("^"))) .then(function (supOrSub) { - var child = blocks[supOrSub === '_' ? 0 : 1]; - return block.then(function (block) { - block.children().adopt(child, child.getEnd(R), 0); - return succeed(self); - }); - }) + var child = blocks[supOrSub === "_" ? 0 : 1]; + return block.then(function (block) { + block.children().adopt(child, child.getEnd(R), 0); + return succeed(self); + }); + }) .many() .result(self); }; SummationNotation.prototype.finalizeTree = function () { var endsL = this.getEnd(L); var endsR = this.getEnd(R); - endsL.ariaLabel = 'lower bound'; - endsR.ariaLabel = 'upper bound'; + endsL.ariaLabel = "lower bound"; + endsR.ariaLabel = "upper bound"; this.downInto = endsL; this.upInto = endsR; endsL.upOutOf = endsR; endsR.downOutOf = endsL; }; return SummationNotation; - }(MathCommand)); - LatexCmds['\u2211'] = - LatexCmds.sum = - LatexCmds.summation = - function () { return new SummationNotation('\\sum ', U_NARY_SUMMATION, 'sum'); }; - LatexCmds['\u220f'] = - LatexCmds.prod = - LatexCmds.product = - function () { return new SummationNotation('\\prod ', U_NARY_PRODUCT, 'product'); }; + })(MathCommand); + LatexCmds["\u2211"] = LatexCmds.sum = LatexCmds.summation = function () { + return new SummationNotation("\\sum ", U_NARY_SUMMATION, "sum"); + }; + LatexCmds["\u220f"] = LatexCmds.prod = LatexCmds.product = function () { + return new SummationNotation("\\prod ", U_NARY_PRODUCT, "product"); + }; LatexCmds.coprod = LatexCmds.coproduct = function () { - return new SummationNotation('\\coprod ', U_NARY_COPRODUCT, 'co product'); + return new SummationNotation("\\coprod ", U_NARY_COPRODUCT, "co product"); }; - LatexCmds['\u222b'] = - LatexCmds['int'] = - LatexCmds.integral = /** @class */ (function (_super) { - __extends(class_11, _super); - function class_11() { - var _this_1 = _super.call(this, '\\int ', '', 'integral') || this; - _this_1.ariaLabel = 'integral'; - _this_1.domView = new DOMView(2, function (blocks) { - return h('span', { class: 'dcg-mq-int dcg-mq-non-leaf' }, [ - h('big', {}, [h.text(U_INTEGRAL)]), - h('span', { class: 'dcg-mq-supsub dcg-mq-non-leaf' }, [ - h('span', { class: 'dcg-mq-sup' }, [ - h.block('span', { class: 'dcg-mq-sup-inner' }, blocks[1]), - ]), - h.block('span', { class: 'dcg-mq-sub' }, blocks[0]), - h('span', { style: 'display:inline-block;width:0' }, [ - h.text(U_ZERO_WIDTH_SPACE), - ]), - ]), - ]); - }); - return _this_1; - } - class_11.prototype.createLeftOf = function (cursor) { - // FIXME: refactor rather than overriding - MathCommand.prototype.createLeftOf.call(this, cursor); - }; - return class_11; - }(SummationNotation)); + LatexCmds["\u222b"] = LatexCmds["int"] = LatexCmds.integral = /** @class */ (function (_super) { + __extends(class_11, _super); + function class_11() { + var _this_1 = _super.call(this, "\\int ", "", "integral") || this; + _this_1.ariaLabel = "integral"; + _this_1.domView = new DOMView(2, function (blocks) { + return h("span", { class: "dcg-mq-int dcg-mq-non-leaf" }, [ + h("big", {}, [h.text(U_INTEGRAL)]), + h("span", { class: "dcg-mq-supsub dcg-mq-non-leaf" }, [ + h("span", { class: "dcg-mq-sup" }, [h.block("span", { class: "dcg-mq-sup-inner" }, blocks[1])]), + h.block("span", { class: "dcg-mq-sub" }, blocks[0]), + h("span", { style: "display:inline-block;width:0" }, [h.text(U_ZERO_WIDTH_SPACE)]), + ]), + ]); + }); + return _this_1; + } + class_11.prototype.createLeftOf = function (cursor) { + // FIXME: refactor rather than overriding + MathCommand.prototype.createLeftOf.call(this, cursor); + }; + return class_11; + })(SummationNotation); //window.LatexCmds = LatexCmds; //console.log(LatexCmds); //console.log(window); - var Fraction = (LatexCmds.frac = - LatexCmds.dfrac = - LatexCmds.cfrac = - LatexCmds.fraction = /** @class */ (function (_super) { - __extends(FracNode, _super); - function FracNode() { - var _this_1 = _super !== null && _super.apply(this, arguments) || this; - _this_1.ctrlSeq = '\\frac'; - _this_1.domView = new DOMView(2, function (blocks) { - return h('span', { class: 'dcg-mq-fraction dcg-mq-non-leaf' }, [ - h.block('span', { class: 'dcg-mq-numerator' }, blocks[0]), - h.block('span', { class: 'dcg-mq-denominator' }, blocks[1]), - h('span', { style: 'display:inline-block;width:0' }, [ - h.text(U_ZERO_WIDTH_SPACE), - ]), - ]); - }); - _this_1.textTemplate = ['(', ')/(', ')']; - return _this_1; - } - FracNode.prototype.finalizeTree = function () { - var endsL = this.getEnd(L); - var endsR = this.getEnd(R); - this.upInto = endsR.upOutOf = endsL; - this.downInto = endsL.downOutOf = endsR; - endsL.ariaLabel = 'numerator'; - endsR.ariaLabel = 'denominator'; - if (this.getFracDepth() > 1) { - this.mathspeakTemplate = [ - 'StartNestedFraction,', - 'NestedOver', - ', EndNestedFraction', - ]; - } - else { - this.mathspeakTemplate = ['StartFraction,', 'Over', ', EndFraction']; - } - }; - FracNode.prototype.mathspeak = function (opts) { - if (opts && opts.createdLeftOf) { - var cursor = opts.createdLeftOf; - return cursor.parent.mathspeak(); - } - var numText = getCtrlSeqsFromBlock(this.getEnd(L)); - var denText = getCtrlSeqsFromBlock(this.getEnd(R)); - // Shorten mathspeak value for whole number fractions whose denominator is less than 10. - if ((!opts || !opts.ignoreShorthand) && - intRgx.test(numText) && - intRgx.test(denText)) { - var isSingular = numText === '1' || numText === '-1'; - var newDenSpeech = ''; - if (denText === '2') { - newDenSpeech = isSingular ? 'half' : 'halves'; - } - else if (denText === '3') { - newDenSpeech = isSingular ? 'third' : 'thirds'; - } - else if (denText === '4') { - newDenSpeech = isSingular ? 'quarter' : 'quarters'; - } - else if (denText === '5') { - newDenSpeech = isSingular ? 'fifth' : 'fifths'; - } - else if (denText === '6') { - newDenSpeech = isSingular ? 'sixth' : 'sixths'; - } - else if (denText === '7') { - newDenSpeech = isSingular ? 'seventh' : 'sevenths'; - } - else if (denText === '8') { - newDenSpeech = isSingular ? 'eighth' : 'eighths'; - } - else if (denText === '9') { - newDenSpeech = isSingular ? 'ninth' : 'ninths'; - } - if (newDenSpeech !== '') { - var output = ''; - // Handle the case of an integer followed by a simplified fraction such as 1\frac{1}{2}. - // Such combinations should be spoken aloud as "1 and 1 half." - // Start at the left sibling of the fraction and continue leftward until something other than a digit or whitespace is found. - var precededByInteger = false; - for (var sibling = this[L]; sibling && sibling[L] !== undefined; sibling = sibling[L]) { - // Ignore whitespace - if (sibling.ctrlSeq === '\\ ') { - continue; - } - else if (intRgx.test(sibling.ctrlSeq || '')) { - precededByInteger = true; - } - else { - precededByInteger = false; - break; - } - } - if (precededByInteger) { - output += 'and '; - } - output += this.getEnd(L).mathspeak() + ' ' + newDenSpeech; - return output; - } + var Fraction = (LatexCmds.frac = LatexCmds.dfrac = LatexCmds.cfrac = LatexCmds.fraction = /** @class */ (function ( + _super + ) { + __extends(FracNode, _super); + function FracNode() { + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = "\\frac"; + _this_1.domView = new DOMView(2, function (blocks) { + return h("span", { class: "dcg-mq-fraction dcg-mq-non-leaf" }, [ + h.block("span", { class: "dcg-mq-numerator" }, blocks[0]), + h.block("span", { class: "dcg-mq-denominator" }, blocks[1]), + h("span", { style: "display:inline-block;width:0" }, [h.text(U_ZERO_WIDTH_SPACE)]), + ]); + }); + _this_1.textTemplate = ["(", ")/(", ")"]; + return _this_1; + } + FracNode.prototype.finalizeTree = function () { + var endsL = this.getEnd(L); + var endsR = this.getEnd(R); + this.upInto = endsR.upOutOf = endsL; + this.downInto = endsL.downOutOf = endsR; + endsL.ariaLabel = "numerator"; + endsR.ariaLabel = "denominator"; + if (this.getFracDepth() > 1) { + this.mathspeakTemplate = ["StartNestedFraction,", "NestedOver", ", EndNestedFraction"]; + } else { + this.mathspeakTemplate = ["StartFraction,", "Over", ", EndFraction"]; + } + }; + FracNode.prototype.mathspeak = function (opts) { + if (opts && opts.createdLeftOf) { + var cursor = opts.createdLeftOf; + return cursor.parent.mathspeak(); + } + var numText = getCtrlSeqsFromBlock(this.getEnd(L)); + var denText = getCtrlSeqsFromBlock(this.getEnd(R)); + // Shorten mathspeak value for whole number fractions whose denominator is less than 10. + if ((!opts || !opts.ignoreShorthand) && intRgx.test(numText) && intRgx.test(denText)) { + var isSingular = numText === "1" || numText === "-1"; + var newDenSpeech = ""; + if (denText === "2") { + newDenSpeech = isSingular ? "half" : "halves"; + } else if (denText === "3") { + newDenSpeech = isSingular ? "third" : "thirds"; + } else if (denText === "4") { + newDenSpeech = isSingular ? "quarter" : "quarters"; + } else if (denText === "5") { + newDenSpeech = isSingular ? "fifth" : "fifths"; + } else if (denText === "6") { + newDenSpeech = isSingular ? "sixth" : "sixths"; + } else if (denText === "7") { + newDenSpeech = isSingular ? "seventh" : "sevenths"; + } else if (denText === "8") { + newDenSpeech = isSingular ? "eighth" : "eighths"; + } else if (denText === "9") { + newDenSpeech = isSingular ? "ninth" : "ninths"; + } + if (newDenSpeech !== "") { + var output = ""; + // Handle the case of an integer followed by a simplified fraction such as 1\frac{1}{2}. + // Such combinations should be spoken aloud as "1 and 1 half." + // Start at the left sibling of the fraction and continue leftward until something other than a digit or whitespace is found. + var precededByInteger = false; + for (var sibling = this[L]; sibling && sibling[L] !== undefined; sibling = sibling[L]) { + // Ignore whitespace + if (sibling.ctrlSeq === "\\ ") { + continue; + } else if (intRgx.test(sibling.ctrlSeq || "")) { + precededByInteger = true; + } else { + precededByInteger = false; + break; } - return _super.prototype.mathspeak.call(this); - }; - FracNode.prototype.getFracDepth = function () { - var level = 0; - var walkUp = function (item, level) { - if (item instanceof MQNode && - item.ctrlSeq && - item.ctrlSeq.toLowerCase().search('frac') >= 0) - level += 1; - if (item && item.parent) - return walkUp(item.parent, level); - else - return level; - }; - return walkUp(this, level); - }; - return FracNode; - }(MathCommand))); - var LiveFraction = (LatexCmds.over = - CharCmds['/'] = /** @class */ (function (_super) { - __extends(class_12, _super); - function class_12() { - return _super !== null && _super.apply(this, arguments) || this; - } - class_12.prototype.createLeftOf = function (cursor) { - if (!this.replacedFragment) { - var leftward = cursor[L]; - if (!cursor.options.typingSlashCreatesNewFraction) { - while (leftward && - !(leftward instanceof BinaryOperator || - leftward instanceof (LatexCmds.text || noop) || - leftward instanceof SummationNotation || - leftward.ctrlSeq === '\\ ' || - /^[,;:]$/.test(leftward.ctrlSeq)) //lookbehind for operator - ) - leftward = leftward[L]; - } - if (leftward instanceof SummationNotation && - leftward[R] instanceof SupSub) { - leftward = leftward[R]; - var leftwardR = leftward[R]; - if (leftwardR instanceof SupSub && - leftwardR.ctrlSeq != leftward.ctrlSeq) - leftward = leftward[R]; } - if (leftward !== cursor[L] && !cursor.isTooDeep(1)) { - var leftwardR = leftward[R]; - var cursorL = cursor[L]; - this.replaces(new Fragment(leftwardR || cursor.parent.getEnd(L), cursorL)); - cursor[L] = leftward; + if (precededByInteger) { + output += "and "; } + output += this.getEnd(L).mathspeak() + " " + newDenSpeech; + return output; } - _super.prototype.createLeftOf.call(this, cursor); + } + return _super.prototype.mathspeak.call(this); + }; + FracNode.prototype.getFracDepth = function () { + var level = 0; + var walkUp = function (item, level) { + if (item instanceof MQNode && item.ctrlSeq && item.ctrlSeq.toLowerCase().search("frac") >= 0) + level += 1; + if (item && item.parent) return walkUp(item.parent, level); + else return level; }; - return class_12; - }(Fraction))); + return walkUp(this, level); + }; + return FracNode; + })(MathCommand)); + var LiveFraction = (LatexCmds.over = CharCmds["/"] = /** @class */ (function (_super) { + __extends(class_12, _super); + function class_12() { + return (_super !== null && _super.apply(this, arguments)) || this; + } + class_12.prototype.createLeftOf = function (cursor) { + if (!this.replacedFragment) { + var leftward = cursor[L]; + if (!cursor.options.typingSlashCreatesNewFraction) { + while ( + leftward && + !( + leftward instanceof BinaryOperator || + leftward instanceof (LatexCmds.text || noop) || + leftward instanceof SummationNotation || + leftward.ctrlSeq === "\\ " || + /^[,;:]$/.test(leftward.ctrlSeq) + ) //lookbehind for operator + ) + leftward = leftward[L]; + } + if (leftward instanceof SummationNotation && leftward[R] instanceof SupSub) { + leftward = leftward[R]; + var leftwardR = leftward[R]; + if (leftwardR instanceof SupSub && leftwardR.ctrlSeq != leftward.ctrlSeq) leftward = leftward[R]; + } + if (leftward !== cursor[L] && !cursor.isTooDeep(1)) { + var leftwardR = leftward[R]; + var cursorL = cursor[L]; + this.replaces(new Fragment(leftwardR || cursor.parent.getEnd(L), cursorL)); + cursor[L] = leftward; + } + } + _super.prototype.createLeftOf.call(this, cursor); + }; + return class_12; + })(Fraction)); var AnsBuilder = function () { - return new MQSymbol('\\operatorname{ans}', h('span', { class: 'dcg-mq-ans' }, [h.text('ans')]), 'ans'); + return new MQSymbol("\\operatorname{ans}", h("span", { class: "dcg-mq-ans" }, [h.text("ans")]), "ans"); }; LatexCmds.ans = AnsBuilder; var PercentOfBuilder = function () { - return new MQSymbol('\\%\\operatorname{of}', h('span', { class: 'dcg-mq-nonSymbola dcg-mq-operator-name' }, [h.text('% of ')]), 'percent of'); + return new MQSymbol( + "\\%\\operatorname{of}", + h("span", { class: "dcg-mq-nonSymbola dcg-mq-operator-name" }, [h.text("% of ")]), + "percent of" + ); }; LatexCmds.percent = LatexCmds.percentof = PercentOfBuilder; var SquareRoot = /** @class */ (function (_super) { __extends(SquareRoot, _super); function SquareRoot() { - var _this_1 = _super !== null && _super.apply(this, arguments) || this; - _this_1.ctrlSeq = '\\sqrt'; + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = "\\sqrt"; _this_1.domView = new DOMView(1, function (blocks) { - return h('span', { class: 'dcg-mq-non-leaf dcg-mq-sqrt-container' }, [ - h('span', { class: 'dcg-mq-scaled dcg-mq-sqrt-prefix' }, [ - SVG_SYMBOLS.sqrt.html(), - ]), - h.block('span', { class: 'dcg-mq-non-leaf dcg-mq-sqrt-stem' }, blocks[0]), + return h("span", { class: "dcg-mq-non-leaf dcg-mq-sqrt-container" }, [ + h("span", { class: "dcg-mq-scaled dcg-mq-sqrt-prefix" }, [SVG_SYMBOLS.sqrt.html()]), + h.block("span", { class: "dcg-mq-non-leaf dcg-mq-sqrt-stem" }, blocks[0]), ]); }); - _this_1.textTemplate = ['sqrt(', ')']; - _this_1.mathspeakTemplate = ['StartRoot,', ', EndRoot']; - _this_1.ariaLabel = 'root'; + _this_1.textTemplate = ["sqrt(", ")"]; + _this_1.mathspeakTemplate = ["StartRoot,", ", EndRoot"]; + _this_1.ariaLabel = "root"; return _this_1; } SquareRoot.prototype.parser = function () { return latexMathParser.optBlock .then(function (optBlock) { - return latexMathParser.block.map(function (block) { - var nthroot = new NthRoot(); - nthroot.blocks = [optBlock, block]; - optBlock.adopt(nthroot, 0, 0); - block.adopt(nthroot, optBlock, 0); - return nthroot; - }); - }) + return latexMathParser.block.map(function (block) { + var nthroot = new NthRoot(); + nthroot.blocks = [optBlock, block]; + optBlock.adopt(nthroot, 0, 0); + block.adopt(nthroot, optBlock, 0); + return nthroot; + }); + }) .or(_super.prototype.parser.call(this)); }; return SquareRoot; - }(MathCommand)); + })(MathCommand); LatexCmds.sqrt = SquareRoot; LatexCmds.hat = /** @class */ (function (_super) { __extends(Hat, _super); function Hat() { - var _this_1 = _super !== null && _super.apply(this, arguments) || this; - _this_1.ctrlSeq = '\\hat'; + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = "\\hat"; _this_1.domView = new DOMView(1, function (blocks) { - return h('span', { class: 'dcg-mq-non-leaf' }, [ - h('span', { class: 'dcg-mq-hat-prefix' }, [h.text('^')]), - h.block('span', { class: 'dcg-mq-hat-stem' }, blocks[0]), + return h("span", { class: "dcg-mq-non-leaf" }, [ + h("span", { class: "dcg-mq-hat-prefix" }, [h.text("^")]), + h.block("span", { class: "dcg-mq-hat-stem" }, blocks[0]), ]); }); - _this_1.textTemplate = ['hat(', ')']; + _this_1.textTemplate = ["hat(", ")"]; return _this_1; } return Hat; - }(MathCommand)); + })(MathCommand); var NthRoot = /** @class */ (function (_super) { __extends(NthRoot, _super); function NthRoot() { - var _this_1 = _super !== null && _super.apply(this, arguments) || this; + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; _this_1.domView = new DOMView(2, function (blocks) { - return h('span', { class: 'dcg-mq-nthroot-container dcg-mq-non-leaf' }, [ - h.block('sup', { class: 'dcg-mq-nthroot dcg-mq-non-leaf' }, blocks[0]), - h('span', { class: 'dcg-mq-scaled dcg-mq-sqrt-container' }, [ - h('span', { class: 'dcg-mq-sqrt-prefix dcg-mq-scaled' }, [ - SVG_SYMBOLS.sqrt.html(), - ]), - h.block('span', { class: 'dcg-mq-sqrt-stem dcg-mq-non-leaf' }, blocks[1]), + return h("span", { class: "dcg-mq-nthroot-container dcg-mq-non-leaf" }, [ + h.block("sup", { class: "dcg-mq-nthroot dcg-mq-non-leaf" }, blocks[0]), + h("span", { class: "dcg-mq-scaled dcg-mq-sqrt-container" }, [ + h("span", { class: "dcg-mq-sqrt-prefix dcg-mq-scaled" }, [SVG_SYMBOLS.sqrt.html()]), + h.block("span", { class: "dcg-mq-sqrt-stem dcg-mq-non-leaf" }, blocks[1]), ]), ]); }); - _this_1.textTemplate = ['sqrt[', '](', ')']; + _this_1.textTemplate = ["sqrt[", "](", ")"]; return _this_1; } NthRoot.prototype.latexRecursive = function (ctx) { this.checkCursorContextOpen(ctx); - ctx.latex += '\\sqrt['; + ctx.latex += "\\sqrt["; this.getEnd(L).latexRecursive(ctx); - ctx.latex += ']{'; + ctx.latex += "]{"; this.getEnd(R).latexRecursive(ctx); - ctx.latex += '}'; + ctx.latex += "}"; this.checkCursorContextClose(ctx); }; NthRoot.prototype.mathspeak = function () { var indexMathspeak = this.getEnd(L).mathspeak(); var radicandMathspeak = this.getEnd(R).mathspeak(); - this.getEnd(L).ariaLabel = 'Index'; - this.getEnd(R).ariaLabel = 'Radicand'; - if (indexMathspeak === '3') { + this.getEnd(L).ariaLabel = "Index"; + this.getEnd(R).ariaLabel = "Radicand"; + if (indexMathspeak === "3") { // cube root - return 'Start Cube Root, ' + radicandMathspeak + ', End Cube Root'; - } - else { - return ('Root Index ' + - indexMathspeak + - ', Start Root, ' + - radicandMathspeak + - ', End Root'); + return "Start Cube Root, " + radicandMathspeak + ", End Cube Root"; + } else { + return "Root Index " + indexMathspeak + ", Start Root, " + radicandMathspeak + ", End Root"; } }; return NthRoot; - }(SquareRoot)); + })(SquareRoot); LatexCmds.nthroot = NthRoot; LatexCmds.cbrt = /** @class */ (function (_super) { __extends(class_13, _super); function class_13() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } class_13.prototype.createLeftOf = function (cursor) { _super.prototype.createLeftOf.call(this, cursor); - new Digit('3').createLeftOf(cursor); + new Digit("3").createLeftOf(cursor); cursor.controller.moveRight(); }; return class_13; - }(NthRoot)); + })(NthRoot); var DiacriticAbove = /** @class */ (function (_super) { __extends(DiacriticAbove, _super); function DiacriticAbove(ctrlSeq, html, textTemplate) { var _this_1 = this; var domView = new DOMView(1, function (blocks) { - return h('span', { class: 'dcg-mq-non-leaf' }, [ - h('span', { class: 'dcg-mq-diacritic-above' }, [html]), - h.block('span', { class: 'dcg-mq-diacritic-stem' }, blocks[0]), + return h("span", { class: "dcg-mq-non-leaf" }, [ + h("span", { class: "dcg-mq-diacritic-above" }, [html]), + h.block("span", { class: "dcg-mq-diacritic-stem" }, blocks[0]), ]); }); _this_1 = _super.call(this, ctrlSeq, domView, textTemplate) || this; return _this_1; } return DiacriticAbove; - }(MathCommand)); + })(MathCommand); LatexCmds.vec = function () { - return new DiacriticAbove('\\vec', h.entityText('→'), ['vec(', ')']); + return new DiacriticAbove("\\vec", h.entityText("→"), ["vec(", ")"]); }; LatexCmds.tilde = function () { - return new DiacriticAbove('\\tilde', h.text('~'), ['tilde(', ')']); + return new DiacriticAbove("\\tilde", h.text("~"), ["tilde(", ")"]); }; var DelimsNode = /** @class */ (function (_super) { __extends(DelimsNode, _super); function DelimsNode() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } DelimsNode.prototype.setDOM = function (el) { var _c; _super.prototype.setDOM.call(this, el); var children = this.domFrag().children(); if (!children.isEmpty()) { - this.delimFrags = (_c = {}, - _c[L] = children.first(), - _c[R] = children.last(), - _c); + this.delimFrags = ((_c = {}), (_c[L] = children.first()), (_c[R] = children.last()), _c); } return this; }; return DelimsNode; - }(MathCommand)); + })(MathCommand); // Round/Square/Curly/Angle Brackets (aka Parens/Brackets/Braces) // first typed as one-sided bracket with matching "ghost" bracket at // far end of current block, until you type an opposing one @@ -8553,12 +8084,10 @@ export default function() { __extends(Bracket, _super); function Bracket(side, open, close, ctrlSeq, end) { var _c; - var _this_1 = _super.call(this, '\\left' + ctrlSeq, undefined, [open, close]) || this; + var _this_1 = _super.call(this, "\\left" + ctrlSeq, undefined, [open, close]) || this; _this_1.side = side; - _this_1.sides = (_c = {}, - _c[L] = { ch: open, ctrlSeq: ctrlSeq }, - _c[R] = { ch: close, ctrlSeq: end }, - _c); + _this_1.sides = + ((_c = {}), (_c[L] = { ch: open, ctrlSeq: ctrlSeq }), (_c[R] = { ch: close, ctrlSeq: end }), _c); return _this_1; } Bracket.prototype.numBlocks = function () { @@ -8571,80 +8100,88 @@ export default function() { // wait until now so that .side may this.domView = new DOMView(1, function (blocks) { return h( - // be set by createLeftOf or parser - 'span', { class: 'dcg-mq-non-leaf dcg-mq-bracket-container' }, [ - h('span', { - style: 'width:' + leftSymbol.width, - class: 'dcg-mq-scaled dcg-mq-bracket-l dcg-mq-paren' + - (_this_1.side === R ? ' dcg-mq-ghost' : ''), - }, [leftSymbol.html()]), - h.block('span', { - style: 'margin-left:' + - leftSymbol.width + - ';margin-right:' + - rightSymbol.width, - class: 'dcg-mq-bracket-middle dcg-mq-non-leaf', - }, blocks[0]), - h('span', { - style: 'width:' + rightSymbol.width, - class: 'dcg-mq-scaled dcg-mq-bracket-r dcg-mq-paren' + - (_this_1.side === L ? ' dcg-mq-ghost' : ''), - }, [rightSymbol.html()]), - ]); + // be set by createLeftOf or parser + "span", + { class: "dcg-mq-non-leaf dcg-mq-bracket-container" }, + [ + h( + "span", + { + style: "width:" + leftSymbol.width, + class: + "dcg-mq-scaled dcg-mq-bracket-l dcg-mq-paren" + + (_this_1.side === R ? " dcg-mq-ghost" : ""), + }, + [leftSymbol.html()] + ), + h.block( + "span", + { + style: "margin-left:" + leftSymbol.width + ";margin-right:" + rightSymbol.width, + class: "dcg-mq-bracket-middle dcg-mq-non-leaf", + }, + blocks[0] + ), + h( + "span", + { + style: "width:" + rightSymbol.width, + class: + "dcg-mq-scaled dcg-mq-bracket-r dcg-mq-paren" + + (_this_1.side === L ? " dcg-mq-ghost" : ""), + }, + [rightSymbol.html()] + ), + ] + ); }); return _super.prototype.html.call(this); }; Bracket.prototype.getSymbol = function (side) { var ch = this.sides[side || R].ch; - return SVG_SYMBOLS[ch] || { width: '0', html: '' }; + return SVG_SYMBOLS[ch] || { width: "0", html: "" }; }; Bracket.prototype.latexRecursive = function (ctx) { this.checkCursorContextOpen(ctx); - ctx.latex += '\\left' + this.sides[L].ctrlSeq; + ctx.latex += "\\left" + this.sides[L].ctrlSeq; this.getEnd(L).latexRecursive(ctx); - ctx.latex += '\\right' + this.sides[R].ctrlSeq; + ctx.latex += "\\right" + this.sides[R].ctrlSeq; this.checkCursorContextClose(ctx); }; Bracket.prototype.mathspeak = function (opts) { - var open = this.sides[L].ch, close = this.sides[R].ch; - if (open === '|' && close === '|') { - this.mathspeakTemplate = ['StartAbsoluteValue,', ', EndAbsoluteValue']; - this.ariaLabel = 'absolute value'; - } - else if (opts && opts.createdLeftOf && this.side) { - var ch = ''; - if (this.side === L) - ch = this.textTemplate[0]; - else if (this.side === R) - ch = this.textTemplate[1]; - return ((this.side === L ? 'left ' : 'right ') + - BRACKET_NAMES[ch]); - } - else { - this.mathspeakTemplate = [ - 'left ' + BRACKET_NAMES[open] + ',', - ', right ' + BRACKET_NAMES[close], - ]; - this.ariaLabel = - BRACKET_NAMES[open] + ' block'; + var open = this.sides[L].ch, + close = this.sides[R].ch; + if (open === "|" && close === "|") { + this.mathspeakTemplate = ["StartAbsoluteValue,", ", EndAbsoluteValue"]; + this.ariaLabel = "absolute value"; + } else if (opts && opts.createdLeftOf && this.side) { + var ch = ""; + if (this.side === L) ch = this.textTemplate[0]; + else if (this.side === R) ch = this.textTemplate[1]; + return (this.side === L ? "left " : "right ") + BRACKET_NAMES[ch]; + } else { + this.mathspeakTemplate = ["left " + BRACKET_NAMES[open] + ",", ", right " + BRACKET_NAMES[close]]; + this.ariaLabel = BRACKET_NAMES[open] + " block"; } return _super.prototype.mathspeak.call(this); }; Bracket.prototype.matchBrack = function (opts, expectedSide, node) { // return node iff it's a matching 1-sided bracket of expected side (if any) - return (node instanceof Bracket && + return ( + node instanceof Bracket && node.side && node.side !== -expectedSide && (!opts.restrictMismatchedBrackets || OPP_BRACKS[this.sides[this.side].ch] === node.sides[node.side].ch || - { '(': ']', '[': ')' }[this.sides[L].ch] === node.sides[R].ch) && - node); + { "(": "]", "[": ")" }[this.sides[L].ch] === node.sides[R].ch) && + node + ); }; Bracket.prototype.closeOpposing = function (brack) { brack.side = 0; brack.sides[this.side] = this.sides[this.side]; // copy over my info (may be var brackFrag = brack.delimFrags[this.side === L ? L : R] // mismatched, like [a, b)) - .removeClass('dcg-mq-ghost'); + .removeClass("dcg-mq-ghost"); this.replaceBracket(brackFrag, this.side); }; Bracket.prototype.createLeftOf = function (cursor) { @@ -8653,17 +8190,16 @@ export default function() { // unless wrapping seln in brackets, // check if next to or inside an opposing one-sided bracket var opts = cursor.options; - if (this.sides[L].ch === '|') { + if (this.sides[L].ch === "|") { // check both sides if I'm a pipe brack = this.matchBrack(opts, R, cursor[R]) || - this.matchBrack(opts, L, cursor[L]) || - this.matchBrack(opts, 0, cursor.parent.parent); - } - else { + this.matchBrack(opts, L, cursor[L]) || + this.matchBrack(opts, 0, cursor.parent.parent); + } else { brack = this.matchBrack(opts, -this.side, cursor[-this.side]) || - this.matchBrack(opts, -this.side, cursor.parent.parent); + this.matchBrack(opts, -this.side, cursor.parent.parent); } } if (brack) { @@ -8681,11 +8217,9 @@ export default function() { node.reflow(); return undefined; }); - } - else { + } else { (brack = this), (side = brack.side); - if (brack.replacedFragment) - brack.side = 0; + if (brack.replacedFragment) brack.side = 0; // wrapping seln, don't be one-sided else if (cursor[-side]) { // elsewise, auto-expand so ghost is at far end @@ -8694,32 +8228,26 @@ export default function() { } _super.prototype.createLeftOf.call(this, cursor); } - if (side === L) - cursor.insAtLeftEnd(brack.getEnd(L)); - else - cursor.insRightOf(brack); + if (side === L) cursor.insAtLeftEnd(brack.getEnd(L)); + else cursor.insRightOf(brack); }; - Bracket.prototype.placeCursor = function () { }; + Bracket.prototype.placeCursor = function () {}; Bracket.prototype.unwrap = function () { - this.getEnd(L) - .children() - .disown() - .adopt(this.parent, this, this[R]) - .domFrag() - .insertAfter(this.domFrag()); + this.getEnd(L).children().disown().adopt(this.parent, this, this[R]).domFrag().insertAfter(this.domFrag()); this.remove(); }; Bracket.prototype.deleteSide = function (side, outward, cursor) { - var parent = this.parent, sib = this[side], farEnd = parent.getEnd(side); + var parent = this.parent, + sib = this[side], + farEnd = parent.getEnd(side); if (side === this.side) { // deleting non-ghost of one-sided bracket, unwrap this.unwrap(); - sib - ? cursor.insDirOf(-side, sib) - : cursor.insAtDirEnd(side, parent); + sib ? cursor.insDirOf(-side, sib) : cursor.insAtDirEnd(side, parent); return; } - var opts = cursor.options, wasSolid = !this.side; + var opts = cursor.options, + wasSolid = !this.side; this.side = -side; // if deleting like, outer close-brace of [(1+2)+3} where inner open-paren if (this.matchBrack(opts, side, this.getEnd(L).getEnd(this.side))) { @@ -8727,16 +8255,13 @@ export default function() { this.closeOpposing(this.getEnd(L).getEnd(this.side)); // then become [1+2)+3 var origEnd = this.getEnd(L).getEnd(side); this.unwrap(); - if (origEnd) - origEnd.siblingCreated(cursor.options, side); + if (origEnd) origEnd.siblingCreated(cursor.options, side); if (sib) { cursor.insDirOf(-side, sib); - } - else { + } else { cursor.insAtDirEnd(side, parent); } - } - else { + } else { // if deleting like, inner close-brace of ([1+2}+3) where outer if (this.matchBrack(opts, side, this.parent.parent)) { // open-paren is @@ -8745,37 +8270,30 @@ export default function() { } // else if deleting outward from a solid pair, unwrap else if (outward && wasSolid) { this.unwrap(); - sib - ? cursor.insDirOf(-side, sib) - : cursor.insAtDirEnd(side, parent); + sib ? cursor.insDirOf(-side, sib) : cursor.insAtDirEnd(side, parent); return; - } - else { + } else { // else deleting just one of a pair of brackets, become one-sided this.sides[side] = getOppBracketSide(this); - this.delimFrags[L].removeClass('dcg-mq-ghost'); - this.delimFrags[R].removeClass('dcg-mq-ghost'); - var brackFrag = this.delimFrags[side].addClass('dcg-mq-ghost'); + this.delimFrags[L].removeClass("dcg-mq-ghost"); + this.delimFrags[R].removeClass("dcg-mq-ghost"); + var brackFrag = this.delimFrags[side].addClass("dcg-mq-ghost"); this.replaceBracket(brackFrag, side); } if (sib) { // auto-expand so ghost is at far end var leftEnd = this.getEnd(L); var origEnd = leftEnd.getEnd(side); - leftEnd.domFrag().removeClass('dcg-mq-empty'); + leftEnd.domFrag().removeClass("dcg-mq-empty"); new Fragment(sib, farEnd, -side) .disown() .withDirAdopt(-side, leftEnd, origEnd, 0) .domFrag() .insAtDirEnd(side, leftEnd.domFrag().oneElement()); - if (origEnd) - origEnd.siblingCreated(cursor.options, side); + if (origEnd) origEnd.siblingCreated(cursor.options, side); cursor.insDirOf(-side, sib); } // didn't auto-expand, cursor goes just outside or just inside parens - else - outward - ? cursor.insDirOf(side, this) - : cursor.insAtDirEnd(side, this.getEnd(L)); + else outward ? cursor.insDirOf(side, this) : cursor.insAtDirEnd(side, this.getEnd(L)); } }; Bracket.prototype.replaceBracket = function (brackFrag, side) { @@ -8787,8 +8305,7 @@ export default function() { if (!next.isEmpty()) { next.oneElement().style.marginLeft = symbol.width; } - } - else { + } else { var prev = brackFrag.prev(); if (!prev.isEmpty()) { prev.oneElement().style.marginRight = symbol.width; @@ -8805,17 +8322,16 @@ export default function() { // FIXME HACK: after initial creation/insertion, finalizeTree would only be // called if the paren is selected and replaced, e.g. by LiveFraction this.finalizeTree = this.intentionalBlur = function () { - this.delimFrags[this.side === L ? R : L].removeClass('dcg-mq-ghost'); + this.delimFrags[this.side === L ? R : L].removeClass("dcg-mq-ghost"); this.side = 0; }; }; Bracket.prototype.siblingCreated = function (_opts, dir) { // if something typed between ghost and far - if (dir === -this.side) - this.finalizeTree(); // end of its block, solidify + if (dir === -this.side) this.finalizeTree(); // end of its block, solidify }; return Bracket; - }(DelimsNode)); + })(DelimsNode); function getOppBracketSide(bracket) { var side = bracket.side; var data = bracket.sides[side]; @@ -8825,55 +8341,61 @@ export default function() { }; } var OPP_BRACKS = { - '(': ')', - ')': '(', - '[': ']', - ']': '[', - '{': '}', - '}': '{', - '\\{': '\\}', - '\\}': '\\{', - '⟨': '⟩', - '⟩': '⟨', - '\\langle ': '\\rangle ', - '\\rangle ': '\\langle ', - '|': '|', - '\\lVert ': '\\rVert ', - '\\rVert ': '\\lVert ', + "(": ")", + ")": "(", + "[": "]", + "]": "[", + "{": "}", + "}": "{", + "\\{": "\\}", + "\\}": "\\{", + "⟨": "⟩", + "⟩": "⟨", + "\\langle ": "\\rangle ", + "\\rangle ": "\\langle ", + "|": "|", + "\\lVert ": "\\rVert ", + "\\rVert ": "\\lVert ", }; var BRACKET_NAMES = { - '⟨': 'angle-bracket', - '⟩': 'angle-bracket', - '|': 'pipe', + "⟨": "angle-bracket", + "⟩": "angle-bracket", + "|": "pipe", }; function bindCharBracketPair(open, ctrlSeq, name) { var ctrlSeq = ctrlSeq || open; var close = OPP_BRACKS[open]; var end = OPP_BRACKS[ctrlSeq]; - CharCmds[open] = function () { return new Bracket(L, open, close, ctrlSeq, end); }; - CharCmds[close] = function () { return new Bracket(R, open, close, ctrlSeq, end); }; + CharCmds[open] = function () { + return new Bracket(L, open, close, ctrlSeq, end); + }; + CharCmds[close] = function () { + return new Bracket(R, open, close, ctrlSeq, end); + }; BRACKET_NAMES[open] = BRACKET_NAMES[close] = name; } - bindCharBracketPair('(', '', 'parenthesis'); - bindCharBracketPair('[', '', 'bracket'); - bindCharBracketPair('{', '\\{', 'brace'); + bindCharBracketPair("(", "", "parenthesis"); + bindCharBracketPair("[", "", "bracket"); + bindCharBracketPair("{", "\\{", "brace"); LatexCmds.langle = function () { - return new Bracket(L, '⟨', '⟩', '\\langle ', '\\rangle '); + return new Bracket(L, "⟨", "⟩", "\\langle ", "\\rangle "); }; LatexCmds.rangle = function () { - return new Bracket(R, '⟨', '⟩', '\\langle ', '\\rangle '); + return new Bracket(R, "⟨", "⟩", "\\langle ", "\\rangle "); + }; + CharCmds["|"] = function () { + return new Bracket(L, "|", "|", "|", "|"); }; - CharCmds['|'] = function () { return new Bracket(L, '|', '|', '|', '|'); }; LatexCmds.lVert = function () { - return new Bracket(L, '∥', '∥', '\\lVert ', '\\rVert '); + return new Bracket(L, "∥", "∥", "\\lVert ", "\\rVert "); }; LatexCmds.rVert = function () { - return new Bracket(R, '∥', '∥', '\\lVert ', '\\rVert '); + return new Bracket(R, "∥", "∥", "\\lVert ", "\\rVert "); }; LatexCmds.left = /** @class */ (function (_super) { __extends(left, _super); function left() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } left.prototype.parser = function () { var regex = Parser.regex; @@ -8882,124 +8404,140 @@ export default function() { return optWhitespace .then(regex(/^(?:[([|]|\\\{|\\langle(?![a-zA-Z])|\\lVert(?![a-zA-Z]))/)) .then(function (ctrlSeq) { - var open = ctrlSeq.replace(/^\\/, ''); - if (ctrlSeq == '\\langle') { - open = '⟨'; - ctrlSeq = ctrlSeq + ' '; - } - if (ctrlSeq == '\\lVert') { - open = '∥'; - ctrlSeq = ctrlSeq + ' '; - } - return latexMathParser.then(function (block) { - return string('\\right') - .skip(optWhitespace) - .then(regex(/^(?:[\])|]|\\\}|\\rangle(?![a-zA-Z])|\\rVert(?![a-zA-Z]))/)) - .map(function (end) { - var close = end.replace(/^\\/, ''); - if (end == '\\rangle') { - close = '⟩'; - end = end + ' '; - } - if (end == '\\rVert') { - close = '∥'; - end = end + ' '; - } - var cmd = new Bracket(0, open, close, ctrlSeq, end); - cmd.blocks = [block]; - block.adopt(cmd, 0, 0); - return cmd; + var open = ctrlSeq.replace(/^\\/, ""); + if (ctrlSeq == "\\langle") { + open = "⟨"; + ctrlSeq = ctrlSeq + " "; + } + if (ctrlSeq == "\\lVert") { + open = "∥"; + ctrlSeq = ctrlSeq + " "; + } + return latexMathParser.then(function (block) { + return string("\\right") + .skip(optWhitespace) + .then(regex(/^(?:[\])|]|\\\}|\\rangle(?![a-zA-Z])|\\rVert(?![a-zA-Z]))/)) + .map(function (end) { + var close = end.replace(/^\\/, ""); + if (end == "\\rangle") { + close = "⟩"; + end = end + " "; + } + if (end == "\\rVert") { + close = "∥"; + end = end + " "; + } + var cmd = new Bracket(0, open, close, ctrlSeq, end); + cmd.blocks = [block]; + block.adopt(cmd, 0, 0); + return cmd; + }); }); }); - }); }; return left; - }(MathCommand)); + })(MathCommand); LatexCmds.right = /** @class */ (function (_super) { __extends(right, _super); function right() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } right.prototype.parser = function () { - return Parser.fail('unmatched \\right'); + return Parser.fail("unmatched \\right"); }; return right; - }(MathCommand)); - var leftBinomialSymbol = SVG_SYMBOLS['(']; - var rightBinomialSymbol = SVG_SYMBOLS[')']; + })(MathCommand); + var leftBinomialSymbol = SVG_SYMBOLS["("]; + var rightBinomialSymbol = SVG_SYMBOLS[")"]; var Binomial = /** @class */ (function (_super) { __extends(Binomial, _super); function Binomial() { - var _this_1 = _super !== null && _super.apply(this, arguments) || this; - _this_1.ctrlSeq = '\\binom'; + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = "\\binom"; _this_1.domView = new DOMView(2, function (blocks) { - return h('span', { class: 'dcg-mq-non-leaf dcg-mq-bracket-container' }, [ - h('span', { - style: 'width:' + leftBinomialSymbol.width, - class: 'dcg-mq-paren dcg-mq-bracket-l dcg-mq-scaled', - }, [leftBinomialSymbol.html()]), - h('span', { - style: 'margin-left:' + - leftBinomialSymbol.width + - '; margin-right:' + - rightBinomialSymbol.width, - class: 'dcg-mq-non-leaf dcg-mq-bracket-middle', - }, [ - h('span', { class: 'dcg-mq-array dcg-mq-non-leaf' }, [ - h.block('span', {}, blocks[0]), - h.block('span', {}, blocks[1]), - ]), - ]), - h('span', { - style: 'width:' + rightBinomialSymbol.width, - class: 'dcg-mq-paren dcg-mq-bracket-r dcg-mq-scaled', - }, [rightBinomialSymbol.html()]), + return h("span", { class: "dcg-mq-non-leaf dcg-mq-bracket-container" }, [ + h( + "span", + { + style: "width:" + leftBinomialSymbol.width, + class: "dcg-mq-paren dcg-mq-bracket-l dcg-mq-scaled", + }, + [leftBinomialSymbol.html()] + ), + h( + "span", + { + style: + "margin-left:" + + leftBinomialSymbol.width + + "; margin-right:" + + rightBinomialSymbol.width, + class: "dcg-mq-non-leaf dcg-mq-bracket-middle", + }, + [ + h("span", { class: "dcg-mq-array dcg-mq-non-leaf" }, [ + h.block("span", {}, blocks[0]), + h.block("span", {}, blocks[1]), + ]), + ] + ), + h( + "span", + { + style: "width:" + rightBinomialSymbol.width, + class: "dcg-mq-paren dcg-mq-bracket-r dcg-mq-scaled", + }, + [rightBinomialSymbol.html()] + ), ]); }); - _this_1.textTemplate = ['choose(', ',', ')']; - _this_1.mathspeakTemplate = ['StartBinomial,', 'Choose', ', EndBinomial']; - _this_1.ariaLabel = 'binomial'; + _this_1.textTemplate = ["choose(", ",", ")"]; + _this_1.mathspeakTemplate = ["StartBinomial,", "Choose", ", EndBinomial"]; + _this_1.ariaLabel = "binomial"; return _this_1; } return Binomial; - }(DelimsNode)); + })(DelimsNode); LatexCmds.binom = LatexCmds.binomial = Binomial; LatexCmds.choose = /** @class */ (function (_super) { __extends(class_14, _super); function class_14() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } class_14.prototype.createLeftOf = function (cursor) { LiveFraction.prototype.createLeftOf(cursor); }; return class_14; - }(Binomial)); + })(Binomial); var MathFieldNode = /** @class */ (function (_super) { __extends(MathFieldNode, _super); function MathFieldNode() { - var _this_1 = _super !== null && _super.apply(this, arguments) || this; - _this_1.ctrlSeq = '\\MathQuillMathField'; + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = "\\MathQuillMathField"; _this_1.domView = new DOMView(1, function (blocks) { - return h('span', { class: 'dcg-mq-editable-field' }, [ - h.block('span', { class: 'dcg-mq-root-block', 'aria-hidden': 'true' }, blocks[0]), + return h("span", { class: "dcg-mq-editable-field" }, [ + h.block("span", { class: "dcg-mq-root-block", "aria-hidden": "true" }, blocks[0]), ]); }); return _this_1; } MathFieldNode.prototype.parser = function () { - var self = this, string = Parser.string, regex = Parser.regex, succeed = Parser.succeed; - return string('[') + var self = this, + string = Parser.string, + regex = Parser.regex, + succeed = Parser.succeed; + return string("[") .then(regex(/^[a-z][a-z0-9]*/i)) - .skip(string(']')) + .skip(string("]")) .map(function (name) { - self.name = name; - }) + self.name = name; + }) .or(succeed(undefined)) .then(_super.prototype.parser.call(this)); }; MathFieldNode.prototype.finalizeTree = function (options) { var ctrlr = new Controller(this.getEnd(L), this.domFrag().oneElement(), options); - ctrlr.KIND_OF_MQ = 'MathField'; + ctrlr.KIND_OF_MQ = "MathField"; ctrlr.editable = true; ctrlr.createTextarea(); ctrlr.editablesTextareaEvents(); @@ -9025,23 +8563,23 @@ export default function() { // should keep as much of what was previously hidden hidden as // possible while obeying this constraint function pushDownAriaHidden(node) { - if (node.parentNode && !domFrag(node).hasClass('dcg-mq-root-block')) { + if (node.parentNode && !domFrag(node).hasClass("dcg-mq-root-block")) { pushDownAriaHidden(node.parentNode); } if (node.nodeType === Node.ELEMENT_NODE) { var element = node; - if (element.getAttribute('aria-hidden') === 'true') { - element.removeAttribute('aria-hidden'); + if (element.getAttribute("aria-hidden") === "true") { + element.removeAttribute("aria-hidden"); domFrag(node) .children() .eachElement(function (child) { - child.setAttribute('aria-hidden', 'true'); - }); + child.setAttribute("aria-hidden", "true"); + }); } } } pushDownAriaHidden(this.domFrag().parent().oneElement()); - this.domFrag().oneElement().removeAttribute('aria-hidden'); + this.domFrag().oneElement().removeAttribute("aria-hidden"); }; MathFieldNode.prototype.registerInnerField = function (innerFields, MathField) { var controller = this.getEnd(L).controller; @@ -9058,7 +8596,7 @@ export default function() { return this.getEnd(L).text(); }; return MathFieldNode; - }(MathCommand)); + })(MathCommand); LatexCmds.editable = LatexCmds.MathQuillMathField = MathFieldNode; // backcompat with before cfd3620 on #233 // Embed arbitrary things // Probably the closest DOM analogue would be an iframe? @@ -9070,15 +8608,15 @@ export default function() { var EmbedNode = /** @class */ (function (_super) { __extends(EmbedNode, _super); function EmbedNode() { - return _super !== null && _super.apply(this, arguments) || this; + return (_super !== null && _super.apply(this, arguments)) || this; } EmbedNode.prototype.setOptions = function (options) { function noop() { - return ''; + return ""; } this.text = options.text || noop; this.domView = new DOMView(0, function () { - return h('span', {}, [parseHTML(options.htmlString || '')]); + return h("span", {}, [parseHTML(options.htmlString || "")]); }); this.latex = options.latex || noop; return this; @@ -9089,42 +8627,45 @@ export default function() { this.checkCursorContextClose(ctx); }; EmbedNode.prototype.parser = function () { - var self = this, string = Parser.string, regex = Parser.regex, succeed = Parser.succeed; - return string('{') + var self = this, + string = Parser.string, + regex = Parser.regex, + succeed = Parser.succeed; + return string("{") .then(regex(/^[a-z][a-z0-9]*/i)) - .skip(string('}')) + .skip(string("}")) .then(function (name) { - // the chars allowed in the optional data block are arbitrary other than - // excluding curly braces and square brackets (which'd be too confusing) - return string('[') - .then(regex(/^[-\w\s]*/)) - .skip(string(']')) - .or(succeed(undefined)) - .map(function (data) { - return self.setOptions(EMBEDS[name](data)); + // the chars allowed in the optional data block are arbitrary other than + // excluding curly braces and square brackets (which'd be too confusing) + return string("[") + .then(regex(/^[-\w\s]*/)) + .skip(string("]")) + .or(succeed(undefined)) + .map(function (data) { + return self.setOptions(EMBEDS[name](data)); + }); }); - }); }; return EmbedNode; - }(MQSymbol)); + })(MQSymbol); LatexCmds.embed = EmbedNode; /**************************************** * Input box to type backslash commands ***************************************/ - CharCmds['\\'] = /** @class */ (function (_super) { + CharCmds["\\"] = /** @class */ (function (_super) { __extends(LatexCommandInput, _super); function LatexCommandInput() { - var _this_1 = _super !== null && _super.apply(this, arguments) || this; - _this_1.ctrlSeq = '\\'; + var _this_1 = (_super !== null && _super.apply(this, arguments)) || this; + _this_1.ctrlSeq = "\\"; _this_1.domView = new DOMView(1, function (blocks) { - return h('span', { class: 'dcg-mq-latex-command-input-wrapper dcg-mq-non-leaf' }, [ - h('span', { class: 'dcg-mq-latex-command-input dcg-mq-non-leaf' }, [ - h.text('\\'), - h.block('span', {}, blocks[0]), + return h("span", { class: "dcg-mq-latex-command-input-wrapper dcg-mq-non-leaf" }, [ + h("span", { class: "dcg-mq-latex-command-input dcg-mq-non-leaf" }, [ + h.text("\\"), + h.block("span", {}, blocks[0]), ]), ]); }); - _this_1.textTemplate = ['\\']; + _this_1.textTemplate = ["\\"]; return _this_1; } LatexCommandInput.prototype.replaces = function (replacedFragment) { @@ -9137,15 +8678,13 @@ export default function() { _super.prototype.createBlocks.call(this); var endsL = this.getEnd(L); endsL.focus = function () { - this.parent.domFrag().addClass('dcg-mq-hasCursor'); - if (this.isEmpty()) - this.parent.domFrag().removeClass('dcg-mq-empty'); + this.parent.domFrag().addClass("dcg-mq-hasCursor"); + if (this.isEmpty()) this.parent.domFrag().removeClass("dcg-mq-empty"); return this; }; endsL.blur = function () { - this.parent.domFrag().removeClass('dcg-mq-hasCursor'); - if (this.isEmpty()) - this.parent.domFrag().addClass('dcg-mq-empty'); + this.parent.domFrag().removeClass("dcg-mq-hasCursor"); + if (this.isEmpty()) this.parent.domFrag().addClass("dcg-mq-empty"); return this; }; endsL.write = function (cursor, ch) { @@ -9154,20 +8693,17 @@ export default function() { new VanillaSymbol(ch).createLeftOf(cursor); // TODO needs tests cursor.controller.aria.alert(ch); - } - else { + } else { var cmd = this.parent.renderCommand(cursor); // TODO needs tests cursor.controller.aria.queue(cmd.mathspeak({ createdLeftOf: cursor })); - if (ch !== '\\' || !this.isEmpty()) - cursor.parent.write(cursor, ch); - else - cursor.controller.aria.alert(); + if (ch !== "\\" || !this.isEmpty()) cursor.parent.write(cursor, ch); + else cursor.controller.aria.alert(); } }; var originalKeystroke = endsL.keystroke; endsL.keystroke = function (key, e, ctrlr) { - if (key === 'Tab' || key === 'Enter' || key === 'Spacebar') { + if (key === "Tab" || key === "Enter" || key === "Spacebar") { var cmd = this.parent.renderCommand(ctrlr.cursor); // TODO needs tests ctrlr.aria.alert(cmd.mathspeak({ createdLeftOf: ctrlr.cursor })); @@ -9182,7 +8718,7 @@ export default function() { if (this._replacedFragment) { var frag = this.domFrag(); var el_1 = frag.oneElement(); - this._replacedFragment.domFrag().addClass('dcg-mq-blur'); + this._replacedFragment.domFrag().addClass("dcg-mq-blur"); //FIXME: is monkey-patching the mousedown and mousemove handlers the right way to do this? var rewriteMousedownEventTarget = function (e) { { @@ -9192,16 +8728,16 @@ export default function() { return false; } }; - el_1.addEventListener('mousedown', rewriteMousedownEventTarget); - el_1.addEventListener('mouseup', rewriteMousedownEventTarget); + el_1.addEventListener("mousedown", rewriteMousedownEventTarget); + el_1.addEventListener("mouseup", rewriteMousedownEventTarget); this._replacedFragment.domFrag().insertBefore(frag.children().first()); } }; LatexCommandInput.prototype.latexRecursive = function (ctx) { this.checkCursorContextOpen(ctx); - ctx.latex += '\\'; + ctx.latex += "\\"; this.getEnd(L).latexRecursive(ctx); - ctx.latex += ' '; + ctx.latex += " "; this.checkCursorContextClose(ctx); }; LatexCommandInput.prototype.renderCommand = function (cursor) { @@ -9209,29 +8745,24 @@ export default function() { this.remove(); if (this[R]) { cursor.insLeftOf(this[R]); - } - else { + } else { cursor.insAtRightEnd(this.parent); } var latex = this.getEnd(L).latex(); - if (!latex) - latex = ' '; + if (!latex) latex = " "; var cmd = LatexCmds[latex]; if (cmd) { //console.log(cmd); var node = void 0; if (isMQNodeClass(cmd)) { node = new cmd(latex); - } - else { + } else { node = cmd(latex); } - if (this._replacedFragment) - node.replaces(this._replacedFragment); + if (this._replacedFragment) node.replaces(this._replacedFragment); node.createLeftOf(cursor); return node; - } - else { + } else { var node = new TextBlock(); node.replaces(latex); node.createLeftOf(cursor); @@ -9243,21 +8774,19 @@ export default function() { } }; return LatexCommandInput; - }(MathCommand)); + })(MathCommand); // For backwards compatibility, set up the global MathQuill object as an instance of API interface v1 if (window.jQuery) { MQ1 = getInterface(1); for (var key in MQ1) (function (key, val) { - if (typeof val === 'function') { + if (typeof val === "function") { MathQuill[key] = function () { insistOnInterVer(); return val.apply(this, arguments); }; MathQuill[key].prototype = val.prototype; - } - else - MathQuill[key] = val; + } else MathQuill[key] = val; })(key, MQ1[key]); } //console.log(MathQuill); diff --git a/src/preload/script.ts b/src/preload/script.ts index 2156ea9..25c2100 100644 --- a/src/preload/script.ts +++ b/src/preload/script.ts @@ -1,12 +1,12 @@ -import window from '../globals/window'; -import extendMathQuill from './extend_mathquill'; -import { pollForValue } from '../utils/utils'; -import injectScript from '../utils/injectScript'; -import { postMessageUp, listenToMessageDown } from '../utils/messages'; +import window from "../globals/window"; +import extendMathQuill from "./extend_mathquill"; +import { pollForValue } from "../utils/utils"; +import injectScript from "../utils/injectScript"; +import { postMessageUp, listenToMessageDown } from "../utils/messages"; let oldDefine!: any; function newDefine(moduleName: string, dependencies: any, definition: any) { - if (moduleName === 'mathquill_src') { + if (moduleName === "mathquill_src") { // override should either be `{dependencies, definition}` or just `definition` dependencies = extendMathQuill; } @@ -21,12 +21,11 @@ newDefine.amd = { // If ALMOND_OVERRIDES is already defined, DesModder must be enabled. const isDesmodderActive: boolean = window.ALMOND_OVERRIDES; - // Layer a proxy over DesModder's ALMOND_OVERRIDES proxy, if it's enabled. window.ALMOND_OVERRIDES = new Proxy(isDesmodderActive ? window.ALMOND_OVERRIDES : {}, { get(target, prop, receiver) { - if (prop === 'define') { - console.log('ALMOND_OVERRIDES proxy success'); + if (prop === "define") { + console.log("ALMOND_OVERRIDES proxy success"); // If DesModder is enabled, we have to make sure to forward the operation // to DesModder's own ALMOND_OVERRIDES proxy. If we use ALMOND_OVERRIDES.define, @@ -42,42 +41,42 @@ window.ALMOND_OVERRIDES = new Proxy(isDesmodderActive ? window.ALMOND_OVERRIDES function runCalculator() { window.require( - ['toplevel/calculator_desktop', 'testbridge', 'jquery'], + ["toplevel/calculator_desktop", "testbridge", "jquery"], function (calcPromise: any, TestBridge: any, $: any) { - $('.dcg-loading-div-container').hide(); + $(".dcg-loading-div-container").hide(); if (calcPromise === undefined) { - console.error('No calc promise'); + console.error("No calc promise"); } calcPromise.then(function (calc: any) { if (calc === undefined) { - console.error('No calc'); + console.error("No calc"); } window.Calc = calc; TestBridge.ready(); // DesModder needs the following lines added listenToMessageDown((message) => { - if (message.type === 'set-script-url') { + if (message.type === "set-script-url") { injectScript(message.value); // cancel listener return true; } }); postMessageUp({ - type: 'get-script-url', + type: "get-script-url", }); }); } ); } -if (document.currentScript.getAttribute('run-calculator')) { +if (document.currentScript.getAttribute("run-calculator")) { pollForValue( - () => (document.querySelector('script[src^=\'/assets/build/calculator_desktop\']') as HTMLScriptElement)?.src + () => (document.querySelector("script[src^='/assets/build/calculator_desktop']") as HTMLScriptElement)?.src ).then((src) => { /* we blocked calculator_desktop.js earlier to ensure that the preload/override script runs first. Now we load it, but with '??' appended to prevent the web request rules from blocking it */ - const script = document.createElement('script'); - script.src = src + '??'; + const script = document.createElement("script"); + script.src = src + "??"; console.log(src); script.async = false; script.onload = () => { @@ -86,7 +85,7 @@ if (document.currentScript.getAttribute('run-calculator')) { runCalculator(); }; script.onerror = () => { - console.error('Injected script onerror'); + console.error("Injected script onerror"); }; document.body.appendChild(script); }); diff --git a/src/script.ts b/src/script.ts index 6702758..63ee4fc 100644 --- a/src/script.ts +++ b/src/script.ts @@ -1,6 +1,6 @@ /// -import { pollForValue } from './utils/utils'; -import window from './globals/window'; +import { pollForValue } from "./utils/utils"; +import window from "./globals/window"; const handler = (({ detail }: CustomEvent) => { // Have to wait for all the preload modifications to finish @@ -8,8 +8,8 @@ const handler = (({ detail }: CustomEvent) => { (window as any).Desmos.MathQuill.config({ autoCommands: detail, }); - document.removeEventListener('send-config', handler); + document.removeEventListener("send-config", handler); }); }) as EventListener; -document.addEventListener('send-config', handler); +document.addEventListener("send-config", handler); diff --git a/src/utils/autoCommands.ts b/src/utils/autoCommands.ts index 631338c..bda5687 100644 --- a/src/utils/autoCommands.ts +++ b/src/utils/autoCommands.ts @@ -3,95 +3,95 @@ export interface AutoCommandsToSymbols { } export const desmosDefualtAutoCommands: AutoCommandsToSymbols = { - sqrt: '√', - cbrt: '∛', - nthroot: '∜', - sum: 'Σ', - prod: '∏', - int: '∫', - percent: '%', - infinity: '∞', - infty: '∞', - alpha: 'α', - beta: 'β', - theta: 'θ', - pi: 'π', - tau: 'τ', - phi: 'ϕ', + sqrt: "√", + cbrt: "∛", + nthroot: "∜", + sum: "Σ", + prod: "∏", + int: "∫", + percent: "%", + infinity: "∞", + infty: "∞", + alpha: "α", + beta: "β", + theta: "θ", + pi: "π", + tau: "τ", + phi: "ϕ", }; export const basicAutoCommands: AutoCommandsToSymbols = { - gamma: 'γ', - digamma: 'ϝ', - Gamma: 'Γ', - delta: 'δ', - Delta: 'Δ', - epsilon: 'ϵ', + gamma: "γ", + digamma: "ϝ", + Gamma: "Γ", + delta: "δ", + Delta: "Δ", + epsilon: "ϵ", //varepsilon: 'ε', - zeta: 'ζ', - eta: 'η', - iota: 'ι', - kappa: 'κ', + zeta: "ζ", + eta: "η", + iota: "ι", + kappa: "κ", //varkappa: 'ϰ', - lambda: 'λ', - Lambda: 'Λ', - mu: 'μ', - nu: 'ν', - xi: 'ξ', + lambda: "λ", + Lambda: "Λ", + mu: "μ", + nu: "ν", + xi: "ξ", //varpi: 'ϖ', - Pi: 'Π', - rho: 'ρ', + Pi: "Π", + rho: "ρ", //varrho: 'ϱ', - sigma: 'σ', + sigma: "σ", //varsigma: 'ς', - Sigma: 'Σ', - upsilon: 'υ', - Upsilon: 'Υ', + Sigma: "Σ", + upsilon: "υ", + Upsilon: "Υ", //varphi: 'φ', - Phi: 'Φ', - chi: 'χ', - psi: 'ψ', - Psi: 'Ψ', - omega: 'ω', - Omega: 'Ω', - square: '□', - mid: '|', - parallel: '∥', - nparallel: '∦', - perp: '⊥', - pm: '±', - mp: '∓', - to: '→', - le: '≤', - ge: '≥', - ne: '≠', - times: '×', - div: '÷', - approx: '≈', + Phi: "Φ", + chi: "χ", + psi: "ψ", + Psi: "Ψ", + omega: "ω", + Omega: "Ω", + square: "□", + mid: "|", + parallel: "∥", + nparallel: "∦", + perp: "⊥", + pm: "±", + mp: "∓", + to: "→", + le: "≤", + ge: "≥", + ne: "≠", + times: "×", + div: "÷", + approx: "≈", }; export const advancedAutoCommands = { - dot: ' ̇', - hat: 'ˆ', - vec: ' ⃗', - bar: '¯', - tidle: ' ̃', - langle: '⟨', - rangle: '⟩', - lVert: '||', - rVert: '||', - binom: '( )', - coprod: '∐', - frac: '½', - underline: '⎯', - overline: '¯', - overarc: '⌒', - mathrm: 'rm', - mathit: '𝑖𝑡', - mathbf: '𝐛𝐟', - mathsf: 'sf', - overrightarrow: '→', - overleftarrow: '←', - overleftrightarrow: '⟷', - MathQuillMathField: '▭', + dot: " ̇", + hat: "ˆ", + vec: " ⃗", + bar: "¯", + tidle: " ̃", + langle: "⟨", + rangle: "⟩", + lVert: "||", + rVert: "||", + binom: "( )", + coprod: "∐", + frac: "½", + underline: "⎯", + overline: "¯", + overarc: "⌒", + mathrm: "rm", + mathit: "𝑖𝑡", + mathbf: "𝐛𝐟", + mathsf: "sf", + overrightarrow: "→", + overleftarrow: "←", + overleftrightarrow: "⟷", + MathQuillMathField: "▭", }; diff --git a/src/utils/injectScript.ts b/src/utils/injectScript.ts index 77cf525..4f51e76 100644 --- a/src/utils/injectScript.ts +++ b/src/utils/injectScript.ts @@ -1,5 +1,5 @@ export default function injectScript(url: string) { - const s = document.createElement('script'); + const s = document.createElement("script"); s.src = url; s.onload = function () { // remove the script so it doesn't appear in the DOM tree diff --git a/src/utils/messages.ts b/src/utils/messages.ts index a05a193..9bcb7b3 100644 --- a/src/utils/messages.ts +++ b/src/utils/messages.ts @@ -12,54 +12,54 @@ Post message conventions: type MessageWindowToContent = | { - type: 'enable-script'; + type: "enable-script"; scriptName: string; } | { - type: 'set-plugins-enabled'; + type: "set-plugins-enabled"; value: { [id: string]: boolean }; } | { - type: 'set-plugin-settings'; + type: "set-plugin-settings"; value: { [id: string]: any }; } | { - type: 'get-initial-data'; + type: "get-initial-data"; } | { - type: 'get-preload-enabled'; + type: "get-preload-enabled"; } | { - type: 'get-script-url'; + type: "get-script-url"; } | { - type: 'get-worker-append-url'; + type: "get-worker-append-url"; }; type MessageContentToWindow = | { - type: 'apply-preload-enabled'; + type: "apply-preload-enabled"; value: { [key: string]: boolean }; } | { - type: 'apply-plugins-enabled'; + type: "apply-plugins-enabled"; value: { [key: string]: boolean }; } | { - type: 'apply-plugin-settings'; + type: "apply-plugin-settings"; value: { [id: string]: { [key: string]: boolean } }; } | { - type: 'set-script-url'; + type: "set-script-url"; value: string; } | { - type: 'set-worker-append-url'; + type: "set-worker-append-url"; value: string; }; function postMessage(message: T) { - window.postMessage(message, '*'); + window.postMessage(message, "*"); } export function postMessageUp(message: MessageWindowToContent) { @@ -80,10 +80,10 @@ function listenToMessage(callback: (message: T) => ShouldCancel) { } const cancel = callback(event.data); if (cancel) { - window.removeEventListener('message', wrappedCallback, false); + window.removeEventListener("message", wrappedCallback, false); } }; - window.addEventListener('message', wrappedCallback, false); + window.addEventListener("message", wrappedCallback, false); return wrappedCallback; } diff --git a/src/utils/utils.ts b/src/utils/utils.ts index ee85b24..849b160 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -1,4 +1,4 @@ -import { AutoCommandsToSymbols } from './autoCommands'; +import { AutoCommandsToSymbols } from "./autoCommands"; interface FuncAny { (): any; @@ -23,15 +23,15 @@ function _pollForValue(func: () => T) { // Set many sliders at once. Used when the user presses a reset-to-default button. // toSet is an array of all the strings for the option 'opt' to be set. export function massSet(toSet: string[], opt: string) { - document.querySelectorAll('.grid .latex-item').forEach(function (item) { - item.querySelector('.onoffswitch-checkbox').checked = toSet.includes(item.id); + document.querySelectorAll(".grid .latex-item").forEach(function (item) { + item.querySelector(".onoffswitch-checkbox").checked = toSet.includes(item.id); }); // MathQuill requires autoCommands to be a non-empty space-delimited list of // commands. So keepmeKEEPME should always remain in storage for autoCommands // to avoid MathQuill throwing errors if the user disables all shortucts. // [opt] because otherwise it will assign the literal string 'opt' as the field name. - browser.storage.local.set({ [opt]: opt === 'autoCommands' ? 'keepmeKEEPME ' + toSet.join(' ') : toSet.join(' ') }); + browser.storage.local.set({ [opt]: opt === "autoCommands" ? "keepmeKEEPME " + toSet.join(" ") : toSet.join(" ") }); } // Create the DOM node for the items that will be placed in the grid. @@ -40,13 +40,13 @@ function createGridItem(templateID: string, symbol: string, shortcut: string, co let html = document.getElementById(templateID).innerHTML; html = html.replace(/#symbol#/g, symbol); html = html.replace(/#shortcut#/g, shortcut); - const node = new DOMParser().parseFromString(html, 'text/html').body.firstElementChild as HTMLElement; - node.querySelector('.onoffswitch-checkbox').checked = commands.includes(shortcut); + const node = new DOMParser().parseFromString(html, "text/html").body.firstElementChild as HTMLElement; + node.querySelector(".onoffswitch-checkbox").checked = commands.includes(shortcut); // Stop overflow of long shortcuts by letting them span both columns. // This feels like a bad way of styling this but oh well. if (shortcut.length > 9) { - node.style.gridColumn = '1 / span 2'; + node.style.gridColumn = "1 / span 2"; } return node; @@ -54,28 +54,28 @@ function createGridItem(templateID: string, symbol: string, shortcut: string, co // Populate the grid with fancy sliders for all the symbols -> shortcuts in dict. export async function populateGrid(templateID: string, gridID: string, dict: AutoCommandsToSymbols) { - const { autoCommands } = await browser.storage.local.get('autoCommands'); + const { autoCommands } = await browser.storage.local.get("autoCommands"); const grid = document.getElementById(gridID); for (const shortcut in dict) { - grid.append(createGridItem(templateID, dict[shortcut], shortcut, (autoCommands as string).split(' '))); + grid.append(createGridItem(templateID, dict[shortcut], shortcut, (autoCommands as string).split(" "))); } } export async function storeConfig(this: HTMLInputElement) { let wordToStore = this.parentElement.parentElement.id; - const opt = this.parentElement.parentElement.getAttribute('opt'); + const opt = this.parentElement.parentElement.getAttribute("opt"); const storageObj = await browser.storage.local.get(opt); const currentlyStored = storageObj[opt].toString(); if (this.checked) { - if (currentlyStored !== '') { - wordToStore = ' ' + wordToStore; + if (currentlyStored !== "") { + wordToStore = " " + wordToStore; } browser.storage.local.set({ [opt]: currentlyStored + wordToStore }); } else { const newStorage = currentlyStored - .split(' ') + .split(" ") .filter((word) => word != wordToStore) - .join(' '); + .join(" "); browser.storage.local.set({ [opt]: newStorage }); } } diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index 81c24c5..14d1762 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -1,10 +1,10 @@ -const path = require('path'); -const CopyPlugin = require('copy-webpack-plugin'); -const { merge } = require('webpack-merge'); +const path = require("path"); +const CopyPlugin = require("copy-webpack-plugin"); +const { merge } = require("webpack-merge"); const browser = process.env.BROWSER; -const BUILD_DIR_NAME = 'dist'; -const SRC_DIR_NAME = 'src'; +const BUILD_DIR_NAME = "dist"; +const SRC_DIR_NAME = "src"; baseConfig = { entry: { @@ -17,33 +17,33 @@ baseConfig = { }, output: { path: path.join(__dirname, `../${BUILD_DIR_NAME}`), - filename: '[name].js', + filename: "[name].js", }, module: { rules: [ { test: /\.tsx?$/, - use: 'ts-loader', + use: "ts-loader", exclude: /node_modules/, }, ], }, resolve: { - extensions: ['.ts', '.tsx', '.js'], + extensions: [".ts", ".tsx", ".js"], }, plugins: [ new CopyPlugin({ patterns: [ - { from: './images', to: `../${BUILD_DIR_NAME}/images`, context: 'public' }, - { from: './popup.html', to: `../${BUILD_DIR_NAME}/popup.html`, context: 'public' }, - { from: './popup.css', to: `../${BUILD_DIR_NAME}/popup.css`, context: 'public' }, - { from: `${browser}_manifest.json`, to: `../${BUILD_DIR_NAME}/manifest.json`, context: 'public' }, + { from: "./images", to: `../${BUILD_DIR_NAME}/images`, context: "public" }, + { from: "./popup.html", to: `../${BUILD_DIR_NAME}/popup.html`, context: "public" }, + { from: "./popup.css", to: `../${BUILD_DIR_NAME}/popup.css`, context: "public" }, + { from: `${browser}_manifest.json`, to: `../${BUILD_DIR_NAME}/manifest.json`, context: "public" }, ], }), ], }; -if (browser === 'firefox') { +if (browser === "firefox") { module.exports = baseConfig; } else { module.exports = merge(baseConfig, { @@ -54,14 +54,14 @@ if (browser === 'firefox') { new CopyPlugin({ patterns: [ { - from: 'net_request_rules.json', + from: "net_request_rules.json", to: `../${BUILD_DIR_NAME}/net_request_rules.json`, - context: 'public', + context: "public", }, { - from: '../node_modules/webextension-polyfill/dist/browser-polyfill.js', + from: "../node_modules/webextension-polyfill/dist/browser-polyfill.js", to: `../${BUILD_DIR_NAME}/browser-polyfill.js`, - context: 'public', + context: "public", }, ], }), diff --git a/webpack/webpack.dev.js b/webpack/webpack.dev.js index 9a2981b..25943ea 100644 --- a/webpack/webpack.dev.js +++ b/webpack/webpack.dev.js @@ -1,7 +1,7 @@ -const { merge } = require('webpack-merge'); -const common = require('./webpack.common.js'); +const { merge } = require("webpack-merge"); +const common = require("./webpack.common.js"); module.exports = merge(common, { - devtool: 'inline-source-map', - mode: 'development', + devtool: "inline-source-map", + mode: "development", }); diff --git a/webpack/webpack.prod.js b/webpack/webpack.prod.js index 99d888e..18feb6f 100644 --- a/webpack/webpack.prod.js +++ b/webpack/webpack.prod.js @@ -1,9 +1,9 @@ -const { merge } = require('webpack-merge'); -const TerserPlugin = require('terser-webpack-plugin'); -const common = require('./webpack.common.js'); +const { merge } = require("webpack-merge"); +const TerserPlugin = require("terser-webpack-plugin"); +const common = require("./webpack.common.js"); module.exports = merge(common, { - mode: 'production', + mode: "production", optimization: { minimize: true, minimizer: [ From e8e8baa10f9da96218f2b4dfab7594be903bb7c1 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Sun, 17 Jul 2022 21:10:24 -0500 Subject: [PATCH 26/32] Use config object for communication between content and page scripts --- src/content.ts | 17 +++++++++++++++-- src/globals/config.ts | 3 +++ src/script.ts | 9 ++++++--- 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 src/globals/config.ts diff --git a/src/content.ts b/src/content.ts index f9126f3..ab4ec0f 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1,3 +1,11 @@ +import { MathQuillConfig } from "./globals/config"; + +// Firefox only allows primitive types to be sent from the content script to the page context. +// Firefox provides the builtin cloneInto function to allow sending objects between these +// contexts. +// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Sharing_objects_with_page_scripts#cloneinto +declare const cloneInto: ((toClone: MathQuillConfig, context: any) => MathQuillConfig) | undefined; + async function updateAutoCommands() { const commands = await browser.storage.local.get("autoCommands"); const script = document.createElement("script"); @@ -5,8 +13,13 @@ async function updateAutoCommands() { const cmdString = commands.autoCommands.toString(); script.onload = function () { const data = cmdString; - document.dispatchEvent(new CustomEvent("send-config", { detail: data })); - + let config: MathQuillConfig; + try { + config = cloneInto!({ autoCommands: data }, window); + } catch { + config = { autoCommands: data }; + } + document.dispatchEvent(new CustomEvent("send-config", { detail: config })); script.remove(); }; (document.head || document.documentElement).appendChild(script); diff --git a/src/globals/config.ts b/src/globals/config.ts new file mode 100644 index 0000000..84630d6 --- /dev/null +++ b/src/globals/config.ts @@ -0,0 +1,3 @@ +export interface MathQuillConfig { + autoCommands: string; +} diff --git a/src/script.ts b/src/script.ts index 63ee4fc..e0cfa5b 100644 --- a/src/script.ts +++ b/src/script.ts @@ -1,12 +1,15 @@ /// import { pollForValue } from "./utils/utils"; import window from "./globals/window"; +import { MathQuillConfig } from "./globals/config"; -const handler = (({ detail }: CustomEvent) => { + +const handler = (({ detail }: CustomEvent) => { // Have to wait for all the preload modifications to finish pollForValue(() => window.Desmos?.MathQuill?.config).then(() => { - (window as any).Desmos.MathQuill.config({ - autoCommands: detail, + console.log(detail); + window.Desmos.MathQuill.config({ + autoCommands: detail.autoCommands, }); document.removeEventListener("send-config", handler); }); From cd49f5108739637172767515b7ea3d7046b01d8f Mon Sep 17 00:00:00 2001 From: SinclaM Date: Mon, 18 Jul 2022 00:05:53 -0500 Subject: [PATCH 27/32] Refactor src/content.ts --- src/content.ts | 28 ++++++++++++++++------------ src/globals/config.ts | 2 +- src/script.ts | 1 - 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/content.ts b/src/content.ts index ab4ec0f..3c9f4f1 100644 --- a/src/content.ts +++ b/src/content.ts @@ -6,24 +6,28 @@ import { MathQuillConfig } from "./globals/config"; // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Sharing_objects_with_page_scripts#cloneinto declare const cloneInto: ((toClone: MathQuillConfig, context: any) => MathQuillConfig) | undefined; -async function updateAutoCommands() { - const commands = await browser.storage.local.get("autoCommands"); +async function updateConfig(changes?: browser.storage.ChangeDict) { + let config: MathQuillConfig; + if (typeof changes === "undefined") { + config = await browser.storage.local.get(["autoCommands"]); + } else { + config = {}; + Object.keys(changes).forEach((configOption) => (config[configOption] = changes[configOption].newValue)); + } + const script = document.createElement("script"); script.src = browser.runtime.getURL("script.js"); - const cmdString = commands.autoCommands.toString(); script.onload = function () { - const data = cmdString; - let config: MathQuillConfig; + // TODO: This syntax is a bit rough. Clean up. try { - config = cloneInto!({ autoCommands: data }, window); - } catch { - config = { autoCommands: data }; + config = cloneInto!(config, window); + } finally { + document.dispatchEvent(new CustomEvent("send-config", { detail: config })); + script.remove(); } - document.dispatchEvent(new CustomEvent("send-config", { detail: config })); - script.remove(); }; (document.head || document.documentElement).appendChild(script); } -updateAutoCommands(); -browser.storage.onChanged.addListener(updateAutoCommands); +updateConfig(); +browser.storage.onChanged.addListener(updateConfig); diff --git a/src/globals/config.ts b/src/globals/config.ts index 84630d6..2dc5a7c 100644 --- a/src/globals/config.ts +++ b/src/globals/config.ts @@ -1,3 +1,3 @@ export interface MathQuillConfig { - autoCommands: string; + autoCommands?: string; } diff --git a/src/script.ts b/src/script.ts index e0cfa5b..a0b9b1f 100644 --- a/src/script.ts +++ b/src/script.ts @@ -7,7 +7,6 @@ import { MathQuillConfig } from "./globals/config"; const handler = (({ detail }: CustomEvent) => { // Have to wait for all the preload modifications to finish pollForValue(() => window.Desmos?.MathQuill?.config).then(() => { - console.log(detail); window.Desmos.MathQuill.config({ autoCommands: detail.autoCommands, }); From b23ffa1a6ca59b95cb9cd46b9d9dfcf21f2c2b9e Mon Sep 17 00:00:00 2001 From: SinclaM Date: Mon, 18 Jul 2022 11:02:53 -0500 Subject: [PATCH 28/32] Reduce repeated storage accesses in src/popup.ts --- src/popup.ts | 17 ++++------------- src/utils/utils.ts | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/popup.ts b/src/popup.ts index c9ae209..b1c68f6 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -22,22 +22,13 @@ setToDesmosDefault.onclick = function () { ); }; -// Log changes to storage for testing -// browser.storage.onChanged.addListener(function (changes, namespace) { -// for (const [key, { oldValue, newValue }] of Object.entries(changes)) { -// console.log( -// `Storage key '${key}' in namespace '${namespace}' changed.`, -// `Old value was '${oldValue}', new value is '${newValue}'.` -// ); -// } -// }); - // Add all the dynamically loaded nodes to the DOM using templates and give // sliders their funcionality async function initialize() { - await populateGrid("grid-item-template", "desmos-default", desmosDefualtAutoCommands); - await populateGrid("grid-item-template", "basic", basicAutoCommands); - await populateGrid("grid-item-template", "advanced", advancedAutoCommands); + const { autoCommands }: { autoCommands: string } = await browser.storage.local.get("autoCommands"); + populateGrid("grid-item-template", "desmos-default", desmosDefualtAutoCommands, autoCommands); + populateGrid("grid-item-template", "basic", basicAutoCommands, autoCommands); + populateGrid("grid-item-template", "advanced", advancedAutoCommands, autoCommands); // Make the sliders actually update user configs when clicked document.querySelectorAll(".latex-item").forEach(function (item) { diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 849b160..95ea6bf 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -20,6 +20,18 @@ function _pollForValue(func: () => T) { }); } +// Log changes to storage for testing +export function monitorStorage() { + browser.storage.onChanged.addListener(function (changes, namespace) { + for (const [key, { oldValue, newValue }] of Object.entries(changes)) { + console.log( + `Storage key '${key}' in namespace '${namespace}' changed.`, + `Old value was '${oldValue}', new value is '${newValue}'.` + ); + } + }); +} + // Set many sliders at once. Used when the user presses a reset-to-default button. // toSet is an array of all the strings for the option 'opt' to be set. export function massSet(toSet: string[], opt: string) { @@ -53,8 +65,7 @@ function createGridItem(templateID: string, symbol: string, shortcut: string, co } // Populate the grid with fancy sliders for all the symbols -> shortcuts in dict. -export async function populateGrid(templateID: string, gridID: string, dict: AutoCommandsToSymbols) { - const { autoCommands } = await browser.storage.local.get("autoCommands"); +export function populateGrid(templateID: string, gridID: string, dict: AutoCommandsToSymbols, autoCommands: string) { const grid = document.getElementById(gridID); for (const shortcut in dict) { grid.append(createGridItem(templateID, dict[shortcut], shortcut, (autoCommands as string).split(" "))); From ec293f82ce369f70182d2e4b3ba2da80ff52b6e4 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Mon, 18 Jul 2022 11:04:45 -0500 Subject: [PATCH 29/32] Remove unnecessary babel.config.js --- babel.config.js | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 babel.config.js diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index cd57e3d..0000000 --- a/babel.config.js +++ /dev/null @@ -1,4 +0,0 @@ -// babel.config.js -module.exports = { - presets: [["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-typescript"], -}; From 14f6fce6f7951c344dc36d26fdb911b87fa4006e Mon Sep 17 00:00:00 2001 From: SinclaM Date: Mon, 18 Jul 2022 11:26:25 -0500 Subject: [PATCH 30/32] Add production check npm script, use .eslintrc.js instead of .eslintrc.json --- .eslintrc.json => .eslintrc.js | 62 +- package-lock.json | 28080 +++++++++++++++---------------- package.json | 126 +- public/net_request_rules.json | 41 +- src/script.ts | 1 - tsconfig.json | 33 +- 6 files changed, 14170 insertions(+), 14173 deletions(-) rename .eslintrc.json => .eslintrc.js (50%) diff --git a/.eslintrc.json b/.eslintrc.js similarity index 50% rename from .eslintrc.json rename to .eslintrc.js index 6b1967e..09b9435 100644 --- a/.eslintrc.json +++ b/.eslintrc.js @@ -1,36 +1,36 @@ -{ - "env": { - "browser": true, - "es2021": true +module.exports = { + env: { + browser: true, + es2021: true, }, - "extends": [ + extends: [ "eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:import/errors", - "plugin:import/warnings" + "plugin:import/warnings", ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 12, - "sourceType": "module" + parser: "@typescript-eslint/parser", + parserOptions: { + ecmaVersion: 12, + sourceType: "module", }, - "plugins": ["@typescript-eslint", "import"], - "ignorePatterns": ["dist/*", "webpack/*"], - "rules": { + plugins: ["@typescript-eslint", "import"], + ignorePatterns: ["dist/*", "webpack/*", ".eslintrc.js"], + rules: { "linebreak-style": ["error", "unix"], - "quotes": ["error", "double"], - "semi": ["error", "always"], + quotes: ["error", "double"], + semi: ["error", "always"], "eol-last": ["error", "always"], "import/newline-after-import": [ "error", { - "count": 1 - } + count: 1, + }, ], "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/explicit-module-boundary-types": "off", - "no-console": 1, - "no-constant-condition": 1, + "no-console": process.env.NODE_ENV === "prod" ? "error" : "warn", + "no-constant-condition": "off", "@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/no-inferrable-types": "off", "@typescript-eslint/no-unused-vars": "error", @@ -39,17 +39,17 @@ "@typescript-eslint/ban-types": [ "off", { - "types": { - "Function": "" - } - } - ] + types: { + Function: "", + }, + }, + ], }, - "settings": { + settings: { "import/resolver": { - "node": { - "extensions": [".js", ".jsx", ".ts", ".tsx"] - } - } - } -} + node: { + extensions: [".js", ".jsx", ".ts", ".tsx"], + }, + }, + }, +}; diff --git a/package-lock.json b/package-lock.json index 1208d69..2b1d556 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14276 +1,14276 @@ { - "name": "desmos-unlocked", - "version": "1.0.3", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "desmos-unlocked", - "version": "1.0.3", - "license": "MIT", - "devDependencies": { - "@babel/preset-env": "7.12.11", - "@babel/preset-typescript": "7.12.7", - "@types/chrome": "0.0.135", - "@types/sinon": "^10.0.0", - "@typescript-eslint/eslint-plugin": "4.17.0", - "@typescript-eslint/parser": "4.17.0", - "copy-webpack-plugin": "^8.1.1", - "cross-env": "7.0.3", - "eslint": "7.21.0", - "eslint-plugin-import": "2.22.1", - "git-hooks-plus": "1.0.1", - "prettier": "2.2.1", - "rimraf": "^3.0.2", - "sinon": "^10.0.0", - "terser-webpack-plugin": "5.1.1", - "ts-loader": "^9.1.1", - "typescript": "^4.2.4", - "web-ext-types": "3.2.1", - "webextension-polyfill": "^0.9.0", - "webpack": "5.18.0", - "webpack-cli": "4.4.0", - "webpack-merge": "5.7.3", - "whatwg-fetch": "3.0.0" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.10.4" - } - }, - "node_modules/@babel/compat-data": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.0.tgz", - "integrity": "sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q==", - "dev": true - }, - "node_modules/@babel/core": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.10.tgz", - "integrity": "sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.10", - "@babel/helper-module-transforms": "^7.12.1", - "@babel/helpers": "^7.12.5", - "@babel/parser": "^7.12.10", - "@babel/template": "^7.12.7", - "@babel/traverse": "^7.12.10", - "@babel/types": "^7.12.10", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", - "json5": "^2.1.2", - "lodash": "^4.17.19", - "semver": "^5.4.1", - "source-map": "^0.5.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/generator": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.11.tgz", - "integrity": "sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.11", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } - }, - "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz", - "integrity": "sha512-7YXfX5wQ5aYM/BOlbSccHDbuXXFPxeoUmfWtz8le2yTkTZc+BxsiEnENFoi2SlmA8ewDkG2LgIMIVzzn2h8kfw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/helper-annotate-as-pure/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/helper-annotate-as-pure/node_modules/@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.12.13.tgz", - "integrity": "sha512-CZOv9tGphhDRlVjVkAgm8Nhklm9RzSmWpX2my+t7Ua/KT616pEzXsQCjinzvkRvHWJ9itO4f296efroX23XCMA==", - "dev": true, - "dependencies": { - "@babel/helper-explode-assignable-expression": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/helper-builder-binary-assignment-operator-visitor/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/helper-builder-binary-assignment-operator-visitor/node_modules/@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz", - "integrity": "sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.13.15", - "@babel/helper-validator-option": "^7.12.17", - "browserslist": "^4.14.5", - "semver": "^6.3.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-compilation-targets/node_modules/@babel/helper-validator-option": { - "version": "7.12.17", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz", - "integrity": "sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw==", - "dev": true - }, - "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz", - "integrity": "sha512-hkL++rWeta/OVOBTRJc9a5Azh5mt5WgZUGAKMD8JM141YsE08K//bp1unBBieO6rUKkIPyUE0USQ30jAy3Sk1w==", - "dev": true, - "dependencies": { - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-member-expression-to-functions": "^7.12.1", - "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/helper-replace-supers": "^7.12.1", - "@babel/helper-split-export-declaration": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.12.17", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.17.tgz", - "integrity": "sha512-p2VGmBu9oefLZ2nQpgnEnG0ZlRPvL8gAGvPUMQwUdaE8k49rOMuZpOwdQoy5qJf6K8jL3bcAMhVUlHAjIgJHUg==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.12.13", - "regexpu-core": "^4.7.1" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-explode-assignable-expression": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.13.0.tgz", - "integrity": "sha512-qS0peLTDP8kOisG1blKbaoBg/o9OSa1qoumMjTK5pM+KDTtpxpsiubnCGP34vK8BXGcb2M9eigwgvoJryrzwWA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.0" - } - }, - "node_modules/@babel/helper-explode-assignable-expression/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/helper-explode-assignable-expression/node_modules/@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/helper-function-name": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz", - "integrity": "sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.12.10", - "@babel/template": "^7.12.7", - "@babel/types": "^7.12.11" - } - }, - "node_modules/@babel/helper-get-function-arity": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz", - "integrity": "sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.10" - } - }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.13.16.tgz", - "integrity": "sha512-1eMtTrXtrwscjcAeO4BVK+vvkxaLJSPFz1w1KLawz6HLNi9bPFGBNwwDyVfiu1Tv/vRRFYfoGaKhmAQPGPn5Wg==", - "dev": true, - "dependencies": { - "@babel/traverse": "^7.13.15", - "@babel/types": "^7.13.16" - } - }, - "node_modules/@babel/helper-hoist-variables/node_modules/@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.12.13" - } - }, - "node_modules/@babel/helper-hoist-variables/node_modules/@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } - }, - "node_modules/@babel/helper-hoist-variables/node_modules/@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/helper-hoist-variables/node_modules/@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/helper-hoist-variables/node_modules/@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/helper-hoist-variables/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/helper-hoist-variables/node_modules/@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@babel/helper-hoist-variables/node_modules/@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/helper-hoist-variables/node_modules/@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/helper-hoist-variables/node_modules/@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } - }, - "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.12.7", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz", - "integrity": "sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.7" - } - }, - "node_modules/@babel/helper-module-imports": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", - "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.5" - } - }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz", - "integrity": "sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/helper-module-imports": "^7.12.1", - "@babel/helper-replace-supers": "^7.12.1", - "@babel/helper-simple-access": "^7.12.1", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/helper-validator-identifier": "^7.10.4", - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.1", - "@babel/types": "^7.12.1", - "lodash": "^4.17.19" - } - }, - "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.10.tgz", - "integrity": "sha512-4tpbU0SrSTjjt65UMWSrUOPZTsgvPgGG4S8QSTNHacKzpS51IVWGDj0yCwyeZND/i+LSN2g/O63jEXEWm49sYQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.10" - } - }, - "node_modules/@babel/helper-plugin-utils": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", - "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", - "dev": true - }, - "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.13.0.tgz", - "integrity": "sha512-pUQpFBE9JvC9lrQbpX0TmeNIy5s7GnZjna2lhhcHC7DzgBs6fWn722Y5cfwgrtrqc7NAJwMvOa0mKhq6XaE4jg==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.12.13", - "@babel/helper-wrap-function": "^7.13.0", - "@babel/types": "^7.13.0" - } - }, - "node_modules/@babel/helper-remap-async-to-generator/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/helper-remap-async-to-generator/node_modules/@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/helper-replace-supers": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.11.tgz", - "integrity": "sha512-q+w1cqmhL7R0FNzth/PLLp2N+scXEK/L2AHbXUyydxp828F4FEa5WcVoqui9vFRiHDQErj9Zof8azP32uGVTRA==", - "dev": true, - "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.12.7", - "@babel/helper-optimise-call-expression": "^7.12.10", - "@babel/traverse": "^7.12.10", - "@babel/types": "^7.12.11" - } - }, - "node_modules/@babel/helper-simple-access": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz", - "integrity": "sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/types": "^7.12.1" - } - }, - "node_modules/@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.12.1.tgz", - "integrity": "sha512-Mf5AUuhG1/OCChOJ/HcADmvcHM42WJockombn8ATJG3OnyiSxBK/Mm5x78BQWvmtXZKHgbjdGL2kin/HOLlZGA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.1" - } - }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz", - "integrity": "sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.11" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "dev": true - }, - "node_modules/@babel/helper-validator-option": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.11.tgz", - "integrity": "sha512-TBFCyj939mFSdeX7U7DDj32WtzYY7fDcalgq8v3fBZMNOJQNn7nOYzMaUCiPxPYfCup69mtIpqlKgMZLvQ8Xhw==", - "dev": true - }, - "node_modules/@babel/helper-wrap-function": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.13.0.tgz", - "integrity": "sha512-1UX9F7K3BS42fI6qd2A4BjKzgGjToscyZTdp1DjknHLCIvpgne6918io+aL5LXFcER/8QWiwpoY902pVEqgTXA==", - "dev": true, - "dependencies": { - "@babel/helper-function-name": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.0" - } - }, - "node_modules/@babel/helper-wrap-function/node_modules/@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.12.13" - } - }, - "node_modules/@babel/helper-wrap-function/node_modules/@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } - }, - "node_modules/@babel/helper-wrap-function/node_modules/@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/helper-wrap-function/node_modules/@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/helper-wrap-function/node_modules/@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/helper-wrap-function/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/helper-wrap-function/node_modules/@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@babel/helper-wrap-function/node_modules/@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/helper-wrap-function/node_modules/@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/helper-wrap-function/node_modules/@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } - }, - "node_modules/@babel/helper-wrap-function/node_modules/@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/helpers": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", - "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.5", - "@babel/types": "^7.12.5" - } - }, - "node_modules/@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@babel/parser": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.11.tgz", - "integrity": "sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-proposal-async-generator-functions": { - "version": "7.13.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.15.tgz", - "integrity": "sha512-VapibkWzFeoa6ubXy/NgV5U2U4MVnUlvnx6wo1XhlsaTrLYWE0UFpDQsVrmn22q5CzeloqJ8gEMHSKxuee6ZdA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-remap-async-to-generator": "^7.13.0", - "@babel/plugin-syntax-async-generators": "^7.8.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-async-generator-functions/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-proposal-class-properties": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.13.0.tgz", - "integrity": "sha512-KnTDjFNC1g+45ka0myZNvSBFLhNCLN+GeGYLDEA8Oq7MZ6yMgfLoIRh86GRT0FjtJhZw8JyUskP9uvj5pHM9Zg==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.13.0", - "@babel/helper-plugin-utils": "^7.13.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.12.13" - } - }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } - }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.1.tgz", - "integrity": "sha512-r8rsUahG4ywm0QpGcCrLaUSOuNAISR3IZCg4Fx05Ozq31aCUrQsTLH6KPxy0N5ULoQ4Sn9qjNdGNtbPWAC6hYg==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.12.13", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/helper-replace-supers": "^7.13.12", - "@babel/helper-split-export-declaration": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", - "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-replace-supers": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", - "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", - "dev": true, - "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } - }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/plugin-proposal-dynamic-import": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.13.8.tgz", - "integrity": "sha512-ONWKj0H6+wIRCkZi9zSbZtE/r73uOhMVHh256ys0UzfM7I3d4n+spZNWjOnJv2gzopumP2Wxi186vI8N0Y2JyQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/plugin-syntax-dynamic-import": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-dynamic-import/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-proposal-export-namespace-from": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.13.tgz", - "integrity": "sha512-INAgtFo4OnLN3Y/j0VwAgw3HDXcDtX+C/erMvWzuV9v71r7urb6iyMXu7eM9IgLr1ElLlOkaHjJ0SbCmdOQ3Iw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-export-namespace-from/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-proposal-json-strings": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.13.8.tgz", - "integrity": "sha512-w4zOPKUFPX1mgvTmL/fcEqy34hrQ1CRcGxdphBc6snDnnqJ47EZDIyop6IwXzAC8G916hsIuXB2ZMBCExC5k7Q==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/plugin-syntax-json-strings": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-json-strings/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.13.8.tgz", - "integrity": "sha512-aul6znYB4N4HGweImqKn59Su9RS8lbUIqxtXTOcAGtNIDczoEFv+l1EhmX8rUBp3G1jMjKJm8m0jXVp63ZpS4A==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-logical-assignment-operators/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.13.8.tgz", - "integrity": "sha512-iePlDPBn//UhxExyS9KyeYU7RM9WScAG+D3Hhno0PLJebAEpDZMocbDe64eqynhNAnwz/vZoL/q/QB2T1OH39A==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-nullish-coalescing-operator/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-proposal-numeric-separator": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.13.tgz", - "integrity": "sha512-O1jFia9R8BUCl3ZGB7eitaAPu62TXJRHn7rh+ojNERCFyqRwJMTmhz+tJ+k0CwI6CLjX/ee4qW74FSqlq9I35w==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13", - "@babel/plugin-syntax-numeric-separator": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-numeric-separator/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-proposal-object-rest-spread": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.13.8.tgz", - "integrity": "sha512-DhB2EuB1Ih7S3/IRX5AFVgZ16k3EzfRbq97CxAVI1KSYcW+lexV8VZb7G7L8zuPVSdQMRn0kiBpf/Yzu9ZKH0g==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.13.8", - "@babel/helper-compilation-targets": "^7.13.8", - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.13.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-object-rest-spread/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-proposal-optional-catch-binding": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.13.8.tgz", - "integrity": "sha512-0wS/4DUF1CuTmGo+NiaHfHcVSeSLj5S3e6RivPTg/2k3wOv3jO35tZ6/ZWsQhQMvdgI7CwphjQa/ccarLymHVA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-optional-catch-binding/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-proposal-optional-chaining": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz", - "integrity": "sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-optional-chaining/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-proposal-private-methods": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.13.0.tgz", - "integrity": "sha512-MXyyKQd9inhx1kDYPkFRVOBXQ20ES8Pto3T7UZ92xj2mY0EVD8oAVzeyYuVfy/mxAdTSIayOvg+aVzcHV2bn6Q==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.13.0", - "@babel/helper-plugin-utils": "^7.13.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.12.13" - } - }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } - }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.1.tgz", - "integrity": "sha512-r8rsUahG4ywm0QpGcCrLaUSOuNAISR3IZCg4Fx05Ozq31aCUrQsTLH6KPxy0N5ULoQ4Sn9qjNdGNtbPWAC6hYg==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.12.13", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/helper-replace-supers": "^7.13.12", - "@babel/helper-split-export-declaration": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", - "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-replace-supers": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", - "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", - "dev": true, - "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } - }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/plugin-proposal-unicode-property-regex": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.13.tgz", - "integrity": "sha512-XyJmZidNfofEkqFV5VC/bLabGmO5QzenPO/YOfGuEbgU+2sSwMmio3YLb4WtBgcmmdwZHyVyv8on77IUjQ5Gvg==", - "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-unicode-property-regex/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-class-properties": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.1.tgz", - "integrity": "sha512-U40A76x5gTwmESz+qiqssqmeEsKvcSyvtgktrm0uzcARAmM9I1jR221f6Oq+GmHrcD+LvZDag1UTOTe2fL3TeA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", - "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-export-namespace-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", - "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-top-level-await": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.1.tgz", - "integrity": "sha512-i7ooMZFS+a/Om0crxZodrTzNEPJHZrlMVGMTEpFAj6rYY/bKCddB0Dk/YxfPuYXOopuhKk/e1jV6h+WUU9XN3A==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.12.1.tgz", - "integrity": "sha512-UZNEcCY+4Dp9yYRCAHrHDU+9ZXLYaY9MgBXSRLkB9WjYFRR6quJBumfVrEkUxrePPBwFcpWfNKXqVRQQtm7mMA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.13.0.tgz", - "integrity": "sha512-96lgJagobeVmazXFaDrbmCLQxBysKu7U6Do3mLsx27gf5Dk85ezysrs2BZUpXD703U/Su1xTBDxxar2oa4jAGg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.13.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-arrow-functions/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.13.0.tgz", - "integrity": "sha512-3j6E004Dx0K3eGmhxVJxwwI89CTJrce7lg3UrtFuDAVQ/2+SJ/h/aSFOeE6/n0WB1GsOffsJp6MnPQNQ8nmwhg==", - "dev": true, - "dependencies": { - "@babel/helper-module-imports": "^7.12.13", - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-remap-async-to-generator": "^7.13.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-async-to-generator/node_modules/@babel/helper-module-imports": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", - "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-async-to-generator/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-async-to-generator/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/plugin-transform-async-to-generator/node_modules/@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.12.13.tgz", - "integrity": "sha512-zNyFqbc3kI/fVpqwfqkg6RvBgFpC4J18aKKMmv7KdQ/1GgREapSJAykLMVNwfRGO3BtHj3YQZl8kxCXPcVMVeg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-block-scoped-functions/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.1.tgz", - "integrity": "sha512-2mQXd0zBrwfp0O1moWIhPpEeTKDvxyHcnma3JATVP1l+CctWBuot6OJG8LQ4DnBj4ZZPSmlb/fm4mu47EOAnVA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.13.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-block-scoping/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-classes": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.13.0.tgz", - "integrity": "sha512-9BtHCPUARyVH1oXGcSJD3YpsqRLROJx5ZNP6tN5vnk17N0SVf9WCtf8Nuh1CFmgByKKAIMstitKduoCmsaDK5g==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.12.13", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-replace-supers": "^7.13.0", - "@babel/helper-split-export-declaration": "^7.12.13", - "globals": "^11.1.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-classes/node_modules/@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-classes/node_modules/@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } - }, - "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", - "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-replace-supers": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", - "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", - "dev": true, - "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/plugin-transform-classes/node_modules/@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@babel/plugin-transform-classes/node_modules/@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-transform-classes/node_modules/@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-classes/node_modules/@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } - }, - "node_modules/@babel/plugin-transform-classes/node_modules/@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.13.0.tgz", - "integrity": "sha512-RRqTYTeZkZAz8WbieLTvKUEUxZlUTdmL5KGMyZj7FnMfLNKV4+r5549aORG/mgojRmFlQMJDUupwAMiF2Q7OUg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.13.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-computed-properties/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.13.17", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.17.tgz", - "integrity": "sha512-UAUqiLv+uRLO+xuBKKMEpC+t7YRNVRqBsWWq1yKXbBZBje/t3IXCiSinZhjn/DC3qzBfICeYd2EFGEbHsh5RLA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.13.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-destructuring/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.13.tgz", - "integrity": "sha512-foDrozE65ZFdUC2OfgeOCrEPTxdB3yjqxpXh8CH+ipd9CHd4s/iq81kcUpyH8ACGNEPdFqbtzfgzbT/ZGlbDeQ==", - "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-dotall-regex/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.12.13.tgz", - "integrity": "sha512-NfADJiiHdhLBW3pulJlJI2NB0t4cci4WTZ8FtdIuNc2+8pslXdPtRRAEWqUY+m9kNOk2eRYbTAOipAxlrOcwwQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-duplicate-keys/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.12.13.tgz", - "integrity": "sha512-fbUelkM1apvqez/yYx1/oICVnGo2KM5s63mhGylrmXUxK/IAXSIf87QIxVfZldWf4QsOafY6vV3bX8aMHSvNrA==", - "dev": true, - "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-exponentiation-operator/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-for-of": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.13.0.tgz", - "integrity": "sha512-IHKT00mwUVYE0zzbkDgNRP6SRzvfGCYsOxIRz8KsiaaHCcT9BWIkO+H9QRJseHBLOGBZkHUdHiqj6r0POsdytg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.13.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-for-of/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.12.13.tgz", - "integrity": "sha512-6K7gZycG0cmIwwF7uMK/ZqeCikCGVBdyP2J5SKNCXO5EOHcqi+z7Jwf8AmyDNcBgxET8DrEtCt/mPKPyAzXyqQ==", - "dev": true, - "dependencies": { - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/plugin-transform-literals": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.12.13.tgz", - "integrity": "sha512-FW+WPjSR7hiUxMcKqyNjP05tQ2kmBCdpEpZHY1ARm96tGQCCBvXKnpjILtDplUnJ/eHZ0lALLM+d2lMFSpYJrQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-literals/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-member-expression-literals": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.12.13.tgz", - "integrity": "sha512-kxLkOsg8yir4YeEPHLuO2tXP9R/gTjpuTOjshqSpELUN3ZAg2jfDnKUvzzJxObun38sw3wm4Uu69sX/zA7iRvg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-member-expression-literals/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.0.tgz", - "integrity": "sha512-CF4c5LX4LQ03LebQxJ5JZes2OYjzBuk1TdiF7cG7d5dK4lAdw9NZmaxq5K/mouUdNeqwz3TNjnW6v01UqUNgpQ==", - "dev": true, - "dependencies": { - "@babel/helper-module-transforms": "^7.14.0", - "@babel/helper-plugin-utils": "^7.13.0", - "babel-plugin-dynamic-import-node": "^2.3.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", - "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-module-imports": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", - "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-module-transforms": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", - "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", - "dev": true, - "dependencies": { - "@babel/helper-module-imports": "^7.13.12", - "@babel/helper-replace-supers": "^7.13.12", - "@babel/helper-simple-access": "^7.13.12", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/helper-validator-identifier": "^7.14.0", - "@babel/template": "^7.12.13", - "@babel/traverse": "^7.14.0", - "@babel/types": "^7.14.0" - } - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-replace-supers": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", - "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", - "dev": true, - "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-simple-access": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", - "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } - }, - "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.0.tgz", - "integrity": "sha512-EX4QePlsTaRZQmw9BsoPeyh5OCtRGIhwfLquhxGp5e32w+dyL8htOcDwamlitmNFK6xBZYlygjdye9dbd9rUlQ==", - "dev": true, - "dependencies": { - "@babel/helper-module-transforms": "^7.14.0", - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-simple-access": "^7.13.12", - "babel-plugin-dynamic-import-node": "^2.3.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", - "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-module-imports": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", - "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-module-transforms": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", - "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", - "dev": true, - "dependencies": { - "@babel/helper-module-imports": "^7.13.12", - "@babel/helper-replace-supers": "^7.13.12", - "@babel/helper-simple-access": "^7.13.12", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/helper-validator-identifier": "^7.14.0", - "@babel/template": "^7.12.13", - "@babel/traverse": "^7.14.0", - "@babel/types": "^7.14.0" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-replace-supers": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", - "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", - "dev": true, - "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-simple-access": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", - "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.13.8.tgz", - "integrity": "sha512-hwqctPYjhM6cWvVIlOIe27jCIBgHCsdH2xCJVAYQm7V5yTMoilbVMi9f6wKg0rpQAOn6ZG4AOyvCqFF/hUh6+A==", - "dev": true, - "dependencies": { - "@babel/helper-hoist-variables": "^7.13.0", - "@babel/helper-module-transforms": "^7.13.0", - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-validator-identifier": "^7.12.11", - "babel-plugin-dynamic-import-node": "^2.3.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", - "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-module-imports": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", - "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-module-transforms": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", - "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", - "dev": true, - "dependencies": { - "@babel/helper-module-imports": "^7.13.12", - "@babel/helper-replace-supers": "^7.13.12", - "@babel/helper-simple-access": "^7.13.12", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/helper-validator-identifier": "^7.14.0", - "@babel/template": "^7.12.13", - "@babel/traverse": "^7.14.0", - "@babel/types": "^7.14.0" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-module-transforms/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-replace-supers": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", - "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", - "dev": true, - "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-simple-access": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", - "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/highlight/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/types/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.0.tgz", - "integrity": "sha512-nPZdnWtXXeY7I87UZr9VlsWme3Y0cfFFE41Wbxz4bbaexAjNMInXPFUpRRUJ8NoMm0Cw+zxbqjdPmLhcjfazMw==", - "dev": true, - "dependencies": { - "@babel/helper-module-transforms": "^7.14.0", - "@babel/helper-plugin-utils": "^7.13.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", - "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-module-imports": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", - "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-module-transforms": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", - "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", - "dev": true, - "dependencies": { - "@babel/helper-module-imports": "^7.13.12", - "@babel/helper-replace-supers": "^7.13.12", - "@babel/helper-simple-access": "^7.13.12", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/helper-validator-identifier": "^7.14.0", - "@babel/template": "^7.12.13", - "@babel/traverse": "^7.14.0", - "@babel/types": "^7.14.0" - } - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-replace-supers": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", - "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", - "dev": true, - "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-simple-access": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", - "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } - }, - "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.13.tgz", - "integrity": "sha512-Xsm8P2hr5hAxyYblrfACXpQKdQbx4m2df9/ZZSQ8MAhsadw06+jW7s9zsSw6he+mJZXRlVMyEnVktJo4zjk1WA==", - "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/plugin-transform-new-target": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.12.13.tgz", - "integrity": "sha512-/KY2hbLxrG5GTQ9zzZSc3xWiOy379pIETEhbtzwZcw9rvuaVV4Fqy7BYGYOWZnaoXIQYbbJ0ziXLa/sKcGCYEQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-new-target/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-object-super": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.12.13.tgz", - "integrity": "sha512-JzYIcj3XtYspZDV8j9ulnoMPZZnF/Cj0LUxPOjR89BdBVx+zYJI9MdMIlUZjbXDX+6YVeS6I3e8op+qQ3BYBoQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13", - "@babel/helper-replace-supers": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } - }, - "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", - "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-replace-supers": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", - "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", - "dev": true, - "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.12" - } - }, - "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } - }, - "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/plugin-transform-parameters": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.13.0.tgz", - "integrity": "sha512-Jt8k/h/mIwE2JFEOb3lURoY5C85ETcYPnbuAJ96zRBzh1XHtQZfs62ChZ6EP22QlC8c7Xqr9q+e1SU5qttwwjw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.13.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-parameters/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-property-literals": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.12.13.tgz", - "integrity": "sha512-nqVigwVan+lR+g8Fj8Exl0UQX2kymtjcWfMOYM1vTYEKujeyv2SkMgazf2qNcK7l4SDiKyTA/nHCPqL4e2zo1A==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-property-literals/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.13.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.13.15.tgz", - "integrity": "sha512-Bk9cOLSz8DiurcMETZ8E2YtIVJbFCPGW28DJWUakmyVWtQSm6Wsf0p4B4BfEr/eL2Nkhe/CICiUiMOCi1TPhuQ==", - "dev": true, - "dependencies": { - "regenerator-transform": "^0.14.2" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-reserved-words": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.12.13.tgz", - "integrity": "sha512-xhUPzDXxZN1QfiOy/I5tyye+TRz6lA7z6xaT4CLOjPRMVg1ldRf0LHw0TDBpYL4vG78556WuHdyO9oi5UmzZBg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-reserved-words/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.12.13.tgz", - "integrity": "sha512-xpL49pqPnLtf0tVluuqvzWIgLEhuPpZzvs2yabUHSKRNlN7ScYU7aMlmavOeyXJZKgZKQRBlh8rHbKiJDraTSw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-shorthand-properties/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-spread": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.13.0.tgz", - "integrity": "sha512-V6vkiXijjzYeFmQTr3dBxPtZYLPcUfY34DebOU27jIl2M/Y8Egm52Hw82CSjjPqd54GTlJs5x+CR7HeNr24ckg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-spread/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.13.tgz", - "integrity": "sha512-Jc3JSaaWT8+fr7GRvQP02fKDsYk4K/lYwWq38r/UGfaxo89ajud321NH28KRQ7xy1Ybc0VUE5Pz8psjNNDUglg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-sticky-regex/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.13.0.tgz", - "integrity": "sha512-d67umW6nlfmr1iehCcBv69eSUSySk1EsIS8aTDX4Xo9qajAh6mYtcl4kJrBkGXuxZPEgVr7RVfAvNW6YQkd4Mw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.13.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-template-literals/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.13.tgz", - "integrity": "sha512-eKv/LmUJpMnu4npgfvs3LiHhJua5fo/CysENxa45YCQXZwKnGCQKAg87bvoqSW1fFT+HA32l03Qxsm8ouTY3ZQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-typeof-symbol/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-typescript": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.12.1.tgz", - "integrity": "sha512-VrsBByqAIntM+EYMqSm59SiMEf7qkmI9dqMt6RbD/wlwueWmYcI0FFK5Fj47pP6DRZm+3teXjosKlwcZJ5lIMw==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-syntax-typescript": "^7.12.1" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-unicode-escapes": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.12.13.tgz", - "integrity": "sha512-0bHEkdwJ/sN/ikBHfSmOXPypN/beiGqjo+o4/5K+vxEFNPRPdImhviPakMKG4x96l85emoa0Z6cDflsdBusZbw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-unicode-escapes/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.12.13.tgz", - "integrity": "sha512-mDRzSNY7/zopwisPZ5kM9XKCfhchqIYwAKRERtEnhYscZB79VRekuRSoYbN0+KVe3y8+q1h6A4svXtP7N+UoCA==", - "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-unicode-regex/node_modules/@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - }, - "node_modules/@babel/preset-env": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.12.11.tgz", - "integrity": "sha512-j8Tb+KKIXKYlDBQyIOy4BLxzv1NUOwlHfZ74rvW+Z0Gp4/cI2IMDPBWAgWceGcE7aep9oL/0K9mlzlMGxA8yNw==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.12.7", - "@babel/helper-compilation-targets": "^7.12.5", - "@babel/helper-module-imports": "^7.12.5", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-validator-option": "^7.12.11", - "@babel/plugin-proposal-async-generator-functions": "^7.12.1", - "@babel/plugin-proposal-class-properties": "^7.12.1", - "@babel/plugin-proposal-dynamic-import": "^7.12.1", - "@babel/plugin-proposal-export-namespace-from": "^7.12.1", - "@babel/plugin-proposal-json-strings": "^7.12.1", - "@babel/plugin-proposal-logical-assignment-operators": "^7.12.1", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1", - "@babel/plugin-proposal-numeric-separator": "^7.12.7", - "@babel/plugin-proposal-object-rest-spread": "^7.12.1", - "@babel/plugin-proposal-optional-catch-binding": "^7.12.1", - "@babel/plugin-proposal-optional-chaining": "^7.12.7", - "@babel/plugin-proposal-private-methods": "^7.12.1", - "@babel/plugin-proposal-unicode-property-regex": "^7.12.1", - "@babel/plugin-syntax-async-generators": "^7.8.0", - "@babel/plugin-syntax-class-properties": "^7.12.1", - "@babel/plugin-syntax-dynamic-import": "^7.8.0", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.0", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", - "@babel/plugin-syntax-numeric-separator": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.0", - "@babel/plugin-syntax-top-level-await": "^7.12.1", - "@babel/plugin-transform-arrow-functions": "^7.12.1", - "@babel/plugin-transform-async-to-generator": "^7.12.1", - "@babel/plugin-transform-block-scoped-functions": "^7.12.1", - "@babel/plugin-transform-block-scoping": "^7.12.11", - "@babel/plugin-transform-classes": "^7.12.1", - "@babel/plugin-transform-computed-properties": "^7.12.1", - "@babel/plugin-transform-destructuring": "^7.12.1", - "@babel/plugin-transform-dotall-regex": "^7.12.1", - "@babel/plugin-transform-duplicate-keys": "^7.12.1", - "@babel/plugin-transform-exponentiation-operator": "^7.12.1", - "@babel/plugin-transform-for-of": "^7.12.1", - "@babel/plugin-transform-function-name": "^7.12.1", - "@babel/plugin-transform-literals": "^7.12.1", - "@babel/plugin-transform-member-expression-literals": "^7.12.1", - "@babel/plugin-transform-modules-amd": "^7.12.1", - "@babel/plugin-transform-modules-commonjs": "^7.12.1", - "@babel/plugin-transform-modules-systemjs": "^7.12.1", - "@babel/plugin-transform-modules-umd": "^7.12.1", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.12.1", - "@babel/plugin-transform-new-target": "^7.12.1", - "@babel/plugin-transform-object-super": "^7.12.1", - "@babel/plugin-transform-parameters": "^7.12.1", - "@babel/plugin-transform-property-literals": "^7.12.1", - "@babel/plugin-transform-regenerator": "^7.12.1", - "@babel/plugin-transform-reserved-words": "^7.12.1", - "@babel/plugin-transform-shorthand-properties": "^7.12.1", - "@babel/plugin-transform-spread": "^7.12.1", - "@babel/plugin-transform-sticky-regex": "^7.12.7", - "@babel/plugin-transform-template-literals": "^7.12.1", - "@babel/plugin-transform-typeof-symbol": "^7.12.10", - "@babel/plugin-transform-unicode-escapes": "^7.12.1", - "@babel/plugin-transform-unicode-regex": "^7.12.1", - "@babel/preset-modules": "^0.1.3", - "@babel/types": "^7.12.11", - "core-js-compat": "^3.8.0", - "semver": "^5.5.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/preset-modules": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.4.tgz", - "integrity": "sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", - "@babel/plugin-transform-dotall-regex": "^7.4.4", - "@babel/types": "^7.4.4", - "esutils": "^2.0.2" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/preset-typescript": { - "version": "7.12.7", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.12.7.tgz", - "integrity": "sha512-nOoIqIqBmHBSEgBXWR4Dv/XBehtIFcw9PqZw6rFYuKrzsZmOQm3PR5siLBnKZFEsDb03IegG8nSjU/iXXXYRmw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-validator-option": "^7.12.1", - "@babel/plugin-transform-typescript": "^7.12.1" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/runtime": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.0.tgz", - "integrity": "sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA==", - "dev": true, - "dependencies": { - "regenerator-runtime": "^0.13.4" - } - }, - "node_modules/@babel/template": { - "version": "7.12.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz", - "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/parser": "^7.12.7", - "@babel/types": "^7.12.7" - } - }, - "node_modules/@babel/traverse": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.10.tgz", - "integrity": "sha512-6aEtf0IeRgbYWzta29lePeYSk+YAFIC3kyqESeft8o5CkFlYIMX+EQDDWEiAQ9LHOA3d0oHdgrSsID/CKqXJlg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.10", - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.12.10", - "@babel/types": "^7.12.10", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" - } - }, - "node_modules/@babel/types": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.11.tgz", - "integrity": "sha512-ukA9SQtKThINm++CX1CwmliMrE54J6nIYB5XTwL5f/CLFW9owfls+YSU8tVW15RQ2w+a3fSbPjC6HdQNtWZkiA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.12.11", - "lodash": "^4.17.19", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@discoveryjs/json-ext": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz", - "integrity": "sha512-HyYEUDeIj5rRQU2Hk5HTB2uHsbRQpF70nvMhVzi+VJR0X+xNEhjPui4/kBf3VeH/wqD28PT4sVOm8qqLjBrSZg==", - "dev": true, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", - "integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", - "dev": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "dev": true, - "dependencies": { - "type-fest": "^0.8.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@eslint/eslintrc/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", - "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.4", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", - "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", - "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.4", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@sinonjs/commons": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.1.tgz", - "integrity": "sha512-892K+kWUUi3cl+LlqEWIDrhvLgdL79tECi8JZUyq6IviKy/DNhuzCRlbHUjxK89f4ypPMMaFnFuR9Ie6DoIMsw==", - "dev": true, - "dependencies": { - "type-detect": "4.0.8" - } - }, - "node_modules/@sinonjs/fake-timers": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", - "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.7.0" - } - }, - "node_modules/@sinonjs/samsam": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.3.1.tgz", - "integrity": "sha512-1Hc0b1TtyfBu8ixF/tpfSHTVWKwCBLY4QJbkgnE7HcwyvT2xArDxb4K7dMgqRm3szI+LJbzmW/s4xxEhv6hwDg==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.6.0", - "lodash.get": "^4.4.2", - "type-detect": "^4.0.8" - } - }, - "node_modules/@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", - "dev": true - }, - "node_modules/@types/chrome": { - "version": "0.0.135", - "resolved": "https://registry.npmjs.org/@types/chrome/-/chrome-0.0.135.tgz", - "integrity": "sha512-SczB5P5mIgQWHAeiimlYg5VFvuQKCw4Q5cAzVD7II1Czf4U0222jb3mTHUd1qM0BRJ/kPtzybBde+Zy2sdx/LA==", - "dev": true, - "dependencies": { - "@types/filesystem": "*", - "@types/har-format": "*" - } - }, - "node_modules/@types/eslint": { - "version": "7.2.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.10.tgz", - "integrity": "sha512-kUEPnMKrqbtpCq/KTaGFFKAcz6Ethm2EjCoKIDaCmfRBWLbFuTcOJfTlorwbnboXBzahqWLgUp1BQeKHiJzPUQ==", - "dev": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.0.tgz", - "integrity": "sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw==", - "dev": true, - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, - "node_modules/@types/estree": { - "version": "0.0.46", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.46.tgz", - "integrity": "sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg==", - "dev": true - }, - "node_modules/@types/filesystem": { - "version": "0.0.30", - "resolved": "https://registry.npmjs.org/@types/filesystem/-/filesystem-0.0.30.tgz", - "integrity": "sha512-NCoRgmGmLpTT9VFL6Bb6z0jQuqI3d0E5FGl7M0JOv/J5RQYo9s5aOItPYnpckx9MbYQk1APLXcF8f20Vqnf2yA==", - "dev": true, - "dependencies": { - "@types/filewriter": "*" - } - }, - "node_modules/@types/filewriter": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/filewriter/-/filewriter-0.0.29.tgz", - "integrity": "sha512-BsPXH/irW0ht0Ji6iw/jJaK8Lj3FJemon2gvEqHKpCdDCeemHa+rI3WBGq5z7cDMZgoLjY40oninGxqk+8NzNQ==", - "dev": true - }, - "node_modules/@types/har-format": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@types/har-format/-/har-format-1.2.5.tgz", - "integrity": "sha512-IG8AE1m2pWtPqQ7wXhFhy6Q59bwwnLwO36v5Rit2FrbXCIp8Sk8E2PfUCreyrdo17STwFSKDAkitVuVYbpEHvQ==", - "dev": true - }, - "node_modules/@types/json-schema": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", - "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", - "dev": true - }, - "node_modules/@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", - "dev": true - }, - "node_modules/@types/node": { - "version": "14.14.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.14.tgz", - "integrity": "sha512-UHnOPWVWV1z+VV8k6L1HhG7UbGBgIdghqF3l9Ny9ApPghbjICXkUJSd/b9gOgQfjM1r+37cipdw/HJ3F6ICEnQ==", - "dev": true - }, - "node_modules/@types/sinon": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.0.tgz", - "integrity": "sha512-jDZ55oCKxqlDmoTBBbBBEx+N8ZraUVhggMZ9T5t+6/Dh8/4NiOjSUfpLrPiEwxQDlAe3wpAkoXhWvE6LibtsMQ==", - "dev": true, - "dependencies": { - "@sinonjs/fake-timers": "^7.0.4" - } - }, - "node_modules/@types/sinon/node_modules/@sinonjs/fake-timers": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-7.0.5.tgz", - "integrity": "sha512-fUt6b15bjV/VW93UP5opNXJxdwZSbK1EdiwnhN7XrQrcpaOhMJpZ/CjwFpM3THpxwA+YviBUJKSuEqKlCK5alw==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.7.0" - } - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.17.0.tgz", - "integrity": "sha512-/fKFDcoHg8oNan39IKFOb5WmV7oWhQe1K6CDaAVfJaNWEhmfqlA24g+u1lqU5bMH7zuNasfMId4LaYWC5ijRLw==", - "dev": true, - "dependencies": { - "@typescript-eslint/experimental-utils": "4.17.0", - "@typescript-eslint/scope-manager": "4.17.0", - "debug": "^4.1.1", - "functional-red-black-tree": "^1.0.1", - "lodash": "^4.17.15", - "regexpp": "^3.0.0", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^4.0.0", - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/experimental-utils": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.17.0.tgz", - "integrity": "sha512-ZR2NIUbnIBj+LGqCFGQ9yk2EBQrpVVFOh9/Kd0Lm6gLpSAcCuLLe5lUCibKGCqyH9HPwYC0GIJce2O1i8VYmWA==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.17.0", - "@typescript-eslint/types": "4.17.0", - "@typescript-eslint/typescript-estree": "4.17.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "*" - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.17.0.tgz", - "integrity": "sha512-KYdksiZQ0N1t+6qpnl6JeK9ycCFprS9xBAiIrw4gSphqONt8wydBw4BXJi3C11ywZmyHulvMaLjWsxDjUSDwAw==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "4.17.0", - "@typescript-eslint/types": "4.17.0", - "@typescript-eslint/typescript-estree": "4.17.0", - "debug": "^4.1.1" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.17.0.tgz", - "integrity": "sha512-OJ+CeTliuW+UZ9qgULrnGpPQ1bhrZNFpfT/Bc0pzNeyZwMik7/ykJ0JHnQ7krHanFN9wcnPK89pwn84cRUmYjw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "4.17.0", - "@typescript-eslint/visitor-keys": "4.17.0" - }, - "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.17.0.tgz", - "integrity": "sha512-RN5z8qYpJ+kXwnLlyzZkiJwfW2AY458Bf8WqllkondQIcN2ZxQowAToGSd9BlAUZDB5Ea8I6mqL2quGYCLT+2g==", - "dev": true, - "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.17.0.tgz", - "integrity": "sha512-lRhSFIZKUEPPWpWfwuZBH9trYIEJSI0vYsrxbvVvNyIUDoKWaklOAelsSkeh3E2VBSZiNe9BZ4E5tYBZbUczVQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "4.17.0", - "@typescript-eslint/visitor-keys": "4.17.0", - "debug": "^4.1.1", - "globby": "^11.0.1", - "is-glob": "^4.0.1", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.17.0.tgz", - "integrity": "sha512-WfuMN8mm5SSqXuAr9NM+fItJ0SVVphobWYkWOwQ1odsfC014Vdxk/92t4JwS1Q6fCA/ABfCKpa3AVtpUKTNKGQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "4.17.0", - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@webassemblyjs/ast": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.0.tgz", - "integrity": "sha512-kX2W49LWsbthrmIRMbQZuQDhGtjyqXfEmmHyEi4XWnSZtPmxY0+3anPIzsnRb45VH/J55zlOfWvZuY47aJZTJg==", - "dev": true, - "dependencies": { - "@webassemblyjs/helper-numbers": "1.11.0", - "@webassemblyjs/helper-wasm-bytecode": "1.11.0" - } - }, - "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.0.tgz", - "integrity": "sha512-Q/aVYs/VnPDVYvsCBL/gSgwmfjeCb4LW8+TMrO3cSzJImgv8lxxEPM2JA5jMrivE7LSz3V+PFqtMbls3m1exDA==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.0.tgz", - "integrity": "sha512-baT/va95eXiXb2QflSx95QGT5ClzWpGaa8L7JnJbgzoYeaA27FCvuBXU758l+KXWRndEmUXjP0Q5fibhavIn8w==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.0.tgz", - "integrity": "sha512-u9HPBEl4DS+vA8qLQdEQ6N/eJQ7gT7aNvMIo8AAWvAl/xMrcOSiI2M0MAnMCy3jIFke7bEee/JwdX1nUpCtdyA==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.0.tgz", - "integrity": "sha512-DhRQKelIj01s5IgdsOJMKLppI+4zpmcMQ3XboFPLwCpSNH6Hqo1ritgHgD0nqHeSYqofA6aBN/NmXuGjM1jEfQ==", - "dev": true, - "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.11.0", - "@webassemblyjs/helper-api-error": "1.11.0", - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.0.tgz", - "integrity": "sha512-MbmhvxXExm542tWREgSFnOVo07fDpsBJg3sIl6fSp9xuu75eGz5lz31q7wTLffwL3Za7XNRCMZy210+tnsUSEA==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.0.tgz", - "integrity": "sha512-3Eb88hcbfY/FCukrg6i3EH8H2UsD7x8Vy47iVJrP967A9JGqgBVL9aH71SETPx1JrGsOUVLo0c7vMCN22ytJew==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/helper-buffer": "1.11.0", - "@webassemblyjs/helper-wasm-bytecode": "1.11.0", - "@webassemblyjs/wasm-gen": "1.11.0" - } - }, - "node_modules/@webassemblyjs/ieee754": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.0.tgz", - "integrity": "sha512-KXzOqpcYQwAfeQ6WbF6HXo+0udBNmw0iXDmEK5sFlmQdmND+tr773Ti8/5T/M6Tl/413ArSJErATd8In3B+WBA==", - "dev": true, - "dependencies": { - "@xtuc/ieee754": "^1.2.0" - } - }, - "node_modules/@webassemblyjs/leb128": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.0.tgz", - "integrity": "sha512-aqbsHa1mSQAbeeNcl38un6qVY++hh8OpCOzxhixSYgbRfNWcxJNJQwe2rezK9XEcssJbbWIkblaJRwGMS9zp+g==", - "dev": true, - "dependencies": { - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@webassemblyjs/utf8": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.0.tgz", - "integrity": "sha512-A/lclGxH6SpSLSyFowMzO/+aDEPU4hvEiooCMXQPcQFPPJaYcPQNKGOCLUySJsYJ4trbpr+Fs08n4jelkVTGVw==", - "dev": true - }, - "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.0.tgz", - "integrity": "sha512-JHQ0damXy0G6J9ucyKVXO2j08JVJ2ntkdJlq1UTiUrIgfGMmA7Ik5VdC/L8hBK46kVJgujkBIoMtT8yVr+yVOQ==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/helper-buffer": "1.11.0", - "@webassemblyjs/helper-wasm-bytecode": "1.11.0", - "@webassemblyjs/helper-wasm-section": "1.11.0", - "@webassemblyjs/wasm-gen": "1.11.0", - "@webassemblyjs/wasm-opt": "1.11.0", - "@webassemblyjs/wasm-parser": "1.11.0", - "@webassemblyjs/wast-printer": "1.11.0" - } - }, - "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.0.tgz", - "integrity": "sha512-BEUv1aj0WptCZ9kIS30th5ILASUnAPEvE3tVMTrItnZRT9tXCLW2LEXT8ezLw59rqPP9klh9LPmpU+WmRQmCPQ==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/helper-wasm-bytecode": "1.11.0", - "@webassemblyjs/ieee754": "1.11.0", - "@webassemblyjs/leb128": "1.11.0", - "@webassemblyjs/utf8": "1.11.0" - } - }, - "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.0.tgz", - "integrity": "sha512-tHUSP5F4ywyh3hZ0+fDQuWxKx3mJiPeFufg+9gwTpYp324mPCQgnuVKwzLTZVqj0duRDovnPaZqDwoyhIO8kYg==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/helper-buffer": "1.11.0", - "@webassemblyjs/wasm-gen": "1.11.0", - "@webassemblyjs/wasm-parser": "1.11.0" - } - }, - "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.0.tgz", - "integrity": "sha512-6L285Sgu9gphrcpDXINvm0M9BskznnzJTE7gYkjDbxET28shDqp27wpruyx3C2S/dvEwiigBwLA1cz7lNUi0kw==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/helper-api-error": "1.11.0", - "@webassemblyjs/helper-wasm-bytecode": "1.11.0", - "@webassemblyjs/ieee754": "1.11.0", - "@webassemblyjs/leb128": "1.11.0", - "@webassemblyjs/utf8": "1.11.0" - } - }, - "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.0.tgz", - "integrity": "sha512-Fg5OX46pRdTgB7rKIUojkh9vXaVN6sGYCnEiJN1GYkb0RPwShZXp6KTDqmoMdQPKhcroOXh3fEzmkWmCYaKYhQ==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.11.0", - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@webpack-cli/configtest": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.3.tgz", - "integrity": "sha512-WQs0ep98FXX2XBAfQpRbY0Ma6ADw8JR6xoIkaIiJIzClGOMqVRvPCWqndTxf28DgFopWan0EKtHtg/5W1h0Zkw==", - "dev": true, - "peerDependencies": { - "webpack": "4.x.x || 5.x.x", - "webpack-cli": "4.x.x" - } - }, - "node_modules/@webpack-cli/info": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.2.4.tgz", - "integrity": "sha512-ogE2T4+pLhTTPS/8MM3IjHn0IYplKM4HbVNMCWA9N4NrdPzunwenpCsqKEXyejMfRu6K8mhauIPYf8ZxWG5O6g==", - "dev": true, - "dependencies": { - "envinfo": "^7.7.3" - }, - "peerDependencies": { - "webpack-cli": "4.x.x" - } - }, - "node_modules/@webpack-cli/serve": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.4.0.tgz", - "integrity": "sha512-xgT/HqJ+uLWGX+Mzufusl3cgjAcnqYYskaB7o0vRcwOEfuu6hMzSILQpnIzFMGsTaeaX4Nnekl+6fadLbl1/Vg==", - "dev": true, - "peerDependencies": { - "webpack-cli": "4.x.x" - }, - "peerDependenciesMeta": { - "webpack-dev-server": { - "optional": true - } - } - }, - "node_modules/@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "node_modules/@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true - }, - "node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "peerDependencies": { - "ajv": "^6.9.1" - } - }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/array-includes": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz", - "integrity": "sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.2", - "get-intrinsic": "^1.1.1", - "is-string": "^1.0.5" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/array.prototype.flat": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", - "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-dynamic-import-node": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", - "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", - "dev": true, - "dependencies": { - "object.assign": "^4.1.0" - } - }, - "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/browserslist": { - "version": "4.16.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", - "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", - "dev": true, - "dependencies": { - "caniuse-lite": "^1.0.30001219", - "colorette": "^1.2.2", - "electron-to-chromium": "^1.3.723", - "escalade": "^3.1.1", - "node-releases": "^1.1.71" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - } - }, - "node_modules/buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001223", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001223.tgz", - "integrity": "sha512-k/RYs6zc/fjbxTjaWZemeSmOjO0JJV+KguOBA3NwPup8uzxM1cMhR2BD9XmO86GuqaqTCO8CgkgH9Rz//vdDiA==", - "dev": true - }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", - "dev": true, - "engines": { - "node": ">=6.0" - } - }, - "node_modules/clone-deep": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", - "dev": true, - "dependencies": { - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.2", - "shallow-clone": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "node_modules/colorette": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", - "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", - "dev": true - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "node_modules/contains-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", - "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "peer": true, - "dependencies": { - "safe-buffer": "~5.1.1" - } - }, - "node_modules/copy-webpack-plugin": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-8.1.1.tgz", - "integrity": "sha512-rYM2uzRxrLRpcyPqGceRBDpxxUV8vcDqIKxAUKfcnFpcrPxT5+XvhTxv7XLjo5AvEJFPdAE3zCogG2JVahqgSQ==", - "dev": true, - "dependencies": { - "fast-glob": "^3.2.5", - "glob-parent": "^5.1.1", - "globby": "^11.0.3", - "normalize-path": "^3.0.0", - "p-limit": "^3.1.0", - "schema-utils": "^3.0.0", - "serialize-javascript": "^5.0.1" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^5.1.0" - } - }, - "node_modules/copy-webpack-plugin/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/core-js-compat": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.12.0.tgz", - "integrity": "sha512-vvaN8EOvYBEjrr+MN3vCKrMNc/xdYZI+Rt/uPMROi4T5Hj8Fz6TiPQm2mrB9aZoQVW1lCFHYmMrv99aUct9mkg==", - "dev": true, - "dependencies": { - "browserslist": "^4.16.6", - "semver": "7.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, - "node_modules/core-js-compat/node_modules/semver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", - "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/cross-env": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", - "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.1" - }, - "bin": { - "cross-env": "src/bin/cross-env.js", - "cross-env-shell": "src/bin/cross-env-shell.js" - }, - "engines": { - "node": ">=10.14", - "npm": ">=6", - "yarn": ">=1" - } - }, - "node_modules/cross-env/node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/cross-env/node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/cross-env/node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cross-env/node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/cross-env/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "node_modules/define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "dependencies": { - "object-keys": "^1.0.12" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/electron-to-chromium": { - "version": "1.3.727", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.727.tgz", - "integrity": "sha512-Mfz4FIB4FSvEwBpDfdipRIrwd6uo8gUDoRDF4QEYb4h4tSuI3ov594OrjU6on042UlFHouIJpClDODGkPcBSbg==", - "dev": true - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/enhanced-resolve": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.0.tgz", - "integrity": "sha512-Sl3KRpJA8OpprrtaIswVki3cWPiPKxXuFxJXBp+zNb6s6VwNWwFRUdtmzd2ReUut8n+sCPx7QCtQ7w5wfJhSgQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "dependencies": { - "ansi-colors": "^4.1.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", - "dev": true, - "bin": { - "envinfo": "dist/cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, - "node_modules/es-abstract": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0.tgz", - "integrity": "sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.2", - "is-callable": "^1.2.3", - "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.2", - "is-string": "^1.0.5", - "object-inspect": "^1.9.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es-module-lexer": { - "version": "0.3.26", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.3.26.tgz", - "integrity": "sha512-Va0Q/xqtrss45hWzP8CZJwzGSZJjDM5/MJRE3IXXnUCcVLElR9BRaE9F62BopysASyc4nM3uwhSW7FFB9nlWAA==", - "dev": true - }, - "node_modules/es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/eslint": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.21.0.tgz", - "integrity": "sha512-W2aJbXpMNofUp0ztQaF40fveSsJBjlSCSWpy//gzfTvwC+USs/nceBrKmlJOiM8r1bLwP2EuYkCqArn/6QTIgg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash": "^4.17.20", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.4", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-import-resolver-node": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", - "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", - "dev": true, - "dependencies": { - "debug": "^2.6.9", - "resolve": "^1.13.1" - } - }, - "node_modules/eslint-import-resolver-node/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/eslint-import-resolver-node/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "node_modules/eslint-module-utils": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", - "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", - "dev": true, - "dependencies": { - "debug": "^2.6.9", - "pkg-dir": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/eslint-module-utils/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "node_modules/eslint-module-utils/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, - "dependencies": { - "find-up": "^2.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-plugin-import": { - "version": "2.22.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", - "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", - "dev": true, - "dependencies": { - "array-includes": "^3.1.1", - "array.prototype.flat": "^1.2.3", - "contains-path": "^0.1.0", - "debug": "^2.6.9", - "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.4", - "eslint-module-utils": "^2.6.0", - "has": "^1.0.3", - "minimatch": "^3.0.4", - "object.values": "^1.1.1", - "read-pkg-up": "^2.0.0", - "resolve": "^1.17.0", - "tsconfig-paths": "^3.9.0" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0" - } - }, - "node_modules/eslint-plugin-import/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/eslint-plugin-import/node_modules/doctrine": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", - "dev": true, - "dependencies": { - "esutils": "^2.0.2", - "isarray": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eslint-plugin-import/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-plugin-import/node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-plugin-import/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "node_modules/eslint-plugin-import/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-plugin-import/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-plugin-import/node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-plugin-import/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-plugin-import/node_modules/path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", - "dev": true, - "dependencies": { - "pify": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-plugin-import/node_modules/read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", - "dev": true, - "dependencies": { - "load-json-file": "^2.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-plugin-import/node_modules/read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", - "dev": true, - "dependencies": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/eslint/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/eslint/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/eslint/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/eslint/node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/eslint/node_modules/globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "dev": true, - "dependencies": { - "type-fest": "^0.8.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/eslint/node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/eslint/node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/eslint/node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/eslint/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint/node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/eslint/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dev": true, - "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, - "engines": { - "node": ">=0.8.x" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", - "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "node_modules/fastest-levenshtein": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", - "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", - "dev": true - }, - "node_modules/fastq": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", - "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", - "dev": true - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/git-hooks-plus": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/git-hooks-plus/-/git-hooks-plus-1.0.1.tgz", - "integrity": "sha512-IeIEuXySE+EklJieSIXLoFGLuF5ERutODXZz3UCiL1JAjpvZKNyl9j00iF67i5yfX3sKepS1AHN9d3KmUxgWnw==", - "dev": true, - "hasInstallScript": true, - "engines": { - "node": ">=0.8.x" - } - }, - "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true - }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/globby": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz", - "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-bigints": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, - "node_modules/ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/import-fresh/node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/import-local": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", - "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", - "dev": true, - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/interpret": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", - "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "node_modules/is-bigint": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz", - "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-boolean-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.0.tgz", - "integrity": "sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-callable": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", - "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-core-module": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", - "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-date-object": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.3.tgz", - "integrity": "sha512-tDpEUInNcy2Yw3lNSepK3Wdw1RnXLcIVienz6Ou631Acl15cJyRWK4dgA1vCmOEgIbtOV0W7MHg+AR2Gdg1NXQ==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-negative-zero": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", - "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-number-object": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", - "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-regex": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz", - "integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-symbols": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-string": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", - "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", - "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", - "dev": true, - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/jest-worker/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-worker/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "node_modules/json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", - "dev": true, - "peer": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/just-extend": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", - "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", - "dev": true - }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/load-json-file/node_modules/parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "dependencies": { - "error-ex": "^1.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/load-json-file/node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/loader-runner": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", - "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", - "dev": true, - "engines": { - "node": ">=6.11.5" - } - }, - "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "node_modules/lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", - "dev": true - }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", - "dev": true - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", - "dev": true, - "dependencies": { - "mime-db": "1.44.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "node_modules/nise": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", - "integrity": "sha512-eQMEmGN/8arp0xsvGoQ+B1qvSkR73B1nWSCh7nOt5neMCtwcQVYQGdzQMhcNscktTsWB54xnlSQFzOAPJD8nXA==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.7.0", - "@sinonjs/fake-timers": "^6.0.0", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "path-to-regexp": "^1.7.0" - } - }, - "node_modules/node-releases": { - "version": "1.1.71", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.71.tgz", - "integrity": "sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg==", - "dev": true - }, - "node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.2.tgz", - "integrity": "sha512-gz58rdPpadwztRrPjZE9DZLOABUpTGdcANUgOwBFO1C+HZZhePoP83M65WGDmbpwFYJSWqavbl4SgDn4k8RYTA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object.values": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz", - "integrity": "sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.2", - "has": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dev": true, - "dependencies": { - "isarray": "0.0.1" - } - }, - "node_modules/path-to-regexp/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/prettier": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", - "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", - "dev": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/rechoir": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", - "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", - "dev": true, - "dependencies": { - "resolve": "^1.9.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/regenerate": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", - "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", - "dev": true - }, - "node_modules/regenerate-unicode-properties": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", - "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", - "dev": true, - "dependencies": { - "regenerate": "^1.4.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/regenerator-runtime": { - "version": "0.13.7", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", - "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", - "dev": true - }, - "node_modules/regenerator-transform": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", - "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.8.4" - } - }, - "node_modules/regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/regexpu-core": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz", - "integrity": "sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==", - "dev": true, - "dependencies": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.2.0", - "regjsgen": "^0.5.1", - "regjsparser": "^0.6.4", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.2.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/regjsgen": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", - "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", - "dev": true - }, - "node_modules/regjsparser": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", - "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", - "dev": true, - "dependencies": { - "jsesc": "~0.5.0" - }, - "bin": { - "regjsparser": "bin/parser" - } - }, - "node_modules/regjsparser/node_modules/jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", - "dev": true, - "dependencies": { - "is-core-module": "^2.1.0", - "path-parse": "^1.0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "dependencies": { - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/schema-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", - "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.6", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/serialize-javascript": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/shallow-clone": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", - "dev": true - }, - "node_modules/sinon": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-10.0.0.tgz", - "integrity": "sha512-XAn5DxtGVJBlBWYrcYKEhWCz7FLwZGdyvANRyK06419hyEpdT0dMc5A8Vcxg5SCGHc40CsqoKsc1bt1CbJPfNw==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.8.1", - "@sinonjs/fake-timers": "^6.0.1", - "@sinonjs/samsam": "^5.3.1", - "diff": "^4.0.2", - "nise": "^4.1.0", - "supports-color": "^7.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/sinon" - } - }, - "node_modules/sinon/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/sinon/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/slice-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/source-list-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true - }, - "node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/source-map-support/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-license-ids": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", - "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", - "dev": true - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "node_modules/string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string.prototype.trimend": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", - "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", - "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/table": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.7.0.tgz", - "integrity": "sha512-SAM+5p6V99gYiiy2gT5ArdzgM1dLDed0nkrWmG6Fry/bUS/m9x83BwpJUOf1Qj/x2qJd+thL6IkIx7qPGRxqBw==", - "dev": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.2.0.tgz", - "integrity": "sha512-WSNGFuyWd//XO8n/m/EaOlNLtO0yL8EXT/74LqT4khdhpZjP7lkj/kT5uwRmGitKEVp/Oj7ZUHeGfPtgHhQ5CA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/tapable": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz", - "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/terser-webpack-plugin": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.1.tgz", - "integrity": "sha512-5XNNXZiR8YO6X6KhSGXfY0QrGrCRlSwAEjIIrlRQR4W8nP69TaJUlh3bkuac6zzgspiGPfKEHcY295MMVExl5Q==", - "dev": true, - "dependencies": { - "jest-worker": "^26.6.2", - "p-limit": "^3.1.0", - "schema-utils": "^3.0.0", - "serialize-javascript": "^5.0.1", - "source-map": "^0.6.1", - "terser": "^5.5.1" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^5.1.0" - } - }, - "node_modules/terser-webpack-plugin/node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "node_modules/terser-webpack-plugin/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/terser-webpack-plugin/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/terser-webpack-plugin/node_modules/terser": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.0.tgz", - "integrity": "sha512-HP5/9hp2UaZt5fYkuhNBR8YyRcT8juw8+uFbAme53iN9hblvKnLUTKkmwJG6ocWpIKf8UK4DoeWG4ty0J6S6/g==", - "dev": true, - "dependencies": { - "commander": "^2.20.0", - "source-map": "~0.7.2", - "source-map-support": "~0.5.19" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/terser-webpack-plugin/node_modules/terser/node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/ts-loader": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.1.2.tgz", - "integrity": "sha512-ryMgATvLLl+z8zQvdlm6Pep0slmwxFWIEnq/5VdiLVjqQXnFJgO+qNLGIIP+d2N2jsFZ9MibZCVDb2bSp7OmEA==", - "dev": true, - "dependencies": { - "chalk": "^4.1.0", - "enhanced-resolve": "^5.0.0", - "micromatch": "^4.0.0", - "semver": "^7.3.4" - }, - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "typescript": "*", - "webpack": "*" - } - }, - "node_modules/ts-loader/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/ts-loader/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/ts-loader/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/ts-loader/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/ts-loader/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ts-loader/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/ts-loader/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/tsconfig-paths": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", - "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", - "dev": true, - "dependencies": { - "@types/json5": "^0.0.29", - "json5": "^1.0.1", - "minimist": "^1.2.0", - "strip-bom": "^3.0.0" - } - }, - "node_modules/tsconfig-paths/node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "json5": "lib/cli.js" - } - }, - "node_modules/tsconfig-paths/node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/typescript": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", - "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/unbox-primitive": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", - "which-boxed-primitive": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/unicode-canonical-property-names-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-match-property-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", - "dev": true, - "dependencies": { - "unicode-canonical-property-names-ecmascript": "^1.0.4", - "unicode-property-aliases-ecmascript": "^1.0.4" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-match-property-value-ecmascript": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-property-aliases-ecmascript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", - "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/uri-js": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", - "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "node_modules/watchpack": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.1.1.tgz", - "integrity": "sha512-Oo7LXCmc1eE1AjyuSBmtC3+Wy4HcV8PxWh2kP6fOl8yTlNS7r0K9l1ao2lrrUza7V39Y3D/BbJgY8VeSlc5JKw==", - "dev": true, - "dependencies": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/web-ext-types": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/web-ext-types/-/web-ext-types-3.2.1.tgz", - "integrity": "sha512-oQZYDU3W8X867h8Jmt3129kRVKklz70db40Y6OzoTTuzOJpF/dB2KULJUf0txVPyUUXuyzV8GmT3nVvRHoG+Ew==", - "dev": true - }, - "node_modules/webextension-polyfill": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/webextension-polyfill/-/webextension-polyfill-0.9.0.tgz", - "integrity": "sha512-LTtHb0yR49xa9irkstDxba4GATDAcDw3ncnFH9RImoFwDlW47U95ME5sn5IiQX2ghfaECaf6xyXM8yvClIBkkw==", - "dev": true - }, - "node_modules/webpack": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.18.0.tgz", - "integrity": "sha512-RmiP/iy6ROvVe/S+u0TrvL/oOmvP+2+Bs8MWjvBwwY/j82Q51XJyDJ75m0QAGntL1Wx6B//Xc0+4VPP/hlNHmw==", - "dev": true, - "dependencies": { - "@types/eslint-scope": "^3.7.0", - "@types/estree": "^0.0.46", - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/wasm-edit": "1.11.0", - "@webassemblyjs/wasm-parser": "1.11.0", - "acorn": "^8.0.4", - "browserslist": "^4.14.5", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.7.0", - "es-module-lexer": "^0.3.26", - "eslint-scope": "^5.1.1", - "events": "^3.2.0", - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.4", - "json-parse-better-errors": "^1.0.2", - "loader-runner": "^4.2.0", - "mime-types": "^2.1.27", - "neo-async": "^2.6.2", - "pkg-dir": "^5.0.0", - "schema-utils": "^3.0.0", - "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.1.1", - "watchpack": "^2.0.0", - "webpack-sources": "^2.1.1" - }, - "bin": { - "webpack": "bin/webpack.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependenciesMeta": { - "webpack-cli": { - "optional": true - } - } - }, - "node_modules/webpack-cli": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.4.0.tgz", - "integrity": "sha512-/Qh07CXfXEkMu5S8wEpjuaw2Zj/CC0hf/qbTDp6N8N7JjdGuaOjZ7kttz+zhuJO/J5m7alQEhNk9lsc4rC6xgQ==", - "dev": true, - "dependencies": { - "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^1.0.0", - "@webpack-cli/info": "^1.2.1", - "@webpack-cli/serve": "^1.2.2", - "colorette": "^1.2.1", - "commander": "^6.2.0", - "enquirer": "^2.3.6", - "execa": "^5.0.0", - "fastest-levenshtein": "^1.0.12", - "import-local": "^3.0.2", - "interpret": "^2.2.0", - "rechoir": "^0.7.0", - "v8-compile-cache": "^2.2.0", - "webpack-merge": "^5.7.3" - }, - "bin": { - "webpack-cli": "bin/cli.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "peerDependencies": { - "webpack": "4.x.x || 5.x.x" - }, - "peerDependenciesMeta": { - "@webpack-cli/generators": { - "optional": true - }, - "@webpack-cli/init": { - "optional": true - }, - "@webpack-cli/migrate": { - "optional": true - }, - "webpack-bundle-analyzer": { - "optional": true - }, - "webpack-dev-server": { - "optional": true - } - } - }, - "node_modules/webpack-cli/node_modules/commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, - "node_modules/webpack-cli/node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/webpack-cli/node_modules/execa": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz", - "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/webpack-cli/node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/webpack-cli/node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true, - "engines": { - "node": ">=10.17.0" - } - }, - "node_modules/webpack-cli/node_modules/is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/webpack-cli/node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "dependencies": { - "path-key": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/webpack-cli/node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/webpack-cli/node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/webpack-cli/node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/webpack-cli/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/webpack-merge": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.7.3.tgz", - "integrity": "sha512-6/JUQv0ELQ1igjGDzHkXbVDRxkfA57Zw7PfiupdLFJYrgFqY5ZP8xxbpp2lU3EPwYx89ht5Z/aDkD40hFCm5AA==", - "dev": true, - "dependencies": { - "clone-deep": "^4.0.1", - "wildcard": "^2.0.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/webpack-sources": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz", - "integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==", - "dev": true, - "dependencies": { - "source-list-map": "^2.0.1", - "source-map": "^0.6.1" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/webpack-sources/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/webpack/node_modules/acorn": { - "version": "8.2.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.2.4.tgz", - "integrity": "sha512-Ibt84YwBDDA890eDiDCEqcbwvHlBvzzDkU2cGBBDDI1QWT12jTiXIOn2CIw5KK4i6N5Z2HUxwYjzriDyqaqqZg==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/webpack/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/webpack/node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/webpack/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/webpack/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/webpack/node_modules/pkg-dir": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", - "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==", - "dev": true, - "dependencies": { - "find-up": "^5.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/whatwg-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", - "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==", - "dev": true - }, - "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/wildcard": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", - "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", - "dev": true - }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/compat-data": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.0.tgz", - "integrity": "sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q==", - "dev": true - }, - "@babel/core": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.10.tgz", - "integrity": "sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w==", - "dev": true, - "peer": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.10", - "@babel/helper-module-transforms": "^7.12.1", - "@babel/helpers": "^7.12.5", - "@babel/parser": "^7.12.10", - "@babel/template": "^7.12.7", - "@babel/traverse": "^7.12.10", - "@babel/types": "^7.12.10", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", - "json5": "^2.1.2", - "lodash": "^4.17.19", - "semver": "^5.4.1", - "source-map": "^0.5.0" - } - }, - "@babel/generator": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.11.tgz", - "integrity": "sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA==", - "dev": true, - "requires": { - "@babel/types": "^7.12.11", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } - }, - "@babel/helper-annotate-as-pure": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz", - "integrity": "sha512-7YXfX5wQ5aYM/BOlbSccHDbuXXFPxeoUmfWtz8le2yTkTZc+BxsiEnENFoi2SlmA8ewDkG2LgIMIVzzn2h8kfw==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - }, - "dependencies": { - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true + "name": "desmos-unlocked", + "version": "1.0.3", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "desmos-unlocked", + "version": "1.0.3", + "license": "MIT", + "devDependencies": { + "@babel/preset-env": "7.12.11", + "@babel/preset-typescript": "7.12.7", + "@types/chrome": "0.0.135", + "@types/sinon": "^10.0.0", + "@typescript-eslint/eslint-plugin": "4.17.0", + "@typescript-eslint/parser": "4.17.0", + "copy-webpack-plugin": "^8.1.1", + "cross-env": "7.0.3", + "eslint": "7.21.0", + "eslint-plugin-import": "2.22.1", + "git-hooks-plus": "1.0.1", + "prettier": "2.2.1", + "rimraf": "^3.0.2", + "sinon": "^10.0.0", + "terser-webpack-plugin": "5.1.1", + "ts-loader": "^9.1.1", + "typescript": "^4.2.4", + "web-ext-types": "3.2.1", + "webextension-polyfill": "^0.9.0", + "webpack": "5.18.0", + "webpack-cli": "4.4.0", + "webpack-merge": "5.7.3", + "whatwg-fetch": "3.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.10.4" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.0.tgz", + "integrity": "sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q==", + "dev": true + }, + "node_modules/@babel/core": { + "version": "7.12.10", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.10.tgz", + "integrity": "sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.10", + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helpers": "^7.12.5", + "@babel/parser": "^7.12.10", + "@babel/template": "^7.12.7", + "@babel/traverse": "^7.12.10", + "@babel/types": "^7.12.10", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.19", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.11.tgz", + "integrity": "sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.11", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz", + "integrity": "sha512-7YXfX5wQ5aYM/BOlbSccHDbuXXFPxeoUmfWtz8le2yTkTZc+BxsiEnENFoi2SlmA8ewDkG2LgIMIVzzn2h8kfw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/helper-annotate-as-pure/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/helper-annotate-as-pure/node_modules/@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.12.13.tgz", + "integrity": "sha512-CZOv9tGphhDRlVjVkAgm8Nhklm9RzSmWpX2my+t7Ua/KT616pEzXsQCjinzvkRvHWJ9itO4f296efroX23XCMA==", + "dev": true, + "dependencies": { + "@babel/helper-explode-assignable-expression": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/helper-builder-binary-assignment-operator-visitor/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/helper-builder-binary-assignment-operator-visitor/node_modules/@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.13.16", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz", + "integrity": "sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.13.15", + "@babel/helper-validator-option": "^7.12.17", + "browserslist": "^4.14.5", + "semver": "^6.3.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/@babel/helper-validator-option": { + "version": "7.12.17", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz", + "integrity": "sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw==", + "dev": true + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz", + "integrity": "sha512-hkL++rWeta/OVOBTRJc9a5Azh5mt5WgZUGAKMD8JM141YsE08K//bp1unBBieO6rUKkIPyUE0USQ30jAy3Sk1w==", + "dev": true, + "dependencies": { + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-member-expression-to-functions": "^7.12.1", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-replace-supers": "^7.12.1", + "@babel/helper-split-export-declaration": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.12.17", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.17.tgz", + "integrity": "sha512-p2VGmBu9oefLZ2nQpgnEnG0ZlRPvL8gAGvPUMQwUdaE8k49rOMuZpOwdQoy5qJf6K8jL3bcAMhVUlHAjIgJHUg==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.12.13", + "regexpu-core": "^4.7.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-explode-assignable-expression": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.13.0.tgz", + "integrity": "sha512-qS0peLTDP8kOisG1blKbaoBg/o9OSa1qoumMjTK5pM+KDTtpxpsiubnCGP34vK8BXGcb2M9eigwgvoJryrzwWA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.0" + } + }, + "node_modules/@babel/helper-explode-assignable-expression/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/helper-explode-assignable-expression/node_modules/@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz", + "integrity": "sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.12.10", + "@babel/template": "^7.12.7", + "@babel/types": "^7.12.11" + } + }, + "node_modules/@babel/helper-get-function-arity": { + "version": "7.12.10", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz", + "integrity": "sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.10" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.13.16", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.13.16.tgz", + "integrity": "sha512-1eMtTrXtrwscjcAeO4BVK+vvkxaLJSPFz1w1KLawz6HLNi9bPFGBNwwDyVfiu1Tv/vRRFYfoGaKhmAQPGPn5Wg==", + "dev": true, + "dependencies": { + "@babel/traverse": "^7.13.15", + "@babel/types": "^7.13.16" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.12.13" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz", + "integrity": "sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.7" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", + "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.5" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz", + "integrity": "sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/helper-module-imports": "^7.12.1", + "@babel/helper-replace-supers": "^7.12.1", + "@babel/helper-simple-access": "^7.12.1", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/helper-validator-identifier": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.12.1", + "@babel/types": "^7.12.1", + "lodash": "^4.17.19" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.12.10", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.10.tgz", + "integrity": "sha512-4tpbU0SrSTjjt65UMWSrUOPZTsgvPgGG4S8QSTNHacKzpS51IVWGDj0yCwyeZND/i+LSN2g/O63jEXEWm49sYQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.10" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "dev": true + }, + "node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.13.0.tgz", + "integrity": "sha512-pUQpFBE9JvC9lrQbpX0TmeNIy5s7GnZjna2lhhcHC7DzgBs6fWn722Y5cfwgrtrqc7NAJwMvOa0mKhq6XaE4jg==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.12.13", + "@babel/helper-wrap-function": "^7.13.0", + "@babel/types": "^7.13.0" + } + }, + "node_modules/@babel/helper-remap-async-to-generator/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/helper-remap-async-to-generator/node_modules/@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.11.tgz", + "integrity": "sha512-q+w1cqmhL7R0FNzth/PLLp2N+scXEK/L2AHbXUyydxp828F4FEa5WcVoqui9vFRiHDQErj9Zof8azP32uGVTRA==", + "dev": true, + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.12.7", + "@babel/helper-optimise-call-expression": "^7.12.10", + "@babel/traverse": "^7.12.10", + "@babel/types": "^7.12.11" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz", + "integrity": "sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/types": "^7.12.1" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.12.1.tgz", + "integrity": "sha512-Mf5AUuhG1/OCChOJ/HcADmvcHM42WJockombn8ATJG3OnyiSxBK/Mm5x78BQWvmtXZKHgbjdGL2kin/HOLlZGA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.1" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz", + "integrity": "sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.11" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", + "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "dev": true + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.11.tgz", + "integrity": "sha512-TBFCyj939mFSdeX7U7DDj32WtzYY7fDcalgq8v3fBZMNOJQNn7nOYzMaUCiPxPYfCup69mtIpqlKgMZLvQ8Xhw==", + "dev": true + }, + "node_modules/@babel/helper-wrap-function": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.13.0.tgz", + "integrity": "sha512-1UX9F7K3BS42fI6qd2A4BjKzgGjToscyZTdp1DjknHLCIvpgne6918io+aL5LXFcER/8QWiwpoY902pVEqgTXA==", + "dev": true, + "dependencies": { + "@babel/helper-function-name": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.0" + } + }, + "node_modules/@babel/helper-wrap-function/node_modules/@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.12.13" + } + }, + "node_modules/@babel/helper-wrap-function/node_modules/@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "node_modules/@babel/helper-wrap-function/node_modules/@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/helper-wrap-function/node_modules/@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/helper-wrap-function/node_modules/@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/helper-wrap-function/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/helper-wrap-function/node_modules/@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/helper-wrap-function/node_modules/@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/helper-wrap-function/node_modules/@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/helper-wrap-function/node_modules/@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "node_modules/@babel/helper-wrap-function/node_modules/@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", + "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" + } + }, + "node_modules/@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.11.tgz", + "integrity": "sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-proposal-async-generator-functions": { + "version": "7.13.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.15.tgz", + "integrity": "sha512-VapibkWzFeoa6ubXy/NgV5U2U4MVnUlvnx6wo1XhlsaTrLYWE0UFpDQsVrmn22q5CzeloqJ8gEMHSKxuee6ZdA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-remap-async-to-generator": "^7.13.0", + "@babel/plugin-syntax-async-generators": "^7.8.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-async-generator-functions/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-class-properties": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.13.0.tgz", + "integrity": "sha512-KnTDjFNC1g+45ka0myZNvSBFLhNCLN+GeGYLDEA8Oq7MZ6yMgfLoIRh86GRT0FjtJhZw8JyUskP9uvj5pHM9Zg==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.13.0", + "@babel/helper-plugin-utils": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.12.13" + } + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.1.tgz", + "integrity": "sha512-r8rsUahG4ywm0QpGcCrLaUSOuNAISR3IZCg4Fx05Ozq31aCUrQsTLH6KPxy0N5ULoQ4Sn9qjNdGNtbPWAC6hYg==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.12.13", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/plugin-proposal-dynamic-import": { + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.13.8.tgz", + "integrity": "sha512-ONWKj0H6+wIRCkZi9zSbZtE/r73uOhMVHh256ys0UzfM7I3d4n+spZNWjOnJv2gzopumP2Wxi186vI8N0Y2JyQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-dynamic-import/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-export-namespace-from": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.13.tgz", + "integrity": "sha512-INAgtFo4OnLN3Y/j0VwAgw3HDXcDtX+C/erMvWzuV9v71r7urb6iyMXu7eM9IgLr1ElLlOkaHjJ0SbCmdOQ3Iw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-export-namespace-from/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-json-strings": { + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.13.8.tgz", + "integrity": "sha512-w4zOPKUFPX1mgvTmL/fcEqy34hrQ1CRcGxdphBc6snDnnqJ47EZDIyop6IwXzAC8G916hsIuXB2ZMBCExC5k7Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-json-strings": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-json-strings/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-logical-assignment-operators": { + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.13.8.tgz", + "integrity": "sha512-aul6znYB4N4HGweImqKn59Su9RS8lbUIqxtXTOcAGtNIDczoEFv+l1EhmX8rUBp3G1jMjKJm8m0jXVp63ZpS4A==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-logical-assignment-operators/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.13.8.tgz", + "integrity": "sha512-iePlDPBn//UhxExyS9KyeYU7RM9WScAG+D3Hhno0PLJebAEpDZMocbDe64eqynhNAnwz/vZoL/q/QB2T1OH39A==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-nullish-coalescing-operator/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-numeric-separator": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.13.tgz", + "integrity": "sha512-O1jFia9R8BUCl3ZGB7eitaAPu62TXJRHn7rh+ojNERCFyqRwJMTmhz+tJ+k0CwI6CLjX/ee4qW74FSqlq9I35w==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-numeric-separator/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-object-rest-spread": { + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.13.8.tgz", + "integrity": "sha512-DhB2EuB1Ih7S3/IRX5AFVgZ16k3EzfRbq97CxAVI1KSYcW+lexV8VZb7G7L8zuPVSdQMRn0kiBpf/Yzu9ZKH0g==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.13.8", + "@babel/helper-compilation-targets": "^7.13.8", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-object-rest-spread/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-optional-catch-binding": { + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.13.8.tgz", + "integrity": "sha512-0wS/4DUF1CuTmGo+NiaHfHcVSeSLj5S3e6RivPTg/2k3wOv3jO35tZ6/ZWsQhQMvdgI7CwphjQa/ccarLymHVA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-optional-catch-binding/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-optional-chaining": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz", + "integrity": "sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-optional-chaining/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-private-methods": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.13.0.tgz", + "integrity": "sha512-MXyyKQd9inhx1kDYPkFRVOBXQ20ES8Pto3T7UZ92xj2mY0EVD8oAVzeyYuVfy/mxAdTSIayOvg+aVzcHV2bn6Q==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.13.0", + "@babel/helper-plugin-utils": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.12.13" + } + }, + "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.1.tgz", + "integrity": "sha512-r8rsUahG4ywm0QpGcCrLaUSOuNAISR3IZCg4Fx05Ozq31aCUrQsTLH6KPxy0N5ULoQ4Sn9qjNdGNtbPWAC6hYg==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.12.13", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/plugin-proposal-unicode-property-regex": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.13.tgz", + "integrity": "sha512-XyJmZidNfofEkqFV5VC/bLabGmO5QzenPO/YOfGuEbgU+2sSwMmio3YLb4WtBgcmmdwZHyVyv8on77IUjQ5Gvg==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.12.13", + "@babel/helper-plugin-utils": "^7.12.13" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-unicode-property-regex/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.1.tgz", + "integrity": "sha512-U40A76x5gTwmESz+qiqssqmeEsKvcSyvtgktrm0uzcARAmM9I1jR221f6Oq+GmHrcD+LvZDag1UTOTe2fL3TeA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.1.tgz", + "integrity": "sha512-i7ooMZFS+a/Om0crxZodrTzNEPJHZrlMVGMTEpFAj6rYY/bKCddB0Dk/YxfPuYXOopuhKk/e1jV6h+WUU9XN3A==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.12.1.tgz", + "integrity": "sha512-UZNEcCY+4Dp9yYRCAHrHDU+9ZXLYaY9MgBXSRLkB9WjYFRR6quJBumfVrEkUxrePPBwFcpWfNKXqVRQQtm7mMA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.13.0.tgz", + "integrity": "sha512-96lgJagobeVmazXFaDrbmCLQxBysKu7U6Do3mLsx27gf5Dk85ezysrs2BZUpXD703U/Su1xTBDxxar2oa4jAGg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-arrow-functions/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.13.0.tgz", + "integrity": "sha512-3j6E004Dx0K3eGmhxVJxwwI89CTJrce7lg3UrtFuDAVQ/2+SJ/h/aSFOeE6/n0WB1GsOffsJp6MnPQNQ8nmwhg==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-remap-async-to-generator": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator/node_modules/@babel/helper-module-imports": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-async-to-generator/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/plugin-transform-async-to-generator/node_modules/@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.12.13.tgz", + "integrity": "sha512-zNyFqbc3kI/fVpqwfqkg6RvBgFpC4J18aKKMmv7KdQ/1GgREapSJAykLMVNwfRGO3BtHj3YQZl8kxCXPcVMVeg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoped-functions/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.1.tgz", + "integrity": "sha512-2mQXd0zBrwfp0O1moWIhPpEeTKDvxyHcnma3JATVP1l+CctWBuot6OJG8LQ4DnBj4ZZPSmlb/fm4mu47EOAnVA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoping/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-classes": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.13.0.tgz", + "integrity": "sha512-9BtHCPUARyVH1oXGcSJD3YpsqRLROJx5ZNP6tN5vnk17N0SVf9WCtf8Nuh1CFmgByKKAIMstitKduoCmsaDK5g==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.12.13", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-replace-supers": "^7.13.0", + "@babel/helper-split-export-declaration": "^7.12.13", + "globals": "^11.1.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.13.0.tgz", + "integrity": "sha512-RRqTYTeZkZAz8WbieLTvKUEUxZlUTdmL5KGMyZj7FnMfLNKV4+r5549aORG/mgojRmFlQMJDUupwAMiF2Q7OUg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-computed-properties/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.13.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.17.tgz", + "integrity": "sha512-UAUqiLv+uRLO+xuBKKMEpC+t7YRNVRqBsWWq1yKXbBZBje/t3IXCiSinZhjn/DC3qzBfICeYd2EFGEbHsh5RLA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-destructuring/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.13.tgz", + "integrity": "sha512-foDrozE65ZFdUC2OfgeOCrEPTxdB3yjqxpXh8CH+ipd9CHd4s/iq81kcUpyH8ACGNEPdFqbtzfgzbT/ZGlbDeQ==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.12.13", + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-dotall-regex/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-duplicate-keys": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.12.13.tgz", + "integrity": "sha512-NfADJiiHdhLBW3pulJlJI2NB0t4cci4WTZ8FtdIuNc2+8pslXdPtRRAEWqUY+m9kNOk2eRYbTAOipAxlrOcwwQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-keys/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-exponentiation-operator": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.12.13.tgz", + "integrity": "sha512-fbUelkM1apvqez/yYx1/oICVnGo2KM5s63mhGylrmXUxK/IAXSIf87QIxVfZldWf4QsOafY6vV3bX8aMHSvNrA==", + "dev": true, + "dependencies": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.12.13", + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-exponentiation-operator/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.13.0.tgz", + "integrity": "sha512-IHKT00mwUVYE0zzbkDgNRP6SRzvfGCYsOxIRz8KsiaaHCcT9BWIkO+H9QRJseHBLOGBZkHUdHiqj6r0POsdytg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-for-of/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.12.13.tgz", + "integrity": "sha512-6K7gZycG0cmIwwF7uMK/ZqeCikCGVBdyP2J5SKNCXO5EOHcqi+z7Jwf8AmyDNcBgxET8DrEtCt/mPKPyAzXyqQ==", + "dev": true, + "dependencies": { + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/plugin-transform-literals": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.12.13.tgz", + "integrity": "sha512-FW+WPjSR7hiUxMcKqyNjP05tQ2kmBCdpEpZHY1ARm96tGQCCBvXKnpjILtDplUnJ/eHZ0lALLM+d2lMFSpYJrQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-literals/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-member-expression-literals": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.12.13.tgz", + "integrity": "sha512-kxLkOsg8yir4YeEPHLuO2tXP9R/gTjpuTOjshqSpELUN3ZAg2jfDnKUvzzJxObun38sw3wm4Uu69sX/zA7iRvg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-member-expression-literals/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-amd": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.0.tgz", + "integrity": "sha512-CF4c5LX4LQ03LebQxJ5JZes2OYjzBuk1TdiF7cG7d5dK4lAdw9NZmaxq5K/mouUdNeqwz3TNjnW6v01UqUNgpQ==", + "dev": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.14.0", + "@babel/helper-plugin-utils": "^7.13.0", + "babel-plugin-dynamic-import-node": "^2.3.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-module-imports": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-module-transforms": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", + "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-simple-access": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/helper-validator-identifier": "^7.14.0", + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-simple-access": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", + "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.0.tgz", + "integrity": "sha512-EX4QePlsTaRZQmw9BsoPeyh5OCtRGIhwfLquhxGp5e32w+dyL8htOcDwamlitmNFK6xBZYlygjdye9dbd9rUlQ==", + "dev": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.14.0", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-simple-access": "^7.13.12", + "babel-plugin-dynamic-import-node": "^2.3.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-module-imports": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-module-transforms": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", + "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-simple-access": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/helper-validator-identifier": "^7.14.0", + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-simple-access": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", + "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs": { + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.13.8.tgz", + "integrity": "sha512-hwqctPYjhM6cWvVIlOIe27jCIBgHCsdH2xCJVAYQm7V5yTMoilbVMi9f6wKg0rpQAOn6ZG4AOyvCqFF/hUh6+A==", + "dev": true, + "dependencies": { + "@babel/helper-hoist-variables": "^7.13.0", + "@babel/helper-module-transforms": "^7.13.0", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-validator-identifier": "^7.12.11", + "babel-plugin-dynamic-import-node": "^2.3.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-module-imports": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-module-transforms": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", + "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-simple-access": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/helper-validator-identifier": "^7.14.0", + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-module-transforms/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-simple-access": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", + "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/highlight/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/types/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-umd": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.0.tgz", + "integrity": "sha512-nPZdnWtXXeY7I87UZr9VlsWme3Y0cfFFE41Wbxz4bbaexAjNMInXPFUpRRUJ8NoMm0Cw+zxbqjdPmLhcjfazMw==", + "dev": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.14.0", + "@babel/helper-plugin-utils": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-module-imports": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-module-transforms": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", + "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-simple-access": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/helper-validator-identifier": "^7.14.0", + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-simple-access": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", + "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.13.tgz", + "integrity": "sha512-Xsm8P2hr5hAxyYblrfACXpQKdQbx4m2df9/ZZSQ8MAhsadw06+jW7s9zsSw6he+mJZXRlVMyEnVktJo4zjk1WA==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-new-target": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.12.13.tgz", + "integrity": "sha512-/KY2hbLxrG5GTQ9zzZSc3xWiOy379pIETEhbtzwZcw9rvuaVV4Fqy7BYGYOWZnaoXIQYbbJ0ziXLa/sKcGCYEQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-new-target/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-object-super": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.12.13.tgz", + "integrity": "sha512-JzYIcj3XtYspZDV8j9ulnoMPZZnF/Cj0LUxPOjR89BdBVx+zYJI9MdMIlUZjbXDX+6YVeS6I3e8op+qQ3BYBoQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13", + "@babel/helper-replace-supers": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/plugin-transform-parameters": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.13.0.tgz", + "integrity": "sha512-Jt8k/h/mIwE2JFEOb3lURoY5C85ETcYPnbuAJ96zRBzh1XHtQZfs62ChZ6EP22QlC8c7Xqr9q+e1SU5qttwwjw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-parameters/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-property-literals": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.12.13.tgz", + "integrity": "sha512-nqVigwVan+lR+g8Fj8Exl0UQX2kymtjcWfMOYM1vTYEKujeyv2SkMgazf2qNcK7l4SDiKyTA/nHCPqL4e2zo1A==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-property-literals/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-regenerator": { + "version": "7.13.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.13.15.tgz", + "integrity": "sha512-Bk9cOLSz8DiurcMETZ8E2YtIVJbFCPGW28DJWUakmyVWtQSm6Wsf0p4B4BfEr/eL2Nkhe/CICiUiMOCi1TPhuQ==", + "dev": true, + "dependencies": { + "regenerator-transform": "^0.14.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-reserved-words": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.12.13.tgz", + "integrity": "sha512-xhUPzDXxZN1QfiOy/I5tyye+TRz6lA7z6xaT4CLOjPRMVg1ldRf0LHw0TDBpYL4vG78556WuHdyO9oi5UmzZBg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-reserved-words/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-shorthand-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.12.13.tgz", + "integrity": "sha512-xpL49pqPnLtf0tVluuqvzWIgLEhuPpZzvs2yabUHSKRNlN7ScYU7aMlmavOeyXJZKgZKQRBlh8rHbKiJDraTSw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-shorthand-properties/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-spread": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.13.0.tgz", + "integrity": "sha512-V6vkiXijjzYeFmQTr3dBxPtZYLPcUfY34DebOU27jIl2M/Y8Egm52Hw82CSjjPqd54GTlJs5x+CR7HeNr24ckg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-spread/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-sticky-regex": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.13.tgz", + "integrity": "sha512-Jc3JSaaWT8+fr7GRvQP02fKDsYk4K/lYwWq38r/UGfaxo89ajud321NH28KRQ7xy1Ybc0VUE5Pz8psjNNDUglg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-sticky-regex/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-template-literals": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.13.0.tgz", + "integrity": "sha512-d67umW6nlfmr1iehCcBv69eSUSySk1EsIS8aTDX4Xo9qajAh6mYtcl4kJrBkGXuxZPEgVr7RVfAvNW6YQkd4Mw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-template-literals/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-typeof-symbol": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.13.tgz", + "integrity": "sha512-eKv/LmUJpMnu4npgfvs3LiHhJua5fo/CysENxa45YCQXZwKnGCQKAg87bvoqSW1fFT+HA32l03Qxsm8ouTY3ZQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typeof-symbol/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-typescript": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.12.1.tgz", + "integrity": "sha512-VrsBByqAIntM+EYMqSm59SiMEf7qkmI9dqMt6RbD/wlwueWmYcI0FFK5Fj47pP6DRZm+3teXjosKlwcZJ5lIMw==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-typescript": "^7.12.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-escapes": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.12.13.tgz", + "integrity": "sha512-0bHEkdwJ/sN/ikBHfSmOXPypN/beiGqjo+o4/5K+vxEFNPRPdImhviPakMKG4x96l85emoa0Z6cDflsdBusZbw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-escapes/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-unicode-regex": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.12.13.tgz", + "integrity": "sha512-mDRzSNY7/zopwisPZ5kM9XKCfhchqIYwAKRERtEnhYscZB79VRekuRSoYbN0+KVe3y8+q1h6A4svXtP7N+UoCA==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.12.13", + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-regex/node_modules/@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "node_modules/@babel/preset-env": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.12.11.tgz", + "integrity": "sha512-j8Tb+KKIXKYlDBQyIOy4BLxzv1NUOwlHfZ74rvW+Z0Gp4/cI2IMDPBWAgWceGcE7aep9oL/0K9mlzlMGxA8yNw==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.12.7", + "@babel/helper-compilation-targets": "^7.12.5", + "@babel/helper-module-imports": "^7.12.5", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-validator-option": "^7.12.11", + "@babel/plugin-proposal-async-generator-functions": "^7.12.1", + "@babel/plugin-proposal-class-properties": "^7.12.1", + "@babel/plugin-proposal-dynamic-import": "^7.12.1", + "@babel/plugin-proposal-export-namespace-from": "^7.12.1", + "@babel/plugin-proposal-json-strings": "^7.12.1", + "@babel/plugin-proposal-logical-assignment-operators": "^7.12.1", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1", + "@babel/plugin-proposal-numeric-separator": "^7.12.7", + "@babel/plugin-proposal-object-rest-spread": "^7.12.1", + "@babel/plugin-proposal-optional-catch-binding": "^7.12.1", + "@babel/plugin-proposal-optional-chaining": "^7.12.7", + "@babel/plugin-proposal-private-methods": "^7.12.1", + "@babel/plugin-proposal-unicode-property-regex": "^7.12.1", + "@babel/plugin-syntax-async-generators": "^7.8.0", + "@babel/plugin-syntax-class-properties": "^7.12.1", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.0", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.0", + "@babel/plugin-syntax-top-level-await": "^7.12.1", + "@babel/plugin-transform-arrow-functions": "^7.12.1", + "@babel/plugin-transform-async-to-generator": "^7.12.1", + "@babel/plugin-transform-block-scoped-functions": "^7.12.1", + "@babel/plugin-transform-block-scoping": "^7.12.11", + "@babel/plugin-transform-classes": "^7.12.1", + "@babel/plugin-transform-computed-properties": "^7.12.1", + "@babel/plugin-transform-destructuring": "^7.12.1", + "@babel/plugin-transform-dotall-regex": "^7.12.1", + "@babel/plugin-transform-duplicate-keys": "^7.12.1", + "@babel/plugin-transform-exponentiation-operator": "^7.12.1", + "@babel/plugin-transform-for-of": "^7.12.1", + "@babel/plugin-transform-function-name": "^7.12.1", + "@babel/plugin-transform-literals": "^7.12.1", + "@babel/plugin-transform-member-expression-literals": "^7.12.1", + "@babel/plugin-transform-modules-amd": "^7.12.1", + "@babel/plugin-transform-modules-commonjs": "^7.12.1", + "@babel/plugin-transform-modules-systemjs": "^7.12.1", + "@babel/plugin-transform-modules-umd": "^7.12.1", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.12.1", + "@babel/plugin-transform-new-target": "^7.12.1", + "@babel/plugin-transform-object-super": "^7.12.1", + "@babel/plugin-transform-parameters": "^7.12.1", + "@babel/plugin-transform-property-literals": "^7.12.1", + "@babel/plugin-transform-regenerator": "^7.12.1", + "@babel/plugin-transform-reserved-words": "^7.12.1", + "@babel/plugin-transform-shorthand-properties": "^7.12.1", + "@babel/plugin-transform-spread": "^7.12.1", + "@babel/plugin-transform-sticky-regex": "^7.12.7", + "@babel/plugin-transform-template-literals": "^7.12.1", + "@babel/plugin-transform-typeof-symbol": "^7.12.10", + "@babel/plugin-transform-unicode-escapes": "^7.12.1", + "@babel/plugin-transform-unicode-regex": "^7.12.1", + "@babel/preset-modules": "^0.1.3", + "@babel/types": "^7.12.11", + "core-js-compat": "^3.8.0", + "semver": "^5.5.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-modules": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.4.tgz", + "integrity": "sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-typescript": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.12.7.tgz", + "integrity": "sha512-nOoIqIqBmHBSEgBXWR4Dv/XBehtIFcw9PqZw6rFYuKrzsZmOQm3PR5siLBnKZFEsDb03IegG8nSjU/iXXXYRmw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-validator-option": "^7.12.1", + "@babel/plugin-transform-typescript": "^7.12.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.0.tgz", + "integrity": "sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA==", + "dev": true, + "dependencies": { + "regenerator-runtime": "^0.13.4" + } + }, + "node_modules/@babel/template": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz", + "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.12.7", + "@babel/types": "^7.12.7" + } + }, + "node_modules/@babel/traverse": { + "version": "7.12.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.10.tgz", + "integrity": "sha512-6aEtf0IeRgbYWzta29lePeYSk+YAFIC3kyqESeft8o5CkFlYIMX+EQDDWEiAQ9LHOA3d0oHdgrSsID/CKqXJlg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.10", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/parser": "^7.12.10", + "@babel/types": "^7.12.10", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.19" + } + }, + "node_modules/@babel/types": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.11.tgz", + "integrity": "sha512-ukA9SQtKThINm++CX1CwmliMrE54J6nIYB5XTwL5f/CLFW9owfls+YSU8tVW15RQ2w+a3fSbPjC6HdQNtWZkiA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.12.11", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@discoveryjs/json-ext": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz", + "integrity": "sha512-HyYEUDeIj5rRQU2Hk5HTB2uHsbRQpF70nvMhVzi+VJR0X+xNEhjPui4/kBf3VeH/wqD28PT4sVOm8qqLjBrSZg==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", + "integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "dependencies": { + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", + "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.4", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", + "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", + "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.4", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@sinonjs/commons": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.1.tgz", + "integrity": "sha512-892K+kWUUi3cl+LlqEWIDrhvLgdL79tECi8JZUyq6IviKy/DNhuzCRlbHUjxK89f4ypPMMaFnFuR9Ie6DoIMsw==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", + "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^1.7.0" + } + }, + "node_modules/@sinonjs/samsam": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.3.1.tgz", + "integrity": "sha512-1Hc0b1TtyfBu8ixF/tpfSHTVWKwCBLY4QJbkgnE7HcwyvT2xArDxb4K7dMgqRm3szI+LJbzmW/s4xxEhv6hwDg==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^1.6.0", + "lodash.get": "^4.4.2", + "type-detect": "^4.0.8" + } + }, + "node_modules/@sinonjs/text-encoding": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", + "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", + "dev": true + }, + "node_modules/@types/chrome": { + "version": "0.0.135", + "resolved": "https://registry.npmjs.org/@types/chrome/-/chrome-0.0.135.tgz", + "integrity": "sha512-SczB5P5mIgQWHAeiimlYg5VFvuQKCw4Q5cAzVD7II1Czf4U0222jb3mTHUd1qM0BRJ/kPtzybBde+Zy2sdx/LA==", + "dev": true, + "dependencies": { + "@types/filesystem": "*", + "@types/har-format": "*" + } + }, + "node_modules/@types/eslint": { + "version": "7.2.10", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.10.tgz", + "integrity": "sha512-kUEPnMKrqbtpCq/KTaGFFKAcz6Ethm2EjCoKIDaCmfRBWLbFuTcOJfTlorwbnboXBzahqWLgUp1BQeKHiJzPUQ==", + "dev": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.0.tgz", + "integrity": "sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw==", + "dev": true, + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "node_modules/@types/estree": { + "version": "0.0.46", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.46.tgz", + "integrity": "sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg==", + "dev": true + }, + "node_modules/@types/filesystem": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@types/filesystem/-/filesystem-0.0.30.tgz", + "integrity": "sha512-NCoRgmGmLpTT9VFL6Bb6z0jQuqI3d0E5FGl7M0JOv/J5RQYo9s5aOItPYnpckx9MbYQk1APLXcF8f20Vqnf2yA==", + "dev": true, + "dependencies": { + "@types/filewriter": "*" + } + }, + "node_modules/@types/filewriter": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/filewriter/-/filewriter-0.0.29.tgz", + "integrity": "sha512-BsPXH/irW0ht0Ji6iw/jJaK8Lj3FJemon2gvEqHKpCdDCeemHa+rI3WBGq5z7cDMZgoLjY40oninGxqk+8NzNQ==", + "dev": true + }, + "node_modules/@types/har-format": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@types/har-format/-/har-format-1.2.5.tgz", + "integrity": "sha512-IG8AE1m2pWtPqQ7wXhFhy6Q59bwwnLwO36v5Rit2FrbXCIp8Sk8E2PfUCreyrdo17STwFSKDAkitVuVYbpEHvQ==", + "dev": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", + "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", + "dev": true + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, + "node_modules/@types/node": { + "version": "14.14.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.14.tgz", + "integrity": "sha512-UHnOPWVWV1z+VV8k6L1HhG7UbGBgIdghqF3l9Ny9ApPghbjICXkUJSd/b9gOgQfjM1r+37cipdw/HJ3F6ICEnQ==", + "dev": true + }, + "node_modules/@types/sinon": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.0.tgz", + "integrity": "sha512-jDZ55oCKxqlDmoTBBbBBEx+N8ZraUVhggMZ9T5t+6/Dh8/4NiOjSUfpLrPiEwxQDlAe3wpAkoXhWvE6LibtsMQ==", + "dev": true, + "dependencies": { + "@sinonjs/fake-timers": "^7.0.4" + } + }, + "node_modules/@types/sinon/node_modules/@sinonjs/fake-timers": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-7.0.5.tgz", + "integrity": "sha512-fUt6b15bjV/VW93UP5opNXJxdwZSbK1EdiwnhN7XrQrcpaOhMJpZ/CjwFpM3THpxwA+YviBUJKSuEqKlCK5alw==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^1.7.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.17.0.tgz", + "integrity": "sha512-/fKFDcoHg8oNan39IKFOb5WmV7oWhQe1K6CDaAVfJaNWEhmfqlA24g+u1lqU5bMH7zuNasfMId4LaYWC5ijRLw==", + "dev": true, + "dependencies": { + "@typescript-eslint/experimental-utils": "4.17.0", + "@typescript-eslint/scope-manager": "4.17.0", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "lodash": "^4.17.15", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^4.0.0", + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/experimental-utils": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.17.0.tgz", + "integrity": "sha512-ZR2NIUbnIBj+LGqCFGQ9yk2EBQrpVVFOh9/Kd0Lm6gLpSAcCuLLe5lUCibKGCqyH9HPwYC0GIJce2O1i8VYmWA==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/scope-manager": "4.17.0", + "@typescript-eslint/types": "4.17.0", + "@typescript-eslint/typescript-estree": "4.17.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.17.0.tgz", + "integrity": "sha512-KYdksiZQ0N1t+6qpnl6JeK9ycCFprS9xBAiIrw4gSphqONt8wydBw4BXJi3C11ywZmyHulvMaLjWsxDjUSDwAw==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "4.17.0", + "@typescript-eslint/types": "4.17.0", + "@typescript-eslint/typescript-estree": "4.17.0", + "debug": "^4.1.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.17.0.tgz", + "integrity": "sha512-OJ+CeTliuW+UZ9qgULrnGpPQ1bhrZNFpfT/Bc0pzNeyZwMik7/ykJ0JHnQ7krHanFN9wcnPK89pwn84cRUmYjw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "4.17.0", + "@typescript-eslint/visitor-keys": "4.17.0" + }, + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.17.0.tgz", + "integrity": "sha512-RN5z8qYpJ+kXwnLlyzZkiJwfW2AY458Bf8WqllkondQIcN2ZxQowAToGSd9BlAUZDB5Ea8I6mqL2quGYCLT+2g==", + "dev": true, + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.17.0.tgz", + "integrity": "sha512-lRhSFIZKUEPPWpWfwuZBH9trYIEJSI0vYsrxbvVvNyIUDoKWaklOAelsSkeh3E2VBSZiNe9BZ4E5tYBZbUczVQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "4.17.0", + "@typescript-eslint/visitor-keys": "4.17.0", + "debug": "^4.1.1", + "globby": "^11.0.1", + "is-glob": "^4.0.1", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.17.0.tgz", + "integrity": "sha512-WfuMN8mm5SSqXuAr9NM+fItJ0SVVphobWYkWOwQ1odsfC014Vdxk/92t4JwS1Q6fCA/ABfCKpa3AVtpUKTNKGQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "4.17.0", + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.0.tgz", + "integrity": "sha512-kX2W49LWsbthrmIRMbQZuQDhGtjyqXfEmmHyEi4XWnSZtPmxY0+3anPIzsnRb45VH/J55zlOfWvZuY47aJZTJg==", + "dev": true, + "dependencies": { + "@webassemblyjs/helper-numbers": "1.11.0", + "@webassemblyjs/helper-wasm-bytecode": "1.11.0" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.0.tgz", + "integrity": "sha512-Q/aVYs/VnPDVYvsCBL/gSgwmfjeCb4LW8+TMrO3cSzJImgv8lxxEPM2JA5jMrivE7LSz3V+PFqtMbls3m1exDA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.0.tgz", + "integrity": "sha512-baT/va95eXiXb2QflSx95QGT5ClzWpGaa8L7JnJbgzoYeaA27FCvuBXU758l+KXWRndEmUXjP0Q5fibhavIn8w==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.0.tgz", + "integrity": "sha512-u9HPBEl4DS+vA8qLQdEQ6N/eJQ7gT7aNvMIo8AAWvAl/xMrcOSiI2M0MAnMCy3jIFke7bEee/JwdX1nUpCtdyA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.0.tgz", + "integrity": "sha512-DhRQKelIj01s5IgdsOJMKLppI+4zpmcMQ3XboFPLwCpSNH6Hqo1ritgHgD0nqHeSYqofA6aBN/NmXuGjM1jEfQ==", + "dev": true, + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.11.0", + "@webassemblyjs/helper-api-error": "1.11.0", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.0.tgz", + "integrity": "sha512-MbmhvxXExm542tWREgSFnOVo07fDpsBJg3sIl6fSp9xuu75eGz5lz31q7wTLffwL3Za7XNRCMZy210+tnsUSEA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.0.tgz", + "integrity": "sha512-3Eb88hcbfY/FCukrg6i3EH8H2UsD7x8Vy47iVJrP967A9JGqgBVL9aH71SETPx1JrGsOUVLo0c7vMCN22ytJew==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/helper-buffer": "1.11.0", + "@webassemblyjs/helper-wasm-bytecode": "1.11.0", + "@webassemblyjs/wasm-gen": "1.11.0" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.0.tgz", + "integrity": "sha512-KXzOqpcYQwAfeQ6WbF6HXo+0udBNmw0iXDmEK5sFlmQdmND+tr773Ti8/5T/M6Tl/413ArSJErATd8In3B+WBA==", + "dev": true, + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.0.tgz", + "integrity": "sha512-aqbsHa1mSQAbeeNcl38un6qVY++hh8OpCOzxhixSYgbRfNWcxJNJQwe2rezK9XEcssJbbWIkblaJRwGMS9zp+g==", + "dev": true, + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.0.tgz", + "integrity": "sha512-A/lclGxH6SpSLSyFowMzO/+aDEPU4hvEiooCMXQPcQFPPJaYcPQNKGOCLUySJsYJ4trbpr+Fs08n4jelkVTGVw==", + "dev": true + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.0.tgz", + "integrity": "sha512-JHQ0damXy0G6J9ucyKVXO2j08JVJ2ntkdJlq1UTiUrIgfGMmA7Ik5VdC/L8hBK46kVJgujkBIoMtT8yVr+yVOQ==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/helper-buffer": "1.11.0", + "@webassemblyjs/helper-wasm-bytecode": "1.11.0", + "@webassemblyjs/helper-wasm-section": "1.11.0", + "@webassemblyjs/wasm-gen": "1.11.0", + "@webassemblyjs/wasm-opt": "1.11.0", + "@webassemblyjs/wasm-parser": "1.11.0", + "@webassemblyjs/wast-printer": "1.11.0" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.0.tgz", + "integrity": "sha512-BEUv1aj0WptCZ9kIS30th5ILASUnAPEvE3tVMTrItnZRT9tXCLW2LEXT8ezLw59rqPP9klh9LPmpU+WmRQmCPQ==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/helper-wasm-bytecode": "1.11.0", + "@webassemblyjs/ieee754": "1.11.0", + "@webassemblyjs/leb128": "1.11.0", + "@webassemblyjs/utf8": "1.11.0" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.0.tgz", + "integrity": "sha512-tHUSP5F4ywyh3hZ0+fDQuWxKx3mJiPeFufg+9gwTpYp324mPCQgnuVKwzLTZVqj0duRDovnPaZqDwoyhIO8kYg==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/helper-buffer": "1.11.0", + "@webassemblyjs/wasm-gen": "1.11.0", + "@webassemblyjs/wasm-parser": "1.11.0" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.0.tgz", + "integrity": "sha512-6L285Sgu9gphrcpDXINvm0M9BskznnzJTE7gYkjDbxET28shDqp27wpruyx3C2S/dvEwiigBwLA1cz7lNUi0kw==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/helper-api-error": "1.11.0", + "@webassemblyjs/helper-wasm-bytecode": "1.11.0", + "@webassemblyjs/ieee754": "1.11.0", + "@webassemblyjs/leb128": "1.11.0", + "@webassemblyjs/utf8": "1.11.0" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.0.tgz", + "integrity": "sha512-Fg5OX46pRdTgB7rKIUojkh9vXaVN6sGYCnEiJN1GYkb0RPwShZXp6KTDqmoMdQPKhcroOXh3fEzmkWmCYaKYhQ==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.0", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webpack-cli/configtest": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.3.tgz", + "integrity": "sha512-WQs0ep98FXX2XBAfQpRbY0Ma6ADw8JR6xoIkaIiJIzClGOMqVRvPCWqndTxf28DgFopWan0EKtHtg/5W1h0Zkw==", + "dev": true, + "peerDependencies": { + "webpack": "4.x.x || 5.x.x", + "webpack-cli": "4.x.x" + } + }, + "node_modules/@webpack-cli/info": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.2.4.tgz", + "integrity": "sha512-ogE2T4+pLhTTPS/8MM3IjHn0IYplKM4HbVNMCWA9N4NrdPzunwenpCsqKEXyejMfRu6K8mhauIPYf8ZxWG5O6g==", + "dev": true, + "dependencies": { + "envinfo": "^7.7.3" + }, + "peerDependencies": { + "webpack-cli": "4.x.x" + } + }, + "node_modules/@webpack-cli/serve": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.4.0.tgz", + "integrity": "sha512-xgT/HqJ+uLWGX+Mzufusl3cgjAcnqYYskaB7o0vRcwOEfuu6hMzSILQpnIzFMGsTaeaX4Nnekl+6fadLbl1/Vg==", + "dev": true, + "peerDependencies": { + "webpack-cli": "4.x.x" + }, + "peerDependenciesMeta": { + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/array-includes": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz", + "integrity": "sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.2", + "get-intrinsic": "^1.1.1", + "is-string": "^1.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", + "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-dynamic-import-node": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", + "dev": true, + "dependencies": { + "object.assign": "^4.1.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", + "dev": true, + "dependencies": { + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + } + }, + "node_modules/buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001223", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001223.tgz", + "integrity": "sha512-k/RYs6zc/fjbxTjaWZemeSmOjO0JJV+KguOBA3NwPup8uzxM1cMhR2BD9XmO86GuqaqTCO8CgkgH9Rz//vdDiA==", + "dev": true + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chrome-trace-event": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "dev": true, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/colorette": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "peer": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/copy-webpack-plugin": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-8.1.1.tgz", + "integrity": "sha512-rYM2uzRxrLRpcyPqGceRBDpxxUV8vcDqIKxAUKfcnFpcrPxT5+XvhTxv7XLjo5AvEJFPdAE3zCogG2JVahqgSQ==", + "dev": true, + "dependencies": { + "fast-glob": "^3.2.5", + "glob-parent": "^5.1.1", + "globby": "^11.0.3", + "normalize-path": "^3.0.0", + "p-limit": "^3.1.0", + "schema-utils": "^3.0.0", + "serialize-javascript": "^5.0.1" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + } + }, + "node_modules/copy-webpack-plugin/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/core-js-compat": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.12.0.tgz", + "integrity": "sha512-vvaN8EOvYBEjrr+MN3vCKrMNc/xdYZI+Rt/uPMROi4T5Hj8Fz6TiPQm2mrB9aZoQVW1lCFHYmMrv99aUct9mkg==", + "dev": true, + "dependencies": { + "browserslist": "^4.16.6", + "semver": "7.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/core-js-compat/node_modules/semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, + "node_modules/cross-env/node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cross-env/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cross-env/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cross-env/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cross-env/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "node_modules/define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "dependencies": { + "object-keys": "^1.0.12" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.3.727", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.727.tgz", + "integrity": "sha512-Mfz4FIB4FSvEwBpDfdipRIrwd6uo8gUDoRDF4QEYb4h4tSuI3ov594OrjU6on042UlFHouIJpClDODGkPcBSbg==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/enhanced-resolve": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.0.tgz", + "integrity": "sha512-Sl3KRpJA8OpprrtaIswVki3cWPiPKxXuFxJXBp+zNb6s6VwNWwFRUdtmzd2ReUut8n+sCPx7QCtQ7w5wfJhSgQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "dev": true, + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0.tgz", + "integrity": "sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.2", + "is-callable": "^1.2.3", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.2", + "is-string": "^1.0.5", + "object-inspect": "^1.9.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.4", + "string.prototype.trimstart": "^1.0.4", + "unbox-primitive": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-module-lexer": { + "version": "0.3.26", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.3.26.tgz", + "integrity": "sha512-Va0Q/xqtrss45hWzP8CZJwzGSZJjDM5/MJRE3IXXnUCcVLElR9BRaE9F62BopysASyc4nM3uwhSW7FFB9nlWAA==", + "dev": true + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.21.0.tgz", + "integrity": "sha512-W2aJbXpMNofUp0ztQaF40fveSsJBjlSCSWpy//gzfTvwC+USs/nceBrKmlJOiM8r1bLwP2EuYkCqArn/6QTIgg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.20", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.4", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", + "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "dev": true, + "dependencies": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/eslint-module-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "dev": true, + "dependencies": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/eslint-module-utils/node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/eslint-module-utils/node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "dependencies": { + "find-up": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", + "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.4", + "eslint-module-utils": "^2.6.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.1", + "read-pkg-up": "^2.0.0", + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "dependencies": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/eslint-plugin-import/node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "dependencies": { + "pify": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "dependencies": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "dependencies": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/eslint/node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/eslint/node_modules/globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "dependencies": { + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/eslint/node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/eslint/node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/eslint/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/eslint/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/eslint/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "dependencies": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", + "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "node_modules/fastest-levenshtein": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", + "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", + "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "dev": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/git-hooks-plus": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/git-hooks-plus/-/git-hooks-plus-1.0.1.tgz", + "integrity": "sha512-IeIEuXySE+EklJieSIXLoFGLuF5ERutODXZz3UCiL1JAjpvZKNyl9j00iF67i5yfX3sKepS1AHN9d3KmUxgWnw==", + "dev": true, + "hasInstallScript": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/globby": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz", + "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-bigints": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", + "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/import-local": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", + "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", + "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/interpret": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", + "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "node_modules/is-bigint": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz", + "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.0.tgz", + "integrity": "sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", + "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", + "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.3.tgz", + "integrity": "sha512-tDpEUInNcy2Yw3lNSepK3Wdw1RnXLcIVienz6Ou631Acl15cJyRWK4dgA1vCmOEgIbtOV0W7MHg+AR2Gdg1NXQ==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", + "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-regex": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz", + "integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-symbols": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jest-worker": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "dev": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/jest-worker/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "node_modules/json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "peer": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/just-extend": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", + "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", + "dev": true + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/load-json-file/node_modules/parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "dependencies": { + "error-ex": "^1.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/load-json-file/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/loader-runner": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", + "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", + "dev": true, + "engines": { + "node": ">=6.11.5" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "node_modules/lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, + "node_modules/lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "dev": true + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } }, - "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.12.13.tgz", - "integrity": "sha512-CZOv9tGphhDRlVjVkAgm8Nhklm9RzSmWpX2my+t7Ua/KT616pEzXsQCjinzvkRvHWJ9itO4f296efroX23XCMA==", - "dev": true, - "requires": { - "@babel/helper-explode-assignable-expression": "^7.12.13", - "@babel/types": "^7.12.13" - }, - "dependencies": { - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true + "node_modules/micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "dependencies": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + }, + "engines": { + "node": ">=8" + } }, - "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/helper-compilation-targets": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz", - "integrity": "sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.13.15", - "@babel/helper-validator-option": "^7.12.17", - "browserslist": "^4.14.5", - "semver": "^6.3.0" - }, - "dependencies": { - "@babel/helper-validator-option": { - "version": "7.12.17", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz", - "integrity": "sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw==", - "dev": true + "node_modules/mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "@babel/helper-create-class-features-plugin": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz", - "integrity": "sha512-hkL++rWeta/OVOBTRJc9a5Azh5mt5WgZUGAKMD8JM141YsE08K//bp1unBBieO6rUKkIPyUE0USQ30jAy3Sk1w==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-member-expression-to-functions": "^7.12.1", - "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/helper-replace-supers": "^7.12.1", - "@babel/helper-split-export-declaration": "^7.10.4" - } - }, - "@babel/helper-create-regexp-features-plugin": { - "version": "7.12.17", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.17.tgz", - "integrity": "sha512-p2VGmBu9oefLZ2nQpgnEnG0ZlRPvL8gAGvPUMQwUdaE8k49rOMuZpOwdQoy5qJf6K8jL3bcAMhVUlHAjIgJHUg==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.12.13", - "regexpu-core": "^4.7.1" - } - }, - "@babel/helper-explode-assignable-expression": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.13.0.tgz", - "integrity": "sha512-qS0peLTDP8kOisG1blKbaoBg/o9OSa1qoumMjTK5pM+KDTtpxpsiubnCGP34vK8BXGcb2M9eigwgvoJryrzwWA==", - "dev": true, - "requires": { - "@babel/types": "^7.13.0" - }, - "dependencies": { - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true + "node_modules/mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "dev": true, + "dependencies": { + "mime-db": "1.44.0" + }, + "engines": { + "node": ">= 0.6" + } }, - "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/helper-function-name": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz", - "integrity": "sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.12.10", - "@babel/template": "^7.12.7", - "@babel/types": "^7.12.11" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz", - "integrity": "sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag==", - "dev": true, - "requires": { - "@babel/types": "^7.12.10" - } - }, - "@babel/helper-hoist-variables": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.13.16.tgz", - "integrity": "sha512-1eMtTrXtrwscjcAeO4BVK+vvkxaLJSPFz1w1KLawz6HLNi9bPFGBNwwDyVfiu1Tv/vRRFYfoGaKhmAQPGPn5Wg==", - "dev": true, - "requires": { - "@babel/traverse": "^7.13.15", - "@babel/types": "^7.13.16" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.12.13" - } + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } }, - "@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "requires": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } }, - "@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } + "node_modules/minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/nise": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", + "integrity": "sha512-eQMEmGN/8arp0xsvGoQ+B1qvSkR73B1nWSCh7nOt5neMCtwcQVYQGdzQMhcNscktTsWB54xnlSQFzOAPJD8nXA==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^1.7.0", + "@sinonjs/fake-timers": "^6.0.0", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "path-to-regexp": "^1.7.0" + } }, - "@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "node_modules/node-releases": { + "version": "1.1.71", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.71.tgz", + "integrity": "sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg==", + "dev": true + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } }, - "@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true + "node_modules/object-inspect": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.2.tgz", + "integrity": "sha512-gz58rdPpadwztRrPjZE9DZLOABUpTGdcANUgOwBFO1C+HZZhePoP83M65WGDmbpwFYJSWqavbl4SgDn4k8RYTA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } }, - "@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true + "node_modules/object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } + "node_modules/object.values": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz", + "integrity": "sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.2", + "has": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } }, - "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/helper-member-expression-to-functions": { - "version": "7.12.7", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz", - "integrity": "sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw==", - "dev": true, - "requires": { - "@babel/types": "^7.12.7" - } - }, - "@babel/helper-module-imports": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", - "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", - "dev": true, - "requires": { - "@babel/types": "^7.12.5" - } - }, - "@babel/helper-module-transforms": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz", - "integrity": "sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w==", - "dev": true, - "peer": true, - "requires": { - "@babel/helper-module-imports": "^7.12.1", - "@babel/helper-replace-supers": "^7.12.1", - "@babel/helper-simple-access": "^7.12.1", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/helper-validator-identifier": "^7.10.4", - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.1", - "@babel/types": "^7.12.1", - "lodash": "^4.17.19" - } - }, - "@babel/helper-optimise-call-expression": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.10.tgz", - "integrity": "sha512-4tpbU0SrSTjjt65UMWSrUOPZTsgvPgGG4S8QSTNHacKzpS51IVWGDj0yCwyeZND/i+LSN2g/O63jEXEWm49sYQ==", - "dev": true, - "requires": { - "@babel/types": "^7.12.10" - } - }, - "@babel/helper-plugin-utils": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", - "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", - "dev": true - }, - "@babel/helper-remap-async-to-generator": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.13.0.tgz", - "integrity": "sha512-pUQpFBE9JvC9lrQbpX0TmeNIy5s7GnZjna2lhhcHC7DzgBs6fWn722Y5cfwgrtrqc7NAJwMvOa0mKhq6XaE4jg==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.12.13", - "@babel/helper-wrap-function": "^7.13.0", - "@babel/types": "^7.13.0" - }, - "dependencies": { - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/helper-replace-supers": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.11.tgz", - "integrity": "sha512-q+w1cqmhL7R0FNzth/PLLp2N+scXEK/L2AHbXUyydxp828F4FEa5WcVoqui9vFRiHDQErj9Zof8azP32uGVTRA==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.12.7", - "@babel/helper-optimise-call-expression": "^7.12.10", - "@babel/traverse": "^7.12.10", - "@babel/types": "^7.12.11" - } - }, - "@babel/helper-simple-access": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz", - "integrity": "sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA==", - "dev": true, - "peer": true, - "requires": { - "@babel/types": "^7.12.1" - } - }, - "@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.12.1.tgz", - "integrity": "sha512-Mf5AUuhG1/OCChOJ/HcADmvcHM42WJockombn8ATJG3OnyiSxBK/Mm5x78BQWvmtXZKHgbjdGL2kin/HOLlZGA==", - "dev": true, - "requires": { - "@babel/types": "^7.12.1" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz", - "integrity": "sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g==", - "dev": true, - "requires": { - "@babel/types": "^7.12.11" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "dev": true - }, - "@babel/helper-validator-option": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.11.tgz", - "integrity": "sha512-TBFCyj939mFSdeX7U7DDj32WtzYY7fDcalgq8v3fBZMNOJQNn7nOYzMaUCiPxPYfCup69mtIpqlKgMZLvQ8Xhw==", - "dev": true - }, - "@babel/helper-wrap-function": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.13.0.tgz", - "integrity": "sha512-1UX9F7K3BS42fI6qd2A4BjKzgGjToscyZTdp1DjknHLCIvpgne6918io+aL5LXFcER/8QWiwpoY902pVEqgTXA==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.0" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.12.13" - } + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "requires": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } }, - "@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } }, - "@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } }, - "@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "dev": true, + "dependencies": { + "isarray": "0.0.1" + } }, - "@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true + "node_modules/path-to-regexp/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } + "node_modules/picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } }, - "@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/helpers": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", - "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", - "dev": true, - "peer": true, - "requires": { - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.5", - "@babel/types": "^7.12.5" - } - }, - "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.11.tgz", - "integrity": "sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg==", - "dev": true - }, - "@babel/plugin-proposal-async-generator-functions": { - "version": "7.13.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.15.tgz", - "integrity": "sha512-VapibkWzFeoa6ubXy/NgV5U2U4MVnUlvnx6wo1XhlsaTrLYWE0UFpDQsVrmn22q5CzeloqJ8gEMHSKxuee6ZdA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-remap-async-to-generator": "^7.13.0", - "@babel/plugin-syntax-async-generators": "^7.8.4" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-proposal-class-properties": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.13.0.tgz", - "integrity": "sha512-KnTDjFNC1g+45ka0myZNvSBFLhNCLN+GeGYLDEA8Oq7MZ6yMgfLoIRh86GRT0FjtJhZw8JyUskP9uvj5pHM9Zg==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.13.0", - "@babel/helper-plugin-utils": "^7.13.0" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.12.13" - } + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } }, - "@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "requires": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } + "node_modules/prettier": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", + "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + } }, - "@babel/helper-create-class-features-plugin": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.1.tgz", - "integrity": "sha512-r8rsUahG4ywm0QpGcCrLaUSOuNAISR3IZCg4Fx05Ozq31aCUrQsTLH6KPxy0N5ULoQ4Sn9qjNdGNtbPWAC6hYg==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.12.13", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/helper-replace-supers": "^7.13.12", - "@babel/helper-split-export-declaration": "^7.12.13" - } + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } }, - "@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } }, - "@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } }, - "@babel/helper-member-expression-to-functions": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", - "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "node_modules/rechoir": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", + "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", + "dev": true, + "dependencies": { + "resolve": "^1.9.0" + }, + "engines": { + "node": ">= 0.10" + } }, - "@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "node_modules/regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "node_modules/regenerate-unicode-properties": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", + "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", + "dev": true, + "dependencies": { + "regenerate": "^1.4.0" + }, + "engines": { + "node": ">=4" + } }, - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true + "node_modules/regenerator-runtime": { + "version": "0.13.7", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", + "dev": true + }, + "node_modules/regenerator-transform": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", + "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.8.4" + } }, - "@babel/helper-replace-supers": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", - "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.12" - } + "node_modules/regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } }, - "@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "node_modules/regexpu-core": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz", + "integrity": "sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==", + "dev": true, + "dependencies": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.2.0", + "regjsgen": "^0.5.1", + "regjsparser": "^0.6.4", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.2.0" + }, + "engines": { + "node": ">=4" + } }, - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true + "node_modules/regjsgen": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", + "dev": true + }, + "node_modules/regjsparser": { + "version": "0.6.9", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", + "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", + "dev": true, + "dependencies": { + "jsesc": "~0.5.0" + }, + "bin": { + "regjsparser": "bin/parser" + } }, - "@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } + "node_modules/regjsparser/node_modules/jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + } }, - "@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } + "node_modules/resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "dependencies": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } }, - "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/plugin-proposal-dynamic-import": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.13.8.tgz", - "integrity": "sha512-ONWKj0H6+wIRCkZi9zSbZtE/r73uOhMVHh256ys0UzfM7I3d4n+spZNWjOnJv2gzopumP2Wxi186vI8N0Y2JyQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/plugin-syntax-dynamic-import": "^7.8.3" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-proposal-export-namespace-from": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.13.tgz", - "integrity": "sha512-INAgtFo4OnLN3Y/j0VwAgw3HDXcDtX+C/erMvWzuV9v71r7urb6iyMXu7eM9IgLr1ElLlOkaHjJ0SbCmdOQ3Iw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-proposal-json-strings": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.13.8.tgz", - "integrity": "sha512-w4zOPKUFPX1mgvTmL/fcEqy34hrQ1CRcGxdphBc6snDnnqJ47EZDIyop6IwXzAC8G916hsIuXB2ZMBCExC5k7Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/plugin-syntax-json-strings": "^7.8.3" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.13.8.tgz", - "integrity": "sha512-aul6znYB4N4HGweImqKn59Su9RS8lbUIqxtXTOcAGtNIDczoEFv+l1EhmX8rUBp3G1jMjKJm8m0jXVp63ZpS4A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.13.8.tgz", - "integrity": "sha512-iePlDPBn//UhxExyS9KyeYU7RM9WScAG+D3Hhno0PLJebAEpDZMocbDe64eqynhNAnwz/vZoL/q/QB2T1OH39A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-proposal-numeric-separator": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.13.tgz", - "integrity": "sha512-O1jFia9R8BUCl3ZGB7eitaAPu62TXJRHn7rh+ojNERCFyqRwJMTmhz+tJ+k0CwI6CLjX/ee4qW74FSqlq9I35w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13", - "@babel/plugin-syntax-numeric-separator": "^7.10.4" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-proposal-object-rest-spread": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.13.8.tgz", - "integrity": "sha512-DhB2EuB1Ih7S3/IRX5AFVgZ16k3EzfRbq97CxAVI1KSYcW+lexV8VZb7G7L8zuPVSdQMRn0kiBpf/Yzu9ZKH0g==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.13.8", - "@babel/helper-compilation-targets": "^7.13.8", - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.13.0" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-proposal-optional-catch-binding": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.13.8.tgz", - "integrity": "sha512-0wS/4DUF1CuTmGo+NiaHfHcVSeSLj5S3e6RivPTg/2k3wOv3jO35tZ6/ZWsQhQMvdgI7CwphjQa/ccarLymHVA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-proposal-optional-chaining": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz", - "integrity": "sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-proposal-private-methods": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.13.0.tgz", - "integrity": "sha512-MXyyKQd9inhx1kDYPkFRVOBXQ20ES8Pto3T7UZ92xj2mY0EVD8oAVzeyYuVfy/mxAdTSIayOvg+aVzcHV2bn6Q==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.13.0", - "@babel/helper-plugin-utils": "^7.13.0" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.12.13" - } + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/schema-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", + "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.6", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/serialize-javascript": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", + "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "node_modules/sinon": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-10.0.0.tgz", + "integrity": "sha512-XAn5DxtGVJBlBWYrcYKEhWCz7FLwZGdyvANRyK06419hyEpdT0dMc5A8Vcxg5SCGHc40CsqoKsc1bt1CbJPfNw==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^1.8.1", + "@sinonjs/fake-timers": "^6.0.1", + "@sinonjs/samsam": "^5.3.1", + "diff": "^4.0.2", + "nise": "^4.1.0", + "supports-color": "^7.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/sinon" + } + }, + "node_modules/sinon/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/sinon/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/slice-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", + "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", + "dev": true + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "node_modules/string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", + "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", + "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/table": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.0.tgz", + "integrity": "sha512-SAM+5p6V99gYiiy2gT5ArdzgM1dLDed0nkrWmG6Fry/bUS/m9x83BwpJUOf1Qj/x2qJd+thL6IkIx7qPGRxqBw==", + "dev": true, + "dependencies": { + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/table/node_modules/ajv": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.2.0.tgz", + "integrity": "sha512-WSNGFuyWd//XO8n/m/EaOlNLtO0yL8EXT/74LqT4khdhpZjP7lkj/kT5uwRmGitKEVp/Oj7ZUHeGfPtgHhQ5CA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/table/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/tapable": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz", + "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser-webpack-plugin": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.1.tgz", + "integrity": "sha512-5XNNXZiR8YO6X6KhSGXfY0QrGrCRlSwAEjIIrlRQR4W8nP69TaJUlh3bkuac6zzgspiGPfKEHcY295MMVExl5Q==", + "dev": true, + "dependencies": { + "jest-worker": "^26.6.2", + "p-limit": "^3.1.0", + "schema-utils": "^3.0.0", + "serialize-javascript": "^5.0.1", + "source-map": "^0.6.1", + "terser": "^5.5.1" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + } + }, + "node_modules/terser-webpack-plugin/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/terser-webpack-plugin/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/terser-webpack-plugin/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/terser-webpack-plugin/node_modules/terser": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.0.tgz", + "integrity": "sha512-HP5/9hp2UaZt5fYkuhNBR8YyRcT8juw8+uFbAme53iN9hblvKnLUTKkmwJG6ocWpIKf8UK4DoeWG4ty0J6S6/g==", + "dev": true, + "dependencies": { + "commander": "^2.20.0", + "source-map": "~0.7.2", + "source-map-support": "~0.5.19" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser-webpack-plugin/node_modules/terser/node_modules/source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-loader": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.1.2.tgz", + "integrity": "sha512-ryMgATvLLl+z8zQvdlm6Pep0slmwxFWIEnq/5VdiLVjqQXnFJgO+qNLGIIP+d2N2jsFZ9MibZCVDb2bSp7OmEA==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "enhanced-resolve": "^5.0.0", + "micromatch": "^4.0.0", + "semver": "^7.3.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "typescript": "*", + "webpack": "*" + } + }, + "node_modules/ts-loader/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ts-loader/node_modules/chalk": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ts-loader/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/ts-loader/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/ts-loader/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ts-loader/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ts-loader/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tsconfig-paths": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "dev": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/tsconfig-paths/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/typescript": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", + "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "has-bigints": "^1.0.1", + "has-symbols": "^1.0.2", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "requires": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true, + "engines": { + "node": ">=4" + } }, - "@babel/helper-create-class-features-plugin": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.1.tgz", - "integrity": "sha512-r8rsUahG4ywm0QpGcCrLaUSOuNAISR3IZCg4Fx05Ozq31aCUrQsTLH6KPxy0N5ULoQ4Sn9qjNdGNtbPWAC6hYg==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.12.13", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/helper-replace-supers": "^7.13.12", - "@babel/helper-split-export-declaration": "^7.12.13" - } + "node_modules/unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + }, + "engines": { + "node": ">=4" + } }, - "@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } + "node_modules/unicode-match-property-value-ecmascript": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "dev": true, + "engines": { + "node": ">=4" + } }, - "@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "node_modules/unicode-property-aliases-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "dev": true, + "engines": { + "node": ">=4" + } }, - "@babel/helper-member-expression-to-functions": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", - "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "node_modules/uri-js": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } }, - "@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } }, - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true + "node_modules/watchpack": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.1.1.tgz", + "integrity": "sha512-Oo7LXCmc1eE1AjyuSBmtC3+Wy4HcV8PxWh2kP6fOl8yTlNS7r0K9l1ao2lrrUza7V39Y3D/BbJgY8VeSlc5JKw==", + "dev": true, + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } }, - "@babel/helper-replace-supers": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", - "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.12" - } + "node_modules/web-ext-types": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-ext-types/-/web-ext-types-3.2.1.tgz", + "integrity": "sha512-oQZYDU3W8X867h8Jmt3129kRVKklz70db40Y6OzoTTuzOJpF/dB2KULJUf0txVPyUUXuyzV8GmT3nVvRHoG+Ew==", + "dev": true + }, + "node_modules/webextension-polyfill": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/webextension-polyfill/-/webextension-polyfill-0.9.0.tgz", + "integrity": "sha512-LTtHb0yR49xa9irkstDxba4GATDAcDw3ncnFH9RImoFwDlW47U95ME5sn5IiQX2ghfaECaf6xyXM8yvClIBkkw==", + "dev": true + }, + "node_modules/webpack": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.18.0.tgz", + "integrity": "sha512-RmiP/iy6ROvVe/S+u0TrvL/oOmvP+2+Bs8MWjvBwwY/j82Q51XJyDJ75m0QAGntL1Wx6B//Xc0+4VPP/hlNHmw==", + "dev": true, + "dependencies": { + "@types/eslint-scope": "^3.7.0", + "@types/estree": "^0.0.46", + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/wasm-edit": "1.11.0", + "@webassemblyjs/wasm-parser": "1.11.0", + "acorn": "^8.0.4", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.7.0", + "es-module-lexer": "^0.3.26", + "eslint-scope": "^5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.4", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "pkg-dir": "^5.0.0", + "schema-utils": "^3.0.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.1.1", + "watchpack": "^2.0.0", + "webpack-sources": "^2.1.1" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } }, - "@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "node_modules/webpack-cli": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.4.0.tgz", + "integrity": "sha512-/Qh07CXfXEkMu5S8wEpjuaw2Zj/CC0hf/qbTDp6N8N7JjdGuaOjZ7kttz+zhuJO/J5m7alQEhNk9lsc4rC6xgQ==", + "dev": true, + "dependencies": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^1.0.0", + "@webpack-cli/info": "^1.2.1", + "@webpack-cli/serve": "^1.2.2", + "colorette": "^1.2.1", + "commander": "^6.2.0", + "enquirer": "^2.3.6", + "execa": "^5.0.0", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^2.2.0", + "rechoir": "^0.7.0", + "v8-compile-cache": "^2.2.0", + "webpack-merge": "^5.7.3" + }, + "bin": { + "webpack-cli": "bin/cli.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "peerDependencies": { + "webpack": "4.x.x || 5.x.x" + }, + "peerDependenciesMeta": { + "@webpack-cli/generators": { + "optional": true + }, + "@webpack-cli/init": { + "optional": true + }, + "@webpack-cli/migrate": { + "optional": true + }, + "webpack-bundle-analyzer": { + "optional": true + }, + "webpack-dev-server": { + "optional": true + } + } }, - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true + "node_modules/webpack-cli/node_modules/commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true, + "engines": { + "node": ">= 6" + } }, - "@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } + "node_modules/webpack-cli/node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } }, - "@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true + "node_modules/webpack-cli/node_modules/execa": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz", + "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } }, - "@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } + "node_modules/webpack-cli/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } + "node_modules/webpack-cli/node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } }, - "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.13.tgz", - "integrity": "sha512-XyJmZidNfofEkqFV5VC/bLabGmO5QzenPO/YOfGuEbgU+2sSwMmio3YLb4WtBgcmmdwZHyVyv8on77IUjQ5Gvg==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-class-properties": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.1.tgz", - "integrity": "sha512-U40A76x5gTwmESz+qiqssqmeEsKvcSyvtgktrm0uzcARAmM9I1jR221f6Oq+GmHrcD+LvZDag1UTOTe2fL3TeA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", - "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-export-namespace-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", - "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-top-level-await": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.1.tgz", - "integrity": "sha512-i7ooMZFS+a/Om0crxZodrTzNEPJHZrlMVGMTEpFAj6rYY/bKCddB0Dk/YxfPuYXOopuhKk/e1jV6h+WUU9XN3A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-typescript": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.12.1.tgz", - "integrity": "sha512-UZNEcCY+4Dp9yYRCAHrHDU+9ZXLYaY9MgBXSRLkB9WjYFRR6quJBumfVrEkUxrePPBwFcpWfNKXqVRQQtm7mMA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-arrow-functions": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.13.0.tgz", - "integrity": "sha512-96lgJagobeVmazXFaDrbmCLQxBysKu7U6Do3mLsx27gf5Dk85ezysrs2BZUpXD703U/Su1xTBDxxar2oa4jAGg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.13.0" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-async-to-generator": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.13.0.tgz", - "integrity": "sha512-3j6E004Dx0K3eGmhxVJxwwI89CTJrce7lg3UrtFuDAVQ/2+SJ/h/aSFOeE6/n0WB1GsOffsJp6MnPQNQ8nmwhg==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.12.13", - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-remap-async-to-generator": "^7.13.0" - }, - "dependencies": { - "@babel/helper-module-imports": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", - "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "node_modules/webpack-cli/node_modules/is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true + "node_modules/webpack-cli/node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } }, - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true + "node_modules/webpack-cli/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/plugin-transform-block-scoped-functions": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.12.13.tgz", - "integrity": "sha512-zNyFqbc3kI/fVpqwfqkg6RvBgFpC4J18aKKMmv7KdQ/1GgREapSJAykLMVNwfRGO3BtHj3YQZl8kxCXPcVMVeg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-block-scoping": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.1.tgz", - "integrity": "sha512-2mQXd0zBrwfp0O1moWIhPpEeTKDvxyHcnma3JATVP1l+CctWBuot6OJG8LQ4DnBj4ZZPSmlb/fm4mu47EOAnVA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.13.0" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-classes": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.13.0.tgz", - "integrity": "sha512-9BtHCPUARyVH1oXGcSJD3YpsqRLROJx5ZNP6tN5vnk17N0SVf9WCtf8Nuh1CFmgByKKAIMstitKduoCmsaDK5g==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.12.13", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-replace-supers": "^7.13.0", - "@babel/helper-split-export-declaration": "^7.12.13", - "globals": "^11.1.0" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.12.13" - } + "node_modules/webpack-cli/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } }, - "@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "requires": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } + "node_modules/webpack-cli/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } + "node_modules/webpack-cli/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } }, - "@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "node_modules/webpack-merge": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.7.3.tgz", + "integrity": "sha512-6/JUQv0ELQ1igjGDzHkXbVDRxkfA57Zw7PfiupdLFJYrgFqY5ZP8xxbpp2lU3EPwYx89ht5Z/aDkD40hFCm5AA==", + "dev": true, + "dependencies": { + "clone-deep": "^4.0.1", + "wildcard": "^2.0.0" + }, + "engines": { + "node": ">=10.0.0" + } }, - "@babel/helper-member-expression-to-functions": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", - "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "node_modules/webpack-sources": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz", + "integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==", + "dev": true, + "dependencies": { + "source-list-map": "^2.0.1", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10.13.0" + } }, - "@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "node_modules/webpack-sources/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true + "node_modules/webpack/node_modules/acorn": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.2.4.tgz", + "integrity": "sha512-Ibt84YwBDDA890eDiDCEqcbwvHlBvzzDkU2cGBBDDI1QWT12jTiXIOn2CIw5KK4i6N5Z2HUxwYjzriDyqaqqZg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } }, - "@babel/helper-replace-supers": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", - "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.12" - } + "node_modules/webpack/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "node_modules/webpack/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true + "node_modules/webpack/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } + "node_modules/webpack/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true + "node_modules/webpack/node_modules/pkg-dir": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", + "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==", + "dev": true, + "dependencies": { + "find-up": "^5.0.0" + }, + "engines": { + "node": ">=10" + } }, - "@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } + "node_modules/whatwg-fetch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", + "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==", + "dev": true + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } + "node_modules/wildcard": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", + "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", + "dev": true + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/plugin-transform-computed-properties": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.13.0.tgz", - "integrity": "sha512-RRqTYTeZkZAz8WbieLTvKUEUxZlUTdmL5KGMyZj7FnMfLNKV4+r5549aORG/mgojRmFlQMJDUupwAMiF2Q7OUg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.13.0" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-destructuring": { - "version": "7.13.17", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.17.tgz", - "integrity": "sha512-UAUqiLv+uRLO+xuBKKMEpC+t7YRNVRqBsWWq1yKXbBZBje/t3IXCiSinZhjn/DC3qzBfICeYd2EFGEbHsh5RLA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.13.0" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-dotall-regex": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.13.tgz", - "integrity": "sha512-foDrozE65ZFdUC2OfgeOCrEPTxdB3yjqxpXh8CH+ipd9CHd4s/iq81kcUpyH8ACGNEPdFqbtzfgzbT/ZGlbDeQ==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-duplicate-keys": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.12.13.tgz", - "integrity": "sha512-NfADJiiHdhLBW3pulJlJI2NB0t4cci4WTZ8FtdIuNc2+8pslXdPtRRAEWqUY+m9kNOk2eRYbTAOipAxlrOcwwQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-exponentiation-operator": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.12.13.tgz", - "integrity": "sha512-fbUelkM1apvqez/yYx1/oICVnGo2KM5s63mhGylrmXUxK/IAXSIf87QIxVfZldWf4QsOafY6vV3bX8aMHSvNrA==", - "dev": true, - "requires": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-for-of": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.13.0.tgz", - "integrity": "sha512-IHKT00mwUVYE0zzbkDgNRP6SRzvfGCYsOxIRz8KsiaaHCcT9BWIkO+H9QRJseHBLOGBZkHUdHiqj6r0POsdytg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.13.0" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } - } }, - "@babel/plugin-transform-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.12.13.tgz", - "integrity": "sha512-6K7gZycG0cmIwwF7uMK/ZqeCikCGVBdyP2J5SKNCXO5EOHcqi+z7Jwf8AmyDNcBgxET8DrEtCt/mPKPyAzXyqQ==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13" - }, - "dependencies": { + "dependencies": { "@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.12.13" - } - }, - "@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } }, - "@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "@babel/compat-data": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.0.tgz", + "integrity": "sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q==", + "dev": true + }, + "@babel/core": { + "version": "7.12.10", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.10.tgz", + "integrity": "sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w==", + "dev": true, + "peer": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.10", + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helpers": "^7.12.5", + "@babel/parser": "^7.12.10", + "@babel/template": "^7.12.7", + "@babel/traverse": "^7.12.10", + "@babel/types": "^7.12.10", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.19", + "semver": "^5.4.1", + "source-map": "^0.5.0" + } }, - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true + "@babel/generator": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.11.tgz", + "integrity": "sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.11", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } }, - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true + "@babel/helper-annotate-as-pure": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz", + "integrity": "sha512-7YXfX5wQ5aYM/BOlbSccHDbuXXFPxeoUmfWtz8le2yTkTZc+BxsiEnENFoi2SlmA8ewDkG2LgIMIVzzn2h8kfw==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + } + } }, - "@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.12.13.tgz", + "integrity": "sha512-CZOv9tGphhDRlVjVkAgm8Nhklm9RzSmWpX2my+t7Ua/KT616pEzXsQCjinzvkRvHWJ9itO4f296efroX23XCMA==", + "dev": true, + "requires": { + "@babel/helper-explode-assignable-expression": "^7.12.13", + "@babel/types": "^7.12.13" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + } + } }, - "@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true + "@babel/helper-compilation-targets": { + "version": "7.13.16", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz", + "integrity": "sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.13.15", + "@babel/helper-validator-option": "^7.12.17", + "browserslist": "^4.14.5", + "semver": "^6.3.0" + }, + "dependencies": { + "@babel/helper-validator-option": { + "version": "7.12.17", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz", + "integrity": "sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } }, - "@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } + "@babel/helper-create-class-features-plugin": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz", + "integrity": "sha512-hkL++rWeta/OVOBTRJc9a5Azh5mt5WgZUGAKMD8JM141YsE08K//bp1unBBieO6rUKkIPyUE0USQ30jAy3Sk1w==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-member-expression-to-functions": "^7.12.1", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-replace-supers": "^7.12.1", + "@babel/helper-split-export-declaration": "^7.10.4" + } }, - "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/plugin-transform-literals": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.12.13.tgz", - "integrity": "sha512-FW+WPjSR7hiUxMcKqyNjP05tQ2kmBCdpEpZHY1ARm96tGQCCBvXKnpjILtDplUnJ/eHZ0lALLM+d2lMFSpYJrQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-member-expression-literals": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.12.13.tgz", - "integrity": "sha512-kxLkOsg8yir4YeEPHLuO2tXP9R/gTjpuTOjshqSpELUN3ZAg2jfDnKUvzzJxObun38sw3wm4Uu69sX/zA7iRvg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-modules-amd": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.0.tgz", - "integrity": "sha512-CF4c5LX4LQ03LebQxJ5JZes2OYjzBuk1TdiF7cG7d5dK4lAdw9NZmaxq5K/mouUdNeqwz3TNjnW6v01UqUNgpQ==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.14.0", - "@babel/helper-plugin-utils": "^7.13.0", - "babel-plugin-dynamic-import-node": "^2.3.3" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.12.13" - } + "@babel/helper-create-regexp-features-plugin": { + "version": "7.12.17", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.17.tgz", + "integrity": "sha512-p2VGmBu9oefLZ2nQpgnEnG0ZlRPvL8gAGvPUMQwUdaE8k49rOMuZpOwdQoy5qJf6K8jL3bcAMhVUlHAjIgJHUg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.12.13", + "regexpu-core": "^4.7.1" + } }, - "@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "requires": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } + "@babel/helper-explode-assignable-expression": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.13.0.tgz", + "integrity": "sha512-qS0peLTDP8kOisG1blKbaoBg/o9OSa1qoumMjTK5pM+KDTtpxpsiubnCGP34vK8BXGcb2M9eigwgvoJryrzwWA==", + "dev": true, + "requires": { + "@babel/types": "^7.13.0" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + } + } }, "@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz", + "integrity": "sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.12.10", + "@babel/template": "^7.12.7", + "@babel/types": "^7.12.11" + } }, "@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "version": "7.12.10", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz", + "integrity": "sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag==", + "dev": true, + "requires": { + "@babel/types": "^7.12.10" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.13.16", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.13.16.tgz", + "integrity": "sha512-1eMtTrXtrwscjcAeO4BVK+vvkxaLJSPFz1w1KLawz6HLNi9bPFGBNwwDyVfiu1Tv/vRRFYfoGaKhmAQPGPn5Wg==", + "dev": true, + "requires": { + "@babel/traverse": "^7.13.15", + "@babel/types": "^7.13.16" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "requires": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true + }, + "@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + } + } }, "@babel/helper-member-expression-to-functions": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", - "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz", + "integrity": "sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw==", + "dev": true, + "requires": { + "@babel/types": "^7.12.7" + } }, "@babel/helper-module-imports": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", - "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", + "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.5" + } }, "@babel/helper-module-transforms": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", - "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.13.12", - "@babel/helper-replace-supers": "^7.13.12", - "@babel/helper-simple-access": "^7.13.12", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/helper-validator-identifier": "^7.14.0", - "@babel/template": "^7.12.13", - "@babel/traverse": "^7.14.0", - "@babel/types": "^7.14.0" - } + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz", + "integrity": "sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w==", + "dev": true, + "peer": true, + "requires": { + "@babel/helper-module-imports": "^7.12.1", + "@babel/helper-replace-supers": "^7.12.1", + "@babel/helper-simple-access": "^7.12.1", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/helper-validator-identifier": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.12.1", + "@babel/types": "^7.12.1", + "lodash": "^4.17.19" + } }, "@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "version": "7.12.10", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.10.tgz", + "integrity": "sha512-4tpbU0SrSTjjt65UMWSrUOPZTsgvPgGG4S8QSTNHacKzpS51IVWGDj0yCwyeZND/i+LSN2g/O63jEXEWm49sYQ==", + "dev": true, + "requires": { + "@babel/types": "^7.12.10" + } }, "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "dev": true + }, + "@babel/helper-remap-async-to-generator": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.13.0.tgz", + "integrity": "sha512-pUQpFBE9JvC9lrQbpX0TmeNIy5s7GnZjna2lhhcHC7DzgBs6fWn722Y5cfwgrtrqc7NAJwMvOa0mKhq6XaE4jg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.12.13", + "@babel/helper-wrap-function": "^7.13.0", + "@babel/types": "^7.13.0" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + } + } }, "@babel/helper-replace-supers": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", - "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.12" - } + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.11.tgz", + "integrity": "sha512-q+w1cqmhL7R0FNzth/PLLp2N+scXEK/L2AHbXUyydxp828F4FEa5WcVoqui9vFRiHDQErj9Zof8azP32uGVTRA==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.12.7", + "@babel/helper-optimise-call-expression": "^7.12.10", + "@babel/traverse": "^7.12.10", + "@babel/types": "^7.12.11" + } }, "@babel/helper-simple-access": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", - "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz", + "integrity": "sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA==", + "dev": true, + "peer": true, + "requires": { + "@babel/types": "^7.12.1" + } + }, + "@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.12.1.tgz", + "integrity": "sha512-Mf5AUuhG1/OCChOJ/HcADmvcHM42WJockombn8ATJG3OnyiSxBK/Mm5x78BQWvmtXZKHgbjdGL2kin/HOLlZGA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.1" + } }, "@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz", + "integrity": "sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g==", + "dev": true, + "requires": { + "@babel/types": "^7.12.11" + } }, "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", + "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.11.tgz", + "integrity": "sha512-TBFCyj939mFSdeX7U7DDj32WtzYY7fDcalgq8v3fBZMNOJQNn7nOYzMaUCiPxPYfCup69mtIpqlKgMZLvQ8Xhw==", + "dev": true + }, + "@babel/helper-wrap-function": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.13.0.tgz", + "integrity": "sha512-1UX9F7K3BS42fI6qd2A4BjKzgGjToscyZTdp1DjknHLCIvpgne6918io+aL5LXFcER/8QWiwpoY902pVEqgTXA==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "requires": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true + }, + "@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + } + } + }, + "@babel/helpers": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", + "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", + "dev": true, + "peer": true, + "requires": { + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" + } }, "@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } }, "@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.11.tgz", + "integrity": "sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg==", + "dev": true + }, + "@babel/plugin-proposal-async-generator-functions": { + "version": "7.13.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.15.tgz", + "integrity": "sha512-VapibkWzFeoa6ubXy/NgV5U2U4MVnUlvnx6wo1XhlsaTrLYWE0UFpDQsVrmn22q5CzeloqJ8gEMHSKxuee6ZdA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-remap-async-to-generator": "^7.13.0", + "@babel/plugin-syntax-async-generators": "^7.8.4" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } + "@babel/plugin-proposal-class-properties": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.13.0.tgz", + "integrity": "sha512-KnTDjFNC1g+45ka0myZNvSBFLhNCLN+GeGYLDEA8Oq7MZ6yMgfLoIRh86GRT0FjtJhZw8JyUskP9uvj5pHM9Zg==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.13.0", + "@babel/helper-plugin-utils": "^7.13.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "requires": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-create-class-features-plugin": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.1.tgz", + "integrity": "sha512-r8rsUahG4ywm0QpGcCrLaUSOuNAISR3IZCg4Fx05Ozq31aCUrQsTLH6KPxy0N5ULoQ4Sn9qjNdGNtbPWAC6hYg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.12.13", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13" + } + }, + "@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true + }, + "@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + } + } }, - "@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } + "@babel/plugin-proposal-dynamic-import": { + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.13.8.tgz", + "integrity": "sha512-ONWKj0H6+wIRCkZi9zSbZtE/r73uOhMVHh256ys0UzfM7I3d4n+spZNWjOnJv2gzopumP2Wxi186vI8N0Y2JyQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/plugin-transform-modules-commonjs": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.0.tgz", - "integrity": "sha512-EX4QePlsTaRZQmw9BsoPeyh5OCtRGIhwfLquhxGp5e32w+dyL8htOcDwamlitmNFK6xBZYlygjdye9dbd9rUlQ==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.14.0", - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-simple-access": "^7.13.12", - "babel-plugin-dynamic-import-node": "^2.3.3" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.12.13" - } + "@babel/plugin-proposal-export-namespace-from": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.13.tgz", + "integrity": "sha512-INAgtFo4OnLN3Y/j0VwAgw3HDXcDtX+C/erMvWzuV9v71r7urb6iyMXu7eM9IgLr1ElLlOkaHjJ0SbCmdOQ3Iw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "requires": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } + "@babel/plugin-proposal-json-strings": { + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.13.8.tgz", + "integrity": "sha512-w4zOPKUFPX1mgvTmL/fcEqy34hrQ1CRcGxdphBc6snDnnqJ47EZDIyop6IwXzAC8G916hsIuXB2ZMBCExC5k7Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-json-strings": "^7.8.3" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } + "@babel/plugin-proposal-logical-assignment-operators": { + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.13.8.tgz", + "integrity": "sha512-aul6znYB4N4HGweImqKn59Su9RS8lbUIqxtXTOcAGtNIDczoEFv+l1EhmX8rUBp3G1jMjKJm8m0jXVp63ZpS4A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.13.8.tgz", + "integrity": "sha512-iePlDPBn//UhxExyS9KyeYU7RM9WScAG+D3Hhno0PLJebAEpDZMocbDe64eqynhNAnwz/vZoL/q/QB2T1OH39A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/helper-member-expression-to-functions": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", - "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "@babel/plugin-proposal-numeric-separator": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.13.tgz", + "integrity": "sha512-O1jFia9R8BUCl3ZGB7eitaAPu62TXJRHn7rh+ojNERCFyqRwJMTmhz+tJ+k0CwI6CLjX/ee4qW74FSqlq9I35w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/helper-module-imports": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", - "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.13.8.tgz", + "integrity": "sha512-DhB2EuB1Ih7S3/IRX5AFVgZ16k3EzfRbq97CxAVI1KSYcW+lexV8VZb7G7L8zuPVSdQMRn0kiBpf/Yzu9ZKH0g==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.13.8", + "@babel/helper-compilation-targets": "^7.13.8", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.13.0" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/helper-module-transforms": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", - "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.13.12", - "@babel/helper-replace-supers": "^7.13.12", - "@babel/helper-simple-access": "^7.13.12", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/helper-validator-identifier": "^7.14.0", - "@babel/template": "^7.12.13", - "@babel/traverse": "^7.14.0", - "@babel/types": "^7.14.0" - } + "@babel/plugin-proposal-optional-catch-binding": { + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.13.8.tgz", + "integrity": "sha512-0wS/4DUF1CuTmGo+NiaHfHcVSeSLj5S3e6RivPTg/2k3wOv3jO35tZ6/ZWsQhQMvdgI7CwphjQa/ccarLymHVA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "@babel/plugin-proposal-optional-chaining": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz", + "integrity": "sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true + "@babel/plugin-proposal-private-methods": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.13.0.tgz", + "integrity": "sha512-MXyyKQd9inhx1kDYPkFRVOBXQ20ES8Pto3T7UZ92xj2mY0EVD8oAVzeyYuVfy/mxAdTSIayOvg+aVzcHV2bn6Q==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.13.0", + "@babel/helper-plugin-utils": "^7.13.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "requires": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-create-class-features-plugin": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.1.tgz", + "integrity": "sha512-r8rsUahG4ywm0QpGcCrLaUSOuNAISR3IZCg4Fx05Ozq31aCUrQsTLH6KPxy0N5ULoQ4Sn9qjNdGNtbPWAC6hYg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.12.13", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13" + } + }, + "@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true + }, + "@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + } + } }, - "@babel/helper-replace-supers": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", - "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.12" - } + "@babel/plugin-proposal-unicode-property-regex": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.13.tgz", + "integrity": "sha512-XyJmZidNfofEkqFV5VC/bLabGmO5QzenPO/YOfGuEbgU+2sSwMmio3YLb4WtBgcmmdwZHyVyv8on77IUjQ5Gvg==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.12.13", + "@babel/helper-plugin-utils": "^7.12.13" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/helper-simple-access": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", - "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } }, - "@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "@babel/plugin-syntax-class-properties": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.1.tgz", + "integrity": "sha512-U40A76x5gTwmESz+qiqssqmeEsKvcSyvtgktrm0uzcARAmM9I1jR221f6Oq+GmHrcD+LvZDag1UTOTe2fL3TeA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } }, - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true + "@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } }, - "@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } + "@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.3" + } }, - "@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true + "@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } }, - "@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } + "@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } }, - "@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } }, - "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/plugin-transform-modules-systemjs": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.13.8.tgz", - "integrity": "sha512-hwqctPYjhM6cWvVIlOIe27jCIBgHCsdH2xCJVAYQm7V5yTMoilbVMi9f6wKg0rpQAOn6ZG4AOyvCqFF/hUh6+A==", - "dev": true, - "requires": { - "@babel/helper-hoist-variables": "^7.13.0", - "@babel/helper-module-transforms": "^7.13.0", - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-validator-identifier": "^7.12.11", - "babel-plugin-dynamic-import-node": "^2.3.3" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.12.13" - } + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } }, - "@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "requires": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } }, - "@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } }, - "@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.1.tgz", + "integrity": "sha512-i7ooMZFS+a/Om0crxZodrTzNEPJHZrlMVGMTEpFAj6rYY/bKCddB0Dk/YxfPuYXOopuhKk/e1jV6h+WUU9XN3A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-typescript": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.12.1.tgz", + "integrity": "sha512-UZNEcCY+4Dp9yYRCAHrHDU+9ZXLYaY9MgBXSRLkB9WjYFRR6quJBumfVrEkUxrePPBwFcpWfNKXqVRQQtm7mMA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-arrow-functions": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.13.0.tgz", + "integrity": "sha512-96lgJagobeVmazXFaDrbmCLQxBysKu7U6Do3mLsx27gf5Dk85ezysrs2BZUpXD703U/Su1xTBDxxar2oa4jAGg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } + }, + "@babel/plugin-transform-async-to-generator": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.13.0.tgz", + "integrity": "sha512-3j6E004Dx0K3eGmhxVJxwwI89CTJrce7lg3UrtFuDAVQ/2+SJ/h/aSFOeE6/n0WB1GsOffsJp6MnPQNQ8nmwhg==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-remap-async-to-generator": "^7.13.0" + }, + "dependencies": { + "@babel/helper-module-imports": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + } + } + }, + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.12.13.tgz", + "integrity": "sha512-zNyFqbc3kI/fVpqwfqkg6RvBgFpC4J18aKKMmv7KdQ/1GgREapSJAykLMVNwfRGO3BtHj3YQZl8kxCXPcVMVeg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } + }, + "@babel/plugin-transform-block-scoping": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.1.tgz", + "integrity": "sha512-2mQXd0zBrwfp0O1moWIhPpEeTKDvxyHcnma3JATVP1l+CctWBuot6OJG8LQ4DnBj4ZZPSmlb/fm4mu47EOAnVA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } + }, + "@babel/plugin-transform-classes": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.13.0.tgz", + "integrity": "sha512-9BtHCPUARyVH1oXGcSJD3YpsqRLROJx5ZNP6tN5vnk17N0SVf9WCtf8Nuh1CFmgByKKAIMstitKduoCmsaDK5g==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.12.13", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-replace-supers": "^7.13.0", + "@babel/helper-split-export-declaration": "^7.12.13", + "globals": "^11.1.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "requires": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true + }, + "@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + } + } + }, + "@babel/plugin-transform-computed-properties": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.13.0.tgz", + "integrity": "sha512-RRqTYTeZkZAz8WbieLTvKUEUxZlUTdmL5KGMyZj7FnMfLNKV4+r5549aORG/mgojRmFlQMJDUupwAMiF2Q7OUg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } + }, + "@babel/plugin-transform-destructuring": { + "version": "7.13.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.17.tgz", + "integrity": "sha512-UAUqiLv+uRLO+xuBKKMEpC+t7YRNVRqBsWWq1yKXbBZBje/t3IXCiSinZhjn/DC3qzBfICeYd2EFGEbHsh5RLA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } + }, + "@babel/plugin-transform-dotall-regex": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.13.tgz", + "integrity": "sha512-foDrozE65ZFdUC2OfgeOCrEPTxdB3yjqxpXh8CH+ipd9CHd4s/iq81kcUpyH8ACGNEPdFqbtzfgzbT/ZGlbDeQ==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.12.13", + "@babel/helper-plugin-utils": "^7.12.13" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } + }, + "@babel/plugin-transform-duplicate-keys": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.12.13.tgz", + "integrity": "sha512-NfADJiiHdhLBW3pulJlJI2NB0t4cci4WTZ8FtdIuNc2+8pslXdPtRRAEWqUY+m9kNOk2eRYbTAOipAxlrOcwwQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } + }, + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.12.13.tgz", + "integrity": "sha512-fbUelkM1apvqez/yYx1/oICVnGo2KM5s63mhGylrmXUxK/IAXSIf87QIxVfZldWf4QsOafY6vV3bX8aMHSvNrA==", + "dev": true, + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.12.13", + "@babel/helper-plugin-utils": "^7.12.13" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } + }, + "@babel/plugin-transform-for-of": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.13.0.tgz", + "integrity": "sha512-IHKT00mwUVYE0zzbkDgNRP6SRzvfGCYsOxIRz8KsiaaHCcT9BWIkO+H9QRJseHBLOGBZkHUdHiqj6r0POsdytg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } + }, + "@babel/plugin-transform-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.12.13.tgz", + "integrity": "sha512-6K7gZycG0cmIwwF7uMK/ZqeCikCGVBdyP2J5SKNCXO5EOHcqi+z7Jwf8AmyDNcBgxET8DrEtCt/mPKPyAzXyqQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-plugin-utils": "^7.12.13" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true + }, + "@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + } + } + }, + "@babel/plugin-transform-literals": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.12.13.tgz", + "integrity": "sha512-FW+WPjSR7hiUxMcKqyNjP05tQ2kmBCdpEpZHY1ARm96tGQCCBvXKnpjILtDplUnJ/eHZ0lALLM+d2lMFSpYJrQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } + }, + "@babel/plugin-transform-member-expression-literals": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.12.13.tgz", + "integrity": "sha512-kxLkOsg8yir4YeEPHLuO2tXP9R/gTjpuTOjshqSpELUN3ZAg2jfDnKUvzzJxObun38sw3wm4Uu69sX/zA7iRvg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } + }, + "@babel/plugin-transform-modules-amd": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.0.tgz", + "integrity": "sha512-CF4c5LX4LQ03LebQxJ5JZes2OYjzBuk1TdiF7cG7d5dK4lAdw9NZmaxq5K/mouUdNeqwz3TNjnW6v01UqUNgpQ==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.14.0", + "@babel/helper-plugin-utils": "^7.13.0", + "babel-plugin-dynamic-import-node": "^2.3.3" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "requires": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-module-imports": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-module-transforms": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", + "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-simple-access": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/helper-validator-identifier": "^7.14.0", + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-simple-access": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", + "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true + }, + "@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + } + } + }, + "@babel/plugin-transform-modules-commonjs": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.0.tgz", + "integrity": "sha512-EX4QePlsTaRZQmw9BsoPeyh5OCtRGIhwfLquhxGp5e32w+dyL8htOcDwamlitmNFK6xBZYlygjdye9dbd9rUlQ==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.14.0", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-simple-access": "^7.13.12", + "babel-plugin-dynamic-import-node": "^2.3.3" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "requires": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-module-imports": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-module-transforms": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", + "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-simple-access": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/helper-validator-identifier": "^7.14.0", + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-simple-access": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", + "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true + }, + "@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + } + } + }, + "@babel/plugin-transform-modules-systemjs": { + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.13.8.tgz", + "integrity": "sha512-hwqctPYjhM6cWvVIlOIe27jCIBgHCsdH2xCJVAYQm7V5yTMoilbVMi9f6wKg0rpQAOn6ZG4AOyvCqFF/hUh6+A==", + "dev": true, + "requires": { + "@babel/helper-hoist-variables": "^7.13.0", + "@babel/helper-module-transforms": "^7.13.0", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-validator-identifier": "^7.12.11", + "babel-plugin-dynamic-import-node": "^2.3.3" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "requires": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-module-imports": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-module-transforms": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", + "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-simple-access": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/helper-validator-identifier": "^7.14.0", + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + } + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-simple-access": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", + "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + } + } + }, + "@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true + }, + "@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + } + } + } + } + }, + "@babel/plugin-transform-modules-umd": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.0.tgz", + "integrity": "sha512-nPZdnWtXXeY7I87UZr9VlsWme3Y0cfFFE41Wbxz4bbaexAjNMInXPFUpRRUJ8NoMm0Cw+zxbqjdPmLhcjfazMw==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.14.0", + "@babel/helper-plugin-utils": "^7.13.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "requires": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-module-imports": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-module-transforms": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", + "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-simple-access": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/helper-validator-identifier": "^7.14.0", + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-simple-access": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", + "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true + }, + "@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + } + } }, - "@babel/helper-member-expression-to-functions": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", - "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.13.tgz", + "integrity": "sha512-Xsm8P2hr5hAxyYblrfACXpQKdQbx4m2df9/ZZSQ8MAhsadw06+jW7s9zsSw6he+mJZXRlVMyEnVktJo4zjk1WA==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.12.13" + } }, - "@babel/helper-module-imports": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", - "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "@babel/plugin-transform-new-target": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.12.13.tgz", + "integrity": "sha512-/KY2hbLxrG5GTQ9zzZSc3xWiOy379pIETEhbtzwZcw9rvuaVV4Fqy7BYGYOWZnaoXIQYbbJ0ziXLa/sKcGCYEQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/helper-module-transforms": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", - "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.13.12", - "@babel/helper-replace-supers": "^7.13.12", - "@babel/helper-simple-access": "^7.13.12", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/helper-validator-identifier": "^7.14.0", - "@babel/template": "^7.12.13", - "@babel/traverse": "^7.14.0", - "@babel/types": "^7.14.0" - }, - "dependencies": { - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - } - } + "@babel/plugin-transform-object-super": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.12.13.tgz", + "integrity": "sha512-JzYIcj3XtYspZDV8j9ulnoMPZZnF/Cj0LUxPOjR89BdBVx+zYJI9MdMIlUZjbXDX+6YVeS6I3e8op+qQ3BYBoQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13", + "@babel/helper-replace-supers": "^7.12.13" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/generator": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", + "dev": true, + "requires": { + "@babel/types": "^7.14.1", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + }, + "@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "dev": true + }, + "@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/traverse": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + } + } }, - "@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "@babel/plugin-transform-parameters": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.13.0.tgz", + "integrity": "sha512-Jt8k/h/mIwE2JFEOb3lURoY5C85ETcYPnbuAJ96zRBzh1XHtQZfs62ChZ6EP22QlC8c7Xqr9q+e1SU5qttwwjw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true + "@babel/plugin-transform-property-literals": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.12.13.tgz", + "integrity": "sha512-nqVigwVan+lR+g8Fj8Exl0UQX2kymtjcWfMOYM1vTYEKujeyv2SkMgazf2qNcK7l4SDiKyTA/nHCPqL4e2zo1A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/helper-replace-supers": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", - "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.12" - } + "@babel/plugin-transform-regenerator": { + "version": "7.13.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.13.15.tgz", + "integrity": "sha512-Bk9cOLSz8DiurcMETZ8E2YtIVJbFCPGW28DJWUakmyVWtQSm6Wsf0p4B4BfEr/eL2Nkhe/CICiUiMOCi1TPhuQ==", + "dev": true, + "requires": { + "regenerator-transform": "^0.14.2" + } }, - "@babel/helper-simple-access": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", - "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "@babel/plugin-transform-reserved-words": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.12.13.tgz", + "integrity": "sha512-xhUPzDXxZN1QfiOy/I5tyye+TRz6lA7z6xaT4CLOjPRMVg1ldRf0LHw0TDBpYL4vG78556WuHdyO9oi5UmzZBg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "@babel/plugin-transform-shorthand-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.12.13.tgz", + "integrity": "sha512-xpL49pqPnLtf0tVluuqvzWIgLEhuPpZzvs2yabUHSKRNlN7ScYU7aMlmavOeyXJZKgZKQRBlh8rHbKiJDraTSw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - } - } + "@babel/plugin-transform-spread": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.13.0.tgz", + "integrity": "sha512-V6vkiXijjzYeFmQTr3dBxPtZYLPcUfY34DebOU27jIl2M/Y8Egm52Hw82CSjjPqd54GTlJs5x+CR7HeNr24ckg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true + "@babel/plugin-transform-sticky-regex": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.13.tgz", + "integrity": "sha512-Jc3JSaaWT8+fr7GRvQP02fKDsYk4K/lYwWq38r/UGfaxo89ajud321NH28KRQ7xy1Ybc0VUE5Pz8psjNNDUglg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } + "@babel/plugin-transform-template-literals": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.13.0.tgz", + "integrity": "sha512-d67umW6nlfmr1iehCcBv69eSUSySk1EsIS8aTDX4Xo9qajAh6mYtcl4kJrBkGXuxZPEgVr7RVfAvNW6YQkd4Mw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } + "@babel/plugin-transform-typeof-symbol": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.13.tgz", + "integrity": "sha512-eKv/LmUJpMnu4npgfvs3LiHhJua5fo/CysENxa45YCQXZwKnGCQKAg87bvoqSW1fFT+HA32l03Qxsm8ouTY3ZQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - }, - "dependencies": { - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - } - } - } - } - }, - "@babel/plugin-transform-modules-umd": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.0.tgz", - "integrity": "sha512-nPZdnWtXXeY7I87UZr9VlsWme3Y0cfFFE41Wbxz4bbaexAjNMInXPFUpRRUJ8NoMm0Cw+zxbqjdPmLhcjfazMw==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.14.0", - "@babel/helper-plugin-utils": "^7.13.0" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.12.13" - } + "@babel/plugin-transform-typescript": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.12.1.tgz", + "integrity": "sha512-VrsBByqAIntM+EYMqSm59SiMEf7qkmI9dqMt6RbD/wlwueWmYcI0FFK5Fj47pP6DRZm+3teXjosKlwcZJ5lIMw==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-typescript": "^7.12.1" + } }, - "@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "requires": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } + "@babel/plugin-transform-unicode-escapes": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.12.13.tgz", + "integrity": "sha512-0bHEkdwJ/sN/ikBHfSmOXPypN/beiGqjo+o4/5K+vxEFNPRPdImhviPakMKG4x96l85emoa0Z6cDflsdBusZbw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } + "@babel/plugin-transform-unicode-regex": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.12.13.tgz", + "integrity": "sha512-mDRzSNY7/zopwisPZ5kM9XKCfhchqIYwAKRERtEnhYscZB79VRekuRSoYbN0+KVe3y8+q1h6A4svXtP7N+UoCA==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.12.13", + "@babel/helper-plugin-utils": "^7.12.13" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", + "dev": true + } + } }, - "@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "@babel/preset-env": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.12.11.tgz", + "integrity": "sha512-j8Tb+KKIXKYlDBQyIOy4BLxzv1NUOwlHfZ74rvW+Z0Gp4/cI2IMDPBWAgWceGcE7aep9oL/0K9mlzlMGxA8yNw==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.12.7", + "@babel/helper-compilation-targets": "^7.12.5", + "@babel/helper-module-imports": "^7.12.5", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-validator-option": "^7.12.11", + "@babel/plugin-proposal-async-generator-functions": "^7.12.1", + "@babel/plugin-proposal-class-properties": "^7.12.1", + "@babel/plugin-proposal-dynamic-import": "^7.12.1", + "@babel/plugin-proposal-export-namespace-from": "^7.12.1", + "@babel/plugin-proposal-json-strings": "^7.12.1", + "@babel/plugin-proposal-logical-assignment-operators": "^7.12.1", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1", + "@babel/plugin-proposal-numeric-separator": "^7.12.7", + "@babel/plugin-proposal-object-rest-spread": "^7.12.1", + "@babel/plugin-proposal-optional-catch-binding": "^7.12.1", + "@babel/plugin-proposal-optional-chaining": "^7.12.7", + "@babel/plugin-proposal-private-methods": "^7.12.1", + "@babel/plugin-proposal-unicode-property-regex": "^7.12.1", + "@babel/plugin-syntax-async-generators": "^7.8.0", + "@babel/plugin-syntax-class-properties": "^7.12.1", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.0", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.0", + "@babel/plugin-syntax-top-level-await": "^7.12.1", + "@babel/plugin-transform-arrow-functions": "^7.12.1", + "@babel/plugin-transform-async-to-generator": "^7.12.1", + "@babel/plugin-transform-block-scoped-functions": "^7.12.1", + "@babel/plugin-transform-block-scoping": "^7.12.11", + "@babel/plugin-transform-classes": "^7.12.1", + "@babel/plugin-transform-computed-properties": "^7.12.1", + "@babel/plugin-transform-destructuring": "^7.12.1", + "@babel/plugin-transform-dotall-regex": "^7.12.1", + "@babel/plugin-transform-duplicate-keys": "^7.12.1", + "@babel/plugin-transform-exponentiation-operator": "^7.12.1", + "@babel/plugin-transform-for-of": "^7.12.1", + "@babel/plugin-transform-function-name": "^7.12.1", + "@babel/plugin-transform-literals": "^7.12.1", + "@babel/plugin-transform-member-expression-literals": "^7.12.1", + "@babel/plugin-transform-modules-amd": "^7.12.1", + "@babel/plugin-transform-modules-commonjs": "^7.12.1", + "@babel/plugin-transform-modules-systemjs": "^7.12.1", + "@babel/plugin-transform-modules-umd": "^7.12.1", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.12.1", + "@babel/plugin-transform-new-target": "^7.12.1", + "@babel/plugin-transform-object-super": "^7.12.1", + "@babel/plugin-transform-parameters": "^7.12.1", + "@babel/plugin-transform-property-literals": "^7.12.1", + "@babel/plugin-transform-regenerator": "^7.12.1", + "@babel/plugin-transform-reserved-words": "^7.12.1", + "@babel/plugin-transform-shorthand-properties": "^7.12.1", + "@babel/plugin-transform-spread": "^7.12.1", + "@babel/plugin-transform-sticky-regex": "^7.12.7", + "@babel/plugin-transform-template-literals": "^7.12.1", + "@babel/plugin-transform-typeof-symbol": "^7.12.10", + "@babel/plugin-transform-unicode-escapes": "^7.12.1", + "@babel/plugin-transform-unicode-regex": "^7.12.1", + "@babel/preset-modules": "^0.1.3", + "@babel/types": "^7.12.11", + "core-js-compat": "^3.8.0", + "semver": "^5.5.0" + } }, - "@babel/helper-member-expression-to-functions": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", - "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "@babel/preset-modules": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.4.tgz", + "integrity": "sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + } }, - "@babel/helper-module-imports": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", - "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "@babel/preset-typescript": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.12.7.tgz", + "integrity": "sha512-nOoIqIqBmHBSEgBXWR4Dv/XBehtIFcw9PqZw6rFYuKrzsZmOQm3PR5siLBnKZFEsDb03IegG8nSjU/iXXXYRmw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-validator-option": "^7.12.1", + "@babel/plugin-transform-typescript": "^7.12.1" + } }, - "@babel/helper-module-transforms": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", - "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.13.12", - "@babel/helper-replace-supers": "^7.13.12", - "@babel/helper-simple-access": "^7.13.12", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/helper-validator-identifier": "^7.14.0", - "@babel/template": "^7.12.13", - "@babel/traverse": "^7.14.0", - "@babel/types": "^7.14.0" - } + "@babel/runtime": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.0.tgz", + "integrity": "sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } }, - "@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "@babel/template": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz", + "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.12.7", + "@babel/types": "^7.12.7" + } }, - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true + "@babel/traverse": { + "version": "7.12.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.10.tgz", + "integrity": "sha512-6aEtf0IeRgbYWzta29lePeYSk+YAFIC3kyqESeft8o5CkFlYIMX+EQDDWEiAQ9LHOA3d0oHdgrSsID/CKqXJlg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.10", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/parser": "^7.12.10", + "@babel/types": "^7.12.10", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.19" + } }, - "@babel/helper-replace-supers": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", - "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.12" - } + "@babel/types": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.11.tgz", + "integrity": "sha512-ukA9SQtKThINm++CX1CwmliMrE54J6nIYB5XTwL5f/CLFW9owfls+YSU8tVW15RQ2w+a3fSbPjC6HdQNtWZkiA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.12.11", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } }, - "@babel/helper-simple-access": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", - "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "@discoveryjs/json-ext": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz", + "integrity": "sha512-HyYEUDeIj5rRQU2Hk5HTB2uHsbRQpF70nvMhVzi+VJR0X+xNEhjPui4/kBf3VeH/wqD28PT4sVOm8qqLjBrSZg==", + "dev": true + }, + "@eslint/eslintrc": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", + "integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + } + } }, - "@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "@nodelib/fs.scandir": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", + "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.4", + "run-parallel": "^1.1.9" + } }, - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true + "@nodelib/fs.stat": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", + "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", + "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.4", + "fastq": "^1.6.0" + } }, - "@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } + "@sinonjs/commons": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.1.tgz", + "integrity": "sha512-892K+kWUUi3cl+LlqEWIDrhvLgdL79tECi8JZUyq6IviKy/DNhuzCRlbHUjxK89f4ypPMMaFnFuR9Ie6DoIMsw==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } }, - "@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true + "@sinonjs/fake-timers": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", + "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } }, - "@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } + "@sinonjs/samsam": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.3.1.tgz", + "integrity": "sha512-1Hc0b1TtyfBu8ixF/tpfSHTVWKwCBLY4QJbkgnE7HcwyvT2xArDxb4K7dMgqRm3szI+LJbzmW/s4xxEhv6hwDg==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.6.0", + "lodash.get": "^4.4.2", + "type-detect": "^4.0.8" + } }, - "@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } + "@sinonjs/text-encoding": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", + "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", + "dev": true + }, + "@types/chrome": { + "version": "0.0.135", + "resolved": "https://registry.npmjs.org/@types/chrome/-/chrome-0.0.135.tgz", + "integrity": "sha512-SczB5P5mIgQWHAeiimlYg5VFvuQKCw4Q5cAzVD7II1Czf4U0222jb3mTHUd1qM0BRJ/kPtzybBde+Zy2sdx/LA==", + "dev": true, + "requires": { + "@types/filesystem": "*", + "@types/har-format": "*" + } }, - "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.13.tgz", - "integrity": "sha512-Xsm8P2hr5hAxyYblrfACXpQKdQbx4m2df9/ZZSQ8MAhsadw06+jW7s9zsSw6he+mJZXRlVMyEnVktJo4zjk1WA==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.12.13" - } - }, - "@babel/plugin-transform-new-target": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.12.13.tgz", - "integrity": "sha512-/KY2hbLxrG5GTQ9zzZSc3xWiOy379pIETEhbtzwZcw9rvuaVV4Fqy7BYGYOWZnaoXIQYbbJ0ziXLa/sKcGCYEQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-object-super": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.12.13.tgz", - "integrity": "sha512-JzYIcj3XtYspZDV8j9ulnoMPZZnF/Cj0LUxPOjR89BdBVx+zYJI9MdMIlUZjbXDX+6YVeS6I3e8op+qQ3BYBoQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13", - "@babel/helper-replace-supers": "^7.12.13" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.12.13" - } + "@types/eslint": { + "version": "7.2.10", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.10.tgz", + "integrity": "sha512-kUEPnMKrqbtpCq/KTaGFFKAcz6Ethm2EjCoKIDaCmfRBWLbFuTcOJfTlorwbnboXBzahqWLgUp1BQeKHiJzPUQ==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } }, - "@babel/generator": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", - "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", - "dev": true, - "requires": { - "@babel/types": "^7.14.1", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } + "@types/eslint-scope": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.0.tgz", + "integrity": "sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw==", + "dev": true, + "requires": { + "@types/eslint": "*", + "@types/estree": "*" + } }, - "@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" - } + "@types/estree": { + "version": "0.0.46", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.46.tgz", + "integrity": "sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg==", + "dev": true + }, + "@types/filesystem": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@types/filesystem/-/filesystem-0.0.30.tgz", + "integrity": "sha512-NCoRgmGmLpTT9VFL6Bb6z0jQuqI3d0E5FGl7M0JOv/J5RQYo9s5aOItPYnpckx9MbYQk1APLXcF8f20Vqnf2yA==", + "dev": true, + "requires": { + "@types/filewriter": "*" + } }, - "@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "@types/filewriter": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/filewriter/-/filewriter-0.0.29.tgz", + "integrity": "sha512-BsPXH/irW0ht0Ji6iw/jJaK8Lj3FJemon2gvEqHKpCdDCeemHa+rI3WBGq5z7cDMZgoLjY40oninGxqk+8NzNQ==", + "dev": true + }, + "@types/har-format": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@types/har-format/-/har-format-1.2.5.tgz", + "integrity": "sha512-IG8AE1m2pWtPqQ7wXhFhy6Q59bwwnLwO36v5Rit2FrbXCIp8Sk8E2PfUCreyrdo17STwFSKDAkitVuVYbpEHvQ==", + "dev": true + }, + "@types/json-schema": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", + "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", + "dev": true + }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, + "@types/node": { + "version": "14.14.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.14.tgz", + "integrity": "sha512-UHnOPWVWV1z+VV8k6L1HhG7UbGBgIdghqF3l9Ny9ApPghbjICXkUJSd/b9gOgQfjM1r+37cipdw/HJ3F6ICEnQ==", + "dev": true + }, + "@types/sinon": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.0.tgz", + "integrity": "sha512-jDZ55oCKxqlDmoTBBbBBEx+N8ZraUVhggMZ9T5t+6/Dh8/4NiOjSUfpLrPiEwxQDlAe3wpAkoXhWvE6LibtsMQ==", + "dev": true, + "requires": { + "@sinonjs/fake-timers": "^7.0.4" + }, + "dependencies": { + "@sinonjs/fake-timers": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-7.0.5.tgz", + "integrity": "sha512-fUt6b15bjV/VW93UP5opNXJxdwZSbK1EdiwnhN7XrQrcpaOhMJpZ/CjwFpM3THpxwA+YviBUJKSuEqKlCK5alw==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + } + } }, - "@babel/helper-member-expression-to-functions": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", - "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", - "dev": true, - "requires": { - "@babel/types": "^7.13.12" - } + "@typescript-eslint/eslint-plugin": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.17.0.tgz", + "integrity": "sha512-/fKFDcoHg8oNan39IKFOb5WmV7oWhQe1K6CDaAVfJaNWEhmfqlA24g+u1lqU5bMH7zuNasfMId4LaYWC5ijRLw==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "4.17.0", + "@typescript-eslint/scope-manager": "4.17.0", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "lodash": "^4.17.15", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } }, - "@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "@typescript-eslint/experimental-utils": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.17.0.tgz", + "integrity": "sha512-ZR2NIUbnIBj+LGqCFGQ9yk2EBQrpVVFOh9/Kd0Lm6gLpSAcCuLLe5lUCibKGCqyH9HPwYC0GIJce2O1i8VYmWA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/scope-manager": "4.17.0", + "@typescript-eslint/types": "4.17.0", + "@typescript-eslint/typescript-estree": "4.17.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } }, - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true + "@typescript-eslint/parser": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.17.0.tgz", + "integrity": "sha512-KYdksiZQ0N1t+6qpnl6JeK9ycCFprS9xBAiIrw4gSphqONt8wydBw4BXJi3C11ywZmyHulvMaLjWsxDjUSDwAw==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "4.17.0", + "@typescript-eslint/types": "4.17.0", + "@typescript-eslint/typescript-estree": "4.17.0", + "debug": "^4.1.1" + } }, - "@babel/helper-replace-supers": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", - "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.13.12", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.12" - } + "@typescript-eslint/scope-manager": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.17.0.tgz", + "integrity": "sha512-OJ+CeTliuW+UZ9qgULrnGpPQ1bhrZNFpfT/Bc0pzNeyZwMik7/ykJ0JHnQ7krHanFN9wcnPK89pwn84cRUmYjw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.17.0", + "@typescript-eslint/visitor-keys": "4.17.0" + } }, - "@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, - "requires": { - "@babel/types": "^7.12.13" - } + "@typescript-eslint/types": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.17.0.tgz", + "integrity": "sha512-RN5z8qYpJ+kXwnLlyzZkiJwfW2AY458Bf8WqllkondQIcN2ZxQowAToGSd9BlAUZDB5Ea8I6mqL2quGYCLT+2g==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.17.0.tgz", + "integrity": "sha512-lRhSFIZKUEPPWpWfwuZBH9trYIEJSI0vYsrxbvVvNyIUDoKWaklOAelsSkeh3E2VBSZiNe9BZ4E5tYBZbUczVQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.17.0", + "@typescript-eslint/visitor-keys": "4.17.0", + "debug": "^4.1.1", + "globby": "^11.0.1", + "is-glob": "^4.0.1", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } }, - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true + "@typescript-eslint/visitor-keys": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.17.0.tgz", + "integrity": "sha512-WfuMN8mm5SSqXuAr9NM+fItJ0SVVphobWYkWOwQ1odsfC014Vdxk/92t4JwS1Q6fCA/ABfCKpa3AVtpUKTNKGQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.17.0", + "eslint-visitor-keys": "^2.0.0" + } }, - "@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } + "@webassemblyjs/ast": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.0.tgz", + "integrity": "sha512-kX2W49LWsbthrmIRMbQZuQDhGtjyqXfEmmHyEi4XWnSZtPmxY0+3anPIzsnRb45VH/J55zlOfWvZuY47aJZTJg==", + "dev": true, + "requires": { + "@webassemblyjs/helper-numbers": "1.11.0", + "@webassemblyjs/helper-wasm-bytecode": "1.11.0" + } }, - "@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", - "dev": true + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.0.tgz", + "integrity": "sha512-Q/aVYs/VnPDVYvsCBL/gSgwmfjeCb4LW8+TMrO3cSzJImgv8lxxEPM2JA5jMrivE7LSz3V+PFqtMbls3m1exDA==", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.0.tgz", + "integrity": "sha512-baT/va95eXiXb2QflSx95QGT5ClzWpGaa8L7JnJbgzoYeaA27FCvuBXU758l+KXWRndEmUXjP0Q5fibhavIn8w==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.0.tgz", + "integrity": "sha512-u9HPBEl4DS+vA8qLQdEQ6N/eJQ7gT7aNvMIo8AAWvAl/xMrcOSiI2M0MAnMCy3jIFke7bEee/JwdX1nUpCtdyA==", + "dev": true + }, + "@webassemblyjs/helper-numbers": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.0.tgz", + "integrity": "sha512-DhRQKelIj01s5IgdsOJMKLppI+4zpmcMQ3XboFPLwCpSNH6Hqo1ritgHgD0nqHeSYqofA6aBN/NmXuGjM1jEfQ==", + "dev": true, + "requires": { + "@webassemblyjs/floating-point-hex-parser": "1.11.0", + "@webassemblyjs/helper-api-error": "1.11.0", + "@xtuc/long": "4.2.2" + } }, - "@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" - } + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.0.tgz", + "integrity": "sha512-MbmhvxXExm542tWREgSFnOVo07fDpsBJg3sIl6fSp9xuu75eGz5lz31q7wTLffwL3Za7XNRCMZy210+tnsUSEA==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.0.tgz", + "integrity": "sha512-3Eb88hcbfY/FCukrg6i3EH8H2UsD7x8Vy47iVJrP967A9JGqgBVL9aH71SETPx1JrGsOUVLo0c7vMCN22ytJew==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/helper-buffer": "1.11.0", + "@webassemblyjs/helper-wasm-bytecode": "1.11.0", + "@webassemblyjs/wasm-gen": "1.11.0" + } }, - "@babel/traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", - "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.14.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.14.0", - "@babel/types": "^7.14.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } + "@webassemblyjs/ieee754": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.0.tgz", + "integrity": "sha512-KXzOqpcYQwAfeQ6WbF6HXo+0udBNmw0iXDmEK5sFlmQdmND+tr773Ti8/5T/M6Tl/413ArSJErATd8In3B+WBA==", + "dev": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } }, - "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/plugin-transform-parameters": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.13.0.tgz", - "integrity": "sha512-Jt8k/h/mIwE2JFEOb3lURoY5C85ETcYPnbuAJ96zRBzh1XHtQZfs62ChZ6EP22QlC8c7Xqr9q+e1SU5qttwwjw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.13.0" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-property-literals": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.12.13.tgz", - "integrity": "sha512-nqVigwVan+lR+g8Fj8Exl0UQX2kymtjcWfMOYM1vTYEKujeyv2SkMgazf2qNcK7l4SDiKyTA/nHCPqL4e2zo1A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-regenerator": { - "version": "7.13.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.13.15.tgz", - "integrity": "sha512-Bk9cOLSz8DiurcMETZ8E2YtIVJbFCPGW28DJWUakmyVWtQSm6Wsf0p4B4BfEr/eL2Nkhe/CICiUiMOCi1TPhuQ==", - "dev": true, - "requires": { - "regenerator-transform": "^0.14.2" - } - }, - "@babel/plugin-transform-reserved-words": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.12.13.tgz", - "integrity": "sha512-xhUPzDXxZN1QfiOy/I5tyye+TRz6lA7z6xaT4CLOjPRMVg1ldRf0LHw0TDBpYL4vG78556WuHdyO9oi5UmzZBg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-shorthand-properties": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.12.13.tgz", - "integrity": "sha512-xpL49pqPnLtf0tVluuqvzWIgLEhuPpZzvs2yabUHSKRNlN7ScYU7aMlmavOeyXJZKgZKQRBlh8rHbKiJDraTSw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-spread": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.13.0.tgz", - "integrity": "sha512-V6vkiXijjzYeFmQTr3dBxPtZYLPcUfY34DebOU27jIl2M/Y8Egm52Hw82CSjjPqd54GTlJs5x+CR7HeNr24ckg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-sticky-regex": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.13.tgz", - "integrity": "sha512-Jc3JSaaWT8+fr7GRvQP02fKDsYk4K/lYwWq38r/UGfaxo89ajud321NH28KRQ7xy1Ybc0VUE5Pz8psjNNDUglg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-template-literals": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.13.0.tgz", - "integrity": "sha512-d67umW6nlfmr1iehCcBv69eSUSySk1EsIS8aTDX4Xo9qajAh6mYtcl4kJrBkGXuxZPEgVr7RVfAvNW6YQkd4Mw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.13.0" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-typeof-symbol": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.13.tgz", - "integrity": "sha512-eKv/LmUJpMnu4npgfvs3LiHhJua5fo/CysENxa45YCQXZwKnGCQKAg87bvoqSW1fFT+HA32l03Qxsm8ouTY3ZQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-typescript": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.12.1.tgz", - "integrity": "sha512-VrsBByqAIntM+EYMqSm59SiMEf7qkmI9dqMt6RbD/wlwueWmYcI0FFK5Fj47pP6DRZm+3teXjosKlwcZJ5lIMw==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-syntax-typescript": "^7.12.1" - } - }, - "@babel/plugin-transform-unicode-escapes": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.12.13.tgz", - "integrity": "sha512-0bHEkdwJ/sN/ikBHfSmOXPypN/beiGqjo+o4/5K+vxEFNPRPdImhviPakMKG4x96l85emoa0Z6cDflsdBusZbw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/plugin-transform-unicode-regex": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.12.13.tgz", - "integrity": "sha512-mDRzSNY7/zopwisPZ5kM9XKCfhchqIYwAKRERtEnhYscZB79VRekuRSoYbN0+KVe3y8+q1h6A4svXtP7N+UoCA==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13" - }, - "dependencies": { - "@babel/helper-plugin-utils": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", - "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==", - "dev": true - } - } - }, - "@babel/preset-env": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.12.11.tgz", - "integrity": "sha512-j8Tb+KKIXKYlDBQyIOy4BLxzv1NUOwlHfZ74rvW+Z0Gp4/cI2IMDPBWAgWceGcE7aep9oL/0K9mlzlMGxA8yNw==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.12.7", - "@babel/helper-compilation-targets": "^7.12.5", - "@babel/helper-module-imports": "^7.12.5", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-validator-option": "^7.12.11", - "@babel/plugin-proposal-async-generator-functions": "^7.12.1", - "@babel/plugin-proposal-class-properties": "^7.12.1", - "@babel/plugin-proposal-dynamic-import": "^7.12.1", - "@babel/plugin-proposal-export-namespace-from": "^7.12.1", - "@babel/plugin-proposal-json-strings": "^7.12.1", - "@babel/plugin-proposal-logical-assignment-operators": "^7.12.1", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1", - "@babel/plugin-proposal-numeric-separator": "^7.12.7", - "@babel/plugin-proposal-object-rest-spread": "^7.12.1", - "@babel/plugin-proposal-optional-catch-binding": "^7.12.1", - "@babel/plugin-proposal-optional-chaining": "^7.12.7", - "@babel/plugin-proposal-private-methods": "^7.12.1", - "@babel/plugin-proposal-unicode-property-regex": "^7.12.1", - "@babel/plugin-syntax-async-generators": "^7.8.0", - "@babel/plugin-syntax-class-properties": "^7.12.1", - "@babel/plugin-syntax-dynamic-import": "^7.8.0", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.0", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", - "@babel/plugin-syntax-numeric-separator": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.0", - "@babel/plugin-syntax-top-level-await": "^7.12.1", - "@babel/plugin-transform-arrow-functions": "^7.12.1", - "@babel/plugin-transform-async-to-generator": "^7.12.1", - "@babel/plugin-transform-block-scoped-functions": "^7.12.1", - "@babel/plugin-transform-block-scoping": "^7.12.11", - "@babel/plugin-transform-classes": "^7.12.1", - "@babel/plugin-transform-computed-properties": "^7.12.1", - "@babel/plugin-transform-destructuring": "^7.12.1", - "@babel/plugin-transform-dotall-regex": "^7.12.1", - "@babel/plugin-transform-duplicate-keys": "^7.12.1", - "@babel/plugin-transform-exponentiation-operator": "^7.12.1", - "@babel/plugin-transform-for-of": "^7.12.1", - "@babel/plugin-transform-function-name": "^7.12.1", - "@babel/plugin-transform-literals": "^7.12.1", - "@babel/plugin-transform-member-expression-literals": "^7.12.1", - "@babel/plugin-transform-modules-amd": "^7.12.1", - "@babel/plugin-transform-modules-commonjs": "^7.12.1", - "@babel/plugin-transform-modules-systemjs": "^7.12.1", - "@babel/plugin-transform-modules-umd": "^7.12.1", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.12.1", - "@babel/plugin-transform-new-target": "^7.12.1", - "@babel/plugin-transform-object-super": "^7.12.1", - "@babel/plugin-transform-parameters": "^7.12.1", - "@babel/plugin-transform-property-literals": "^7.12.1", - "@babel/plugin-transform-regenerator": "^7.12.1", - "@babel/plugin-transform-reserved-words": "^7.12.1", - "@babel/plugin-transform-shorthand-properties": "^7.12.1", - "@babel/plugin-transform-spread": "^7.12.1", - "@babel/plugin-transform-sticky-regex": "^7.12.7", - "@babel/plugin-transform-template-literals": "^7.12.1", - "@babel/plugin-transform-typeof-symbol": "^7.12.10", - "@babel/plugin-transform-unicode-escapes": "^7.12.1", - "@babel/plugin-transform-unicode-regex": "^7.12.1", - "@babel/preset-modules": "^0.1.3", - "@babel/types": "^7.12.11", - "core-js-compat": "^3.8.0", - "semver": "^5.5.0" - } - }, - "@babel/preset-modules": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.4.tgz", - "integrity": "sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", - "@babel/plugin-transform-dotall-regex": "^7.4.4", - "@babel/types": "^7.4.4", - "esutils": "^2.0.2" - } - }, - "@babel/preset-typescript": { - "version": "7.12.7", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.12.7.tgz", - "integrity": "sha512-nOoIqIqBmHBSEgBXWR4Dv/XBehtIFcw9PqZw6rFYuKrzsZmOQm3PR5siLBnKZFEsDb03IegG8nSjU/iXXXYRmw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-validator-option": "^7.12.1", - "@babel/plugin-transform-typescript": "^7.12.1" - } - }, - "@babel/runtime": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.0.tgz", - "integrity": "sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA==", - "dev": true, - "requires": { - "regenerator-runtime": "^0.13.4" - } - }, - "@babel/template": { - "version": "7.12.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz", - "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/parser": "^7.12.7", - "@babel/types": "^7.12.7" - } - }, - "@babel/traverse": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.10.tgz", - "integrity": "sha512-6aEtf0IeRgbYWzta29lePeYSk+YAFIC3kyqESeft8o5CkFlYIMX+EQDDWEiAQ9LHOA3d0oHdgrSsID/CKqXJlg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.10", - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.12.10", - "@babel/types": "^7.12.10", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" - } - }, - "@babel/types": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.11.tgz", - "integrity": "sha512-ukA9SQtKThINm++CX1CwmliMrE54J6nIYB5XTwL5f/CLFW9owfls+YSU8tVW15RQ2w+a3fSbPjC6HdQNtWZkiA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.12.11", - "lodash": "^4.17.19", - "to-fast-properties": "^2.0.0" - } - }, - "@discoveryjs/json-ext": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz", - "integrity": "sha512-HyYEUDeIj5rRQU2Hk5HTB2uHsbRQpF70nvMhVzi+VJR0X+xNEhjPui4/kBf3VeH/wqD28PT4sVOm8qqLjBrSZg==", - "dev": true - }, - "@eslint/eslintrc": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", - "integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", - "dev": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "dependencies": { - "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "dev": true, - "requires": { - "type-fest": "^0.8.1" - } + "@webassemblyjs/leb128": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.0.tgz", + "integrity": "sha512-aqbsHa1mSQAbeeNcl38un6qVY++hh8OpCOzxhixSYgbRfNWcxJNJQwe2rezK9XEcssJbbWIkblaJRwGMS9zp+g==", + "dev": true, + "requires": { + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/utf8": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.0.tgz", + "integrity": "sha512-A/lclGxH6SpSLSyFowMzO/+aDEPU4hvEiooCMXQPcQFPPJaYcPQNKGOCLUySJsYJ4trbpr+Fs08n4jelkVTGVw==", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.0.tgz", + "integrity": "sha512-JHQ0damXy0G6J9ucyKVXO2j08JVJ2ntkdJlq1UTiUrIgfGMmA7Ik5VdC/L8hBK46kVJgujkBIoMtT8yVr+yVOQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/helper-buffer": "1.11.0", + "@webassemblyjs/helper-wasm-bytecode": "1.11.0", + "@webassemblyjs/helper-wasm-section": "1.11.0", + "@webassemblyjs/wasm-gen": "1.11.0", + "@webassemblyjs/wasm-opt": "1.11.0", + "@webassemblyjs/wasm-parser": "1.11.0", + "@webassemblyjs/wast-printer": "1.11.0" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.0.tgz", + "integrity": "sha512-BEUv1aj0WptCZ9kIS30th5ILASUnAPEvE3tVMTrItnZRT9tXCLW2LEXT8ezLw59rqPP9klh9LPmpU+WmRQmCPQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/helper-wasm-bytecode": "1.11.0", + "@webassemblyjs/ieee754": "1.11.0", + "@webassemblyjs/leb128": "1.11.0", + "@webassemblyjs/utf8": "1.11.0" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.0.tgz", + "integrity": "sha512-tHUSP5F4ywyh3hZ0+fDQuWxKx3mJiPeFufg+9gwTpYp324mPCQgnuVKwzLTZVqj0duRDovnPaZqDwoyhIO8kYg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/helper-buffer": "1.11.0", + "@webassemblyjs/wasm-gen": "1.11.0", + "@webassemblyjs/wasm-parser": "1.11.0" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.0.tgz", + "integrity": "sha512-6L285Sgu9gphrcpDXINvm0M9BskznnzJTE7gYkjDbxET28shDqp27wpruyx3C2S/dvEwiigBwLA1cz7lNUi0kw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/helper-api-error": "1.11.0", + "@webassemblyjs/helper-wasm-bytecode": "1.11.0", + "@webassemblyjs/ieee754": "1.11.0", + "@webassemblyjs/leb128": "1.11.0", + "@webassemblyjs/utf8": "1.11.0" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.0.tgz", + "integrity": "sha512-Fg5OX46pRdTgB7rKIUojkh9vXaVN6sGYCnEiJN1GYkb0RPwShZXp6KTDqmoMdQPKhcroOXh3fEzmkWmCYaKYhQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.0", + "@xtuc/long": "4.2.2" + } + }, + "@webpack-cli/configtest": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.3.tgz", + "integrity": "sha512-WQs0ep98FXX2XBAfQpRbY0Ma6ADw8JR6xoIkaIiJIzClGOMqVRvPCWqndTxf28DgFopWan0EKtHtg/5W1h0Zkw==", + "dev": true, + "requires": {} + }, + "@webpack-cli/info": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.2.4.tgz", + "integrity": "sha512-ogE2T4+pLhTTPS/8MM3IjHn0IYplKM4HbVNMCWA9N4NrdPzunwenpCsqKEXyejMfRu6K8mhauIPYf8ZxWG5O6g==", + "dev": true, + "requires": { + "envinfo": "^7.7.3" + } + }, + "@webpack-cli/serve": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.4.0.tgz", + "integrity": "sha512-xgT/HqJ+uLWGX+Mzufusl3cgjAcnqYYskaB7o0vRcwOEfuu6hMzSILQpnIzFMGsTaeaX4Nnekl+6fadLbl1/Vg==", + "dev": true, + "requires": {} + }, + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true, + "requires": {} + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "requires": {} + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - } - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", - "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.4", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", - "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", - "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.4", - "fastq": "^1.6.0" - } - }, - "@sinonjs/commons": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.1.tgz", - "integrity": "sha512-892K+kWUUi3cl+LlqEWIDrhvLgdL79tECi8JZUyq6IviKy/DNhuzCRlbHUjxK89f4ypPMMaFnFuR9Ie6DoIMsw==", - "dev": true, - "requires": { - "type-detect": "4.0.8" - } - }, - "@sinonjs/fake-timers": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", - "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.7.0" - } - }, - "@sinonjs/samsam": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.3.1.tgz", - "integrity": "sha512-1Hc0b1TtyfBu8ixF/tpfSHTVWKwCBLY4QJbkgnE7HcwyvT2xArDxb4K7dMgqRm3szI+LJbzmW/s4xxEhv6hwDg==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.6.0", - "lodash.get": "^4.4.2", - "type-detect": "^4.0.8" - } - }, - "@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", - "dev": true - }, - "@types/chrome": { - "version": "0.0.135", - "resolved": "https://registry.npmjs.org/@types/chrome/-/chrome-0.0.135.tgz", - "integrity": "sha512-SczB5P5mIgQWHAeiimlYg5VFvuQKCw4Q5cAzVD7II1Czf4U0222jb3mTHUd1qM0BRJ/kPtzybBde+Zy2sdx/LA==", - "dev": true, - "requires": { - "@types/filesystem": "*", - "@types/har-format": "*" - } - }, - "@types/eslint": { - "version": "7.2.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.10.tgz", - "integrity": "sha512-kUEPnMKrqbtpCq/KTaGFFKAcz6Ethm2EjCoKIDaCmfRBWLbFuTcOJfTlorwbnboXBzahqWLgUp1BQeKHiJzPUQ==", - "dev": true, - "requires": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "@types/eslint-scope": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.0.tgz", - "integrity": "sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw==", - "dev": true, - "requires": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, - "@types/estree": { - "version": "0.0.46", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.46.tgz", - "integrity": "sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg==", - "dev": true - }, - "@types/filesystem": { - "version": "0.0.30", - "resolved": "https://registry.npmjs.org/@types/filesystem/-/filesystem-0.0.30.tgz", - "integrity": "sha512-NCoRgmGmLpTT9VFL6Bb6z0jQuqI3d0E5FGl7M0JOv/J5RQYo9s5aOItPYnpckx9MbYQk1APLXcF8f20Vqnf2yA==", - "dev": true, - "requires": { - "@types/filewriter": "*" - } - }, - "@types/filewriter": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/filewriter/-/filewriter-0.0.29.tgz", - "integrity": "sha512-BsPXH/irW0ht0Ji6iw/jJaK8Lj3FJemon2gvEqHKpCdDCeemHa+rI3WBGq5z7cDMZgoLjY40oninGxqk+8NzNQ==", - "dev": true - }, - "@types/har-format": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@types/har-format/-/har-format-1.2.5.tgz", - "integrity": "sha512-IG8AE1m2pWtPqQ7wXhFhy6Q59bwwnLwO36v5Rit2FrbXCIp8Sk8E2PfUCreyrdo17STwFSKDAkitVuVYbpEHvQ==", - "dev": true - }, - "@types/json-schema": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", - "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", - "dev": true - }, - "@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", - "dev": true - }, - "@types/node": { - "version": "14.14.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.14.tgz", - "integrity": "sha512-UHnOPWVWV1z+VV8k6L1HhG7UbGBgIdghqF3l9Ny9ApPghbjICXkUJSd/b9gOgQfjM1r+37cipdw/HJ3F6ICEnQ==", - "dev": true - }, - "@types/sinon": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.0.tgz", - "integrity": "sha512-jDZ55oCKxqlDmoTBBbBBEx+N8ZraUVhggMZ9T5t+6/Dh8/4NiOjSUfpLrPiEwxQDlAe3wpAkoXhWvE6LibtsMQ==", - "dev": true, - "requires": { - "@sinonjs/fake-timers": "^7.0.4" - }, - "dependencies": { - "@sinonjs/fake-timers": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-7.0.5.tgz", - "integrity": "sha512-fUt6b15bjV/VW93UP5opNXJxdwZSbK1EdiwnhN7XrQrcpaOhMJpZ/CjwFpM3THpxwA+YviBUJKSuEqKlCK5alw==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.7.0" - } - } - } - }, - "@typescript-eslint/eslint-plugin": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.17.0.tgz", - "integrity": "sha512-/fKFDcoHg8oNan39IKFOb5WmV7oWhQe1K6CDaAVfJaNWEhmfqlA24g+u1lqU5bMH7zuNasfMId4LaYWC5ijRLw==", - "dev": true, - "requires": { - "@typescript-eslint/experimental-utils": "4.17.0", - "@typescript-eslint/scope-manager": "4.17.0", - "debug": "^4.1.1", - "functional-red-black-tree": "^1.0.1", - "lodash": "^4.17.15", - "regexpp": "^3.0.0", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - }, - "dependencies": { - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - } - } - }, - "@typescript-eslint/experimental-utils": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.17.0.tgz", - "integrity": "sha512-ZR2NIUbnIBj+LGqCFGQ9yk2EBQrpVVFOh9/Kd0Lm6gLpSAcCuLLe5lUCibKGCqyH9HPwYC0GIJce2O1i8VYmWA==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.17.0", - "@typescript-eslint/types": "4.17.0", - "@typescript-eslint/typescript-estree": "4.17.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - } - }, - "@typescript-eslint/parser": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.17.0.tgz", - "integrity": "sha512-KYdksiZQ0N1t+6qpnl6JeK9ycCFprS9xBAiIrw4gSphqONt8wydBw4BXJi3C11ywZmyHulvMaLjWsxDjUSDwAw==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "4.17.0", - "@typescript-eslint/types": "4.17.0", - "@typescript-eslint/typescript-estree": "4.17.0", - "debug": "^4.1.1" - } - }, - "@typescript-eslint/scope-manager": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.17.0.tgz", - "integrity": "sha512-OJ+CeTliuW+UZ9qgULrnGpPQ1bhrZNFpfT/Bc0pzNeyZwMik7/ykJ0JHnQ7krHanFN9wcnPK89pwn84cRUmYjw==", - "dev": true, - "requires": { - "@typescript-eslint/types": "4.17.0", - "@typescript-eslint/visitor-keys": "4.17.0" - } - }, - "@typescript-eslint/types": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.17.0.tgz", - "integrity": "sha512-RN5z8qYpJ+kXwnLlyzZkiJwfW2AY458Bf8WqllkondQIcN2ZxQowAToGSd9BlAUZDB5Ea8I6mqL2quGYCLT+2g==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.17.0.tgz", - "integrity": "sha512-lRhSFIZKUEPPWpWfwuZBH9trYIEJSI0vYsrxbvVvNyIUDoKWaklOAelsSkeh3E2VBSZiNe9BZ4E5tYBZbUczVQ==", - "dev": true, - "requires": { - "@typescript-eslint/types": "4.17.0", - "@typescript-eslint/visitor-keys": "4.17.0", - "debug": "^4.1.1", - "globby": "^11.0.1", - "is-glob": "^4.0.1", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - }, - "dependencies": { - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - } - } - }, - "@typescript-eslint/visitor-keys": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.17.0.tgz", - "integrity": "sha512-WfuMN8mm5SSqXuAr9NM+fItJ0SVVphobWYkWOwQ1odsfC014Vdxk/92t4JwS1Q6fCA/ABfCKpa3AVtpUKTNKGQ==", - "dev": true, - "requires": { - "@typescript-eslint/types": "4.17.0", - "eslint-visitor-keys": "^2.0.0" - } - }, - "@webassemblyjs/ast": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.0.tgz", - "integrity": "sha512-kX2W49LWsbthrmIRMbQZuQDhGtjyqXfEmmHyEi4XWnSZtPmxY0+3anPIzsnRb45VH/J55zlOfWvZuY47aJZTJg==", - "dev": true, - "requires": { - "@webassemblyjs/helper-numbers": "1.11.0", - "@webassemblyjs/helper-wasm-bytecode": "1.11.0" - } - }, - "@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.0.tgz", - "integrity": "sha512-Q/aVYs/VnPDVYvsCBL/gSgwmfjeCb4LW8+TMrO3cSzJImgv8lxxEPM2JA5jMrivE7LSz3V+PFqtMbls3m1exDA==", - "dev": true - }, - "@webassemblyjs/helper-api-error": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.0.tgz", - "integrity": "sha512-baT/va95eXiXb2QflSx95QGT5ClzWpGaa8L7JnJbgzoYeaA27FCvuBXU758l+KXWRndEmUXjP0Q5fibhavIn8w==", - "dev": true - }, - "@webassemblyjs/helper-buffer": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.0.tgz", - "integrity": "sha512-u9HPBEl4DS+vA8qLQdEQ6N/eJQ7gT7aNvMIo8AAWvAl/xMrcOSiI2M0MAnMCy3jIFke7bEee/JwdX1nUpCtdyA==", - "dev": true - }, - "@webassemblyjs/helper-numbers": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.0.tgz", - "integrity": "sha512-DhRQKelIj01s5IgdsOJMKLppI+4zpmcMQ3XboFPLwCpSNH6Hqo1ritgHgD0nqHeSYqofA6aBN/NmXuGjM1jEfQ==", - "dev": true, - "requires": { - "@webassemblyjs/floating-point-hex-parser": "1.11.0", - "@webassemblyjs/helper-api-error": "1.11.0", - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.0.tgz", - "integrity": "sha512-MbmhvxXExm542tWREgSFnOVo07fDpsBJg3sIl6fSp9xuu75eGz5lz31q7wTLffwL3Za7XNRCMZy210+tnsUSEA==", - "dev": true - }, - "@webassemblyjs/helper-wasm-section": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.0.tgz", - "integrity": "sha512-3Eb88hcbfY/FCukrg6i3EH8H2UsD7x8Vy47iVJrP967A9JGqgBVL9aH71SETPx1JrGsOUVLo0c7vMCN22ytJew==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/helper-buffer": "1.11.0", - "@webassemblyjs/helper-wasm-bytecode": "1.11.0", - "@webassemblyjs/wasm-gen": "1.11.0" - } - }, - "@webassemblyjs/ieee754": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.0.tgz", - "integrity": "sha512-KXzOqpcYQwAfeQ6WbF6HXo+0udBNmw0iXDmEK5sFlmQdmND+tr773Ti8/5T/M6Tl/413ArSJErATd8In3B+WBA==", - "dev": true, - "requires": { - "@xtuc/ieee754": "^1.2.0" - } - }, - "@webassemblyjs/leb128": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.0.tgz", - "integrity": "sha512-aqbsHa1mSQAbeeNcl38un6qVY++hh8OpCOzxhixSYgbRfNWcxJNJQwe2rezK9XEcssJbbWIkblaJRwGMS9zp+g==", - "dev": true, - "requires": { - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/utf8": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.0.tgz", - "integrity": "sha512-A/lclGxH6SpSLSyFowMzO/+aDEPU4hvEiooCMXQPcQFPPJaYcPQNKGOCLUySJsYJ4trbpr+Fs08n4jelkVTGVw==", - "dev": true - }, - "@webassemblyjs/wasm-edit": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.0.tgz", - "integrity": "sha512-JHQ0damXy0G6J9ucyKVXO2j08JVJ2ntkdJlq1UTiUrIgfGMmA7Ik5VdC/L8hBK46kVJgujkBIoMtT8yVr+yVOQ==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/helper-buffer": "1.11.0", - "@webassemblyjs/helper-wasm-bytecode": "1.11.0", - "@webassemblyjs/helper-wasm-section": "1.11.0", - "@webassemblyjs/wasm-gen": "1.11.0", - "@webassemblyjs/wasm-opt": "1.11.0", - "@webassemblyjs/wasm-parser": "1.11.0", - "@webassemblyjs/wast-printer": "1.11.0" - } - }, - "@webassemblyjs/wasm-gen": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.0.tgz", - "integrity": "sha512-BEUv1aj0WptCZ9kIS30th5ILASUnAPEvE3tVMTrItnZRT9tXCLW2LEXT8ezLw59rqPP9klh9LPmpU+WmRQmCPQ==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/helper-wasm-bytecode": "1.11.0", - "@webassemblyjs/ieee754": "1.11.0", - "@webassemblyjs/leb128": "1.11.0", - "@webassemblyjs/utf8": "1.11.0" - } - }, - "@webassemblyjs/wasm-opt": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.0.tgz", - "integrity": "sha512-tHUSP5F4ywyh3hZ0+fDQuWxKx3mJiPeFufg+9gwTpYp324mPCQgnuVKwzLTZVqj0duRDovnPaZqDwoyhIO8kYg==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/helper-buffer": "1.11.0", - "@webassemblyjs/wasm-gen": "1.11.0", - "@webassemblyjs/wasm-parser": "1.11.0" - } - }, - "@webassemblyjs/wasm-parser": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.0.tgz", - "integrity": "sha512-6L285Sgu9gphrcpDXINvm0M9BskznnzJTE7gYkjDbxET28shDqp27wpruyx3C2S/dvEwiigBwLA1cz7lNUi0kw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/helper-api-error": "1.11.0", - "@webassemblyjs/helper-wasm-bytecode": "1.11.0", - "@webassemblyjs/ieee754": "1.11.0", - "@webassemblyjs/leb128": "1.11.0", - "@webassemblyjs/utf8": "1.11.0" - } - }, - "@webassemblyjs/wast-printer": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.0.tgz", - "integrity": "sha512-Fg5OX46pRdTgB7rKIUojkh9vXaVN6sGYCnEiJN1GYkb0RPwShZXp6KTDqmoMdQPKhcroOXh3fEzmkWmCYaKYhQ==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.0", - "@xtuc/long": "4.2.2" - } - }, - "@webpack-cli/configtest": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.3.tgz", - "integrity": "sha512-WQs0ep98FXX2XBAfQpRbY0Ma6ADw8JR6xoIkaIiJIzClGOMqVRvPCWqndTxf28DgFopWan0EKtHtg/5W1h0Zkw==", - "dev": true, - "requires": {} - }, - "@webpack-cli/info": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.2.4.tgz", - "integrity": "sha512-ogE2T4+pLhTTPS/8MM3IjHn0IYplKM4HbVNMCWA9N4NrdPzunwenpCsqKEXyejMfRu6K8mhauIPYf8ZxWG5O6g==", - "dev": true, - "requires": { - "envinfo": "^7.7.3" - } - }, - "@webpack-cli/serve": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.4.0.tgz", - "integrity": "sha512-xgT/HqJ+uLWGX+Mzufusl3cgjAcnqYYskaB7o0vRcwOEfuu6hMzSILQpnIzFMGsTaeaX4Nnekl+6fadLbl1/Vg==", - "dev": true, - "requires": {} - }, - "@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true - }, - "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true - }, - "acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "dev": true, - "requires": {} - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "requires": {} - }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "array-includes": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz", - "integrity": "sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.2", - "get-intrinsic": "^1.1.1", - "is-string": "^1.0.5" - } - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "array.prototype.flat": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", - "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1" - } - }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true - }, - "babel-plugin-dynamic-import-node": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", - "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", - "dev": true, - "requires": { - "object.assign": "^4.1.0" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "browserslist": { - "version": "4.16.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", - "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30001219", - "colorette": "^1.2.2", - "electron-to-chromium": "^1.3.723", - "escalade": "^3.1.1", - "node-releases": "^1.1.71" - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, - "caniuse-lite": { - "version": "1.0.30001223", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001223.tgz", - "integrity": "sha512-k/RYs6zc/fjbxTjaWZemeSmOjO0JJV+KguOBA3NwPup8uzxM1cMhR2BD9XmO86GuqaqTCO8CgkgH9Rz//vdDiA==", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", - "dev": true - }, - "clone-deep": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.2", - "shallow-clone": "^3.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "colorette": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", - "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "contains-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", - "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", - "dev": true - }, - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "peer": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "copy-webpack-plugin": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-8.1.1.tgz", - "integrity": "sha512-rYM2uzRxrLRpcyPqGceRBDpxxUV8vcDqIKxAUKfcnFpcrPxT5+XvhTxv7XLjo5AvEJFPdAE3zCogG2JVahqgSQ==", - "dev": true, - "requires": { - "fast-glob": "^3.2.5", - "glob-parent": "^5.1.1", - "globby": "^11.0.3", - "normalize-path": "^3.0.0", - "p-limit": "^3.1.0", - "schema-utils": "^3.0.0", - "serialize-javascript": "^5.0.1" - }, - "dependencies": { - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } - } - } - }, - "core-js-compat": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.12.0.tgz", - "integrity": "sha512-vvaN8EOvYBEjrr+MN3vCKrMNc/xdYZI+Rt/uPMROi4T5Hj8Fz6TiPQm2mrB9aZoQVW1lCFHYmMrv99aUct9mkg==", - "dev": true, - "requires": { - "browserslist": "^4.16.6", - "semver": "7.0.0" - }, - "dependencies": { - "semver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", - "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", - "dev": true - } - } - }, - "cross-env": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", - "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.1" - }, - "dependencies": { - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "requires": { - "object-keys": "^1.0.12" - } - }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "electron-to-chromium": { - "version": "1.3.727", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.727.tgz", - "integrity": "sha512-Mfz4FIB4FSvEwBpDfdipRIrwd6uo8gUDoRDF4QEYb4h4tSuI3ov594OrjU6on042UlFHouIJpClDODGkPcBSbg==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "enhanced-resolve": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.0.tgz", - "integrity": "sha512-Sl3KRpJA8OpprrtaIswVki3cWPiPKxXuFxJXBp+zNb6s6VwNWwFRUdtmzd2ReUut8n+sCPx7QCtQ7w5wfJhSgQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - } - }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "requires": { - "ansi-colors": "^4.1.1" - } - }, - "envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", - "dev": true - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es-abstract": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0.tgz", - "integrity": "sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.2", - "is-callable": "^1.2.3", - "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.2", - "is-string": "^1.0.5", - "object-inspect": "^1.9.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.0" - } - }, - "es-module-lexer": { - "version": "0.3.26", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.3.26.tgz", - "integrity": "sha512-Va0Q/xqtrss45hWzP8CZJwzGSZJjDM5/MJRE3IXXnUCcVLElR9BRaE9F62BopysASyc4nM3uwhSW7FFB9nlWAA==", - "dev": true - }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "eslint": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.21.0.tgz", - "integrity": "sha512-W2aJbXpMNofUp0ztQaF40fveSsJBjlSCSWpy//gzfTvwC+USs/nceBrKmlJOiM8r1bLwP2EuYkCqArn/6QTIgg==", - "dev": true, - "requires": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash": "^4.17.20", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.4", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "dependencies": { "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } }, - "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } + "array-includes": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz", + "integrity": "sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.2", + "get-intrinsic": "^1.1.1", + "is-string": "^1.0.5" + } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "array.prototype.flat": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", + "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + } }, - "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "dev": true, - "requires": { - "type-fest": "^0.8.1" - } + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "babel-plugin-dynamic-import-node": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", + "dev": true, + "requires": { + "object.assign": "^4.1.0" + } }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - } - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true + "browserslist": { + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" + } }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "eslint-import-resolver-node": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", - "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", - "dev": true, - "requires": { - "debug": "^2.6.9", - "resolve": "^1.13.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "eslint-module-utils": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", - "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", - "dev": true, - "requires": { - "debug": "^2.6.9", - "pkg-dir": "^2.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } + "caniuse-lite": { + "version": "1.0.30001223", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001223.tgz", + "integrity": "sha512-k/RYs6zc/fjbxTjaWZemeSmOjO0JJV+KguOBA3NwPup8uzxM1cMhR2BD9XmO86GuqaqTCO8CgkgH9Rz//vdDiA==", + "dev": true }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "chrome-trace-event": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "dev": true + }, + "clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + } }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colorette": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "peer": true, + "requires": { + "safe-buffer": "~5.1.1" + } }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true + "copy-webpack-plugin": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-8.1.1.tgz", + "integrity": "sha512-rYM2uzRxrLRpcyPqGceRBDpxxUV8vcDqIKxAUKfcnFpcrPxT5+XvhTxv7XLjo5AvEJFPdAE3zCogG2JVahqgSQ==", + "dev": true, + "requires": { + "fast-glob": "^3.2.5", + "glob-parent": "^5.1.1", + "globby": "^11.0.3", + "normalize-path": "^3.0.0", + "p-limit": "^3.1.0", + "schema-utils": "^3.0.0", + "serialize-javascript": "^5.0.1" + }, + "dependencies": { + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + } + } }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true + "core-js-compat": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.12.0.tgz", + "integrity": "sha512-vvaN8EOvYBEjrr+MN3vCKrMNc/xdYZI+Rt/uPMROi4T5Hj8Fz6TiPQm2mrB9aZoQVW1lCFHYmMrv99aUct9mkg==", + "dev": true, + "requires": { + "browserslist": "^4.16.6", + "semver": "7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true + } + } + }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.1" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } }, - "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - } - } - } - }, - "eslint-plugin-import": { - "version": "2.22.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", - "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", - "dev": true, - "requires": { - "array-includes": "^3.1.1", - "array.prototype.flat": "^1.2.3", - "contains-path": "^0.1.0", - "debug": "^2.6.9", - "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.4", - "eslint-module-utils": "^2.6.0", - "has": "^1.0.3", - "minimatch": "^3.0.4", - "object.values": "^1.1.1", - "read-pkg-up": "^2.0.0", - "resolve": "^1.17.0", - "tsconfig-paths": "^3.9.0" - }, - "dependencies": { "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } }, "doctrine": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "isarray": "^1.0.0" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } + "electron-to-chromium": { + "version": "1.3.727", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.727.tgz", + "integrity": "sha512-Mfz4FIB4FSvEwBpDfdipRIrwd6uo8gUDoRDF4QEYb4h4tSuI3ov594OrjU6on042UlFHouIJpClDODGkPcBSbg==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "enhanced-resolve": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.0.tgz", + "integrity": "sha512-Sl3KRpJA8OpprrtaIswVki3cWPiPKxXuFxJXBp+zNb6s6VwNWwFRUdtmzd2ReUut8n+sCPx7QCtQ7w5wfJhSgQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + } }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } + "es-abstract": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0.tgz", + "integrity": "sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.2", + "is-callable": "^1.2.3", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.2", + "is-string": "^1.0.5", + "object-inspect": "^1.9.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.4", + "string.prototype.trimstart": "^1.0.4", + "unbox-primitive": "^1.0.0" + } }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } + "es-module-lexer": { + "version": "0.3.26", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.3.26.tgz", + "integrity": "sha512-Va0Q/xqtrss45hWzP8CZJwzGSZJjDM5/MJRE3IXXnUCcVLElR9BRaE9F62BopysASyc4nM3uwhSW7FFB9nlWAA==", + "dev": true + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.21.0.tgz", + "integrity": "sha512-W2aJbXpMNofUp0ztQaF40fveSsJBjlSCSWpy//gzfTvwC+USs/nceBrKmlJOiM8r1bLwP2EuYkCqArn/6QTIgg==", + "dev": true, + "requires": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.20", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.4", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true + "eslint-import-resolver-node": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", + "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-module-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + } + } + }, + "eslint-plugin-import": { + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", + "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.4", + "eslint-module-utils": "^2.6.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.1", + "read-pkg-up": "^2.0.0", + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + } + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } }, - "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", - "dev": true, - "requires": { - "pify": "^2.0.0" - } - }, - "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", - "dev": true, - "requires": { - "load-json-file": "^2.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" - } - }, - "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" - } - } - } - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } - } - }, - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true - }, - "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dev": true, - "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "dependencies": { "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "requires": { - "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-glob": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", - "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "fastest-levenshtein": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", - "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", - "dev": true - }, - "fastq": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", - "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "requires": { - "flat-cache": "^3.0.4" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - } - }, - "flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, - "peer": true - }, - "get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - } - }, - "git-hooks-plus": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/git-hooks-plus/-/git-hooks-plus-1.0.1.tgz", - "integrity": "sha512-IeIEuXySE+EklJieSIXLoFGLuF5ERutODXZz3UCiL1JAjpvZKNyl9j00iF67i5yfX3sKepS1AHN9d3KmUxgWnw==", - "dev": true - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true - }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - }, - "globby": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz", - "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - } - }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-bigints": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", - "dev": true - }, - "hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, - "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - } - } - }, - "import-local": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", - "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", - "dev": true, - "requires": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "interpret": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", - "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", - "dev": true - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-bigint": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz", - "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==", - "dev": true - }, - "is-boolean-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.0.tgz", - "integrity": "sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==", - "dev": true, - "requires": { - "call-bind": "^1.0.0" - } - }, - "is-callable": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", - "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", - "dev": true - }, - "is-core-module": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", - "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, - "is-date-object": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.3.tgz", - "integrity": "sha512-tDpEUInNcy2Yw3lNSepK3Wdw1RnXLcIVienz6Ou631Acl15cJyRWK4dgA1vCmOEgIbtOV0W7MHg+AR2Gdg1NXQ==", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-negative-zero": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", - "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", - "dev": true - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-number-object": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", - "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==", - "dev": true - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-regex": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz", - "integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "has-symbols": "^1.0.1" - } - }, - "is-string": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", - "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", - "dev": true - }, - "is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", - "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", - "dev": true, - "requires": { - "has-symbols": "^1.0.1" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", - "dev": true, - "requires": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", - "dev": true, - "peer": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "just-extend": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", - "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", - "dev": true - }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true - }, - "load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "strip-bom": "^3.0.0" - }, - "dependencies": { - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - } - } - }, - "loader-runner": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", - "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", - "dev": true - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", - "dev": true - }, - "lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", - "dev": true - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, - "mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", - "dev": true - }, - "mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", - "dev": true, - "requires": { - "mime-db": "1.44.0" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "nise": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", - "integrity": "sha512-eQMEmGN/8arp0xsvGoQ+B1qvSkR73B1nWSCh7nOt5neMCtwcQVYQGdzQMhcNscktTsWB54xnlSQFzOAPJD8nXA==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.7.0", - "@sinonjs/fake-timers": "^6.0.0", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "path-to-regexp": "^1.7.0" - } - }, - "node-releases": { - "version": "1.1.71", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.71.tgz", - "integrity": "sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg==", - "dev": true - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "object-inspect": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.2.tgz", - "integrity": "sha512-gz58rdPpadwztRrPjZE9DZLOABUpTGdcANUgOwBFO1C+HZZhePoP83M65WGDmbpwFYJSWqavbl4SgDn4k8RYTA==", - "dev": true - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - }, - "object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - } - }, - "object.values": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz", - "integrity": "sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.2", - "has": "^1.0.3" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "requires": { - "mimic-fn": "^2.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dev": true, - "requires": { - "isarray": "0.0.1" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - } - } - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - } - }, - "prettier": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", - "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", - "dev": true - }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "rechoir": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", - "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", - "dev": true, - "requires": { - "resolve": "^1.9.0" - } - }, - "regenerate": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", - "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", - "dev": true - }, - "regenerate-unicode-properties": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", - "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", - "dev": true, - "requires": { - "regenerate": "^1.4.0" - } - }, - "regenerator-runtime": { - "version": "0.13.7", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", - "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", - "dev": true - }, - "regenerator-transform": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", - "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", - "dev": true, - "requires": { - "@babel/runtime": "^7.8.4" - } - }, - "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "dev": true - }, - "regexpu-core": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz", - "integrity": "sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==", - "dev": true, - "requires": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.2.0", - "regjsgen": "^0.5.1", - "regjsparser": "^0.6.4", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.2.0" - } - }, - "regjsgen": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", - "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", - "dev": true - }, - "regjsparser": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", - "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - } - } - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true - }, - "resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", - "dev": true, - "requires": { - "is-core-module": "^2.1.0", - "path-parse": "^1.0.6" - } - }, - "resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "requires": { - "resolve-from": "^5.0.0" - } - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "schema-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", - "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.6", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "serialize-javascript": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, - "shallow-clone": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", - "dev": true, - "requires": { - "kind-of": "^6.0.2" - } - }, - "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", - "dev": true - }, - "sinon": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-10.0.0.tgz", - "integrity": "sha512-XAn5DxtGVJBlBWYrcYKEhWCz7FLwZGdyvANRyK06419hyEpdT0dMc5A8Vcxg5SCGHc40CsqoKsc1bt1CbJPfNw==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.8.1", - "@sinonjs/fake-timers": "^6.0.1", - "@sinonjs/samsam": "^5.3.1", - "diff": "^4.0.2", - "nise": "^4.1.0", - "supports-color": "^7.1.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-glob": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", + "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, - "source-list-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", - "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", - "dev": true - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - } - } - }, - "string.prototype.trimend": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", - "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" - } - }, - "string.prototype.trimstart": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", - "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "table": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.7.0.tgz", - "integrity": "sha512-SAM+5p6V99gYiiy2gT5ArdzgM1dLDed0nkrWmG6Fry/bUS/m9x83BwpJUOf1Qj/x2qJd+thL6IkIx7qPGRxqBw==", - "dev": true, - "requires": { - "ajv": "^8.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ajv": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.2.0.tgz", - "integrity": "sha512-WSNGFuyWd//XO8n/m/EaOlNLtO0yL8EXT/74LqT4khdhpZjP7lkj/kT5uwRmGitKEVp/Oj7ZUHeGfPtgHhQ5CA==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fastest-levenshtein": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", + "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", + "dev": true + }, + "fastq": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", + "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - } - } - }, - "tapable": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz", - "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==", - "dev": true - }, - "terser-webpack-plugin": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.1.tgz", - "integrity": "sha512-5XNNXZiR8YO6X6KhSGXfY0QrGrCRlSwAEjIIrlRQR4W8nP69TaJUlh3bkuac6zzgspiGPfKEHcY295MMVExl5Q==", - "dev": true, - "requires": { - "jest-worker": "^26.6.2", - "p-limit": "^3.1.0", - "schema-utils": "^3.0.0", - "serialize-javascript": "^5.0.1", - "source-map": "^0.6.1", - "terser": "^5.5.1" - }, - "dependencies": { - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "terser": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.0.tgz", - "integrity": "sha512-HP5/9hp2UaZt5fYkuhNBR8YyRcT8juw8+uFbAme53iN9hblvKnLUTKkmwJG6ocWpIKf8UK4DoeWG4ty0J6S6/g==", - "dev": true, - "requires": { - "commander": "^2.20.0", - "source-map": "~0.7.2", - "source-map-support": "~0.5.19" - }, - "dependencies": { - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true - } - } - } - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "ts-loader": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.1.2.tgz", - "integrity": "sha512-ryMgATvLLl+z8zQvdlm6Pep0slmwxFWIEnq/5VdiLVjqQXnFJgO+qNLGIIP+d2N2jsFZ9MibZCVDb2bSp7OmEA==", - "dev": true, - "requires": { - "chalk": "^4.1.0", - "enhanced-resolve": "^5.0.0", - "micromatch": "^4.0.0", - "semver": "^7.3.4" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } }, - "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } + "flatted": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "peer": true + }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "git-hooks-plus": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/git-hooks-plus/-/git-hooks-plus-1.0.1.tgz", + "integrity": "sha512-IeIEuXySE+EklJieSIXLoFGLuF5ERutODXZz3UCiL1JAjpvZKNyl9j00iF67i5yfX3sKepS1AHN9d3KmUxgWnw==", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "globby": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz", + "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-bigints": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", + "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "dev": true }, "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + } + } + }, + "import-local": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", + "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", + "dev": true, + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "interpret": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", + "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-bigint": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz", + "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==", + "dev": true + }, + "is-boolean-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.0.tgz", + "integrity": "sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==", + "dev": true, + "requires": { + "call-bind": "^1.0.0" + } + }, + "is-callable": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", + "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", + "dev": true + }, + "is-core-module": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", + "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-date-object": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.3.tgz", + "integrity": "sha512-tDpEUInNcy2Yw3lNSepK3Wdw1RnXLcIVienz6Ou631Acl15cJyRWK4dgA1vCmOEgIbtOV0W7MHg+AR2Gdg1NXQ==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-negative-zero": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-number-object": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", + "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-regex": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz", + "integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-symbols": "^1.0.1" + } + }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "jest-worker": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "dev": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "tsconfig-paths": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", - "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", - "dev": true, - "requires": { - "@types/json5": "^0.0.29", - "json5": "^1.0.1", - "minimist": "^1.2.0", - "strip-bom": "^3.0.0" - }, - "dependencies": { "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - } - } - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - }, - "typescript": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", - "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", - "dev": true - }, - "unbox-primitive": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", - "which-boxed-primitive": "^1.0.2" - } - }, - "unicode-canonical-property-names-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", - "dev": true - }, - "unicode-match-property-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", - "dev": true, - "requires": { - "unicode-canonical-property-names-ecmascript": "^1.0.4", - "unicode-property-aliases-ecmascript": "^1.0.4" - } - }, - "unicode-match-property-value-ecmascript": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", - "dev": true - }, - "unicode-property-aliases-ecmascript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", - "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", - "dev": true - }, - "uri-js": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", - "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "watchpack": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.1.1.tgz", - "integrity": "sha512-Oo7LXCmc1eE1AjyuSBmtC3+Wy4HcV8PxWh2kP6fOl8yTlNS7r0K9l1ao2lrrUza7V39Y3D/BbJgY8VeSlc5JKw==", - "dev": true, - "requires": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" - } - }, - "web-ext-types": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/web-ext-types/-/web-ext-types-3.2.1.tgz", - "integrity": "sha512-oQZYDU3W8X867h8Jmt3129kRVKklz70db40Y6OzoTTuzOJpF/dB2KULJUf0txVPyUUXuyzV8GmT3nVvRHoG+Ew==", - "dev": true - }, - "webextension-polyfill": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/webextension-polyfill/-/webextension-polyfill-0.9.0.tgz", - "integrity": "sha512-LTtHb0yR49xa9irkstDxba4GATDAcDw3ncnFH9RImoFwDlW47U95ME5sn5IiQX2ghfaECaf6xyXM8yvClIBkkw==", - "dev": true - }, - "webpack": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.18.0.tgz", - "integrity": "sha512-RmiP/iy6ROvVe/S+u0TrvL/oOmvP+2+Bs8MWjvBwwY/j82Q51XJyDJ75m0QAGntL1Wx6B//Xc0+4VPP/hlNHmw==", - "dev": true, - "requires": { - "@types/eslint-scope": "^3.7.0", - "@types/estree": "^0.0.46", - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/wasm-edit": "1.11.0", - "@webassemblyjs/wasm-parser": "1.11.0", - "acorn": "^8.0.4", - "browserslist": "^4.14.5", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.7.0", - "es-module-lexer": "^0.3.26", - "eslint-scope": "^5.1.1", - "events": "^3.2.0", - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.4", - "json-parse-better-errors": "^1.0.2", - "loader-runner": "^4.2.0", - "mime-types": "^2.1.27", - "neo-async": "^2.6.2", - "pkg-dir": "^5.0.0", - "schema-utils": "^3.0.0", - "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.1.1", - "watchpack": "^2.0.0", - "webpack-sources": "^2.1.1" - }, - "dependencies": { - "acorn": { - "version": "8.2.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.2.4.tgz", - "integrity": "sha512-Ibt84YwBDDA890eDiDCEqcbwvHlBvzzDkU2cGBBDDI1QWT12jTiXIOn2CIw5KK4i6N5Z2HUxwYjzriDyqaqqZg==", - "dev": true + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "peer": true, + "requires": { + "minimist": "^1.2.5" + } }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } + "just-extend": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", + "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "loader-runner": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", + "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", + "dev": true }, "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "requires": { - "p-locate": "^5.0.0" - } + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "dev": true, + "requires": { + "mime-db": "1.44.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "nise": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", + "integrity": "sha512-eQMEmGN/8arp0xsvGoQ+B1qvSkR73B1nWSCh7nOt5neMCtwcQVYQGdzQMhcNscktTsWB54xnlSQFzOAPJD8nXA==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0", + "@sinonjs/fake-timers": "^6.0.0", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "path-to-regexp": "^1.7.0" + } + }, + "node-releases": { + "version": "1.1.71", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.71.tgz", + "integrity": "sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "object-inspect": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.2.tgz", + "integrity": "sha512-gz58rdPpadwztRrPjZE9DZLOABUpTGdcANUgOwBFO1C+HZZhePoP83M65WGDmbpwFYJSWqavbl4SgDn4k8RYTA==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "object.values": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz", + "integrity": "sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.2", + "has": "^1.0.3" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } }, "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } }, "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "requires": { - "p-limit": "^3.0.2" - } + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "dev": true, + "requires": { + "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true }, "pkg-dir": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", - "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==", - "dev": true, - "requires": { - "find-up": "^5.0.0" - } - } - } - }, - "webpack-cli": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.4.0.tgz", - "integrity": "sha512-/Qh07CXfXEkMu5S8wEpjuaw2Zj/CC0hf/qbTDp6N8N7JjdGuaOjZ7kttz+zhuJO/J5m7alQEhNk9lsc4rC6xgQ==", - "dev": true, - "requires": { - "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^1.0.0", - "@webpack-cli/info": "^1.2.1", - "@webpack-cli/serve": "^1.2.2", - "colorette": "^1.2.1", - "commander": "^6.2.0", - "enquirer": "^2.3.6", - "execa": "^5.0.0", - "fastest-levenshtein": "^1.0.12", - "import-local": "^3.0.2", - "interpret": "^2.2.0", - "rechoir": "^0.7.0", - "v8-compile-cache": "^2.2.0", - "webpack-merge": "^5.7.3" - }, - "dependencies": { - "commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", - "dev": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "execa": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz", - "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - } - }, - "get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true - }, - "human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true - }, - "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", - "dev": true - }, - "npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "requires": { - "path-key": "^3.0.0" - } - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "webpack-merge": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.7.3.tgz", - "integrity": "sha512-6/JUQv0ELQ1igjGDzHkXbVDRxkfA57Zw7PfiupdLFJYrgFqY5ZP8xxbpp2lU3EPwYx89ht5Z/aDkD40hFCm5AA==", - "dev": true, - "requires": { - "clone-deep": "^4.0.1", - "wildcard": "^2.0.0" - } - }, - "webpack-sources": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz", - "integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==", - "dev": true, - "requires": { - "source-list-map": "^2.0.1", - "source-map": "^0.6.1" - }, - "dependencies": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "prettier": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", + "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "rechoir": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", + "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", + "dev": true, + "requires": { + "resolve": "^1.9.0" + } + }, + "regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", + "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", + "dev": true, + "requires": { + "regenerate": "^1.4.0" + } + }, + "regenerator-runtime": { + "version": "0.13.7", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", + "dev": true + }, + "regenerator-transform": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", + "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", + "dev": true, + "requires": { + "@babel/runtime": "^7.8.4" + } + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, + "regexpu-core": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz", + "integrity": "sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==", + "dev": true, + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.2.0", + "regjsgen": "^0.5.1", + "regjsparser": "^0.6.4", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.2.0" + } + }, + "regjsgen": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", + "dev": true + }, + "regjsparser": { + "version": "0.6.9", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", + "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + }, + "resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "requires": { + "resolve-from": "^5.0.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "schema-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", + "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.6", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "serialize-javascript": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", + "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "sinon": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-10.0.0.tgz", + "integrity": "sha512-XAn5DxtGVJBlBWYrcYKEhWCz7FLwZGdyvANRyK06419hyEpdT0dMc5A8Vcxg5SCGHc40CsqoKsc1bt1CbJPfNw==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.8.1", + "@sinonjs/fake-timers": "^6.0.1", + "@sinonjs/samsam": "^5.3.1", + "diff": "^4.0.2", + "nise": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, + "source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", + "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "string.prototype.trimend": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", + "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, + "string.prototype.trimstart": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", + "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.0.tgz", + "integrity": "sha512-SAM+5p6V99gYiiy2gT5ArdzgM1dLDed0nkrWmG6Fry/bUS/m9x83BwpJUOf1Qj/x2qJd+thL6IkIx7qPGRxqBw==", + "dev": true, + "requires": { + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ajv": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.2.0.tgz", + "integrity": "sha512-WSNGFuyWd//XO8n/m/EaOlNLtO0yL8EXT/74LqT4khdhpZjP7lkj/kT5uwRmGitKEVp/Oj7ZUHeGfPtgHhQ5CA==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + } + } + }, + "tapable": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz", + "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==", + "dev": true + }, + "terser-webpack-plugin": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.1.tgz", + "integrity": "sha512-5XNNXZiR8YO6X6KhSGXfY0QrGrCRlSwAEjIIrlRQR4W8nP69TaJUlh3bkuac6zzgspiGPfKEHcY295MMVExl5Q==", + "dev": true, + "requires": { + "jest-worker": "^26.6.2", + "p-limit": "^3.1.0", + "schema-utils": "^3.0.0", + "serialize-javascript": "^5.0.1", + "source-map": "^0.6.1", + "terser": "^5.5.1" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "terser": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.0.tgz", + "integrity": "sha512-HP5/9hp2UaZt5fYkuhNBR8YyRcT8juw8+uFbAme53iN9hblvKnLUTKkmwJG6ocWpIKf8UK4DoeWG4ty0J6S6/g==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.7.2", + "source-map-support": "~0.5.19" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true + } + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "ts-loader": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.1.2.tgz", + "integrity": "sha512-ryMgATvLLl+z8zQvdlm6Pep0slmwxFWIEnq/5VdiLVjqQXnFJgO+qNLGIIP+d2N2jsFZ9MibZCVDb2bSp7OmEA==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "enhanced-resolve": "^5.0.0", + "micromatch": "^4.0.0", + "semver": "^7.3.4" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "tsconfig-paths": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "typescript": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "dev": true + }, + "unbox-primitive": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", + "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has-bigints": "^1.0.1", + "has-symbols": "^1.0.2", + "which-boxed-primitive": "^1.0.2" + } + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "dev": true + }, + "uri-js": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "watchpack": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.1.1.tgz", + "integrity": "sha512-Oo7LXCmc1eE1AjyuSBmtC3+Wy4HcV8PxWh2kP6fOl8yTlNS7r0K9l1ao2lrrUza7V39Y3D/BbJgY8VeSlc5JKw==", + "dev": true, + "requires": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + } + }, + "web-ext-types": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-ext-types/-/web-ext-types-3.2.1.tgz", + "integrity": "sha512-oQZYDU3W8X867h8Jmt3129kRVKklz70db40Y6OzoTTuzOJpF/dB2KULJUf0txVPyUUXuyzV8GmT3nVvRHoG+Ew==", + "dev": true + }, + "webextension-polyfill": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/webextension-polyfill/-/webextension-polyfill-0.9.0.tgz", + "integrity": "sha512-LTtHb0yR49xa9irkstDxba4GATDAcDw3ncnFH9RImoFwDlW47U95ME5sn5IiQX2ghfaECaf6xyXM8yvClIBkkw==", + "dev": true + }, + "webpack": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.18.0.tgz", + "integrity": "sha512-RmiP/iy6ROvVe/S+u0TrvL/oOmvP+2+Bs8MWjvBwwY/j82Q51XJyDJ75m0QAGntL1Wx6B//Xc0+4VPP/hlNHmw==", + "dev": true, + "requires": { + "@types/eslint-scope": "^3.7.0", + "@types/estree": "^0.0.46", + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/wasm-edit": "1.11.0", + "@webassemblyjs/wasm-parser": "1.11.0", + "acorn": "^8.0.4", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.7.0", + "es-module-lexer": "^0.3.26", + "eslint-scope": "^5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.4", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "pkg-dir": "^5.0.0", + "schema-utils": "^3.0.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.1.1", + "watchpack": "^2.0.0", + "webpack-sources": "^2.1.1" + }, + "dependencies": { + "acorn": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.2.4.tgz", + "integrity": "sha512-Ibt84YwBDDA890eDiDCEqcbwvHlBvzzDkU2cGBBDDI1QWT12jTiXIOn2CIw5KK4i6N5Z2HUxwYjzriDyqaqqZg==", + "dev": true + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "pkg-dir": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", + "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==", + "dev": true, + "requires": { + "find-up": "^5.0.0" + } + } + } + }, + "webpack-cli": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.4.0.tgz", + "integrity": "sha512-/Qh07CXfXEkMu5S8wEpjuaw2Zj/CC0hf/qbTDp6N8N7JjdGuaOjZ7kttz+zhuJO/J5m7alQEhNk9lsc4rC6xgQ==", + "dev": true, + "requires": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^1.0.0", + "@webpack-cli/info": "^1.2.1", + "@webpack-cli/serve": "^1.2.2", + "colorette": "^1.2.1", + "commander": "^6.2.0", + "enquirer": "^2.3.6", + "execa": "^5.0.0", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^2.2.0", + "rechoir": "^0.7.0", + "v8-compile-cache": "^2.2.0", + "webpack-merge": "^5.7.3" + }, + "dependencies": { + "commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "execa": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz", + "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "webpack-merge": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.7.3.tgz", + "integrity": "sha512-6/JUQv0ELQ1igjGDzHkXbVDRxkfA57Zw7PfiupdLFJYrgFqY5ZP8xxbpp2lU3EPwYx89ht5Z/aDkD40hFCm5AA==", + "dev": true, + "requires": { + "clone-deep": "^4.0.1", + "wildcard": "^2.0.0" + } + }, + "webpack-sources": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz", + "integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==", + "dev": true, + "requires": { + "source-list-map": "^2.0.1", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "whatwg-fetch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", + "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==", + "dev": true + }, + "which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "requires": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + } + }, + "wildcard": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", + "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", + "dev": true + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true } - } - }, - "whatwg-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", - "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==", - "dev": true - }, - "which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "requires": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - } - }, - "wildcard": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", - "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", - "dev": true - }, - "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true } - } } diff --git a/package.json b/package.json index 0700868..dc8d76b 100644 --- a/package.json +++ b/package.json @@ -1,65 +1,65 @@ { - "name": "desmos-unlocked", - "version": "1.0.3", - "description": "Browser extension for better user control of the Desmos graphing calculator configuration ", - "main": "background.js", - "scripts": { - "code:lint": "eslint '**/**/*.{ts,tsx}'", - "code:lint-fix": "eslint --fix '**/**/*.{ts,tsx}'", - "code:prettier": "prettier --write '**/**/*.{ts,tsx,js,html,css}'", - "code:typecheck": "./node_modules/.bin/tsc --noEmit", - "app:chrome": "rimraf dist && cross-env BROWSER='chrome' webpack --config webpack/webpack.prod.js", - "app:chrome-dev": "cross-env BROWSER='chrome' webpack --config webpack/webpack.dev.js --watch", - "app:edge": "rimraf dist && cross-env BROWSER='edge' webpack --config webpack/webpack.prod.js", - "app:edge-dev": "cross-env BROWSER='edge' webpack --config webpack/webpack.dev.js --watch", - "app:opera": "rimraf dist && cross-env BROWSER='opera' webpack --config webpack/webpack.prod.js", - "app:opera-dev": "cross-env BROWSER='opera' webpack --config webpack/webpack.dev.js --watch", - "app:firefox": "rimraf dist && cross-env BROWSER='firefox' webpack --config webpack/webpack.prod.js", - "app:firefox-dev": "cross-env BROWSER='firefox' webpack --config webpack/webpack.dev.js --watch" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/davidnguyen179/web-extension-boilerplate.git" - }, - "keywords": [ - "chrome extension", - "microsoft edge extension", - "opera extension", - "firefox addon", - "web extension", - "typescript", - "ts", - "sinon" - ], - "author": "Matthew Sinclair", - "license": "MIT", - "bugs": { - "url": "https://github.com/SinclaM/desmos-unlocked/issues" - }, - "homepage": "https://github.com/SinclaM/desmos-unlocked#readme", - "devDependencies": { - "@babel/preset-env": "7.12.11", - "@babel/preset-typescript": "7.12.7", - "@types/chrome": "0.0.135", - "@types/sinon": "^10.0.0", - "@typescript-eslint/eslint-plugin": "4.17.0", - "@typescript-eslint/parser": "4.17.0", - "copy-webpack-plugin": "^8.1.1", - "cross-env": "7.0.3", - "eslint": "7.21.0", - "eslint-plugin-import": "2.22.1", - "git-hooks-plus": "1.0.1", - "prettier": "2.2.1", - "rimraf": "^3.0.2", - "sinon": "^10.0.0", - "terser-webpack-plugin": "5.1.1", - "ts-loader": "^9.1.1", - "typescript": "^4.2.4", - "web-ext-types": "3.2.1", - "webextension-polyfill": "^0.9.0", - "webpack": "5.18.0", - "webpack-cli": "4.4.0", - "webpack-merge": "5.7.3", - "whatwg-fetch": "3.0.0" - } + "name": "desmos-unlocked", + "version": "1.0.3", + "description": "Browser extension for better user control of the Desmos graphing calculator configuration ", + "main": "background.js", + "scripts": { + "code:lint": "eslint '**/**/*.ts'", + "code:lint-fix": "eslint --fix '**/**/*.ts'", + "code:prettier": "prettier --write '**/**/*.{ts,js,html,css,json}'", + "code:check": "./node_modules/.bin/tsc --noEmit && prettier --check '**/**/*.{ts,js,html,css,json}' && NODE_ENV=prod eslint '**/**/*.ts'", + "app:chrome": "rimraf dist && cross-env BROWSER='chrome' webpack --config webpack/webpack.prod.js", + "app:chrome-dev": "cross-env BROWSER='chrome' webpack --config webpack/webpack.dev.js --watch", + "app:edge": "rimraf dist && cross-env BROWSER='edge' webpack --config webpack/webpack.prod.js", + "app:edge-dev": "cross-env BROWSER='edge' webpack --config webpack/webpack.dev.js --watch", + "app:opera": "rimraf dist && cross-env BROWSER='opera' webpack --config webpack/webpack.prod.js", + "app:opera-dev": "cross-env BROWSER='opera' webpack --config webpack/webpack.dev.js --watch", + "app:firefox": "rimraf dist && cross-env BROWSER='firefox' webpack --config webpack/webpack.prod.js", + "app:firefox-dev": "cross-env BROWSER='firefox' webpack --config webpack/webpack.dev.js --watch" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/davidnguyen179/web-extension-boilerplate.git" + }, + "keywords": [ + "chrome extension", + "microsoft edge extension", + "opera extension", + "firefox addon", + "web extension", + "typescript", + "ts", + "sinon" + ], + "author": "Matthew Sinclair", + "license": "MIT", + "bugs": { + "url": "https://github.com/SinclaM/desmos-unlocked/issues" + }, + "homepage": "https://github.com/SinclaM/desmos-unlocked#readme", + "devDependencies": { + "@babel/preset-env": "7.12.11", + "@babel/preset-typescript": "7.12.7", + "@types/chrome": "0.0.135", + "@types/sinon": "^10.0.0", + "@typescript-eslint/eslint-plugin": "4.17.0", + "@typescript-eslint/parser": "4.17.0", + "copy-webpack-plugin": "^8.1.1", + "cross-env": "7.0.3", + "eslint": "7.21.0", + "eslint-plugin-import": "2.22.1", + "git-hooks-plus": "1.0.1", + "prettier": "2.2.1", + "rimraf": "^3.0.2", + "sinon": "^10.0.0", + "terser-webpack-plugin": "5.1.1", + "ts-loader": "^9.1.1", + "typescript": "^4.2.4", + "web-ext-types": "3.2.1", + "webextension-polyfill": "^0.9.0", + "webpack": "5.18.0", + "webpack-cli": "4.4.0", + "webpack-merge": "5.7.3", + "whatwg-fetch": "3.0.0" + } } diff --git a/public/net_request_rules.json b/public/net_request_rules.json index d18ffd7..9ae589e 100644 --- a/public/net_request_rules.json +++ b/public/net_request_rules.json @@ -1,25 +1,24 @@ [ - { - "id": 1, - "priority": 1, - "action": { - "type": "redirect", - "redirect": {"extensionPath": "/empty.js"} + { + "id": 1, + "priority": 1, + "action": { + "type": "redirect", + "redirect": { "extensionPath": "/empty.js" } + }, + "condition": { + "urlFilter": "https://www.desmos.com/assets/build/calculator_desktop-*.js|" + } }, - "condition": { - "urlFilter": "https://www.desmos.com/assets/build/calculator_desktop-*.js|" + { + "id": 2, + "priority": 2, + "action": { + "type": "redirect", + "redirect": { "extensionPath": "/empty.js" } + }, + "condition": { + "urlFilter": "https://www.desmos.com/assets/build/calculator_desktop-*.js?|" + } } - }, - { - "id": 2, - "priority": 2, - "action": { - "type": "redirect", - "redirect": {"extensionPath": "/empty.js"} - }, - "condition": { - "urlFilter": "https://www.desmos.com/assets/build/calculator_desktop-*.js?|" - } - } ] - diff --git a/src/script.ts b/src/script.ts index a0b9b1f..a9e04d1 100644 --- a/src/script.ts +++ b/src/script.ts @@ -3,7 +3,6 @@ import { pollForValue } from "./utils/utils"; import window from "./globals/window"; import { MathQuillConfig } from "./globals/config"; - const handler = (({ detail }: CustomEvent) => { // Have to wait for all the preload modifications to finish pollForValue(() => window.Desmos?.MathQuill?.config).then(() => { diff --git a/tsconfig.json b/tsconfig.json index 1be2b95..98c0b97 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,19 +1,18 @@ { - "compilerOptions": { - "outDir": "./dist/", - "sourceMap": true, - "strictNullChecks": false, - "module": "esnext", - "moduleResolution": "node", - "allowSyntheticDefaultImports": true, - "jsx": "react", - "jsxFactory": "DCGView.jsx", - "target": "es6", - "allowJs": true, - "strict": true, - "baseUrl": "src", - "noImplicitAny": false - }, - "include": ["./src/"] + "compilerOptions": { + "outDir": "./dist/", + "sourceMap": true, + "strictNullChecks": false, + "module": "esnext", + "moduleResolution": "node", + "allowSyntheticDefaultImports": true, + "jsx": "react", + "jsxFactory": "DCGView.jsx", + "target": "es6", + "allowJs": true, + "strict": true, + "baseUrl": "src", + "noImplicitAny": false + }, + "include": ["./src/"] } - From ef9ac24980d1b9149e2d0ed6d737b0c97deee778 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Mon, 18 Jul 2022 11:44:05 -0500 Subject: [PATCH 31/32] Update version to 1.0.4 --- package-lock.json | 4 ++-- package.json | 2 +- public/chrome_manifest.json | 2 +- public/edge_manifest.json | 2 +- public/firefox_manifest.json | 2 +- public/opera_manifest.json | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2b1d556..45929f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "desmos-unlocked", - "version": "1.0.3", + "version": "1.0.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "desmos-unlocked", - "version": "1.0.3", + "version": "1.0.4", "license": "MIT", "devDependencies": { "@babel/preset-env": "7.12.11", diff --git a/package.json b/package.json index dc8d76b..f15f153 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "desmos-unlocked", - "version": "1.0.3", + "version": "1.0.4", "description": "Browser extension for better user control of the Desmos graphing calculator configuration ", "main": "background.js", "scripts": { diff --git a/public/chrome_manifest.json b/public/chrome_manifest.json index 2767f8e..08bad01 100644 --- a/public/chrome_manifest.json +++ b/public/chrome_manifest.json @@ -1,6 +1,6 @@ { "name": "Desmos Unlocked", - "version": "1.0.3", + "version": "1.0.4", "description": "Browser extension for better user control of the Desmos graphing calculator configuration", "permissions": ["storage", "declarativeNetRequest", "declarativeNetRequestWithHostAccess", "webRequest"], "manifest_version": 3, diff --git a/public/edge_manifest.json b/public/edge_manifest.json index 2767f8e..08bad01 100644 --- a/public/edge_manifest.json +++ b/public/edge_manifest.json @@ -1,6 +1,6 @@ { "name": "Desmos Unlocked", - "version": "1.0.3", + "version": "1.0.4", "description": "Browser extension for better user control of the Desmos graphing calculator configuration", "permissions": ["storage", "declarativeNetRequest", "declarativeNetRequestWithHostAccess", "webRequest"], "manifest_version": 3, diff --git a/public/firefox_manifest.json b/public/firefox_manifest.json index c6bb872..de472f9 100644 --- a/public/firefox_manifest.json +++ b/public/firefox_manifest.json @@ -1,6 +1,6 @@ { "name": "Desmos Unlocked", - "version": "1.0.3", + "version": "1.0.4", "description": "Browser extension for better user control of the Desmos graphing calculator configuration", "permissions": ["https://*.desmos.com/*", "storage", "webRequest", "webRequestBlocking"], "manifest_version": 2, diff --git a/public/opera_manifest.json b/public/opera_manifest.json index ba2b64b..d5bebac 100644 --- a/public/opera_manifest.json +++ b/public/opera_manifest.json @@ -1,6 +1,6 @@ { "name": "Desmos Unlocked", - "version": "1.0.3", + "version": "1.0.4", "description": "Browser extension for better user control of the Desmos graphing calculator configuration", "permissions": ["https://*.desmos.com/*", "storage", "webRequest", "webRequestBlocking"], "manifest_version": 2, From ccbb1dfb7cfca97a670a52a10600a6cb38f43241 Mon Sep 17 00:00:00 2001 From: SinclaM Date: Mon, 18 Jul 2022 11:57:58 -0500 Subject: [PATCH 32/32] Change console logging from error to warning --- .eslintrc.js | 2 +- package.json | 2 +- src/background/chrome/background.ts | 1 - src/background/edge/background.ts | 1 - src/background/firefox/background.ts | 3 --- src/background/opera/background.ts | 3 --- src/preload/content.ts | 12 ++---------- src/preload/script.ts | 3 --- 8 files changed, 4 insertions(+), 23 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 09b9435..2685127 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -29,7 +29,7 @@ module.exports = { ], "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/explicit-module-boundary-types": "off", - "no-console": process.env.NODE_ENV === "prod" ? "error" : "warn", + "no-console": "warn", "no-constant-condition": "off", "@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/no-inferrable-types": "off", diff --git a/package.json b/package.json index f15f153..cc244b0 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "code:lint": "eslint '**/**/*.ts'", "code:lint-fix": "eslint --fix '**/**/*.ts'", "code:prettier": "prettier --write '**/**/*.{ts,js,html,css,json}'", - "code:check": "./node_modules/.bin/tsc --noEmit && prettier --check '**/**/*.{ts,js,html,css,json}' && NODE_ENV=prod eslint '**/**/*.ts'", + "code:check": "./node_modules/.bin/tsc --noEmit && prettier --check '**/**/*.{ts,js,html,css,json}' && eslint '**/**/*.ts'", "app:chrome": "rimraf dist && cross-env BROWSER='chrome' webpack --config webpack/webpack.prod.js", "app:chrome-dev": "cross-env BROWSER='chrome' webpack --config webpack/webpack.dev.js --watch", "app:edge": "rimraf dist && cross-env BROWSER='edge' webpack --config webpack/webpack.prod.js", diff --git a/src/background/chrome/background.ts b/src/background/chrome/background.ts index 6518704..f519b8a 100644 --- a/src/background/chrome/background.ts +++ b/src/background/chrome/background.ts @@ -14,7 +14,6 @@ chrome.runtime.onInstalled.addListener(function () { // initialize the calculator. chrome.webRequest.onBeforeRedirect.addListener( async function ({ url }) { - console.log(url.endsWith("?")); const tabs = await chrome.tabs.query({ active: true, currentWindow: true }); while (true) { // The request to calculator_desktop (and the following redirect) may happen diff --git a/src/background/edge/background.ts b/src/background/edge/background.ts index 6518704..f519b8a 100644 --- a/src/background/edge/background.ts +++ b/src/background/edge/background.ts @@ -14,7 +14,6 @@ chrome.runtime.onInstalled.addListener(function () { // initialize the calculator. chrome.webRequest.onBeforeRedirect.addListener( async function ({ url }) { - console.log(url.endsWith("?")); const tabs = await chrome.tabs.query({ active: true, currentWindow: true }); while (true) { // The request to calculator_desktop (and the following redirect) may happen diff --git a/src/background/firefox/background.ts b/src/background/firefox/background.ts index f54f1db..691188c 100644 --- a/src/background/firefox/background.ts +++ b/src/background/firefox/background.ts @@ -20,12 +20,9 @@ browser.webRequest.onBeforeRequest.addListener( const tabs = await browser.tabs.query({ active: true, currentWindow: true }); if (url.endsWith(".js")) { - console.log(url); const isDesmodderActive: boolean | void = await browser.tabs.sendMessage(tabs[0].id, { message: "check-desmodder", }); - console.log("Message from the content script:"); - console.log(isDesmodderActive); // If DesModder is not active, then we should immediately inject the preload script // and begin overrides. There won't be another opportunity. diff --git a/src/background/opera/background.ts b/src/background/opera/background.ts index f54f1db..691188c 100644 --- a/src/background/opera/background.ts +++ b/src/background/opera/background.ts @@ -20,12 +20,9 @@ browser.webRequest.onBeforeRequest.addListener( const tabs = await browser.tabs.query({ active: true, currentWindow: true }); if (url.endsWith(".js")) { - console.log(url); const isDesmodderActive: boolean | void = await browser.tabs.sendMessage(tabs[0].id, { message: "check-desmodder", }); - console.log("Message from the content script:"); - console.log(isDesmodderActive); // If DesModder is not active, then we should immediately inject the preload script // and begin overrides. There won't be another opportunity. diff --git a/src/preload/content.ts b/src/preload/content.ts index 156856a..f48d71a 100644 --- a/src/preload/content.ts +++ b/src/preload/content.ts @@ -1,5 +1,3 @@ -console.log("Preload running..."); - browser.runtime.onMessage.addListener(async function (request) { let isDesmodderActive: boolean; switch (request.message) { @@ -9,21 +7,17 @@ browser.runtime.onMessage.addListener(async function (request) { // will block this request, result in an exception being thrown. // Note: this case only applies to the manifest v2 versions of this extension. case "check-desmodder": - console.log(`preload_content heard message: ${request.message}`); try { await fetch("https://www.desmos.com/assets/build/calculator_desktop-this_does_not_exist.js"); isDesmodderActive = false; - console.log("preload_content reports DesModder is NOT active"); } catch { isDesmodderActive = true; - console.log("preload_content reports DesModder is active"); } return Promise.resolve(isDesmodderActive); // Inject the script which sets up ALMOND_OVERRIDES and wait for it to finish. // Note: this case only applies to the manifest v2 versions of this extension. case "inject-preload": - console.log(`preload_content heard message: ${request.message}`); await new Promise(function (resolve) { const script = document.createElement("script"); script.src = browser.runtime.getURL("preloadScript.js"); @@ -31,7 +25,7 @@ browser.runtime.onMessage.addListener(async function (request) { script.remove(); resolve(); }; - script.onerror = (e) => console.log(e); + script.onerror = (e) => console.error(e); (document.head || document.documentElement).appendChild(script); }); return Promise.resolve(); @@ -40,8 +34,6 @@ browser.runtime.onMessage.addListener(async function (request) { // Then, inject the script which loads in the calculator and wait for it to finish. // Note: this case only applies to the manifest v3 versions of this extension. case "redirect-detected": - console.log(`preload_content heard message: ${request.message}`); - console.log(`url detected is ${request.url}`); await new Promise(function (resolve) { const script = document.createElement("script"); script.src = browser.runtime.getURL("preloadScript.js"); @@ -54,7 +46,7 @@ browser.runtime.onMessage.addListener(async function (request) { script.remove(); resolve(); }; - script.onerror = (e) => console.log(e); + script.onerror = (e) => console.error(e); (document.head || document.documentElement).appendChild(script); }); return Promise.resolve(); diff --git a/src/preload/script.ts b/src/preload/script.ts index 25c2100..999900f 100644 --- a/src/preload/script.ts +++ b/src/preload/script.ts @@ -25,8 +25,6 @@ const isDesmodderActive: boolean = window.ALMOND_OVERRIDES; window.ALMOND_OVERRIDES = new Proxy(isDesmodderActive ? window.ALMOND_OVERRIDES : {}, { get(target, prop, receiver) { if (prop === "define") { - console.log("ALMOND_OVERRIDES proxy success"); - // If DesModder is enabled, we have to make sure to forward the operation // to DesModder's own ALMOND_OVERRIDES proxy. If we use ALMOND_OVERRIDES.define, // we'll get infinite recursion. And if we just use window.define, then we'll @@ -77,7 +75,6 @@ if (document.currentScript.getAttribute("run-calculator")) { Now we load it, but with '??' appended to prevent the web request rules from blocking it */ const script = document.createElement("script"); script.src = src + "??"; - console.log(src); script.async = false; script.onload = () => { // remove from DOM