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