UNPKG

mathjax

Version:

Beautiful and accessible math in all browsers. MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all browsers. This package includes the packaged components (install mathjax-full to get the source

1 lines 177 kB
(()=>{var __webpack_modules__={288(t){t.exports.p="/"},164(t,e,s){"use strict";var i={};s.r(i),s.d(i,{LiteElement:()=>f});var r={};s.r(r),s.d(r,{LiteDocument:()=>R});var n={};s.r(n),s.d(n,{LiteComment:()=>L,LiteText:()=>x});var o={};s.r(o),s.d(o,{LiteList:()=>b});var a={};s.r(a),s.d(a,{LiteParser:()=>w,PATTERNS:()=>T});var l={};s.r(l),s.d(l,{LiteWindow:()=>A});var c={};s.r(c),s.d(c,{LiteAdaptor:()=>_,LiteBase:()=>S,liteAdaptor:()=>j});var h=s(977),d=s(516),u=s(502),p=s(6),m=s(780),E=function(t,e,s,i){return new(s||(s=Promise))(function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function a(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})};const g={badCSS:!0,badSizes:!0};class f{constructor(t,e={},s=[]){this.kind=t,this.attributes=Object.assign({},e),this.children=[...s];for(const t of this.children)t.parent=this;this.styles=null}}class R{get kind(){return"#document"}constructor(t=null){this.defaultView=null,this.root=new f("html",{},[this.head=new f("head"),this.body=new f("body")]),this.type="",this.defaultView=t}}class x{get kind(){return"#text"}constructor(t=""){this.value=t}}class L extends x{get kind(){return"#comment"}}class b{constructor(t){this.nodes=[],this.nodes=[...t]}append(t){this.nodes.push(t)}[Symbol.iterator](){let t=0;return{next(){return t===this.nodes.length?{value:null,done:!0}:{value:this.nodes[t++],done:!1}}}}}var y=s(989);const N="[ \\n]+",I="[ \\n]*",O="[A-Za-z][^\0-\x1f \"'>/=\x7f-\x9f]*",v="[^\0-\x1f \"'>/=\x7f-\x9f]+",C=`${v}(?:${I}=${I}${`(?:'[^']*'|"[^"]*"|${N})`})?`,D=`(${v})(?:${I}=${I}${`(?:'([^']*)'|"([^"]*)"|(${N}))`})?`,T={tag:new RegExp(`(<(?:${O}(?:${N}${C})*${I}/?|/${O}|!--[^]*?--|![^]*?)(?:>|$))`,"u"),attr:new RegExp(C,"u"),attrsplit:new RegExp(D,"u")};class w{parseFromString(t,e="text/html",s=null){const i=s.createDocument();let r=s.body(i);const n=t.replace(/<\?.*?\?>/g,"").split(T.tag);for(;n.length;){const t=n.shift(),e=n.shift();t&&this.addText(s,r,t),e&&">"===e.charAt(e.length-1)&&("!"===e.charAt(1)?this.addComment(s,r,e):r="/"===e.charAt(1)?this.closeTag(s,r,e):this.openTag(s,r,e,n))}return this.checkDocument(s,i),i}addText(t,e,s){return s=y.translate(s),t.append(e,t.text(s))}addComment(t,e,s){return t.append(e,new L(s))}closeTag(t,e,s){const i=s.slice(2,s.length-1).toLowerCase();for(;t.parent(e)&&t.kind(e)!==i;)e=t.parent(e);return t.parent(e)}openTag(t,e,s,i){const r=this.constructor.PCDATA,n=this.constructor.SELF_CLOSING,o=s.match(/<(.*?)[\s\n>/]/)[1].toLowerCase(),a=t.node(o),l=s.replace(/^<.*?[\s\n>]/,"").split(T.attrsplit);return(l.pop().match(/>$/)||l.length<5)&&(this.addAttributes(t,a,l),t.append(e,a),n[o]||s.match(/\/>$/)||(r[o]?this.handlePCDATA(t,a,o,i):e=a)),e}addAttributes(t,e,s){for(;s.length;){const[,i,r,n,o]=s.splice(0,5),a=y.translate(r||n||o||"");t.setAttribute(e,i,a)}}handlePCDATA(t,e,s,i){const r=[],n="</"+s+">";let o="";for(;i.length&&o!==n;)r.push(o),r.push(i.shift()),o=i.shift();t.append(e,t.text(r.join("")))}checkDocument(t,e){const s=this.getOnlyChild(t,t.body(e));if(s){for(const i of t.childNodes(t.body(e))){if(i===s)break;i instanceof L&&i.value.match(/^<!DOCTYPE/)&&(e.type=i.value)}switch(t.kind(s)){case"html":for(const i of s.children)switch(t.kind(i)){case"head":e.head=i;break;case"body":e.body=i}e.root=s,t.remove(s),t.parent(e.body)!==s&&t.append(s,e.body),t.parent(e.head)!==s&&t.insert(e.head,e.body);break;case"head":e.head=t.replace(s,e.head);break;case"body":e.body=t.replace(s,e.body)}}}getOnlyChild(t,e){let s=null;for(const i of t.childNodes(e))if(i instanceof f){if(s)return null;s=i}return s}serialize(t,e,s=!1){const i=this.constructor.SELF_CLOSING,r=t.kind(e),n=this.allAttributes(t,e,s).map(t=>t.name+'="'+this.protectAttribute(t.value,s)+'"').join(" "),o=this.serializeInner(t,e,s);return`<${r}`+(n?" "+n:"")+(s&&!o||i[r]?s?"/>":">":`>${o}</${r}>`)}serializeInner(t,e,s=!1){const i=this.constructor.PCDATA;return Object.hasOwn(i,e.kind)?t.childNodes(e).map(e=>t.value(e)).join(""):t.childNodes(e).map(e=>{const i=t.kind(e);return"#text"===i?this.protectHTML(t.value(e)):"#comment"===i?e.value:this.serialize(t,e,s)}).join("")}allAttributes(t,e,s){const i=t.allAttributes(e);if(!s)return i;const r=t.kind(e),n=this.constructor.XMLNS;if(!Object.hasOwn(n,r))return i;for(const{name:t}of i)if("xmlns"===t)return i;return i.push({name:"xmlns",value:n[r]}),i}protectAttribute(t,e){return"string"!=typeof t&&(t=String(t)),t=t.replace(/&/g,"&amp;").replace(/"/g,"&quot;"),e&&(t=t.replace(/</g,"&lt;").replace(/>/g,"&gt;")),t}protectHTML(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}}w.SELF_CLOSING={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,menuitem:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},w.PCDATA={option:!0,textarea:!0,fieldset:!0,title:!0,style:!0,script:!0},w.XMLNS={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML",html:"http://www.w3.org/1999/xhtml"};class A{constructor(){this.DOMParser=w,this.NodeList=b,this.HTMLCollection=b,this.HTMLElement=f,this.DocumentFragment=b,this.Document=R,this.document=new R(this)}}var k=s(292),M=function(t,e,s,i){return new(s||(s=Promise))(function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function a(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})};class S extends u.AbstractDOMAdaptor{constructor(){super(),this.parser=new w,this.window=new A}parse(t,e){return this.parser.parseFromString(t,e,this)}create(t,e=null){return new f(t)}text(t){return new x(t)}comment(t){return new L(t)}createDocument(){return new R}head(t=this.document){return t.head}body(t=this.document){return t.body}root(t=this.document){return t.root}doctype(t=this.document){return t.type}tags(t,e,s=null,i=null){let r=[];const n=[];if(s)return n;let o=t;for(;o;){const t=o.kind;if("#text"!==t&&"#comment"!==t){if(t===e&&(n.push(o),n.length===i))return n;o.children.length&&(r=o.children.concat(r))}o=r.shift()}return n}elementById(t,e){let s=[],i=t;for(;i;){if("#text"!==i.kind&&"#comment"!==i.kind){if(i.attributes.id===e)return i;i.children.length&&(s=i.children.concat(s))}i=s.shift()}return null}elementsByClass(t,e,s=null){let i=[];const r=[];let n=t;for(;n;){if("#text"!==n.kind&&"#comment"!==n.kind){if((n.attributes.class||"").trim().split(/ +/).includes(e)&&(r.push(n),r.length===s))return r;n.children.length&&(i=n.children.concat(i))}n=i.shift()}return r}elementsByAttribute(t,e,s,i=null){let r=[];const n=[];let o=t;for(;o;){if("#text"!==o.kind&&"#comment"!==o.kind){if(o.attributes[e]===s&&(n.push(o),n.length===i))return n;o.children.length&&(r=o.children.concat(r))}o=r.shift()}return n}getElements(t,e){let s=[];const i=this.body(e);for(const e of t)if("string"==typeof e)if("#"===e.charAt(0)){const t=this.elementById(i,e.slice(1));t&&s.push(t)}else if("."===e.charAt(0))s=s.concat(this.elementsByClass(i,e.slice(1)));else if(e.match(/^[-a-z][-a-z0-9]*$/i))s=s.concat(this.tags(i,e));else{const t=e.match(/^\[(.*?)="(.*?)"\]$/);t&&(s=s.concat(this.elementsByAttribute(i,t[1],t[2])))}else Array.isArray(e)?s=s.concat(e):e instanceof this.window.NodeList||e instanceof this.window.HTMLCollection?s=s.concat(e.nodes):s.push(e);return s}getElement(t,e=this.document){if(e instanceof R&&(e=this.body(e)),"#"===t.charAt(0))return this.elementById(e,t.slice(1));if("."===t.charAt(0))return this.elementsByClass(e,t.slice(1),1)[0];if(t.match(/^[-a-z][-a-z0-9]*$/i))return this.tags(e,t,null,1)[0];const s=t.match(/^\[(.*?)="(.*?)"\]$/);return s?this.elementsByAttribute(e,s[1],s[2],1)[0]:null}contains(t,e){for(;e&&e!==t;)e=this.parent(e);return!!e}parent(t){return t.parent}childIndex(t){return t.parent?t.parent.children.findIndex(e=>e===t):-1}append(t,e){return e.parent&&this.remove(e),t.children.push(e),e.parent=t,e}insert(t,e){if(t.parent&&this.remove(t),e&&e.parent){const s=this.childIndex(e);e.parent.children.splice(s,0,t),t.parent=e.parent}}remove(t){const e=this.childIndex(t);return e>=0&&t.parent.children.splice(e,1),t.parent=null,t}replace(t,e){const s=this.childIndex(e);return s>=0&&(e.parent.children[s]=t,t.parent=e.parent,e.parent=null),e}clone(t,e=!0){const s=new f(t.kind);return s.attributes=Object.assign({},t.attributes),s.children=e?t.children.map(t=>{if("#text"===t.kind)return new x(t.value);if("#comment"===t.kind)return new L(t.value);{const e=this.clone(t);return e.parent=s,e}}):[],s}split(t,e){const s=new x(t.value.slice(e));return t.value=t.value.slice(0,e),t.parent.children.splice(this.childIndex(t)+1,0,s),s.parent=t.parent,s}next(t){const e=t.parent;if(!e)return null;const s=this.childIndex(t)+1;return s>=0&&s<e.children.length?e.children[s]:null}previous(t){const e=t.parent;if(!e)return null;const s=this.childIndex(t)-1;return s>=0?e.children[s]:null}firstChild(t){return t.children[0]}lastChild(t){return t.children[t.children.length-1]}childNodes(t){return[...t.children]}childNode(t,e){return t.children[e]}kind(t){return t.kind}value(t){return"#text"===t.kind?t.value:"#comment"===t.kind?t.value.replace(/^<!(--)?((?:.|\n)*)\1>$/,"$2"):""}textContent(t){return t.children.reduce((t,e)=>t+("#text"===e.kind?e.value:"#comment"===e.kind?"":this.textContent(e)),"")}innerHTML(t){return this.parser.serializeInner(this,t)}outerHTML(t){return this.parser.serialize(this,t)}serializeXML(t){return this.parser.serialize(this,t,!0)}setAttribute(t,e,s,i=null){"string"!=typeof s&&(s=String(s)),i&&(e=i.replace(/.*\//,"")+":"+e.replace(/^.*:/,"")),t.attributes[e]=s,"style"===e&&(t.styles=null)}getAttribute(t,e){return t.attributes[e]}removeAttribute(t,e){delete t.attributes[e]}hasAttribute(t,e){return Object.hasOwn(t.attributes,e)}allAttributes(t){const e=t.attributes,s=[];for(const t of Object.keys(e))s.push({name:t,value:e[t]});return s}addClass(t,e){const s=t.attributes.class,i=(null==s?void 0:s.split(/ /))||[];i.includes(e)||(i.push(e),t.attributes.class=i.join(" "))}removeClass(t,e){const s=t.attributes.class,i=(null==s?void 0:s.split(/ /))||[],r=i.indexOf(e);r>=0&&(i.splice(r,1),t.attributes.class=i.join(" "))}hasClass(t,e){return(t.attributes.class||"").split(/ /).includes(e)}setStyle(t,e,s){t.styles||(t.styles=new k.Styles(this.getAttribute(t,"style"))),t.styles.set(e,s),t.attributes.style=t.styles.cssText}getStyle(t,e){if(!t.styles){const e=this.getAttribute(t,"style");if(!e)return"";t.styles=new k.Styles(e)}return t.styles.get(e)}allStyles(t){return this.getAttribute(t,"style")}insertRules(t,e){t.children=[this.text(this.textContent(t)+"\n\n"+e.join("\n\n"))]}fontSize(t){return 0}fontFamily(t){return""}nodeSize(t,e=1,s=null){return[0,0]}nodeBBox(t){return{left:0,right:0,top:0,bottom:0}}createWorker(){return M(this,void 0,void 0,function*(){return null})}}class _ extends(function(t,e={}){var s;return e=(0,p.userOptions)((0,p.defaultOptions)({},g),e),(s=class extends t{constructor(...t){super(t[0]),this.canMeasureNodes=!1;const e=this.constructor;this.options=(0,p.userOptions)((0,p.defaultOptions)({},e.OPTIONS),t[1])}fontSize(t){return e.badCSS?this.options.fontSize:super.fontSize(t)}fontFamily(t){return e.badCSS?this.options.fontFamily:super.fontFamily(t)}nodeSize(t,i=1,r=null){if(!e.badSizes)return super.nodeSize(t,i,r);const n=this.textContent(t),o=Array.from(n.replace(s.cjkPattern,"")).length;return[(Array.from(n).length-o)*this.options.cjkCharWidth+o*this.options.unknownCharWidth,this.options.unknownCharHeight]}nodeBBox(t){return e.badSizes?{left:0,right:0,top:0,bottom:0}:super.nodeBBox(t)}createWorker(t,e){return E(this,void 0,void 0,function*(){const{Worker:s}=yield(0,m.asyncLoad)("node:worker_threads");const{path:i,maps:r}=e,n=`${i}/${e.worker}`,o=new class{constructor(t,e={}){this.worker=new s(t,e)}addEventListener(t,e){this.worker.on(t,e)}postMessage(t){this.worker.postMessage({data:t})}terminate(){this.worker.terminate()}}(n,{type:"module",workerData:{maps:r}});return o.addEventListener("message",t),o})}}).OPTIONS=Object.assign(Object.assign({},e.badCSS?{fontSize:16,fontFamily:"Times"}:{}),e.badSizes?{cjkCharWidth:1,unknownCharWidth:.6,unknownCharHeight:.8}:{}),s.cjkPattern=new RegExp(["[","\u1100-\u115f","\u2329\u232a","\u2e80-\u303e","\u3040-\u3247","\u3250-\u4dbf","\u4e00-\ua4c6","\ua960-\ua97c","\uac00-\ud7a3","\uf900-\ufaff","\ufe10-\ufe19","\ufe30-\ufe6b","\uff01-\uff60\uffe0-\uffe6","\u{1b000}-\u{1b001}","\u{1f200}-\u{1f251}","\u{20000}-\u{3fffd}","]"].join(""),"gu"),s}(S)){}function j(t=null){return new _(null,t)}MathJax.loader&&MathJax.loader.checkVersion("adaptors/liteDOM",d.x,"adaptors"),(0,h.combineWithMathJax)({_:{adaptors:{liteAdaptor:c,lite:{Document:r,Element:i,List:o,Parser:a,Text:n,Window:l}}}}),MathJax.startup&&(MathJax.startup.registerConstructor("liteAdaptor",j),MathJax.startup.useAdaptor("liteAdaptor",!0))},586(t,e,s){"use strict";var i={};s.r(i),s.d(i,{HTMLAdaptor:()=>yt});var r={};s.r(r),s.d(r,{browserAdaptor:()=>It});var n={};s.r(n),s.d(n,{AbstractFindMath:()=>vt});var o={};s.r(o),s.d(o,{AbstractInputJax:()=>Dt});var a={};s.r(a),s.d(a,{AbstractOutputJax:()=>Tt});var l={};s.r(l),s.d(l,{END:()=>wt,LinkedList:()=>kt,ListItem:()=>At});var c={};s.r(c),s.d(c,{AbstractMathList:()=>Mt});var h={};s.r(h),s.d(h,{AbstractMathItem:()=>_t,STATE:()=>jt,newState:()=>Pt,protoItem:()=>St});var d={};s.r(d),s.d(d,{AbstractFactory:()=>Bt});var u={};s.r(u),s.d(u,{AbstractNodeFactory:()=>Wt});var p={};s.r(p),s.d(p,{Attributes:()=>Ft,INHERIT:()=>Ht});var m={};s.r(m),s.d(m,{AbstractEmptyNode:()=>zt,AbstractNode:()=>$t});var E={};s.r(E),s.d(E,{AbstractMmlBaseNode:()=>Qt,AbstractMmlEmptyNode:()=>te,AbstractMmlLayoutNode:()=>Zt,AbstractMmlNode:()=>Vt,AbstractMmlTokenNode:()=>Yt,MATHVARIANTS:()=>Ut,TEXCLASS:()=>Jt,TEXCLASSNAMES:()=>qt,TextNode:()=>ee,XMLNode:()=>se,indentAttributes:()=>Gt});var g={};s.r(g),s.d(g,{MmlMath:()=>ie});var f={};s.r(f),s.d(f,{MmlMi:()=>re});var R={};s.r(R),s.d(R,{MmlMn:()=>ne});var x={};s.r(x),s.d(x,{MMLSPACING:()=>he,MO:()=>ae,OPDEF:()=>oe,OPTABLE:()=>de,RANGES:()=>le,getRange:()=>ce});var L={};s.r(L),s.d(L,{isPercent:()=>ge,quotePattern:()=>pe,replaceUnicode:()=>Re,sortLength:()=>ue,split:()=>fe,toEntity:()=>xe,unicodeChars:()=>me,unicodeString:()=>Ee});var b={};s.r(b),s.d(b,{MmlMo:()=>Le});var y={};s.r(y),s.d(y,{MmlMtext:()=>be});var N={};s.r(N),s.d(N,{MmlMspace:()=>ye});var I={};s.r(I),s.d(I,{MmlMs:()=>Ne});var O={};s.r(O),s.d(O,{MmlInferredMrow:()=>Oe,MmlMrow:()=>Ie});var v={};s.r(v),s.d(v,{MmlMfrac:()=>ve});var C={};s.r(C),s.d(C,{MmlMsqrt:()=>Ce});var D={};s.r(D),s.d(D,{MmlMroot:()=>De});var T={};s.r(T),s.d(T,{MmlMstyle:()=>Te});var w={};s.r(w),s.d(w,{MmlMerror:()=>we});var A={};s.r(A),s.d(A,{MmlMpadded:()=>Ae});var k={};s.r(k),s.d(k,{MmlMphantom:()=>ke});var M={};s.r(M),s.d(M,{MmlMfenced:()=>Me});var S={};s.r(S),s.d(S,{MmlMenclose:()=>Se});var _={};s.r(_),s.d(_,{MmlMaction:()=>_e});var j={};s.r(j),s.d(j,{MmlMsub:()=>Pe,MmlMsubsup:()=>je,MmlMsup:()=>Be});var P={};s.r(P),s.d(P,{MmlMover:()=>Fe,MmlMunder:()=>He,MmlMunderover:()=>We});var B={};s.r(B),s.d(B,{MmlMmultiscripts:()=>$e,MmlMprescripts:()=>ze,MmlNone:()=>Je});var W={};s.r(W),s.d(W,{MmlMtable:()=>qe});var H={};s.r(H),s.d(H,{MmlMlabeledtr:()=>Xe,MmlMtr:()=>Ke});var F={};s.r(F),s.d(F,{MmlMtd:()=>Ue});var $={};s.r($),s.d($,{MmlMaligngroup:()=>Ge});var z={};s.r(z),s.d(z,{MmlMalignmark:()=>Ve});var J={};s.r(J),s.d(J,{MmlMglyph:()=>Ye});var q={};s.r(q),s.d(q,{MmlAnnotation:()=>ts,MmlAnnotationXML:()=>Qe,MmlSemantics:()=>Ze});var K={};s.r(K),s.d(K,{TeXAtom:()=>es});var X={};s.r(X),s.d(X,{MathChoice:()=>ss});var U={};s.r(U),s.d(U,{HtmlNode:()=>is});var G={};s.r(G),s.d(G,{MML:()=>rs});var V={};s.r(V),s.d(V,{MmlFactory:()=>ns});var Y={};s.r(Y),s.d(Y,{BitField:()=>os,BitFieldClass:()=>as});var Z={};s.r(Z),s.d(Z,{AbstractMathDocument:()=>fs,RenderList:()=>ds,resetAllOptions:()=>ps,resetOptions:()=>us});var Q={};s.r(Q),s.d(Q,{AbstractHandler:()=>xs});var tt={};s.r(tt),s.d(tt,{AbstractVisitor:()=>bs});var et={};s.r(et),s.d(et,{DATAMJX:()=>ys,MmlVisitor:()=>Ns});var st={};s.r(st),s.d(st,{MathMLVisitor:()=>Is});var it={};s.r(it),s.d(it,{SerializedMmlVisitor:()=>Os});var rt={};s.r(rt),s.d(rt,{AbstractWrapper:()=>vs});var nt={};s.r(nt),s.d(nt,{AbstractWrapperFactory:()=>Cs});var ot={};s.r(ot),s.d(ot,{HTMLMathItem:()=>Ts});var at={};s.r(at),s.d(at,{HTMLMathList:()=>ws});var lt={};s.r(lt),s.d(lt,{HTMLDomStrings:()=>As});var ct={};s.r(ct),s.d(ct,{HTMLDocument:()=>ks});var ht={};s.r(ht),s.d(ht,{HTMLHandler:()=>Ms});var dt={};s.r(dt),s.d(dt,{RegisterHTMLHandler:()=>Ss});var ut={};s.r(ut),s.d(ut,{StyleJsonSheet:()=>_s});var pt={};s.r(pt),s.d(pt,{DraggableDialog:()=>Ws,isDialog:()=>Bs});var mt={};s.r(mt),s.d(mt,{InfoDialog:()=>Hs});var Et={};s.r(Et),s.d(Et,{BIGDIMEN:()=>$s,MATHSPACE:()=>qs,RELUNITS:()=>Js,UNITS:()=>zs,em:()=>Us,length2em:()=>Ks,percent:()=>Xs,px:()=>Gs});var gt={};s.r(gt),s.d(gt,{BBox:()=>Vs});var ft={};s.r(ft),s.d(ft,{max:()=>ti,sum:()=>Qs});var Rt=s(977),xt=s(516),Lt=s(502),bt=function(t,e,s,i){return new(s||(s=Promise))(function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function a(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})};class yt extends Lt.AbstractDOMAdaptor{constructor(t){super(t.document),this.canMeasureNodes=!0,this.window=t,this.parser=new t.DOMParser}parse(t,e="text/html"){return this.parser.parseFromString(t,e)}create(t,e){return e?this.document.createElementNS(e,t):this.document.createElement(t)}text(t){return this.document.createTextNode(t)}head(t=this.document){return t.head||t}body(t=this.document){return t.body||t}root(t=this.document){return t.documentElement||t}doctype(t=this.document){return t.doctype?`<!DOCTYPE ${t.doctype.name}>`:""}tags(t,e,s=null){const i=s?t.getElementsByTagNameNS(s,e):t.getElementsByTagName(e);return Array.from(i)}getElements(t,e){let s=[];for(const e of t)"string"==typeof e?s=s.concat(Array.from(this.document.querySelectorAll(e))):Array.isArray(e)||e instanceof this.window.NodeList||e instanceof this.window.HTMLCollection?s=s.concat(Array.from(e)):s.push(e);return s}getElement(t,e=this.document){return e.querySelector(t)}contains(t,e){return t.contains(e)}parent(t){return t.parentNode}append(t,e){return t.appendChild(e)}insert(t,e){return this.parent(e).insertBefore(t,e)}remove(t){return this.parent(t).removeChild(t)}replace(t,e){return this.parent(e).replaceChild(t,e)}clone(t,e=!0){return t.cloneNode(e)}split(t,e){return t.splitText(e)}next(t){return t.nextSibling}previous(t){return t.previousSibling}firstChild(t){return t.firstChild}lastChild(t){return t.lastChild}childNodes(t){return Array.from(t.childNodes)}childNode(t,e){return t.childNodes[e]}kind(t){const e=t.nodeType;return 1===e||3===e||8===e?t.nodeName.toLowerCase():""}value(t){return t.nodeValue||""}textContent(t){return t.textContent}innerHTML(t){return t.innerHTML}outerHTML(t){return t.outerHTML}serializeXML(t){return(new this.window.XMLSerializer).serializeToString(t)}setAttribute(t,e,s,i=null){return i?(e=i.replace(/.*\//,"")+":"+e.replace(/^.*:/,""),t.setAttributeNS(i,e,s)):("style"===e&&(s=s.replace(/\n/g," ")),t.setAttribute(e,s))}getAttribute(t,e){return t.getAttribute(e)}removeAttribute(t,e){return t.removeAttribute(e)}hasAttribute(t,e){return t.hasAttribute(e)}allAttributes(t){return Array.from(t.attributes).map(t=>({name:t.name,value:t.value}))}addClass(t,e){t.classList?t.classList.add(e):t.className=(t.className+" "+e).trim()}removeClass(t,e){t.classList?t.classList.remove(e):t.className=t.className.split(/ /).filter(t=>t!==e).join(" ")}hasClass(t,e){return t.classList?t.classList.contains(e):t.className.split(/ /).includes(e)}setStyle(t,e,s){t.style[e]=String(s).replace(/\n/g," ")}getStyle(t,e){return t.style[e]}allStyles(t){return t.style.cssText}insertRules(t,e){for(const s of e)try{t.sheet.insertRule(s,t.sheet.cssRules.length)}catch(t){console.warn(`MathJax: can't insert css rule '${s}': ${t.message}`)}}cssText(t){return"style"!==this.kind(t)?"":Array.from(t.sheet.cssRules).map(t=>t.cssText).join("\n")}fontSize(t){const e=this.window.getComputedStyle(t);return parseFloat(e.fontSize||String(this.constructor.DEFAULT_FONT_SIZE))}fontFamily(t){return this.window.getComputedStyle(t).fontFamily||""}nodeSize(t,e=1,s=!1){if(s&&t.getBBox){const{width:s,height:i}=t.getBBox();return[s/e,i/e]}return[t.offsetWidth/e,t.offsetHeight/e]}nodeBBox(t){const{left:e,right:s,top:i,bottom:r}=t.getBoundingClientRect();return{left:e,right:s,top:i,bottom:r}}createWorker(t,e){return bt(this,void 0,void 0,function*(){const{path:s,maps:i,worker:r}=e,n=`${s}/${r}`,o=`\n self.maps = '${Nt(i)}';\n importScripts('${Nt(n)}');\n `,a=URL.createObjectURL(new Blob([o],{type:"text/javascript"})),l=new Worker(a);return l.onmessage=t,URL.revokeObjectURL(a),l})}}function Nt(t){return[...t].map(t=>("\\"===t||"'"===t?t="\\"+t:(t<" "||t>"~")&&(t=`\\u{${t.codePointAt(0).toString(16)}}`),t)).join("")}function It(){return new yt(window)}yt.DEFAULT_FONT_SIZE=16;var Ot=s(6);class vt{constructor(t){const e=this.constructor;this.options=(0,Ot.userOptions)((0,Ot.defaultOptions)({},e.OPTIONS),t)}}vt.OPTIONS={};var Ct=s(174);class Dt{constructor(t={}){this.adaptor=null,this.mmlFactory=null;const e=this.constructor;this.options=(0,Ot.userOptions)((0,Ot.defaultOptions)({},e.OPTIONS),t),this.preFilters=new Ct.FunctionList(this.options.preFilters),this.postFilters=new Ct.FunctionList(this.options.postFilters)}get name(){return this.constructor.NAME}setAdaptor(t){this.adaptor=t}setMmlFactory(t){this.mmlFactory=t}initialize(){}reset(...t){}get processStrings(){return!0}findMath(t,e){return[]}executeFilters(t,e,s,i){const r={math:e,document:s,data:i};return t.execute(r),r.data}}Dt.NAME="generic",Dt.OPTIONS={preFilters:[],postFilters:[]};class Tt{constructor(t={}){this.adaptor=null;const e=this.constructor;this.options=(0,Ot.userOptions)((0,Ot.defaultOptions)({},e.OPTIONS),t),this.preFilters=new Ct.FunctionList(this.options.preFilters),this.postFilters=new Ct.FunctionList(this.options.postFilters)}get name(){return this.constructor.NAME}setAdaptor(t){this.adaptor=t}initialize(){}reset(...t){}getMetrics(t){}styleSheet(t){return null}pageElements(t){return null}executeFilters(t,e,s,i){const r={math:e,document:s,data:i};return t.execute(r),r.data}}Tt.NAME="generic",Tt.OPTIONS={preFilters:[],postFilters:[]};const wt=Symbol();class At{constructor(t=null){this.next=null,this.prev=null,this.data=t}}class kt{constructor(...t){this.list=new At(wt),this.list.next=this.list.prev=this.list,this.push(...t)}isBefore(t,e){return t<e}push(...t){for(const e of t){const t=new At(e);t.next=this.list,t.prev=this.list.prev,this.list.prev=t,t.prev.next=t}return this}pop(){const t=this.list.prev;return t.data===wt?null:(this.list.prev=t.prev,t.prev.next=this.list,t.next=t.prev=null,t.data)}unshift(...t){for(const e of t.slice(0).reverse()){const t=new At(e);t.next=this.list.next,t.prev=this.list,this.list.next=t,t.next.prev=t}return this}shift(){const t=this.list.next;return t.data===wt?null:(this.list.next=t.next,t.next.prev=this.list,t.next=t.prev=null,t.data)}remove(...t){const e=new Map;for(const s of t)e.set(s,!0);let s=this.list.next;for(;s.data!==wt;){const t=s.next;e.has(s.data)&&(s.prev.next=s.next,s.next.prev=s.prev,s.next=s.prev=null),s=t}return this}clear(){return this.list.next.prev=this.list.prev.next=null,this.list.next=this.list.prev=this.list,this}*[Symbol.iterator](){let t=this.list.next;for(;t.data!==wt;)yield t.data,t=t.next}*reversed(){let t=this.list.prev;for(;t.data!==wt;)yield t.data,t=t.prev}insert(t,e=null){null===e&&(e=this.isBefore.bind(this));const s=new At(t);let i=this.list.next;for(;i.data!==wt&&e(i.data,s.data);)i=i.next;return s.prev=i.prev,s.next=i,i.prev.next=i.prev=s,this}sort(t=null){null===t&&(t=this.isBefore.bind(this));const e=[];for(const t of this)e.push(new kt(t));for(this.list.next=this.list.prev=this.list;e.length>1;){const s=e.shift(),i=e.shift();s.merge(i,t),e.push(s)}return e.length&&(this.list=e[0].list),this}merge(t,e=null){null===e&&(e=this.isBefore.bind(this));let s=this.list.next,i=t.list.next;for(;s.data!==wt&&i.data!==wt;)e(i.data,s.data)?([i.prev.next,s.prev.next]=[s,i],[i.prev,s.prev]=[s.prev,i.prev],[this.list.prev.next,t.list.prev.next]=[t.list,this.list],[this.list.prev,t.list.prev]=[t.list.prev,this.list.prev],[s,i]=[i.next,s]):s=s.next;return i.data!==wt&&(this.list.prev.next=t.list.next,t.list.next.prev=this.list.prev,t.list.prev.next=this.list,this.list.prev=t.list.prev,t.list.next=t.list.prev=t.list),this}}class Mt extends kt{isBefore(t,e){return t.start.i<e.start.i||t.start.i===e.start.i&&t.start.n<e.start.n}}function St(t,e,s,i,r,n,o=null){return{open:t,math:e,close:s,n:i,start:{n:r},end:{n},display:o}}class _t{get isEscaped(){return null===this.display}constructor(t,e,s=!0,i={i:0,n:0,delim:""},r={i:0,n:0,delim:""}){this.root=null,this.typesetRoot=null,this.metrics={},this.inputData={},this.outputData={},this._state=jt.UNPROCESSED,this.math=t,this.inputJax=e,this.display=s,this.start=i,this.end=r,this.root=null,this.typesetRoot=null,this.metrics={},this.inputData={},this.outputData={}}render(t){t.renderActions.renderMath(this,t)}rerender(t,e=jt.RERENDER){this.state()>=e&&this.state(e-1),t.renderActions.renderMath(this,t,e)}convert(t,e=jt.LAST){t.renderActions.renderConvert(this,t,e)}compile(t){this.state()<jt.COMPILED&&(this.root=this.inputJax.compile(this,t),this.state(jt.COMPILED))}typeset(t){this.state()<jt.TYPESET&&(this.typesetRoot=t.outputJax[this.isEscaped?"escaped":"typeset"](this,t),this.state(jt.TYPESET))}updateDocument(t){}removeFromDocument(t=!1){this.clear()}setMetrics(t,e,s,i){this.metrics={em:t,ex:e,containerWidth:s,scale:i}}state(t=null,e=!1){return null!=t&&(t<jt.INSERTED&&this._state>=jt.INSERTED&&this.removeFromDocument(e),t<jt.TYPESET&&this._state>=jt.TYPESET&&(this.outputData={}),t<jt.COMPILED&&this._state>=jt.COMPILED&&(this.inputData={}),this._state=t),this._state}reset(t=!1){this.state(jt.UNPROCESSED,t)}clear(){}}const jt={UNPROCESSED:0,FINDMATH:10,COMPILED:20,CONVERT:100,METRICS:110,RERENDER:125,TYPESET:150,INSERTED:200,LAST:1e4};function Pt(t,e){if(t in jt)throw Error("State "+t+" already exists");jt[t]=e}class Bt{constructor(t=null){this.defaultKind="unknown",this.nodeMap=new Map,this.node={},null===t&&(t=this.constructor.defaultNodes);for(const e of Object.keys(t))this.setNodeClass(e,t[e])}create(t,...e){return(this.node[t]||this.node[this.defaultKind])(...e)}setNodeClass(t,e){this.nodeMap.set(t,e);const s=this.nodeMap.get(t);this.node[t]=(...t)=>new s(this,...t)}getNodeClass(t){return this.nodeMap.get(t)}deleteNodeClass(t){this.nodeMap.delete(t),delete this.node[t]}nodeIsKind(t,e){return t instanceof this.getNodeClass(e)}getKinds(){return Array.from(this.nodeMap.keys())}}Bt.defaultNodes={};class Wt extends Bt{create(t,e={},s=[]){return this.node[t](e,s)}}const Ht="_inherit_";class Ft{constructor(t,e){this.global=e,this.defaults=Object.create(e),this.inherited=Object.create(this.defaults),this.attributes=Object.create(this.inherited),Object.assign(this.defaults,t)}set(t,e){this.attributes[t]=e}setList(t){Object.assign(this.attributes,t)}unset(t){delete this.attributes[t]}get(t){let e=this.attributes[t];return e===Ht&&(e=this.global[t]),e}getExplicit(t){return this.hasExplicit(t)?this.attributes[t]:void 0}hasExplicit(t){return Object.hasOwn(this.attributes,t)}hasOneOf(t){for(const e of t)if(this.hasExplicit(e))return!0;return!1}getList(...t){const e={};for(const s of t)e[s]=this.get(s);return e}setInherited(t,e){this.inherited[t]=e}getInherited(t){return this.inherited[t]}getDefault(t){return this.defaults[t]}isSet(t){return Object.hasOwn(this.attributes,t)||Object.hasOwn(this.inherited,t)}hasDefault(t){return t in this.defaults}getExplicitNames(){return Object.keys(this.attributes)}getInheritedNames(){return Object.keys(this.inherited)}getDefaultNames(){return Object.keys(this.defaults)}getGlobalNames(){return Object.keys(this.global)}getAllAttributes(){return this.attributes}getAllInherited(){return this.inherited}getAllDefaults(){return this.defaults}getAllGlobals(){return this.global}}class $t{constructor(t,e={},s=[]){this.factory=t,this.parent=null,this.properties={},this.childNodes=[];for(const t of Object.keys(e))this.setProperty(t,e[t]);s.length&&this.setChildren(s)}get kind(){return"unknown"}setProperty(t,e){this.properties[t]=e}getProperty(t){return this.properties[t]}getPropertyNames(){return Object.keys(this.properties)}getAllProperties(){return this.properties}removeProperty(...t){for(const e of t)delete this.properties[e]}isKind(t){return this.factory.nodeIsKind(this,t)}setChildren(t){this.childNodes=[];for(const e of t)this.appendChild(e)}appendChild(t){return this.childNodes.push(t),t.parent=this,t}replaceChild(t,e){const s=this.childIndex(e);return null!==s&&(this.childNodes[s]=t,t.parent=this,e.parent===this&&(e.parent=null)),t}removeChild(t){const e=this.childIndex(t);return null!==e&&(this.childNodes.splice(e,1),t.parent=null),t}childIndex(t){const e=this.childNodes.indexOf(t);return-1===e?null:e}copy(){const t=this.factory.create(this.kind);t.properties=Object.assign({},this.properties);for(const e of this.childNodes||[])e&&t.appendChild(e.copy());return t}findNodes(t){const e=[];return this.walkTree(s=>{s.isKind(t)&&e.push(s)}),e}walkTree(t,e){t(this,e);for(const s of this.childNodes)s&&s.walkTree(t,e);return e}toString(){return this.kind+"("+this.childNodes.join(",")+")"}}class zt extends $t{setChildren(t){}appendChild(t){return t}replaceChild(t,e){return e}childIndex(t){return null}walkTree(t,e){return t(this,e),e}toString(){return this.kind}}const Jt={ORD:0,OP:1,BIN:2,REL:3,OPEN:4,CLOSE:5,PUNCT:6,INNER:7,NONE:-1},qt=["ORD","OP","BIN","REL","OPEN","CLOSE","PUNCT","INNER"],Kt=["","thinmathspace","mediummathspace","thickmathspace"],Xt=[[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]],Ut=new Set(["normal","bold","italic","bold-italic","double-struck","fraktur","bold-fraktur","script","bold-script","sans-serif","bold-sans-serif","sans-serif-italic","sans-serif-bold-italic","monospace","inital","tailed","looped","stretched"]),Gt=["indentalign","indentalignfirst","indentshift","indentshiftfirst"];class Vt extends $t{constructor(t,e={},s=[]){super(t),this.prevClass=null,this.prevLevel=null,this.texclass=null,this.arity<0&&(this.childNodes=[t.create("inferredMrow")],this.childNodes[0].parent=this),this.setChildren(s),this.attributes=new Ft(t.getNodeClass(this.kind).defaults,t.getNodeClass("math").defaults),this.attributes.setList(e)}copy(t=!1){const e=this.factory.create(this.kind);if(e.properties=Object.assign({},this.properties),this.attributes){const s=this.attributes.getAllAttributes();for(const i of Object.keys(s))("id"!==i||t)&&e.attributes.set(i,s[i])}if(this.childNodes&&this.childNodes.length){let t=this.childNodes;1===t.length&&t[0].isInferred&&(t=t[0].childNodes);for(const s of t)s?e.appendChild(s.copy()):e.childNodes.push(null)}return e}get texClass(){return this.texclass}set texClass(t){this.texclass=t}get isToken(){return!1}get isEmbellished(){return!1}get isSpacelike(){return!1}get linebreakContainer(){return!1}get linebreakAlign(){return"data-align"}get isEmpty(){for(const t of this.childNodes)if(!t.isEmpty)return!1;return!0}get arity(){return 1/0}get isInferred(){return!1}get Parent(){let t=this.parent;for(;t&&t.notParent;)t=t.Parent;return t}get notParent(){return!1}setChildren(t){return this.arity<0?this.childNodes[0].setChildren(t):super.setChildren(t)}appendChild(t){if(this.arity<0)return this.childNodes[0].appendChild(t),t;if(t.isInferred){if(this.arity===1/0)return t.childNodes.forEach(t=>super.appendChild(t)),t;const e=t;(t=this.factory.create("mrow")).setChildren(e.childNodes),t.attributes=e.attributes;for(const s of e.getPropertyNames())t.setProperty(s,e.getProperty(s))}return super.appendChild(t)}replaceChild(t,e){return this.arity<0?(this.childNodes[0].replaceChild(t,e),t):super.replaceChild(t,e)}core(){return this}coreMO(){return this}coreIndex(){return 0}childPosition(){let t=null,e=this.parent;for(;e&&e.notParent;)t=e,e=e.parent;if(t=t||this,e){let s=0;for(const i of e.childNodes){if(i===t)return s;s++}}return null}setTeXclass(t){return this.getPrevClass(t),null!=this.texClass?this:t}updateTeXclass(t){t&&(this.prevClass=t.prevClass,this.prevLevel=t.prevLevel,t.prevClass=t.prevLevel=null,this.texClass=t.texClass)}getPrevClass(t){t&&(this.prevClass=t.texClass,this.prevLevel=t.attributes.get("scriptlevel"))}texSpacing(){const t=null!=this.prevClass?this.prevClass:Jt.NONE,e=this.texClass||Jt.ORD;if(t===Jt.NONE||e===Jt.NONE)return"";const s=Xt[t][e];return(this.prevLevel>0||this.attributes.get("scriptlevel")>0)&&s>=0?"":Kt[Math.abs(s)]}hasSpacingAttributes(){return this.isEmbellished&&this.coreMO().hasSpacingAttributes()}setInheritedAttributes(t={},e=!1,s=0,i=!1){var r,n,o;const a=this.attributes.getAllDefaults();for(const e of Object.keys(t)){if(Object.hasOwn(a,e)||Object.hasOwn(Vt.alwaysInherit,e)){const[s,i]=t[e];(null===(n=null===(r=Vt.noInherit[s])||void 0===r?void 0:r[this.kind])||void 0===n?void 0:n[e])||this.attributes.setInherited(e,i)}(null===(o=Vt.stopInherit[this.kind])||void 0===o?void 0:o[e])&&delete(t=Object.assign({},t))[e]}void 0===this.attributes.getExplicit("displaystyle")&&this.attributes.setInherited("displaystyle",e);void 0===this.attributes.getExplicit("scriptlevel")&&this.attributes.setInherited("scriptlevel",s),i&&this.setProperty("texprimestyle",i);const l=this.arity;if(l>=0&&l!==1/0&&(1===l&&0===this.childNodes.length||1!==l&&this.childNodes.length!==l))if(l<this.childNodes.length)this.childNodes=this.childNodes.slice(0,l);else for(;this.childNodes.length<l;)this.appendChild(this.factory.create("mrow"));if(this.linebreakContainer&&!this.isEmbellished){const e=this.linebreakAlign;if(e){const s=this.attributes.get(e)||"left";t=this.addInheritedAttributes(t,{indentalign:s,indentshift:"0",indentalignfirst:s,indentshiftfirst:"0",indentalignlast:"indentalign",indentshiftlast:"indentshift"})}}this.setChildInheritedAttributes(t,e,s,i)}setChildInheritedAttributes(t,e,s,i){for(const r of this.childNodes)r.setInheritedAttributes(t,e,s,i)}addInheritedAttributes(t,e){const s=Object.assign({},t);for(const t of Object.keys(e))"displaystyle"!==t&&"scriptlevel"!==t&&"style"!==t&&(s[t]=[this.kind,e[t]]);return s}inheritAttributesFrom(t){const e=t.attributes,s=e.get("displaystyle"),i=e.get("scriptlevel"),r=e.isSet("mathsize")?{mathsize:["math",e.get("mathsize")]}:{},n=t.getProperty("texprimestyle")||!1;this.setInheritedAttributes(r,s,i,n)}verifyTree(t=null){if(null===t)return;this.verifyAttributes(t);const e=this.arity;t.checkArity&&e>=0&&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',t,!0),this.verifyChildren(t)}verifyAttributes(t){if(t.checkAttributes){const e=this.attributes,s=[];for(const t of e.getExplicitNames())"data-"===t.substring(0,5)||void 0!==e.getDefault(t)||t.match(/^(?:class|style|id|(?:xlink:)?href)$/)||s.push(t);s.length&&this.mError("Unknown attributes for "+this.kind+" node: "+s.join(", "),t)}if(t.checkMathvariants){const e=this.attributes.getExplicit("mathvariant");!e||Ut.has(e)||this.getProperty("ignore-variant")||this.mError(`Invalid mathvariant: ${e}`,t,!0)}}verifyChildren(t){for(const e of this.childNodes)e.verifyTree(t)}mError(t,e,s=!1){if(this.parent&&this.parent.isKind("merror"))return null;const i=this.factory.create("merror");if(i.attributes.set("data-mjx-message",t),e.fullErrors||s){const s=this.factory.create("mtext"),r=this.factory.create("text");r.setText(e.fullErrors?t:this.kind),s.appendChild(r),i.appendChild(s),this.parent.replaceChild(i,this),e.fullErrors||i.attributes.set("title",t)}else this.parent.replaceChild(i,this),i.appendChild(this);return i}}Vt.defaults={mathbackground:Ht,mathcolor:Ht,mathsize:Ht,dir:Ht},Vt.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}},mtr:{msqrt:{"data-vertical-align":!0},mroot:{"data-vertical-align":!0}},mlabeledtr:{msqrt:{"data-vertical-align":!0},mroot:{"data-vertical-align":!0}}},Vt.stopInherit={mtd:{columnalign:!0,rowalign:!0,groupalign:!0}},Vt.alwaysInherit={scriptminsize:!0,scriptsizemultiplier:!0,infixlinebreakstyle:!0},Vt.verifyDefaults={checkArity:!0,checkAttributes:!1,checkMathvariants:!0,fullErrors:!1,fixMmultiscripts:!0,fixMtables:!0};class Yt extends Vt{get isToken(){return!0}get isEmpty(){for(const t of this.childNodes)if(!(t instanceof ee)||t.getText().length)return!1;return!0}getText(){let t="";for(const e of this.childNodes)e instanceof ee?t+=e.getText():"textContent"in e&&(t+=e.textContent());return t}setChildInheritedAttributes(t,e,s,i){for(const r of this.childNodes)r instanceof Vt&&r.setInheritedAttributes(t,e,s,i)}walkTree(t,e){t(this,e);for(const s of this.childNodes)s instanceof Vt&&s.walkTree(t,e);return e}}Yt.defaults=Object.assign(Object.assign({},Vt.defaults),{mathvariant:"normal",mathsize:Ht});class Zt extends Vt{get isSpacelike(){return this.childNodes[0].isSpacelike}get isEmbellished(){return this.childNodes[0].isEmbellished}get arity(){return-1}core(){return this.childNodes[0]}coreMO(){return this.childNodes[0].coreMO()}setTeXclass(t){return t=this.childNodes[0].setTeXclass(t),this.updateTeXclass(this.childNodes[0]),t}}Zt.defaults=Vt.defaults;class Qt extends Vt{get isEmbellished(){return this.childNodes[0].isEmbellished}core(){return this.childNodes[0]}coreMO(){return this.childNodes[0].coreMO()}setTeXclass(t){this.getPrevClass(t),this.texClass=Jt.ORD;const e=this.childNodes[0];let s=null;e&&(this.isEmbellished||e.isKind("mi")?(s=e.setTeXclass(t),this.updateTeXclass(this.core())):(e.setTeXclass(null),e.isKind("TeXAtom")&&(this.texClass=e.texClass)));for(const t of this.childNodes.slice(1))t&&t.setTeXclass(null);return s||this}}Qt.defaults=Vt.defaults;class te extends zt{get isToken(){return!1}get isEmpty(){return!0}get isEmbellished(){return!1}get isSpacelike(){return!1}get linebreakContainer(){return!1}get linebreakAlign(){return""}get arity(){return 0}get isInferred(){return!1}get notParent(){return!1}get Parent(){return this.parent}get texClass(){return Jt.NONE}get prevClass(){return Jt.NONE}get prevLevel(){return 0}hasSpacingAttributes(){return!1}get attributes(){return null}core(){return this}coreMO(){return this}coreIndex(){return 0}childPosition(){return 0}setTeXclass(t){return t}texSpacing(){return""}setInheritedAttributes(t,e,s,i){}inheritAttributesFrom(t){}verifyTree(t){}mError(t,e,s=!1){return null}}class ee extends te{constructor(){super(...arguments),this.text=""}get kind(){return"text"}getText(){return this.text}setText(t){return this.text=t,this}copy(){return this.factory.create(this.kind).setText(this.getText())}toString(){return this.text}}class se extends te{constructor(){super(...arguments),this.xml=null,this.adaptor=null}get kind(){return"XML"}getXML(){return this.xml}setXML(t,e=null){return this.xml=t,this.adaptor=e,this}getSerializedXML(){return this.adaptor.serializeXML(this.xml)}copy(){return this.factory.create(this.kind).setXML(this.adaptor.clone(this.xml))}toString(){return"XML data"}}class ie extends Zt{get kind(){return"math"}get linebreakContainer(){return!0}get linebreakAlign(){return""}setChildInheritedAttributes(t,e,s,i){"display"===this.attributes.get("mode")&&this.attributes.setInherited("display","block"),t=this.addInheritedAttributes(t,this.attributes.getAllAttributes()),e=!!this.attributes.get("displaystyle")||!this.attributes.get("displaystyle")&&"block"===this.attributes.get("display"),this.attributes.setInherited("displaystyle",e),s=this.attributes.get("scriptlevel")||this.constructor.defaults.scriptlevel,super.setChildInheritedAttributes(t,e,s,i)}verifyTree(t=null){super.verifyTree(t),this.parent&&this.mError("Improper nesting of math tags",t,!0)}}ie.defaults=Object.assign(Object.assign({},Zt.defaults),{mathvariant:"normal",mathsize:"normal",mathcolor:"",mathbackground:"transparent",dir:"ltr",scriptlevel:0,displaystyle:!1,display:"inline",maxwidth:"",overflow:"linebreak",altimg:"","altimg-width":"","altimg-height":"","altimg-valign":"",alttext:"",cdgroup:"",scriptsizemultiplier:1/Math.sqrt(2),scriptminsize:".4em",infixlinebreakstyle:"before",lineleading:"100%",linebreakmultchar:"\u2062",indentshift:"auto",indentalign:"auto",indenttarget:"",indentalignfirst:"indentalign",indentshiftfirst:"indentshift",indentalignlast:"indentalign",indentshiftlast:"indentshift"});class re extends Yt{constructor(){super(...arguments),this.texclass=Jt.ORD}get kind(){return"mi"}setInheritedAttributes(t={},e=!1,s=0,i=!1){super.setInheritedAttributes(t,e,s,i);this.getText().match(re.singleCharacter)&&!t.mathvariant&&this.attributes.setInherited("mathvariant","italic")}setTeXclass(t){this.getPrevClass(t);const e=this.getText();return e.length>1&&e.match(re.operatorName)&&"normal"===this.attributes.get("mathvariant")&&void 0===this.getProperty("autoOP")&&void 0===this.getProperty("texClass")&&(this.texClass=Jt.OP,this.setProperty("autoOP",!0)),this}}re.defaults=Object.assign({},Yt.defaults),re.operatorName=/^[a-z][a-z0-9]*$/i,re.singleCharacter=/^[\uD800-\uDBFF]?.[\u0300-\u036F\u1AB0-\u1ABE\u1DC0-\u1DFF\u20D0-\u20EF]*$/;class ne extends Yt{constructor(){super(...arguments),this.texclass=Jt.ORD}get kind(){return"mn"}}function oe(t,e,s=Jt.BIN,i=null){return[t,e,s,i]}ne.defaults=Object.assign({},Yt.defaults);const ae={REL:oe(5,5,Jt.REL),WIDEREL:oe(5,5,Jt.REL,{accent:!0,stretchy:!0}),BIN4:oe(4,4,Jt.BIN),RELSTRETCH:oe(5,5,Jt.REL,{stretchy:!0}),ORD:oe(0,0,Jt.ORD),BIN3:oe(3,3,Jt.BIN),OPEN:oe(0,0,Jt.OPEN,{fence:!0,stretchy:!0,symmetric:!0}),CLOSE:oe(0,0,Jt.CLOSE,{fence:!0,stretchy:!0,symmetric:!0}),INTEGRAL:oe(3,3,Jt.OP,{largeop:!0,symmetric:!0}),ACCENT:oe(0,0,Jt.ORD,{accent:!0}),WIDEACCENT:oe(0,0,Jt.ORD,{accent:!0,stretchy:!0}),OP:oe(3,3,Jt.OP,{largeop:!0,movablelimits:!0,symmetric:!0}),RELACCENT:oe(5,5,Jt.REL,{accent:!0}),BIN0:oe(0,0,Jt.BIN),BIN5:oe(5,5,Jt.BIN),FENCE:oe(0,0,Jt.ORD,{fence:!0,stretchy:!0,symmetric:!0}),INNER:oe(1,1,Jt.INNER),ORD30:oe(3,0,Jt.ORD),NONE:oe(0,0,Jt.NONE),ORDSTRETCH0:oe(0,0,Jt.ORD,{stretchy:!0}),BINSTRETCH0:oe(0,0,Jt.BIN,{stretchy:!0}),RELSTRETCH0:oe(0,0,Jt.REL,{stretchy:!0}),CLOSE0:oe(0,0,Jt.CLOSE,{fence:!0}),ORD3:oe(3,3,Jt.ORD),PUNCT03:oe(0,3,Jt.PUNCT,{linebreakstyle:"after"}),OPEN0:oe(0,0,Jt.OPEN,{fence:!0}),STRETCH4:oe(4,4,Jt.BIN,{stretchy:!0})},le=[[32,127,Jt.REL,"mo"],[160,191,Jt.ORD,"mo"],[192,591,Jt.ORD,"mi"],[688,879,Jt.ORD,"mo"],[880,6688,Jt.ORD,"mi"],[6832,6911,Jt.ORD,"mo"],[6912,7615,Jt.ORD,"mi"],[7616,7679,Jt.ORD,"mo"],[7680,8191,Jt.ORD,"mi"],[8192,8303,Jt.ORD,"mo"],[8304,8351,Jt.ORD,"mo"],[8448,8527,Jt.ORD,"mi"],[8528,8591,Jt.ORD,"mn"],[8592,8703,Jt.REL,"mo"],[8704,8959,Jt.BIN,"mo"],[8960,9215,Jt.ORD,"mo"],[9312,9471,Jt.ORD,"mn"],[9472,10223,Jt.ORD,"mo"],[10224,10239,Jt.REL,"mo"],[10240,10495,Jt.ORD,"mtext"],[10496,10623,Jt.REL,"mo"],[10624,10751,Jt.ORD,"mo"],[10752,11007,Jt.BIN,"mo"],[11008,11055,Jt.ORD,"mo"],[11056,11087,Jt.REL,"mo"],[11088,11263,Jt.ORD,"mo"],[11264,11744,Jt.ORD,"mi"],[11776,11903,Jt.ORD,"mo"],[11904,12255,Jt.ORD,"mi","normal"],[12272,12351,Jt.ORD,"mo"],[12352,42143,Jt.ORD,"mi","normal"],[42192,43055,Jt.ORD,"mi"],[43056,43071,Jt.ORD,"mn"],[43072,55295,Jt.ORD,"mi"],[63744,64255,Jt.ORD,"mi","normal"],[64256,65023,Jt.ORD,"mi"],[65024,65135,Jt.ORD,"mo"],[65136,65791,Jt.ORD,"mi"],[65792,65935,Jt.ORD,"mn"],[65936,74751,Jt.ORD,"mi","normal"],[74752,74879,Jt.ORD,"mn"],[74880,113823,Jt.ORD,"mi","normal"],[113824,119391,Jt.ORD,"mo"],[119648,119679,Jt.ORD,"mn"],[119808,120781,Jt.ORD,"mi"],[120782,120831,Jt.ORD,"mn"],[122624,129023,Jt.ORD,"mo"],[129024,129279,Jt.REL,"mo"],[129280,129535,Jt.ORD,"mo"],[131072,195103,Jt.ORD,"mi","normal"]];function ce(t){const e=de.infix[t]||de.prefix[t]||de.postfix[t];if(e)return[0,0,e[2],"mo"];const s=t.codePointAt(0);for(const t of le)if(s<=t[1]){if(s>=t[0])return t;break}return[0,0,Jt.REL,"mo"]}const he=[[0,0],[1,2],[3,3],[4,4],[0,0],[0,0],[0,3],[1,1]],de={prefix:{"!":ae.ORD,"(":ae.OPEN,"+":ae.BIN0,"-":ae.BIN0,"[":ae.OPEN,"{":ae.OPEN,"|":ae.OPEN,"||":ae.BIN0,"\xac":ae.ORD,"\xb1":ae.BIN0,"\u2016":ae.FENCE,"\u2018":ae.OPEN0,"\u201c":ae.OPEN0,\u2145:ae.ORD30,\u2146:ae.ORD30,"\u2200":ae.ORD,"\u2201":ae.ORD,"\u2202":ae.ORD30,"\u2203":ae.ORD,"\u2204":ae.ORD,"\u2207":ae.ORD,"\u220f":ae.OP,"\u2210":ae.OP,"\u2211":ae.OP,"\u2212":ae.BIN0,"\u2213":ae.BIN0,"\u221a":[3,0,Jt.ORD,{stretchy:!0}],"\u221b":ae.ORD30,"\u221c":ae.ORD30,"\u221f":ae.ORD,"\u2220":ae.ORD,"\u2221":ae.ORD,"\u2222":ae.ORD,"\u222b":ae.INTEGRAL,"\u222c":ae.INTEGRAL,"\u222d":ae.INTEGRAL,"\u222e":ae.INTEGRAL,"\u222f":ae.INTEGRAL,"\u2230":ae.INTEGRAL,"\u2231":ae.INTEGRAL,"\u2232":ae.INTEGRAL,"\u2233":ae.INTEGRAL,"\u2234":ae.REL,"\u2235":ae.REL,"\u223c":[0,0,Jt.REL,{}],"\u22be":ae.ORD,"\u22bf":ae.ORD,"\u22c0":ae.OP,"\u22c1":ae.OP,"\u22c2":ae.OP,"\u22c3":ae.OP,"\u2308":ae.OPEN,"\u230a":ae.OPEN,"\u2310":ae.ORD,"\u2319":ae.ORD,"\u2772":ae.OPEN,"\u2795":ae.ORD,"\u2796":ae.ORD,"\u27c0":ae.ORD,"\u27e6":ae.OPEN,"\u27e8":ae.OPEN,"\u27ea":ae.OPEN,"\u27ec":ae.OPEN,"\u27ee":ae.OPEN,"\u2980":ae.FENCE,"\u2983":ae.OPEN,"\u2985":ae.OPEN,"\u2987":ae.OPEN,"\u2989":ae.OPEN,"\u298b":ae.OPEN,"\u298d":ae.OPEN,"\u298f":ae.OPEN,"\u2991":ae.OPEN,"\u2993":ae.OPEN,"\u2995":ae.OPEN,"\u2997":ae.OPEN,"\u2999":ae.FENCE,"\u299b":ae.ORD,"\u299c":ae.ORD,"\u299d":ae.ORD,"\u299e":ae.ORD,"\u299f":ae.ORD,"\u29a0":ae.ORD,"\u29a1":ae.ORD,"\u29a2":ae.ORD,"\u29a3":ae.ORD,"\u29a4":ae.ORD,"\u29a5":ae.ORD,"\u29a6":ae.ORD,"\u29a7":ae.ORD,"\u29a8":ae.ORD,"\u29a9":ae.ORD,"\u29aa":ae.ORD,"\u29ab":ae.ORD,"\u29ac":ae.ORD,"\u29ad":ae.ORD,"\u29ae":ae.ORD,"\u29af":ae.ORD,"\u29d8":ae.OPEN,"\u29da":ae.OPEN,"\u29fc":ae.OPEN,"\u2a00":ae.OP,"\u2a01":ae.OP,"\u2a02":ae.OP,"\u2a03":ae.OP,"\u2a04":ae.OP,"\u2a05":ae.OP,"\u2a06":ae.OP,"\u2a07":ae.OP,"\u2a08":ae.OP,"\u2a09":ae.OP,"\u2a0a":ae.OP,"\u2a0b":ae.INTEGRAL,"\u2a0c":ae.INTEGRAL,"\u2a0d":ae.INTEGRAL,"\u2a0e":ae.INTEGRAL,"\u2a0f":ae.INTEGRAL,"\u2a10":ae.INTEGRAL,"\u2a11":ae.INTEGRAL,"\u2a12":ae.INTEGRAL,"\u2a13":ae.INTEGRAL,"\u2a14":ae.INTEGRAL,"\u2a15":ae.INTEGRAL,"\u2a16":ae.INTEGRAL,"\u2a17":ae.INTEGRAL,"\u2a18":ae.INTEGRAL,"\u2a19":ae.INTEGRAL,"\u2a1a":ae.INTEGRAL,"\u2a1b":ae.INTEGRAL,"\u2a1c":ae.INTEGRAL,"\u2a1d":ae.OP,"\u2a1e":ae.OP,"\u2aec":ae.ORD,"\u2aed":ae.ORD,"\u2afc":ae.OP,"\u2aff":ae.OP,"\u3008":ae.OPEN},postfix:{"!!":ae.BIN0,"!":ae.CLOSE0,'"':ae.ORD,"%":ae.ORD,"&":ae.ORD,"'":ae.ACCENT,")":ae.CLOSE,"++":ae.BIN0,"--":ae.BIN0,"]":ae.CLOSE,"^":ae.WIDEACCENT,_:ae.WIDEACCENT,"`":ae.ACCENT,"|":ae.CLOSE,"||":ae.BIN0,"}":ae.CLOSE,"~":ae.WIDEACCENT,"\xa8":ae.ACCENT,"\xaf":ae.WIDEACCENT,"\xb0":ae.ACCENT,"\xb2":ae.ORD,"\xb3":ae.ORD,"\xb4":ae.ACCENT,"\xb8":ae.ACCENT,"\xb9":ae.ORD,\u02c6:ae.WIDEACCENT,\u02c7:ae.WIDEACCENT,\u02c9:ae.WIDEACCENT,\u02ca:ae.ACCENT,\u02cb:ae.ACCENT,\u02cd:ae.WIDEACCENT,"\u02d8":ae.ACCENT,"\u02d9":ae.ACCENT,"\u02da":ae.ACCENT,"\u02dc":ae.WIDEACCENT,"\u02dd":ae.ACCENT,"\u02f7":ae.WIDEACCENT,"\u0302":ae.WIDEACCENT,"\u0311":ae.ACCENT,"\u2016":ae.FENCE,"\u2019":ae.CLOSE0,"\u201a":ae.ORD,"\u201b":ae.ORD,"\u201d":ae.CLOSE0,"\u201e":ae.ORD,"\u201f":ae.ORD,"\u2032":ae.ORD,"\u2033":ae.ORD,"\u2034":ae.ORD,"\u2035":ae.ORD,"\u2036":ae.ORD,"\u2037":ae.ORD,"\u203e":ae.WIDEACCENT,"\u2057":ae.ORD,"\u20db":ae.ACCENT,"\u20dc":ae.ACCENT,"\u2309":ae.CLOSE,"\u230b":ae.CLOSE,"\u2322":ae.RELSTRETCH0,"\u2323":ae.RELSTRETCH0,"\u23b4":ae.WIDEACCENT,"\u23b5":ae.WIDEACCENT,"\u23cd":ae.ORD,"\u23dc":ae.WIDEACCENT,"\u23dd":ae.WIDEACCENT,"\u23de":ae.WIDEACCENT,"\u23df":ae.WIDEACCENT,"\u23e0":ae.WIDEACCENT,"\u23e1":ae.WIDEACCENT,"\u2773":ae.CLOSE,"\u27e7":ae.CLOSE,"\u27e9":ae.CLOSE,"\u27eb":ae.CLOSE,"\u27ed":ae.CLOSE,"\u27ef":ae.CLOSE,"\u2980":ae.FENCE,"\u2984":ae.CLOSE,"\u2986":ae.CLOSE,"\u2988":ae.CLOSE,"\u298a":ae.CLOSE,"\u298c":ae.CLOSE,"\u298e":ae.CLOSE,"\u2990":ae.CLOSE,"\u2992":ae.CLOSE,"\u2994":ae.CLOSE,"\u2996":ae.CLOSE,"\u2998":ae.CLOSE,"\u2999":ae.FENCE,"\u29d9":ae.CLOSE,"\u29db":ae.CLOSE,"\u29fd":ae.CLOSE,"\u3009":ae.CLOSE,"\u{1eef0}":ae.BINSTRETCH0,"\u{1eef1}":ae.BINSTRETCH0},infix:{"!":ae.ORD,"!=":ae.BIN5,"#":ae.ORD,$:ae.ORD,"%":ae.ORD3,"&&":ae.BIN4,"**":ae.BIN3,"*":ae.BIN3,"*=":ae.BIN5,"+":ae.BIN4,"+=":ae.BIN5,",":ae.PUNCT03,"":ae.ORD,"-":ae.BIN4,"-=":ae.BIN5,"->":ae.BIN5,".":ae.ORD3,"..":ae.BIN3,"...":ae.INNER,"/":[4,4,Jt.ORD,{}],"//":ae.BIN5,"/=":ae.BIN5,":":[0,3,Jt.REL,{}],":=":ae.BIN5,";":ae.PUNCT03,"<":ae.REL,"<=":ae.REL,"<>":[3,3,Jt.REL,{}],"=":ae.REL,"==":ae.REL,">":ae.REL,">=":ae.REL,"?":[3,3,Jt.CLOSE,{fence:!0}],"@":ae.ORD3,"\\":ae.ORD,"^":[3,3,Jt.ORD,{accent:!0,stretchy:!0}],_:ae.WIDEACCENT,"|":[5,5,Jt.ORD,{}],"||":ae.BIN5,"\xb1":ae.BIN4,"\xb7":ae.BIN3,"\xd7":ae.BIN3,"\xf7":ae.BIN4,\u02b9:ae.ORD,"\u0300":ae.ACCENT,"\u0301":ae.ACCENT,"\u0303":ae.WIDEACCENT,"\u0304":ae.ACCENT,"\u0306":ae.ACCENT,"\u0307":ae.ACCENT,"\u0308":ae.ACCENT,"\u030c":ae.ACCENT,"\u0332":ae.WIDEACCENT,"\u0338":ae.REL,"\u03f6":ae.REL,"\u2015":ae.ORDSTRETCH0,"\u2017":ae.ORDSTRETCH0,"\u2020":ae.BIN3,"\u2021":ae.BIN3,"\u2022":ae.BIN3,"\u2026":ae.INNER,"\u2043":ae.BIN3,"\u2044":ae.STRETCH4,"\u2061":ae.NONE,"\u2062":ae.NONE,"\u2063":[0,0,Jt.NONE,{linebreakstyle:"after"}],"\u2064":ae.NONE,"\u20d7":ae.ACCENT,\u2111:ae.ORD,\u2113:ae.ORD,\u2118:ae.ORD,\u211c:ae.ORD,"\u2190":ae.WIDEREL,"\u2191":ae.RELSTRETCH,"\u2192":ae.WIDEREL,"\u2193":ae.RELSTRETCH,"\u2194":ae.WIDEREL,"\u2195":ae.RELSTRETCH,"\u2196":ae.REL,"\u2197":ae.REL,"\u2198":ae.REL,"\u2199":ae.REL,"\u219a":ae.WIDEREL,"\u219b":ae.WIDEREL,"\u219c":ae.WIDEREL,"\u219d":ae.WIDEREL,"\u219e":ae.WIDEREL,"\u219f":ae.RELSTRETCH,"\u21a0":ae.WIDEREL,"\u21a1":ae.RELSTRETCH,"\u21a2":ae.WIDEREL,"\u21a3":ae.WIDEREL,"\u21a4":ae.WIDEREL,"\u21a5":ae.RELSTRETCH,"\u21a6":ae.WIDEREL,"\u21a7":ae.RELSTRETCH,"\u21a8":ae.RELSTRETCH,"\u21a9":ae.