@alan-ai/alan-sdk-web
Version:
Alan Web SDK: a lightweight JavaScript library for adding a voice experience to your website or web application
25 lines (24 loc) • 11.6 MB
JavaScript
;(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
root.alanBtn = factory();
}
}(this, function() {
(function () {
window.MathJax = {
startup: {
pageReady: function () {
window.mj = MathJax;
return MathJax.startup.defaultPageReady();
}
},
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']],
processEscapes: true
}
};
})();
!function(t){var e={};function r(Q){if(e[Q])return e[Q].exports;var T=e[Q]={i:Q,l:!1,exports:{}};return t[Q].call(T.exports,T,T.exports,r),T.l=!0,T.exports}r.m=t,r.c=e,r.d=function(Q,T,t){r.o(Q,T)||Object.defineProperty(Q,T,{enumerable:!0,get:t})},r.r=function(Q){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Q,"__esModule",{value:!0})},r.t=function(T,Q){if(1&Q&&(T=r(T)),8&Q)return T;if(4&Q&&"object"==typeof T&&T&&T.__esModule)return T;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:T}),2&Q&&"string"!=typeof T)for(var e in T)r.d(t,e,function(Q){return T[Q]}.bind(null,e));return t},r.n=function(Q){var T=Q&&Q.__esModule?function(){return Q.default}:function(){return Q};return r.d(T,"a",T),T},r.o=function(Q,T){return Object.prototype.hasOwnProperty.call(Q,T)},r.p="",r(r.s=230)}([function(Q,o,T){"use strict";var e,t=this&&this.__extends||(e=function(Q,T){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,T){Q.__proto__=T}||function(Q,T){for(var t in T)T.hasOwnProperty(t)&&(Q[t]=T[t])})(Q,T)},function(Q,T){function t(){this.constructor=Q}e(Q,T),Q.prototype=null===T?Object.create(T):(t.prototype=T.prototype,new t)}),a=this&&this.__assign||function(){return(a=Object.assign||function(Q){for(var T,t=1,e=arguments.length;t<e;t++)for(var r in T=arguments[t])Object.prototype.hasOwnProperty.call(T,r)&&(Q[r]=T[r]);return Q}).apply(this,arguments)},u=this&&this.__values||function(Q){var T="function"==typeof Symbol&&Q[Symbol.iterator],t=0;return T?T.call(Q):{next:function(){return Q&&t>=Q.length&&(Q=void 0),{value:Q&&Q[t++],done:!Q}}}},h=this&&this.__read||function(Q,T){var t="function"==typeof Symbol&&Q[Symbol.iterator];if(!t)return Q;var e,r,n=t.call(Q),i=[];try{for(;(void 0===T||0<T--)&&!(e=n.next()).done;)i.push(e.value)}catch(Q){r={error:Q}}finally{try{e&&!e.done&&(t=n.return)&&t.call(n)}finally{if(r)throw r.error}}return i};Object.defineProperty(o,"__esModule",{value:!0});var r=T(17),n=T(45);o.TEXCLASS={ORD:0,OP:1,BIN:2,REL:3,OPEN:4,CLOSE:5,PUNCT:6,INNER:7,VCENTER:8,NONE:-1},o.TEXCLASSNAMES=["ORD","OP","BIN","REL","OPEN","CLOSE","PUNCT","INNER","VCENTER"];var i=["","thinmathspace","mediummathspace","thickmathspace"],s=[[0,-1,2,3,0,0,0,1],[-1,-1,0,3,0,0,0,1],[2,2,0,0,2,0,0,2],[3,3,0,0,3,0,0,3],[0,0,0,0,0,0,0,0],[0,-1,2,3,0,0,0,1],[1,1,0,1,1,1,1,1],[1,-1,2,3,1,0,1,1]];o.indentAttributes=["indentalign","indentalignfirst","indentshift","indentshiftfirst"];var L,H=(L=n.AbstractNode,t(p,L),Object.defineProperty(p.prototype,"isToken",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"isEmbellished",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"isSpacelike",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"linebreakContainer",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"hasNewLine",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"arity",{get:function(){return 1/0},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"isInferred",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"Parent",{get:function(){for(var Q=this.parent;Q&&Q.notParent;)Q=Q.Parent;return Q},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"notParent",{get:function(){return!1},enumerable:!0,configurable:!0}),p.prototype.setChildren=function(Q){return this.arity<0?this.childNodes[0].setChildren(Q):L.prototype.setChildren.call(this,Q)},p.prototype.appendChild=function(Q){return this.arity<0?(this.childNodes[0].appendChild(Q),Q):L.prototype.appendChild.call(this,Q)},p.prototype.replaceChild=function(Q,T){return this.arity<0?(this.childNodes[0].replaceChild(Q,T),Q):L.prototype.replaceChild.call(this,Q,T)},p.prototype.core=function(){return this},p.prototype.coreMO=function(){return this},p.prototype.coreIndex=function(){return 0},p.prototype.childPosition=function(){for(var T,Q,t=this,e=t.parent;e&&e.notParent;)e=(t=e).parent;if(e){var r=0;try{for(var n=u(e.childNodes),i=n.next();!i.done;i=n.next()){if(i.value===t)return r;r++}}catch(Q){T={error:Q}}finally{try{i&&!i.done&&(Q=n.return)&&Q.call(n)}finally{if(T)throw T.error}}}return null},p.prototype.setTeXclass=function(Q){return this.getPrevClass(Q),null!=this.texClass?this:Q},p.prototype.updateTeXclass=function(Q){Q&&(this.prevClass=Q.prevClass,this.prevLevel=Q.prevLevel,Q.prevClass=Q.prevLevel=null,this.texClass=Q.texClass)},p.prototype.getPrevClass=function(Q){Q&&(this.prevClass=Q.texClass,this.prevLevel=Q.attributes.get("scriptlevel"))},p.prototype.texSpacing=function(){var Q=null!=this.prevClass?this.prevClass:o.TEXCLASS.NONE,T=this.texClass||o.TEXCLASS.ORD;if(Q===o.TEXCLASS.NONE||T===o.TEXCLASS.NONE)return"";Q===o.TEXCLASS.VCENTER&&(Q=o.TEXCLASS.ORD),T===o.TEXCLASS.VCENTER&&(T=o.TEXCLASS.ORD);var t=s[Q][T];return(0<this.prevLevel||0<this.attributes.get("scriptlevel"))&&0<=t?"":i[Math.abs(t)]},p.prototype.hasSpacingAttributes=function(){return this.isEmbellished&&this.coreMO().hasSpacingAttributes()},p.prototype.setInheritedAttributes=function(Q,T,t,e){var r,n;void 0===Q&&(Q={}),void 0===T&&(T=!1),void 0===t&&(t=0),void 0===e&&(e=!1);var i=this.attributes.getAllDefaults();try{for(var o=u(Object.keys(Q)),a=o.next();!a.done;a=o.next()){var s=a.value;if(i.hasOwnProperty(s)){var L=h(Q[s],2),H=L[0],l=L[1];((p.noInherit[H]||{})[this.kind]||{})[s]||this.attributes.setInherited(s,l)}}}catch(Q){r={error:Q}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}void 0===this.attributes.getExplicit("displaystyle")&&this.attributes.setInherited("displaystyle",T),void 0===this.attributes.getExplicit("scriptlevel")&&this.attributes.setInherited("scriptlevel",t),e&&this.setProperty("texprimestyle",e);var c=this.arity;if(0<=c&&c!==1/0&&(1===c&&0===this.childNodes.length||1!==c&&this.childNodes.length!==c))if(c<this.childNodes.length)this.childNodes=this.childNodes.slice(0,c);else for(;this.childNodes.length<c;)this.appendChild(this.factory.create("mrow"));this.setChildInheritedAttributes(Q,T,t,e)},p.prototype.setChildInheritedAttributes=function(Q,T,t,e){var r,n;try{for(var i=u(this.childNodes),o=i.next();!o.done;o=i.next())o.value.setInheritedAttributes(Q,T,t,e)}catch(Q){r={error:Q}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},p.prototype.addInheritedAttributes=function(Q,T){var t,e,r=a({},Q);try{for(var n=u(Object.keys(T)),i=n.next();!i.done;i=n.next()){var o=i.value;"displaystyle"!==o&&"scriptlevel"!==o&&"style"!==o&&(r[o]=[this.kind,T[o]])}}catch(Q){t={error:Q}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return r},p.prototype.inheritAttributesFrom=function(Q){var T=Q.attributes,t=T.get("displaystyle"),e=T.get("scriptlevel"),r=T.isSet("mathsize")?{mathsize:["math",T.get("mathsize")]}:{},n=Q.getProperty("texprimestyle")||!1;this.setInheritedAttributes(r,t,e,n)},p.prototype.verifyTree=function(Q){if(void 0===Q&&(Q=null),null!==Q){this.verifyAttributes(Q);var T=this.arity;Q.checkArity&&0<=T&&T!==1/0&&(1===T&&0===this.childNodes.length||1!==T&&this.childNodes.length!==T)&&this.mError('Wrong number of children for "'+this.kind+'" node',Q,!0),this.verifyChildren(Q)}},p.prototype.verifyAttributes=function(Q){var T,t;if(Q.checkAttributes){var e=this.attributes,r=[];try{for(var n=u(e.getExplicitNames()),i=n.next();!i.done;i=n.next()){var o=i.value;"data-"===o.substr(0,5)||void 0!==e.getDefault(o)||o.match(/^(?:class|style|id|(?:xlink:)?href)$/)||r.push(o)}}catch(Q){T={error:Q}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(T)throw T.error}}r.length&&this.mError("Unknown attributes for "+this.kind+" node: "+r.join(", "),Q)}},p.prototype.verifyChildren=function(Q){var T,t;try{for(var e=u(this.childNodes),r=e.next();!r.done;r=e.next())r.value.verifyTree(Q)}catch(Q){T={error:Q}}finally{try{r&&!r.done&&(t=e.return)&&t.call(e)}finally{if(T)throw T.error}}},p.prototype.mError=function(Q,T,t){if(void 0===t&&(t=!1),!this.parent||!this.parent.isKind("merror")){var e=this.factory.create("merror");if(T.fullErrors||t){var r=this.factory.create("mtext"),n=this.factory.create("text");n.setText(T.fullErrors?Q:this.kind),r.appendChild(n),e.appendChild(r),this.parent.replaceChild(e,this)}else this.parent.replaceChild(e,this),e.appendChild(this);return e}},p.defaults={mathbackground:r.INHERIT,mathcolor:r.INHERIT,mathsize:r.INHERIT,dir:r.INHERIT},p.noInherit={mstyle:{mpadded:{width:!0,height:!0,depth:!0,lspace:!0,voffset:!0},mtable:{width:!0,height:!0,depth:!0,align:!0}},maligngroup:{mrow:{groupalign:!0},mtable:{groupalign:!0}}},p.verifyDefaults={checkArity:!0,checkAttributes:!1,fullErrors:!1,fixMmultiscripts:!0,fixMtables:!0},p);function p(Q,T,t){void 0===T&&(T={}),void 0===t&&(t=[]);var e=L.call(this,Q)||this;return e.texClass=null,e.prevClass=null,e.prevLevel=null,e.arity<0&&(e.childNodes=[Q.create("inferredMrow")],e.childNodes[0].parent=e),e.setChildren(t),e.attributes=new r.Attributes(Q.getNodeClass(e.kind).defaults,Q.getNodeClass("math").defaults),e.attributes.setList(T),e}o.AbstractMmlNode=H;var l,c=(t(d,l=H),Object.defineProperty(d.prototype,"isToken",{get:function(){return!0},enumerable:!0,configurable:!0}),d.prototype.getText=function(){var T,Q,t="";try{for(var e=u(this.childNodes),r=e.next();!r.done;r=e.next()){var n=r.value;n instanceof E&&(t+=n.getText())}}catch(Q){T={error:Q}}finally{try{r&&!r.done&&(Q=e.return)&&Q.call(e)}finally{if(T)throw T.error}}return t},d.prototype.setChildInheritedAttributes=function(Q,T,t,e){var r,n;try{for(var i=u(this.childNodes),o=i.next();!o.done;o=i.next()){var a=o.value;a instanceof H&&a.setInheritedAttributes(Q,T,t,e)}}catch(Q){r={error:Q}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},d.prototype.walkTree=function(Q,T){var t,e;Q(this,T);try{for(var r=u(this.childNodes),n=r.next();!n.done;n=r.next()){var i=n.value;i instanceof H&&i.walkTree(Q,T)}}catch(Q){t={error:Q}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return T},d.defaults=a({},H.defaults,{mathvariant:"normal",mathsize:r.INHERIT}),d);function d(){return null!==l&&l.apply(this,arguments)||this}o.AbstractMmlTokenNode=c;var f,V=(t(y,f=H),Object.defineProperty(y.prototype,"isSpacelike",{get:function(){return this.childNodes[0].isSpacelike},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"isEmbellished",{get:function(){return this.childNodes[0].isEmbellished},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"arity",{get:function(){return-1},enumerable:!0,configurable:!0}),y.prototype.core=function(){return this.childNodes[0]},y.prototype.coreMO=function(){return this.childNodes[0].coreMO()},y.prototype.setTeXclass=function(Q){return Q=this.childNodes[0].setTeXclass(Q),this.updateTeXclass(this.childNodes[0]),Q},y.defaults=H.defaults,y);function y(){return null!==f&&f.apply(this,arguments)||this}o.AbstractMmlLayoutNode=V;var m,M=(t(v,m=H),Object.defineProperty(v.prototype,"isEmbellished",{get:function(){return this.childNodes[0].isEmbellished},enumerable:!0,configurable:!0}),v.prototype.core=function(){return this.childNodes[0]},v.prototype.coreMO=function(){return this.childNodes[0].coreMO()},v.prototype.setTeXclass=function(Q){var T,t;this.getPrevClass(Q),this.texClass=o.TEXCLASS.ORD;var e=this.childNodes[0];e?this.isEmbellished||e.isKind("mi")?(Q=e.setTeXclass(Q),this.updateTeXclass(this.core())):(e.setTeXclass(null),Q=this):Q=this;try{for(var r=u(this.childNodes.slice(1)),n=r.next();!n.done;n=r.next()){var i=n.value;i&&i.setTeXclass(null)}}catch(Q){T={error:Q}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(T)throw T.error}}return Q},v.defaults=H.defaults,v);function v(){return null!==m&&m.apply(this,arguments)||this}o.AbstractMmlBaseNode=M;var g,b=(g=n.AbstractEmptyNode,t(O,g),Object.defineProperty(O.prototype,"isToken",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"isEmbellished",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"isSpacelike",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"linebreakContainer",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"hasNewLine",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"arity",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"isInferred",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"notParent",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"Parent",{get:function(){return this.parent},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"texClass",{get:function(){return o.TEXCLASS.NONE},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"prevClass",{get:function(){return o.TEXCLASS.NONE},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"prevLevel",{get:function(){return 0},enumerable:!0,configurable:!0}),O.prototype.hasSpacingAttributes=function(){return!1},Object.defineProperty(O.prototype,"attributes",{get:function(){return null},enumerable:!0,configurable:!0}),O.prototype.core=function(){return this},O.prototype.coreMO=function(){return this},O.prototype.coreIndex=function(){return 0},O.prototype.childPosition=function(){return 0},O.prototype.setTeXclass=function(Q){return Q},O.prototype.texSpacing=function(){return""},O.prototype.setInheritedAttributes=function(Q,T,t,e){},O.prototype.inheritAttributesFrom=function(Q){},O.prototype.verifyTree=function(Q){},O.prototype.mError=function(Q,T,t){void 0===t&&(t=!1)},O);function O(){return null!==g&&g.apply(this,arguments)||this}o.AbstractMmlEmptyNode=b;var x,E=(t(_,x=b),Object.defineProperty(_.prototype,"kind",{get:function(){return"text"},enumerable:!0,configurable:!0}),_.prototype.getText=function(){return this.text},_.prototype.setText=function(Q){return this.text=Q,this},_.prototype.toString=function(){return this.text},_);function _(){var Q=null!==x&&x.apply(this,arguments)||this;return Q.text="",Q}o.TextNode=E;var S,Z=(t(C,S=b),Object.defineProperty(C.prototype,"kind",{get:function(){return"XML"},enumerable:!0,configurable:!0}),C.prototype.getXML=function(){return this.xml},C.prototype.setXML=function(Q,T){return void 0===T&&(T=null),this.xml=Q,this.adaptor=T,this},C.prototype.getSerializedXML=function(){return this.adaptor.outerHTML(this.xml)},C.prototype.toString=function(){return"XML data"},C);function C(){var Q=null!==S&&S.apply(this,arguments)||this;return Q.xml=null,Q.adaptor=null,Q}o.XMLNode=Z},function(Q,T,t){"use strict";var e,r=this&&this.__extends||(e=function(Q,T){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,T){Q.__proto__=T}||function(Q,T){for(var t in T)T.hasOwnProperty(t)&&(Q[t]=T[t])})(Q,T)},function(Q,T){function t(){this.constructor=Q}e(Q,T),Q.prototype=null===T?Object.create(T):(t.prototype=T.prototype,new t)}),f=this&&this.__values||function(Q){var T="function"==typeof Symbol&&Q[Symbol.iterator],t=0;return T?T.call(Q):{next:function(){return Q&&t>=Q.length&&(Q=void 0),{value:Q&&Q[t++],done:!Q}}}},V=this&&this.__read||function(Q,T){var t="function"==typeof Symbol&&Q[Symbol.iterator];if(!t)return Q;var e,r,n=t.call(Q),i=[];try{for(;(void 0===T||0<T--)&&!(e=n.next()).done;)i.push(e.value)}catch(Q){r={error:Q}}finally{try{e&&!e.done&&(t=n.return)&&t.call(n)}finally{if(r)throw r.error}}return i};Object.defineProperty(T,"__esModule",{value:!0});var n,i=t(122),o=t(78),a=(n=i.CommonWrapper,r(u,n),u.prototype.toSVG=function(Q){this.addChildren(this.standardSVGnode(Q))},u.prototype.addChildren=function(Q){var T,t,e=0;try{for(var r=f(this.childNodes),n=r.next();!n.done;n=r.next()){var i=n.value;i.toSVG(Q),i.element&&i.place(e+i.bbox.L*i.bbox.rscale,0),e+=(i.bbox.L+i.bbox.w+i.bbox.R)*i.bbox.rscale}}catch(Q){T={error:Q}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(T)throw T.error}}},u.prototype.standardSVGnode=function(Q){var T=this.createSVGnode(Q);return this.handleStyles(),this.handleScale(),this.handleColor(),this.handleAttributes(),T},u.prototype.createSVGnode=function(Q){var T=this.node.attributes.get("href");if(T){Q=this.adaptor.append(Q,this.svg("a",{href:T}));var t=this.getBBox(),e=t.h,r=t.d,n=t.w;this.adaptor.append(Q,this.svg("rect",{"data-hitbox":!0,fill:"none",stroke:"none","pointer-events":"all",width:this.fixed(n),height:this.fixed(e+r),y:this.fixed(-r)}))}return this.element=this.adaptor.append(Q,this.svg("g",{"data-mml-node":this.node.kind})),this.element},u.prototype.handleStyles=function(){if(this.styles){var Q=this.styles.cssText;Q&&this.adaptor.setAttribute(this.element,"style",Q)}},u.prototype.handleScale=function(){if(1!==this.bbox.rscale){var Q="scale("+this.fixed(this.bbox.rscale/1e3,3)+")";this.adaptor.setAttribute(this.element,"transform",Q)}},u.prototype.handleColor=function(){var Q=this.adaptor,T=this.node.attributes,t=T.getExplicit("mathcolor"),e=T.getExplicit("color"),r=T.getExplicit("mathbackground"),n=T.getExplicit("background");if((t||e)&&(Q.setAttribute(this.element,"fill",t||e),Q.setAttribute(this.element,"stroke",t||e)),r||n){var i=this.getBBox(),o=i.h,a=i.d,s=i.w,L=this.svg("rect",{fill:r||n,x:0,y:this.fixed(-a),width:this.fixed(s),height:this.fixed(o+a),"data-bgcolor":!0}),H=Q.firstChild(this.element);H?Q.insert(L,H):Q.append(this.element,L)}},u.prototype.handleAttributes=function(){var T,Q,t,e,r=this.node.attributes,n=r.getAllDefaults(),i=u.skipAttributes;try{for(var o=f(r.getExplicitNames()),a=o.next();!a.done;a=o.next()){var s=a.value;!1!==i[s]&&(s in n||i[s]||this.adaptor.hasAttribute(this.element,s))||this.adaptor.setAttribute(this.element,s,r.getExplicit(s))}}catch(Q){T={error:Q}}finally{try{a&&!a.done&&(Q=o.return)&&Q.call(o)}finally{if(T)throw T.error}}if(r.get("class")){var L=r.get("class").trim().split(/ +/);try{for(var H=f(L),l=H.next();!l.done;l=H.next()){var c=l.value;this.adaptor.addClass(this.element,c)}}catch(Q){t={error:Q}}finally{try{l&&!l.done&&(e=H.return)&&e.call(H)}finally{if(t)throw t.error}}}},u.prototype.place=function(Q,T,t){if(void 0===t&&(t=null),Q||T){t=t||this.element;var e=this.adaptor.getAttribute(t,"transform")||"";e="translate("+this.fixed(Q)+", "+this.fixed(T)+")"+(e?" "+e:""),this.adaptor.setAttribute(t,"transform",e)}},u.prototype.placeChar=function(Q,T,t,e,r){var n,i;void 0===r&&(r=null),null===r&&(r=this.variant);var o=Q.toString(16).toUpperCase(),a=V(this.getVariantChar(r,Q),4),s=(a[0],a[1],a[2]),L=a[3];if("p"in L){var H=L.p?"M"+L.p+"Z":"";this.place(T,t,this.adaptor.append(e,this.charNode(r,o,H)))}else if("c"in L){var l=this.adaptor.append(e,this.svg("g",{"data-c":o}));this.place(T,t,l),T=0;try{for(var c=f(this.unicodeChars(L.c)),u=c.next();!u.done;u=c.next()){var h=u.value;T+=this.placeChar(h,T,t,l,r)}}catch(Q){n={error:Q}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}}else if(L.unknown){var p=String.fromCharCode(Q),d=this.adaptor.append(e,this.jax.unknownText(p,r));return this.place(T,t,d),this.jax.measureTextNodeWithCache(d,p,r).w}return s},u.prototype.charNode=function(Q,T,t){return"none"!==this.jax.options.fontCache?this.useNode(Q,T,t):this.pathNode(T,t)},u.prototype.pathNode=function(Q,T){return this.svg("path",{"data-c":Q,d:T})},u.prototype.useNode=function(Q,T,t){var e=this.svg("use"),r="#"+this.jax.fontCache.cachePath(Q,T,t);return this.adaptor.setAttribute(e,"href",r,o.XLINKNS),e},u.prototype.drawBBox=function(){var Q=this.getBBox(),T=Q.w,t=Q.h,e=Q.d,r=this.svg("g",{style:{opacity:.25}},[this.svg("rect",{fill:"red",height:this.fixed(t),width:this.fixed(T)}),this.svg("rect",{fill:"green",height:this.fixed(e),width:this.fixed(T),y:this.fixed(-e)})]),n=this.element||this.parent.element;this.adaptor.append(n,r)},u.prototype.html=function(Q,T,t){return void 0===T&&(T={}),void 0===t&&(t=[]),this.jax.html(Q,T,t)},u.prototype.svg=function(Q,T,t){return void 0===T&&(T={}),void 0===t&&(t=[]),this.jax.svg(Q,T,t)},u.prototype.text=function(Q){return this.jax.text(Q)},u.prototype.createMo=function(Q){return n.prototype.createMo.call(this,Q)},u.prototype.coreMO=function(){return n.prototype.coreMO.call(this)},u.prototype.fixed=function(Q,T){return void 0===T&&(T=1),this.jax.fixed(1e3*Q,T)},u.kind="unknown",u);function u(){var Q=null!==n&&n.apply(this,arguments)||this;return Q.element=null,Q}T.SVGWrapper=a},function(Q,t,T){"use strict";var e,r=this&&this.__extends||(e=function(Q,T){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,T){Q.__proto__=T}||function(Q,T){for(var t in T)T.hasOwnProperty(t)&&(Q[t]=T[t])})(Q,T)},function(Q,T){function t(){this.constructor=Q}e(Q,T),Q.prototype=null===T?Object.create(T):(t.prototype=T.prototype,new t)}),c=this&&this.__values||function(Q){var T="function"==typeof Symbol&&Q[Symbol.iterator],t=0;return T?T.call(Q):{next:function(){return Q&&t>=Q.length&&(Q=void 0),{value:Q&&Q[t++],done:!Q}}}};Object.defineProperty(t,"__esModule",{value:!0});var n=T(21);!function(Q){for(var T in Q)t.hasOwnProperty(T)||(t[T]=Q[T])}(T(21));var i,u=(i=n.FontData,r(o,i),o.charOptions=function(Q,T){return i.charOptions.call(this,Q,T)},o);function o(){return null!==i&&i.apply(this,arguments)||this}t.SVGFontData=u,t.AddPaths=function(Q,T,t){var e,r,n,i;try{for(var o=c(Object.keys(T)),a=o.next();!a.done;a=o.next()){var s=a.value,L=parseInt(s);u.charOptions(Q,L).p=T[L]}}catch(Q){e={error:Q}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}try{for(var H=c(Object.keys(t)),l=H.next();!l.done;l=H.next()){s=l.value,L=parseInt(s);u.charOptions(Q,L).c=t[L]}}catch(Q){n={error:Q}}finally{try{l&&!l.done&&(i=H.return)&&i.call(H)}finally{if(n)throw n.error}}return Q}},function(Q,a,T){"use strict";var p=this&&this.__values||function(Q){var T="function"==typeof Symbol&&Q[Symbol.iterator],t=0;return T?T.call(Q):{next:function(){return Q&&t>=Q.length&&(Q=void 0),{value:Q&&Q[t++],done:!Q}}}},t=this&&this.__read||function(Q,T){var t="function"==typeof Symbol&&Q[Symbol.iterator];if(!t)return Q;var e,r,n=t.call(Q),i=[];try{for(;(void 0===T||0<T--)&&!(e=n.next()).done;)i.push(e.value)}catch(Q){r={error:Q}}finally{try{e&&!e.done&&(t=n.return)&&t.call(n)}finally{if(r)throw r.error}}return i},s=this&&this.__spread||function(){for(var Q=[],T=0;T<arguments.length;T++)Q=Q.concat(t(arguments[T]));return Q};Object.defineProperty(a,"__esModule",{value:!0});var e={}.constructor;function L(Q){return"object"==typeof Q&&null!==Q&&(Q.constructor===e||Q.constructor===H)}a.APPEND="[+]",a.REMOVE="[-]";var H=function(){};function l(Q){return Object.assign(Object.create(H.prototype),Q)}function c(Q){return Q?Object.keys(Q).concat(Object.getOwnPropertySymbols(Q)):[]}function u(Q){var T,t,e={};try{for(var r=p(c(Q)),n=r.next();!n.done;n=r.next()){var i=n.value,o=Object.getOwnPropertyDescriptor(Q,i),a=o.value;Array.isArray(a)?o.value=h([],a,!1):L(a)&&(o.value=u(a)),o.enumerable&&(e[i]=o)}}catch(Q){T={error:Q}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(T)throw T.error}}return Object.defineProperties(Q.constructor===H?l({}):{},e)}function h(r,n,i){var T,Q;void 0===i&&(i=!0);function t(Q){if(i&&void 0===r[Q]&&r.constructor!==H)throw"symbol"==typeof Q&&(Q=Q.toString()),new Error('Invalid option "'+Q+'" (no default value).');var T=n[Q],t=r[Q];if(!L(T)||null===t||"object"!=typeof t&&"function"!=typeof t)Array.isArray(T)?(r[Q]=[],h(r[Q],T,!1)):L(T)?r[Q]=u(T):r[Q]=T;else{var e=c(T);Array.isArray(t)&&(1===e.length&&(e[0]===a.APPEND||e[0]===a.REMOVE)&&Array.isArray(T[e[0]])||2===e.length&&e.sort().join(",")===a.APPEND+","+a.REMOVE&&Array.isArray(T[a.APPEND])&&Array.isArray(T[a.REMOVE]))?(T[a.REMOVE]&&(t=r[Q]=t.filter(function(Q){return T[a.REMOVE].indexOf(Q)<0})),T[a.APPEND]&&(r[Q]=s(t,T[a.APPEND]))):h(t,T,i)}}try{for(var e=p(c(n)),o=e.next();!o.done;o=e.next()){t(o.value)}}catch(Q){T={error:Q}}finally{try{o&&!o.done&&(Q=e.return)&&Q.call(e)}finally{if(T)throw T.error}}return r}function r(Q){for(var T,t,e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n={};try{for(var i=p(e),o=i.next();!o.done;o=i.next()){var a=o.value;Q.hasOwnProperty(a)&&(n[a]=Q[a])}}catch(Q){T={error:Q}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(T)throw T.error}}return n}a.Expandable=H,a.expandable=l,a.makeArray=function(Q){return Array.isArray(Q)?Q:[Q]},a.keys=c,a.copy=u,a.insert=h,a.defaultOptions=function(T){for(var Q=[],t=1;t<arguments.length;t++)Q[t-1]=arguments[t];return Q.forEach(function(Q){return h(T,Q,!1)}),T},a.userOptions=function(T){for(var Q=[],t=1;t<arguments.length;t++)Q[t-1]=arguments[t];return Q.forEach(function(Q){return h(T,Q,!0)}),T},a.selectOptions=r,a.selectOptionsFromKeys=function(Q,T){return r.apply(void 0,s([Q],Object.keys(T)))},a.separateOptions=function(Q){for(var T,t,e,r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=[];try{for(var a=p(n),s=a.next();!s.done;s=a.next()){var L=s.value,H={},l={};try{for(var c=(e=void 0,p(Object.keys(Q||{}))),u=c.next();!u.done;u=c.next()){var h=u.value;(void 0===L[h]?l:H)[h]=Q[h]}}catch(Q){e={error:Q}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(e)throw e.error}}o.push(H),Q=l}}catch(Q){T={error:Q}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(T)throw T.error}}return o.unshift(Q),o}},function(Q,T,t){"use strict";Object.defineProperty(T,"__esModule",{value:!0});var e=(i.processString=function(Q,T){for(var t=Q.split(i.pattern),e=1,r=t.length;e<r;e+=2){var n=t[e].charAt(0);"0"<=n&&n<="9"?(t[e]=T[parseInt(t[e],10)-1],"number"==typeof t[e]&&(t[e]=t[e].toString())):"{"===n&&("0"<=(n=t[e].substr(1))&&n<="9"?(t[e]=T[parseInt(t[e].substr(1,t[e].length-2),10)-1],"number"==typeof t[e]&&(t[e]=t[e].toString())):t[e].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/)&&(t[e]="%"+t[e])),null==t[e]&&(t[e]="???")}return t.join("")},i.pattern=/%(\d+|\{\d+\}|\{[a-z]+:\%\d+(?:\|(?:%\{\d+\}|%.|[^\}])*)+\}|.)/g,i);function i(Q,T){for(var t=[],e=2;e<arguments.length;e++)t[e-2]=arguments[e];this.id=Q,this.message=i.processString(T,t)}T.default=e},function(Q,T,t){"use strict";(function(Q){var s=this&&this.__values||function(Q){var T="function"==typeof Symbol&&Q[Symbol.iterator],t=0;return T?T.call(Q):{next:function(){return Q&&t>=Q.length&&(Q=void 0),{value:Q&&Q[t++],done:!Q}}}};function o(Q,T){var t,e;try{for(var r=s(Object.keys(T)),n=r.next();!n.done;n=r.next()){var i=n.value;"__esModule"!==i&&("object"==typeof Q[i]&&"object"==typeof T[i]?o(Q[i],T[i]):null!==T[i]&&void 0!==T[i]&&(Q[i]=T[i]))}}catch(Q){t={error:Q}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return Q}Object.defineProperty(T,"__esModule",{value:!0}),T.combineConfig=o,T.combineDefaults=function Q(T,t,e){var r,n;T[t]||(T[t]={}),T=T[t];try{for(var i=s(Object.keys(e)),o=i.next();!o.done;o=i.next()){var a=o.value;"object"==typeof T[a]&&"object"==typeof e[a]?Q(T,a,e[a]):null==T[a]&&null!=e[a]&&(T[a]=e[a])}}catch(Q){r={error:Q}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return T},T.combineWithMathJax=function(Q){return o(T.MathJax,Q)},void 0===Q.MathJax&&(Q.MathJax={}),Q.MathJax.version||(Q.MathJax={version:"3.0.1",_:{},config:Q.MathJax}),T.MathJax=Q.MathJax}).call(this,t(26))},function(Q,T,t){"use strict";var s=this&&this.__values||function(Q){var T="function"==typeof Symbol&&Q[Symbol.iterator],t=0;return T?T.call(Q):{next:function(){return Q&&t>=Q.length&&(Q=void 0),{value:Q&&Q[t++],done:!Q}}}},e=this&&this.__read||function(Q,T){var t="function"==typeof Symbol&&Q[Symbol.iterator];if(!t)return Q;var e,r,n=t.call(Q),i=[];try{for(;(void 0===T||0<T--)&&!(e=n.next()).done;)i.push(e.value)}catch(Q){r={error:Q}}finally{try{e&&!e.done&&(t=n.return)&&t.call(n)}finally{if(r)throw r.error}}return i},r=this&&this.__spread||function(){for(var Q=[],T=0;T<arguments.length;T++)Q=Q.concat(e(arguments[T]));return Q};Object.defineProperty(T,"__esModule",{value:!0});var n,i,a,o=t(0),L=t(24);function H(Q,T){var t,e;try{for(var r=s(Object.keys(T)),n=r.next();!n.done;n=r.next()){var i=n.value,o=T[i];"texClass"===i?(Q.texClass=o,Q.setProperty(i,o)):"movablelimits"===i?(Q.setProperty("movablelimits",o),(Q.isKind("mo")||Q.isKind("mstyle"))&&Q.attributes.set("movablelimits",o)):"inferred"===i||(a.has(i)?Q.setProperty(i,o):Q.attributes.set(i,o))}}catch(Q){t={error:Q}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}}function l(Q,T,t){(Q.childNodes[T]=t)&&(t.parent=Q)}function c(Q,T){return Q.isKind(T)}i=n=n||{},a=new Map([["autoOP",!0],["fnOP",!0],["movesupsub",!0],["subsupOK",!0],["texprimestyle",!0],["useHeight",!0],["variantForm",!0],["withDelims",!0],["open",!0],["close",!0]]),i.createEntity=function(Q){return String.fromCharCode(parseInt(Q,16))},i.getChildren=function(Q){return Q.childNodes},i.getText=function(Q){return Q.getText()},i.appendChildren=function(Q,T){var t,e;try{for(var r=s(T),n=r.next();!n.done;n=r.next()){var i=n.value;Q.appendChild(i)}}catch(Q){t={error:Q}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},i.setAttribute=function(Q,T,t){Q.attributes.set(T,t)},i.setProperty=function(Q,T,t){Q.setProperty(T,t)},i.setProperties=H,i.getProperty=function(Q,T){return Q.getProperty(T)},i.getAttribute=function(Q,T){return Q.attributes.get(T)},i.removeProperties=function(Q){for(var T=[],t=1;t<arguments.length;t++)T[t-1]=arguments[t];Q.removeProperty.apply(Q,r(T))},i.getChildAt=function(Q,T){return Q.childNodes[T]},i.setChild=l,i.copyChildren=function(Q,T){for(var t=Q.childNodes,e=0;e<t.length;e++)l(T,e,t[e])},i.copyAttributes=function(Q,T){T.attributes=Q.attributes,H(T,Q.getAllProperties())},i.isType=c,i.isEmbellished=function(Q){return Q.isEmbellished},i.getTexClass=function(Q){return Q.texClass},i.getCoreMO=function(Q){return Q.coreMO()},i.isNode=function(Q){return Q instanceof o.AbstractMmlNode||Q instanceof o.AbstractMmlEmptyNode},i.isInferred=function(Q){return Q.isInferred},i.getForm=function(Q){var T,t;if(!c(Q,"mo"))return null;var e=Q,r=e.getForms();try{for(var n=s(r),i=n.next();!i.done;i=n.next()){var o=i.value,a=L.MmlMo.OPTABLE[o][e.getText()];if(a)return a}}catch(Q){T={error:Q}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(T)throw T.error}}return null},T.default=n},function(Q,T,t){"use strict";var s=this&&this.__read||function(Q,T){var t="function"==typeof Symbol&&Q[Symbol.iterator];if(!t)return Q;var e,r,n=t.call(Q),i=[];try{for(;(void 0===T||0<T--)&&!(e=n.next()).done;)i.push(e.value)}catch(Q){r={error:Q}}finally{try{e&&!e.done&&(t=n.return)&&t.call(n)}finally{if(r)throw r.error}}return i},L=this&&this.__values||function(Q){var T="function"==typeof Symbol&&Q[Symbol.iterator],t=0;return T?T.call(Q):{next:function(){return Q&&t>=Q.length&&(Q=void 0),{value:Q&&Q[t++],done:!Q}}}};Object.defineProperty(T,"__esModule",{value:!0});var e,r,a,n,i,H,l,c=t(0),u=t(6),h=t(19),p=t(4),o=t(13);function d(Q,T){void 0===T&&(T=!1);var t,e,r,n,i,o=Q.match(T?l:H);return o?(t=[o[1].replace(/,/,"."),o[4],o[0].length],e=s(t,3),r=e[0],n=e[1],i=e[2],"mu"===n?[f(a[n](parseFloat(r||"1"))).slice(0,-2),"em",i]:[r,n,i]):[null,null,0]}function f(Q){return Math.abs(Q)<6e-4?"0em":Q.toFixed(3).replace(/\.?0+$/,"")+"em"}function V(Q,T,t){"{"!==T&&"}"!==T||(T="\\"+T);var e="{\\bigg"+t+" "+T+"}",r="{\\big"+t+" "+T+"}";return new h.default("\\mathchoice"+e+r+r+r,{},Q).mml()}function y(Q,T,t){T=T.replace(/^\s+/,o.entities.nbsp).replace(/\s+$/,o.entities.nbsp);var e=Q.create("text",T);return Q.create("node","mtext",[],t,e)}function m(Q,T,t){if(t.match(/^[a-z]/i)&&T.match(/(^|[^\\])(\\\\)*\\[a-z]+$/i)&&(T+=" "),T.length+t.length>Q.configuration.options.maxBuffer)throw new p.default("MaxBufferSize","MathJax internal buffer size exceeded; is there a recursive macro call?");return T+t}function M(Q,T){for(;0<T;)Q=Q.trim().slice(1,-1),T--;return Q.trim()}function v(Q,T){for(var t=Q.length,e=0,r="",n=0,i=0,o=!0,a=!1;n<t;){var s=Q[n++];switch(s){case" ":break;case"{":o?i++:(a=!1,e<i&&(i=e)),e++;break;case"}":e&&e--,(o||a)&&(i--,a=!0),o=!1;break;default:if(!e&&-1!==T.indexOf(s))return[a?"true":M(r,i),s,Q.slice(n)];a=o=!1}r+=s}if(e)throw new p.default("ExtraOpenMissingClose","Extra open brace or missing close brace");return[a?"true":M(r,i),"",Q.slice(n)]}t(109),r=e=e||{},a={em:function(Q){return Q},ex:function(Q){return.43*Q},pt:function(Q){return Q/10},pc:function(Q){return 1.2*Q},px:function(Q){return 7.2*Q/72},in:function(Q){return 7.2*Q},cm:function(Q){return 7.2*Q/2.54},mm:function(Q){return 7.2*Q/25.4},mu:function(Q){return Q/18}},n="([-+]?([.,]\\d+|\\d+([.,]\\d*)?))",i="(pt|em|ex|mu|px|mm|cm|in|pc)",H=RegExp("^\\s*"+n+"\\s*"+i+"\\s*$"),l=RegExp("^\\s*"+n+"\\s*"+i+" ?"),r.matchDimen=d,r.dimen2em=function(Q){var T=s(d(Q),3),t=T[0],e=T[1],r=(T[2],parseFloat(t||"1")),n=a[e];return n?n(r):0},r.Em=f,r.fenced=function(Q,T,t,e,r){void 0===r&&(r="");var n,i=Q.nodeFactory,o=i.create("node","mrow",[],{open:T,close:e,texClass:c.TEXCLASS.INNER});if(r)n=new h.default("\\"+r+"l"+T,Q.parser.stack.env,Q).mml();else{var a=i.create("text",T);n=i.create("node","mo",[],{fence:!0,stretchy:!0,symmetric:!0,texClass:c.TEXCLASS.OPEN},a)}if(u.default.appendChildren(o,[n]),u.default.isType(t,"mrow")&&u.default.isInferred(t)?u.default.appendChildren(o,u.default.getChildren(t)):u.default.appendChildren(o,[t]),r)n=new h.default("\\"+r+"r"+e,Q.parser.stack.env,Q).mml();else{var s=i.create("text",e);n=i.create("node","mo",[],{fence:!0,stretchy:!0,symmetric:!0,texClass:c.TEXCLASS.CLOSE},s)}return u.default.appendChildren(o,[n]),o},r.fixedFence=function(Q,T,t,e){var r=Q.nodeFactory.create("node","mrow",[],{open:T,close:e,texClass:c.TEXCLASS.ORD});return T&&u.default.appendChildren(r,[V(Q,T,"l")]),u.default.isType(t,"mrow")?u.default.appendChildren(r,u.default.getChildren(t)):u.default.appendChildren(r,[t]),e&&u.default.appendChildren(r,[V(Q,e,"r")]),r},r.mathPalette=V,r.fixInitialMO=function(Q,T){for(var t=0,e=T.length;t<e;t++){var r=T[t];if(r&&!u.default.isType(r,"mspace")&&(!u.default.isType(r,"TeXAtom")||u.default.getChildren(r)[0]&&u.default.getChildren(u.default.getChildren(r)[0]).length)){if(u.default.isEmbellished(r)){var n=Q.nodeFactory.create("node","mi");T.unshift(n)}break}}},r.internalMath=function(Q,T,t){var e,r,n=Q.stack.env.font?{mathvariant:Q.stack.env.font}:{},i=[],o=0,a=0,s="",L=0;if(T.match(/\\?[${}\\]|\\\(|\\(eq)?ref\s*\{/)){for(;o<T.length;)if("$"===(e=T.charAt(o++)))"$"===s&&0===L?(r=Q.create("node","TeXAtom",[new h.default(T.slice(a,o-1),{},Q.configuration).mml()]),i.push(r),s="",a=o):""===s&&(a<o-1&&i.push(y(Q,T.slice(a,o-1),n)),s="$",a=o);else if("{"===e&&""!==s)L++;else if("}"===e)if("}"===s&&0===L){var H=new h.default(T.slice(a,o),{},Q.configuration).mml();r=Q.create("node","TeXAtom",[H],n),i.push(r),s="",a=o}else""!==s&&L&&L--;else if("\\"===e)if(""===s&&T.substr(o).match(/^(eq)?ref\s*\{/)){var l=RegExp["$&"].length;a<o-1&&i.push(y(Q,T.slice(a,o-1),n)),s="}",a=o-1,o+=l}else"("===(e=T.charAt(o++))&&""===s?(a<o-2&&i.push(y(Q,T.slice(a,o-2),n)),s=")",a=o):")"===e&&")"===s&&0===L?(r=Q.create("node","TeXAtom",[new h.default(T.slice(a,o-2),{},Q.configuration).mml()]),i.push(r),s="",a=o):e.match(/[${}\\]/)&&""===s&&(o--,T=T.substr(0,o-1)+T.substr(o));if(""!==s)throw new p.default("MathNotTerminated","Math not terminated in text box")}return a<T.length&&i.push(y(Q,T.slice(a),n)),null!=t?i=[Q.create("node","mstyle",i,{displaystyle:!1,scriptlevel:t})]:1<i.length&&(i=[Q.create("node","mrow",i)]),i},r.trimSpaces=function(Q){if("string"!=typeof Q)return Q;var T=Q.trim();return T.match(/\\$/)&&Q.match(/ $/)&&(T+=" "),T},r.setArrayAlign=function(Q,T){return"t"===(T=r.trimSpaces(T||""))?Q.arraydef.align="baseline 1":"b"===T?Q.arraydef.align="baseline -1":"c"===T?Q.arraydef.align="center":T&&(Q.arraydef.align=T),Q},r.substituteArgs=function(Q,T,t){for(var e="",r="",n=0;n<t.length;){var i=t.charAt(n++);if("\\"===i)e+=i+t.charAt(n++);else if("#"===i)if("#"===(i=t.charAt(n++)))e+=i;else{if(!i.match(/[1-9]/)||parseInt(i,10)>T.length)throw new p.default("IllegalMacroParam","Illegal macro parameter reference");r=m(Q,m(Q,r,e),T[parseInt(i,10)-1]),e=""}else e+=i}return m(Q,r,e)},r.addArgs=m,r.checkEqnEnv=function(Q){if(Q.stack.global.eqnenv)throw new p.default("ErroneousNestingEq","Erroneous nesting of equation structures");Q.stack.global.eqnenv=!0},r.MmlFilterAttribute=function(Q,T,t){return t},r.getFontDef=function(Q){var T=Q.stack.env.font;return T?{mathvariant:T}:{}},r.keyvalOptions=function(Q,T,t){var e,r;void 0===T&&(T=null),void 0===t&&(t=!1);var n=function(Q){var T,t,e,r,n,i={},o=Q;for(;o;)T=s(v(o,["=",","]),3),r=T[0],e=T[1],o=T[2],"="===e?(t=s(v(o,[","]),3),n=t[0],e=t[1],o=t[2],n="false"===n||"true"===n?JSON.parse(n):n,i[r]=n):r&&(i[r]=!0);return i}(Q);if(T)try{for(var i=L(Object.keys(n)),o=i.next();!o.done;o=i.next()){var a=o.value;if(!T.hasOwnProperty(a)){if(t)throw new p.default("InvalidOption","Invalid optional argument: %1",a);delete n[a]}}}catch(Q){e={error:Q}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n},T.default=e},function(Q,T,t){"use strict";var e,r,n,s=this&&this.__values||function(Q){var T="function"==typeof Symbol&&Q[Symbol.iterator],t=0;return T?T.call(Q):{next:function(){return Q&&t>=Q.length&&(Q=void 0),{value:Q&&Q[t++],done:!Q}}}},L=this&&this.__read||function(Q,T){var t="function"==typeof Symbol&&Q[Symbol.iterator];if(!t)return Q;var e,r,n=t.call(Q),i=[];try{for(;(void 0===T||0<T--)&&!(e=n.next()).done;)i.push(e.value)}catch(Q){r={error:Q}}finally{try{e&&!e.done&&(t=n.return)&&t.call(n)}finally{if(r)throw r.error}}return i};Object.defineProperty(T,"__esModule",{value:!0}),r=e=T.MapHandler||(T.MapHandler={}),n=new Map,r.register=function(Q){n.set(Q.name,Q)},r.getMap=function(Q){return n.get(Q)},T.ExtensionMaps={NEW_MACRO:"new-Macro",NEW_DELIMITER:"new-Delimiter",NEW_COMMAND:"new-Command",NEW_ENVIRONMENT:"new-Environment"};var o=(i.prototype.add=function(Q){var T=e.getMap(Q);T?this._configuration.push(T):this.warn("Configuration "+Q+" not found! Omitted.")},i.prototype.parse=function(Q){var T,t;try{for(var e=s(this._configuration),r=e.next();!r.done;r=e.next()){var n=r.value.parse(Q);if(n)return n}}catch(Q){T={error:Q}}finally{try{r&&!r.done&&(t=e.return)&&t.call(e)}finally{if(T)throw T.error}}var i=L(Q,2),o=i[0],a=i[1];this._fallback(o,a)},i.prototype.lookup=function(Q){var T=this.applicable(Q);return T?T.lookup(Q):null},i.prototype.contains=function(Q){return!!this.applicable(Q)},i.prototype.toString=function(){return this._configuration.map(function(Q){return Q.name}).join(", ")},i.prototype.applicable=function(Q){var T,t;try{for(var e=s(this._configuration),r=e.next();!r.done;r=e.next()){var n=r.value;if(n.contains(Q))return n}}catch(Q){T={error:Q}}finally{try{r&&!r.done&&(t=e.return)&&t.call(e)}finally{if(T)throw T.error}}return null},i.prototype.retrieve=function(T){return this._configuration.find(function(Q){return Q.name===T})},i.prototype.warn=function(Q){console.log("TexParser Warning: "+Q)},i);function i(Q,T){var t,e;this._fallback=T,this._configuration=[];try{for(var r=s(Q),n=r.next();!n.done;n=r.next()){var i=n.value;this.add(i)}}catch(Q){t={error:Q}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}}T.SubHandler=o;var a=(H.prototype.set=function(Q,T){this.map.set(Q,T)},H.prototype.get=function(Q){return this.map.get(Q)},H.prototype.retrieve=function(Q){var T,t;try{for(var e=s(this.map.values()),r=e.next();!r.done;r=e.next()){var n=r.value.retrieve(Q);if(n)return n}}catch(Q){T={error:Q}}finally{try{r&&!r.done&&(t=e.return)&&t.call(e)}finally{if(T)throw T.error}}return null},H.prototype.keys=function(){return this.map.keys()},H);function H(Q){var T,t;this.map=new Map;try{for(var e=s(Object.keys(Q.handler)),r=e.next();!r.done;r=e.next()){var n=r.value,i=new o(Q.handler[n]||[],Q.fallback[n]);this.set(n,i)}}catch(Q){T={error:Q}}finally{try{r&&!r.done&&(t=e.return)&&t.call(e)}finally{if(T)throw T.error}}}T.SubHandlers=a},function(Q,T,t){"use strict";var e,r=this&&this.__extends||(e=function(Q,T){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,T){Q.__proto__=T}||function(Q,T){for(var t in T)T.hasOwnProperty(t)&&(Q[t]=T[t])})(Q,T)},function(Q,T){function t(){this.constructor=Q}e(Q,T),Q.prototype=null===T?Object.create(T):(t.prototype=T.prototype,new t)}),u=this&&this.__read||function(Q,T){var t="function"==typeof Symbol&&Q[Symbol.iterator];if(!t)return Q;var e,r,n=t.call(Q),i=[];try{for(;(void 0===T||0<T--)&&!(e=n.next()).done;)i.push(e.value)}catch(Q){r={error:Q}}finally{try{e&&!e.done&&(t=n.return)&&t.call(n)}finally{if(r)throw r.error}}return i},h=this&&this.__values||function(Q){var T="function"==typeof Symbol&&Q[Symbol.iterator],t=0;return T?T.call(Q):{next:function(){return Q&&t>=Q.length&&(Q=void 0),{value:Q&&Q[t++],done:!Q}}}},a=this&&this.__spread||function(){for(var Q=[],T=0;T<arguments.length;T++)Q=Q.concat(u(arguments[T]));return Q};Object.defineProperty(T,"__esModule",{value:!0});var p=t(20),n=t(8),i=(Object.defineProperty(o.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),o.prototype.parserFor=function(Q){return this.contains(Q)?this.parser:null},o.prototype.parse=function(Q){var T=u(Q,2),t=T[0],e=T[1],r=this.parserFor(e),n=this.lookup(e);return r&&n?r(t,n)||!0:null},Object.defineProperty(o.prototype,"parser",{get:function(){return this._parser},set:function(Q){this._parser=Q},enumerable:!0,configurable:!0}),o);function o(Q,T){this._name=Q,this._parser=T,n.MapHandler.register(this)}T.AbstractSymbolMap=i;var s,L=(r(H,s=i),H.prototype.contains=function(Q){return this._regExp.test(Q)},H.prototype.lookup=function(Q){return this.contains(Q)?Q:null},H);function H(Q,T,t){var e=s.call(this,Q,T)||this;return e._regExp=t,e}T.RegExpMap=L;var l,c=(r(d,l=i),d.prototype.lookup=function(Q){return this.map.get(Q)},d.prototype.contains=function(Q){return this.map.has(Q)},d.prototype.add=function(Q,T){this.map.set(Q,T)},d);function d(){var Q=null!==l&&l.apply(this,arguments)||this;return Q.map=new Map,Q}T.AbstractParseMap=c;var f,V=(r(y,f=c),y);function y(Q,T,t){var e,r,n=f.call(this,Q,T)||this;try{for(var i=h(Object.keys(t)),o=i.next();!o.done;o=i.next()){var a=o.value,s=t[a],L=u("string"==typeof s?[s,null]:s,2),H=L[0],l=L[1],c=new p.Symbol(a,H,l);n.add(a,c)}}catch(Q){e={error:Q}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}T.CharacterMap=V;var m,M=(r(v,m=V),v.prototype.parse=function(Q){var T=u(Q,2),t=T[0],e=T[1];return m.prototype.parse.call(this,[t,"\\"+e])},v);function v(){return null!==m&&m.apply(this,arguments)||this}T.DelimiterMap=M;var g,b=(r(O,g=c),O.prototype.parserFor=function(Q){var T=this.lookup(Q);return T?T.func:null},O.prototype.parse=function(Q){var T=u(Q,2),t=T[0],e=T[1],r=this.lookup(e),n=this.parserFor(e);return r&&n?n.apply(void 0,a([t,r.symbol],r.args))||!0:null},O);function O(Q,T,t){var e,r,n=g.call(this,Q,null)||this;try{for(var i=h(Object.keys(T)),o=i.next();!o.done;o=i.next()){var a=o.value,s=T[a],L=u("string"==typeof s?[s]:s),H=L[0],l=L.slice(1),c=new p.Macro(a,t[H],l);n.add(a,c)}}catch(Q){e={error:Q}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}T.MacroMap=b;var x,E=(r(_,x=b),_.prototype.parse=function(Q){var T=u(Q,2),t=T[0],e=T[1],r=this.lookup(e),n=this.parserFor(e);if(!r||!n)return null;if(["\\"+r.symbol].concat(r.args),!n)return null;var i=t.currentCS;t.currentCS="\\"+e;var o=n.apply(void 0,a([t,"\\"+r.symbol],r.args));return t.currentCS=i,o||!0},_);function _(){return null!==x&&x.apply(this,arguments)||this}T.CommandMap=E;var S,Z=(r(C,S=b),C.prototype.parse=function(Q){var T=u(Q,2),t=T[0],e=T[1],r=this.lookup(e),n=this.parserFor(e);return r&&n?(this.parser(t,r.symbol,n,r.args),!0):null},C);function C(Q,T,t,e){var r=S.call(this,Q,t,e)||this;return r.parser=T,r}T.EnvironmentMap=Z},function(Q,n,T){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.protoItem=function(Q,T,t,e,r,n,i){return void 0===i&&(i=null),{open:Q,math:T,close:t,n:e,start:{n:r},end:{n:n},display:i}};var t=(e.prototype.render=function(Q){Q.renderActions.renderMath(this,Q)},e.prototype.rerender=function(Q,T){void 0===T&&(T=n.STATE.RERENDER),this.state()>=T&&this.state(T-1),Q.renderActions.renderMath(this,Q,T)},e.prototype.convert=function(Q,T){void 0===T&&(T=n.STATE.LAST),Q.renderActions.renderConvert(this,Q,T)},e.prototype.compile=function(Q){this.state()<n.STATE.COMPILED&&(this.root=this.inputJax.compile(this,Q),this.state(n.STATE.COMPILED))},e.prototype.typeset=function(Q){this.state()<n.STATE.TYPESET&&(this.typesetRoot=Q.outputJax[null===this.display?"escaped":"typeset"](this,Q),this.state(n.STATE.TYPESET))},e.prototype.updateDocument=function(Q){},e.prototype.removeFromDocument=function(Q){void 0===Q&&(Q=!1)},e.prototype.setMetrics=function(Q,T,t,e,r){this.metrics={em:Q,ex:T,containerWidth:t,lineWidth:e,scale:r}},e.prototype.state=function(Q,T){return void 0===Q&&(Q=null),void 0===T&&(T=!1),null!=Q&&(Q<n.STATE.INSERTED&&this._state>=n.STATE.INSERTED&&this.removeFromDocument(T),Q<n.STATE.TYPESET&&this._state>=n.STATE.TYPESET&&(this.bbox={},this.outputData={}),Q<n.STATE.COMPILED&&this._state>=n.STATE.COMPILED&&(this.inputData={}),this._state=Q),this._state},e.prototype.reset=function(Q){void 0===Q&&(Q=!1),this.state(n.STATE.UNPROCESSED)},e);function e(Q,T,t,e,r){void 0===t&&(t=!0),void 0===e&&(e={i:0,n:0,delim:""}),void 0===r&&(r={i:0,n:0,delim:""}),this.root=null,this.typesetRoot=null,this._state=n.STATE.UNPROCESSED,this.metrics={},this.bbox={},this.inputData={},this.outputData={},this.math=Q,this.inputJax=T,this.display=t,this.start=e,this.end=r,this.root=null,this.typesetRoot=null,this.metrics={},this.bbox={},this.inputData={},this.outputData={}}n.AbstractMathItem=t,n.STATE={UNPROCESSED:0,FINDMATH:10,COMPILED:20,CONVERT:100,METRICS:110,RERENDER:125,TYPESET:150,INSERTED:200,LAST:1e4},n.newState=function(Q,T){if(Q in n.STATE)throw Error("State "+Q+" already exists");n.STATE[Q]=T}},function(Q,T,t){"use strict";var d=this&&this.__read||function(Q,T){var t="function"==typeof Symbol&&Q[Symbol.iterator];if(!t)return Q;var e,r,n=t.call(Q),i=[];try{for(;(void 0===T||0<T--)&&!(e=n.next()).done;)i.push(e.value)}catch(Q){r={error:Q}}finally{try{e&&!e.done&&(t=n.return)&&t.call(n)}finally{if(r)throw r.error}}return i},Z=this&&this.__values||function(Q){var T="function"==typeof Symbol&&Q[Symbol.iterator],t=0;return T?T.call(Q):{next:function(){return Q&&t>=Q.length&&(Q=void 0),{value:Q&&Q[t++],done:!Q}}}};Object.defineProperty(T,"__esModule",{value:!0});var f,e,r,n=t(33),i=t(8),C=t(3),o=t(9),s=t(8),V=t(27),a=(L.create=function(Q,T){return void 0===T&&(T={}),new L(Q,T.handler||{},T.fallback||{},T.items||{},T.tags||{},T.options||{},T.nodes||{},T.preprocessors||[],T.postprocessors||[],[T.init,T.priority],[T.config,T.configPriority])},L.empty=function(){return L.create("empty")},L.extension=function(){return new o.MacroMap(i.ExtensionMaps.NEW_MACRO,{},{}),new o.DelimiterMap(i.ExtensionMaps.NEW_DELIMITER,n.default.delimiter,{}),new o.CommandMap(i.ExtensionMaps.NEW_COMMAND,{},{}),new o.EnvironmentMap(i.ExtensionMaps.NEW_ENVIRONMENT,n.default.environment,{},{}),L.create("extension",{handler:{character:[],delimiter:[i.ExtensionMaps.NEW_DELIMITER],macro:[i.ExtensionMaps.NEW_DELIMITER,i.ExtensionMaps.NEW_COMMAND,i.ExtensionMaps.NEW_MACRO],environment:[i.ExtensionMaps.NEW_ENVIRONMENT]}})},L.prototype.init=function(Q){this.initMethod.execute(Q)},L.prototype.config=function(Q,T){var t,e,r,n;this.configMethod.execute(Q,T);try{for(var i=Z(this.preprocessors),o=i.next();!o.done;o=i.next()){var a=o.value;"function"==typeof a?T.preFilters.add(a):T.preFilters.add(a[0],a[1])}}catch(Q){t={error:Q}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}try{for(var s=Z(this.postprocessors),L=s.next();!L.done;L=s.next()){var H=L.value;"function"==typeof H?T.postFilters.add(H):T.postFilters.add(H[0],H[1])}}catch(Q){r={error:Q}}finally{try{L&&!L.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}},L.prototype.append=function(Q){var T,t,e,r,n,i,o,a,s,L,H,l,c=Object.keys(Q.handler);try{for(var u=Z(c),h=u.next();!h.done;h=u.next()){var p=h.value;try{for(var d=(e=void 0,Z(Q.handler[p])),f=d.next();!f.done;f=d.next()){var V=f.value;this.handler[p].unshift(V)}}catch(Q){e={error:Q}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(e)throw e.error}}}}catch(Q){T={error:Q}}finally{try{h&&!h.done&&(t=u.return)&&t.call(u)}finally{if(T)throw T.error}}Object.assign(this.fallback,Q.fallback),Object.assign(this.items,Q.items),Object.assign(this.tags,Q.tags),C.defaultOptions(this.options,Q.options),Object.assign(this.nodes,Q.nodes);try{for(var y=Z(Q.preprocessors),m=y.next();!m.done;m=y.next()){var M=m.value;this.preprocessors.push(M)}}catch(Q){n={error:Q}}finally{try{m&&!m.done&&(i=y.return)&&i.call(y)}finally{if(n)throw n.error}}try{for(var v=Z(Q.postprocessors),g=v.next();!g.done;g=v.next()){var b=g.value;this.postprocessors.push(b)}}catch(Q){o={error:Q}}finally{try{g&&!g.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}try{for(var O=Z(Q.initMethod),x=O.next();!x.done;x=O.next()){var E=x.value;this.initMethod.add(E.item,E.priority)}}catch(Q){s={error:Q}}finally{try{x&&!x.done&&(L