@lelouchhe/webagent 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,173 @@
1
+ import{b as ms}from"./chunk.UMQMOGWO.js";var Ka=null,Qa=()=>Ka??=import("./chunk.VZXGXFNN.js").then(e=>e.default);async function Ja(e){let t=await Qa();for(let n of e.querySelectorAll("pre code"))n.dataset.highlighted||t.highlightElement(n)}function ei(e){let t=e.querySelectorAll("pre");for(let n of t){if(!n.querySelector("code")||n.parentElement?.classList.contains("code-block-wrapper"))continue;let s=document.createElement("div");s.className="code-block-wrapper";let a=document.createElement("div");a.className="code-toolbar";let l=document.createElement("button");l.className="copy-btn",l.textContent="cp",l.type="button",a.appendChild(l),n.replaceWith(s),s.appendChild(a),s.appendChild(n)}}var Un=new WeakMap;function nd(e){let t=e.target.closest(".copy-btn");if(!t)return;let r=t.closest(".code-block-wrapper")?.querySelector("code");if(!r)return;let s=r.textContent||"";navigator.clipboard.writeText(s).then(()=>{let a=Un.get(t);a&&clearTimeout(a),t.textContent="\u2713",t.classList.add("copied");let l=setTimeout(()=>{t.textContent="cp",t.classList.remove("copied"),Un.delete(t)},1500);Un.set(t,l)}).catch(()=>{let a=document.createRange();a.selectNodeContents(r);let l=window.getSelection();l?.removeAllRanges(),l?.addRange(a)})}function rd(e){e.querySelector("pre code")&&(ei(e),Ja(e))}function sd(){}var fs={task_complete:"\u2714",read:"cat",edit:"edit",execute:"exec",search:"find",delete:"rm"},gs="run",it={pending:"[ ]",in_progress:"[~]",completed:"[x]"},bs={pending:"pending",in_progress:"in progress",completed:"completed"};var ti="Info: Operation cancelled by user",lt="<final_answer>",ni=/<\/final_answer\s*>/i,ri=/<\/final_answer>\s*$/i;function Qt(e){return e.replaceAll(ti,"Info: Operation cancelled \u2014 ")}function xs(e,t){if(t?.startsWith(lt)&&(e.startsWith(t)||t.startsWith(e)))return{foldedText:(e.startsWith(t)?t:e).slice(lt.length).replace(ri,""),continuationText:e.startsWith(t)?e.slice(t.length):""};if(!e.startsWith(lt))return null;let n=ni.exec(e);return!n||n.index<lt.length?null:{foldedText:e.slice(lt.length,n.index),continuationText:e.slice(n.index+n[0].length)}}function ld(e,t){if(e!=="completed"||!t)return null;let n=jn(t);return n.startsWith(lt)?n:null}function ys(e,t,n){let r=fs[e]||gs,s,a;return n&&typeof n=="object"&&(n.command?(s=n.command,a="$ "):n.path&&(s=n.path)),{icon:r,title:t,detail:s,detailPrefix:a,showDiff:e==="edit"}}function jn(e){return e.map(t=>t.type==="terminal"?`[terminal ${t.terminalId}]`:t.content&&!Array.isArray(t.content)&&t.content.text?t.content.text:Array.isArray(t.content)?t.content.map(n=>n.text??"").join(""):"").filter(Boolean).join(`
2
+ `)}function ws(e){return{icon:e==="completed"?"\u2713":e==="failed"?"\u2717":"\u2026",className:`tool-call ${e}`}}function ks(e){let t=e||"",n=t.includes("allow")?"allow":"deny",r=t.includes("reject")||t.includes("deny")?"deny":"resolve";return{cssClass:n,apiAction:r}}function As(e,t){return e??(t?"denied":"allowed")}function Ts(e){return e.map(t=>({status:it[t.status]?t.status:"unknown",symbol:it[t.status]||"[?]",content:t.content}))}function vs(e){let t=Object.keys(it),n=new Map,r=0;for(let a of e)it[a.status]?n.set(a.status,(n.get(a.status)??0)+1):r+=1;let s=t.flatMap(a=>{let l=n.get(a)??0;return l>0?[{status:a,symbol:it[a],label:bs[a]??a,count:l}]:[]});return r>0&&s.push({status:"unknown",symbol:"[?]",label:"unknown",count:r}),s}function Ss(e){if(typeof e=="string"&&e.includes("*** Begin Patch")){let t=e.split(`
3
+ `),n=[];for(let r of t)r.startsWith("*** Begin Patch")||r.startsWith("*** End Patch")||(r.startsWith("*** Update File:")||r.startsWith("*** Add File:")||r.startsWith("*** Delete File:")?n.push({kind:"file",text:r}):r.startsWith("@@")?n.push({kind:"hunk",text:r}):r.startsWith("-")?n.push({kind:"del",text:r}):r.startsWith("+")?n.push({kind:"add",text:r}):n.push({kind:"context",text:r}));return n}if(e&&typeof e=="object"){let t=[];if(e.path&&t.push({kind:"file",text:`*** ${e.path}`}),e.old_str!=null)for(let n of String(e.old_str).split(`
4
+ `))t.push({kind:"del",text:`- ${n}`});if(e.new_str!=null)for(let n of String(e.new_str).split(`
5
+ `))t.push({kind:"add",text:`+ ${n}`});if(e.file_text!=null)for(let n of String(e.file_text).split(`
6
+ `))t.push({kind:"add",text:`+ ${n}`});return t.length>(e.path?1:0)?t:null}return null}function ud(e){if(Array.isArray(e))return{events:e,streaming:{thinking:!1,assistant:!1}};let t=e;return{events:t.events??[],streaming:t.streaming??{thinking:!1,assistant:!1},total:typeof t.total=="number"?t.total:void 0,hasMore:typeof t.hasMore=="boolean"?t.hasMore:void 0}}function cd(e,t,n){return e&&t===0&&n===0}function _s(e,t){let n=Ts(e),r=vs(e),s=document.createElement("details");s.className=t.className,s.open=t.open;let a=document.createElement("summary");a.className="plan-summary";let l=r.map(b=>`${b.count} ${b.label}`).join(", ");a.setAttribute("aria-label",l?`plan: ${l}`:"plan");let u=document.createElement("span");u.className="plan-label",u.textContent="plan",a.appendChild(u);let c=document.createElement("span");c.className="plan-counts";for(let[b,f]of r.entries()){b>0&&c.appendChild(document.createTextNode(" "));let x=document.createElement("span");x.className=`plan-status-${f.status}`;let A=document.createElement("span");A.className="plan-symbol plan-count-symbol",A.textContent=f.symbol,x.appendChild(A),x.appendChild(document.createTextNode(` ${f.count}`)),c.appendChild(x)}a.appendChild(c),s.appendChild(a);let d=document.createElement("div");d.className="plan-entries";for(let b of n){let f=document.createElement("div");f.className=`plan-entry plan-status-${b.status}`;let x=document.createElement("span");x.className="plan-symbol",x.textContent=b.symbol,f.appendChild(x),f.appendChild(document.createTextNode(" "));let A=document.createElement("span");A.className="plan-content",A.textContent=b.content,f.appendChild(A),d.appendChild(f)}return s.appendChild(d),s}function Xn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ke=Xn();function Ms(e){Ke=e}var Xe={exec:()=>null};function H(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(s,a)=>{let l=typeof a=="string"?a:a.source;return l=l.replace(pe.caret,"$1"),n=n.replace(s,l),r},getRegex:()=>new RegExp(n,t)};return r}var si=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),pe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},oi=/^(?:[ \t]*(?:\n|$))+/,ai=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ii=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Tt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,li=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Yn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,$s=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Is=H($s).replace(/bull/g,Yn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ui=H($s).replace(/bull/g,Yn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Kn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ci=/^[^\n]+/,Qn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,di=H(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Qn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),pi=H(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Yn).getRegex(),rn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Jn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,hi=H("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Jn).replace("tag",rn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Bs=H(Kn).replace("hr",Tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex(),mi=H(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Bs).getRegex(),er={blockquote:mi,code:ai,def:di,fences:ii,heading:li,hr:Tt,html:hi,lheading:Is,list:pi,newline:oi,paragraph:Bs,table:Xe,text:ci},Es=H("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex(),fi={...er,lheading:ui,table:Es,paragraph:H(Kn).replace("hr",Tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Es).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex()},gi={...er,html:H(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Jn).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Xe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:H(Kn).replace("hr",Tt).replace("heading",` *#{1,6} *[^
7
+ ]`).replace("lheading",Is).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},bi=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xi=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ns=/^( {2,}|\\)\n(?!\s*$)/,yi=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ut=/[\p{P}\p{S}]/u,sn=/[\s\p{P}\p{S}]/u,tr=/[^\s\p{P}\p{S}]/u,wi=H(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,sn).getRegex(),Ps=/(?!~)[\p{P}\p{S}]/u,ki=/(?!~)[\s\p{P}\p{S}]/u,Ai=/(?:[^\s\p{P}\p{S}]|~)/u,Ti=H(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",si?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),zs=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,vi=H(zs,"u").replace(/punct/g,ut).getRegex(),Si=H(zs,"u").replace(/punct/g,Ps).getRegex(),Fs="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_i=H(Fs,"gu").replace(/notPunctSpace/g,tr).replace(/punctSpace/g,sn).replace(/punct/g,ut).getRegex(),Ei=H(Fs,"gu").replace(/notPunctSpace/g,Ai).replace(/punctSpace/g,ki).replace(/punct/g,Ps).getRegex(),Ci=H("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,tr).replace(/punctSpace/g,sn).replace(/punct/g,ut).getRegex(),Di=H(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ut).getRegex(),Li="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ri=H(Li,"gu").replace(/notPunctSpace/g,tr).replace(/punctSpace/g,sn).replace(/punct/g,ut).getRegex(),qi=H(/\\(punct)/,"gu").replace(/punct/g,ut).getRegex(),Oi=H(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Mi=H(Jn).replace("(?:-->|$)","-->").getRegex(),$i=H("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Mi).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),en=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Ii=H(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",en).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Gs=H(/^!?\[(label)\]\[(ref)\]/).replace("label",en).replace("ref",Qn).getRegex(),Hs=H(/^!?\[(ref)\](?:\[\])?/).replace("ref",Qn).getRegex(),Bi=H("reflink|nolink(?!\\()","g").replace("reflink",Gs).replace("nolink",Hs).getRegex(),Cs=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,nr={_backpedal:Xe,anyPunctuation:qi,autolink:Oi,blockSkip:Ti,br:Ns,code:xi,del:Xe,delLDelim:Xe,delRDelim:Xe,emStrongLDelim:vi,emStrongRDelimAst:_i,emStrongRDelimUnd:Ci,escape:bi,link:Ii,nolink:Hs,punctuation:wi,reflink:Gs,reflinkSearch:Bi,tag:$i,text:yi,url:Xe},Ni={...nr,link:H(/^!?\[(label)\]\((.*?)\)/).replace("label",en).getRegex(),reflink:H(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",en).getRegex()},Wn={...nr,emStrongRDelimAst:Ei,emStrongLDelim:Si,delLDelim:Di,delRDelim:Ri,url:H(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Cs).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:H(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Cs).getRegex()},Pi={...Wn,br:H(Ns).replace("{2,}","*").getRegex(),text:H(Wn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Jt={normal:er,gfm:fi,pedantic:gi},kt={normal:nr,gfm:Wn,breaks:Pi,pedantic:Ni},zi={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ds=e=>zi[e];function Me(e,t){if(t){if(pe.escapeTest.test(e))return e.replace(pe.escapeReplace,Ds)}else if(pe.escapeTestNoEncode.test(e))return e.replace(pe.escapeReplaceNoEncode,Ds);return e}function Ls(e){try{e=encodeURI(e).replace(pe.percentDecode,"%")}catch{return null}return e}function Rs(e,t){let n=e.replace(pe.findPipe,(a,l,u)=>{let c=!1,d=l;for(;--d>=0&&u[d]==="\\";)c=!c;return c?"|":" |"}),r=n.split(pe.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(pe.slashPipe,"|");return r}function Ue(e,t,n){let r=e.length;if(r===0)return"";let s=0;for(;s<r;){let a=e.charAt(r-s-1);if(a===t&&!n)s++;else if(a!==t&&n)s++;else break}return e.slice(0,r-s)}function qs(e){let t=e.split(`
8
+ `),n=t.length-1;for(;n>=0&&pe.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
9
+ `)}function Fi(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Gi(e,t=0){let n=t,r="";for(let s of e)if(s===" "){let a=4-n%4;r+=" ".repeat(a),n+=a}else r+=s,n++;return r}function Os(e,t,n,r,s){let a=t.href,l=t.title||null,u=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let c={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:l,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,c}function Hi(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let s=r[1];return t.split(`
10
+ `).map(a=>{let l=a.match(n.other.beginningSpace);if(l===null)return a;let[u]=l;return u.length>=s.length?a.slice(s.length):a}).join(`
11
+ `)}var tn=class{options;rules;lexer;constructor(e){this.options=e||Ke}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=this.options.pedantic?t[0]:qs(t[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=Hi(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=Ue(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:Ue(t[0],`
12
+ `),depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Ue(t[0],`
13
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Ue(t[0],`
14
+ `).split(`
15
+ `),r="",s="",a=[];for(;n.length>0;){let l=!1,u=[],c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))u.push(n[c]),l=!0;else if(!l)u.push(n[c]);else break;n=n.slice(c);let d=u.join(`
16
+ `),b=d.replace(this.rules.other.blockquoteSetextReplace,`
17
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
18
+ ${d}`:d,s=s?`${s}
19
+ ${b}`:b;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,a,!0),this.lexer.state.top=f,n.length===0)break;let x=a.at(-1);if(x?.type==="code")break;if(x?.type==="blockquote"){let A=x,_=A.raw+`
20
+ `+n.join(`
21
+ `),O=this.blockquote(_);a[a.length-1]=O,r=r.substring(0,r.length-A.raw.length)+O.raw,s=s.substring(0,s.length-A.text.length)+O.text;break}else if(x?.type==="list"){let A=x,_=A.raw+`
22
+ `+n.join(`
23
+ `),O=this.list(_);a[a.length-1]=O,r=r.substring(0,r.length-x.raw.length)+O.raw,s=s.substring(0,s.length-A.raw.length)+O.raw,n=_.substring(a.at(-1).raw.length).split(`
24
+ `);continue}}return{type:"blockquote",raw:r,tokens:a,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let a=this.rules.other.listItemRegex(n),l=!1;for(;e;){let c=!1,d="",b="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;d=t[0],e=e.substring(d.length);let f=Gi(t[2].split(`
25
+ `,1)[0],t[1].length),x=e.split(`
26
+ `,1)[0],A=!f.trim(),_=0;if(this.options.pedantic?(_=2,b=f.trimStart()):A?_=t[1].length+1:(_=f.search(this.rules.other.nonSpaceChar),_=_>4?1:_,b=f.slice(_),_+=t[1].length),A&&this.rules.other.blankLine.test(x)&&(d+=x+`
27
+ `,e=e.substring(x.length+1),c=!0),!c){let O=this.rules.other.nextBulletRegex(_),R=this.rules.other.hrRegex(_),C=this.rules.other.fencesBeginRegex(_),L=this.rules.other.headingBeginRegex(_),$=this.rules.other.htmlBeginRegex(_),B=this.rules.other.blockquoteBeginRegex(_);for(;e;){let j=e.split(`
28
+ `,1)[0],V;if(x=j,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),V=x):V=x.replace(this.rules.other.tabCharGlobal," "),C.test(x)||L.test(x)||$.test(x)||B.test(x)||O.test(x)||R.test(x))break;if(V.search(this.rules.other.nonSpaceChar)>=_||!x.trim())b+=`
29
+ `+V.slice(_);else{if(A||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(f)||L.test(f)||R.test(f))break;b+=`
30
+ `+x}A=!x.trim(),d+=j+`
31
+ `,e=e.substring(j.length+1),f=V.slice(_)}}s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(l=!0)),s.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(b),loose:!1,text:b,tokens:[]}),s.raw+=d}let u=s.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c of s.items){if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),c.task){if(c.text=c.text.replace(this.rules.other.listReplaceTask,""),c.tokens[0]?.type==="text"||c.tokens[0]?.type==="paragraph"){c.tokens[0].raw=c.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),c.tokens[0].text=c.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let b=this.lexer.inlineQueue.length-1;b>=0;b--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[b].src)){this.lexer.inlineQueue[b].src=this.lexer.inlineQueue[b].src.replace(this.rules.other.listReplaceTask,"");break}}let d=this.rules.other.listTaskCheckbox.exec(c.raw);if(d){let b={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};c.checked=b.checked,s.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=b.raw+c.tokens[0].raw,c.tokens[0].text=b.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(b)):c.tokens.unshift({type:"paragraph",raw:b.raw,text:b.raw,tokens:[b]}):c.tokens.unshift(b)}}if(!s.loose){let d=c.tokens.filter(f=>f.type==="space"),b=d.length>0&&d.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=b}}if(s.loose)for(let c of s.items){c.loose=!0;for(let d of c.tokens)d.type==="text"&&(d.type="paragraph")}return s}}html(e){let t=this.rules.block.html.exec(e);if(t){let n=qs(t[0]);return{type:"html",block:!0,raw:n,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:Ue(t[0],`
32
+ `),href:r,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Rs(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
33
+ `):[],a={type:"table",raw:Ue(t[0],`
34
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?a.align.push("right"):this.rules.other.tableAlignCenter.test(l)?a.align.push("center"):this.rules.other.tableAlignLeft.test(l)?a.align.push("left"):a.align.push(null);for(let l=0;l<n.length;l++)a.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:a.align[l]});for(let l of s)a.rows.push(Rs(l,a.header.length).map((u,c)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:a.align[c]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:Ue(t[0],`
35
+ `),depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
36
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=Ue(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=Fi(t[2],"()");if(a===-2)return;if(a>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(r);a&&(r=a[1],s=a[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Os(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return Os(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,a,l,u=s,c=0,d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+s);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(l=[...a].length,r[3]||r[4]){u+=l;continue}else if((r[5]||r[6])&&s%3&&!((s+l)%3)){c+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+c);let b=[...r[0]][0].length,f=e.slice(0,s+r.index+b+l);if(Math.min(s,l)%2){let A=f.slice(1,-1);return{type:"em",raw:f,text:A,tokens:this.lexer.inlineTokens(A)}}let x=f.slice(2,-2);return{type:"strong",raw:f,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,a,l,u=s,c=this.rules.inline.delRDelim;for(c.lastIndex=0,t=t.slice(-1*e.length+s);(r=c.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a||(l=[...a].length,l!==s))continue;if(r[3]||r[4]){u+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u);let d=[...r[0]][0].length,b=e.slice(0,s+r.index+d+l),f=b.slice(s,-s);return{type:"del",raw:b,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},ye=class Vn{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ke,this.options.tokenizer=this.options.tokenizer||new tn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:pe,block:Jt.normal,inline:kt.normal};this.options.pedantic?(n.block=Jt.pedantic,n.inline=kt.pedantic):this.options.gfm&&(n.block=Jt.gfm,this.options.breaks?n.inline=kt.breaks:n.inline=kt.gfm),this.tokenizer.rules=n}static get rules(){return{block:Jt,inline:kt}}static lex(t,n){return new Vn(n).lex(t)}static lexInline(t,n){return new Vn(n).inlineTokens(t)}lex(t){t=t.replace(pe.carriageReturn,`
37
+ `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(pe.tabCharGlobal," ").replace(pe.spaceLine,""));let s=1/0;for(;t;){if(t.length<s)s=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let a;if(this.options.extensions?.block?.some(u=>(a=u.call({lexer:this},t,n))?(t=t.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);let u=n.at(-1);a.raw.length===1&&u!==void 0?u.raw+=`
38
+ `:n.push(a);continue}if(a=this.tokenizer.code(t)){t=t.substring(a.raw.length);let u=n.at(-1);u?.type==="paragraph"||u?.type==="text"?(u.raw+=(u.raw.endsWith(`
39
+ `)?"":`
40
+ `)+a.raw,u.text+=`
41
+ `+a.text,this.inlineQueue.at(-1).src=u.text):n.push(a);continue}if(a=this.tokenizer.fences(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.heading(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.hr(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.blockquote(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.list(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.html(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.def(t)){t=t.substring(a.raw.length);let u=n.at(-1);u?.type==="paragraph"||u?.type==="text"?(u.raw+=(u.raw.endsWith(`
42
+ `)?"":`
43
+ `)+a.raw,u.text+=`
44
+ `+a.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},n.push(a));continue}if(a=this.tokenizer.table(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.lheading(t)){t=t.substring(a.raw.length),n.push(a);continue}let l=t;if(this.options.extensions?.startBlock){let u=1/0,c=t.slice(1),d;this.options.extensions.startBlock.forEach(b=>{d=b.call({lexer:this},c),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(l=t.substring(0,u+1))}if(this.state.top&&(a=this.tokenizer.paragraph(l))){let u=n.at(-1);r&&u?.type==="paragraph"?(u.raw+=(u.raw.endsWith(`
45
+ `)?"":`
46
+ `)+a.raw,u.text+=`
47
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(a),r=l.length!==t.length,t=t.substring(a.raw.length);continue}if(a=this.tokenizer.text(t)){t=t.substring(a.raw.length);let u=n.at(-1);u?.type==="text"?(u.raw+=(u.raw.endsWith(`
48
+ `)?"":`
49
+ `)+a.raw,u.text+=`
50
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(a);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){this.tokenizer.lexer=this;let r=t,s=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)a=s[2]?s[2].length:0,r=r.slice(0,s.index+a)+"["+"a".repeat(s[0].length-a-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let l=!1,u="",c=1/0;for(;t;){if(t.length<c)c=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}l||(u=""),l=!1;let d;if(this.options.extensions?.inline?.some(f=>(d=f.call({lexer:this},t,n))?(t=t.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);let f=n.at(-1);d.type==="text"&&f?.type==="text"?(f.raw+=d.raw,f.text+=d.text):n.push(d);continue}if(d=this.tokenizer.emStrong(t,r,u)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.del(t,r,u)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),n.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),n.push(d);continue}let b=t;if(this.options.extensions?.startInline){let f=1/0,x=t.slice(1),A;this.options.extensions.startInline.forEach(_=>{A=_.call({lexer:this},x),typeof A=="number"&&A>=0&&(f=Math.min(f,A))}),f<1/0&&f>=0&&(b=t.substring(0,f+1))}if(d=this.tokenizer.inlineText(b)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(u=d.raw.slice(-1)),l=!0;let f=n.at(-1);f?.type==="text"?(f.raw+=d.raw,f.text+=d.text):n.push(d);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return n}infiniteLoopError(t){let n="Infinite loop on byte: "+t;if(this.options.silent)console.error(n);else throw new Error(n)}},nn=class{options;parser;constructor(e){this.options=e||Ke}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(pe.notSpaceStart)?.[0],s=e.replace(pe.endingNewline,"")+`
51
+ `;return r?'<pre><code class="language-'+Me(r)+'">'+(n?s:Me(s,!0))+`</code></pre>
52
+ `:"<pre><code>"+(n?s:Me(s,!0))+`</code></pre>
53
+ `}blockquote({tokens:e}){return`<blockquote>
54
+ ${this.parser.parse(e)}</blockquote>
55
+ `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
56
+ `}hr(e){return`<hr>
57
+ `}list(e){let t=e.ordered,n=e.start,r="";for(let l=0;l<e.items.length;l++){let u=e.items[l];r+=this.listitem(u)}let s=t?"ol":"ul",a=t&&n!==1?' start="'+n+'"':"";return"<"+s+a+`>
58
+ `+r+"</"+s+`>
59
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
60
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
61
+ `}table(e){let t="",n="";for(let s=0;s<e.header.length;s++)n+=this.tablecell(e.header[s]);t+=this.tablerow({text:n});let r="";for(let s=0;s<e.rows.length;s++){let a=e.rows[s];n="";for(let l=0;l<a.length;l++)n+=this.tablecell(a[l]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
62
+ <thead>
63
+ `+t+`</thead>
64
+ `+r+`</table>
65
+ `}tablerow({text:e}){return`<tr>
66
+ ${e}</tr>
67
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
68
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Me(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),s=Ls(e);if(s===null)return r;e=s;let a='<a href="'+e+'"';return t&&(a+=' title="'+Me(t)+'"'),a+=">"+r+"</a>",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let s=Ls(e);if(s===null)return Me(n);e=s;let a=`<img src="${e}" alt="${Me(n)}"`;return t&&(a+=` title="${Me(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Me(e.text)}},rr=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Ce=class Zn{options;renderer;textRenderer;constructor(t){this.options=t||Ke,this.options.renderer=this.options.renderer||new nn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new rr}static parse(t,n){return new Zn(n).parse(t)}static parseInline(t,n){return new Zn(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let r=0;r<t.length;r++){let s=t[r];if(this.options.extensions?.renderers?.[s.type]){let l=s,u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=u||"";continue}}let a=s;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(t,n=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<t.length;s++){let a=t[s];if(this.options.extensions?.renderers?.[a.type]){let u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=u||"";continue}}let l=a;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"checkbox":{r+=n.checkbox(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{let u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},At=class{options;block;constructor(e){this.options=e||Ke}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ye.lex:ye.lexInline}provideParser(e=this.block){return e?Ce.parse:Ce.parseInline}},Ui=class{defaults=Xn();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ce;Renderer=nn;TextRenderer=rr;Lexer=ye;Tokenizer=tn;Hooks=At;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let s=r;for(let a of s.header)n=n.concat(this.walkTokens(a.tokens,t));for(let a of s.rows)for(let l of a)n=n.concat(this.walkTokens(l.tokens,t));break}case"list":{let s=r;n=n.concat(this.walkTokens(s.items,t));break}default:{let s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(a=>{let l=s[a].flat(1/0);n=n.concat(this.walkTokens(l,t))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=t.renderers[s.name];a?t.renderers[s.name]=function(...l){let u=s.renderer.apply(this,l);return u===!1&&(u=a.apply(this,l)),u}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=t[s.level];a?a.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),n.renderer){let s=this.defaults.renderer||new nn(this.defaults);for(let a in n.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let l=a,u=n.renderer[l],c=s[l];s[l]=(...d)=>{let b=u.apply(s,d);return b===!1&&(b=c.apply(s,d)),b||""}}r.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new tn(this.defaults);for(let a in n.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let l=a,u=n.tokenizer[l],c=s[l];s[l]=(...d)=>{let b=u.apply(s,d);return b===!1&&(b=c.apply(s,d)),b}}r.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new At;for(let a in n.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let l=a,u=n.hooks[l],c=s[l];At.passThroughHooks.has(a)?s[l]=d=>{if(this.defaults.async&&At.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await u.call(s,d);return c.call(s,f)})();let b=u.call(s,d);return c.call(s,b)}:s[l]=(...d)=>{if(this.defaults.async)return(async()=>{let f=await u.apply(s,d);return f===!1&&(f=await c.apply(s,d)),f})();let b=u.apply(s,d);return b===!1&&(b=c.apply(s,d)),b}}r.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,a=n.walkTokens;r.walkTokens=function(l){let u=[];return u.push(a.call(this,l)),s&&(u=u.concat(s.call(this,l))),u}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ye.lex(e,t??this.defaults)}parser(e,t){return Ce.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},s={...this.defaults,...r},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let l=s.hooks?await s.hooks.preprocess(t):t,u=await(s.hooks?await s.hooks.provideLexer(e):e?ye.lex:ye.lexInline)(l,s),c=s.hooks?await s.hooks.processAllTokens(u):u;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let d=await(s.hooks?await s.hooks.provideParser(e):e?Ce.parse:Ce.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(d):d})().catch(a);try{s.hooks&&(t=s.hooks.preprocess(t));let l=(s.hooks?s.hooks.provideLexer(e):e?ye.lex:ye.lexInline)(t,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let u=(s.hooks?s.hooks.provideParser(e):e?Ce.parse:Ce.parseInline)(l,s);return s.hooks&&(u=s.hooks.postprocess(u)),u}catch(l){return a(l)}}}onError(e,t){return n=>{if(n.message+=`
69
+ Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+Me(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},Ye=new Ui;function N(e,t){return Ye.parse(e,t)}N.options=N.setOptions=function(e){return Ye.setOptions(e),N.defaults=Ye.defaults,Ms(N.defaults),N};N.getDefaults=Xn;N.defaults=Ke;N.use=function(...e){return Ye.use(...e),N.defaults=Ye.defaults,Ms(N.defaults),N};N.walkTokens=function(e,t){return Ye.walkTokens(e,t)};N.parseInline=Ye.parseInline;N.Parser=Ce;N.parser=Ce.parse;N.Renderer=nn;N.TextRenderer=rr;N.Lexer=ye;N.lexer=ye.lex;N.Tokenizer=tn;N.Hooks=At;N.parse=N;var md=N.options,fd=N.setOptions,gd=N.use,bd=N.walkTokens,xd=N.parseInline;var yd=Ce.parse,wd=ye.lex;var{entries:no,setPrototypeOf:Us,isFrozen:ji,getPrototypeOf:Wi,getOwnPropertyDescriptor:Vi}=Object,{freeze:ge,seal:Ae,create:dt}=Object,{apply:ur,construct:cr}=typeof Reflect<"u"&&Reflect;ge||(ge=function(t){return t});Ae||(Ae=function(t){return t});ur||(ur=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),a=2;a<r;a++)s[a-2]=arguments[a];return t.apply(n,s)});cr||(cr=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return new t(...r)});var vt=ne(Array.prototype.forEach),Zi=ne(Array.prototype.lastIndexOf),js=ne(Array.prototype.pop),St=ne(Array.prototype.push),Xi=ne(Array.prototype.splice),fe=Array.isArray,Ct=ne(String.prototype.toLowerCase),sr=ne(String.prototype.toString),Ws=ne(String.prototype.match),ct=ne(String.prototype.replace),Vs=ne(String.prototype.indexOf),Yi=ne(String.prototype.trim),Ki=ne(Number.prototype.toString),Qi=ne(Boolean.prototype.toString),Zs=typeof BigInt>"u"?null:ne(BigInt.prototype.toString),Xs=typeof Symbol>"u"?null:ne(Symbol.prototype.toString),Y=ne(Object.prototype.hasOwnProperty),_t=ne(Object.prototype.toString),ce=ne(RegExp.prototype.test),on=Ji(TypeError);function ne(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return ur(e,t,r)}}function Ji(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return cr(e,n)}}function z(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ct;if(Us&&Us(e,null),!fe(t))return e;let r=t.length;for(;r--;){let s=t[r];if(typeof s=="string"){let a=n(s);a!==s&&(ji(t)||(t[r]=a),s=a)}e[s]=!0}return e}function el(e){for(let t=0;t<e.length;t++)Y(e,t)||(e[t]=null);return e}function xe(e){let t=dt(null);for(let[n,r]of no(e))Y(e,n)&&(fe(r)?t[n]=el(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=xe(r):t[n]=r);return t}function tl(e){switch(typeof e){case"string":return e;case"number":return Ki(e);case"boolean":return Qi(e);case"bigint":return Zs?Zs(e):"0";case"symbol":return Xs?Xs(e):"Symbol()";case"undefined":return _t(e);case"function":case"object":{if(e===null)return _t(e);let t=e,n=pt(t,"toString");if(typeof n=="function"){let r=n(t);return typeof r=="string"?r:_t(r)}return _t(e)}default:return _t(e)}}function pt(e,t){for(;e!==null;){let r=Vi(e,t);if(r){if(r.get)return ne(r.get);if(typeof r.value=="function")return ne(r.value)}e=Wi(e)}function n(){return null}return n}function nl(e){try{return ce(e,""),!0}catch{return!1}}var Ys=ge(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),or=ge(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ar=ge(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),rl=ge(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ir=ge(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),sl=ge(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ks=ge(["#text"]),Qs=ge(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),lr=ge(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Js=ge(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),an=ge(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ol=Ae(/\{\{[\w\W]*|[\w\W]*\}\}/gm),al=Ae(/<%[\w\W]*|[\w\W]*%>/gm),il=Ae(/\$\{[\w\W]*/gm),ll=Ae(/^data-[\-\w.\u00B7-\uFFFF]+$/),ul=Ae(/^aria-[\-\w]+$/),ro=Ae(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cl=Ae(/^(?:\w+script|data):/i),dl=Ae(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),so=Ae(/^html$/i),pl=Ae(/^[a-z][.\w]*(-[.\w]+)+$/i),eo=Object.freeze({__proto__:null,ARIA_ATTR:ul,ATTR_WHITESPACE:dl,CUSTOM_ELEMENT:pl,DATA_ATTR:ll,DOCTYPE_NAME:so,ERB_EXPR:al,IS_ALLOWED_URI:ro,IS_SCRIPT_OR_DATA:cl,MUSTACHE_EXPR:ol,TMPLIT_EXPR:il}),Et={element:1,text:3,progressingInstruction:7,comment:8,document:9},hl=function(){return typeof window>"u"?null:window},ml=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null,s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(r=n.getAttribute(s));let a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},to=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function oo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hl(),t=I=>oo(I);if(t.version="3.4.1",t.removed=[],!e||!e.document||e.document.nodeType!==Et.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,s=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:l,Node:u,Element:c,NodeFilter:d,NamedNodeMap:b=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:x,trustedTypes:A}=e,_=c.prototype,O=pt(_,"cloneNode"),R=pt(_,"remove"),C=pt(_,"nextSibling"),L=pt(_,"childNodes"),$=pt(_,"parentNode");if(typeof l=="function"){let I=n.createElement("template");I.content&&I.content.ownerDocument&&(n=I.content.ownerDocument)}let B,j="",{implementation:V,createNodeIterator:Be,createDocumentFragment:Ge,getElementsByTagName:Na}=n,{importNode:Pa}=r,me=to();t.isSupported=typeof no=="function"&&typeof $=="function"&&V&&V.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Ut,ERB_EXPR:jt,TMPLIT_EXPR:Wt,DATA_ATTR:za,ARIA_ATTR:Fa,IS_SCRIPT_OR_DATA:Ga,ATTR_WHITESPACE:Hr,CUSTOM_ELEMENT:Ha}=eo,{IS_ALLOWED_URI:Ur}=eo,ie=null,jr=z({},[...Ys,...or,...ar,...ir,...Ks]),ue=null,Wr=z({},[...Qs,...lr,...Js,...an]),Q=Object.seal(dt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),bt=null,Vt=null,He=Object.seal(dt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Vr=!0,Ln=!0,Zr=!1,Xr=!0,We=!1,xt=!0,Ve=!1,Rn=!1,qn=!1,rt=!1,Zt=!1,Xt=!1,Yr=!0,Kr=!1,Qr="user-content-",On=!0,yt=!1,st={},qe=null,Mn=z({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Jr=null,es=z({},["audio","video","img","source","image","track"]),$n=null,ts=z({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Yt="http://www.w3.org/1998/Math/MathML",Kt="http://www.w3.org/2000/svg",Oe="http://www.w3.org/1999/xhtml",ot=Oe,In=!1,Bn=null,Ua=z({},[Yt,Kt,Oe],sr),Nn=z({},["mi","mo","mn","ms","mtext"]),Pn=z({},["annotation-xml"]),ja=z({},["title","style","font","a","script"]),wt=null,Wa=["application/xhtml+xml","text/html"],Va="text/html",oe=null,at=null,Za=n.createElement("form"),ns=function(g){return g instanceof RegExp||g instanceof Function},zn=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(at&&at===g)return;(!g||typeof g!="object")&&(g={}),g=xe(g),wt=Wa.indexOf(g.PARSER_MEDIA_TYPE)===-1?Va:g.PARSER_MEDIA_TYPE,oe=wt==="application/xhtml+xml"?sr:Ct,ie=Y(g,"ALLOWED_TAGS")&&fe(g.ALLOWED_TAGS)?z({},g.ALLOWED_TAGS,oe):jr,ue=Y(g,"ALLOWED_ATTR")&&fe(g.ALLOWED_ATTR)?z({},g.ALLOWED_ATTR,oe):Wr,Bn=Y(g,"ALLOWED_NAMESPACES")&&fe(g.ALLOWED_NAMESPACES)?z({},g.ALLOWED_NAMESPACES,sr):Ua,$n=Y(g,"ADD_URI_SAFE_ATTR")&&fe(g.ADD_URI_SAFE_ATTR)?z(xe(ts),g.ADD_URI_SAFE_ATTR,oe):ts,Jr=Y(g,"ADD_DATA_URI_TAGS")&&fe(g.ADD_DATA_URI_TAGS)?z(xe(es),g.ADD_DATA_URI_TAGS,oe):es,qe=Y(g,"FORBID_CONTENTS")&&fe(g.FORBID_CONTENTS)?z({},g.FORBID_CONTENTS,oe):Mn,bt=Y(g,"FORBID_TAGS")&&fe(g.FORBID_TAGS)?z({},g.FORBID_TAGS,oe):xe({}),Vt=Y(g,"FORBID_ATTR")&&fe(g.FORBID_ATTR)?z({},g.FORBID_ATTR,oe):xe({}),st=Y(g,"USE_PROFILES")?g.USE_PROFILES&&typeof g.USE_PROFILES=="object"?xe(g.USE_PROFILES):g.USE_PROFILES:!1,Vr=g.ALLOW_ARIA_ATTR!==!1,Ln=g.ALLOW_DATA_ATTR!==!1,Zr=g.ALLOW_UNKNOWN_PROTOCOLS||!1,Xr=g.ALLOW_SELF_CLOSE_IN_ATTR!==!1,We=g.SAFE_FOR_TEMPLATES||!1,xt=g.SAFE_FOR_XML!==!1,Ve=g.WHOLE_DOCUMENT||!1,rt=g.RETURN_DOM||!1,Zt=g.RETURN_DOM_FRAGMENT||!1,Xt=g.RETURN_TRUSTED_TYPE||!1,qn=g.FORCE_BODY||!1,Yr=g.SANITIZE_DOM!==!1,Kr=g.SANITIZE_NAMED_PROPS||!1,On=g.KEEP_CONTENT!==!1,yt=g.IN_PLACE||!1,Ur=nl(g.ALLOWED_URI_REGEXP)?g.ALLOWED_URI_REGEXP:ro,ot=typeof g.NAMESPACE=="string"?g.NAMESPACE:Oe,Nn=Y(g,"MATHML_TEXT_INTEGRATION_POINTS")&&g.MATHML_TEXT_INTEGRATION_POINTS&&typeof g.MATHML_TEXT_INTEGRATION_POINTS=="object"?xe(g.MATHML_TEXT_INTEGRATION_POINTS):z({},["mi","mo","mn","ms","mtext"]),Pn=Y(g,"HTML_INTEGRATION_POINTS")&&g.HTML_INTEGRATION_POINTS&&typeof g.HTML_INTEGRATION_POINTS=="object"?xe(g.HTML_INTEGRATION_POINTS):z({},["annotation-xml"]);let S=Y(g,"CUSTOM_ELEMENT_HANDLING")&&g.CUSTOM_ELEMENT_HANDLING&&typeof g.CUSTOM_ELEMENT_HANDLING=="object"?xe(g.CUSTOM_ELEMENT_HANDLING):dt(null);if(Q=dt(null),Y(S,"tagNameCheck")&&ns(S.tagNameCheck)&&(Q.tagNameCheck=S.tagNameCheck),Y(S,"attributeNameCheck")&&ns(S.attributeNameCheck)&&(Q.attributeNameCheck=S.attributeNameCheck),Y(S,"allowCustomizedBuiltInElements")&&typeof S.allowCustomizedBuiltInElements=="boolean"&&(Q.allowCustomizedBuiltInElements=S.allowCustomizedBuiltInElements),We&&(Ln=!1),Zt&&(rt=!0),st&&(ie=z({},Ks),ue=dt(null),st.html===!0&&(z(ie,Ys),z(ue,Qs)),st.svg===!0&&(z(ie,or),z(ue,lr),z(ue,an)),st.svgFilters===!0&&(z(ie,ar),z(ue,lr),z(ue,an)),st.mathMl===!0&&(z(ie,ir),z(ue,Js),z(ue,an))),He.tagCheck=null,He.attributeCheck=null,Y(g,"ADD_TAGS")&&(typeof g.ADD_TAGS=="function"?He.tagCheck=g.ADD_TAGS:fe(g.ADD_TAGS)&&(ie===jr&&(ie=xe(ie)),z(ie,g.ADD_TAGS,oe))),Y(g,"ADD_ATTR")&&(typeof g.ADD_ATTR=="function"?He.attributeCheck=g.ADD_ATTR:fe(g.ADD_ATTR)&&(ue===Wr&&(ue=xe(ue)),z(ue,g.ADD_ATTR,oe))),Y(g,"ADD_URI_SAFE_ATTR")&&fe(g.ADD_URI_SAFE_ATTR)&&z($n,g.ADD_URI_SAFE_ATTR,oe),Y(g,"FORBID_CONTENTS")&&fe(g.FORBID_CONTENTS)&&(qe===Mn&&(qe=xe(qe)),z(qe,g.FORBID_CONTENTS,oe)),Y(g,"ADD_FORBID_CONTENTS")&&fe(g.ADD_FORBID_CONTENTS)&&(qe===Mn&&(qe=xe(qe)),z(qe,g.ADD_FORBID_CONTENTS,oe)),On&&(ie["#text"]=!0),Ve&&z(ie,["html","head","body"]),ie.table&&(z(ie,["tbody"]),delete bt.tbody),g.TRUSTED_TYPES_POLICY){if(typeof g.TRUSTED_TYPES_POLICY.createHTML!="function")throw on('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof g.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw on('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');B=g.TRUSTED_TYPES_POLICY,j=B.createHTML("")}else B===void 0&&(B=ml(A,s)),B!==null&&typeof j=="string"&&(j=B.createHTML(""));ge&&ge(g),at=g},rs=z({},[...or,...ar,...rl]),ss=z({},[...ir,...sl]),Xa=function(g){let S=$(g);(!S||!S.tagName)&&(S={namespaceURI:ot,tagName:"template"});let M=Ct(g.tagName),Z=Ct(S.tagName);return Bn[g.namespaceURI]?g.namespaceURI===Kt?S.namespaceURI===Oe?M==="svg":S.namespaceURI===Yt?M==="svg"&&(Z==="annotation-xml"||Nn[Z]):!!rs[M]:g.namespaceURI===Yt?S.namespaceURI===Oe?M==="math":S.namespaceURI===Kt?M==="math"&&Pn[Z]:!!ss[M]:g.namespaceURI===Oe?S.namespaceURI===Kt&&!Pn[Z]||S.namespaceURI===Yt&&!Nn[Z]?!1:!ss[M]&&(ja[M]||!rs[M]):!!(wt==="application/xhtml+xml"&&Bn[g.namespaceURI]):!1},_e=function(g){St(t.removed,{element:g});try{$(g).removeChild(g)}catch{R(g)}},Ze=function(g,S){try{St(t.removed,{attribute:S.getAttributeNode(g),from:S})}catch{St(t.removed,{attribute:null,from:S})}if(S.removeAttribute(g),g==="is")if(rt||Zt)try{_e(S)}catch{}else try{S.setAttribute(g,"")}catch{}},os=function(g){let S=null,M=null;if(qn)g="<remove></remove>"+g;else{let te=Ws(g,/^[\r\n\t ]+/);M=te&&te[0]}wt==="application/xhtml+xml"&&ot===Oe&&(g='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+g+"</body></html>");let Z=B?B.createHTML(g):g;if(ot===Oe)try{S=new x().parseFromString(Z,wt)}catch{}if(!S||!S.documentElement){S=V.createDocument(ot,"template",null);try{S.documentElement.innerHTML=In?j:Z}catch{}}let de=S.body||S.documentElement;return g&&M&&de.insertBefore(n.createTextNode(M),de.childNodes[0]||null),ot===Oe?Na.call(S,Ve?"html":"body")[0]:Ve?S.documentElement:de},as=function(g){return Be.call(g.ownerDocument||g,g,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Fn=function(g){return g instanceof f&&(typeof g.nodeName!="string"||typeof g.textContent!="string"||typeof g.removeChild!="function"||!(g.attributes instanceof b)||typeof g.removeAttribute!="function"||typeof g.setAttribute!="function"||typeof g.namespaceURI!="string"||typeof g.insertBefore!="function"||typeof g.hasChildNodes!="function")},Gn=function(g){return typeof u=="function"&&g instanceof u};function Ne(I,g,S){vt(I,M=>{M.call(t,g,S,at)})}let is=function(g){let S=null;if(Ne(me.beforeSanitizeElements,g,null),Fn(g))return _e(g),!0;let M=oe(g.nodeName);if(Ne(me.uponSanitizeElement,g,{tagName:M,allowedTags:ie}),xt&&g.hasChildNodes()&&!Gn(g.firstElementChild)&&ce(/<[/\w!]/g,g.innerHTML)&&ce(/<[/\w!]/g,g.textContent)||xt&&g.namespaceURI===Oe&&M==="style"&&Gn(g.firstElementChild)||g.nodeType===Et.progressingInstruction||xt&&g.nodeType===Et.comment&&ce(/<[/\w]/g,g.data))return _e(g),!0;if(bt[M]||!(He.tagCheck instanceof Function&&He.tagCheck(M))&&!ie[M]){if(!bt[M]&&us(M)&&(Q.tagNameCheck instanceof RegExp&&ce(Q.tagNameCheck,M)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(M)))return!1;if(On&&!qe[M]){let Z=$(g)||g.parentNode,de=L(g)||g.childNodes;if(de&&Z){let te=de.length;for(let be=te-1;be>=0;--be){let ke=O(de[be],!0);Z.insertBefore(ke,C(g))}}}return _e(g),!0}return g instanceof c&&!Xa(g)||(M==="noscript"||M==="noembed"||M==="noframes")&&ce(/<\/no(script|embed|frames)/i,g.innerHTML)?(_e(g),!0):(We&&g.nodeType===Et.text&&(S=g.textContent,vt([Ut,jt,Wt],Z=>{S=ct(S,Z," ")}),g.textContent!==S&&(St(t.removed,{element:g.cloneNode()}),g.textContent=S)),Ne(me.afterSanitizeElements,g,null),!1)},ls=function(g,S,M){if(Vt[S]||Yr&&(S==="id"||S==="name")&&(M in n||M in Za))return!1;if(!(Ln&&!Vt[S]&&ce(za,S))){if(!(Vr&&ce(Fa,S))){if(!(He.attributeCheck instanceof Function&&He.attributeCheck(S,g))){if(!ue[S]||Vt[S]){if(!(us(g)&&(Q.tagNameCheck instanceof RegExp&&ce(Q.tagNameCheck,g)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(g))&&(Q.attributeNameCheck instanceof RegExp&&ce(Q.attributeNameCheck,S)||Q.attributeNameCheck instanceof Function&&Q.attributeNameCheck(S,g))||S==="is"&&Q.allowCustomizedBuiltInElements&&(Q.tagNameCheck instanceof RegExp&&ce(Q.tagNameCheck,M)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(M))))return!1}else if(!$n[S]){if(!ce(Ur,ct(M,Hr,""))){if(!((S==="src"||S==="xlink:href"||S==="href")&&g!=="script"&&Vs(M,"data:")===0&&Jr[g])){if(!(Zr&&!ce(Ga,ct(M,Hr,"")))){if(M)return!1}}}}}}}return!0},Ya=z({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),us=function(g){return!Ya[Ct(g)]&&ce(Ha,g)},cs=function(g){Ne(me.beforeSanitizeAttributes,g,null);let{attributes:S}=g;if(!S||Fn(g))return;let M={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ue,forceKeepAttr:void 0},Z=S.length;for(;Z--;){let de=S[Z],{name:te,namespaceURI:be,value:ke}=de,Ee=oe(te),Hn=ke,le=te==="value"?Hn:Yi(Hn);if(M.attrName=Ee,M.attrValue=le,M.keepAttr=!0,M.forceKeepAttr=void 0,Ne(me.uponSanitizeAttribute,g,M),le=M.attrValue,Kr&&(Ee==="id"||Ee==="name")&&Vs(le,Qr)!==0&&(Ze(te,g),le=Qr+le),xt&&ce(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,le)){Ze(te,g);continue}if(Ee==="attributename"&&Ws(le,"href")){Ze(te,g);continue}if(M.forceKeepAttr)continue;if(!M.keepAttr){Ze(te,g);continue}if(!Xr&&ce(/\/>/i,le)){Ze(te,g);continue}We&&vt([Ut,jt,Wt],hs=>{le=ct(le,hs," ")});let ps=oe(g.nodeName);if(!ls(ps,Ee,le)){Ze(te,g);continue}if(B&&typeof A=="object"&&typeof A.getAttributeType=="function"&&!be)switch(A.getAttributeType(ps,Ee)){case"TrustedHTML":{le=B.createHTML(le);break}case"TrustedScriptURL":{le=B.createScriptURL(le);break}}if(le!==Hn)try{be?g.setAttributeNS(be,te,le):g.setAttribute(te,le),Fn(g)?_e(g):js(t.removed)}catch{Ze(te,g)}}Ne(me.afterSanitizeAttributes,g,null)},ds=function(g){let S=null,M=as(g);for(Ne(me.beforeSanitizeShadowDOM,g,null);S=M.nextNode();)Ne(me.uponSanitizeShadowNode,S,null),is(S),cs(S),S.content instanceof a&&ds(S.content);Ne(me.afterSanitizeShadowDOM,g,null)};return t.sanitize=function(I){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=null,M=null,Z=null,de=null;if(In=!I,In&&(I="<!-->"),typeof I!="string"&&!Gn(I)&&(I=tl(I),typeof I!="string"))throw on("dirty is not a string, aborting");if(!t.isSupported)return I;if(Rn||zn(g),t.removed=[],typeof I=="string"&&(yt=!1),yt){let ke=I.nodeName;if(typeof ke=="string"){let Ee=oe(ke);if(!ie[Ee]||bt[Ee])throw on("root node is forbidden and cannot be sanitized in-place")}}else if(I instanceof u)S=os("<!---->"),M=S.ownerDocument.importNode(I,!0),M.nodeType===Et.element&&M.nodeName==="BODY"||M.nodeName==="HTML"?S=M:S.appendChild(M);else{if(!rt&&!We&&!Ve&&I.indexOf("<")===-1)return B&&Xt?B.createHTML(I):I;if(S=os(I),!S)return rt?null:Xt?j:""}S&&qn&&_e(S.firstChild);let te=as(yt?I:S);for(;Z=te.nextNode();)is(Z),cs(Z),Z.content instanceof a&&ds(Z.content);if(yt)return I;if(rt){if(We){S.normalize();let ke=S.innerHTML;vt([Ut,jt,Wt],Ee=>{ke=ct(ke,Ee," ")}),S.innerHTML=ke}if(Zt)for(de=Ge.call(S.ownerDocument);S.firstChild;)de.appendChild(S.firstChild);else de=S;return(ue.shadowroot||ue.shadowrootmode)&&(de=Pa.call(r,de,!0)),de}let be=Ve?S.outerHTML:S.innerHTML;return Ve&&ie["!doctype"]&&S.ownerDocument&&S.ownerDocument.doctype&&S.ownerDocument.doctype.name&&ce(so,S.ownerDocument.doctype.name)&&(be="<!DOCTYPE "+S.ownerDocument.doctype.name+`>
70
+ `+be),We&&vt([Ut,jt,Wt],ke=>{be=ct(be,ke," ")}),B&&Xt?B.createHTML(be):be},t.setConfig=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};zn(I),Rn=!0},t.clearConfig=function(){at=null,Rn=!1},t.isValidAttribute=function(I,g,S){at||zn({});let M=oe(I),Z=oe(g);return ls(M,Z,S)},t.addHook=function(I,g){typeof g=="function"&&St(me[I],g)},t.removeHook=function(I,g){if(g!==void 0){let S=Zi(me[I],g);return S===-1?void 0:Xi(me[I],S,1)[0]}return js(me[I])},t.removeHooks=function(I){me[I]=[]},t.removeAllHooks=function(){me=to()},t}var ao=oo();var v=class e{constructor(t,n){let r=" "+t,s,a=n&&n.loc;if(a&&a.start<=a.end){let u=a.lexer.input;s=a.start;let c=a.end;s===u.length?r+=" at end of input: ":r+=" at position "+(s+1)+`:
71
+ `;let d=u.slice(s,c).replace(/[^]/g,"$&\u0332"),b;s>15?b="\u2026"+u.slice(s-15,s):b=u.slice(0,s);let f;c+15<u.length?f=u.slice(c,c+15)+"\u2026":f=u.slice(c),r+=b+d+f}let l=new Error(r);return l.name="ParseError",l.__proto__=e.prototype,l.position=s,l}};v.prototype.__proto__=Error.prototype;var De=function(e,t){return e===void 0?t:e},fl=/([A-Z])/g,Dr=function(e){return e.replace(fl,"-$1").toLowerCase()},gl={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},bl=/[&><"']/g;function Pe(e){return String(e).replace(bl,t=>gl[t])}var hn=function(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?hn(e.body[0]):e:e.type==="font"?hn(e.body):e},kn=function(e){let t=hn(e);return t.type==="mathord"||t.type==="textord"||t.type==="atom"},xl=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},yl=function(e){let t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},dr=function(e){return+e.toFixed(4)},Go="aceg\u0131\u0237mnopqrsuvwxyz\u03B1\u03B3\u03B5\u03B7\u03B9\u03BA\u03BC\u03BD\u03BF\u03C0\u03C1\u03C2\u03C3\u03C4\u03C5\u03C7\u03C9\u03D5\u{1D41A}\u{1D41C}\u{1D41E}\u{1D420}\u{1D426}\u{1D427}\u{1D428}\u{1D429}\u{1D42A}\u{1D42B}\u{1D42C}\u{1D42E}\u{1D42F}\u{1D430}\u{1D431}\u{1D432}\u{1D433}",Lt=class{constructor(t){t=t||{},this.displayMode=De(t.displayMode,!1),this.annotate=De(t.annotate,!1),this.leqno=De(t.leqno,!1),this.throwOnError=De(t.throwOnError,!1),this.errorColor=De(t.errorColor,"#b22222"),this.macros=t.macros||{},this.wrap=De(t.wrap,"none"),this.xml=De(t.xml,!1),this.colorIsTextColor=De(t.colorIsTextColor,!1),this.strict=De(t.strict,!1),this.trust=De(t.trust,!1),this.maxSize=t.maxSize===void 0?[1/0,1/0]:Array.isArray(t.maxSize)?t.maxSize:[1/0,1/0],this.maxExpand=Math.max(0,De(t.maxExpand,1e3)),this.wrapDelimiterPairs=!0}isTrusted(t){if(t.url&&!t.protocol){let r=yl(t.url);if(r==null)return!1;t.protocol=r}return!!(typeof this.trust=="function"?this.trust(t):this.trust)}},Ho={},mn={};function D({type:e,names:t,props:n,handler:r,mathmlBuilder:s}){let a={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:r};for(let l=0;l<t.length;++l)Ho[t[l]]=a;e&&s&&(mn[e]=s)}function et({type:e,mathmlBuilder:t}){D({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},mathmlBuilder:t})}var Rt=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},ae=function(e){return e.type==="ordgroup"?e.body:[e]},qt=class{constructor(t){this.children=t,this.classes=[],this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){let t=document.createDocumentFragment();for(let n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){let t="";for(let n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){let t=n=>n.toText();return this.children.map(t).join("")}},mt=function(e){return e.filter(t=>t).join(" ")},wl=function(e,t){this.classes=e||[],this.attributes={},this.style=t||{}},kl=function(e){let t=document.createElement(e);t.className=mt(this.classes);for(let n in this.style)Object.prototype.hasOwnProperty.call(this.style,n)&&(t.style[n]=this.style[n]);for(let n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);for(let n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t},Al=function(e){let t=`<${e}`;this.classes.length&&(t+=` class="${Pe(mt(this.classes))}"`);let n="";for(let r in this.style)Object.prototype.hasOwnProperty.call(this.style,r)&&(n+=`${Dr(r)}:${this.style[r]};`);n&&(t+=` style="${n}"`);for(let r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&(t+=` ${r}="${Pe(this.attributes[r])}"`);t+=">";for(let r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+=`</${e}>`,t},fn=class{constructor(t,n,r){wl.call(this,t,r),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}toNode(){return kl.call(this,"span")}toMarkup(){return Al.call(this,"span")}},Tl=class{constructor(t){this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Pe(this.text)}},gn=class{constructor(t,n,r){this.href=t,this.classes=n,this.children=r||[]}toNode(){let t=document.createElement("a");t.setAttribute("href",this.href),this.classes.length>0&&(t.className=mt(this.classes));for(let n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){let t=`<a href='${Pe(this.href)}'`;this.classes.length>0&&(t+=` class="${Pe(mt(this.classes))}"`),t+=">";for(let n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t+="</a>",t}},xr=class{constructor(t,n,r){this.alt=n,this.src=t,this.classes=["mord"],this.style=r}hasClass(t){return this.classes.includes(t)}toNode(){let t=document.createElement("img");t.src=this.src,t.alt=this.alt,t.className="mord";for(let n in this.style)Object.prototype.hasOwnProperty.call(this.style,n)&&(t.style[n]=this.style[n]);return t}toMarkup(){let t=`<img src='${this.src}' alt='${this.alt}'`,n="";for(let r in this.style)Object.prototype.hasOwnProperty.call(this.style,r)&&(n+=`${Dr(r)}:${this.style[r]};`);return n&&(t+=` style="${Pe(n)}"`),t+=">",t}};function Je(e){return new qt(e)}var y=class{constructor(t,n,r,s){this.type=t,this.attributes={},this.children=n||[],this.classes=r||[],this.style=s||{},this.label=""}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}setLabel(t){this.label=t}toNode(){let t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(let n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=mt(this.classes));for(let n in this.style)Object.prototype.hasOwnProperty.call(this.style,n)&&(t.style[n]=this.style[n]);for(let n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){let t="<"+this.type;for(let r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&(t+=" "+r+'="',t+=Pe(this.attributes[r]),t+='"');this.classes.length>0&&(t+=` class="${Pe(mt(this.classes))}"`);let n="";for(let r in this.style)Object.prototype.hasOwnProperty.call(this.style,r)&&(n+=`${Dr(r)}:${this.style[r]};`);n&&(t+=` style="${n}"`),t+=">";for(let r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}},se=class{constructor(t){this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Pe(this.toText())}toText(){return this.text}},Lr=e=>{let t;return e.length===1&&e[0].type==="mrow"?(t=e.pop(),t.type="mstyle"):t=new y("mstyle",e),t},ht=e=>{let t=0;if(e.body&&Array.isArray(e.body))for(let n of e.body)t+=ht(n);else if(e.body)t+=ht(e.body);else if(e.type==="supsub")t+=ht(e.base),e.sub&&(t+=.7*ht(e.sub)),e.sup&&(t+=.7*ht(e.sup));else if(e.type==="mathord"||e.type==="textord")for(let n of e.text.split("")){let r=n.codePointAt(0);96<r&&r<123||944<r&&r<970?t+=.56:47<r&&r<58?t+=.5:t+=.92}else t+=1;return t},vl={widehat:"^",widecheck:"\u02C7",widetilde:"~",wideparen:"\u23DC",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overbracket:"\u23B4",underbracket:"\u23B5",overgroup:"\u23E0",overparen:"\u23DC",undergroup:"\u23E1",underparen:"\u23DD",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xrightleftarrows:"\u21C4",xtofrom:"\u21C4",xleftrightharpoons:"\u21CB",xrightleftharpoons:"\u21CC",yields:"\u2192",yieldsLeft:"\u2190",mesomerism:"\u2194",longrightharpoonup:"\u21C0",longleftharpoondown:"\u21BD",eqrightharpoonup:"\u21C0",eqleftharpoondown:"\u21BD","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"=",yieldsLeftRight:"\u21C4",chemequilibrium:"\u21CC"},Rr=function(e){let t=new se(vl[e.slice(1)]),n=new y("mo",[t]);return n.setAttribute("stretchy","true"),n},Sl=["\\widetilde","\\widehat","\\widecheck","\\utilde"],Uo=e=>{let t=Rr(e.label);if(Sl.includes(e.label)){let n=ht(e.base);1<n&&n<1.6?t.classes.push("tml-crooked-2"):1.6<=n&&n<2.5?t.classes.push("tml-crooked-3"):2.5<=n&&t.classes.push("tml-crooked-4")}return t},_l={bin:1,close:1,inner:1,open:1,punct:1,rel:1},El={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},K={math:{},text:{}};function o(e,t,n,r,s){K[e][r]={group:t,replace:n},s&&n&&(K[e][n]=K[e][r])}var i="math",w="text",G="accent-token",k="bin",J="close",tt="inner",E="mathord",F="op-token",ee="open",It="punct",m="rel",ze="spacing",h="textord";o(i,m,"\u2261","\\equiv",!0);o(i,m,"\u227A","\\prec",!0);o(i,m,"\u227B","\\succ",!0);o(i,m,"\u223C","\\sim",!0);o(i,m,"\u27C2","\\perp",!0);o(i,m,"\u2AAF","\\preceq",!0);o(i,m,"\u2AB0","\\succeq",!0);o(i,m,"\u2243","\\simeq",!0);o(i,m,"\u224C","\\backcong",!0);o(i,m,"|","\\mid",!0);o(i,m,"\u226A","\\ll",!0);o(i,m,"\u226B","\\gg",!0);o(i,m,"\u224D","\\asymp",!0);o(i,m,"\u2225","\\parallel");o(i,m,"\u2323","\\smile",!0);o(i,m,"\u2291","\\sqsubseteq",!0);o(i,m,"\u2292","\\sqsupseteq",!0);o(i,m,"\u2250","\\doteq",!0);o(i,m,"\u2322","\\frown",!0);o(i,m,"\u220B","\\ni",!0);o(i,m,"\u220C","\\notni",!0);o(i,m,"\u221D","\\propto",!0);o(i,m,"\u22A2","\\vdash",!0);o(i,m,"\u22A3","\\dashv",!0);o(i,m,"\u220B","\\owns");o(i,m,"\u2258","\\arceq",!0);o(i,m,"\u2259","\\wedgeq",!0);o(i,m,"\u225A","\\veeeq",!0);o(i,m,"\u225B","\\stareq",!0);o(i,m,"\u225D","\\eqdef",!0);o(i,m,"\u225E","\\measeq",!0);o(i,m,"\u225F","\\questeq",!0);o(i,m,"\u2260","\\ne",!0);o(i,m,"\u2260","\\neq");o(i,m,"\u2A75","\\eqeq",!0);o(i,m,"\u2A76","\\eqeqeq",!0);o(i,m,"\u2237","\\dblcolon",!0);o(i,m,"\u2254","\\coloneqq",!0);o(i,m,"\u2255","\\eqqcolon",!0);o(i,m,"\u2239","\\eqcolon",!0);o(i,m,"\u2A74","\\Coloneqq",!0);o(i,It,".","\\ldotp");o(i,It,"\xB7","\\cdotp");o(i,h,"#","\\#");o(w,h,"#","\\#");o(i,h,"&","\\&");o(w,h,"&","\\&");o(i,h,"\u2135","\\aleph",!0);o(i,h,"\u2200","\\forall",!0);o(i,h,"\u210F","\\hbar",!0);o(i,h,"\u2203","\\exists",!0);o(i,ee,"\u2207","\\nabla",!0);o(i,h,"\u266D","\\flat",!0);o(i,h,"\u2113","\\ell",!0);o(i,h,"\u266E","\\natural",!0);o(i,h,"\u212B","\\Angstrom",!0);o(w,h,"\u212B","\\Angstrom",!0);o(i,h,"\u2663","\\clubsuit",!0);o(i,h,"\u2667","\\varclubsuit",!0);o(i,h,"\u2118","\\wp",!0);o(i,h,"\u266F","\\sharp",!0);o(i,h,"\u2662","\\diamondsuit",!0);o(i,h,"\u2666","\\vardiamondsuit",!0);o(i,h,"\u211C","\\Re",!0);o(i,h,"\u2661","\\heartsuit",!0);o(i,h,"\u2665","\\varheartsuit",!0);o(i,h,"\u2111","\\Im",!0);o(i,h,"\u2660","\\spadesuit",!0);o(i,h,"\u2664","\\varspadesuit",!0);o(i,h,"\u2640","\\female",!0);o(i,h,"\u2642","\\male",!0);o(i,h,"\xA7","\\S",!0);o(w,h,"\xA7","\\S");o(i,h,"\xB6","\\P",!0);o(w,h,"\xB6","\\P");o(w,h,"\u263A","\\smiley",!0);o(i,h,"\u263A","\\smiley",!0);o(i,h,"\u2020","\\dag");o(w,h,"\u2020","\\dag");o(w,h,"\u2020","\\textdagger");o(i,h,"\u2021","\\ddag");o(w,h,"\u2021","\\ddag");o(w,h,"\u2021","\\textdaggerdbl");o(i,J,"\u23B1","\\rmoustache",!0);o(i,ee,"\u23B0","\\lmoustache",!0);o(i,J,"\u27EF","\\rgroup",!0);o(i,ee,"\u27EE","\\lgroup",!0);o(i,k,"\u2213","\\mp",!0);o(i,k,"\u2296","\\ominus",!0);o(i,k,"\u228E","\\uplus",!0);o(i,k,"\u2293","\\sqcap",!0);o(i,k,"\u2217","\\ast");o(i,k,"\u2294","\\sqcup",!0);o(i,k,"\u25EF","\\bigcirc",!0);o(i,k,"\u2219","\\bullet",!0);o(i,k,"\u2021","\\ddagger");o(i,k,"\u2240","\\wr",!0);o(i,k,"\u2A3F","\\amalg");o(i,k,"&","\\And");o(i,k,"\u2AFD","\\sslash",!0);o(i,m,"\u27F5","\\longleftarrow",!0);o(i,m,"\u21D0","\\Leftarrow",!0);o(i,m,"\u27F8","\\Longleftarrow",!0);o(i,m,"\u27F6","\\longrightarrow",!0);o(i,m,"\u21D2","\\Rightarrow",!0);o(i,m,"\u27F9","\\Longrightarrow",!0);o(i,m,"\u2194","\\leftrightarrow",!0);o(i,m,"\u27F7","\\longleftrightarrow",!0);o(i,m,"\u21D4","\\Leftrightarrow",!0);o(i,m,"\u27FA","\\Longleftrightarrow",!0);o(i,m,"\u21A4","\\mapsfrom",!0);o(i,m,"\u21A6","\\mapsto",!0);o(i,m,"\u27FC","\\longmapsto",!0);o(i,m,"\u2197","\\nearrow",!0);o(i,m,"\u21A9","\\hookleftarrow",!0);o(i,m,"\u21AA","\\hookrightarrow",!0);o(i,m,"\u2198","\\searrow",!0);o(i,m,"\u21BC","\\leftharpoonup",!0);o(i,m,"\u21C0","\\rightharpoonup",!0);o(i,m,"\u2199","\\swarrow",!0);o(i,m,"\u21BD","\\leftharpoondown",!0);o(i,m,"\u21C1","\\rightharpoondown",!0);o(i,m,"\u2196","\\nwarrow",!0);o(i,m,"\u21CC","\\rightleftharpoons",!0);o(i,E,"\u21AF","\\lightning",!0);o(i,E,"\u220E","\\QED",!0);o(i,E,"\u2030","\\permil",!0);o(w,h,"\u2030","\\permil");o(i,E,"\u2609","\\astrosun",!0);o(i,E,"\u263C","\\sun",!0);o(i,E,"\u263E","\\leftmoon",!0);o(i,E,"\u263D","\\rightmoon",!0);o(i,E,"\u2295","\\Earth");o(i,m,"\u226E","\\nless",!0);o(i,m,"\u2A87","\\lneq",!0);o(i,m,"\u2268","\\lneqq",!0);o(i,m,"\u2268\uFE00","\\lvertneqq");o(i,m,"\u22E6","\\lnsim",!0);o(i,m,"\u2A89","\\lnapprox",!0);o(i,m,"\u2280","\\nprec",!0);o(i,m,"\u22E0","\\npreceq",!0);o(i,m,"\u22E8","\\precnsim",!0);o(i,m,"\u2AB9","\\precnapprox",!0);o(i,m,"\u2241","\\nsim",!0);o(i,m,"\u2224","\\nmid",!0);o(i,m,"\u2224","\\nshortmid");o(i,m,"\u22AC","\\nvdash",!0);o(i,m,"\u22AD","\\nvDash",!0);o(i,m,"\u22EA","\\ntriangleleft");o(i,m,"\u22EC","\\ntrianglelefteq",!0);o(i,m,"\u2284","\\nsubset",!0);o(i,m,"\u2285","\\nsupset",!0);o(i,m,"\u228A","\\subsetneq",!0);o(i,m,"\u228A\uFE00","\\varsubsetneq");o(i,m,"\u2ACB","\\subsetneqq",!0);o(i,m,"\u2ACB\uFE00","\\varsubsetneqq");o(i,m,"\u226F","\\ngtr",!0);o(i,m,"\u2A88","\\gneq",!0);o(i,m,"\u2269","\\gneqq",!0);o(i,m,"\u2269\uFE00","\\gvertneqq");o(i,m,"\u22E7","\\gnsim",!0);o(i,m,"\u2A8A","\\gnapprox",!0);o(i,m,"\u2281","\\nsucc",!0);o(i,m,"\u22E1","\\nsucceq",!0);o(i,m,"\u22E9","\\succnsim",!0);o(i,m,"\u2ABA","\\succnapprox",!0);o(i,m,"\u2246","\\ncong",!0);o(i,m,"\u2226","\\nparallel",!0);o(i,m,"\u2226","\\nshortparallel");o(i,m,"\u22AF","\\nVDash",!0);o(i,m,"\u22EB","\\ntriangleright");o(i,m,"\u22ED","\\ntrianglerighteq",!0);o(i,m,"\u228B","\\supsetneq",!0);o(i,m,"\u228B","\\varsupsetneq");o(i,m,"\u2ACC","\\supsetneqq",!0);o(i,m,"\u2ACC\uFE00","\\varsupsetneqq");o(i,m,"\u22AE","\\nVdash",!0);o(i,m,"\u2AB5","\\precneqq",!0);o(i,m,"\u2AB6","\\succneqq",!0);o(i,k,"\u22B4","\\unlhd");o(i,k,"\u22B5","\\unrhd");o(i,m,"\u219A","\\nleftarrow",!0);o(i,m,"\u219B","\\nrightarrow",!0);o(i,m,"\u21CD","\\nLeftarrow",!0);o(i,m,"\u21CF","\\nRightarrow",!0);o(i,m,"\u21AE","\\nleftrightarrow",!0);o(i,m,"\u21CE","\\nLeftrightarrow",!0);o(i,m,"\u25B3","\\vartriangle");o(i,h,"\u210F","\\hslash");o(i,h,"\u25BD","\\triangledown");o(i,h,"\u25CA","\\lozenge");o(i,h,"\u24C8","\\circledS");o(i,h,"\xAE","\\circledR",!0);o(w,h,"\xAE","\\circledR");o(w,h,"\xAE","\\textregistered");o(i,h,"\u2221","\\measuredangle",!0);o(i,h,"\u2204","\\nexists");o(i,h,"\u2127","\\mho");o(i,h,"\u2132","\\Finv",!0);o(i,h,"\u2141","\\Game",!0);o(i,h,"\u2035","\\backprime");o(i,h,"\u2036","\\backdprime");o(i,h,"\u2037","\\backtrprime");o(i,h,"\u25B2","\\blacktriangle");o(i,h,"\u25BC","\\blacktriangledown");o(i,h,"\u25A0","\\blacksquare");o(i,h,"\u29EB","\\blacklozenge");o(i,h,"\u2605","\\bigstar");o(i,h,"\u2222","\\sphericalangle",!0);o(i,h,"\u2201","\\complement",!0);o(i,h,"\u2571","\\diagup");o(i,h,"\u2572","\\diagdown");o(i,h,"\u25A1","\\square");o(i,h,"\u25A1","\\Box");o(i,h,"\u25CA","\\Diamond");o(i,h,"\xA5","\\yen",!0);o(w,h,"\xA5","\\yen",!0);o(i,h,"\u2713","\\checkmark",!0);o(w,h,"\u2713","\\checkmark");o(i,h,"\u2717","\\ballotx",!0);o(w,h,"\u2717","\\ballotx");o(w,h,"\u2022","\\textbullet");o(i,h,"\u2136","\\beth",!0);o(i,h,"\u2138","\\daleth",!0);o(i,h,"\u2137","\\gimel",!0);o(i,h,"\u03DD","\\digamma",!0);o(i,h,"\u03F0","\\varkappa");o(i,ee,"\u231C","\\ulcorner",!0);o(i,J,"\u231D","\\urcorner",!0);o(i,ee,"\u231E","\\llcorner",!0);o(i,J,"\u231F","\\lrcorner",!0);o(i,m,"\u2266","\\leqq",!0);o(i,m,"\u2A7D","\\leqslant",!0);o(i,m,"\u2A95","\\eqslantless",!0);o(i,m,"\u2272","\\lesssim",!0);o(i,m,"\u2A85","\\lessapprox",!0);o(i,m,"\u224A","\\approxeq",!0);o(i,k,"\u22D6","\\lessdot");o(i,m,"\u22D8","\\lll",!0);o(i,m,"\u2276","\\lessgtr",!0);o(i,m,"\u22DA","\\lesseqgtr",!0);o(i,m,"\u2A8B","\\lesseqqgtr",!0);o(i,m,"\u2251","\\doteqdot");o(i,m,"\u2253","\\risingdotseq",!0);o(i,m,"\u2252","\\fallingdotseq",!0);o(i,m,"\u223D","\\backsim",!0);o(i,m,"\u22CD","\\backsimeq",!0);o(i,m,"\u2AC5","\\subseteqq",!0);o(i,m,"\u22D0","\\Subset",!0);o(i,m,"\u228F","\\sqsubset",!0);o(i,m,"\u227C","\\preccurlyeq",!0);o(i,m,"\u22DE","\\curlyeqprec",!0);o(i,m,"\u227E","\\precsim",!0);o(i,m,"\u2AB7","\\precapprox",!0);o(i,m,"\u22B2","\\vartriangleleft");o(i,m,"\u22B4","\\trianglelefteq");o(i,m,"\u22A8","\\vDash",!0);o(i,m,"\u22AB","\\VDash",!0);o(i,m,"\u22AA","\\Vvdash",!0);o(i,m,"\u2323","\\smallsmile");o(i,m,"\u2322","\\smallfrown");o(i,m,"\u224F","\\bumpeq",!0);o(i,m,"\u224E","\\Bumpeq",!0);o(i,m,"\u2267","\\geqq",!0);o(i,m,"\u2A7E","\\geqslant",!0);o(i,m,"\u2A96","\\eqslantgtr",!0);o(i,m,"\u2273","\\gtrsim",!0);o(i,m,"\u2A86","\\gtrapprox",!0);o(i,k,"\u22D7","\\gtrdot");o(i,m,"\u22D9","\\ggg",!0);o(i,m,"\u2277","\\gtrless",!0);o(i,m,"\u22DB","\\gtreqless",!0);o(i,m,"\u2A8C","\\gtreqqless",!0);o(i,m,"\u2256","\\eqcirc",!0);o(i,m,"\u2257","\\circeq",!0);o(i,m,"\u225C","\\triangleq",!0);o(i,m,"\u223C","\\thicksim");o(i,m,"\u2248","\\thickapprox");o(i,m,"\u2AC6","\\supseteqq",!0);o(i,m,"\u22D1","\\Supset",!0);o(i,m,"\u2290","\\sqsupset",!0);o(i,m,"\u227D","\\succcurlyeq",!0);o(i,m,"\u22DF","\\curlyeqsucc",!0);o(i,m,"\u227F","\\succsim",!0);o(i,m,"\u2AB8","\\succapprox",!0);o(i,m,"\u22B3","\\vartriangleright");o(i,m,"\u22B5","\\trianglerighteq");o(i,m,"\u22A9","\\Vdash",!0);o(i,m,"\u2223","\\shortmid");o(i,m,"\u2225","\\shortparallel");o(i,m,"\u226C","\\between",!0);o(i,m,"\u22D4","\\pitchfork",!0);o(i,m,"\u221D","\\varpropto");o(i,m,"\u25C0","\\blacktriangleleft");o(i,m,"\u2234","\\therefore",!0);o(i,m,"\u220D","\\backepsilon");o(i,m,"\u25B6","\\blacktriangleright");o(i,m,"\u2235","\\because",!0);o(i,m,"\u22D8","\\llless");o(i,m,"\u22D9","\\gggtr");o(i,k,"\u22B2","\\lhd");o(i,k,"\u22B3","\\rhd");o(i,m,"\u2242","\\eqsim",!0);o(i,m,"\u2251","\\Doteq",!0);o(i,m,"\u297D","\\strictif",!0);o(i,m,"\u297C","\\strictfi",!0);o(i,k,"\u2214","\\dotplus",!0);o(i,k,"\u2216","\\smallsetminus");o(i,k,"\u22D2","\\Cap",!0);o(i,k,"\u22D3","\\Cup",!0);o(i,k,"\u2A5E","\\doublebarwedge",!0);o(i,k,"\u229F","\\boxminus",!0);o(i,k,"\u229E","\\boxplus",!0);o(i,k,"\u29C4","\\boxslash",!0);o(i,k,"\u22C7","\\divideontimes",!0);o(i,k,"\u22C9","\\ltimes",!0);o(i,k,"\u22CA","\\rtimes",!0);o(i,k,"\u22CB","\\leftthreetimes",!0);o(i,k,"\u22CC","\\rightthreetimes",!0);o(i,k,"\u22CF","\\curlywedge",!0);o(i,k,"\u22CE","\\curlyvee",!0);o(i,k,"\u229D","\\circleddash",!0);o(i,k,"\u229B","\\circledast",!0);o(i,k,"\u22BA","\\intercal",!0);o(i,k,"\u22D2","\\doublecap");o(i,k,"\u22D3","\\doublecup");o(i,k,"\u22A0","\\boxtimes",!0);o(i,k,"\u22C8","\\bowtie",!0);o(i,k,"\u22C8","\\Join");o(i,k,"\u27D5","\\leftouterjoin",!0);o(i,k,"\u27D6","\\rightouterjoin",!0);o(i,k,"\u27D7","\\fullouterjoin",!0);o(i,k,"\u2238","\\dotminus",!0);o(i,k,"\u27D1","\\wedgedot",!0);o(i,k,"\u27C7","\\veedot",!0);o(i,k,"\u2A62","\\doublebarvee",!0);o(i,k,"\u2A63","\\veedoublebar",!0);o(i,k,"\u2A5F","\\wedgebar",!0);o(i,k,"\u2A60","\\wedgedoublebar",!0);o(i,k,"\u2A54","\\Vee",!0);o(i,k,"\u2A53","\\Wedge",!0);o(i,k,"\u2A43","\\barcap",!0);o(i,k,"\u2A42","\\barcup",!0);o(i,k,"\u2A48","\\capbarcup",!0);o(i,k,"\u2A40","\\capdot",!0);o(i,k,"\u2A47","\\capovercup",!0);o(i,k,"\u2A46","\\cupovercap",!0);o(i,k,"\u2A4D","\\closedvarcap",!0);o(i,k,"\u2A4C","\\closedvarcup",!0);o(i,k,"\u2A2A","\\minusdot",!0);o(i,k,"\u2A2B","\\minusfdots",!0);o(i,k,"\u2A2C","\\minusrdots",!0);o(i,k,"\u22BB","\\Xor",!0);o(i,k,"\u22BC","\\Nand",!0);o(i,k,"\u22BD","\\Nor",!0);o(i,k,"\u22BD","\\barvee");o(i,k,"\u2AF4","\\interleave",!0);o(i,k,"\u29E2","\\shuffle",!0);o(i,k,"\u2AF6","\\threedotcolon",!0);o(i,k,"\u2982","\\typecolon",!0);o(i,k,"\u223E","\\invlazys",!0);o(i,k,"\u2A4B","\\twocaps",!0);o(i,k,"\u2A4A","\\twocups",!0);o(i,k,"\u2A4E","\\Sqcap",!0);o(i,k,"\u2A4F","\\Sqcup",!0);o(i,k,"\u2A56","\\veeonvee",!0);o(i,k,"\u2A55","\\wedgeonwedge",!0);o(i,k,"\u29D7","\\blackhourglass",!0);o(i,k,"\u29C6","\\boxast",!0);o(i,k,"\u29C8","\\boxbox",!0);o(i,k,"\u29C7","\\boxcircle",!0);o(i,k,"\u229C","\\circledequal",!0);o(i,k,"\u29B7","\\circledparallel",!0);o(i,k,"\u29B6","\\circledvert",!0);o(i,k,"\u29B5","\\circlehbar",!0);o(i,k,"\u27E1","\\concavediamond",!0);o(i,k,"\u27E2","\\concavediamondtickleft",!0);o(i,k,"\u27E3","\\concavediamondtickright",!0);o(i,k,"\u22C4","\\diamond",!0);o(i,k,"\u29D6","\\hourglass",!0);o(i,k,"\u27E0","\\lozengeminus",!0);o(i,k,"\u233D","\\obar",!0);o(i,k,"\u29B8","\\obslash",!0);o(i,k,"\u2A38","\\odiv",!0);o(i,k,"\u29C1","\\ogreaterthan",!0);o(i,k,"\u29C0","\\olessthan",!0);o(i,k,"\u29B9","\\operp",!0);o(i,k,"\u2A37","\\Otimes",!0);o(i,k,"\u2A36","\\otimeshat",!0);o(i,k,"\u22C6","\\star",!0);o(i,k,"\u25B3","\\triangle",!0);o(i,k,"\u2A3A","\\triangleminus",!0);o(i,k,"\u2A39","\\triangleplus",!0);o(i,k,"\u2A3B","\\triangletimes",!0);o(i,k,"\u27E4","\\whitesquaretickleft",!0);o(i,k,"\u27E5","\\whitesquaretickright",!0);o(i,k,"\u2A33","\\smashtimes",!0);o(i,m,"\u21E2","\\dashrightarrow",!0);o(i,m,"\u21E0","\\dashleftarrow",!0);o(i,m,"\u21C7","\\leftleftarrows",!0);o(i,m,"\u21C6","\\leftrightarrows",!0);o(i,m,"\u21DA","\\Lleftarrow",!0);o(i,m,"\u219E","\\twoheadleftarrow",!0);o(i,m,"\u21A2","\\leftarrowtail",!0);o(i,m,"\u21AB","\\looparrowleft",!0);o(i,m,"\u21CB","\\leftrightharpoons",!0);o(i,m,"\u21B6","\\curvearrowleft",!0);o(i,m,"\u21BA","\\circlearrowleft",!0);o(i,m,"\u21B0","\\Lsh",!0);o(i,m,"\u21C8","\\upuparrows",!0);o(i,m,"\u21BF","\\upharpoonleft",!0);o(i,m,"\u21C3","\\downharpoonleft",!0);o(i,m,"\u22B6","\\origof",!0);o(i,m,"\u22B7","\\imageof",!0);o(i,m,"\u22B8","\\multimap",!0);o(i,m,"\u21AD","\\leftrightsquigarrow",!0);o(i,m,"\u21C9","\\rightrightarrows",!0);o(i,m,"\u21C4","\\rightleftarrows",!0);o(i,m,"\u21A0","\\twoheadrightarrow",!0);o(i,m,"\u21A3","\\rightarrowtail",!0);o(i,m,"\u21AC","\\looparrowright",!0);o(i,m,"\u21B7","\\curvearrowright",!0);o(i,m,"\u21BB","\\circlearrowright",!0);o(i,m,"\u21B1","\\Rsh",!0);o(i,m,"\u21CA","\\downdownarrows",!0);o(i,m,"\u21BE","\\upharpoonright",!0);o(i,m,"\u21C2","\\downharpoonright",!0);o(i,m,"\u21DD","\\rightsquigarrow",!0);o(i,m,"\u21DD","\\leadsto");o(i,m,"\u21DB","\\Rrightarrow",!0);o(i,m,"\u21BE","\\restriction");o(i,h,"\u2018","`");o(i,h,"$","\\$");o(w,h,"$","\\$");o(w,h,"$","\\textdollar");o(i,h,"\xA2","\\cent");o(w,h,"\xA2","\\cent");o(i,h,"%","\\%");o(w,h,"%","\\%");o(i,h,"_","\\_");o(w,h,"_","\\_");o(w,h,"_","\\textunderscore");o(w,h,"\u2423","\\textvisiblespace",!0);o(i,h,"\u2220","\\angle",!0);o(i,h,"\u221E","\\infty",!0);o(i,h,"\u2032","\\prime");o(i,h,"\u2033","\\dprime");o(i,h,"\u2034","\\trprime");o(i,h,"\u2057","\\qprime");o(i,h,"\u25B3","\\triangle");o(w,h,"\u0391","\\Alpha",!0);o(w,h,"\u0392","\\Beta",!0);o(w,h,"\u0393","\\Gamma",!0);o(w,h,"\u0394","\\Delta",!0);o(w,h,"\u0395","\\Epsilon",!0);o(w,h,"\u0396","\\Zeta",!0);o(w,h,"\u0397","\\Eta",!0);o(w,h,"\u0398","\\Theta",!0);o(w,h,"\u0399","\\Iota",!0);o(w,h,"\u039A","\\Kappa",!0);o(w,h,"\u039B","\\Lambda",!0);o(w,h,"\u039C","\\Mu",!0);o(w,h,"\u039D","\\Nu",!0);o(w,h,"\u039E","\\Xi",!0);o(w,h,"\u039F","\\Omicron",!0);o(w,h,"\u03A0","\\Pi",!0);o(w,h,"\u03A1","\\Rho",!0);o(w,h,"\u03A3","\\Sigma",!0);o(w,h,"\u03A4","\\Tau",!0);o(w,h,"\u03A5","\\Upsilon",!0);o(w,h,"\u03A6","\\Phi",!0);o(w,h,"\u03A7","\\Chi",!0);o(w,h,"\u03A8","\\Psi",!0);o(w,h,"\u03A9","\\Omega",!0);o(i,E,"\u0391","\\Alpha",!0);o(i,E,"\u0392","\\Beta",!0);o(i,E,"\u0393","\\Gamma",!0);o(i,E,"\u0394","\\Delta",!0);o(i,E,"\u0395","\\Epsilon",!0);o(i,E,"\u0396","\\Zeta",!0);o(i,E,"\u0397","\\Eta",!0);o(i,E,"\u0398","\\Theta",!0);o(i,E,"\u0399","\\Iota",!0);o(i,E,"\u039A","\\Kappa",!0);o(i,E,"\u039B","\\Lambda",!0);o(i,E,"\u039C","\\Mu",!0);o(i,E,"\u039D","\\Nu",!0);o(i,E,"\u039E","\\Xi",!0);o(i,E,"\u039F","\\Omicron",!0);o(i,E,"\u03A0","\\Pi",!0);o(i,E,"\u03A1","\\Rho",!0);o(i,E,"\u03A3","\\Sigma",!0);o(i,E,"\u03A4","\\Tau",!0);o(i,E,"\u03A5","\\Upsilon",!0);o(i,E,"\u03A6","\\Phi",!0);o(i,E,"\u03A7","\\Chi",!0);o(i,E,"\u03A8","\\Psi",!0);o(i,E,"\u03A9","\\Omega",!0);o(i,ee,"\xAC","\\neg",!0);o(i,ee,"\xAC","\\lnot");o(i,h,"\u22A4","\\top");o(i,h,"\u22A5","\\bot");o(i,h,"\u2205","\\emptyset");o(i,h,"\u2300","\\varnothing");o(i,E,"\u03B1","\\alpha",!0);o(i,E,"\u03B2","\\beta",!0);o(i,E,"\u03B3","\\gamma",!0);o(i,E,"\u03B4","\\delta",!0);o(i,E,"\u03F5","\\epsilon",!0);o(i,E,"\u03B6","\\zeta",!0);o(i,E,"\u03B7","\\eta",!0);o(i,E,"\u03B8","\\theta",!0);o(i,E,"\u03B9","\\iota",!0);o(i,E,"\u03BA","\\kappa",!0);o(i,E,"\u03BB","\\lambda",!0);o(i,E,"\u03BC","\\mu",!0);o(i,E,"\u03BD","\\nu",!0);o(i,E,"\u03BE","\\xi",!0);o(i,E,"\u03BF","\\omicron",!0);o(i,E,"\u03C0","\\pi",!0);o(i,E,"\u03C1","\\rho",!0);o(i,E,"\u03C3","\\sigma",!0);o(i,E,"\u03C4","\\tau",!0);o(i,E,"\u03C5","\\upsilon",!0);o(i,E,"\u03D5","\\phi",!0);o(i,E,"\u03C7","\\chi",!0);o(i,E,"\u03C8","\\psi",!0);o(i,E,"\u03C9","\\omega",!0);o(i,E,"\u03B5","\\varepsilon",!0);o(i,E,"\u03D1","\\vartheta",!0);o(i,E,"\u03D6","\\varpi",!0);o(i,E,"\u03F1","\\varrho",!0);o(i,E,"\u03C2","\\varsigma",!0);o(i,E,"\u03C6","\\varphi",!0);o(i,E,"\u03D8","\\Coppa",!0);o(i,E,"\u03D9","\\coppa",!0);o(i,E,"\u03D9","\\varcoppa",!0);o(i,E,"\u03DE","\\Koppa",!0);o(i,E,"\u03DF","\\koppa",!0);o(i,E,"\u03E0","\\Sampi",!0);o(i,E,"\u03E1","\\sampi",!0);o(i,E,"\u03DA","\\Stigma",!0);o(i,E,"\u03DB","\\stigma",!0);o(i,E,"\u2AEB","\\Bot");o(i,h,"\xF0","\\eth",!0);o(w,h,"\xF0","\xF0");o(i,h,"\xC5","\\AA");o(w,h,"\xC5","\\AA",!0);o(i,h,"\xC6","\\AE",!0);o(w,h,"\xC6","\\AE",!0);o(i,h,"\xD0","\\DH",!0);o(w,h,"\xD0","\\DH",!0);o(i,h,"\xDE","\\TH",!0);o(w,h,"\xDE","\\TH",!0);o(i,h,"\xDF","\\ss",!0);o(w,h,"\xDF","\\ss",!0);o(i,h,"\xE5","\\aa");o(w,h,"\xE5","\\aa",!0);o(i,h,"\xE6","\\ae",!0);o(w,h,"\xE6","\\ae",!0);o(i,h,"\xF0","\\dh");o(w,h,"\xF0","\\dh",!0);o(i,h,"\xFE","\\th",!0);o(w,h,"\xFE","\\th",!0);o(i,h,"\u0110","\\DJ",!0);o(w,h,"\u0110","\\DJ",!0);o(i,h,"\u0111","\\dj",!0);o(w,h,"\u0111","\\dj",!0);o(i,h,"\u0141","\\L",!0);o(w,h,"\u0141","\\L",!0);o(i,h,"\u0141","\\l",!0);o(w,h,"\u0141","\\l",!0);o(i,h,"\u014A","\\NG",!0);o(w,h,"\u014A","\\NG",!0);o(i,h,"\u014B","\\ng",!0);o(w,h,"\u014B","\\ng",!0);o(i,h,"\u0152","\\OE",!0);o(w,h,"\u0152","\\OE",!0);o(i,h,"\u0153","\\oe",!0);o(w,h,"\u0153","\\oe",!0);o(i,k,"\u2217","\u2217",!0);o(i,k,"+","+");o(i,k,"\u2217","*");o(i,k,"\u2044","/",!0);o(i,k,"\u2044","\u2044");o(i,k,"\u2212","-",!0);o(i,k,"\u22C5","\\cdot",!0);o(i,k,"\u2218","\\circ",!0);o(i,k,"\xF7","\\div",!0);o(i,k,"\xB1","\\pm",!0);o(i,k,"\xD7","\\times",!0);o(i,k,"\u2229","\\cap",!0);o(i,k,"\u222A","\\cup",!0);o(i,k,"\u2216","\\setminus",!0);o(i,k,"\u2227","\\land");o(i,k,"\u2228","\\lor");o(i,k,"\u2227","\\wedge",!0);o(i,k,"\u2228","\\vee",!0);o(i,ee,"\u27E6","\\llbracket",!0);o(i,J,"\u27E7","\\rrbracket",!0);o(i,ee,"\u27E8","\\langle",!0);o(i,ee,"\u27EA","\\lAngle",!0);o(i,ee,"\u2989","\\llangle",!0);o(i,ee,"|","\\lvert");o(i,ee,"\u2016","\\lVert",!0);o(i,h,"!","\\oc");o(i,h,"?","\\wn");o(i,h,"\u2193","\\shpos");o(i,h,"\u2195","\\shift");o(i,h,"\u2191","\\shneg");o(i,J,"?","?");o(i,J,"!","!");o(i,J,"\u203C","\u203C");o(i,J,"\u27E9","\\rangle",!0);o(i,J,"\u27EB","\\rAngle",!0);o(i,J,"\u298A","\\rrangle",!0);o(i,J,"|","\\rvert");o(i,J,"\u2016","\\rVert");o(i,ee,"\u2983","\\lBrace",!0);o(i,J,"\u2984","\\rBrace",!0);o(i,m,"=","\\equal",!0);o(i,m,":",":");o(i,m,"\u2248","\\approx",!0);o(i,m,"\u2245","\\cong",!0);o(i,m,"\u2265","\\ge");o(i,m,"\u2265","\\geq",!0);o(i,m,"\u2190","\\gets");o(i,m,">","\\gt",!0);o(i,m,"\u2208","\\in",!0);o(i,m,"\u2209","\\notin",!0);o(i,m,"\uE020","\\@not");o(i,m,"\u2282","\\subset",!0);o(i,m,"\u2283","\\supset",!0);o(i,m,"\u2286","\\subseteq",!0);o(i,m,"\u2287","\\supseteq",!0);o(i,m,"\u2288","\\nsubseteq",!0);o(i,m,"\u2288","\\nsubseteqq");o(i,m,"\u2289","\\nsupseteq",!0);o(i,m,"\u2289","\\nsupseteqq");o(i,m,"\u22A8","\\models");o(i,m,"\u2190","\\leftarrow",!0);o(i,m,"\u2264","\\le");o(i,m,"\u2264","\\leq",!0);o(i,m,"<","\\lt",!0);o(i,m,"\u2192","\\rightarrow",!0);o(i,m,"\u2192","\\to");o(i,m,"\u2271","\\ngeq",!0);o(i,m,"\u2271","\\ngeqq");o(i,m,"\u2271","\\ngeqslant");o(i,m,"\u2270","\\nleq",!0);o(i,m,"\u2270","\\nleqq");o(i,m,"\u2270","\\nleqslant");o(i,m,"\u2AEB","\\Perp",!0);o(i,ze,"\xA0","\\ ");o(i,ze,"\xA0","\\space");o(i,ze,"\xA0","\\nobreakspace");o(w,ze,"\xA0","\\ ");o(w,ze,"\xA0"," ");o(w,ze,"\xA0","\\space");o(w,ze,"\xA0","\\nobreakspace");o(i,ze,null,"\\nobreak");o(i,ze,null,"\\allowbreak");o(i,It,",",",");o(w,It,":",":");o(i,It,";",";");o(i,k,"\u22BC","\\barwedge");o(i,k,"\u22BB","\\veebar");o(i,k,"\u2299","\\odot",!0);o(i,k,"\u2295\uFE0E","\\oplus");o(i,k,"\u2297","\\otimes",!0);o(i,h,"\u2202","\\partial",!0);o(i,k,"\u2298","\\oslash",!0);o(i,k,"\u229A","\\circledcirc",!0);o(i,k,"\u22A1","\\boxdot",!0);o(i,k,"\u25B3","\\bigtriangleup");o(i,k,"\u25BD","\\bigtriangledown");o(i,k,"\u2020","\\dagger");o(i,k,"\u22C4","\\diamond");o(i,k,"\u25C3","\\triangleleft");o(i,k,"\u25B9","\\triangleright");o(i,ee,"{","\\{");o(w,h,"{","\\{");o(w,h,"{","\\textbraceleft");o(i,J,"}","\\}");o(w,h,"}","\\}");o(w,h,"}","\\textbraceright");o(i,ee,"{","\\lbrace");o(i,J,"}","\\rbrace");o(i,ee,"[","\\lbrack",!0);o(w,h,"[","\\lbrack",!0);o(i,J,"]","\\rbrack",!0);o(w,h,"]","\\rbrack",!0);o(i,ee,"(","\\lparen",!0);o(i,J,")","\\rparen",!0);o(i,ee,"\u2987","\\llparenthesis",!0);o(i,J,"\u2988","\\rrparenthesis",!0);o(w,h,"<","\\textless",!0);o(w,h,">","\\textgreater",!0);o(i,ee,"\u230A","\\lfloor",!0);o(i,J,"\u230B","\\rfloor",!0);o(i,ee,"\u2308","\\lceil",!0);o(i,J,"\u2309","\\rceil",!0);o(i,h,"\\","\\backslash");o(i,h,"|","|");o(i,h,"|","\\vert");o(w,h,"|","\\textbar",!0);o(i,h,"\u2016","\\|");o(i,h,"\u2016","\\Vert");o(w,h,"\u2016","\\textbardbl");o(w,h,"~","\\textasciitilde");o(w,h,"\\","\\textbackslash");o(w,h,"^","\\textasciicircum");o(i,m,"\u2191","\\uparrow",!0);o(i,m,"\u21D1","\\Uparrow",!0);o(i,m,"\u2193","\\downarrow",!0);o(i,m,"\u21D3","\\Downarrow",!0);o(i,m,"\u2195","\\updownarrow",!0);o(i,m,"\u21D5","\\Updownarrow",!0);o(i,F,"\u2210","\\coprod");o(i,F,"\u22C1","\\bigvee");o(i,F,"\u22C0","\\bigwedge");o(i,F,"\u2A04","\\biguplus");o(i,F,"\u2A04","\\bigcupplus");o(i,F,"\u2A03","\\bigcupdot");o(i,F,"\u2A07","\\bigdoublevee");o(i,F,"\u2A08","\\bigdoublewedge");o(i,F,"\u22C2","\\bigcap");o(i,F,"\u22C3","\\bigcup");o(i,F,"\u222B","\\int");o(i,F,"\u222B","\\intop");o(i,F,"\u222C","\\iint");o(i,F,"\u222D","\\iiint");o(i,F,"\u220F","\\prod");o(i,F,"\u2211","\\sum");o(i,F,"\u2A02","\\bigotimes");o(i,F,"\u2A01","\\bigoplus");o(i,F,"\u2A00","\\bigodot");o(i,F,"\u2A09","\\bigtimes");o(i,F,"\u222E","\\oint");o(i,F,"\u222F","\\oiint");o(i,F,"\u2230","\\oiiint");o(i,F,"\u2231","\\intclockwise");o(i,F,"\u2232","\\varointclockwise");o(i,F,"\u2A0C","\\iiiint");o(i,F,"\u2A0D","\\intbar");o(i,F,"\u2A0E","\\intBar");o(i,F,"\u2A0F","\\fint");o(i,F,"\u2A12","\\rppolint");o(i,F,"\u2A13","\\scpolint");o(i,F,"\u2A15","\\pointint");o(i,F,"\u2A16","\\sqint");o(i,F,"\u2A17","\\intlarhk");o(i,F,"\u2A18","\\intx");o(i,F,"\u2A19","\\intcap");o(i,F,"\u2A1A","\\intcup");o(i,F,"\u2A05","\\bigsqcap");o(i,F,"\u2A06","\\bigsqcup");o(i,F,"\u222B","\\smallint");o(w,tt,"\u2026","\\textellipsis");o(i,tt,"\u2026","\\mathellipsis");o(w,tt,"\u2026","\\ldots",!0);o(i,tt,"\u2026","\\ldots",!0);o(i,tt,"\u22F0","\\iddots",!0);o(i,tt,"\u22EF","\\@cdots",!0);o(i,tt,"\u22F1","\\ddots",!0);o(i,h,"\u22EE","\\varvdots");o(w,h,"\u22EE","\\varvdots");o(i,G,"\xB4","\\acute");o(i,G,"`","\\grave");o(i,G,"\xA8","\\ddot");o(i,G,"\u2026","\\dddot");o(i,G,"\u2026.","\\ddddot");o(i,G,"~","\\tilde");o(i,G,"\u203E","\\bar");o(i,G,"\u02D8","\\breve");o(i,G,"\u02C7","\\check");o(i,G,"^","\\hat");o(i,G,"\u2192","\\vec");o(i,G,"\u02D9","\\dot");o(i,G,"\u02DA","\\mathring");o(i,E,"\u0131","\\imath",!0);o(i,E,"\u0237","\\jmath",!0);o(i,h,"\u0131","\u0131");o(i,h,"\u0237","\u0237");o(w,h,"\u0131","\\i",!0);o(w,h,"\u0237","\\j",!0);o(w,h,"\xF8","\\o",!0);o(i,E,"\xF8","\\o",!0);o(w,h,"\xD8","\\O",!0);o(i,E,"\xD8","\\O",!0);o(w,G,"\u02CA","\\'");o(w,G,"\u02CB","\\`");o(w,G,"\u02C6","\\^");o(w,G,"~","\\~");o(w,G,"\u02C9","\\=");o(w,G,"\u02D8","\\u");o(w,G,"\u02D9","\\.");o(w,G,"\xB8","\\c");o(w,G,"\u02DA","\\r");o(w,G,"\u02C7","\\v");o(w,G,"\xA8",'\\"');o(w,G,"\u02DD","\\H");o(i,G,"\u02CA","\\'");o(i,G,"\u02CB","\\`");o(i,G,"\u02C6","\\^");o(i,G,"~","\\~");o(i,G,"\u02C9","\\=");o(i,G,"\u02D8","\\u");o(i,G,"\u02D9","\\.");o(i,G,"\xB8","\\c");o(i,G,"\u02DA","\\r");o(i,G,"\u02C7","\\v");o(i,G,"\xA8",'\\"');o(i,G,"\u02DD","\\H");var Cl={"--":!0,"---":!0,"``":!0,"''":!0};o(w,h,"\u2013","--",!0);o(w,h,"\u2013","\\textendash");o(w,h,"\u2014","---",!0);o(w,h,"\u2014","\\textemdash");o(w,h,"\u2018","`",!0);o(w,h,"\u2018","\\textquoteleft");o(w,h,"\u2019","'",!0);o(w,h,"\u2019","\\textquoteright");o(w,h,"\u201C","``",!0);o(w,h,"\u201C","\\textquotedblleft");o(w,h,"\u201D","''",!0);o(w,h,"\u201D","\\textquotedblright");o(i,h,"\xB0","\\degree",!0);o(w,h,"\xB0","\\degree");o(w,h,"\xB0","\\textdegree",!0);o(i,h,"\xA3","\\pounds");o(i,h,"\xA3","\\mathsterling",!0);o(w,h,"\xA3","\\pounds");o(w,h,"\xA3","\\textsterling",!0);o(i,h,"\u2720","\\maltese");o(w,h,"\u2720","\\maltese");o(i,h,"\u20AC","\\euro",!0);o(w,h,"\u20AC","\\euro",!0);o(w,h,"\u20AC","\\texteuro");o(i,h,"\xA9","\\copyright",!0);o(w,h,"\xA9","\\textcopyright");o(i,h,"\u2300","\\diameter",!0);o(w,h,"\u2300","\\diameter");o(i,h,"\u{1D6E4}","\\varGamma");o(i,h,"\u{1D6E5}","\\varDelta");o(i,h,"\u{1D6E9}","\\varTheta");o(i,h,"\u{1D6EC}","\\varLambda");o(i,h,"\u{1D6EF}","\\varXi");o(i,h,"\u{1D6F1}","\\varPi");o(i,h,"\u{1D6F4}","\\varSigma");o(i,h,"\u{1D6F6}","\\varUpsilon");o(i,h,"\u{1D6F7}","\\varPhi");o(i,h,"\u{1D6F9}","\\varPsi");o(i,h,"\u{1D6FA}","\\varOmega");o(w,h,"\u{1D6E4}","\\varGamma");o(w,h,"\u{1D6E5}","\\varDelta");o(w,h,"\u{1D6E9}","\\varTheta");o(w,h,"\u{1D6EC}","\\varLambda");o(w,h,"\u{1D6EF}","\\varXi");o(w,h,"\u{1D6F1}","\\varPi");o(w,h,"\u{1D6F4}","\\varSigma");o(w,h,"\u{1D6F6}","\\varUpsilon");o(w,h,"\u{1D6F7}","\\varPhi");o(w,h,"\u{1D6F9}","\\varPsi");o(w,h,"\u{1D6FA}","\\varOmega");var io='0123456789/@."';for(let e=0;e<io.length;e++){let t=io.charAt(e);o(i,h,t,t)}var lo='0123456789!@*()-=+";:?/.,';for(let e=0;e<lo.length;e++){let t=lo.charAt(e);o(w,h,t,t)}var bn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let e=0;e<bn.length;e++){let t=bn.charAt(e);o(i,E,t,t),o(w,h,t,t)}var uo="\xC7\xD0\xDE\xE7\xFE\u2102\u210D\u2115\u2119\u211A\u211D\u2124\u210E\u210F\u210A\u210B\u210C\u2110\u2111\u2112\u2113\u2118\u211B\u211C\u212C\u2130\u2131\u2133\u212D\u2128";for(let e=0;e<uo.length;e++){let t=uo.charAt(e);o(i,E,t,t),o(w,h,t,t)}var q="";for(let e=0;e<bn.length;e++){q=String.fromCharCode(55349,56320+e),o(i,E,q,q),o(w,h,q,q),q=String.fromCharCode(55349,56372+e),o(i,E,q,q),o(w,h,q,q),q=String.fromCharCode(55349,56424+e),o(i,E,q,q),o(w,h,q,q),q=String.fromCharCode(55349,56580+e),o(i,E,q,q),o(w,h,q,q),q=String.fromCharCode(55349,56736+e),o(i,E,q,q),o(w,h,q,q),q=String.fromCharCode(55349,56788+e),o(i,E,q,q),o(w,h,q,q),q=String.fromCharCode(55349,56840+e),o(i,E,q,q),o(w,h,q,q),q=String.fromCharCode(55349,56944+e),o(i,E,q,q),o(w,h,q,q),q=String.fromCharCode(55349,56632+e),o(i,E,q,q),o(w,h,q,q);let t=bn.charAt(e);q=String.fromCharCode(55349,56476+e),o(i,E,t,q),o(w,h,t,q)}for(let e=0;e<10;e++)q=String.fromCharCode(55349,57294+e),o(i,E,q,q),o(w,h,q,q),q=String.fromCharCode(55349,57314+e),o(i,E,q,q),o(w,h,q,q),q=String.fromCharCode(55349,57324+e),o(i,E,q,q),o(w,h,q,q),q=String.fromCharCode(55349,57334+e),o(i,E,q,q),o(w,h,q,q);function Dl(e,t,n){let r=[],s=[],a=[],l=0,u=0;for(;u<e.length;){for(;e[u]instanceof qt;)e.splice(u,1,...e[u].children);let c=e[u];if(c.attributes&&c.attributes.linebreak&&c.attributes.linebreak==="newline"){a.length>0&&s.push(new y("mrow",a)),s.push(c),a=[];let d=new y("mtd",s);d.style.textAlign="left",r.push(new y("mtr",[d])),s=[],u+=1;continue}if(a.push(c),c.type&&c.type==="mo"&&c.children.length===1&&!(c.attributes.form&&c.attributes.form==="prefix")&&!Object.prototype.hasOwnProperty.call(c.attributes,"movablelimits")){let d=c.children[0].text;if(t==="="&&d==="="){if(l+=1,l>1){a.pop();let b=new y("mrow",a);s.push(b),a=[c]}}else if(t==="tex"){let b=u<e.length-1?e[u+1]:null,f=!0;if(!(b&&b.type==="mtext"&&b.attributes.linebreak&&b.attributes.linebreak==="nobreak"))for(let x=u+1;x<e.length;x++){let A=e[x];if(A.type&&A.type==="mspace"&&!(A.attributes.linebreak&&A.attributes.linebreak==="newline"))a.push(A),u+=1,A.attributes&&A.attributes.linebreak&&A.attributes.linebreak==="nobreak"&&(f=!1);else break}if(f){let x=new y("mrow",a);s.push(x),a=[]}}}u+=1}if(a.length>0){let c=new y("mrow",a);s.push(c)}if(r.length>0){let c=new y("mtd",s);c.style.textAlign="left";let d=new y("mtr",[c]);r.push(d);let b=new y("mtable",r);return n||(b.setAttribute("columnalign","left"),b.setAttribute("rowspacing","0em")),b}return Je(s)}var Te=function(e,t,n){return K[t][e]&&K[t][e].replace&&e.charCodeAt(0)!==55349&&!(Object.prototype.hasOwnProperty.call(Cl,e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=K[t][e].replace),new se(e)},co=(e,t)=>{if(e.children.length===0||e.children[e.children.length-1].type!=="mtext"){let n=new y("mtext",[new se(t.children[0].text)]);e.children.push(n)}else e.children[e.children.length-1].children[0].text+=t.children[0].text},An=e=>{if(e.type!=="mrow"&&e.type!=="mstyle"||e.children.length===0)return e;let t=new y("mrow");for(let n=0;n<e.children.length;n++){let r=e.children[n];if(r.type==="mtext"&&Object.keys(r.attributes).length===0)co(t,r);else if(r.type==="mrow"){let s=!0;for(let a=0;a<r.children.length;a++)if(r.children[a].type!=="mtext"||Object.keys(r.attributes).length!==0){s=!1;break}if(s)for(let a=0;a<r.children.length;a++){let l=r.children[a];co(t,l)}else t.children.push(r)}else t.children.push(r)}for(let n=0;n<t.children.length;n++)if(t.children[n].type==="mtext"){let r=t.children[n];r.children[0].text.charAt(0)===" "&&(r.children[0].text="\xA0"+r.children[0].text.slice(1));let s=r.children[0].text.length;s>0&&r.children[0].text.charAt(s-1)===" "&&(r.children[0].text=r.children[0].text.slice(0,-1)+"\xA0");for(let[a,l]of Object.entries(e.attributes))r.attributes[a]=l}return t.children.length===1&&t.children[0].type==="mtext"?t.children[0]:t},Bt=function(e,t=!1){if(e.length===1&&!(e[0]instanceof qt))return e[0];if(!t){e[0]instanceof y&&e[0].type==="mo"&&!e[0].attributes.fence&&(e[0].attributes.lspace="0em",e[0].attributes.rspace="0em");let n=e.length-1;e[n]instanceof y&&e[n].type==="mo"&&!e[n].attributes.fence&&(e[n].attributes.lspace="0em",e[n].attributes.rspace="0em")}return new y("mrow",e)};function pr(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){let t=e.children[0];return t instanceof se&&t.text==="."}else if(e.type==="mtext"&&e.children.length===1){let t=e.children[0];return t instanceof se&&t.text==="\u2008"}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){let t=e.children[0];return t instanceof se&&t.text===","}else return!1}var Ll=(e,t)=>{let n=e[t],r=e[t+1];return n.type==="atom"&&n.text===","&&n.loc&&r.loc&&n.loc.end===r.loc.start},ln=e=>e.type==="atom"&&e.family==="rel"||e.type==="mclass"&&e.mclass==="mrel",he=function(e,t,n=!1){if(!n&&e.length===1){let l=U(e[0],t);return l instanceof y&&l.type==="mo"&&(l.setAttribute("lspace","0em"),l.setAttribute("rspace","0em")),[l]}let r=[],s=[],a;for(let l=0;l<e.length;l++)s.push(U(e[l],t));for(let l=0;l<s.length;l++){let u=s[l];if(l<e.length-1&&ln(e[l])&&ln(e[l+1])&&u.setAttribute("rspace","0em"),l>0&&ln(e[l])&&ln(e[l-1])&&u.setAttribute("lspace","0em"),u.type==="mn"&&a&&a.type==="mn"){a.children.push(...u.children);continue}else if(pr(u)&&a&&a.type==="mn"){a.children.push(...u.children);continue}else if(a&&a.type==="mn"&&l<s.length-1&&s[l+1].type==="mn"&&Ll(e,l)){a.children.push(...u.children);continue}else if(u.type==="mn"&&pr(a))u.children=[...a.children,...u.children],r.pop();else if((u.type==="msup"||u.type==="msub")&&u.children.length>=1&&a&&(a.type==="mn"||pr(a))){let c=u.children[0];c instanceof y&&c.type==="mn"&&a&&(c.children=[...a.children,...c.children],r.pop())}r.push(u),a=u}return r},je=function(e,t,n=!1){return Bt(he(e,t,n),n)},U=function(e,t){if(!e)return new y("mrow");if(mn[e.type])return mn[e.type](e,t);throw new v("Got group of unknown type: '"+e.type+"'")},po=e=>new y("mtd",[],[],{padding:"0",width:"50%"}),Rl=["mrow","mtd","mtable","mtr"],yr=e=>{for(let t of e.children)if(t.type&&Rl.includes(t.type)){if(t.classes&&t.classes[0]==="tml-label")return t.label;{let n=yr(t);if(n)return n}}else if(!t.type){let n=yr(t);if(n)return n}},ql=(e,t,n,r)=>{t=je(t[0].body,n),t=An(t),t.classes.push("tml-tag");let s=yr(e);e=new y("mtd",[e]);let a=[po(),e,po()];a[r?0:2].children.push(t);let l=new y("mtr",a,["tml-tageqn"]);s&&l.setAttribute("id",s);let u=new y("mtable",[l]);return u.style.width="100%",u.setAttribute("displaystyle","true"),u};function Ol(e,t,n,r){let s=null;e.length===1&&e[0].type==="tag"&&(s=e[0].tag,e=e[0].body);let a=he(e,n);if(a.length===1&&a[0]instanceof gn)return a[0];let l=r.displayMode||r.annotate?"none":r.wrap,u=a.length===0?null:a[0],c=a.length===1&&s===null&&u instanceof y?a[0]:Dl(a,l,r.displayMode);if(s&&(c=ql(c,s,n,r.leqno)),r.annotate){let b=new y("annotation",[new se(t)]);b.setAttribute("encoding","application/x-tex"),c=new y("semantics",[c,b])}let d=new y("math",[c]);return r.xml&&d.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r.displayMode&&(d.setAttribute("display","block"),d.style.display="block math",d.classes=["tml-display"]),d}var Ml="DHKLUcegorsuvxyz\u03A0\u03A5\u03A8\u03B1\u03B4\u03B7\u03B9\u03BC\u03BD\u03BF\u03C4\u03C5\u03C7\u03F5",$l="BCEGIMNOPQRSTXZlpqtw\u0393\u0398\u039E\u03A3\u03A6\u03A9\u03B2\u03B5\u03B6\u03B8\u03BE\u03C1\u03C2\u03C6\u03C8\u03D1\u03D5\u03F1",Il="AFJdf\u0394\u039B",jo=(e,t)=>{let n=e.isStretchy?Uo(e):new y("mo",[Te(e.label,e.mode)]);e.isStretchy||n.setAttribute("stretchy","false"),e.label!=="\\vec"&&(n.style.mathDepth="0");let r=e.label==="\\c"?"munder":"mover",s=Nl.has(e.label);if(r==="mover"&&e.mode==="math"&&!e.isStretchy&&e.base.text&&e.base.text.length===1){let l=e.base.text,u=e.label==="\\vec",c=u==="\\vec"?"-vec":"";u&&n.classes.push("tml-vec");let d=u?"-vec":s?"-acc":"";Ml.indexOf(l)>-1?(n.classes.push(`chr-sml${c}`),n.classes.push(`wbk-sml${d}`)):$l.indexOf(l)>-1?(n.classes.push(`chr-med${c}`),n.classes.push(`wbk-med${d}`)):Il.indexOf(l)>-1?(n.classes.push(`chr-lrg${c}`),n.classes.push(`wbk-lrg${d}`)):u?n.classes.push("wbk-vec"):s&&n.classes.push("wbk-acc")}else s&&n.classes.push("wbk-acc");return new y(r,[U(e.base,t),n])},Bl=new Set(["\\acute","\\check","\\grave","\\ddot","\\dddot","\\ddddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"]),Nl=new Set(["\\acute","\\bar","\\breve","\\check","\\dot","\\ddot","\\grave","\\hat","\\mathring","\\`","\\'","\\^","\\=","\\u","\\.",'\\"',"\\r","\\H","\\v"]),ho={"\\`":"\u0300","\\'":"\u0301","\\^":"\u0302","\\~":"\u0303","\\=":"\u0304","\\u":"\u0306","\\.":"\u0307",'\\"':"\u0308","\\r":"\u030A","\\H":"\u030B","\\v":"\u030C","\\c":"\u0327"};D({type:"accent",names:["\\acute","\\grave","\\ddot","\\dddot","\\ddddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\overparen","\\widecheck","\\widehat","\\wideparen","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{let n=Rt(t[0]),r=!Bl.has(e.funcName);return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,base:n}},mathmlBuilder:jo});D({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\c","\\u","\\.",'\\"',"\\r","\\H","\\v"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{let n=Rt(t[0]),r=e.parser.mode;return r==="math"&&e.parser.settings.strict&&console.log(`Temml parse error: Command ${e.funcName} is invalid in math mode.`),r==="text"&&n.text&&n.text.length===1&&e.funcName in ho&&Go.indexOf(n.text)>-1?{type:"textord",mode:"text",text:n.text+ho[e.funcName]}:e.funcName==="\\c"&&r==="text"&&n.text&&n.text.length===1?{type:"textord",mode:"text",text:n.text+"\u0327"}:{type:"accent",mode:r,label:e.funcName,isStretchy:!1,base:n}},mathmlBuilder:jo});D({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underparen","\\utilde"],props:{numArgs:1},handler:({parser:e,funcName:t},n)=>{let r=n[0];return{type:"accentUnder",mode:e.mode,label:t,base:r}},mathmlBuilder:(e,t)=>{let n=Uo(e);return n.style["math-depth"]=0,new y("munder",[U(e.base,t),n])}});var mo={pt:800/803,pc:12*800/803,dd:1238/1157*800/803,cc:14856/1157*800/803,nd:685/642*800/803,nc:1370/107*800/803,sp:1/65536*800/803,mm:25.4/72,cm:2.54/72,in:1/72,px:96/72},Pl=["em","ex","mu","pt","mm","cm","in","px","bp","pc","dd","cc","nd","nc","sp"],Wo=function(e){return typeof e!="string"&&(e=e.unit),Pl.indexOf(e)>-1},Vo=e=>{let t=Math.max(e-1,0);return[1,.7,.5][t]},$e=function(e,t){let n=e.number;if(t.maxSize[0]<0&&n>0)return{number:0,unit:"em"};let r=e.unit;switch(r){case"mm":case"cm":case"in":case"px":return n*mo[r]>t.maxSize[1]?{number:t.maxSize[1],unit:"pt"}:{number:n,unit:r};case"em":case"ex":return r==="ex"&&(n*=.431),n=Math.min(n/Vo(t.level),t.maxSize[0]),{number:dr(n),unit:"em"};case"bp":return n>t.maxSize[1]&&(n=t.maxSize[1]),{number:n,unit:"pt"};case"pt":case"pc":case"dd":case"cc":case"nd":case"nc":case"sp":return n=Math.min(n*mo[r],t.maxSize[1]),{number:dr(n),unit:"pt"};case"mu":return n=Math.min(n/18,t.maxSize[0]),{number:dr(n),unit:"em"};default:throw new v("Invalid unit: '"+r+"'")}},re=e=>{let t=new y("mspace");return t.setAttribute("width",e+"em"),t},un=(e,t=.3,n=0,r=!1)=>{if(e==null&&n===0)return re(t);let s=e?[e]:[];if(t!==0&&s.unshift(re(t)),n>0&&s.push(re(n)),r){let a=new y("mpadded",s);return a.setAttribute("height","0.1px"),a}else return new y("mrow",s)},hr=(e,t)=>Number(e)/Vo(t),wr=(e,t,n,r)=>{let s=Rr(e),a=e.slice(1,3)==="eq",l=e.charAt(1)==="x"?"1.75":e.slice(2,4)==="cd"?"3.0":a?"1.0":"2.0";s.setAttribute("lspace","0"),s.setAttribute("rspace",a?"0.5em":"0");let u=r.withLevel(r.level<2?2:3),c=hr(l,u.level),d=hr(l,3),b=un(null,c.toFixed(4),0),f=un(null,d.toFixed(4),0),x=hr(a?0:.3,u.level).toFixed(4),A,_,O=t&&t.body&&(t.body.body||t.body.length>0);if(O){let L=U(t,u);L=un(L,x,x,e==="\\\\cdrightarrow"||e==="\\\\cdleftarrow"),A=new y("mover",[L,f])}let R=n&&n.body&&(n.body.body||n.body.length>0);if(R){let L=U(n,u);L=un(L,x,x),_=new y("munder",[L,f])}let C;return!O&&!R?C=new y("mover",[s,b]):O&&R?C=new y("munderover",[s,_,A]):O?C=new y("mover",[s,A]):C=new y("munder",[s,_]),l==="3.0"&&(C.style.height="1em"),C.setAttribute("accent","false"),C};D({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xleftrightharpoons","\\xrightleftharpoons","\\yields","\\yieldsLeft","\\mesomerism","\\longrightharpoonup","\\longleftharpoondown","\\yieldsLeftRight","\\chemequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler({parser:e,funcName:t},n,r){return{type:"xArrow",mode:e.mode,name:t,body:n[0],below:r[0]}},mathmlBuilder(e,t){let r=[wr(e.name,e.body,e.below,t)];return r.unshift(re(.2778)),r.push(re(.2778)),new y("mrow",r)}});var fo={"\\equilibriumRight":["\\longrightharpoonup","\\eqleftharpoondown"],"\\equilibriumLeft":["\\eqrightharpoonup","\\longleftharpoondown"]};D({type:"stackedArrow",names:["\\equilibriumRight","\\equilibriumLeft"],props:{numArgs:1,numOptionalArgs:1},handler({parser:e,funcName:t},n,r){let s=n[0]?{type:"hphantom",mode:e.mode,body:n[0]}:null,a=r[0]?{type:"hphantom",mode:e.mode,body:r[0]}:null;return{type:"stackedArrow",mode:e.mode,name:t,body:n[0],upperArrowBelow:a,lowerArrowBody:s,below:r[0]}},mathmlBuilder(e,t){let n=fo[e.name][0],r=fo[e.name][1],s=wr(n,e.body,e.upperArrowBelow,t),a=wr(r,e.lowerArrowBody,e.below,t),l,u=new y("mpadded",[s]);if(u.setAttribute("voffset","0.3em"),u.setAttribute("height","+0.3em"),u.setAttribute("depth","-0.3em"),e.name==="\\equilibriumLeft"){let c=new y("mpadded",[a]);c.setAttribute("width","0.5em"),l=new y("mpadded",[re(.2778),c,u,re(.2778)])}else u.setAttribute("width",e.name==="\\equilibriumRight"?"0.5em":"0"),l=new y("mpadded",[re(.2778),u,a,re(.2778)]);return l.setAttribute("voffset","-0.18em"),l.setAttribute("height","-0.18em"),l.setAttribute("depth","+0.18em"),l}});var Zo={};function ve({type:e,names:t,props:n,handler:r,mathmlBuilder:s}){let a={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:r};for(let l=0;l<t.length;++l)Zo[t[l]]=a;s&&(mn[e]=s)}function P(e,t){if(!e||e.type!==t)throw new Error(`Expected node of type ${t}, but got `+(e?`node of type ${e.type}`:String(e)));return e}function qr(e){let t=Tn(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?`node of type ${e.type}`:String(e)));return t}function Tn(e){return e&&(e.type==="atom"||e.type==="delimiter"||Object.prototype.hasOwnProperty.call(El,e.type))?e:null}var zl={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},go=()=>({type:"styling",body:[],mode:"math",scriptLevel:"display"}),bo=e=>e.type==="textord"&&e.text==="@",Fl=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function Gl(e,t,n){let r=zl[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{let s=n.callFunction("\\\\cdleft",[t[0]],[]),a={type:"atom",text:r,mode:"math",family:"rel"},l=n.callFunction("\\Big",[a],[]),u=n.callFunction("\\\\cdright",[t[1]],[]),c={type:"ordgroup",mode:"math",body:[s,l,u],semisimple:!0};return n.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{let s={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[s],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Hl(e){let t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();let s=e.fetch().text;if(s==="&"||s==="\\\\")e.consume();else if(s==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new v("Expected \\\\ or \\cr or \\end",e.nextToken)}let n=[],r=[n];for(let s=0;s<t.length;s++){let a=t[s],l=go();for(let u=0;u<a.length;u++)if(!bo(a[u]))l.body.push(a[u]);else{n.push(l),u+=1;let c=qr(a[u]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(c)>-1))if("<>AV".indexOf(c)>-1)for(let f=0;f<2;f++){let x=!0;for(let A=u+1;A<a.length;A++){if(Fl(a[A],c)){x=!1,u=A;break}if(bo(a[A]))throw new v("Missing a "+c+" character to complete a CD arrow.",a[A]);d[f].body.push(a[A])}if(x)throw new v("Missing a "+c+" character to complete a CD arrow.",a[u])}else throw new v('Expected one of "<>AV=|." after @.');let b=Gl(c,d,e);n.push(b),l=go()}s%2===0?n.push(l):n.shift(),n=[],r.push(n)}return r.pop(),e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:r,tags:null,labels:new Array(r.length+1).fill(""),envClasses:["jot","cd"],cols:[],hLinesBeforeRow:new Array(r.length+1).fill([])}}D({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler({parser:e,funcName:t},n){return{type:"cdlabel",mode:e.mode,side:t.slice(4),label:n[0]}},mathmlBuilder(e,t){if(e.label.body.length===0)return new y("mrow",t);let n=U(e.label,t);e.side==="left"&&n.classes.push("tml-shift-left");let r=new y("mtd",[n]);r.style.padding="0";let s=new y("mtr",[r]),a=new y("mtable",[s]),l=new y("mpadded",[a]);return l.setAttribute("width","0.1px"),l.setAttribute("displaystyle","false"),l.setAttribute("scriptlevel","1"),l}});D({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler({parser:e},t){return{type:"cdlabelparent",mode:e.mode,fragment:t[0]}},mathmlBuilder(e,t){return new y("mrow",[U(e.fragment,t)])}});var Xo=e=>({type:"ordgroup",mode:"math",body:e,semisimple:!0}),mr=(e,t)=>({type:t,mode:"math",body:Xo(e)}),Ul=(e,t)=>{let n=e.body;n[0].shift();let r=new Array(n.length-1).fill().map(()=>[]);for(let f=1;f<n.length;f++){r[f-1].push(n[f].shift());let x=[];for(let A=0;A<n[f].length;A++)x.push(n[f][A]);r[f-1].push(mr(x,"vphantom"))}let s=new Array(n.length).fill().map(()=>[]);for(let f=0;f<n[0].length;f++)s[0].push(n[0][f]);for(let f=1;f<n.length;f++)for(let x=0;x<n[0].length;x++)s[f].push(mr(n[f][x].body,"hphantom"));for(let f=0;f<n[0].length;f++)n[0][f]=mr(n[0][f].body,"hphantom");let a={type:"array",mode:"math",body:r,cols:[{type:"align",align:"c"}],rowGaps:new Array(r.length-1).fill(null),hLinesBeforeRow:new Array(r.length+1).fill().map(()=>[]),envClasses:[],scriptLevel:"text",arraystretch:1,labels:new Array(r.length).fill(""),arraycolsep:{number:.04,unit:"em"}},u={type:"styling",mode:"math",scriptLevel:"text",body:[{type:"array",mode:"math",body:s,cols:new Array(s.length).fill({type:"align",align:"c"}),rowGaps:new Array(s.length-1).fill(null),hLinesBeforeRow:new Array(s.length+1).fill().map(()=>[]),envClasses:[],scriptLevel:"text",arraystretch:1,labels:new Array(s.length).fill(""),arraycolsep:null}]},b={type:"supsub",mode:"math",stack:!0,base:{type:"op",mode:"math",limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!0,symbol:!1,suppressBaseShift:!0,body:[{type:"leftright",mode:"math",body:[e],left:t?t[0]:"(",right:t?t[1]:")",rightColor:void 0}]},sup:u,sub:null};return Xo([a,b])},we=class e{constructor(t,n,r){this.lexer=t,this.start=n,this.end=r}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},Le=class e{constructor(t,n){this.text=t,this.loc=n}range(t,n){return new e(n,we.range(this,t))}},X={DISPLAY:0,TEXT:1,SCRIPT:2,SCRIPTSCRIPT:3},Yo={};function p(e,t){Yo[e]=t}var jl=Yo;p("\\noexpand",function(e){let t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});p("\\expandafter",function(e){let t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});p("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}});p("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}});p("\\@ifnextchar",function(e){let t=e.consumeArgs(3);e.consumeSpaces();let n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});p("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");p("\\TextOrMath",function(e){let t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var kr=e=>{let t="";for(let n=e.length-1;n>-1;n--)t+=e[n].text;return t},Or={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15},xo=e=>{let t=e.future().text;return t==="EOF"?[null,""]:[Or[t.charAt(0)],t]},yo=(e,t,n)=>{for(let r=1;r<t.length;r++){let s=Or[t.charAt(r)];e*=n,e+=s}return e};p("\\char",function(e){let t=e.popToken(),n,r="";if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new v("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){let s=t.text;if(r=Or[s.charAt(0)],r==null||r>=n)throw new v(`Invalid base-${n} digit ${t.text}`);r=yo(r,s,n);let a;for([a,s]=xo(e);a!=null&&a<n;)r*=n,r+=a,r=yo(r,s,n),e.popToken(),[a,s]=xo(e)}return`\\@char{${r}}`});function Mr(e){let t=e.consumeArgs(1)[0],n="",r=t[t.length-1].loc.start;for(let s=t.length-1;s>=0;s--){let a=t[s].loc.start;a>r&&(n+=" ",r=a),n+=t[s].text,r+=t[s].text.length}return n}p("\\surd","\\sqrt{\\vphantom{|}}");p("\u2295","\\oplus");p("\\long","");p("\\bgroup","{");p("\\egroup","}");p("~","\\nobreakspace");p("\\lq","`");p("\\rq","'");p("\\aa","\\r a");p("\\Bbbk","\\Bbb{k}");p("\\mathstrut","\\vphantom{(}");p("\\underbar","\\underline{\\text{#1}}");p("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");p("\u22EE","\\vdots");p("\\arraystretch","1");p("\\arraycolsep","6pt");p("\\substack","\\begin{subarray}{c}#1\\end{subarray}");p("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");p("\\implies","\\DOTSB\\;\\Longrightarrow\\;");p("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var wo={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcap":"\\dotsb","\\bigsqcup":"\\dotsb","\\bigtimes":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\DOTSX":"\\dotsx"};p("\\dots",function(e){let t="\\dotso",n=e.expandAfterFuture().text;return n in wo?t=wo[n]:(n.slice(0,4)==="\\not"||n in K.math&&["bin","rel"].includes(K.math[n].group))&&(t="\\dotsb"),t});var $r={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};p("\\dotso",function(e){return e.future().text in $r?"\\ldots\\,":"\\ldots"});p("\\dotsc",function(e){let t=e.future().text;return t in $r&&t!==","?"\\ldots\\,":"\\ldots"});p("\\cdots",function(e){return e.future().text in $r?"\\@cdots\\,":"\\@cdots"});p("\\dotsb","\\cdots");p("\\dotsm","\\cdots");p("\\dotsi","\\!\\cdots");p("\\idotsint","\\int\\!\\cdots\\!\\int");p("\\dotsx","\\ldots\\,");p("\\DOTSI","\\relax");p("\\DOTSB","\\relax");p("\\DOTSX","\\relax");p("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");p("\\,","{\\tmspace+{3mu}{.1667em}}");p("\\thinspace","\\,");p("\\>","\\mskip{4mu}");p("\\:","{\\tmspace+{4mu}{.2222em}}");p("\\medspace","\\:");p("\\;","{\\tmspace+{5mu}{.2777em}}");p("\\thickspace","\\;");p("\\!","{\\tmspace-{3mu}{.1667em}}");p("\\negthinspace","\\!");p("\\negmedspace","{\\tmspace-{4mu}{.2222em}}");p("\\negthickspace","{\\tmspace-{5mu}{.277em}}");p("\\enspace","\\kern.5em ");p("\\enskip","\\hskip.5em\\relax");p("\\quad","\\hskip1em\\relax");p("\\qquad","\\hskip2em\\relax");p("\\AA","\\TextOrMath{\\Angstrom}{\\mathring{A}}\\relax");p("\\tag","\\@ifstar\\tag@literal\\tag@paren");p("\\tag@paren","\\tag@literal{({#1})}");p("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new v("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});p("\\notag","\\nonumber");p("\\nonumber","\\gdef\\@eqnsw{0}");p("\\bmod","\\mathbin{\\text{mod}}");p("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");p("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");p("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");p("\\newline","\\\\\\relax");p("\\TeX","\\textrm{T}\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125em\\textrm{X}");p("\\LaTeX","\\textrm{L}\\kern-.35em\\raisebox{0.2em}{\\scriptstyle A}\\kern-.15em\\TeX");p("\\Temml","\\textrm{T}\\kern-0.2em\\lower{0.2em}{\\textrm{E}}\\kern-0.08em{\\textrm{M}\\kern-0.08em\\raise{0.2em}\\textrm{M}\\kern-0.08em\\textrm{L}}");p("\\hspace","\\@ifstar\\@hspacer\\@hspace");p("\\@hspace","\\hskip #1\\relax");p("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");p("\\colon",'\\mathpunct{\\char"3a}');p("\\prescript","\\pres@cript{_{#1}^{#2}}{}{#3}");p("\\ordinarycolon",'\\char"3a');p("\\vcentcolon","\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}}");p("\\coloneq",'\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"2212}');p("\\Coloneq",'\\mathrel{\\char"2237\\char"2212}');p("\\Eqqcolon",'\\mathrel{\\char"3d\\char"2237}');p("\\Eqcolon",'\\mathrel{\\char"2212\\char"2237}');p("\\colonapprox",'\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"2248}');p("\\Colonapprox",'\\mathrel{\\char"2237\\char"2248}');p("\\colonsim",'\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"223c}');p("\\Colonsim",'\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"223c}');p("\\ratio","\\vcentcolon");p("\\coloncolon","\\dblcolon");p("\\colonequals","\\coloneqq");p("\\coloncolonequals","\\Coloneqq");p("\\equalscolon","\\eqqcolon");p("\\equalscoloncolon","\\Eqqcolon");p("\\colonminus","\\coloneq");p("\\coloncolonminus","\\Coloneq");p("\\minuscolon","\\eqcolon");p("\\minuscoloncolon","\\Eqcolon");p("\\coloncolonapprox","\\Colonapprox");p("\\coloncolonsim","\\Colonsim");p("\\notni","\\mathrel{\\char`\u220C}");p("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");p("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");p("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");p("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");p("\\varlimsup","\\DOTSB\\operatorname*{\\overline{\\text{lim}}}");p("\\varliminf","\\DOTSB\\operatorname*{\\underline{\\text{lim}}}");p("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{\\text{lim}}}");p("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{\\text{lim}}}");p("\\centerdot","{\\medspace\\rule{0.167em}{0.189em}\\medspace}");p("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");p("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");p("\\plim","\\DOTSB\\operatorname*{plim}");p("\\leftmodels","\\mathop{\\reflectbox{$\\models$}}");p("\\bra","\\mathinner{\\langle{#1}|}");p("\\ket","\\mathinner{|{#1}\\rangle}");p("\\braket","\\mathinner{\\langle{#1}\\rangle}");p("\\Bra","\\left\\langle#1\\right|");p("\\Ket","\\left|#1\\right\\rangle");var Ko=(e,t)=>{let r=`}\\,\\middle${t[0]==="|"?"\\vert":"\\Vert"}\\,{`;return e.slice(0,t.index)+r+e.slice(t.index+t[0].length)};p("\\Braket",function(e){let t=Mr(e),n=/\|\||\||\\\|/g,r;for(;(r=n.exec(t))!==null;)t=Ko(t,r);return"\\left\\langle{"+t+"}\\right\\rangle"});p("\\Set",function(e){let t=Mr(e),n=/\|\||\||\\\|/.exec(t);return n&&(t=Ko(t,n)),"\\left\\{\\:{"+t+"}\\:\\right\\}"});p("\\set",function(e){return"\\{{"+Mr(e).replace(/\|/,"}\\mid{")+"}\\}"});p("\\angln","{\\angl n}");p("\\odv","\\@ifstar\\odv@next\\odv@numerator");p("\\odv@numerator","\\frac{\\mathrm{d}#1}{\\mathrm{d}#2}");p("\\odv@next","\\frac{\\mathrm{d}}{\\mathrm{d}#2}#1");p("\\pdv","\\@ifstar\\pdv@next\\pdv@numerator");var Qo=e=>{let t=e[0][0].text,n=kr(e[1]).split(","),r=String(n.length),s=r==="1"?"\\partial":`\\partial^${r}`,a="";return n.map(l=>{a+="\\partial "+l.trim()+"\\,"}),[t,s,a.replace(/\\,$/,"")]};p("\\pdv@numerator",function(e){let[t,n,r]=Qo(e.consumeArgs(2));return`\\frac{${n} ${t}}{${r}}`});p("\\pdv@next",function(e){let[t,n,r]=Qo(e.consumeArgs(2));return`\\frac{${n}}{${r}} ${t}`});p("\\upalpha","\\up@greek{\\alpha}");p("\\upbeta","\\up@greek{\\beta}");p("\\upgamma","\\up@greek{\\gamma}");p("\\updelta","\\up@greek{\\delta}");p("\\upepsilon","\\up@greek{\\epsilon}");p("\\upzeta","\\up@greek{\\zeta}");p("\\upeta","\\up@greek{\\eta}");p("\\uptheta","\\up@greek{\\theta}");p("\\upiota","\\up@greek{\\iota}");p("\\upkappa","\\up@greek{\\kappa}");p("\\uplambda","\\up@greek{\\lambda}");p("\\upmu","\\up@greek{\\mu}");p("\\upnu","\\up@greek{\\nu}");p("\\upxi","\\up@greek{\\xi}");p("\\upomicron","\\up@greek{\\omicron}");p("\\uppi","\\up@greek{\\pi}");p("\\upalpha","\\up@greek{\\alpha}");p("\\uprho","\\up@greek{\\rho}");p("\\upsigma","\\up@greek{\\sigma}");p("\\uptau","\\up@greek{\\tau}");p("\\upupsilon","\\up@greek{\\upsilon}");p("\\upphi","\\up@greek{\\phi}");p("\\upchi","\\up@greek{\\chi}");p("\\uppsi","\\up@greek{\\psi}");p("\\upomega","\\up@greek{\\omega}");p("\\invamp",'\\mathbin{\\char"214b}');p("\\parr",'\\mathbin{\\char"214b}');p("\\upand",'\\mathbin{\\char"214b}');p("\\with",'\\mathbin{\\char"26}');p("\\multimapinv",'\\mathrel{\\char"27dc}');p("\\multimapboth",'\\mathrel{\\char"29df}');p("\\scoh",'{\\mkern5mu\\char"2322\\mkern5mu}');p("\\sincoh",'{\\mkern5mu\\char"2323\\mkern5mu}');p("\\coh",`{\\mkern5mu\\rule{}{0.7em}\\mathrlap{\\smash{\\raise2mu{\\char"2322}}}
72
+ {\\smash{\\lower4mu{\\char"2323}}}\\mkern5mu}`);p("\\incoh",`{\\mkern5mu\\rule{}{0.7em}\\mathrlap{\\smash{\\raise2mu{\\char"2323}}}
73
+ {\\smash{\\lower4mu{\\char"2322}}}\\mkern5mu}`);p("\\standardstate","\\text{\\tiny\\char`\u29B5}");p("\\ce",function(e){return Jo(e.consumeArgs(1)[0],"ce")});p("\\pu",function(e){return Jo(e.consumeArgs(1)[0],"pu")});p("\\uniDash","{\\rule{0.672em}{0.06em}}");p("\\triDash","{\\rule{0.15em}{0.06em}\\kern2mu\\rule{0.15em}{0.06em}\\kern2mu\\rule{0.15em}{0.06em}}");p("\\tripleDash","\\kern0.075em\\raise0.25em{\\triDash}\\kern0.075em");p("\\tripleDashOverLine","\\kern0.075em\\mathrlap{\\raise0.125em{\\uniDash}}\\raise0.34em{\\triDash}\\kern0.075em");p("\\tripleDashOverDoubleLine","\\kern0.075em\\mathrlap{\\mathrlap{\\raise0.48em{\\triDash}}\\raise0.27em{\\uniDash}}{\\raise0.05em{\\uniDash}}\\kern0.075em");p("\\tripleDashBetweenDoubleLine","\\kern0.075em\\mathrlap{\\mathrlap{\\raise0.48em{\\uniDash}}\\raise0.27em{\\triDash}}{\\raise0.05em{\\uniDash}}\\kern0.075em");var Jo=function(e,t){for(var n="",r=e.length&&e[e.length-1].loc.start,s=e.length-1;s>=0;s--)e[s].loc.start>r&&(n+=" ",r=e[s].loc.start),n+=e[s].text,r+=e[s].text.length;var a=W.go(T.go(n,t));return a},T={go:function(e,t){if(!e)return[];t===void 0&&(t="ce");var n="0",r={};r.parenthesisLevel=0,e=e.replace(/\n/g," "),e=e.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),e=e.replace(/[\u2026]/g,"...");for(var s,a=10,l=[];;){s!==e?(a=10,s=e):a--;var u=T.stateMachines[t],c=u.transitions[n]||u.transitions["*"];e:for(var d=0;d<c.length;d++){var b=T.patterns.match_(c[d].pattern,e);if(b){for(var f=c[d].task,x=0;x<f.action_.length;x++){var A;if(u.actions[f.action_[x].type_])A=u.actions[f.action_[x].type_](r,b.match_,f.action_[x].option);else if(T.actions[f.action_[x].type_])A=T.actions[f.action_[x].type_](r,b.match_,f.action_[x].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+f.action_[x].type_+")"];T.concatArray(l,A)}if(n=f.nextState||n,e.length>0){if(f.revisit||(e=b.remainder),!f.toContinue)break e}else return l}}if(a<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(e,t){if(t)if(Array.isArray(t))for(var n=0;n<t.length;n++)e.push(t[n]);else e.push(t)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:([eE]|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return t&&t[0]?{match_:t.splice(1),remainder:e.substr(t[0].length)}:null},"(-)(9)^(-9)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return t&&t[0]?{match_:t.splice(1),remainder:e.substr(t[0].length)}:null},"state of aggregation $":function(e){var t=T.patterns.findObserveGroups(e,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(t&&t.remainder.match(/^($|[\s,;\)\]\}])/))return t;var n=e.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return n?{match_:n[0],remainder:e.substr(n[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(e){return T.patterns.findObserveGroups(e,"^{","","","}")},"^($...$)":function(e){return T.patterns.findObserveGroups(e,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(e){return T.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(e){return T.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(e){return T.patterns.findObserveGroups(e,"_{","","","}")},"_($...$)":function(e){return T.patterns.findObserveGroups(e,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(e){return T.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(e){return T.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(e){return T.patterns.findObserveGroups(e,"","{","}","")},"{(...)}":function(e){return T.patterns.findObserveGroups(e,"{","","","}")},"$...$":function(e){return T.patterns.findObserveGroups(e,"","$","$","")},"${(...)}$":function(e){return T.patterns.findObserveGroups(e,"${","","","}$")},"$(...)$":function(e){return T.patterns.findObserveGroups(e,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(e){return T.patterns.findObserveGroups(e,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(e){return T.patterns.findObserveGroups(e,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(e){return T.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(e){return T.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(e){return T.patterns.findObserveGroups(e,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(e){return T.patterns.findObserveGroups(e,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(e){return T.patterns.findObserveGroups(e,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(e){return T.patterns.findObserveGroups(e,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(e){return T.patterns.findObserveGroups(e,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(e){return T.patterns.findObserveGroups(e,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(e){return T.patterns.findObserveGroups(e,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(e){return T.patterns.findObserveGroups(e,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(e){var t;if(t=e.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/),t)return{match_:t[0],remainder:e.substr(t[0].length)};var n=T.patterns.findObserveGroups(e,"","$","$","");return n&&(t=n.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/),t)?{match_:t[0],remainder:e.substr(t[0].length)}:null},amount2:function(e){return this.amount(e)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(e){if(e.match(/^\([a-z]+\)$/))return null;var t=e.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return t?{match_:t[0],remainder:e.substr(t[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(e,t,n,r,s,a,l,u,c,d){var b=function(C,L){if(typeof L=="string")return C.indexOf(L)!==0?null:L;var $=C.match(L);return $?$[0]:null},f=function(C,L,$){for(var B=0;L<C.length;){var j=C.charAt(L),V=b(C.substr(L),$);if(V!==null&&B===0)return{endMatchBegin:L,endMatchEnd:L+V.length};if(j==="{")B++;else if(j==="}"){if(B===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];B--}L++}return B>0,null},x=b(e,t);if(x===null||(e=e.substr(x.length),x=b(e,n),x===null))return null;var A=f(e,x.length,r||s);if(A===null)return null;var _=e.substring(0,r?A.endMatchEnd:A.endMatchBegin);if(a||l){var O=this.findObserveGroups(e.substr(A.endMatchEnd),a,l,u,c);if(O===null)return null;var R=[_,O.match_];return{match_:d?R.join(""):R,remainder:O.remainder}}else return{match_:_,remainder:e.substr(A.endMatchEnd)}},match_:function(e,t){var n=T.patterns.patterns[e];if(n===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+e+")"];if(typeof n=="function")return T.patterns.patterns[e](t);var r=t.match(n);if(r){var s;return r[2]?s=[r[1],r[2]]:r[1]?s=r[1]:s=r[0],{match_:s,remainder:t.substr(r[0].length)}}return null}},actions:{"a=":function(e,t){e.a=(e.a||"")+t},"b=":function(e,t){e.b=(e.b||"")+t},"p=":function(e,t){e.p=(e.p||"")+t},"o=":function(e,t){e.o=(e.o||"")+t},"q=":function(e,t){e.q=(e.q||"")+t},"d=":function(e,t){e.d=(e.d||"")+t},"rm=":function(e,t){e.rm=(e.rm||"")+t},"text=":function(e,t){e.text_=(e.text_||"")+t},insert:function(e,t,n){return{type_:n}},"insert+p1":function(e,t,n){return{type_:n,p1:t}},"insert+p1+p2":function(e,t,n){return{type_:n,p1:t[0],p2:t[1]}},copy:function(e,t){return t},rm:function(e,t){return{type_:"rm",p1:t||""}},text:function(e,t){return T.go(t,"text")},"{text}":function(e,t){var n=["{"];return T.concatArray(n,T.go(t,"text")),n.push("}"),n},"tex-math":function(e,t){return T.go(t,"tex-math")},"tex-math tight":function(e,t){return T.go(t,"tex-math tight")},bond:function(e,t,n){return{type_:"bond",kind_:n||t}},"color0-output":function(e,t){return{type_:"color0",color:t[0]}},ce:function(e,t){return T.go(t)},"1/2":function(e,t){var n=[];t.match(/^[+\-]/)&&(n.push(t.substr(0,1)),t=t.substr(1));var r=t.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return r[1]=r[1].replace(/\$/g,""),n.push({type_:"frac",p1:r[1],p2:r[2]}),r[3]&&(r[3]=r[3].replace(/\$/g,""),n.push({type_:"tex-math",p1:r[3]})),n},"9,9":function(e,t){return T.go(t,"9,9")}},createTransitions:function(e){var t,n,r,s,a={};for(t in e)for(n in e[t])for(r=n.split("|"),e[t][n].stateArray=r,s=0;s<r.length;s++)a[r[s]]=[];for(t in e)for(n in e[t])for(r=e[t][n].stateArray||[],s=0;s<r.length;s++){var l=e[t][n];if(l.action_){l.action_=[].concat(l.action_);for(var u=0;u<l.action_.length;u++)typeof l.action_[u]=="string"&&(l.action_[u]={type_:l.action_[u]})}else l.action_=[];for(var c=t.split("|"),d=0;d<c.length;d++)if(r[s]==="*")for(var b in a)a[b].push({pattern:c[d],task:l});else a[r[s]].push({pattern:c[d],task:l})}return a},stateMachines:{}};T.stateMachines={ce:{transitions:T.createTransitions({empty:{"*":{action_:"output"}},else:{"0|1|2":{action_:"beginsWithBond=false",revisit:!0,toContinue:!0}},oxidation$:{0:{action_:"oxidation-output"}},CMT:{r:{action_:"rdt=",nextState:"rt"},rd:{action_:"rqt=",nextState:"rdt"}},arrowUpDown:{"0|1|2|as":{action_:["sb=false","output","operator"],nextState:"1"}},uprightEntities:{"0|1|2":{action_:["o=","output"],nextState:"1"}},orbital:{"0|1|2|3":{action_:"o=",nextState:"o"}},"->":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(e,t){var n;if((e.d||"").match(/^[0-9]+$/)){var r=e.d;e.d=void 0,n=this.output(e),e.b=r}else n=this.output(e);return T.actions["o="](e,t),n},"d= kv":function(e,t){e.d=t,e.dType="kv"},"charge or bond":function(e,t){if(e.beginsWithBond){var n=[];return T.concatArray(n,this.output(e)),T.concatArray(n,T.actions.bond(e,t,"-")),n}else e.d=t},"- after o/d":function(e,t,n){var r=T.patterns.match_("orbital",e.o||""),s=T.patterns.match_("one lowercase greek letter $",e.o||""),a=T.patterns.match_("one lowercase latin letter $",e.o||""),l=T.patterns.match_("$one lowercase latin letter$ $",e.o||""),u=t==="-"&&(r&&r.remainder===""||s||a||l);u&&!e.a&&!e.b&&!e.p&&!e.d&&!e.q&&!r&&a&&(e.o="$"+e.o+"$");var c=[];return u?(T.concatArray(c,this.output(e)),c.push({type_:"hyphen"})):(r=T.patterns.match_("digits",e.d||""),n&&r&&r.remainder===""?(T.concatArray(c,T.actions["d="](e,t)),T.concatArray(c,this.output(e))):(T.concatArray(c,this.output(e)),T.concatArray(c,T.actions.bond(e,t,"-")))),c},"a to o":function(e){e.o=e.a,e.a=void 0},"sb=true":function(e){e.sb=!0},"sb=false":function(e){e.sb=!1},"beginsWithBond=true":function(e){e.beginsWithBond=!0},"beginsWithBond=false":function(e){e.beginsWithBond=!1},"parenthesisLevel++":function(e){e.parenthesisLevel++},"parenthesisLevel--":function(e){e.parenthesisLevel--},"state of aggregation":function(e,t){return{type_:"state of aggregation",p1:T.go(t,"o")}},comma:function(e,t){var n=t.replace(/\s*$/,""),r=n!==t;return r&&e.parenthesisLevel===0?{type_:"comma enumeration L",p1:n}:{type_:"comma enumeration M",p1:n}},output:function(e,t,n){var r;if(!e.r)r=[],!e.a&&!e.b&&!e.p&&!e.o&&!e.q&&!e.d&&!n||(e.sb&&r.push({type_:"entitySkip"}),!e.o&&!e.q&&!e.d&&!e.b&&!e.p&&n!==2?(e.o=e.a,e.a=void 0):!e.o&&!e.q&&!e.d&&(e.b||e.p)?(e.o=e.a,e.d=e.b,e.q=e.p,e.a=e.b=e.p=void 0):e.o&&e.dType==="kv"&&T.patterns.match_("d-oxidation$",e.d||"")?e.dType="oxidation":e.o&&e.dType==="kv"&&!e.q&&(e.dType=void 0),r.push({type_:"chemfive",a:T.go(e.a,"a"),b:T.go(e.b,"bd"),p:T.go(e.p,"pq"),o:T.go(e.o,"o"),q:T.go(e.q,"pq"),d:T.go(e.d,e.dType==="oxidation"?"oxidation":"bd"),dType:e.dType}));else{var s;e.rdt==="M"?s=T.go(e.rd,"tex-math"):e.rdt==="T"?s=[{type_:"text",p1:e.rd||""}]:s=T.go(e.rd);var a;e.rqt==="M"?a=T.go(e.rq,"tex-math"):e.rqt==="T"?a=[{type_:"text",p1:e.rq||""}]:a=T.go(e.rq),r={type_:"arrow",r:e.r,rd:s,rq:a}}for(var l in e)l!=="parenthesisLevel"&&l!=="beginsWithBond"&&delete e[l];return r},"oxidation-output":function(e,t){var n=["{"];return T.concatArray(n,T.go(t,"oxidation")),n.push("}"),n},"frac-output":function(e,t){return{type_:"frac-ce",p1:T.go(t[0]),p2:T.go(t[1])}},"overset-output":function(e,t){return{type_:"overset",p1:T.go(t[0]),p2:T.go(t[1])}},"underset-output":function(e,t){return{type_:"underset",p1:T.go(t[0]),p2:T.go(t[1])}},"underbrace-output":function(e,t){return{type_:"underbrace",p1:T.go(t[0]),p2:T.go(t[1])}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:T.go(t[1])}},"r=":function(e,t){e.r=t},"rdt=":function(e,t){e.rdt=t},"rd=":function(e,t){e.rd=t},"rqt=":function(e,t){e.rqt=t},"rq=":function(e,t){e.rq=t},operator:function(e,t,n){return{type_:"operator",kind_:n||t}}}},a:{transitions:T.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:T.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:T.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(e){if(e.text_){var t={type_:"text",p1:e.text_};for(var n in e)delete e[n];return t}}}},pq:{transitions:T.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(e,t){return{type_:"state of aggregation subscript",p1:T.go(t,"o")}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:T.go(t[1],"pq")}}}},bd:{transitions:T.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(e,t){return{type_:"color",color1:t[0],color2:T.go(t[1],"bd")}}}},oxidation:{transitions:T.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(e,t){return{type_:"roman numeral",p1:t||""}}}},"tex-math":{transitions:T.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var n in e)delete e[n];return t}}}},"tex-math tight":{transitions:T.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(e,t){e.o=(e.o||"")+"{"+t+"}"},output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var n in e)delete e[n];return t}}}},"9,9":{transitions:T.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:T.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(e,t){var n=[];return t[0]==="+-"||t[0]==="+/-"?n.push("\\pm "):t[0]&&n.push(t[0]),t[1]&&(T.concatArray(n,T.go(t[1],"pu-9,9")),t[2]&&(t[2].match(/[,.]/)?T.concatArray(n,T.go(t[2],"pu-9,9")):n.push(t[2])),t[3]=t[4]||t[3],t[3]&&(t[3]=t[3].trim(),t[3]==="e"||t[3].substr(0,1)==="*"?n.push({type_:"cdot"}):n.push({type_:"times"}))),t[3]&&n.push("10^{"+t[5]+"}"),n},"number^":function(e,t){var n=[];return t[0]==="+-"||t[0]==="+/-"?n.push("\\pm "):t[0]&&n.push(t[0]),T.concatArray(n,T.go(t[1],"pu-9,9")),n.push("^{"+t[2]+"}"),n},operator:function(e,t,n){return{type_:"operator",kind_:n||t}},space:function(){return{type_:"pu-space-1"}},output:function(e){var t,n=T.patterns.match_("{(...)}",e.d||"");n&&n.remainder===""&&(e.d=n.match_);var r=T.patterns.match_("{(...)}",e.q||"");if(r&&r.remainder===""&&(e.q=r.match_),e.d&&(e.d=e.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.d=e.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),e.q){e.q=e.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.q=e.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var s={d:T.go(e.d,"pu"),q:T.go(e.q,"pu")};e.o==="//"?t={type_:"pu-frac",p1:s.d,p2:s.q}:(t=s.d,s.d.length>1||s.q.length>1?t.push({type_:" / "}):t.push({type_:"/"}),T.concatArray(t,s.q))}else t=T.go(e.d,"pu-2");for(var a in e)delete e[a];return t}}},"pu-2":{transitions:T.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(e,t){e.rm+="^{"+t+"}"},space:function(){return{type_:"pu-space-2"}},output:function(e){var t=[];if(e.rm){var n=T.patterns.match_("{(...)}",e.rm||"");n&&n.remainder===""?t=T.go(n.match_,"pu"):t={type_:"rm",p1:e.rm}}for(var r in e)delete e[r];return t}}},"pu-9,9":{transitions:T.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){var n=e.text_.length%3;n===0&&(n=3);for(var r=e.text_.length-3;r>0;r-=3)t.push(e.text_.substr(r,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(0,n)),t.reverse()}else t.push(e.text_);for(var s in e)delete e[s];return t},"output-o":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){for(var n=e.text_.length-3,r=0;r<n;r+=3)t.push(e.text_.substr(r,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(r))}else t.push(e.text_);for(var s in e)delete e[s];return t}}}};var W={go:function(e,t){if(!e)return"";for(var n="",r=!1,s=0;s<e.length;s++){var a=e[s];typeof a=="string"?n+=a:(n+=W._go2(a),a.type_==="1st-level escape"&&(r=!0))}return!t&&!r&&n&&(n="{"+n+"}"),n},_goInner:function(e){return e&&W.go(e,!0)},_go2:function(e){var t;switch(e.type_){case"chemfive":t="";var n={a:W._goInner(e.a),b:W._goInner(e.b),p:W._goInner(e.p),o:W._goInner(e.o),q:W._goInner(e.q),d:W._goInner(e.d)};n.a&&(n.a.match(/^[+\-]/)&&(n.a="{"+n.a+"}"),t+=n.a+"\\,"),(n.b||n.p)&&(t+="{\\vphantom{X}}",t+="^{\\hphantom{"+(n.b||"")+"}}_{\\hphantom{"+(n.p||"")+"}}",t+="{\\vphantom{X}}",t+="^{\\vphantom{2}\\mathllap{"+(n.b||"")+"}}",t+="_{\\vphantom{2}\\mathllap{"+(n.p||"")+"}}"),n.o&&(n.o.match(/^[+\-]/)&&(n.o="{"+n.o+"}"),t+=n.o),e.dType==="kv"?((n.d||n.q)&&(t+="{\\vphantom{X}}"),n.d&&(t+="^{"+n.d+"}"),n.q&&(t+="_{"+n.q+"}")):e.dType==="oxidation"?(n.d&&(t+="{\\vphantom{X}}",t+="^{"+n.d+"}"),n.q&&(t+="{{}}",t+="_{"+n.q+"}")):(n.q&&(t+="{{}}",t+="_{"+n.q+"}"),n.d&&(t+="{{}}",t+="^{"+n.d+"}"));break;case"rm":t="\\mathrm{"+e.p1+"}";break;case"text":e.p1.match(/[\^_]/)?(e.p1=e.p1.replace(" ","~").replace("-","\\text{-}"),t="\\mathrm{"+e.p1+"}"):t="\\text{"+e.p1+"}";break;case"roman numeral":t="\\mathrm{"+e.p1+"}";break;case"state of aggregation":t="\\mskip2mu "+W._goInner(e.p1);break;case"state of aggregation subscript":t="\\mskip1mu "+W._goInner(e.p1);break;case"bond":if(t=W._getBond(e.kind_),!t)throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+e.kind_+")"];break;case"frac":var r="\\frac{"+e.p1+"}{"+e.p2+"}";t="\\mathchoice{\\textstyle"+r+"}{"+r+"}{"+r+"}{"+r+"}";break;case"pu-frac":var s="\\frac{"+W._goInner(e.p1)+"}{"+W._goInner(e.p2)+"}";t="\\mathchoice{\\textstyle"+s+"}{"+s+"}{"+s+"}{"+s+"}";break;case"tex-math":t=e.p1+" ";break;case"frac-ce":t="\\frac{"+W._goInner(e.p1)+"}{"+W._goInner(e.p2)+"}";break;case"overset":t="\\overset{"+W._goInner(e.p1)+"}{"+W._goInner(e.p2)+"}";break;case"underset":t="\\underset{"+W._goInner(e.p1)+"}{"+W._goInner(e.p2)+"}";break;case"underbrace":t="\\underbrace{"+W._goInner(e.p1)+"}_{"+W._goInner(e.p2)+"}";break;case"color":t="{\\color{"+e.color1+"}{"+W._goInner(e.color2)+"}}";break;case"color0":t="\\color{"+e.color+"}";break;case"arrow":var a={rd:W._goInner(e.rd),rq:W._goInner(e.rq)},l=W._getArrow(e.r);a.rq&&(l+="[{\\rm "+a.rq+"}]"),a.rd?l+="{\\rm "+a.rd+"}":l+="{}",t=l;break;case"operator":t=W._getOperator(e.kind_);break;case"1st-level escape":t=e.p1+" ";break;case"space":t=" ";break;case"entitySkip":t="~";break;case"pu-space-1":t="~";break;case"pu-space-2":t="\\mkern3mu ";break;case"1000 separator":t="\\mkern2mu ";break;case"commaDecimal":t="{,}";break;case"comma enumeration L":t="{"+e.p1+"}\\mkern6mu ";break;case"comma enumeration M":t="{"+e.p1+"}\\mkern3mu ";break;case"comma enumeration S":t="{"+e.p1+"}\\mkern1mu ";break;case"hyphen":t="\\text{-}";break;case"addition compound":t="\\,{\\cdot}\\,";break;case"electron dot":t="\\mkern1mu \\text{\\textbullet}\\mkern1mu ";break;case"KV x":t="{\\times}";break;case"prime":t="\\prime ";break;case"cdot":t="\\cdot ";break;case"tight cdot":t="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":t="\\times ";break;case"circa":t="{\\sim}";break;case"^":t="uparrow";break;case"v":t="downarrow";break;case"ellipsis":t="\\ldots ";break;case"/":t="/";break;case" / ":t="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return t},_getArrow:function(e){switch(e){case"->":return"\\yields";case"\u2192":return"\\yields";case"\u27F6":return"\\yields";case"<-":return"\\yieldsLeft";case"<->":return"\\mesomerism";case"<-->":return"\\yieldsLeftRight";case"<=>":return"\\chemequilibrium";case"\u21CC":return"\\chemequilibrium";case"<=>>":return"\\equilibriumRight";case"<<=>":return"\\equilibriumLeft";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(e){switch(e){case"-":return"{-}";case"1":return"{-}";case"=":return"{=}";case"2":return"{=}";case"#":return"{\\equiv}";case"3":return"{\\equiv}";case"~":return"{\\tripleDash}";case"~-":return"{\\tripleDashOverLine}";case"~=":return"{\\tripleDashOverDoubleLine}";case"~--":return"{\\tripleDashOverDoubleLine}";case"-~-":return"{\\tripleDashBetweenDoubleLine}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(e){switch(e){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":return" {}\\approx{} ";case"$\\approx$":return" {}\\approx{} ";case"v":return" \\downarrow{} ";case"(v)":return" \\downarrow{} ";case"^":return" \\uparrow{} ";case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};p("\\darr","\\downarrow");p("\\dArr","\\Downarrow");p("\\Darr","\\Downarrow");p("\\lang","\\langle");p("\\rang","\\rangle");p("\\uarr","\\uparrow");p("\\uArr","\\Uparrow");p("\\Uarr","\\Uparrow");p("\\N","\\mathbb{N}");p("\\R","\\mathbb{R}");p("\\Z","\\mathbb{Z}");p("\\alef","\\aleph");p("\\alefsym","\\aleph");p("\\bull","\\bullet");p("\\clubs","\\clubsuit");p("\\cnums","\\mathbb{C}");p("\\Complex","\\mathbb{C}");p("\\Dagger","\\ddagger");p("\\diamonds","\\diamondsuit");p("\\empty","\\emptyset");p("\\exist","\\exists");p("\\harr","\\leftrightarrow");p("\\hArr","\\Leftrightarrow");p("\\Harr","\\Leftrightarrow");p("\\hearts","\\heartsuit");p("\\image","\\Im");p("\\infin","\\infty");p("\\isin","\\in");p("\\larr","\\leftarrow");p("\\lArr","\\Leftarrow");p("\\Larr","\\Leftarrow");p("\\lrarr","\\leftrightarrow");p("\\lrArr","\\Leftrightarrow");p("\\Lrarr","\\Leftrightarrow");p("\\natnums","\\mathbb{N}");p("\\plusmn","\\pm");p("\\rarr","\\rightarrow");p("\\rArr","\\Rightarrow");p("\\Rarr","\\Rightarrow");p("\\real","\\Re");p("\\reals","\\mathbb{R}");p("\\Reals","\\mathbb{R}");p("\\sdot","\\cdot");p("\\sect","\\S");p("\\spades","\\spadesuit");p("\\sub","\\subset");p("\\sube","\\subseteq");p("\\supe","\\supseteq");p("\\thetasym","\\vartheta");p("\\weierp","\\wp");p("\\quantity","{\\left\\{ #1 \\right\\}}");p("\\qty","{\\left\\{ #1 \\right\\}}");p("\\pqty","{\\left( #1 \\right)}");p("\\bqty","{\\left[ #1 \\right]}");p("\\vqty","{\\left\\vert #1 \\right\\vert}");p("\\Bqty","{\\left\\{ #1 \\right\\}}");p("\\absolutevalue","{\\left\\vert #1 \\right\\vert}");p("\\abs","{\\left\\vert #1 \\right\\vert}");p("\\norm","{\\left\\Vert #1 \\right\\Vert}");p("\\evaluated","{\\left.#1 \\right\\vert}");p("\\eval","{\\left.#1 \\right\\vert}");p("\\order","{\\mathcal{O} \\left( #1 \\right)}");p("\\commutator","{\\left[ #1 , #2 \\right]}");p("\\comm","{\\left[ #1 , #2 \\right]}");p("\\anticommutator","{\\left\\{ #1 , #2 \\right\\}}");p("\\acomm","{\\left\\{ #1 , #2 \\right\\}}");p("\\poissonbracket","{\\left\\{ #1 , #2 \\right\\}}");p("\\pb","{\\left\\{ #1 , #2 \\right\\}}");p("\\vectorbold","{\\boldsymbol{ #1 }}");p("\\vb","{\\boldsymbol{ #1 }}");p("\\vectorarrow","{\\vec{\\boldsymbol{ #1 }}}");p("\\va","{\\vec{\\boldsymbol{ #1 }}}");p("\\vectorunit","{{\\boldsymbol{\\hat{ #1 }}}}");p("\\vu","{{\\boldsymbol{\\hat{ #1 }}}}");p("\\dotproduct","\\mathbin{\\boldsymbol\\cdot}");p("\\vdot","{\\boldsymbol\\cdot}");p("\\crossproduct","\\mathbin{\\boldsymbol\\times}");p("\\cross","\\mathbin{\\boldsymbol\\times}");p("\\cp","\\mathbin{\\boldsymbol\\times}");p("\\gradient","{\\boldsymbol\\nabla}");p("\\grad","{\\boldsymbol\\nabla}");p("\\divergence","{\\grad\\vdot}");p("\\curl","{\\grad\\cross}");p("\\laplacian","\\nabla^2");p("\\tr","{\\operatorname{tr}}");p("\\Tr","{\\operatorname{Tr}}");p("\\rank","{\\operatorname{rank}}");p("\\erf","{\\operatorname{erf}}");p("\\Res","{\\operatorname{Res}}");p("\\principalvalue","{\\mathcal{P}}");p("\\pv","{\\mathcal{P}}");p("\\PV","{\\operatorname{P.V.}}");p("\\qqtext","{\\quad\\text{ #1 }\\quad}");p("\\qq","{\\quad\\text{ #1 }\\quad}");p("\\qcomma","{\\text{,}\\quad}");p("\\qc","{\\text{,}\\quad}");p("\\qcc","{\\quad\\text{c.c.}\\quad}");p("\\qif","{\\quad\\text{if}\\quad}");p("\\qthen","{\\quad\\text{then}\\quad}");p("\\qelse","{\\quad\\text{else}\\quad}");p("\\qotherwise","{\\quad\\text{otherwise}\\quad}");p("\\qunless","{\\quad\\text{unless}\\quad}");p("\\qgiven","{\\quad\\text{given}\\quad}");p("\\qusing","{\\quad\\text{using}\\quad}");p("\\qassume","{\\quad\\text{assume}\\quad}");p("\\qsince","{\\quad\\text{since}\\quad}");p("\\qlet","{\\quad\\text{let}\\quad}");p("\\qfor","{\\quad\\text{for}\\quad}");p("\\qall","{\\quad\\text{all}\\quad}");p("\\qeven","{\\quad\\text{even}\\quad}");p("\\qodd","{\\quad\\text{odd}\\quad}");p("\\qinteger","{\\quad\\text{integer}\\quad}");p("\\qand","{\\quad\\text{and}\\quad}");p("\\qor","{\\quad\\text{or}\\quad}");p("\\qas","{\\quad\\text{as}\\quad}");p("\\qin","{\\quad\\text{in}\\quad}");p("\\differential","{\\text{d}}");p("\\dd","{\\text{d}}");p("\\derivative","{\\frac{\\text{d}{ #1 }}{\\text{d}{ #2 }}}");p("\\dv","{\\frac{\\text{d}{ #1 }}{\\text{d}{ #2 }}}");p("\\partialderivative","{\\frac{\\partial{ #1 }}{\\partial{ #2 }}}");p("\\variation","{\\delta}");p("\\var","{\\delta}");p("\\functionalderivative","{\\frac{\\delta{ #1 }}{\\delta{ #2 }}}");p("\\fdv","{\\frac{\\delta{ #1 }}{\\delta{ #2 }}}");p("\\innerproduct","{\\left\\langle {#1} \\mid { #2} \\right\\rangle}");p("\\outerproduct","{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}");p("\\dyad","{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}");p("\\ketbra","{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}");p("\\op","{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}");p("\\expectationvalue","{\\left\\langle {#1 } \\right\\rangle}");p("\\expval","{\\left\\langle {#1 } \\right\\rangle}");p("\\ev","{\\left\\langle {#1 } \\right\\rangle}");p("\\matrixelement","{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}");p("\\matrixel","{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}");p("\\mel","{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}");function ko(e){let t=[];e.consumeSpaces();let n=e.fetch().text;for(n==="\\relax"&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n==="\\hline"||n==="\\hdashline";)e.consume(),t.push(n==="\\hdashline"),e.consumeSpaces(),n=e.fetch().text;return t}var Nt=e=>{if(!e.parser.settings.displayMode)throw new v(`{${e.envName}} can be used only in display mode.`)},Wl=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/,ea=e=>{let t=e.get("\\arraystretch");typeof t!="string"&&(t=kr(t.tokens)),t=isNaN(t)?null:Number(t);let n=e.get("\\arraycolsep");typeof n!="string"&&(n=kr(n.tokens));let r=Wl.exec(n),s=r?{number:+(r[1]+r[2]),unit:r[3]}:null;return[t,s]},Ao=e=>{let t="";for(let n=0;n<e.length;n++)if(e[n].type==="label"){if(t)throw new v("Multiple \\labels in one row");t=e[n].string}return t};function Ir(e){if(e.indexOf("ed")===-1)return e.indexOf("*")===-1}function Ie(e,{cols:t,envClasses:n,autoTag:r,singleRow:s,emptySingleRow:a,maxNumCols:l,leqno:u,arraystretch:c,arraycolsep:d},b){let f=n&&n.includes("bordermatrix")?"}":"\\end";e.gullet.beginGroup(),s||e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();let x=[],A=[x],_=[],O=[],R=[],C=r!=null?[]:void 0;function L(){r&&e.gullet.macros.set("\\@eqnsw","1",!0)}function $(){C&&(e.gullet.macros.get("\\df@tag")?(C.push(e.subparse([new Le("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):C.push(!!r&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(L(),R.push(ko(e));;){let B=e.parseExpression(!1,s?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),B={type:"ordgroup",mode:e.mode,body:B,semisimple:!0},x.push(B);let j=e.fetch().text;if(j==="&"){if(l&&x.length===l)if(n.includes("array")){if(e.settings.strict)throw new v("Too few columns specified in the {array} column argument.",e.nextToken)}else throw l===2?new v("The split environment accepts no more than two columns",e.nextToken):new v("The equation environment accepts only one column",e.nextToken);e.consume()}else if(j===f){$(),x.length===1&&B.body.length===0&&(A.length>1||!a)&&A.pop(),O.push(Ao(B.body)),R.length<A.length+1&&R.push([]);break}else if(j==="\\\\"){e.consume();let V;e.gullet.future().text!==" "&&(V=e.parseSizeGroup(!0)),_.push(V?V.value:null),$(),O.push(Ao(B.body)),R.push(ko(e)),x=[],A.push(x),L()}else throw new v("Expected & or \\\\ or \\cr or "+f,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,body:A,cols:t,rowGaps:_,hLinesBeforeRow:R,envClasses:n,autoTag:r,scriptLevel:b,tags:C,labels:O,leqno:u,arraystretch:c,arraycolsep:d}}function ta(e){return e.slice(0,1)==="d"?"display":"text"}var Vl={c:"center ",l:"left ",r:"right "},To=e=>{let t=new y("mtd",[]);return t.style={padding:"0",width:"50%"},e.envClasses.includes("multline")&&(t.style.width="7.5%"),t},Se=function(e,t){let n=[],r=e.body.length,s=e.hLinesBeforeRow,a=e.tags&&e.tags.some(d=>d);for(let d=0;d<r;d++){let b=e.body[d],f=[],x=e.scriptLevel==="text"?X.TEXT:e.scriptLevel==="script"?X.SCRIPT:X.DISPLAY;for(let C=0;C<b.length;C++){let L=new y("mtd",[U(b[C],t.withLevel(x))]);if(e.envClasses.includes("multline")){let $=d===0?"left":d===r-1?"right":"center";$!=="center"&&L.classes.push("tml-"+$)}f.push(L)}let A=e.body[0].length;for(let C=0;C<A-b.length;C++)f.push(new y("mtd",[],[],t));if(a){let C=e.tags[d],L;C===!0?L=new y("mtext",[new fn(["tml-eqn"])]):C===!1?L=new y("mtext",[],[]):(L=je(C[0].body,t.withLevel(x),!0),L=An(L),L.classes=["tml-tag"]),L&&(f.unshift(To(e)),f.push(To(e)),e.leqno?f[0].children.push(L):f[f.length-1].children.push(L))}let _=new y("mtr",f,[]),O=e.labels.shift();O&&e.tags&&e.tags[d]&&(_.setAttribute("id",O),Array.isArray(e.tags[d])&&_.classes.push("tml-tageqn")),d===0&&s[0].length>0&&(s[0].length===2?_.children.forEach(C=>{C.style.borderTop="0.15em double"}):_.children.forEach(C=>{C.style.borderTop=s[0][0]?"0.06em dashed":"0.06em solid"})),s[d+1].length>0&&(s[d+1].length===2?_.children.forEach(C=>{C.style.borderBottom="0.15em double"}):_.children.forEach(C=>{C.style.borderBottom=s[d+1][0]?"0.06em dashed":"0.06em solid"}));let R=!0;for(let C=0;C<_.children.length;C++){let L=_.children[C].children[0];if(!(L&&L.type==="mpadded"&&L.attributes.height==="0px")){R=!1;break}}if(R)for(let C=0;C<_.children.length;C++)_.children[C].style.display="block",_.children[C].style.height="0",_.children[C].style.paddingTop="0",_.children[C].style.paddingBottom="0";n.push(_)}if(e.arraystretch&&e.arraystretch!==1){let d=String(1.4*e.arraystretch-.8)+"ex";for(let b=0;b<n.length;b++)for(let f=0;f<n[b].children.length;f++)n[b].children[f].style.paddingTop=d,n[b].children[f].style.paddingBottom=d}let l,u;if(e.envClasses.length>0&&(l=e.envClasses.includes("abut")||e.envClasses.includes("cases")?"0":e.envClasses.includes("small")?"0.1389":e.envClasses.includes("cd")?"0.25":"0.4",u="em"),e.arraycolsep){let d=$e(e.arraycolsep,t);l=d.number.toFixed(4),u=d.unit}if(l){let d=n.length===0?0:n[0].children.length,b=(f,x)=>f===0&&x===0||f===d-1&&x===1?"0":e.envClasses[0]!=="align"?l:x===1?"0":a?f%2?"1":"0":f%2?"0":"1";for(let f=0;f<n.length;f++)for(let x=0;x<n[f].children.length;x++)n[f].children[x].style.paddingLeft=`${b(x,0)}${u}`,n[f].children[x].style.paddingRight=`${b(x,1)}${u}`}if(e.envClasses.length===0)for(let d=0;d<n.length;d++)n[d].children[0].style.paddingLeft="0em",n[d].children.length===n[0].children.length&&(n[d].children[n[d].children.length-1].style.paddingRight="0em");if(e.envClasses.length>0){let d=e.envClasses.includes("align")||e.envClasses.includes("alignat");for(let b=0;b<n.length;b++){let f=n[b];if(d){for(let x=0;x<f.children.length;x++)f.children[x].classes=["tml-"+(x%2?"left":"right")];if(a){let x=e.leqno?0:f.children.length-1;f.children[x].classes=[]}}if(f.children.length>1&&e.envClasses.includes("cases")&&(f.children[1].style.paddingLeft="1em"),e.envClasses.includes("cases")||e.envClasses.includes("subarray"))for(let x of f.children)x.classes.push("tml-left")}}let c=new y("mtable",n);if(e.envClasses.length>0&&(e.envClasses.includes("jot")?c.classes.push("tml-jot"):e.envClasses.includes("small")&&c.classes.push("tml-small")),e.scriptLevel==="display"&&c.setAttribute("displaystyle","true"),(e.autoTag||e.envClasses.includes("multline"))&&(c.style.width="100%"),e.cols&&e.cols.length>0){let d=e.cols,b=!1,f=0,x=d.length;for(;d[f].type==="separator";)f+=1;for(;d[x-1].type==="separator";)x-=1;if(d[0].type==="separator"){let _=d[1].type==="separator"?"0.15em double":d[0].separator==="|"?"0.06em solid ":"0.06em dashed ";for(let O of c.children)O.children[0].style.borderLeft=_}let A=a?0:-1;for(let _=f;_<x;_++)if(d[_].type==="align"){let O=Vl[d[_].align];A+=1;for(let R of c.children)O.trim()!=="center"&&A<R.children.length&&(R.children[A].classes=["tml-"+O.trim()]);b=!0}else if(d[_].type==="separator"){if(b){let O=d[_+1].type==="separator"?"0.15em double":d[_].separator==="|"?"0.06em solid":"0.06em dashed";for(let R of c.children)A<R.children.length&&(R.children[A].style.borderRight=O)}b=!1}if(d[d.length-1].type==="separator"){let _=d[d.length-2].type==="separator"?"0.15em double":d[d.length-1].separator==="|"?"0.06em solid":"0.06em dashed";for(let O of c.children)O.children[O.children.length-1].style.borderRight=_,O.children[O.children.length-1].style.paddingRight="0.4em"}}return e.envClasses.includes("small")&&(c=new y("mstyle",[c]),c.setAttribute("scriptlevel","1")),c},na=function(e,t){e.envName.indexOf("ed")===-1&&Nt(e);let n=e.envName==="split",r=[],s=Ie(e.parser,{cols:r,emptySingleRow:!0,autoTag:n?void 0:Ir(e.envName),envClasses:["abut","jot"],maxNumCols:e.envName==="split"?2:void 0,leqno:e.parser.settings.leqno},"display"),a,l=0,u=e.envName.indexOf("at")>-1;if(t[0]&&u){let c="";for(let d=0;d<t[0].body.length;d++){let b=P(t[0].body[d],"textord");c+=b.text}if(isNaN(c))throw new v("The alignat enviroment requires a numeric first argument.");a=Number(c),l=a*2}s.body.forEach(function(c){if(u){let d=c.length/2;if(a<d)throw new v(`Too many math in a row: expected ${a}, but got ${d}`,c[0])}else l<c.length&&(l=c.length)});for(let c=0;c<l;++c){let d="r";c%2===1&&(d="l"),r[c]={type:"align",align:d}}return e.envName==="split"||(u?s.envClasses.push("alignat"):s.envClasses[0]="align"),s};ve({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){let s=(Tn(t[0])?[t[0]]:P(t[0],"ordgroup").body).map(function(c){let b=qr(c).text;if("lcr".indexOf(b)!==-1)return{type:"align",align:b};if(b==="|")return{type:"separator",separator:"|"};if(b===":")return{type:"separator",separator:":"};throw new v("Unknown column alignment: "+b,c)}),[a,l]=ea(e.parser.gullet.macros),u={cols:s,envClasses:["array"],maxNumCols:s.length,arraystretch:a,arraycolsep:l};return Ie(e.parser,u,ta(e.envName))},mathmlBuilder:Se});ve({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){let t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={envClasses:[],cols:[]};if(e.envName.charAt(e.envName.length-1)==="*"){let u=e.parser;if(u.consumeSpaces(),u.fetch().text==="["){if(u.consume(),u.consumeSpaces(),n=u.fetch().text,"lcr".indexOf(n)===-1)throw new v("Expected l or c or r",u.nextToken);u.consume(),u.consumeSpaces(),u.expect("]"),u.consume(),r.cols=[]}}let s=Ie(e.parser,r,"text");s.cols=s.body.length>0?new Array(s.body[0].length).fill({type:"align",align:n}):[];let[a,l]=ea(e.parser.gullet.macros);return s.arraystretch=a,l&&!(l===6&&l==="pt")&&(s.arraycolsep=l),t?{type:"leftright",mode:e.mode,body:[s],left:t[0],right:t[1],rightColor:void 0}:s},mathmlBuilder:Se});ve({type:"array",names:["bordermatrix"],props:{numArgs:0},handler(e){let t={cols:[],envClasses:["bordermatrix"]},n=Ie(e.parser,t,"text");return n.cols=n.body.length>0?new Array(n.body[0].length).fill({type:"align",align:"c"}):[],n.envClasses=[],n.arraystretch=1,e.envName==="matrix"?n:Ul(n,e.delimiters)},mathmlBuilder:Se});ve({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){let t={envClasses:["small"]};return Ie(e.parser,t,"script")},mathmlBuilder:Se});ve({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){let s=(Tn(t[0])?[t[0]]:P(t[0],"ordgroup").body).map(function(l){let c=qr(l).text;if("lc".indexOf(c)!==-1)return{type:"align",align:c};throw new v("Unknown column alignment: "+c,l)});if(s.length>1)throw new v("{subarray} can contain only one column");let a={cols:s,envClasses:["small"]};if(a=Ie(e.parser,a,"script"),a.body.length>0&&a.body[0].length>1)throw new v("{subarray} can contain only one column");return a},mathmlBuilder:Se});ve({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){let t={cols:[],envClasses:["cases"]},n=Ie(e.parser,t,ta(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},mathmlBuilder:Se});ve({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:na,mathmlBuilder:Se});ve({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:na,mathmlBuilder:Se});ve({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){e.envName!=="gathered"&&Nt(e);let t={cols:[],envClasses:["abut","jot"],autoTag:Ir(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Ie(e.parser,t,"display")},mathmlBuilder:Se});ve({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Nt(e);let t={autoTag:Ir(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,envClasses:["align"],leqno:e.parser.settings.leqno};return Ie(e.parser,t,"display")},mathmlBuilder:Se});ve({type:"array",names:["multline","multline*"],props:{numArgs:0},handler(e){Nt(e);let t={autoTag:e.envName==="multline",maxNumCols:1,envClasses:["jot","multline"],leqno:e.parser.settings.leqno};return Ie(e.parser,t,"display")},mathmlBuilder:Se});ve({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Nt(e),Hl(e.parser)},mathmlBuilder:Se});D({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new v(`${e.funcName} valid only within array environment`)}});var Ar=Zo;D({type:"bordermatrix",names:["\\bordermatrix","\\matrix"],props:{numArgs:0,numOptionalArgs:1},handler:({parser:e,funcName:t},n,r)=>{let s=["(",")"];if(t==="\\bordermatrix"&&r[0]&&r[0].body){let c=r[0].body;c.length===2&&c[0].type==="atom"&&c[1].type==="atom"&&c[0].family==="open"&&c[1].family==="close"&&(s=[c[0].text,c[1].text])}e.consumeSpaces(),e.consume();let a=Ar.bordermatrix,l={mode:e.mode,envName:t.slice(1),delimiters:s,parser:e},u=a.handler(l);return e.expect("}",!0),u}});D({type:"cancelto",names:["\\cancelto"],props:{numArgs:2},handler({parser:e},t){let n=t[0],r=t[1];return{type:"cancelto",mode:e.mode,body:r,to:n,isCharacterBox:kn(r)}},mathmlBuilder(e,t){let n=new y("mrow",[U(e.body,t)],["ff-narrow"]),r=new y("mphantom",[U(e.body,t)]),s=new y("mrow",[r],["tml-cancelto"]);s.style.color=t.color,e.isCharacterBox&&Go.indexOf(e.body.body[0].text)>-1&&(s.style.left="0.1em",s.style.width="90%");let a=new y("mrow",[n,s],["menclose"]);if(!e.isCharacterBox||/[f∫∑]/.test(e.body.body[0].text))r.style.paddingRight="0.2em";else{r.style.padding="0.5ex 0.1em 0 0";let f=new y("mspace",[]);f.setAttribute("height","0.85em"),n.children.push(f)}let l;if(e.isCharacterBox)l=new y("mspace",[]),l.setAttribute("height","1em");else{let f=U(e.body,t),x=new y("mpadded",[f]);x.setAttribute("width","0.1px"),l=new y("mphantom",[x])}let u=U(e.to,t);u.style.color=t.color;let c=new y("mpadded",[u]);if(!e.isCharacterBox||/[f∫∑]/.test(e.body.body[0].text)){let f=new y("mspace",[]);f.setAttribute("width","0.2em"),c.children.unshift(f)}c.setAttribute("width","0.1px");let d=new y("mover",[l,c]),b=new y("mrow",[],["ff-nudge-left"]);return Je([Bt([a,d]),b])}});D({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler({parser:e,token:t},n){let s=P(n[0],"ordgroup").body,a="";for(let u=0;u<s.length;u++){let c=P(s[u],"textord");a+=c.text}let l=parseInt(a);if(isNaN(l))throw new v(`\\@char has non-numeric argument ${a}`,t);return{type:"textord",mode:e.mode,text:String.fromCodePoint(l)}}});var Zl=/^(#[a-f0-9]{3}|#?[a-f0-9]{6})$/i,Xl=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i,Yl=/^ *\d{1,3} *(?:, *\d{1,3} *){2}$/,Kl=/^ *[10](?:\.\d*)? *(?:, *[10](?:\.\d*)? *){2}$/,Ql=/^[a-f0-9]{6}$/i,vo=e=>{let t=e.toString(16);return t.length===1&&(t="0"+t),t},So=JSON.parse(`{
74
+ "Apricot": "#ffb484",
75
+ "Aquamarine": "#08b4bc",
76
+ "Bittersweet": "#c84c14",
77
+ "blue": "#0000FF",
78
+ "Blue": "#303494",
79
+ "BlueGreen": "#08b4bc",
80
+ "BlueViolet": "#503c94",
81
+ "BrickRed": "#b8341c",
82
+ "brown": "#BF8040",
83
+ "Brown": "#802404",
84
+ "BurntOrange": "#f8941c",
85
+ "CadetBlue": "#78749c",
86
+ "CarnationPink": "#f884b4",
87
+ "Cerulean": "#08a4e4",
88
+ "CornflowerBlue": "#40ace4",
89
+ "cyan": "#00FFFF",
90
+ "Cyan": "#08acec",
91
+ "Dandelion": "#ffbc44",
92
+ "darkgray": "#404040",
93
+ "DarkOrchid": "#a8548c",
94
+ "Emerald": "#08ac9c",
95
+ "ForestGreen": "#089c54",
96
+ "Fuchsia": "#90348c",
97
+ "Goldenrod": "#ffdc44",
98
+ "gray": "#808080",
99
+ "Gray": "#98949c",
100
+ "green": "#00FF00",
101
+ "Green": "#08a44c",
102
+ "GreenYellow": "#e0e474",
103
+ "JungleGreen": "#08ac9c",
104
+ "Lavender": "#f89cc4",
105
+ "lightgray": "#c0c0c0",
106
+ "lime": "#BFFF00",
107
+ "LimeGreen": "#90c43c",
108
+ "magenta": "#FF00FF",
109
+ "Magenta": "#f0048c",
110
+ "Mahogany": "#b0341c",
111
+ "Maroon": "#b03434",
112
+ "Melon": "#f89c7c",
113
+ "MidnightBlue": "#086494",
114
+ "Mulberry": "#b03c94",
115
+ "NavyBlue": "#086cbc",
116
+ "olive": "#7F7F00",
117
+ "OliveGreen": "#407c34",
118
+ "orange": "#FF8000",
119
+ "Orange": "#f8843c",
120
+ "OrangeRed": "#f0145c",
121
+ "Orchid": "#b074ac",
122
+ "Peach": "#f8945c",
123
+ "Periwinkle": "#8074bc",
124
+ "PineGreen": "#088c74",
125
+ "pink": "#ff7f7f",
126
+ "Plum": "#98248c",
127
+ "ProcessBlue": "#08b4ec",
128
+ "purple": "#BF0040",
129
+ "Purple": "#a0449c",
130
+ "RawSienna": "#983c04",
131
+ "red": "#ff0000",
132
+ "Red": "#f01c24",
133
+ "RedOrange": "#f86434",
134
+ "RedViolet": "#a0246c",
135
+ "Rhodamine": "#f0549c",
136
+ "Royallue": "#0874bc",
137
+ "RoyalPurple": "#683c9c",
138
+ "RubineRed": "#f0047c",
139
+ "Salmon": "#f8948c",
140
+ "SeaGreen": "#30bc9c",
141
+ "Sepia": "#701404",
142
+ "SkyBlue": "#48c4dc",
143
+ "SpringGreen": "#c8dc64",
144
+ "Tan": "#e09c74",
145
+ "teal": "#007F7F",
146
+ "TealBlue": "#08acb4",
147
+ "Thistle": "#d884b4",
148
+ "Turquoise": "#08b4cc",
149
+ "violet": "#800080",
150
+ "Violet": "#60449c",
151
+ "VioletRed": "#f054a4",
152
+ "WildStrawberry": "#f0246c",
153
+ "yellow": "#FFFF00",
154
+ "Yellow": "#fff404",
155
+ "YellowGreen": "#98cc6c",
156
+ "YellowOrange": "#ffa41c"
157
+ }`),ft=(e,t)=>{let n="";if(e==="HTML"){if(!Zl.test(t))throw new v("Invalid HTML input.");n=t}else if(e==="RGB"){if(!Yl.test(t))throw new v("Invalid RGB input.");t.split(",").map(r=>{n+=vo(Number(r.trim()))})}else{if(!Kl.test(t))throw new v("Invalid rbg input.");t.split(",").map(r=>{let s=Number(r.trim());if(s>1)throw new v("Color rgb input must be < 1.");n+=vo(Number((s*255).toFixed(0)))})}return n.charAt(0)!=="#"&&(n="#"+n),n},Ot=(e,t,n)=>{let r=`\\\\color@${e}`;if(!Xl.exec(e))throw new v("Invalid color: '"+e+"'",n);return Ql.test(e)?"#"+e:(e.charAt(0)==="#"||(t.has(r)?e=t.get(r).tokens[0].text:So[e]&&(e=So[e])),e)},ra=(e,t)=>{let n=he(e.body,t.withColor(e.color));return n.length===0&&n.push(new y("mrow")),n=n.map(r=>(r.style.color=e.color,r)),Je(n)};D({type:"color",names:["\\textcolor"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,argTypes:["raw","raw","original"]},handler({parser:e,token:t},n,r){let s=r[0]&&P(r[0],"raw").string,a="";if(s){let u=P(n[0],"raw").string;a=ft(s,u)}else a=Ot(P(n[0],"raw").string,e.gullet.macros,t);let l=n[1];return{type:"color",mode:e.mode,color:a,isTextColor:!0,body:ae(l)}},mathmlBuilder:ra});D({type:"color",names:["\\color"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0,argTypes:["raw","raw"]},handler({parser:e,breakOnTokenText:t,token:n},r,s){let a=s[0]&&P(s[0],"raw").string,l="";if(a){let c=P(r[0],"raw").string;l=ft(a,c)}else l=Ot(P(r[0],"raw").string,e.gullet.macros,n);let u=e.parseExpression(!0,t,!0);return{type:"color",mode:e.mode,color:l,isTextColor:!1,body:u}},mathmlBuilder:ra});D({type:"color",names:["\\definecolor"],props:{numArgs:3,allowedInText:!0,argTypes:["raw","raw","raw"]},handler({parser:e,funcName:t,token:n},r){let s=P(r[0],"raw").string;if(!/^[A-Za-z]+$/.test(s))throw new v("Color name must be latin letters.",n);let a=P(r[1],"raw").string;if(!["HTML","RGB","rgb"].includes(a))throw new v("Color model must be HTML, RGB, or rgb.",n);let l=P(r[2],"raw").string,u=ft(a,l);return e.gullet.macros.set(`\\\\color@${s}`,{tokens:[{text:u}],numArgs:0}),{type:"internal",mode:e.mode}}});D({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler({parser:e},t,n){let r=e.gullet.future().text==="["?e.parseSizeGroup(!0):null,s=!e.settings.displayMode;return{type:"cr",mode:e.mode,newLine:s,size:r&&P(r,"size").value}},mathmlBuilder(e,t){let n=new y("mo");if(e.newLine&&(n.setAttribute("linebreak","newline"),e.size)){let r=$e(e.size,t);n.setAttribute("height",r.number+r.unit)}return n}});var Tr={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},xn=e=>{let t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new v("Expected a control sequence",e);return t},Jl=e=>{let t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},sa=(e,t,n,r)=>{let s=e.gullet.macros.get(n.text);s==null&&(n.noexpand=!0,s={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,s,r)};D({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler({parser:e,funcName:t}){e.consumeSpaces();let n=e.fetch();if(Tr[n.text])return(t==="\\global"||t==="\\\\globallong")&&(n.text=Tr[n.text]),P(e.parseFunction(),"internal");throw new v("Invalid token after macro prefix",n)}});D({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:e,funcName:t}){let n=e.gullet.popToken(),r=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(r))throw new v("Expected a control sequence",n);let s=0,a,l=[[]];for(;e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){a=e.gullet.future(),l[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new v(`Invalid argument number "${n.text}"`);if(parseInt(n.text)!==s+1)throw new v(`Argument number "${n.text}" out of order`);s++,l.push([])}else{if(n.text==="EOF")throw new v("Expected a macro definition");l[s].push(n.text)}let{tokens:u}=e.gullet.consumeArg();if(a&&u.unshift(a),t==="\\edef"||t==="\\xdef"){if(u=e.gullet.expandTokens(u),u.length>e.gullet.settings.maxExpand)throw new v("Too many expansions in an "+t);u.reverse()}return e.gullet.macros.set(r,{tokens:u,numArgs:s,delimiters:l},t===Tr[t]),{type:"internal",mode:e.mode}}});D({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:e,funcName:t}){let n=xn(e.gullet.popToken());e.gullet.consumeSpaces();let r=Jl(e);return sa(e,n,r,t==="\\\\globallet"),{type:"internal",mode:e.mode}}});D({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:e,funcName:t}){let n=xn(e.gullet.popToken()),r=e.gullet.popToken(),s=e.gullet.popToken();return sa(e,n,s,t==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(r),{type:"internal",mode:e.mode}}});D({type:"internal",names:["\\newcommand","\\renewcommand","\\providecommand"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:e,funcName:t}){let n="",r=e.gullet.popToken();r.text==="{"?(n=xn(e.gullet.popToken()),e.gullet.popToken()):n=xn(r);let s=e.gullet.isDefined(n);if(s&&t==="\\newcommand")throw new v(`\\newcommand{${n}} attempting to redefine ${n}; use \\renewcommand`);if(!s&&t==="\\renewcommand")throw new v(`\\renewcommand{${n}} when command ${n} does not yet exist; use \\newcommand`);let a=0;if(e.gullet.future().text==="["){let u=e.gullet.popToken();if(u=e.gullet.popToken(),!/^[0-9]$/.test(u.text))throw new v(`Invalid number of arguments: "${u.text}"`);if(a=parseInt(u.text),u=e.gullet.popToken(),u.text!=="]")throw new v(`Invalid argument "${u.text}"`)}let{tokens:l}=e.gullet.consumeArg();return t==="\\providecommand"&&e.gullet.macros.has(n)||e.gullet.macros.set(n,{tokens:l,numArgs:a}),{type:"internal",mode:e.mode}}});var vr={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Br={"(":")","\\lparen":"\\rparen","[":"]","\\lbrack":"\\rbrack","\\{":"\\}","\\lbrace":"\\rbrace","\u2987":"\u2988","\\llparenthesis":"\\rrparenthesis","\\lfloor":"\\rfloor","\u230A":"\u230B","\\lceil":"\\rceil","\u2308":"\u2309","\\langle":"\\rangle","\u27E8":"\u27E9","\\lAngle":"\\rAngle","\u27EA":"\u27EB","\\llangle":"\\rrangle","\u2989":"\u298A","\\lvert":"\\rvert","\\lVert":"\\rVert","\\lgroup":"\\rgroup","\u27EE":"\u27EF","\\lmoustache":"\\rmoustache","\u23B0":"\u23B1","\\llbracket":"\\rrbracket","\u27E6":"\u27E7","\\lBrace":"\\rBrace","\u2983":"\u2984"},eu=new Set(Object.keys(Br));new Set(Object.values(Br));var oa=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\u2987","\\llparenthesis","\u2988","\\rrparenthesis","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27E8","\\rangle","\u27E9","\\lAngle","\u27EA","\\rAngle","\u27EB","\\llangle","\u2989","\\rrangle","\u298A","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1","\\llbracket","\\rrbracket","\u27E6","\u27E7","\\lBrace","\\rBrace","\u2983","\u2984","/","\\backslash","|","\\vert","\\|","\\Vert","\u2016","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]),tu=new Set(["}","\\left","\\middle","\\right"]),vn=e=>e.length>0&&(oa.has(e)||vr[e]||tu.has(e)),_o=[0,1.2,1.8,2.4,3];function Mt(e,t){e.type==="ordgroup"&&e.body.length===1&&(e=e.body[0]);let n=Tn(e);if(n&&oa.has(n.text))return(n.text==="<"||n.text==="\\lt")&&(n.text="\u27E8"),(n.text===">"||n.text==="\\gt")&&(n.text="\u27E9"),n;throw n?new v(`Invalid delimiter '${n.text}' after '${t.funcName}'`,e):new v(`Invalid delimiter type '${e.type}'`,e)}var nu=new Set(["/","\\","\\backslash","\u2216","\\vert","|"]),yn=(e,t,n,r)=>{let s=e==="."?"":e,a=new y("mo",[Te(s,t)]);return a.setAttribute("fence","true"),a.setAttribute("form",n),a.setAttribute("stretchy",r?"true":"false"),a};D({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{let n=Mt(t[0],e),r={type:"delimsizing",mode:e.parser.mode,size:vr[e.funcName].size,mclass:vr[e.funcName].mclass,delim:n.text},s=e.parser.fetch().text;return s!=="^"&&s!=="_"?r:{type:"ordgroup",mode:"math",body:[r,{type:"ordgroup",mode:"math",body:[]}]}},mathmlBuilder:e=>{let t=[],n=e.delim==="."?"":e.delim;t.push(Te(n,e.mode));let r=new y("mo",t);return e.mclass==="mopen"||e.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),(nu.has(n)||n.indexOf("arrow")>-1)&&r.setAttribute("stretchy","true"),r.setAttribute("symmetric","true"),r.setAttribute("minsize",_o[e.size]+"em"),r.setAttribute("maxsize",_o[e.size]+"em"),r}});function aa(e){if(!e.body)throw new Error("Bug: The delim ParseNode wasn't fully parsed.")}D({type:"leftright-right",names:["\\right"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>({type:"leftright-right",mode:e.parser.mode,delim:Mt(t[0],e).text})});D({type:"leftright",names:["\\left"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{let n=Mt(t[0],e),r=e.parser;++r.leftrightDepth;let s=r.parseExpression(!1,"\\right",!0),a=r.fetch();for(;a.text==="\\middle";){r.consume();let u=r.fetch().text;if(!K.math[u])throw new v(`Invalid delimiter '${u}' after '\\middle'`);Mt({type:"atom",mode:"math",text:u},{funcName:"\\middle"}),s.push({type:"middle",mode:"math",delim:u}),r.consume(),s=s.concat(r.parseExpression(!1,"\\right",!0)),a=r.fetch()}--r.leftrightDepth,r.expect("\\right",!1);let l=P(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:n.text,right:l.delim,isStretchy:!0}},mathmlBuilder:(e,t)=>{aa(e);let n=he(e.body,t),r=yn(e.left,e.mode,"prefix",!0);n.unshift(r);let s=yn(e.right,e.mode,"postfix",!0);if(e.body.length>0){let a=e.body[e.body.length-1];a.type==="color"&&!a.isTextColor&&s.setAttribute("mathcolor",a.color)}return n.push(s),Bt(n)}});D({type:"delimiter",names:Array.from(eu),props:{numArgs:0,allowedInText:!0,allowedInMath:!0,allowedInArgument:!0},handler:({parser:e,funcName:t,token:n})=>{if(e.mode==="text")return{type:"textord",mode:"text",text:t,loc:n.loc};if(!e.settings.wrapDelimiterPairs)return{type:"atom",mode:"math",family:"open",loc:n.loc,text:t};let r=Br[t],s=e.parseExpression(!1,r,!1);if(e.fetch().text!==r)throw new v("Unmatched delimiter");return e.consume(),{type:"delimiter",mode:e.mode,body:s,left:t,right:r}},mathmlBuilder:(e,t)=>{aa(e);let n=he(e.body,t),r=yn(e.left,e.mode,"prefix",!1);n.unshift(r);let s=yn(e.right,e.mode,"postfix",!1);if(e.body.length>0){let a=e.body[e.body.length-1];a.type==="color"&&!a.isTextColor&&s.setAttribute("mathcolor",a.color)}return n.push(s),Bt(n)}});D({type:"middle",names:["\\middle"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{let n=Mt(t[0],e);if(!e.parser.leftrightDepth)throw new v("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},mathmlBuilder:e=>{let t=Te(e.delim,e.mode),n=new y("mo",[t]);return n.setAttribute("fence","true"),e.delim.indexOf("arrow")>-1&&n.setAttribute("stretchy","true"),n.setAttribute("form","prefix"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var ru=["\\boxed","\\fcolorbox","\\colorbox"],Pt=(e,t)=>{let n=ru.includes(e.label)?"mrow":"menclose",r=new y(n,[U(e.body,t)]);switch(e.label){case"\\overline":r.setAttribute("notation","top"),r.classes.push("tml-overline");break;case"\\underline":r.setAttribute("notation","bottom"),r.classes.push("tml-underline");break;case"\\cancel":r.setAttribute("notation","updiagonalstrike"),r.children.push(new y("mrow",[],["tml-cancel","upstrike"]));break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike"),r.children.push(new y("mrow",[],["tml-cancel","downstrike"]));break;case"\\sout":r.setAttribute("notation","horizontalstrike"),r.children.push(new y("mrow",[],["tml-cancel","sout"]));break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike"),r.children.push(new y("mrow",[],["tml-cancel","tml-xcancel"]));break;case"\\longdiv":r.setAttribute("notation","longdiv"),r.classes.push("longdiv-top"),r.children.push(new y("mrow",[],["longdiv-arc"]));break;case"\\phase":r.setAttribute("notation","phasorangle"),r.classes.push("phasor-bottom"),r.children.push(new y("mrow",[],["phasor-angle"]));break;case"\\textcircled":r.setAttribute("notation","circle"),r.classes.push("circle-pad"),r.children.push(new y("mrow",[],["textcircle"]));break;case"\\angl":r.setAttribute("notation","actuarial"),r.classes.push("actuarial");break;case"\\boxed":r.style.padding="3pt",r.style.border="1px solid",r.setAttribute("scriptlevel","0"),r.setAttribute("displaystyle","true");break;case"\\fbox":r.setAttribute("notation","box"),r.classes.push("tml-fbox");break;case"\\fcolorbox":case"\\colorbox":{r.style.padding="0.3em",e.label==="\\fcolorbox"&&(r.style.border="0.0667em solid "+String(e.borderColor));break}}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};D({type:"enclose",names:["\\colorbox"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,argTypes:["raw","raw","text"]},handler({parser:e,funcName:t},n,r){let s=r[0]&&P(r[0],"raw").string,a="";if(s){let u=P(n[0],"raw").string;a=ft(s,u)}else a=Ot(P(n[0],"raw").string,e.gullet.macros);let l=n[1];return{type:"enclose",mode:e.mode,label:t,backgroundColor:a,body:l}},mathmlBuilder:Pt});D({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,numOptionalArgs:1,allowedInText:!0,argTypes:["raw","raw","raw","text"]},handler({parser:e,funcName:t},n,r){let s=r[0]&&P(r[0],"raw").string,a="",l;if(s){let c=P(n[0],"raw").string,d=P(n[0],"raw").string;a=ft(s,c),l=ft(s,d)}else a=Ot(P(n[0],"raw").string,e.gullet.macros),l=Ot(P(n[1],"raw").string,e.gullet.macros);let u=n[2];return{type:"enclose",mode:e.mode,label:t,backgroundColor:l,borderColor:a,body:u}},mathmlBuilder:Pt});D({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler({parser:e},t){return{type:"enclose",mode:e.mode,label:"\\fbox",body:t[0]}}});D({type:"enclose",names:["\\angl","\\cancel","\\bcancel","\\xcancel","\\sout","\\overline","\\boxed","\\longdiv","\\phase"],props:{numArgs:1},handler({parser:e,funcName:t},n){let r=n[0];return{type:"enclose",mode:e.mode,label:t,body:r}},mathmlBuilder:Pt});D({type:"enclose",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler({parser:e,funcName:t},n){let r=n[0];return{type:"enclose",mode:e.mode,label:t,body:r}},mathmlBuilder:Pt});D({type:"enclose",names:["\\textcircled"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler({parser:e,funcName:t},n){let r=n[0];return{type:"enclose",mode:e.mode,label:t,body:r}},mathmlBuilder:Pt});D({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler({parser:e,funcName:t},n){let r=n[0];if(r.type!=="ordgroup")throw new v("Invalid environment name",r);let s="";for(let a=0;a<r.body.length;++a)s+=P(r.body[a],"textord").text;if(t==="\\begin"){if(!Object.prototype.hasOwnProperty.call(Ar,s))throw new v("No such environment: "+s,r);let a=Ar[s],{args:l,optArgs:u}=e.parseArguments("\\begin{"+s+"}",a),c={mode:e.mode,envName:s,parser:e},d=a.handler(c,l,u);e.expect("\\end",!1);let b=e.nextToken,f=P(e.parseFunction(),"environment");if(f.name!==s)throw new v(`Mismatch: \\begin{${s}} matched by \\end{${f.name}}`,b);return d}return{type:"environment",mode:e.mode,name:s,nameGroup:r}}});D({type:"envTag",names:["\\env@tag"],props:{numArgs:1,argTypes:["math"]},handler({parser:e},t){return{type:"envTag",mode:e.mode,body:t[0]}},mathmlBuilder(e,t){return new y("mrow")}});D({type:"noTag",names:["\\env@notag"],props:{numArgs:0},handler({parser:e}){return{type:"noTag",mode:e.mode}},mathmlBuilder(e,t){return new y("mrow")}});var su=(e,t)=>{if(t!=="mathrm"||e.body.type!=="ordgroup"||e.body.body.length===1||e.body.body[0].type!=="mathord")return!1;for(let n=1;n<e.body.body.length;n++){let r=e.body.body[n].type;if(!(r==="mathord"||r==="textord"&&!isNaN(e.body.body[n].text)))return!1}return!0},ia=(e,t)=>{let n=e.font,r=t.withFont(n),s=U(e.body,r);if(s.children.length===0)return s;if(n==="boldsymbol"&&["mo","mpadded","mrow"].includes(s.type))return s.style.fontWeight="bold",s;if(su(e,n)){let u=s.children[0].children[0].children?s.children[0].children[0]:s.children[0];delete u.attributes.mathvariant;for(let d=1;d<s.children.length;d++)u.children[0].text+=s.children[d].children[0].children?s.children[d].children[0].children[0].text:s.children[d].children[0].text;let c=new y("mpadded",[u]);return c.setAttribute("lspace","0"),c}let a=s.children[0].type==="mo";for(let u=1;u<s.children.length;u++)s.children[u].type==="mo"&&n==="boldsymbol"&&(s.children[u].style.fontWeight="bold"),s.children[u].type!=="mi"&&(a=!1),(s.children[u].attributes&&s.children[u].attributes.mathvariant||"")!=="normal"&&(a=!1);if(!a)return s;let l=s.children[0];for(let u=1;u<s.children.length;u++)l.children.push(s.children[u].children[0]);if(l.attributes.mathvariant&&l.attributes.mathvariant==="normal"){let u=new y("mtext",new se("\u200B"));return new y("mrow",[u,l])}return l},Eo={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};D({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\up@greek","\\boldsymbol","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathsfit","\\mathtt","\\Bbb","\\bm","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:({parser:e,funcName:t},n)=>{let r=Rt(n[0]),s=t;return s in Eo&&(s=Eo[s]),{type:"font",mode:e.mode,font:s.slice(1),body:r}},mathmlBuilder:ia});D({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:({parser:e,funcName:t,breakOnTokenText:n},r)=>{let{mode:s}=e,a=e.parseExpression(!0,n,!0),l=`math${t.slice(1)}`;return{type:"font",mode:s,font:l,body:{type:"ordgroup",mode:e.mode,body:a}}},mathmlBuilder:ia});var Co=["display","text","script","scriptscript"],ou={auto:-1,display:0,text:0,script:1,scriptscript:2},au=(e,t)=>{let n=t;if(e==="display"){let r=n.level>=X.SCRIPT?X.TEXT:X.DISPLAY;n=n.withLevel(r)}else e==="text"&&n.level===X.DISPLAY?n=n.withLevel(X.TEXT):e==="auto"?n=n.incrementLevel():e==="script"?n=n.withLevel(X.SCRIPT):e==="scriptscript"&&(n=n.withLevel(X.SCRIPTSCRIPT));return n},Nr=(e,t)=>{t=au(e.scriptLevel,t);let n=U(e.numer,t),r=U(e.denom,t);t.level===3&&(n.style.mathDepth="2",n.setAttribute("scriptlevel","2"),r.style.mathDepth="2",r.setAttribute("scriptlevel","2"));let s=new y("mfrac",[n,r]);if(!e.hasBarLine)s.setAttribute("linethickness","0px");else if(e.barSize){let a=$e(e.barSize,t);s.setAttribute("linethickness",a.number+a.unit)}if(e.leftDelim!=null||e.rightDelim!=null){let a=[];if(e.leftDelim!=null){let l=new y("mo",[new se(e.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}if(a.push(s),e.rightDelim!=null){let l=new y("mo",[new se(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}s=Bt(a)}return e.scriptLevel!=="auto"&&(s=new y("mstyle",[s]),s.setAttribute("displaystyle",String(e.scriptLevel==="display")),s.setAttribute("scriptlevel",ou[e.scriptLevel])),s};D({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:({parser:e,funcName:t},n)=>{let r=n[0],s=n[1],a=!1,l=null,u=null,c="auto";switch(t){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":l="(",u=")";break;case"\\\\bracefrac":l="\\{",u="\\}";break;case"\\\\brackfrac":l="[",u="]";break;default:throw new Error("Unrecognized genfrac command")}return t==="\\cfrac"||t.startsWith("\\d")?c="display":t.startsWith("\\t")&&(c="text"),{type:"genfrac",mode:e.mode,continued:!1,numer:r,denom:s,hasBarLine:a,leftDelim:l,rightDelim:u,scriptLevel:c,barSize:null}},mathmlBuilder:Nr});D({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler({parser:e,funcName:t,token:n}){let r;switch(t){case"\\over":r="\\frac";break;case"\\choose":r="\\binom";break;case"\\atop":r="\\\\atopfrac";break;case"\\brace":r="\\\\bracefrac";break;case"\\brack":r="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:r,token:n}}});var Do=function(e){let t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};D({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler({parser:e},t){let n=t[4],r=t[5],s=Rt(t[0]),a=s.type==="atom"&&s.family==="open"?Do(s.text):null,l=Rt(t[1]),u=l.type==="atom"&&l.family==="close"?Do(l.text):null,c=P(t[2],"size"),d,b=null;c.isBlank?d=!0:(b=c.value,d=b.number>0);let f="auto",x=t[3];if(x.type==="ordgroup"){if(x.body.length>0){let A=P(x.body[0],"textord");f=Co[Number(A.text)]}}else x=P(x,"textord"),f=Co[Number(x.text)];return{type:"genfrac",mode:e.mode,numer:n,denom:r,continued:!1,hasBarLine:d,barSize:b,leftDelim:a,rightDelim:u,scriptLevel:f}},mathmlBuilder:Nr});D({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler({parser:e,funcName:t,token:n},r){return{type:"infix",mode:e.mode,replaceWith:"\\\\abovefrac",barSize:P(r[0],"size").value,token:n}}});D({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:({parser:e,funcName:t},n)=>{let r=n[0],s=xl(P(n[1],"infix").barSize),a=n[2],l=s.number>0;return{type:"genfrac",mode:e.mode,numer:r,denom:a,continued:!1,hasBarLine:l,barSize:s,leftDelim:null,rightDelim:null,scriptLevel:"auto"}},mathmlBuilder:Nr});D({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["hbox"],allowedInArgument:!0,allowedInText:!1},handler({parser:e},t){return{type:"hbox",mode:e.mode,body:ae(t[0])}},mathmlBuilder(e,t){let n=t.withLevel(X.TEXT),r=je(e.body,n);return An(r)}});var iu=(e,t)=>{let n=Rr(e.label);return n.style["math-depth"]=0,new y(e.isOver?"mover":"munder",[U(e.base,t),n])};D({type:"horizBracket",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler({parser:e,funcName:t},n){return{type:"horizBracket",mode:e.mode,label:t,isOver:/^\\over/.test(t),base:n[0]}},mathmlBuilder:iu});D({type:"html",names:["\\class","\\id","\\style","\\data"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:({parser:e,funcName:t,token:n},r)=>{let s=P(r[0],"raw").string,a=r[1];if(e.settings.strict)throw new v(`Function "${t}" is disabled in strict mode`,n);let l,u={};switch(t){case"\\class":u.class=s,l={command:"\\class",class:s};break;case"\\id":u.id=s,l={command:"\\id",id:s};break;case"\\style":u.style=s,l={command:"\\style",style:s};break;case"\\data":{let c=s.split(",");for(let d=0;d<c.length;d++){let b=c[d].split("=");if(b.length!==2)throw new v("Error parsing key-value for \\data");u["data-"+b[0].trim()]=b[1].trim()}l={command:"\\data",attributes:u};break}default:throw new Error("Unrecognized html command")}if(!e.settings.isTrusted(l))throw new v(`Function "${t}" is not trusted`,n);return{type:"html",mode:e.mode,attributes:u,body:ae(a)}},mathmlBuilder:(e,t)=>{let n=je(e.body,t),r=[];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/)),n.classes=r;for(let s in e.attributes)s!=="class"&&Object.prototype.hasOwnProperty.call(e.attributes,s)&&n.setAttribute(s,e.attributes[s]);return n}});var fr=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};{let t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new v("Invalid size: '"+e+"' in \\includegraphics");let n={number:+(t[1]+t[2]),unit:t[3]};if(!Wo(n))throw new v("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n}};D({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:({parser:e,token:t},n,r)=>{let s={number:0,unit:"em"},a={number:.9,unit:"em"},l={number:0,unit:"em"},u="";if(r[0]){let b=P(r[0],"raw").string.split(",");for(let f=0;f<b.length;f++){let x=b[f].split("=");if(x.length===2){let A=x[1].trim();switch(x[0].trim()){case"alt":u=A;break;case"width":s=fr(A);break;case"height":a=fr(A);break;case"totalheight":l=fr(A);break;default:throw new v("Invalid key: '"+x[0]+"' in \\includegraphics.")}}}}let c=P(n[0],"url").url;if(u===""&&(u=c,u=u.replace(/^.*[\\/]/,""),u=u.substring(0,u.lastIndexOf("."))),!e.settings.isTrusted({command:"\\includegraphics",url:c}))throw new v('Function "\\includegraphics" is not trusted',t);return{type:"includegraphics",mode:e.mode,alt:u,width:s,height:a,totalheight:l,src:c}},mathmlBuilder:(e,t)=>{let n=$e(e.height,t),r={number:0,unit:"em"};e.totalheight.number>0&&e.totalheight.unit===n.unit&&e.totalheight.number>n.number&&(r.number=e.totalheight.number-n.number,r.unit=n.unit);let s=0;e.width.number>0&&(s=$e(e.width,t));let a={height:n.number+r.number+"em"};s.number>0&&(a.width=s.number+s.unit),r.number>0&&(a.verticalAlign=-r.number+r.unit);let l=new xr(e.src,e.alt,a);return l.height=n,l.depth=r,new y("mtext",[l])}});D({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler({parser:e,funcName:t,token:n},r){let s=P(r[0],"size");if(e.settings.strict){let a=t[1]==="m",l=s.value.unit==="mu";if(a){if(!l)throw new v(`LaTeX's ${t} supports only mu units, not ${s.value.unit} units`,n);if(e.mode!=="math")throw new v(`LaTeX's ${t} works only in math mode`,n)}else if(l)throw new v(`LaTeX's ${t} doesn't support mu units`,n)}return{type:"kern",mode:e.mode,dimension:s.value}},mathmlBuilder(e,t){let n=$e(e.dimension,t),r=n.number>0&&n.unit==="em"?la(n.number):"";if(e.mode==="text"&&r.length>0){let s=new se(r);return new y("mtext",[s])}else if(n.number>=0){let s=new y("mspace");return s.setAttribute("width",n.number+n.unit),s}else{let s=new y("mrow");return s.style.marginLeft=n.number+n.unit,s}}});var la=function(e){return e>=.05555&&e<=.05556?"\u200A":e>=.1666&&e<=.1667?"\u2009":e>=.2222&&e<=.2223?"\u2005":e>=.2777&&e<=.2778?"\u2005\u200A":""},ua=/[^A-Za-z_0-9-]/g;D({type:"label",names:["\\label"],props:{numArgs:1,argTypes:["raw"]},handler({parser:e},t){return{type:"label",mode:e.mode,string:t[0].string.replace(ua,"")}},mathmlBuilder(e,t){let n=new y("mrow",[],["tml-label"]);return e.string.length>0&&n.setLabel(e.string),n}});var lu=["\\clap","\\llap","\\rlap"];D({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap","\\clap","\\llap","\\rlap"],props:{numArgs:1,allowedInText:!0},handler:({parser:e,funcName:t,token:n},r)=>{if(lu.includes(t)){if(e.settings.strict&&e.mode!=="text")throw new v(`{${t}} can be used only in text mode.
158
+ Try \\math${t.slice(1)}`,n);t=t.slice(1)}else t=t.slice(5);let s=r[0];return{type:"lap",mode:e.mode,alignment:t,body:s}},mathmlBuilder:(e,t)=>{let n;if(e.alignment==="llap"){let a=he(ae(e.body),t),l=new y("mphantom",a);n=new y("mpadded",[l]),n.setAttribute("width","0.1px")}let r=U(e.body,t),s;if(e.alignment==="llap"?(r.style.position="absolute",r.style.right="0",r.style.bottom="0",s=new y("mpadded",[n,r])):s=new y("mpadded",[r]),e.alignment==="rlap")e.body.body.length>0&&e.body.body[0].type==="genfrac"&&s.setAttribute("lspace","0.16667em");else{let a=e.alignment==="llap"?"-1":"-0.5";s.setAttribute("lspace",a+"width"),e.alignment==="llap"?s.style.position="relative":(s.style.display="flex",s.style.justifyContent="center")}return s.setAttribute("width","0.1px"),s}});D({type:"ordgroup",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler({funcName:e,parser:t},n){let r=t.mode;t.switchMode("math");let s=e==="\\("?"\\)":"$",a=t.parseExpression(!1,s);return t.expect(s),t.switchMode(r),{type:"ordgroup",mode:t.mode,body:a}}});D({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new v(`Mismatched ${e.funcName}`,t)}});var uu=(e,t)=>{switch(t.level){case X.DISPLAY:return e.display;case X.TEXT:return e.text;case X.SCRIPT:return e.script;case X.SCRIPTSCRIPT:return e.scriptscript;default:return e.text}};D({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:({parser:e},t)=>({type:"mathchoice",mode:e.mode,display:ae(t[0]),text:ae(t[1]),script:ae(t[2]),scriptscript:ae(t[3])}),mathmlBuilder:(e,t)=>{let n=uu(e,t);return je(n,t)}});var cu=["text","textord","mathord","atom"];function ca(e,t){let n,r=he(e.body,t);if(e.mclass==="minner")n=new y("mpadded",r);else if(e.mclass==="mord")e.isCharacterBox||r[0].type==="mathord"?(n=r[0],n.type="mi",n.children.length===1&&n.children[0].text&&n.children[0].text==="\u2207"&&n.setAttribute("mathvariant","normal")):n=new y("mi",r);else{n=new y("mrow",r),e.mustPromote?(n=r[0],n.type="mo",e.isCharacterBox&&e.body[0].text&&/[A-Za-z]/.test(e.body[0].text)&&n.setAttribute("mathvariant","italic")):n=new y("mrow",r);let s=t.level<2;n.type==="mrow"?s&&(e.mclass==="mbin"?(n.children.unshift(re(.2222)),n.children.push(re(.2222))):e.mclass==="mrel"?(n.children.unshift(re(.2778)),n.children.push(re(.2778))):e.mclass==="mpunct"?n.children.push(re(.1667)):e.mclass==="minner"&&(n.children.unshift(re(.0556)),n.children.push(re(.0556)))):e.mclass==="mbin"?(n.attributes.lspace=s?"0.2222em":"0",n.attributes.rspace=s?"0.2222em":"0"):e.mclass==="mrel"?(n.attributes.lspace=s?"0.2778em":"0",n.attributes.rspace=s?"0.2778em":"0"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace=s?"0.1667em":"0"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&s&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em"),e.mclass==="mopen"||e.mclass==="mclose"||(delete n.attributes.stretchy,delete n.attributes.form)}return n}D({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler({parser:e,funcName:t},n){let r=n[0],s=kn(r),a=!0,l={type:"mathord",text:"",mode:e.mode},u=r.body?r.body:[r];for(let c of u)if(cu.includes(c.type))K[e.mode][c.text]?l.text+=K[e.mode][c.text].replace:c.text?l.text+=c.text:c.body&&c.body.map(d=>{l.text+=d.text});else{a=!1;break}return a&&t==="\\mathord"&&l.type==="mathord"&&l.text.length>1?l:{type:"mclass",mode:e.mode,mclass:"m"+t.slice(5),body:ae(a?l:r),isCharacterBox:s,mustPromote:a}},mathmlBuilder:ca});var da=e=>{let t=e.type==="ordgroup"&&e.body.length&&e.body.length===1?e.body[0]:e;if(t.type==="atom"){let n=e.body.length>0&&e.body[0].text&&K.math[e.body[0].text]?K.math[e.body[0].text].group:t.family;return n==="bin"||n==="rel"?"m"+n:"mord"}else return"mord"};D({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler({parser:e},t){return{type:"mclass",mode:e.mode,mclass:da(t[0]),body:ae(t[1]),isCharacterBox:kn(t[1])}}});D({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler({parser:e,funcName:t},n){let r=n[1],s=n[0],a;t!=="\\stackrel"?a=da(r):a="mrel";let u={type:a==="mrel"||a==="mbin"?"op":"ordgroup",mode:r.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:t!=="\\stackrel",body:ae(r)};return{type:"supsub",mode:s.mode,stack:!0,base:u,sup:t==="\\underset"?null:s,sub:t==="\\underset"?s:null}},mathmlBuilder:ca});var cn=(e,t,n)=>{if(!e)return n;let r=U(e,t);return r.type==="mrow"&&r.children.length===0?n:r};D({type:"multiscript",names:["\\sideset","\\pres@cript"],props:{numArgs:3},handler({parser:e,funcName:t,token:n},r){if(r[2].body.length===0)throw new v(t+"cannot parse an empty base.");let s=r[2].body[0];if(e.settings.strict&&t==="\\sideset"&&!s.symbol)throw new v("The base of \\sideset must be a big operator. Try \\prescript.");if(r[0].body.length>0&&r[0].body[0].type!=="supsub"||r[1].body.length>0&&r[1].body[0].type!=="supsub")throw new v("\\sideset can parse only subscripts and superscripts in its first two arguments",n);let a=r[0].body.length>0?r[0].body[0]:null,l=r[1].body.length>0?r[1].body[0]:null;return!a&&!l?s:a?{type:"multiscript",mode:e.mode,isSideset:t==="\\sideset",prescripts:a,postscripts:l,base:s}:{type:"styling",mode:e.mode,scriptLevel:"text",body:[{type:"supsub",mode:e.mode,base:s,sup:l.sup,sub:l.sub}]}},mathmlBuilder(e,t){let n=U(e.base,t),r=new y("mprescripts"),s=new y("none"),a=[],l=cn(e.prescripts.sub,t,s),u=cn(e.prescripts.sup,t,s);if(e.isSideset&&(l.setAttribute("style","text-align: left;"),u.setAttribute("style","text-align: left;")),e.postscripts){let c=cn(e.postscripts.sub,t,s),d=cn(e.postscripts.sup,t,s);a=[n,c,d,r,l,u]}else a=[n,r,l,u];return new y("mmultiscripts",a)}});D({type:"not",names:["\\not"],props:{numArgs:1,primitive:!0,allowedInText:!1},handler({parser:e},t){let n=kn(t[0]),r;return n?(r=ae(t[0]),r[0].text.charAt(0)==="\\"&&(r[0].text=K.math[r[0].text].replace),r[0].text=r[0].text.slice(0,1)+"\u0338"+r[0].text.slice(1)):r=[{type:"textord",mode:"math",text:"\u0338"},{type:"kern",mode:"math",dimension:{number:-.6,unit:"em"}},t[0]],{type:"not",mode:e.mode,body:r,isCharacterBox:n}},mathmlBuilder(e,t){return e.isCharacterBox?he(e.body,t,!0)[0]:je(e.body,t)}});var du=["textord","mathord","atom"],pu=["\\smallint"],Pr=["textord","mathord","ordgroup","close","leftright","font"],Lo=e=>{e.attributes.lspace="0.1667em",e.attributes.rspace="0.1667em"},zt=(e,t)=>{let n;if(e.symbol)n=new y("mo",[Te(e.name,e.mode)]),pu.includes(e.name)?n.setAttribute("largeop","false"):n.setAttribute("movablelimits","false"),e.fromMathOp&&Lo(n);else if(e.body)n=new y("mo",he(e.body,t)),e.fromMathOp&&Lo(n);else if(n=new y("mi",[new se(e.name.slice(1))]),!e.parentIsSupSub){let r=new y("mo",[Te("\u2061","text")]),s=[n,r];if(e.needsLeadingSpace){let a=new y("mspace");a.setAttribute("width","0.1667em"),s.unshift(a)}if(!e.isFollowedByDelimiter){let a=new y("mspace");a.setAttribute("width","0.1667em"),s.push(a)}n=new y("mrow",s)}return n},hu={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A05":"\\bigsqcap","\u2A06":"\\bigsqcup","\u2A03":"\\bigcupdot","\u2A07":"\\bigdoublevee","\u2A08":"\\bigdoublewedge","\u2A09":"\\bigtimes"};D({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcupplus","\\bigcupdot","\\bigcap","\\bigcup","\\bigdoublevee","\\bigdoublewedge","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcap","\\bigsqcup","\\bigtimes","\\smallint","\u220F","\u2210","\u2211","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A03","\u2A04","\u2A05","\u2A06","\u2A07","\u2A08","\u2A09"],props:{numArgs:0},handler:({parser:e,funcName:t},n)=>{let r=t;return r.length===1&&(r=hu[r]),{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!0,stack:!1,name:r}},mathmlBuilder:zt});D({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:({parser:e},t)=>{let n=t[0],r=n.body?n.body:[n],s=r.length===1&&du.includes(r[0].type);return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:s,fromMathOp:!0,stack:!1,name:s?r[0].text:null,body:s?null:ae(n)}},mathmlBuilder:zt});var mu={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint","\u2231":"\\intclockwise","\u2232":"\\varointclockwise","\u2A0C":"\\iiiint","\u2A0D":"\\intbar","\u2A0E":"\\intBar","\u2A0F":"\\fint","\u2A12":"\\rppolint","\u2A13":"\\scpolint","\u2A15":"\\pointint","\u2A16":"\\sqint","\u2A17":"\\intlarhk","\u2A18":"\\intx","\u2A19":"\\intcap","\u2A1A":"\\intcup"};D({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\sgn","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler({parser:e,funcName:t}){let n=e.prevAtomType,r=e.gullet.future().text;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,stack:!1,isFollowedByDelimiter:vn(r),needsLeadingSpace:n.length>0&&Pr.includes(n),name:t}},mathmlBuilder:zt});D({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler({parser:e,funcName:t}){let n=e.prevAtomType,r=e.gullet.future().text;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,stack:!1,isFollowedByDelimiter:vn(r),needsLeadingSpace:n.length>0&&Pr.includes(n),name:t}},mathmlBuilder:zt});D({type:"op",names:["\\int","\\iint","\\iiint","\\iiiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\intbar","\\intBar","\\fint","\\rppolint","\\scpolint","\\pointint","\\sqint","\\intlarhk","\\intx","\\intcap","\\intcup","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230","\u2231","\u2232","\u2A0C","\u2A0D","\u2A0E","\u2A0F","\u2A12","\u2A13","\u2A15","\u2A16","\u2A17","\u2A18","\u2A19","\u2A1A"],props:{numArgs:0,allowedInArgument:!0},handler({parser:e,funcName:t}){let n=t;return n.length===1&&(n=mu[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,stack:!1,name:n}},mathmlBuilder:zt});var fu=(e,t)=>{let n=he(e.body,t.withFont("mathrm")),r=!0;for(let a=0;a<n.length;a++){let l=n[a];if(l instanceof y)switch(((l.type==="mrow"||l.type==="mpadded")&&l.children.length===1&&l.children[0]instanceof y||l.type==="mrow"&&l.children.length===2&&l.children[0]instanceof y&&l.children[1]instanceof y&&l.children[1].type==="mspace"&&!l.children[1].attributes.width&&l.children[1].children.length===0)&&(l=l.children[0]),l.type){case"mi":case"mn":case"ms":case"mtext":break;case"mspace":if(l.attributes.width){let u=l.attributes.width.replace("em",""),c=la(Number(u));c===""?r=!1:n[a]=new y("mtext",[new se(c)])}break;case"mo":{let u=l.children[0];l.children.length===1&&u instanceof se?u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){let a=n.map(l=>l.toText()).join("");n=[new se(a)]}else if(n.length===1&&["mover","munder"].includes(n[0].type)&&(n[0].children[0].type==="mi"||n[0].children[0].type==="mtext")){if(n[0].children[0].type="mi",e.parentIsSupSub)return new y("mrow",n);{let a=new y("mo",[Te("\u2061","text")]);return Je([n[0],a])}}let s;if(r?(s=new y("mi",n),n[0].text.length===1&&s.setAttribute("mathvariant","normal")):s=new y("mrow",n),!e.parentIsSupSub){let a=new y("mo",[Te("\u2061","text")]),l=[s,a];if(e.needsLeadingSpace){let u=new y("mspace");u.setAttribute("width","0.1667em"),l.unshift(u)}if(!e.isFollowedByDelimiter){let u=new y("mspace");u.setAttribute("width","0.1667em"),l.push(u)}return Je(l)}return s};D({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1,allowedInArgument:!0},handler:({parser:e,funcName:t},n)=>{let r=n[0],s=e.prevAtomType,a=e.gullet.future().text;return{type:"operatorname",mode:e.mode,body:ae(r),alwaysHandleSupSub:t==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1,isFollowedByDelimiter:vn(a),needsLeadingSpace:s.length>0&&Pr.includes(s)}},mathmlBuilder:fu});p("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");et({type:"ordgroup",mathmlBuilder(e,t){return je(e.body,t,e.semisimple)}});D({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:({parser:e},t)=>{let n=t[0];return{type:"phantom",mode:e.mode,body:ae(n)}},mathmlBuilder:(e,t)=>{let n=he(e.body,t);return new y("mphantom",n)}});D({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:({parser:e},t)=>{let n=t[0];return{type:"hphantom",mode:e.mode,body:n}},mathmlBuilder:(e,t)=>{let n=he(ae(e.body),t),r=new y("mphantom",n),s=new y("mpadded",[r]);return s.setAttribute("height","0px"),s.setAttribute("depth","0px"),s}});D({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:({parser:e},t)=>{let n=t[0];return{type:"vphantom",mode:e.mode,body:n}},mathmlBuilder:(e,t)=>{let n=he(ae(e.body),t),r=new y("mphantom",n),s=new y("mpadded",[r]);return s.setAttribute("width","0px"),s}});D({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler({parser:e},t){return{type:"pmb",mode:e.mode,body:ae(t[0])}},mathmlBuilder(e,t){let n=he(e.body,t),r=Lr(n);return r.setAttribute("style","font-weight:bold"),r}});var pa=(e,t)=>{let n=t.withLevel(X.TEXT),r=new y("mpadded",[U(e.body,n)]),s=$e(e.dy,t);return r.setAttribute("voffset",s.number+s.unit),s.number>0?r.style.padding=s.number+s.unit+" 0 0 0":r.style.padding="0 0 "+Math.abs(s.number)+s.unit+" 0",r};D({type:"raise",names:["\\raise","\\lower"],props:{numArgs:2,argTypes:["size","primitive"],primitive:!0},handler({parser:e,funcName:t},n){let r=P(n[0],"size").value;t==="\\lower"&&(r.number*=-1);let s=n[1];return{type:"raise",mode:e.mode,dy:r,body:s}},mathmlBuilder:pa});D({type:"raise",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler({parser:e,funcName:t},n){let r=P(n[0],"size").value,s=n[1];return{type:"raise",mode:e.mode,dy:r,body:s}},mathmlBuilder:pa});D({type:"ref",names:["\\ref","\\eqref"],props:{numArgs:1,argTypes:["raw"]},handler({parser:e,funcName:t},n){return{type:"ref",mode:e.mode,funcName:t,string:n[0].string.replace(ua,"")}},mathmlBuilder(e,t){let n=e.funcName==="\\ref"?["tml-ref"]:["tml-ref","tml-eqref"];return new gn("#"+e.string,n,null)}});D({type:"reflect",names:["\\reflectbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler({parser:e},t){return{type:"reflect",mode:e.mode,body:t[0]}},mathmlBuilder(e,t){let n=U(e.body,t);return n.style.transform="scaleX(-1)",n}});D({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler({parser:e}){return{type:"internal",mode:e.mode}}});D({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler({parser:e},t,n){let r=n[0],s=P(t[0],"size"),a=P(t[1],"size");return{type:"rule",mode:e.mode,shift:r&&P(r,"size").value,width:s.value,height:a.value}},mathmlBuilder(e,t){let n=$e(e.width,t),r=$e(e.height,t),s=e.shift?$e(e.shift,t):{number:0,unit:"em"},a=t.color&&t.getColor()||"black",l=new y("mspace");if(n.number>0&&r.number>0&&l.setAttribute("mathbackground",a),l.setAttribute("width",n.number+n.unit),l.setAttribute("height",r.number+r.unit),s.number===0)return l;let u=new y("mpadded",[l]);return s.number>=0?u.setAttribute("height","+"+s.number+s.unit):(u.setAttribute("height",s.number+s.unit),u.setAttribute("depth","+"+-s.number+s.unit)),u.setAttribute("voffset",s.number+s.unit),u}});var Ro=/^[0-9]$/,gu={0:"\u2080",1:"\u2081",2:"\u2082",3:"\u2083",4:"\u2084",5:"\u2085",6:"\u2086",7:"\u2087",8:"\u2088",9:"\u2089"},bu={0:"\u2070",1:"\xB9",2:"\xB2",3:"\xB3",4:"\u2074",5:"\u2075",6:"\u2076",7:"\u2077",8:"\u2078",9:"\u2079"};D({type:"sfrac",names:["\\sfrac"],props:{numArgs:2,allowedInText:!0,allowedInMath:!0},handler({parser:e},t){let n="";for(let s of t[0].body){if(s.type!=="textord"||!Ro.test(s.text))throw new v("Numerator must be an integer.",s);n+=s.text}let r="";for(let s of t[1].body){if(s.type!=="textord"||!Ro.test(s.text))throw new v("Denominator must be an integer.",s);r+=s.text}return{type:"sfrac",mode:e.mode,numerator:n,denominator:r}},mathmlBuilder(e,t){let n=e.numerator.split("").map(a=>bu[a]).join(""),r=e.denominator.split("").map(a=>gu[a]).join(""),s=new se(n+"\u2044"+r,e.mode,t);return new y("mn",[s],["special-fraction"])}});var qo={"\\tiny":.5,"\\sixptsize":.6,"\\Tiny":.6,"\\scriptsize":.7,"\\footnotesize":.8,"\\small":.9,"\\normalsize":1,"\\large":1.2,"\\Large":1.44,"\\LARGE":1.728,"\\huge":2.074,"\\Huge":2.488};D({type:"sizing",names:["\\tiny","\\sixptsize","\\Tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],props:{numArgs:0,allowedInText:!0},handler:({breakOnTokenText:e,funcName:t,parser:n},r)=>{n.settings.strict&&n.mode==="math"&&console.log(`Temml strict-mode warning: Command ${t} is invalid in math mode.`);let s=n.parseExpression(!1,e,!0);return{type:"sizing",mode:n.mode,funcName:t,body:s}},mathmlBuilder:(e,t)=>{let n=t.withFontSize(qo[e.funcName]),r=he(e.body,n),s=Lr(r),a=(qo[e.funcName]/t.fontSize).toFixed(4);return s.setAttribute("mathsize",a+"em"),s}});D({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:({parser:e},t,n)=>{let r=!1,s=!1,a=n[0]&&P(n[0],"ordgroup");if(a){let u="";for(let c=0;c<a.body.length;++c)if(u=a.body[c].text,u==="t")r=!0;else if(u==="b")s=!0;else{r=!1,s=!1;break}}else r=!0,s=!0;let l=t[0];return{type:"smash",mode:e.mode,body:l,smashHeight:r,smashDepth:s}},mathmlBuilder:(e,t)=>{let n=new y("mpadded",[U(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});var xu=["a","c","e","\u0131","m","n","o","r","s","u","v","w","x","z","\u03B1","\u03B5","\u03B9","\u03BA","\u03BD","\u03BF","\u03C0","\u03C3","\u03C4","\u03C5","\u03C9","\\alpha","\\epsilon","\\iota","\\kappa","\\nu","\\omega","\\pi","\\tau","\\omega"];D({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler({parser:e},t,n){let r=n[0],s=t[0];return s.body&&s.body.length===1&&s.body[0].text&&xu.includes(s.body[0].text)&&s.body.push({type:"rule",mode:"math",shift:null,width:{number:0,unit:"pt"},height:{number:.5,unit:"em"}}),{type:"sqrt",mode:e.mode,body:s,index:r}},mathmlBuilder(e,t){let{body:n,index:r}=e;return r?new y("mroot",[U(n,t),U(r,t.incrementLevel())]):new y("msqrt",[U(n,t)])}});var yu={display:0,text:1,script:2,scriptscript:3},wu={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]};D({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({breakOnTokenText:e,funcName:t,parser:n},r){let s=n.parseExpression(!0,e,!0),a=t.slice(1,t.length-5);return{type:"styling",mode:n.mode,scriptLevel:a,body:s}},mathmlBuilder(e,t){let n=t.withLevel(yu[e.scriptLevel]),r=he(e.body,n),s=Lr(r),a=wu[e.scriptLevel];return s.setAttribute("scriptlevel",a[0]),s.setAttribute("displaystyle",a[1]),s}});var ku=/^m(over|under|underover)$/,Au="DHKLUcegorsuvxyz\u03A0\u03A5\u03A8\u03B1\u03B4\u03B7\u03B9\u03BC\u03BD\u03BF\u03C4\u03C5\u03C7\u03F5",Tu="BCEFGIMNOPQRSTXZlpqtw\u0393\u0398\u039E\u03A3\u03A6\u03A9\u03B2\u03B5\u03B6\u03B8\u03BE\u03C1\u03C2\u03C6\u03C8\u03D1\u03D5\u03F1",vu="AJdf\u0394\u039B";et({type:"supsub",mathmlBuilder(e,t){let n=!1,r,s,a=!1,l=!1,u=!1;e.base&&e.base.type==="horizBracket"&&(s=!!e.sup,s===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&!e.stack&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0,a=!e.base.symbol,l=a&&!e.isFollowedByDelimiter,u=e.base.needsLeadingSpace);let c=e.stack&&e.base.body.length===1?[U(e.base.body[0],t)]:[U(e.base,t)],d=t.inSubOrSup();if(e.sub){let x=U(e.sub,d);t.level===3&&x.setAttribute("scriptlevel","2"),c.push(x)}if(e.sup){let x=U(e.sup,d);if(t.level===3&&x.setAttribute("scriptlevel","2"),e.base&&e.base.text&&e.base.text.length===1){let A=e.base.text;Au.indexOf(A)>-1?x.classes.push("tml-sml-pad"):Tu.indexOf(A)>-1?x.classes.push("tml-med-pad"):vu.indexOf(A)>-1&&x.classes.push("tml-lrg-pad")}c.push(x)}let b;if(n)b=r?"mover":"munder";else if(e.sub)if(e.sup){let x=e.base;x&&(x.type==="op"&&x.limits||x.type==="multiscript")&&(t.level===X.DISPLAY||x.alwaysHandleSupSub)||x&&x.type==="operatorname"&&x.alwaysHandleSupSub&&(t.level===X.DISPLAY||x.limits)?b="munderover":b="msubsup"}else{let x=e.base;e.stack||x&&x.type==="op"&&x.limits&&(t.level===X.DISPLAY||x.alwaysHandleSupSub)||x&&x.type==="operatorname"&&x.alwaysHandleSupSub&&(x.limits||t.level===X.DISPLAY)?b="munder":b="msub"}else{let x=e.base;x&&x.type==="op"&&x.limits&&(t.level===X.DISPLAY||x.alwaysHandleSupSub)||x&&x.type==="operatorname"&&x.alwaysHandleSupSub&&(x.limits||t.level===X.DISPLAY)?b="mover":b="msup"}let f=new y(b,c);if(a){let x=new y("mo",[Te("\u2061","text")]);if(u){let A=new y("mspace");A.setAttribute("width","0.1667em"),f=Je([A,f,x])}else f=Je([f,x]);if(l){let A=new y("mspace");A.setAttribute("width","0.1667em"),f.children.push(A)}}else ku.test(b)&&(f=new y("mrow",[f]));return f}});var Su=["\\shortmid","\\nshortmid","\\shortparallel","\\nshortparallel","\\smallsetminus"],_u=["\\Rsh","\\Lsh","\\restriction"],Eu=e=>{if(e.length===1){let t=e.codePointAt(0);return 8591<t&&t<8704}return e.indexOf("arrow")>-1||e.indexOf("harpoon")>-1||_u.includes(e)};et({type:"atom",mathmlBuilder(e,t){let n=new y("mo",[Te(e.text,e.mode)]);if(e.family==="punct")n.setAttribute("separator","true");else if(e.family==="open"||e.family==="close")e.family==="open"?(n.setAttribute("form","prefix"),n.setAttribute("stretchy","false")):e.family==="close"&&(n.setAttribute("form","postfix"),n.setAttribute("stretchy","false"));else if(e.text==="\\mid")n.setAttribute("lspace","0.22em"),n.setAttribute("rspace","0.22em"),n.setAttribute("stretchy","false");else if(e.family==="rel"&&Eu(e.text))n.setAttribute("stretchy","false");else if(Su.includes(e.text))n.setAttribute("mathsize","70%");else if(e.text===":")n.attributes.lspace="0.2222em",n.attributes.rspace="0.2222em";else if(e.needsSpacing)return e.family==="bin"?new y("mrow",[re(.222),n,re(.222)]):new y("mrow",[re(.2778),n,re(.2778)]);return n}});var Oo={mathbf:"bold",mathrm:"normal",textit:"italic",mathit:"italic",mathnormal:"italic",mathbb:"double-struck",mathcal:"script",mathfrak:"fraktur",mathscr:"script",mathsf:"sans-serif",mathtt:"monospace"},ha=function(e,t){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsc")return"normal";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"sans-serif-bold":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold";let n=t.font;if(!n||n==="mathnormal")return null;let r=e.mode;switch(n){case"mathit":return"italic";case"mathrm":{let a=e.text.codePointAt(0);return 939<a&&a<975?"italic":"normal"}case"greekItalic":return"italic";case"up@greek":return"normal";case"boldsymbol":case"mathboldsymbol":return"bold-italic";case"mathbf":return"bold";case"mathbb":return"double-struck";case"mathfrak":return"fraktur";case"mathscr":case"mathcal":return"script";case"mathsf":return"sans-serif";case"mathsfit":return"sans-serif-italic";case"mathtt":return"monospace"}let s=e.text;return K[r][s]&&K[r][s].replace&&(s=K[r][s].replace),Object.prototype.hasOwnProperty.call(Oo,n)?Oo[n]:null},Mo=Object.freeze({B:8426,E:8427,F:8427,H:8387,I:8391,L:8390,M:8422,R:8393,e:8394,g:8355,o:8389}),Cu=Object.freeze({C:8426,H:8388,I:8392,R:8394,Z:8398}),Du=Object.freeze({C:8383,H:8389,N:8391,P:8393,Q:8393,R:8395,Z:8394}),ma=Object.freeze({"\u03F5":119527,\u03D1:119564,\u03F0:119534,\u03C6:119577,\u03F1:119535,\u03D6:119563}),Lu=Object.freeze({"\u03F5":119643,\u03D1:119680,\u03F0:119650,\u03C6:119693,\u03F1:119651,\u03D6:119679}),$o=Object.freeze({"\u03F5":119701,\u03D1:119738,\u03F0:119708,\u03C6:119751,\u03F1:119709,\u03D6:119737}),Ru=Object.freeze({"\u03F5":119759,\u03D1:119796,\u03F0:119766,\u03C6:119809,\u03F1:119767,\u03D6:119795}),qu=Object.freeze({upperCaseLatin:{normal:e=>0,bold:e=>119743,italic:e=>119795,"bold-italic":e=>119847,script:e=>Mo[e]||119899,"script-bold":e=>119951,fraktur:e=>Cu[e]||120003,"fraktur-bold":e=>120107,"double-struck":e=>Du[e]||120055,"sans-serif":e=>120159,"sans-serif-bold":e=>120211,"sans-serif-italic":e=>120263,"sans-serif-bold-italic":e=>120380,monospace:e=>120367},lowerCaseLatin:{normal:e=>0,bold:e=>119737,italic:e=>e==="h"?8358:119789,"bold-italic":e=>119841,script:e=>Mo[e]||119893,"script-bold":e=>119945,fraktur:e=>119997,"fraktur-bold":e=>120101,"double-struck":e=>120049,"sans-serif":e=>120153,"sans-serif-bold":e=>120205,"sans-serif-italic":e=>120257,"sans-serif-bold-italic":e=>120309,monospace:e=>120361},upperCaseGreek:{normal:e=>0,bold:e=>119575,italic:e=>119633,"bold-italic":e=>119575,script:e=>0,"script-bold":e=>0,fraktur:e=>0,"fraktur-bold":e=>0,"double-struck":e=>0,"sans-serif":e=>119749,"sans-serif-bold":e=>119749,"sans-serif-italic":e=>0,"sans-serif-bold-italic":e=>119807,monospace:e=>0},lowerCaseGreek:{normal:e=>0,bold:e=>119569,italic:e=>119627,"bold-italic":e=>e==="\u03D5"?119678:119685,script:e=>0,"script-bold":e=>0,fraktur:e=>0,"fraktur-bold":e=>0,"double-struck":e=>0,"sans-serif":e=>119743,"sans-serif-bold":e=>119743,"sans-serif-italic":e=>0,"sans-serif-bold-italic":e=>119801,monospace:e=>0},varGreek:{normal:e=>0,bold:e=>ma[e]||-51,italic:e=>0,"bold-italic":e=>Lu[e]||58,script:e=>0,"script-bold":e=>0,fraktur:e=>0,"fraktur-bold":e=>0,"double-struck":e=>0,"sans-serif":e=>$o[e]||116,"sans-serif-bold":e=>$o[e]||116,"sans-serif-italic":e=>0,"sans-serif-bold-italic":e=>Ru[e]||174,monospace:e=>0},numeral:{normal:e=>0,bold:e=>120734,italic:e=>0,"bold-italic":e=>0,script:e=>0,"script-bold":e=>0,fraktur:e=>0,"fraktur-bold":e=>0,"double-struck":e=>120744,"sans-serif":e=>120754,"sans-serif-bold":e=>120764,"sans-serif-italic":e=>0,"sans-serif-bold-italic":e=>0,monospace:e=>120774}}),Dt=(e,t)=>{let n=e.codePointAt(0),r=64<n&&n<91?"upperCaseLatin":96<n&&n<123?"lowerCaseLatin":912<n&&n<938?"upperCaseGreek":944<n&&n<970||e==="\u03D5"?"lowerCaseGreek":120545<n&&n<120572||ma[e]?"varGreek":47<n&&n<58?"numeral":"other";return r==="other"?e:String.fromCodePoint(n+qu[r][t](e))},Ou=Object.freeze({a:"\u1D00",b:"\u0299",c:"\u1D04",d:"\u1D05",e:"\u1D07",f:"\uA730",g:"\u0262",h:"\u029C",i:"\u026A",j:"\u1D0A",k:"\u1D0B",l:"\u029F",m:"\u1D0D",n:"\u0274",o:"\u1D0F",p:"\u1D18",q:"\u01EB",r:"\u0280",s:"s",t:"\u1D1B",u:"\u1D1C",v:"\u1D20",w:"\u1D21",x:"x",y:"\u028F",z:"\u1D22"}),Mu=/^\d(?:[\d,.]*\d)?$/,$u=/[A-Ba-z]/,Iu=new Set(["\\prime","\\dprime","\\trprime","\\qprime","\\backprime","\\backdprime","\\backtrprime"]),Bu=(e,t,n)=>{let r=new y(n,[e]),s=new y("mstyle",[r]);return s.style["font-style"]="italic",s.style["font-family"]="Cambria, 'Times New Roman', serif",t==="bold-italic"&&(s.style["font-weight"]="bold"),s};et({type:"mathord",mathmlBuilder(e,t){let n=Te(e.text,e.mode,t),r=n.text.codePointAt(0),s=912<r&&r<938?"normal":"italic",a=ha(e,t)||s;if(a==="script")return n.text=Dt(n.text,a),new y("mi",[n],[t.font]);a!=="italic"&&(n.text=Dt(n.text,a));let l=new y("mi",[n]);if(a==="normal"&&(l.setAttribute("mathvariant","normal"),n.text.length===1)){let u=new y("mspace",[]);l=new y("mrow",[l,u])}return l}});et({type:"textord",mathmlBuilder(e,t){let n=e.text,r=n.codePointAt(0);t.fontFamily==="textsc"&&96<r&&r<123&&(n=Ou[n]);let s=Te(n,e.mode,t),a=ha(e,t)||"normal",l;if(Mu.test(e.text)){let u=e.mode==="text"?"mtext":"mn";if(a==="italic"||a==="bold-italic")return Bu(s,a,u);a!=="normal"&&(s.text=s.text.split("").map(c=>Dt(c,a)).join("")),l=new y(u,[s])}else if(e.mode==="text")a!=="normal"&&(s.text=Dt(s.text,a)),l=new y("mtext",[s]);else if(Iu.has(e.text))l=new y("mo",[s]),l.classes.push("tml-prime");else{let u=s.text;a!=="italic"&&(s.text=Dt(s.text,a)),l=new y("mi",[s]),s.text===u&&$u.test(u)&&l.setAttribute("mathvariant","italic")}return l}});var Nu={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Pu={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};et({type:"spacing",mathmlBuilder(e,t){let n;if(Object.prototype.hasOwnProperty.call(Pu,e.text))n=new y("mtext",[new se("\xA0")]);else if(Object.prototype.hasOwnProperty.call(Nu,e.text))n=new y("mo"),e.text==="\\nobreak"&&n.setAttribute("linebreak","nobreak");else throw new v(`Unknown type of space "${e.text}"`);return n}});et({type:"tag"});var Io={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm","\\textsc":"textsc"},Bo={"\\textbf":"textbf","\\textmd":"textmd"},zu={"\\textit":"textit","\\textup":"textup"},Fu=(e,t)=>{let n=e.font;if(n){if(Io[n])return t.withTextFontFamily(Io[n]);if(Bo[n])return t.withTextFontWeight(Bo[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(zu[n])};D({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textsc","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler({parser:e,funcName:t},n){let r=n[0];return{type:"text",mode:e.mode,body:ae(r),font:t}},mathmlBuilder(e,t){let n=Fu(e,t),r=je(e.body,n);return An(r)}});D({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler({parser:e},t){return{type:"vcenter",mode:e.mode,body:t[0]}},mathmlBuilder(e,t){let n=new y("mtd",[U(e.body,t)]);n.style.padding="0";let r=new y("mtr",[n]);return new y("mtable",[r])}});D({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new v("\\verb ended by end of line instead of matching delimiter")},mathmlBuilder(e,t){let n=new se(Gu(e)),r=new y("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var Gu=e=>e.body.replace(/ /g,e.star?"\u2423":"\xA0"),Qe=Ho,fa=`[ \r
159
+ ]`,Hu="\\\\[a-zA-Z@]+",Uu="\\\\[^\uD800-\uDFFF]",ju=`(${Hu})${fa}*`,Wu=`\\\\(
160
+ |[ \r ]+
161
+ ?)[ \r ]*`,Sr="[\u0300-\u036F]",No=new RegExp(`${Sr}+$`),Vu=`(${fa}+)|${Wu}|([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]${Sr}*|[\uD800-\uDBFF][\uDC00-\uDFFF]${Sr}*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|${ju}|${Uu})`,wn=class{constructor(t,n){this.input=t,this.settings=n,this.tokenRegex=new RegExp(Vu,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){let t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new Le("EOF",new we(this,n,n));let r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new v(`Unexpected character: '${t[n]}'`,new Le(t[n],new we(this,n,n+1)));let s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){let a=t.indexOf(`
162
+ `,this.tokenRegex.lastIndex);if(a===-1){if(this.tokenRegex.lastIndex=t.length,this.settings.strict)throw new v("% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode")}else this.tokenRegex.lastIndex=a+1;return this.lex()}return new Le(s,new we(this,n,this.tokenRegex.lastIndex))}},_r=class{constructor(t={},n={}){this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new v("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");let t=this.undefStack.pop();for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]===void 0?delete this.current[n]:this.current[n]=t[n])}has(t){return Object.prototype.hasOwnProperty.call(this.current,t)||Object.prototype.hasOwnProperty.call(this.builtins,t)}get(t){return Object.prototype.hasOwnProperty.call(this.current,t)?this.current[t]:this.builtins[t]}set(t,n,r=!1){if(r){for(let s=0;s<this.undefStack.length;s++)delete this.undefStack[s][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{let s=this.undefStack[this.undefStack.length-1];s&&!Object.prototype.hasOwnProperty.call(s,t)&&(s[t]=this.current[t])}this.current[t]=n}},ga={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Er=class{constructor(t,n,r){this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new _r(jl,n.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new wn(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){let n,r,s;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:n,end:r}=this.consumeArg());return this.pushToken(new Le("EOF",r.loc)),this.pushTokens(s),n.range(r,"")}consumeSpaces(){for(;this.future().text===" ";)this.stack.pop()}consumeArg(t){let n=[],r=t&&t.length>0;r||this.consumeSpaces();let s=this.future(),a,l=0,u=0;do{if(a=this.popToken(),n.push(a),a.text==="{")++l;else if(a.text==="}"){if(--l,l===-1)throw new v("Extra }",a)}else if(a.text==="EOF")throw new v("Unexpected end of input in a macro argument, expected '"+(t&&r?t[u]:"}")+"'",a);if(t&&r)if((l===0||l===1&&t[u]==="{")&&a.text===t[u]){if(++u,u===t.length){n.splice(-u,u);break}}else u=0}while(l!==0||r);return s.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:s,end:a}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new v("The length of delimiters doesn't match the number of args!");let s=n[0];for(let a=0;a<s.length;a++){let l=this.popToken();if(s[a]!==l.text)throw new v("Use of the macro doesn't match its definition",l)}}let r=[];for(let s=0;s<t;s++)r.push(this.consumeArg(n&&n[s+1]).tokens);return r}expandOnce(t){let n=this.popToken(),r=n.text,s=n.noexpand?null:this._getExpansion(r);if(s==null||t&&s.unexpandable){if(t&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new v("Undefined control sequence: "+r);return this.pushToken(n),!1}if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new v("Too many expansions: infinite loop or need to increase maxExpand setting");let a=s.tokens,l=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){a=a.slice();for(let u=a.length-1;u>=0;--u){let c=a[u];if(c.text==="#"){if(u===0)throw new v("Incomplete placeholder at end of macro body",c);if(c=a[--u],c.text==="#")a.splice(u+1,1);else if(/^[1-9]$/.test(c.text))a.splice(u,2,...l[+c.text-1]);else throw new v("Not a valid argument number",c)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){let t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}throw new Error}expandMacro(t){return this.macros.has(t)?this.expandTokens([new Le(t)]):void 0}expandTokens(t){let n=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(this.expandOnce(!0)===!1){let s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),n.push(s)}return n}expandMacroAsText(t){let n=this.expandMacro(t);return n&&n.map(r=>r.text).join("")}_getExpansion(t){let n=this.macros.get(t);if(n==null)return n;if(t.length===1){let s=this.lexer.catcodes[t];if(s!=null&&s!==13)return}let r=typeof n=="function"?n(this):n;if(typeof r=="string"){let s=0;if(r.indexOf("#")!==-1){let d=r.replace(/##/g,"");for(;d.indexOf("#"+(s+1))!==-1;)++s}let a=new wn(r,this.settings),l=[],u=a.lex();for(;u.text!=="EOF";)l.push(u),u=a.lex();return l.reverse(),{tokens:l,numArgs:s}}return r}isDefined(t){return this.macros.has(t)||Object.prototype.hasOwnProperty.call(Qe,t)||Object.prototype.hasOwnProperty.call(K.math,t)||Object.prototype.hasOwnProperty.call(K.text,t)||Object.prototype.hasOwnProperty.call(ga,t)}isExpandable(t){let n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Object.prototype.hasOwnProperty.call(Qe,t)&&!Qe[t].primitive}},Po=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,dn=Object.freeze({"\u208A":"+","\u208B":"-","\u208C":"=","\u208D":"(","\u208E":")","\u2080":"0","\u2081":"1","\u2082":"2","\u2083":"3","\u2084":"4","\u2085":"5","\u2086":"6","\u2087":"7","\u2088":"8","\u2089":"9","\u2090":"a","\u2091":"e","\u2095":"h","\u1D62":"i","\u2C7C":"j","\u2096":"k","\u2097":"l","\u2098":"m","\u2099":"n","\u2092":"o","\u209A":"p","\u1D63":"r","\u209B":"s","\u209C":"t","\u1D64":"u","\u1D65":"v","\u2093":"x","\u1D66":"\u03B2","\u1D67":"\u03B3","\u1D68":"\u03C1","\u1D69":"\u03D5","\u1D6A":"\u03C7","\u207A":"+","\u207B":"-","\u207C":"=","\u207D":"(","\u207E":")","\u2070":"0","\xB9":"1","\xB2":"2","\xB3":"3","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u1D2C":"A","\u1D2E":"B","\u1D30":"D","\u1D31":"E","\u1D33":"G","\u1D34":"H","\u1D35":"I","\u1D36":"J","\u1D37":"K","\u1D38":"L","\u1D39":"M","\u1D3A":"N","\u1D3C":"O","\u1D3E":"P","\u1D3F":"R","\u1D40":"T","\u1D41":"U","\u2C7D":"V","\u1D42":"W","\u1D43":"a","\u1D47":"b","\u1D9C":"c","\u1D48":"d","\u1D49":"e","\u1DA0":"f","\u1D4D":"g",\u02B0:"h","\u2071":"i",\u02B2:"j","\u1D4F":"k",\u02E1:"l","\u1D50":"m",\u207F:"n","\u1D52":"o","\u1D56":"p",\u02B3:"r",\u02E2:"s","\u1D57":"t","\u1D58":"u","\u1D5B":"v",\u02B7:"w",\u02E3:"x",\u02B8:"y","\u1DBB":"z","\u1D5D":"\u03B2","\u1D5E":"\u03B3","\u1D5F":"\u03B4","\u1D60":"\u03D5","\u1D61":"\u03C7","\u1DBF":"\u03B8"}),zo=Object.freeze({"\u{1D49C}":"A",\u212C:"B","\u{1D49E}":"C","\u{1D49F}":"D",\u2130:"E",\u2131:"F","\u{1D4A2}":"G",\u210B:"H",\u2110:"I","\u{1D4A5}":"J","\u{1D4A6}":"K",\u2112:"L",\u2133:"M","\u{1D4A9}":"N","\u{1D4AA}":"O","\u{1D4AB}":"P","\u{1D4AC}":"Q",\u211B:"R","\u{1D4AE}":"S","\u{1D4AF}":"T","\u{1D4B0}":"U","\u{1D4B1}":"V","\u{1D4B2}":"W","\u{1D4B3}":"X","\u{1D4B4}":"Y","\u{1D4B5}":"Z"}),gr={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030C":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030A":{text:"\\r",math:"\\mathring"},"\u030B":{text:"\\H"},"\u0327":{text:"\\c"}},Fo={\u00E1:"a\u0301",\u00E0:"a\u0300",\u00E4:"a\u0308",\u01DF:"a\u0308\u0304",\u00E3:"a\u0303",\u0101:"a\u0304",\u0103:"a\u0306",\u1EAF:"a\u0306\u0301",\u1EB1:"a\u0306\u0300",\u1EB5:"a\u0306\u0303",\u01CE:"a\u030C",\u00E2:"a\u0302",\u1EA5:"a\u0302\u0301",\u1EA7:"a\u0302\u0300",\u1EAB:"a\u0302\u0303",\u0227:"a\u0307",\u01E1:"a\u0307\u0304",\u00E5:"a\u030A",\u01FB:"a\u030A\u0301",\u1E03:"b\u0307",\u0107:"c\u0301",\u010D:"c\u030C",\u0109:"c\u0302",\u010B:"c\u0307",\u010F:"d\u030C",\u1E0B:"d\u0307",\u00E9:"e\u0301",\u00E8:"e\u0300",\u00EB:"e\u0308",\u1EBD:"e\u0303",\u0113:"e\u0304",\u1E17:"e\u0304\u0301",\u1E15:"e\u0304\u0300",\u0115:"e\u0306",\u011B:"e\u030C",\u00EA:"e\u0302",\u1EBF:"e\u0302\u0301",\u1EC1:"e\u0302\u0300",\u1EC5:"e\u0302\u0303",\u0117:"e\u0307",\u1E1F:"f\u0307",\u01F5:"g\u0301",\u1E21:"g\u0304",\u011F:"g\u0306",\u01E7:"g\u030C",\u011D:"g\u0302",\u0121:"g\u0307",\u1E27:"h\u0308",\u021F:"h\u030C",\u0125:"h\u0302",\u1E23:"h\u0307",\u00ED:"i\u0301",\u00EC:"i\u0300",\u00EF:"i\u0308",\u1E2F:"i\u0308\u0301",\u0129:"i\u0303",\u012B:"i\u0304",\u012D:"i\u0306",\u01D0:"i\u030C",\u00EE:"i\u0302",\u01F0:"j\u030C",\u0135:"j\u0302",\u1E31:"k\u0301",\u01E9:"k\u030C",\u013A:"l\u0301",\u013E:"l\u030C",\u1E3F:"m\u0301",\u1E41:"m\u0307",\u0144:"n\u0301",\u01F9:"n\u0300",\u00F1:"n\u0303",\u0148:"n\u030C",\u1E45:"n\u0307",\u00F3:"o\u0301",\u00F2:"o\u0300",\u00F6:"o\u0308",\u022B:"o\u0308\u0304",\u00F5:"o\u0303",\u1E4D:"o\u0303\u0301",\u1E4F:"o\u0303\u0308",\u022D:"o\u0303\u0304",\u014D:"o\u0304",\u1E53:"o\u0304\u0301",\u1E51:"o\u0304\u0300",\u014F:"o\u0306",\u01D2:"o\u030C",\u00F4:"o\u0302",\u1ED1:"o\u0302\u0301",\u1ED3:"o\u0302\u0300",\u1ED7:"o\u0302\u0303",\u022F:"o\u0307",\u0231:"o\u0307\u0304",\u0151:"o\u030B",\u1E55:"p\u0301",\u1E57:"p\u0307",\u0155:"r\u0301",\u0159:"r\u030C",\u1E59:"r\u0307",\u015B:"s\u0301",\u1E65:"s\u0301\u0307",\u0161:"s\u030C",\u1E67:"s\u030C\u0307",\u015D:"s\u0302",\u1E61:"s\u0307",\u1E97:"t\u0308",\u0165:"t\u030C",\u1E6B:"t\u0307",\u00FA:"u\u0301",\u00F9:"u\u0300",\u00FC:"u\u0308",\u01D8:"u\u0308\u0301",\u01DC:"u\u0308\u0300",\u01D6:"u\u0308\u0304",\u01DA:"u\u0308\u030C",\u0169:"u\u0303",\u1E79:"u\u0303\u0301",\u016B:"u\u0304",\u1E7B:"u\u0304\u0308",\u016D:"u\u0306",\u01D4:"u\u030C",\u00FB:"u\u0302",\u016F:"u\u030A",\u0171:"u\u030B",\u1E7D:"v\u0303",\u1E83:"w\u0301",\u1E81:"w\u0300",\u1E85:"w\u0308",\u0175:"w\u0302",\u1E87:"w\u0307",\u1E98:"w\u030A",\u1E8D:"x\u0308",\u1E8B:"x\u0307",\u00FD:"y\u0301",\u1EF3:"y\u0300",\u00FF:"y\u0308",\u1EF9:"y\u0303",\u0233:"y\u0304",\u0177:"y\u0302",\u1E8F:"y\u0307",\u1E99:"y\u030A",\u017A:"z\u0301",\u017E:"z\u030C",\u1E91:"z\u0302",\u017C:"z\u0307",\u00C1:"A\u0301",\u00C0:"A\u0300",\u00C4:"A\u0308",\u01DE:"A\u0308\u0304",\u00C3:"A\u0303",\u0100:"A\u0304",\u0102:"A\u0306",\u1EAE:"A\u0306\u0301",\u1EB0:"A\u0306\u0300",\u1EB4:"A\u0306\u0303",\u01CD:"A\u030C",\u00C2:"A\u0302",\u1EA4:"A\u0302\u0301",\u1EA6:"A\u0302\u0300",\u1EAA:"A\u0302\u0303",\u0226:"A\u0307",\u01E0:"A\u0307\u0304",\u00C5:"A\u030A",\u01FA:"A\u030A\u0301",\u1E02:"B\u0307",\u0106:"C\u0301",\u010C:"C\u030C",\u0108:"C\u0302",\u010A:"C\u0307",\u010E:"D\u030C",\u1E0A:"D\u0307",\u00C9:"E\u0301",\u00C8:"E\u0300",\u00CB:"E\u0308",\u1EBC:"E\u0303",\u0112:"E\u0304",\u1E16:"E\u0304\u0301",\u1E14:"E\u0304\u0300",\u0114:"E\u0306",\u011A:"E\u030C",\u00CA:"E\u0302",\u1EBE:"E\u0302\u0301",\u1EC0:"E\u0302\u0300",\u1EC4:"E\u0302\u0303",\u0116:"E\u0307",\u1E1E:"F\u0307",\u01F4:"G\u0301",\u1E20:"G\u0304",\u011E:"G\u0306",\u01E6:"G\u030C",\u011C:"G\u0302",\u0120:"G\u0307",\u1E26:"H\u0308",\u021E:"H\u030C",\u0124:"H\u0302",\u1E22:"H\u0307",\u00CD:"I\u0301",\u00CC:"I\u0300",\u00CF:"I\u0308",\u1E2E:"I\u0308\u0301",\u0128:"I\u0303",\u012A:"I\u0304",\u012C:"I\u0306",\u01CF:"I\u030C",\u00CE:"I\u0302",\u0130:"I\u0307",\u0134:"J\u0302",\u1E30:"K\u0301",\u01E8:"K\u030C",\u0139:"L\u0301",\u013D:"L\u030C",\u1E3E:"M\u0301",\u1E40:"M\u0307",\u0143:"N\u0301",\u01F8:"N\u0300",\u00D1:"N\u0303",\u0147:"N\u030C",\u1E44:"N\u0307",\u00D3:"O\u0301",\u00D2:"O\u0300",\u00D6:"O\u0308",\u022A:"O\u0308\u0304",\u00D5:"O\u0303",\u1E4C:"O\u0303\u0301",\u1E4E:"O\u0303\u0308",\u022C:"O\u0303\u0304",\u014C:"O\u0304",\u1E52:"O\u0304\u0301",\u1E50:"O\u0304\u0300",\u014E:"O\u0306",\u01D1:"O\u030C",\u00D4:"O\u0302",\u1ED0:"O\u0302\u0301",\u1ED2:"O\u0302\u0300",\u1ED6:"O\u0302\u0303",\u022E:"O\u0307",\u0230:"O\u0307\u0304",\u0150:"O\u030B",\u1E54:"P\u0301",\u1E56:"P\u0307",\u0154:"R\u0301",\u0158:"R\u030C",\u1E58:"R\u0307",\u015A:"S\u0301",\u1E64:"S\u0301\u0307",\u0160:"S\u030C",\u1E66:"S\u030C\u0307",\u015C:"S\u0302",\u1E60:"S\u0307",\u0164:"T\u030C",\u1E6A:"T\u0307",\u00DA:"U\u0301",\u00D9:"U\u0300",\u00DC:"U\u0308",\u01D7:"U\u0308\u0301",\u01DB:"U\u0308\u0300",\u01D5:"U\u0308\u0304",\u01D9:"U\u0308\u030C",\u0168:"U\u0303",\u1E78:"U\u0303\u0301",\u016A:"U\u0304",\u1E7A:"U\u0304\u0308",\u016C:"U\u0306",\u01D3:"U\u030C",\u00DB:"U\u0302",\u016E:"U\u030A",\u0170:"U\u030B",\u1E7C:"V\u0303",\u1E82:"W\u0301",\u1E80:"W\u0300",\u1E84:"W\u0308",\u0174:"W\u0302",\u1E86:"W\u0307",\u1E8C:"X\u0308",\u1E8A:"X\u0307",\u00DD:"Y\u0301",\u1EF2:"Y\u0300",\u0178:"Y\u0308",\u1EF8:"Y\u0303",\u0232:"Y\u0304",\u0176:"Y\u0302",\u1E8E:"Y\u0307",\u0179:"Z\u0301",\u017D:"Z\u030C",\u1E90:"Z\u0302",\u017B:"Z\u0307",\u03AC:"\u03B1\u0301",\u1F70:"\u03B1\u0300",\u1FB1:"\u03B1\u0304",\u1FB0:"\u03B1\u0306",\u03AD:"\u03B5\u0301",\u1F72:"\u03B5\u0300",\u03AE:"\u03B7\u0301",\u1F74:"\u03B7\u0300",\u03AF:"\u03B9\u0301",\u1F76:"\u03B9\u0300",\u03CA:"\u03B9\u0308",\u0390:"\u03B9\u0308\u0301",\u1FD2:"\u03B9\u0308\u0300",\u1FD1:"\u03B9\u0304",\u1FD0:"\u03B9\u0306",\u03CC:"\u03BF\u0301",\u1F78:"\u03BF\u0300",\u03CD:"\u03C5\u0301",\u1F7A:"\u03C5\u0300",\u03CB:"\u03C5\u0308",\u03B0:"\u03C5\u0308\u0301",\u1FE2:"\u03C5\u0308\u0300",\u1FE1:"\u03C5\u0304",\u1FE0:"\u03C5\u0306",\u03CE:"\u03C9\u0301",\u1F7C:"\u03C9\u0300",\u038E:"\u03A5\u0301",\u1FEA:"\u03A5\u0300",\u03AB:"\u03A5\u0308",\u1FE9:"\u03A5\u0304",\u1FE8:"\u03A5\u0306",\u038F:"\u03A9\u0301",\u1FFA:"\u03A9\u0300"},Zu=["bin","op","open","punct","rel"],Xu=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/,Yu=/^ *\\text/,$t=class e{constructor(t,n,r=!1){this.mode="math",this.gullet=new Er(t,n,this.mode),this.settings=n,this.isPreamble=r,this.leftrightDepth=0,this.prevAtomType=""}expect(t,n=!0){if(this.fetch().text!==t)throw new v(`Expected '${t}', got '${this.fetch().text}'`,this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");let t=this.parseExpression(!1);if(this.expect("EOF"),this.isPreamble){let r=Object.create(null);return Object.entries(this.gullet.macros.current).forEach(([s,a])=>{r[s]=a}),this.gullet.endGroup(),r}let n=this.gullet.macros.get("\\df@tag");return this.gullet.endGroup(),n&&(this.gullet.macros.current["\\df@tag"]=n),t}static get endOfExpression(){return["}","\\endgroup","\\end","\\right","\\endtoggle","&"]}subparse(t){let n=this.nextToken;this.consume(),this.gullet.pushToken(new Le("}")),this.gullet.pushTokens(t);let r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(t,n,r){let s=[];for(this.prevAtomType="";;){this.mode==="math"&&this.consumeSpaces();let a=this.fetch();if(e.endOfExpression.indexOf(a.text)!==-1||n&&a.text===n||r&&a.text==="\\middle"||t&&Qe[a.text]&&Qe[a.text].infix)break;let l=this.parseAtom(n);if(l){if(l.type==="internal")continue}else break;s.push(l),this.prevAtomType=l.type==="atom"?l.family:l.type}return this.mode==="text"&&this.formLigatures(s),this.handleInfixNodes(s)}handleInfixNodes(t){let n=-1,r;for(let s=0;s<t.length;s++)if(t[s].type==="infix"){if(n!==-1)throw new v("only one infix operator per group",t[s].token);n=s,r=t[s].replaceWith}if(n!==-1&&r){let s,a,l=t.slice(0,n),u=t.slice(n+1);l.length===1&&l[0].type==="ordgroup"?s=l[0]:s={type:"ordgroup",mode:this.mode,body:l},u.length===1&&u[0].type==="ordgroup"?a=u[0]:a={type:"ordgroup",mode:this.mode,body:u};let c;return r==="\\\\abovefrac"?c=this.callFunction(r,[s,t[n],a],[]):c=this.callFunction(r,[s,a],[]),[c]}else return t}handleSupSubscript(t){let n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();let s;do s=this.parseGroup(t);while(s.type&&s.type==="internal");if(!s)throw new v("Expected group after '"+r+"'",n);return s}formatUnsupportedCmd(t){let n=[];for(let a=0;a<t.length;a++)n.push({type:"textord",mode:"text",text:t[a]});let r={type:"text",mode:this.mode,body:n};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(t){let n=this.parseGroup("atom",t);if(n&&n.type==="internal"||this.mode==="text")return n;let r,s;for(;;){this.consumeSpaces();let a=this.fetch();if(a.text==="\\limits"||a.text==="\\nolimits"){if(n&&n.type==="op"){let l=a.text==="\\limits";n.limits=l,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=a.text==="\\limits");else throw new v("Limit controls must follow a math operator",a);this.consume()}else if(a.text==="^"){if(r)throw new v("Double superscript",a);r=this.handleSupSubscript("superscript")}else if(a.text==="_"){if(s)throw new v("Double subscript",a);s=this.handleSupSubscript("subscript")}else if(a.text==="'"){if(r)throw new v("Double superscript",a);let l={type:"textord",mode:this.mode,text:"\\prime"},u=[l];for(this.consume();this.fetch().text==="'";)u.push(l),this.consume();this.fetch().text==="^"&&u.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:u}}else if(dn[a.text]){let l=Po.test(a.text),u=[];for(u.push(new Le(dn[a.text])),this.consume();;){let d=this.fetch().text;if(!dn[d]||Po.test(d)!==l)break;u.unshift(new Le(dn[d])),this.consume()}let c=this.subparse(u);l?s={type:"ordgroup",mode:"math",body:c}:r={type:"ordgroup",mode:"math",body:c}}else break}if(r||s){if(n&&n.type==="multiscript"&&!n.postscripts)return n.postscripts={sup:r,sub:s},n;{let a=!n||n.type!=="op"&&n.type!=="operatorname"?void 0:vn(this.nextToken.text);return{type:"supsub",mode:this.mode,base:n,sup:r,sub:s,isFollowedByDelimiter:a}}}else return n}parseFunction(t,n){let r=this.fetch(),s=r.text,a=Qe[s];if(!a)return null;if(this.consume(),n&&n!=="atom"&&!a.allowedInArgument)throw new v("Got function '"+s+"' with no arguments"+(n?" as "+n:""),r);if(this.mode==="text"&&!a.allowedInText)throw new v("Can't use function '"+s+"' in text mode",r);if(this.mode==="math"&&a.allowedInMath===!1)throw new v("Can't use function '"+s+"' in math mode",r);let l=this.prevAtomType,{args:u,optArgs:c}=this.parseArguments(s,a);return this.prevAtomType=l,this.callFunction(s,u,c,r,t)}callFunction(t,n,r,s,a){let l={funcName:t,parser:this,token:s,breakOnTokenText:a},u=Qe[t];if(u&&u.handler)return u.handler(l,n,r);throw new v(`No function handler for ${t}`)}parseArguments(t,n){let r=n.numArgs+n.numOptionalArgs;if(r===0)return{args:[],optArgs:[]};let s=[],a=[];for(let l=0;l<r;l++){let u=n.argTypes&&n.argTypes[l],c=l<n.numOptionalArgs;(n.primitive&&u==null||n.type==="sqrt"&&l===1&&a[0]==null)&&(u="primitive");let d=this.parseGroupOfType(`argument to '${t}'`,u,c);if(c)a.push(d);else if(d!=null)s.push(d);else throw new v("Null argument, please report this as a bug")}return{args:s,optArgs:a}}parseGroupOfType(t,n,r){switch(n){case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,n);case"hbox":{let s=this.parseArgumentGroup(r,"text");return s!=null?{type:"styling",mode:s.mode,body:[s],scriptLevel:"text"}:null}case"raw":{let s=this.parseStringGroup("raw",r);return s!=null?{type:"raw",mode:"text",string:s.text}:null}case"primitive":{if(r)throw new v("A primitive argument cannot be optional");let s=this.parseGroup(t);if(s==null)throw new v("Expected group as "+t,this.fetch());return s}case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new v("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;;){let t=this.fetch().text;if(t===" "||t==="\xA0"||t==="\uFE0E")this.consume();else break}}parseStringGroup(t,n){let r=this.gullet.scanArgument(n);if(r==null)return null;let s="",a;for(;(a=this.fetch()).text!=="EOF";)s+=a.text,this.consume();return this.consume(),r.text=s,r}parseRegexGroup(t,n){let r=this.fetch(),s=r,a="",l;for(;(l=this.fetch()).text!=="EOF"&&t.test(a+l.text);)s=l,a+=s.text,this.consume();if(a==="")throw new v("Invalid "+n+": '"+r.text+"'",r);return r.range(s,a)}parseSizeGroup(t){let n,r=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",t),!n)return null;!t&&n.text.length===0&&(n.text="0pt",r=!0);let s=Xu.exec(n.text);if(!s)throw new v("Invalid size: '"+n.text+"'",n);let a={number:+(s[1]+s[2]),unit:s[3]};if(!Wo(a))throw new v("Invalid unit: '"+a.unit+"'",n);return{type:"size",mode:this.mode,value:a,isBlank:r}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);let n=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;let r=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return r=n.text.replace(/{\u2044}/g,"/"),{type:"url",mode:this.mode,url:r}}parseArgumentGroup(t,n){let r=this.gullet.scanArgument(t);if(r==null)return null;let s=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();let a=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();let l={type:"ordgroup",mode:this.mode,loc:r.loc,body:a};return n&&this.switchMode(s),l}parseGroup(t,n){let r=this.fetch(),s=r.text;if(t==="argument to '\\left'")return this.parseSymbol();let a;if(s==="{"||s==="\\begingroup"||s==="\\toggle"){this.consume();let l=s==="{"?"}":s==="\\begingroup"?"\\endgroup":"\\endtoggle";this.gullet.beginGroup();let u=this.parseExpression(!1,l),c=this.fetch();this.expect(l),this.gullet.endGroup(),a={type:c.text==="\\endtoggle"?"toggle":"ordgroup",mode:this.mode,loc:we.range(r,c),body:u,semisimple:s==="\\begingroup"||void 0}}else if(a=this.parseFunction(n,t)||this.parseSymbol(),a==null&&s[0]==="\\"&&!Object.prototype.hasOwnProperty.call(ga,s)){if(this.settings.throwOnError)throw new v("Unsupported function name: "+s,r);a=this.formatUnsupportedCmd(s),this.consume()}return a}formLigatures(t){let n=t.length-1;for(let r=0;r<n;++r){let s=t[r],a=s.text;a==="-"&&t[r+1].text==="-"&&(r+1<n&&t[r+2].text==="-"?(t.splice(r,3,{type:"textord",mode:"text",loc:we.range(s,t[r+2]),text:"---"}),n-=2):(t.splice(r,2,{type:"textord",mode:"text",loc:we.range(s,t[r+1]),text:"--"}),n-=1)),(a==="'"||a==="`")&&t[r+1].text===a&&(t.splice(r,2,{type:"textord",mode:"text",loc:we.range(s,t[r+1]),text:a+a}),n-=1)}}parseSymbol(){let t=this.fetch(),n=t.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();let a=n.slice(5),l=a.charAt(0)==="*";if(l&&(a=a.slice(1)),a.length<2||a.charAt(0)!==a.slice(-1))throw new v(`\\verb assertion failed --
163
+ please report what input caused this bug`);return a=a.slice(1,-1),{type:"verb",mode:"text",body:a,star:l}}if(Object.prototype.hasOwnProperty.call(Fo,n[0])&&this.mode==="math"&&!K[this.mode][n[0]]){if(this.settings.strict&&this.mode==="math")throw new v(`Accented Unicode text character "${n[0]}" used in math mode`,t);n=Fo[n[0]]+n.slice(1)}let r=this.mode==="math"?No.exec(n):null;r&&(n=n.substring(0,r.index),n==="i"?n="\u0131":n==="j"&&(n="\u0237"));let s;if(K[this.mode][n]){let a=K[this.mode][n].group;a==="bin"&&(Zu.includes(this.prevAtomType)||this.prevAtomType==="")&&(a="open");let l=we.range(t),u;if(Object.prototype.hasOwnProperty.call(_l,a)){let c=a;u={type:"atom",mode:this.mode,family:c,loc:l,text:n},(c==="rel"||c==="bin")&&this.prevAtomType==="text"&&Yu.test(l.lexer.input.slice(l.end))&&(u.needsSpacing=!0)}else{if(zo[n]){this.consume();let c=this.fetch().text.charCodeAt(0),d=c===65025?"mathscr":"mathcal";return(c===65024||c===65025)&&this.consume(),{type:"font",mode:"math",font:d,body:{type:"mathord",mode:"math",loc:l,text:zo[n]}}}u={type:a,mode:this.mode,loc:l,text:n}}s=u}else if(n.charCodeAt(0)>=128||No.exec(n)){if(this.settings.strict&&this.mode==="math")throw new v(`Unicode text character "${n[0]}" used in math mode`,t);s={type:"textord",mode:"text",loc:we.range(t),text:n}}else return null;if(this.consume(),r)for(let a=0;a<r[0].length;a++){let l=r[0][a];if(!gr[l])throw new v(`Unknown accent ' ${l}'`,t);let u=gr[l][this.mode]||gr[l].text;if(!u)throw new v(`Accent ${l} unsupported in ${this.mode} mode`,t);s={type:"accent",mode:this.mode,loc:we.range(t),label:u,isStretchy:!1,base:s}}return s}},ba=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("Temml can only parse string typed expression");let n,r;try{r=new $t(e,t),delete r.gullet.macros.current["\\df@tag"],n=r.parse()}catch(s){if(s.toString()==="ParseError: Unmatched delimiter")t.wrapDelimiterPairs=!1,r=new $t(e,t),delete r.gullet.macros.current["\\df@tag"],n=r.parse();else throw s}if(!(n.length>0&&n[0].type&&n[0].type==="array"&&n[0].addEqnNum)&&r.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new v("\\tag works only in display mode");r.gullet.feed("\\df@tag"),n=[{type:"tag",mode:"text",body:n,tag:r.parse()}]}return n},Ku=[2,2,3,3],Cr=class e{constructor(t){this.level=t.level,this.color=t.color,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontSize=t.fontSize||1,this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.maxSize=t.maxSize}extend(t){let n={level:this.level,color:this.color,font:this.font,fontFamily:this.fontFamily,fontSize:this.fontSize,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return new e(n)}withLevel(t){return this.extend({level:t})}incrementLevel(){return this.extend({level:Math.min(this.level+1,3)})}inSubOrSup(){return this.extend({level:Ku[this.level]})}withColor(t){return this.extend({color:t})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withFontSize(t){return this.extend({fontSize:t})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}getColor(){return this.color}},Qu="0.13.02";function xa(e){let t={},n=0,r=document.getElementsByClassName("tml-eqn");for(let l of r)for(n+=1,l.setAttribute("id","tml-eqn-"+String(n));l.tagName!=="mtable";)if(l.getElementsByClassName("tml-label").length>0){let c=l.attributes.id.value;t[c]=String(n);break}else l=l.parentElement;let s=document.getElementsByClassName("tml-tageqn");for(let l of s)if(l.getElementsByClassName("tml-label").length>0){let c=l.getElementsByClassName("tml-tag");if(c.length>0){let d=l.attributes.id.value;t[d]=c[0].textContent}}[...e.getElementsByClassName("tml-ref")].forEach(l=>{let u=l.getAttribute("href"),c=t[u.slice(1)];l.className.indexOf("tml-eqref")===-1?(c=c.replace(/^\(/,""),c=c.replace(/\)$/,"")):(c.charAt(0)!=="("&&(c="("+c),c.slice(-1)!==")"&&(c=c+")"));let d=document.createElementNS("http://www.w3.org/1998/Math/MathML","mtext");d.appendChild(document.createTextNode(c));let b=document.createElementNS("http://www.w3.org/1998/Math/MathML","math");b.appendChild(d),l.textContent="",l.appendChild(b)})}var Ju=function(e,t,n){let r=n,s=0,a=e.length;for(;r<t.length;){let l=t[r];if(s<=0&&t.slice(r,r+a)===e)return r;l==="\\"?r++:l==="{"?s++:l==="}"&&s--,r++}return-1},ec=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},tc=/^\\(?:begin|(?:eq)?ref){/,nc=function(e,t){let n,r=[],s=new RegExp("("+t.map(a=>ec(a.left)).join("|")+")");for(;n=e.search(s),n!==-1;){n>0&&(r.push({type:"text",data:e.slice(0,n)}),e=e.slice(n));let a=t.findIndex(c=>e.startsWith(c.left));if(n=Ju(t[a].right,e,t[a].left.length),n===-1)break;let l=e.slice(0,n+t[a].right.length),u=tc.test(l)?l:e.slice(t[a].left.length,n);r.push({type:"math",data:u,rawData:l,display:t[a].display}),e=e.slice(n+t[a].right.length)}return e!==""&&r.push({type:"text",data:e}),r},ya=[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{equation*}",right:"\\end{equation*}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{align*}",right:"\\end{align*}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{alignat*}",right:"\\end{alignat*}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{gather*}",right:"\\end{gather*}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\ref{",right:"}",display:!1},{left:"\\eqref{",right:"}",display:!1},{left:"\\[",right:"\\]",display:!0}],pn={$:[{left:"$$",right:"$$",display:!0},{left:"$`",right:"`$",display:!1},{left:"$",right:"$",display:!1}],"(":[{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!1}]},br=[{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{equation*}",right:"\\end{equation*}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{align*}",right:"\\end{align*}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{alignat*}",right:"\\end{alignat*}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{gather*}",right:"\\end{gather*}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\ref{",right:"}",display:!1},{left:"\\eqref{",right:"}",display:!1}],rc=e=>e==="$"||e==="("?pn[e]:e==="$+"||e==="(+"?pn[e.slice(0,1)].concat(br):e==="ams"?br:e==="all"?pn["("].concat(pn.$).concat(br):ya,sc=function(e,t){let n=nc(e,t.delimiters);if(n.length===1&&n[0].type==="text")return null;let r=document.createDocumentFragment();for(let s=0;s<n.length;s++)if(n[s].type==="text")r.appendChild(document.createTextNode(n[s].data));else{let a=document.createElement("span"),l=n[s].data;t.displayMode=n[s].display;try{t.preProcess&&(l=t.preProcess(l)),temml.render(l,a,t)}catch(u){if(!(u instanceof v))throw u;t.errorCallback("Temml auto-render: Failed to parse `"+n[s].data+"` with ",u),r.appendChild(document.createTextNode(n[s].rawData));continue}r.appendChild(a)}return r},wa=function(e,t){for(let n=0;n<e.childNodes.length;n++){let r=e.childNodes[n];if(r.nodeType===3){let s=sc(r.textContent,t);s&&(n+=s.childNodes.length-1,e.replaceChild(s,r))}else if(r.nodeType===1){let s=" "+r.className+" ";t.ignoredTags.indexOf(r.nodeName.toLowerCase())===-1&&t.ignoredClasses.every(l=>s.indexOf(" "+l+" ")===-1)&&wa(r,t)}}},oc=function(e,t){if(!e)throw new Error("No element provided to render");let n={};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);n.fences?n.delimiters=rc(n.fences):n.delimiters=n.delimiters||ya,n.ignoredTags=n.ignoredTags||["script","noscript","style","textarea","pre","code","option"],n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},wa(e,n),xa(e)},ka=function(e,t,n={}){t.textContent="";let r=t.tagName.toLowerCase()==="math";r&&(n.wrap="none");let s=zr(e,n);r?(t.textContent="",s.children.forEach(a=>{t.appendChild(a.toNode())})):s.children.length>1?(t.textContent="",s.children.forEach(a=>{t.appendChild(a.toNode())})):t.appendChild(s.toNode())};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: Temml doesn't work in quirks mode. Make sure your website has a suitable doctype."),ka=function(){throw new v("Temml doesn't work in quirks mode.")});var ac=function(e,t){return zr(e,t).toMarkup()},ic=function(e,t){let n=new Lt(t);return ba(e,n)},lc=function(e,t){let n=new Lt(t);if(n.macros={},!(typeof e=="string"||e instanceof String))throw new TypeError("Temml can only parse string typed expression");let r=new $t(e,n,!0);return delete r.gullet.macros.current["\\df@tag"],r.parse()},uc=function(e,t,n){if(n.throwOnError||!(e instanceof v))throw e;let r=new fn(["temml-error"],[new Tl(t+`
164
+
165
+ `+e.toString())]);return r.style.color=n.errorColor,r.style.whiteSpace="pre-line",r},zr=function(e,t){let n=new Lt(t);try{let r=ba(e,n),s=new Cr({level:n.displayMode?X.DISPLAY:X.TEXT,maxSize:n.maxSize});return Ol(r,e,s,n)}catch(r){return uc(r,e,n)}},Aa={version:Qu,render:ka,renderToString:ac,renderMathInElement:oc,postProcess:xa,ParseError:v,definePreamble:lc,__parse:ic,__renderToMathMLTree:zr,__defineSymbol:o,__defineMacro:p};var Ta=/^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:?!。,:]|$)/,cc=/^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;function dc(e){let t=/^( {0,3})(`{3,}|~{3,})/.exec(e);return t?{char:t[2][0],len:t[2].length}:null}function pc(e,t){let n=t.char==="`"?"`":"~",r=new RegExp(`^ {0,3}(${n}{3,})\\s*$`).exec(e);return r?r[1].length>=t.len:!1}function Sa(e){let t=null,n=null,r=0;for(;r<=e.length;){let s=e.indexOf(`
166
+ `,r),a=s!==-1,l=a?s:e.length,u=e.slice(r,l);if(n)pc(u,n)&&(n=null);else{let c=dc(u);c?n=c:u==="$$"&&(t===null?t=r:t=null)}if(!a)break;r=s+1}return t}function va(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function _a(e){let t;try{t=Aa.renderToString(e.text,{displayMode:e.displayMode,throwOnError:!0})}catch(n){let r=n instanceof Error?n.message:String(n),s=va(e.raw),l=`<span class="math-error" title="${va(`LaTeX parse error: ${r}`)}">${s}</span>`;return e.displayMode?`<div class="math-block">${l}</div>`:l}return e.displayMode?`<div class="math-block">${t}</div>`:`<span class="math-inline">${t}</span>`}var hc={name:"inlineMath",level:"inline",start(e){let r=0,s=e.length;for(;r<s;){let a=e.indexOf("$",r);if(a===-1)return;if((a===0||e.charCodeAt(a-1)===32)&&Ta.test(e.slice(a,Math.min(s,a+256))))return a;let u=a+1;for(;u<s&&e.charCodeAt(u)===36;)u++;r=u}},tokenizer(e){let t=Ta.exec(e);if(t)return{type:"inlineMath",raw:t[0],text:t[2].trim(),displayMode:t[1].length===2}},renderer:_a},mc={name:"blockMath",level:"block",tokenizer(e){let t=cc.exec(e);if(t)return{type:"blockMath",raw:t[0],text:t[2].trim(),displayMode:t[1].length===2}},renderer:e=>_a(e)+`
167
+ `};N.use({extensions:[hc,mc]});N.setOptions({breaks:!0,gfm:!0});function Re(e){let t=document.createElement("div");return t.textContent=e,t.innerHTML}var Sn=new WeakMap;function Ca(){return{lex:0,parse:0,sanitize:0,dom:0,blocks:0,hits:0,misses:0,lexPrefix:0,lexTail:0,prefixBlocks:0,prefixLen:0,tailLen:0,mathRelex:!1,mathRelexLen:0,tailBlocks:0,tailRawBlocks:0,fastPath:0,defsAbsorbed:0,linkMemoSize:0,seq:0,missDetails:[],subList:{hits:0,misses:0},subTable:{hits:0,misses:0}}}var Da=Ca();function fc(){return Da}function Ea(e,t,n){if(!(typeof performance>"u"||typeof performance.measure!="function"))try{performance.measure(e,{start:t,end:n})}catch{}}var gc=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function Ft(e){for(let t of Array.from(e.childNodes))t.nodeType===3&&/^\s*$/.test(t.nodeValue??"")&&t.parentNode?.removeChild(t)}function Gt(e){return ao.sanitize(e,{USE_PROFILES:{html:!0,mathMl:!0},RETURN_DOM_FRAGMENT:!0})}function Fr(e,t,n){for(let r=0;r<n&&!(t>=e.childNodes.length);r++)e.removeChild(e.childNodes.item(t))}function bc(e,t){let n=new ye(N.defaults);for(let x of Object.keys(t))n.tokens.links[x]=t[x];let r=n.lex(e),s=n.tokens.links,a=[],l="",u=null,c=[],d=[],b=/<([a-zA-Z][\w-]*)(?:\s[^>]*)?>/g,f=/<\/([a-zA-Z][\w-]*)\s*>/g;for(let x of r){let A=x.raw??"",_=x.type??"?";if(u??=_,l+=A,c.push(x),_==="paragraph"||_==="html"){b.lastIndex=0;let O;for(;O=b.exec(A);){let R=O[1].toLowerCase();gc.has(R)||d.push(R)}for(f.lastIndex=0;O=f.exec(A);){let R=O[1].toLowerCase(),C=d.lastIndexOf(R);C>=0&&d.splice(C,1)}}d.length===0&&(c.links=s,a.push({raw:l,type:u,tokens:c}),l="",u=null,c=[])}return l&&(c.links=s,a.push({raw:l,type:u??"?",tokens:c})),{blocks:a,rawCount:r.length}}function xc(e,t,n,r,s){let a=s(),l=0,u=0;for(let $ of e)if(n.startsWith($,l))l+=$.length,u++;else break;u>0&&(u--,l-=e[u].length),u>0&&t[u-1]==="list"&&(u--,l-=e[u].length);let c=Sa(n.slice(0,l)),d=!1,b=0;if(c!==null){l=0,u=0;for(let $ of e){if(l+$.length>c)break;l+=$.length,u++}d=!0,b=n.length-l}let f=s(),x=l===0?n:n.slice(l),A=s(),_=x?bc(x,r):{blocks:[],rawCount:0},O=_.blocks,R=s(),C=0;for(let $=0;$<O.length-1;$++){let B=O[$];if(B.type!=="def")continue;let j=B.tokens[0];j.tag in r||(r[j.tag]={href:j.href,title:j.title},C++)}let L=[];for(let $=0;$<u;$++)L.push({raw:e[$],type:null,tokens:null});for(let $ of O)L.push({raw:$.raw,type:$.type,tokens:$.tokens});return{blocks:L,prefixMs:f-a,tailMs:R-A,prefixBlockCount:u,prefixLen:l,tailLen:x.length,mathRelex:d,mathRelexLen:b,tailBlockCount:O.length,tailRawBlockCount:_.rawCount,defsAbsorbed:C}}function _n(e,t,n,r,s,a,l,u){let{raw:c,type:d,tokens:b}=t;if(!u&&b?.length===1){let Ge=b[0];if(Ge.type==="list")return kc(e,Ge,n,r,s,a,l);if(Ge.type==="table")return vc(e,Ge,n,r,s,a,l)}let f=l(),x;!u&&b?.length===1?(a.fastPath++,x=N.parser(b,{...N.defaults,async:!1})):x=N.parse(c,{async:!1});let _=l()-f;if(a.parse+=_,typeof x!="string")throw new Error("updateMarkdownStream requires sync marked (>= 5.0); marked.parse returned a non-string (likely a Promise)");let O=l(),R=Gt(x),L=l()-O;a.sanitize+=L;let $=l();Ft(R);let B=R.childNodes.length;Fr(e,n,r);let j=e.childNodes.item(n);e.insertBefore(R,j);let Be=l()-$;return a.dom+=Be,a.missDetails.push({type:d??"?",len:c.length,snip:c.slice(0,40).replace(/\n/g,"\u21B5"),parseMs:_,sanMs:L,domMs:Be,path:u??"general"}),{newCount:B,newSubMemo:null}}function yc(e){return e.replace(/[\r\n]+$/,"")}function wc(e,t,n){let r={...e,items:[t]},s=n(),a=N.parser([r],{...N.defaults,async:!1}),l=n();if(typeof a!="string")throw new Error("renderOneListItem: marked.parser returned non-string (async mode leaked?)");let u=n(),c=Gt(a),d=n(),b=n();Ft(c);let x=c.firstElementChild?.firstElementChild??null,A=n();return{newLi:x,parseMs:l-s,sanMs:d-u,domMs:A-b}}function kc(e,t,n,r,s,a,l){let u=t.items,c=t.start===""?1:t.start,d=t.loose?"1":"0",b=t.ordered?`ol:start=${c}:loose=${d}`:`ul:loose=${d}`,f,x;if(s!==null&&s.type==="list"&&s.variant===b&&s.containerEl.parentNode===e)f=s.containerEl,x=s.subCache;else{let C=N.parser([{...t,items:[]}],{...N.defaults,async:!1}),L=Gt(C);Ft(L);let $=L.firstElementChild;if(!$)return _n(e,{raw:t.raw,type:t.type,tokens:null},n,r,null,a,l,"slowFallback");Fr(e,n,r);let B=e.childNodes.item(n);e.insertBefore($,B),f=$,x=[]}let _=0,O=0,R=0;for(let C=0;C<u.length;C++){let L=yc(u[C].raw);if(x[C]===L&&f.children.item(C)){a.subList.hits++;continue}a.subList.misses++;let $=wc(t,u[C],l);if(_+=$.parseMs,O+=$.sanMs,R+=$.domMs,!$.newLi)continue;let B=f.children.item(C);B?f.replaceChild($.newLi,B):f.appendChild($.newLi),x[C]=L}for(;f.children.length>u.length;)f.lastElementChild&&f.removeChild(f.lastElementChild);for(;x.length>u.length;)x.pop();return a.parse+=_,a.sanitize+=O,a.dom+=R,a.missDetails.push({type:"list",len:t.raw.length,snip:t.raw.slice(0,40).replace(/\n/g,"\u21B5"),parseMs:_,sanMs:O,domMs:R,path:"list",items:u.length}),{newCount:1,newSubMemo:{type:"list",variant:b,containerEl:f,subCache:x}}}function La(e){return e.map(t=>t.text).join("")}function Ac(e){let t=La(e.header),n=e.align.map(r=>r??"").join(",");return`table:h=${t}|a=${n}`}function Tc(e,t,n){let r={...e,rows:[t]},s=n(),a=N.parser([r],{...N.defaults,async:!1}),l=n();if(typeof a!="string")throw new Error("renderOneTableRow: marked.parser returned non-string (async mode leaked?)");let u=n(),c=Gt(a),d=n(),b=n();Ft(c);let A=c.firstElementChild?.querySelector("tbody")?.firstElementChild??null,_=n();return{newTr:A,parseMs:l-s,sanMs:d-u,domMs:_-b}}function vc(e,t,n,r,s,a,l){let u=t.rows,c=Ac(t),d,b,f;if(s!==null&&s.type==="table"&&s.variant===c&&s.containerEl.parentNode===e){d=s.containerEl;let R=d.querySelector("tbody");if(!R)return _n(e,{raw:t.raw,type:t.type,tokens:null},n,r,null,a,l,"slowFallback");b=R,f=s.subCache}else{let R=l(),C=N.parser([{...t,rows:[]}],{...N.defaults,async:!1}),L=l();a.parse+=L-R;let $=l(),B=Gt(C),j=l();a.sanitize+=j-$,Ft(B);let V=B.firstElementChild;if(!V)return _n(e,{raw:t.raw,type:t.type,tokens:null},n,r,null,a,l,"slowFallback");let Be=V.querySelector("tbody");Be||(Be=V.ownerDocument.createElement("tbody"),V.appendChild(Be)),Fr(e,n,r);let Ge=e.childNodes.item(n);e.insertBefore(V,Ge),d=V,b=Be,f=[]}let A=0,_=0,O=0;for(let R=0;R<u.length;R++){let C=La(u[R]);if(f[R]===C&&b.children.item(R)){a.subTable.hits++;continue}a.subTable.misses++;let L=Tc(t,u[R],l);if(A+=L.parseMs,_+=L.sanMs,O+=L.domMs,!L.newTr)continue;let $=b.children.item(R);$?b.replaceChild(L.newTr,$):b.appendChild(L.newTr),f[R]=C}for(;b.children.length>u.length;)b.lastElementChild&&b.removeChild(b.lastElementChild);for(;f.length>u.length;)f.pop();return a.parse+=A,a.sanitize+=_,a.dom+=O,a.missDetails.push({type:"table",len:t.raw.length,snip:t.raw.slice(0,40).replace(/\n/g,"\u21B5"),parseMs:A,sanMs:_,domMs:O,path:"table",items:u.length}),{newCount:1,newSubMemo:{type:"table",variant:c,containerEl:d,subCache:f}}}function En(e,t){let r=Sn.get(e);r&&r.cache.length>0&&r.rootCounts.reduce((C,L)=>C+L,0)!==e.childNodes.length&&(Sn.delete(e),e.replaceChildren(),r=void 0);let s=Ca(),a=typeof performance<"u"&&typeof performance.now=="function"?()=>performance.now():()=>Date.now(),l=a();r||(r={cache:[],cacheTypes:[],rootCounts:[],subMemos:[],links:{},callCount:0},Sn.set(e,r)),r.callCount++,s.seq=r.callCount;let{cache:u,cacheTypes:c,rootCounts:d,subMemos:b}=r,f=a(),x=xc(u,c,t,r.links,a),A=a();s.lex=A-f,s.lexPrefix=x.prefixMs,s.lexTail=x.tailMs,s.prefixBlocks=x.prefixBlockCount,s.prefixLen=x.prefixLen,s.tailLen=x.tailLen,s.mathRelex=x.mathRelex,s.mathRelexLen=x.mathRelexLen,s.tailBlocks=x.tailBlockCount,s.tailRawBlocks=x.tailRawBlockCount,s.defsAbsorbed=x.defsAbsorbed;let _=x.blocks;s.blocks=_.length,Ea("mdstream.lex",f,A);let O=0;for(let R=0;R<_.length;R++){let C=_[R],L=C.raw,$=d[R]??0;if(u[R]===L){O+=$,s.hits++;continue}s.misses++;let{newCount:B,newSubMemo:j}=_n(e,C,O,$,b[R]??null,s,a);u[R]=L,c[R]=C.type,d[R]=B,b[R]=j,O+=B}for(;u.length>_.length;){let R=d.pop()??0;u.pop(),c.pop(),b.pop();for(let C=0;C<R;C++)e.lastChild&&e.removeChild(e.lastChild)}s.linkMemoSize=Object.keys(r.links).length,Da=s,Ea("mdstream.total",l,a())}function nt(e){Sn.delete(e)}var Sc={file:"diff-file",hunk:"diff-hunk",add:"diff-add",del:"diff-del",context:null};function _c(e){let t=Ss(e);return t?t.map(n=>{let r=Sc[n.kind];return r?`<span class="${r}">${Re(n.text)}</span>`:Re(n.text)}).join(`
168
+ `):null}var Ec=["user_message","assistant_message","thinking","tool_call","tool_call_update","plan","permission_request","permission_response","bash_command","bash_result"];function zd(e){return Ec.includes(e)}var gt=new WeakMap;function Fd(e,t){let n=gt.get(t);n&&gt.set(e,n)}function Gd(e,t,n){switch(e){case"user_message":return Cc(t,n);case"assistant_message":return Rc(t,n);case"thinking":return $c(t);case"tool_call":return Ic(t);case"tool_call_update":return Bc(t,n),null;case"plan":return Nc(t);case"permission_request":return Pc(t,n);case"permission_response":return zc(t,n),null;case"bash_command":return Fc(t);case"bash_result":return Gc(t,n),null;default:return e}}function Cc(e,t){let n=typeof e.text=="string"?e.text:"",r=document.createElement("div");r.className="msg user",typeof e.clientOpId=="string"&&(r.dataset.clientOpId=e.clientOpId),r.innerHTML=Re(n).replace(/\n/g,"<br>");let s=Array.isArray(e.attachments)?e.attachments:[];for(let a of s){if(!a||typeof a!="object")continue;let l=a,u=typeof l.displayName=="string"?l.displayName:"file",c=l.kind==="image"?"image":"file",d=typeof l.path=="string"?l.path:"",b=d?t.rewriteAttachmentSrc?t.rewriteAttachmentSrc(d):d:"";if(c==="image"&&b){let f=document.createElement("img");f.className="user-image",f.src=b,f.alt=u;let x=Dc(l.width,l.height);x&&(f.width=x.width,f.height=x.height),r.appendChild(f)}else if(c==="file"&&b){let f=document.createElement("a");f.className="user-file",f.href=b,f.target="_blank",f.rel="noopener",f.download=u,f.textContent=u,r.appendChild(f)}else{let f=document.createElement("div");f.className="user-attachment",f.textContent=`[${c}: ${u}]`,r.appendChild(f)}}return r}function Dc(e,t){if(typeof e!="number"||typeof t!="number"||!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0)return null;let n=Lc(),r=Math.min(n.width/e,n.height/t,1);return{width:Math.max(1,Math.round(e*r)),height:Math.max(1,Math.round(t*r))}}function Lc(){let e=document.defaultView?.getComputedStyle(document.documentElement);return e?{width:Ra(e,"--user-image-max-width",200),height:Ra(e,"--user-image-max-height",150)}:{width:200,height:150}}function Ra(e,t,n){let r=e.getPropertyValue(t).trim();if(!r.endsWith("px"))return n;let s=Number(r.slice(0,-2));return Number.isFinite(s)&&s>0?s:n}function Rc(e,t){let n=typeof e.text=="string"?e.text:"",r=document.createElement("div");return r.className="msg assistant",r.setAttribute("data-raw",n),Mc(r,n,t.finalAnswerToolText,!0),t.enhanceMarkdown?.(r),r}function qc(e){if(e.dataset.assistantDisplay==="final-answer"){let t=e.querySelector(".subagent-result-content"),n=e.querySelector(".assistant-continuation");t&&nt(t),n&&nt(n)}else nt(e)}function Oc(e,t,n){let r="<final_answer>";return t||n||e.length===0||!e.startsWith(r)&&!r.startsWith(e)?null:{foldedText:e.startsWith(r)?e.slice(r.length):"",continuationText:""}}function Mc(e,t,n,r=!1){n!==void 0&&(n?gt.set(e,n):gt.delete(e));let s=gt.get(e)??null,a=xs(t,s)??Oc(t,s!==null,r);if(!a){e.dataset.assistantDisplay==="final-answer"&&(qc(e),nt(e),e.replaceChildren()),delete e.dataset.assistantDisplay,r&&gt.delete(e),En(e,Qt(t));return}e.dataset.assistantDisplay!=="final-answer"&&(nt(e),e.replaceChildren(),e.dataset.assistantDisplay="final-answer");let l=e.querySelector("details.subagent-result");if(!l){l=document.createElement("details"),l.className="subagent-result";let d=document.createElement("summary");d.textContent="sub-agent result";let b=document.createElement("div");b.className="subagent-result-content",l.append(d,b),e.appendChild(l)}let u=l.querySelector(".subagent-result-content");u&&En(u,Qt(a.foldedText));let c=e.querySelector(".assistant-continuation");a.continuationText?(c||(c=document.createElement("div"),c.className="assistant-continuation",e.appendChild(c)),En(c,Qt(a.continuationText))):c&&(nt(c),c.remove())}function $c(e){let t=typeof e.text=="string"?e.text:"",n=document.createElement("details");return n.className="thinking",n.setAttribute("data-raw",t),n.innerHTML=`<summary>\u283F thought</summary><div class="thinking-content">${Re(t)}</div>`,n}function Ic(e){let t=typeof e.id=="string"?e.id:"",n=typeof e.kind=="string"?e.kind:"",r=typeof e.title=="string"?e.title:"",s=e.rawInput,a=ys(n,r,s),l=document.createElement("div");l.className="tool-call",l.id=`tc-${t}`,l.dataset.kind=n;let u=`<span class="icon">${a.icon}</span> ${Re(a.title)}`;if(a.detail&&(u+=`<span class="tc-detail">${a.detailPrefix??""}${Re(a.detail)}</span>`),l.innerHTML=u,a.showDiff){let d=_c(s);if(d){let b=document.createElement("details");b.innerHTML=`<summary>diff</summary><div class="diff-view">${d}</div>`,l.appendChild(b)}}let c=l.querySelector(".tc-detail");return c&&l.addEventListener("click",d=>{d.target.closest("details")||c.classList.toggle("expanded")}),l}function Bc(e,t){let n=typeof e.id=="string"?e.id:"",r=t.findToolCallEl(n);if(!r)return;let s=typeof e.status=="string"?e.status:"pending",a=ws(s);r.className=a.className;let l=r.querySelector(".icon");l&&(l.textContent=a.icon);let u=Array.isArray(e.content)?e.content:[];if(!u.length)return;let c=jn(u);if(c)if(r.dataset.kind==="task_complete"){let d=r.querySelector(".tc-summary");d||(d=document.createElement("div"),d.className="tc-summary",r.appendChild(d)),d.textContent=c}else{let d=r.querySelector(".tc-output .tc-content");if(!d){let b=document.createElement("details");b.className="tc-output",b.innerHTML='<summary>output</summary><div class="tc-content"></div>',r.appendChild(b),d=b.querySelector(".tc-content")}d&&(d.textContent=c)}}function Nc(e){let t=Array.isArray(e.entries)?e.entries:[];return _s(t,{className:"plan",open:!1})}function Pc(e,t){let n=typeof e.requestId=="string"?e.requestId:"",r=typeof e.title=="string"?e.title:"",s=document.createElement("div");s.className="permission",s.dataset.requestId=n,s.dataset.title=r;let a=t.isPermissionResolved?.(n)??!1,l=a?"title dim":"title";if(s.innerHTML=`<span class="${l}">\u26BF ${Re(r)}</span> `,!a){let u=Array.isArray(e.options)?e.options:[];for(let c of u){let d=document.createElement("button"),b=ks(c.kind??"");d.className=b.cssClass,d.textContent=c.name,d.dataset.optionId=c.optionId,d.dataset.optionKind=c.kind??"",s.appendChild(d)}}return s}function zc(e,t){let n=typeof e.requestId=="string"?e.requestId:"",r=t.findPermissionEl(n);if(!r)return;let s=r.dataset.title,a=s?`\u26BF ${s}`:"\u26BF",l=As(typeof e.optionName=="string"?e.optionName:void 0,typeof e.denied=="boolean"?e.denied:void 0);r.innerHTML=`<span class="dim">${Re(a)} \u2014 ${Re(l)}</span>`}function Fc(e){let t=typeof e.command=="string"?e.command:"",n=document.createElement("div");return n.className="bash-block",n.innerHTML=`<span class="bash-cmd">${Re(t)}</span><div class="bash-output"></div>`,n.querySelector(".bash-cmd").addEventListener("click",()=>{let r=n.querySelector(".bash-output");r.style.display==="none"?r.style.display="block":r.classList.contains("has-content")&&(r.style.display="none")}),n}function Gc(e,t){let n=t.findBashEl();if(!n)return;let r=typeof e.output=="string"?e.output:"";if(r){let c=n.querySelector(".bash-output");c&&(c.textContent=r,c.classList.add("has-content"))}let s=n.querySelector(".bash-cmd");s&&s.classList.remove("running");let a=typeof e.code=="number"?e.code:null,l=typeof e.signal=="string"?e.signal:null,u="";if(l?u=`[signal: ${l}]`:a!==0&&a!=null&&(u=`[exit: ${a}]`),u&&s){let c=document.createElement("span");c.className=`bash-exit ${a===0?"ok":"fail"}`,c.textContent=u,s.after(c)}}var Cn="theme",Hc="wa_log_level",Uc="webagent_notify_tip_shown",jc="webagent_notify_tip_denied_shown",Wc=new Set([Cn,Hc,Uc,jc]);function Vc(e){return e===ms?!1:Wc.has(e)?!0:e.startsWith("wa_")||e.startsWith("webagent_")}function Zc(){let e=[];for(let t=localStorage.length-1;t>=0;t--){let n=localStorage.key(t);!n||!Vc(n)||(localStorage.removeItem(n),e.push(n))}return e}async function Xc(){if(typeof navigator>"u"||!("serviceWorker"in navigator)||typeof navigator.serviceWorker.getRegistrations!="function")return 0;let e=await navigator.serviceWorker.getRegistrations();return await Promise.all(e.map(t=>t.unregister())),e.length}async function Yc(){if(typeof caches>"u")return[];let e=await caches.keys();return await Promise.all(e.map(t=>caches.delete(t))),e}async function jd(){let e={localStorageKeys:[],serviceWorkers:0,caches:[],errors:[]};try{e.localStorageKeys=Zc()}catch(t){e.errors.push(`localStorage: ${Gr(t)}`)}try{e.serviceWorkers=await Xc()}catch(t){e.errors.push(`serviceWorker: ${Gr(t)}`)}try{e.caches=await Yc()}catch(t){e.errors.push(`cache: ${Gr(t)}`)}return e}function Gr(e){return e instanceof Error?e.message:String(e)}var Kc={auto:"\u25D1",light:"\u2600",dark:"\u263E"},qa=["auto","light","dark"];function Ma(){return localStorage.getItem(Cn)??"auto"}var $a=[];function Zd(e){$a.push(e)}function Ia(e){document.documentElement.setAttribute("data-theme",e);let t=document.getElementById("theme-btn");t&&(t.textContent=Kc[e],t.title=`Theme: ${e}`),localStorage.setItem(Cn,e);for(let n of $a)n()}var Oa=document.getElementById("theme-btn");Oa&&Oa.addEventListener("click",()=>{let e=Ma(),t=qa[(qa.indexOf(e)+1)%3];Ia(t)});Ia(Ma());var Fe=document.createElement("div");Fe.id="lightbox-overlay";var Ht=document.createElement("img");Fe.appendChild(Ht);document.body.appendChild(Fe);var Dn=1,Qc=.5,Jc=5;function ed(){return Fe.classList.contains("active")}function td(e){Ht.src=e,Dn=1,Ht.style.transform="",Fe.classList.add("active")}function Ba(){Fe.classList.remove("active"),Ht.src=""}document.getElementById("messages").addEventListener("click",e=>{let t=e.target;t.tagName==="IMG"&&t.classList.contains("user-image")&&td(t.src)});Fe.addEventListener("click",e=>{e.target===Fe&&Ba()});document.addEventListener("keydown",e=>{e.key==="Escape"&&ed()&&Ba()});Fe.addEventListener("wheel",e=>{e.preventDefault();let t=e.deltaY>0?-.15:.15;Dn=Math.min(Jc,Math.max(Qc,Dn+t)),Ht.style.transform=`scale(${Dn})`},{passive:!1});export{nd as a,rd as b,sd as c,ld as d,ks as e,ud as f,cd as g,_s as h,Re as i,fc as j,En as k,nt as l,zd as m,Fd as n,Gd as o,Mc as p,Hc as q,Uc as r,jc as s,jd as t,Zd as u};
169
+ /*! Bundled license information:
170
+
171
+ dompurify/dist/purify.es.mjs:
172
+ (*! @license DOMPurify 3.4.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.1/LICENSE *)
173
+ */