You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Paperlibrary__See__index...

3126 lines
819 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

!(function(){var jr=Math.pow;var Ei=(Tt,Ge,P)=>new Promise((q,de)=>{var V=Z=>{try{De(P.next(Z))}catch(re){de(re)}},Ke=Z=>{try{De(P.throw(Z))}catch(re){de(re)}},De=Z=>Z.done?q(Z.value):Promise.resolve(Z.value).then(V,Ke);De((P=P.apply(Tt,Ge)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[3247],{71736:function(Tt,Ge){"use strict";Ge.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},14375:function(Tt,Ge,P){"use strict";var q=P(67294),de=Object.defineProperty,V=Object.getOwnPropertySymbols,Ke=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,Z=(g,ke,fe)=>ke in g?de(g,ke,{enumerable:!0,configurable:!0,writable:!0,value:fe}):g[ke]=fe,re=(g,ke)=>{for(var fe in ke||(ke={}))Ke.call(ke,fe)&&Z(g,fe,ke[fe]);if(V)for(var fe of V(ke))De.call(ke,fe)&&Z(g,fe,ke[fe]);return g};const p=g=>React.createElement("svg",re({width:14,height:14,xmlns:"http://www.w3.org/2000/svg"},g),React.createElement("title",null,"\u7F16\u7EC4 18"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("circle",{fill:"#FCB041",cx:7,cy:7,r:7}),React.createElement("path",{d:"M7.531 9.638a.616.616 0 1 1-1.231 0v-.02a.616.616 0 1 1 1.231 0v.02Zm0-2.25a.616.616 0 1 1-1.231 0V4.117a.616.616 0 1 1 1.231 0v3.273Z",fill:"#FFF",fillRule:"nonzero"})));Ge.Z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGQ0IwNDEiIGN4PSI3IiBjeT0iNyIgcj0iNyIvPjxwYXRoIGQ9Ik03LjUzMSA5LjYzOGEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwdi0uMDJhLjYxNi42MTYgMCAxIDEgMS4yMzEgMHYuMDJabTAtMi4yNWEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwVjQuMTE3YS42MTYuNjE2IDAgMSAxIDEuMjMxIDB2My4yNzNaIiBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+"},35713:function(Tt,Ge,P){"use strict";var q=P(67294),de=P(71736),V=P(84279),Ke=P(36527),De=P(14446),Z=P(67294);const re=(0,q.forwardRef)(({callback:p,width:g,onChange:ke,disabled:fe,readOnly:le,type:wt="",value:Me="",style:mt={}},G)=>{const ut=(0,q.useRef)(),kt=(0,q.useRef)(),[Se,N]=(0,q.useState)(0),[R,Mt]=(0,q.useState)(0),[Ye,pe]=(0,q.useState)(!1),qe=()=>{var ye=document.createElement("div");ye.innerHTML=ut.current.getValue();var b=ye.innerText;return p&&p(b),b};(0,q.useImperativeHandle)(G,()=>({getData:qe}));const it=ye=>{ye.preventDefault();const b=ye.clientX-Se,F=ye.clientY-R;document.body.onmousemove=H=>{let se=H.clientX-b,Ce=H.clientY-F;const We=document.getElementsByClassName("markdown-popup-form")[0],Mr=window.innerWidth-We.offsetWidth,nt=window.innerHeight-We.offsetHeight;se=Math.max(0,Math.min(se,Mr)),Ce=Math.max(0,Math.min(Ce,nt)),dr(H.clientX,H.clientY,b,F)&&(N(se),Mt(Ce))},document.body.onmouseup=function(){document.body.onmousemove=null}},dr=(ye,b,F,H)=>{const se=document.body.clientHeight,Ce=document.body.clientWidth;return ye<20&&F>ye||ye>Ce-20&&F<ye||b<20&&H>b||b>se-20&&H<b?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};(0,q.useEffect)(()=>{Ye&&setTimeout(()=>{const ye=document.getElementsByClassName("markdown-popup-form")[0],b=window.innerWidth/2-ye.offsetWidth/2,F=window.innerHeight/2-ye.offsetHeight/2;N(b),Mt(F)},0)},[Ye]);const Rt=()=>{fe||le||pe(!0)};return Z.createElement("div",{style:mt},Z.createElement("div",{style:{width:g||"100%",position:"relative"},className:`${de.Z.mathFillWrap} ${fe||le?"cursorDefault":""}`,onClick:()=>Rt()},Z.createElement("math-field",{disabled:fe,locale:"zh_cn",class:`${de.Z.mathField} ${wt}`,readOnly:le,placeholder:"\u8BF7\u8F93\u5165\u516C\u5F0F",ref:ut,style:{width:"100%",fontSize:Me?18:14},value:Me||""})),Z.createElement(De.default,{maskClosable:!1,centered:!0,width:860,style:{position:"absolute",left:Se,top:R},title:Z.createElement("div",{style:{cursor:"move"},onMouseDown:it},"\u8F93\u5165\u516C\u5F0F"),open:Ye,onOk:()=>{const ye=kt.current.getData();ut.current.setValue(ye),ke(ye),pe(!1)},onCancel:()=>{pe(!1)},destroyOnClose:!0,className:"markdown-popup-form"},Z.createElement(Ke.Z,{value:Me,ref:kt,onChange:ke,showSaveButton:!1})))});Ge.Z=re},36527:function(Tt,Ge,P){"use strict";var q=P(67294),de=P(71230),V=P(15746),Ke=P(66368),De=P(71577),Z=P(85725),re=P(71736),p=P(84279),g=P(67294);const ke=(0,q.forwardRef)(({callback:fe,showSaveButton:le,value:wt=""},Me)=>{const mt=(0,q.useRef)(),G=[{name:"\u5206\u6570\u5F97\u5206",value:"\\frac{x}{y}",children:[{name:"\u5206\u6570 Fractions",data:[{value:"\\frac{a}{b}"},{value:"x\\tfrac{x}{a} "},{value:"\\mathrm{d}t"},{value:"\\partial t"},{value:"\\frac{\\partial y}{\\partial x}"},{value:"\\nabla\\psi"},{value:"\\frac{\\partial^2}{\\partial x_1\\partial x_2}y"},{value:"\\cfrac{1}{a + \\cfrac{7}{b + \\cfrac{2}{9}}} = c"}]},{name:"\u5BFC\u6570 Derivative",data:[{value:"\\dot{a} "},{value:"\\ddot{a}"},{value:"{f}^{\\prime}"},{value:"{f}^{\\prime\\prime}"},{value:"{f}^{(n)}"}]},{name:"\u6A21\u7B97\u672F Modular arithmetic",data:[{value:"a \\bmod b"},{value:"a \\equiv b \\pmod{m} "},{value:"\\gcd(m, n) "},{value:"\\operatorname{lcm}(m, n) "}]}]},{name:"\u6839\u5F0F\u89D2\u6807",value:"\\sqrt{x}",children:[{name:"\u6839\u5F0F Radicals",data:[{value:"\\sqrt{x}"},{value:"\\sqrt[y]{x}"}]},{name:"\u4E0A\u4E0B\u6807 Sub&Super",data:[{value:"x^{a}"},{value:"x_{a}"},{value:"x_{a}^{b} "},{value:"_{a}^{b} x"},{value:"x_{a}^{b} "}]},{name:"\u91CD\u97F3\u7B26\u53CA\u5176\u4ED6 Accents and Others",data:[{value:"\\hat{a} "},{value:"\\sqrt[y]{x}"},{value:"\\check{} "},{value:"\\grave{a} "},{value:"\\acute{a}"},{value:"\\tilde{a}"},{value:"\\breve{a}"},{value:"\\bar{a}"},{value:"\\vec{a}"},{value:"\\not{a}"},{value:"\\widetilde{abc}"},{value:"\\widehat{abc}"},{value:"\\overleftarrow{abc} "},{value:"\\overrightarrow{abc}"},{value:"\\overline{abc}"},{value:"\\underline{abc}"},{value:"\\overbrace{abc}"},{value:"\\underbrace{abc}"},{value:"\\overset{a}{abc}"},{value:"\\underset{a}{abc} \\stackrel\\frown{ab}"},{value:"\\overline{ab} "},{value:"\\overleftrightarrow{ab}"},{value:"\\overset{a}{\\leftarrow}"},{value:"\\overset{a}{\\rightarrow}"},{value:"\\xleftarrow[abc]{a}"},{value:"\\xrightarrow[abc]{a} "}]}]},{name:"\u6781\u9650\u5BF9\u6570",value:"\\lim_{x \\to 0}",children:[{name:"\u6781\u9650 Limits",data:[{value:"\\lim a"},{value:"\\lim_{x \\to 0}"},{value:"\\lim_{x \\to \\infty}"},{value:"\\max_b{a}"},{value:"\\min_a{b}"}]},{name:"\u5BF9\u6570\u6307\u6570 Logarithms and exponentials",data:[{value:"\\log_{a}{b}"},{value:"\\lg_{a}{b}"},{value:"\\ln_{a}{b}"},{value:"\\exp a"}]},{name:"\u754C\u9650 Bounds",data:[{value:"\\min x"},{value:"\\sup t"},{value:"\\inf s"},{value:"\\lim u"},{value:"\\limsup w"},{value:"\\dim p"},{value:"\\ker\\phi "}]}]},{name:"\u4E09\u89D2\u51FD\u6570",value:"\\sin a",children:[{name:"\u4E09\u89D2\u51FD\u6570 Trigonometric functions",data:[{value:"\\sin a"},{value:"\\cos a"},{value:"\\tan a"},{value:"\\cot a "},{value:"\\sec a "},{value:"\\csc a "}]},{name:"\u53CD\u4E09\u89D2\u51FD\u6570 Inverse trigonometric functions",data:[{value:"\\sin^{-1}"},{value:"\\cos^{-1}"},{value:"\\tan^{-1}"},{value:"\\cot^{-1}"},{value:"\\sec^{-1}"},{value:"\\csc^{-1}"},{value:"\\arcsin a"},{value:"\\arccos a"},{value:"\\arctan a"},{value:"\\operatorname{arccot} a"},{value:"\\operatorname{arcsec} a"},{value:"\\operatorname{arccsc} a"}]},{name:"\u53CC\u66F2\u51FD\u6570 Hyperblic functions",data:[{value:"\\sinh a"},{value:"\\cosh a"},{value:"\\tanh a"},{value:"\\coth a"},{value:"\\operatorname{sech} a"},{value:"\\operatorname{csch} a"}]},{name:"\u53CD\u53CC\u66F2\u51FD\u6570 Inverse hyperbolic functions",data:[{value:"\\sinh^{-1}"},{value:"a\\cosh^{-1} a"},{value:"\\tanh^{-1} a"},{value:"\\coth^{-1} a"},{value:"\\operatorname{sech}^{-1} a"},{value:"\\operatorname{csch}^{-1} a"}]}]},{name:"\u79EF\u5206\u8FD0\u7B97",value:"\\int_{a}^{b}",children:[{name:"\u79EF\u5206 Integral",data:[{value:"\\int"},{value:"\\int_{a}^{b}"},{value:"\\int\\limits_{a}^{b}"}]},{name:"\u53CC\u91CD\u79EF\u5206 Double integral",data:[{value:"\\iint"},{value:"\\iint_{a}^{b} "},{value:"\\iint\\limits_{a}^{b} "}]},{name:"\u4E09\u91CD\u79EF\u5206 Triple integral",data:[{value:"\\iiint"},{value:"\\iiint_{a}^{b}"},{value:"\\iiint\\limits_{a}^{b} "}]},{name:"\u66F2\u7EBF\u79EF\u5206 Closed line or path integral",data:[{value:"\\oint"},{value:"\\oint_{a}^{b} "}]}]},{name:"\u5927\u578B\u8FD0\u7B97",value:"\\sum_{a}^{b}",children:[{name:"\u6C42\u548C Summation",data:[{value:"\\sum"},{value:"\\sum_{a}^{b}"},{value:"{\\textstyle \\sum_{a}^{b}} "}]},{name:"\u4E58\u79EF\u4F59\u79EF Product and coproduct",data:[{value:"\\prod"},{value:"\\prod_{a}^{b}"},{value:"{\\textstyle \\prod_{a}^{b}}"},{value:"\\coprod"},{value:"\\coprod_{a}^{b}"},{value:"{\\textstyle \\coprod_{a}^{b}} "}]},{name:"\u5E76\u96C6\u4EA4\u96C6 Union and intersection",data:[{value:"\\bigcup"},{value:"\\bigcup_{a}^{b}"},{value:"{\\textstyle \\bigcup_{a}^{b}}"},{value:"\\bigcap"},{value:"\\bigcap_{a}^{b}"}]},{name:"\u6790\u53D6\u5408\u53D6 Disjunction and conjunction",data:[{value:"\\bigvee"},{value:"\\bigvee_{a}^{b}"},{value:"\\bigwedge"},{value:"\\bigwedge_{a}^{b}"}]}]},{name:"\u62EC\u53F7\u53D6\u6574",value:"\\left [ \\left ( \\right ) \\right ] ",children:[{name:"\u62EC\u53F7 Brackets",data:[{value:"\\left ( \\right )"},{value:"\\left [ \\right ]"},{value:"\\left \\langle \\right \\rangle "},{value:"\\left | \\right | "},{value:"\\left \\lfloor \\right \\rfloor "},{value:"\\left \\lceil \\right \\rceil "}]}]}],ut=[{name:"\u4EE3\u6570",value:"\\sqrt{a^2+b^2}",children:[{data:[{value:"\\left(x-1\\right)\\left(x+3\\right) "},{value:"\\sqrt{a^2+b^2}"},{value:"\\left ( \\frac{a}{b}\\right )^{n}= \\frac{a^{n}}{b^{n}}"},{value:"\\frac{a}{b}\\pm \\frac{c}{d}= \\frac{ad \\pm bc}{bd} "},{value:"\\frac{x^{2}}{a^{2}}-\\frac{y^{2}}{b^{2}}=1 "},{value:"\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0 "},{value:"\\sqrt[n]{a^{n}}=\\left ( \\sqrt[n]{a}\\right )^{n} "},{value:"x ={-b \\pm \\sqrt{b^2-4ac}\\over 2a} "},{value:"y-y_{1}=k \\left( x-x_{1}\\right) "},{value:`\\left\\{\\begin{matrix} \r
x=a + r\\text{cos}\\theta \\ \r
y=b + r\\text{sin}\\theta \r
\\end{matrix}\\right. `},{value:`\\begin{array}{l} \r
\\text{\u5BF9\u4E8E\u65B9\u7A0B\u5F62\u5982\uFF1A}x^{3}-1=0 \\ \r
\\text{\u8BBE}\\text{:}\\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
x_{1}=1,x_{2}= \\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
x_{3}= \\omega ^{2}=\\frac{-1-\\sqrt{3}i}{2} \r
\\end{array} `},{value:`\\begin{array}{l} \r
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
\\left\\{\\begin{matrix} \r
\\Delta \\gt 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u4E0D\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
\\Delta = 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
\\Delta \\lt 0\\text{\u65B9\u7A0B\u65E0\u5B9E\u6839} \r
\\end{matrix}\\right. \r
\\end{array} `},{value:`\\begin{array}{l} \r
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
\\mathop{{x}}\\nolimits_{{1,2}}=\\frac{{-b \\pm \r
\\sqrt{{\\mathop{{b}}\\nolimits^{{2}}-4ac}}}}{{2a}} \\ \r
\\mathop{{x}}\\nolimits_{{1}}+\\mathop{{x}}\\nolimits_{{2}}=-\\frac{{b}}{{a}} \\ \r
\\mathop{{x}}\\nolimits_{{1}}\\mathop{{x}}\\nolimits_{{2}}=\\frac{{c}}{{a}} \r
\\end{array} `}]}]},{name:"\u51E0\u4F55",value:"\\Delta A B C ",children:[{data:[{value:"\\Delta A B C "},{value:"a \\parallel c,b \\parallel c \\Rightarrow a \\parallel b "},{value:"l \\perp \\beta ,l \\subset \\alpha \\Rightarrow \\alpha \\perp \\beta"},{value:`\\left.\\begin{matrix} \r
a \\perp \\alpha \\ \r
b \\perp \\alpha \r
\\end{matrix}\\right\\}\\Rightarrow a \\parallel b`},{value:"P \\in \\alpha ,P \\in \\beta , \\alpha \\cap \\beta =l \\Rightarrow P \\in l "},{value:`\\alpha \\perp \\beta , \\alpha \\cap \\beta =l,a \\subset \\alpha ,a \\perp l \r
\\Rightarrow a \\perp \\beta `},{value:`\\left.\\begin{matrix} \r
a \\subset \\beta ,b \\subset \\beta ,a \\cap b=P \\ \r
a \\parallel \\partial ,b \\parallel \\partial \r
\\end{matrix}\\right\\}\\Rightarrow \\beta \\parallel \\alpha `},{value:"\\alpha \\parallel \\beta , \\gamma \\cap \\alpha =a, \\gamma \\cap \\beta =b \\Rightarrow a \\parallel b "},{value:"A \\in l,B \\in l,A \\in \\alpha ,B \\in \\alpha \\Rightarrow l \\subset \\alpha "},{value:`\\left.\\begin{matrix} \r
m \\subset \\alpha ,n \\subset \\alpha ,m \\cap n=P \\ \r
a \\perp m,a \\perp n \r
\\end{matrix}\\right\\}\\Rightarrow a \\perp \\alpha `},{value:`\\begin{array}{c} \r
\\text{\u76F4\u89D2\u4E09\u89D2\u5F62\u4E2D,\u76F4\u89D2\u8FB9\u957Fa,b,\u659C\u8FB9\u8FB9\u957Fc} \\ \r
a^{2}+b^{2}=c^{2} \r
\\end{array}`}]}]},{name:"\u4E0D\u7B49\u5F0F",value:"a > b",children:[{data:[{value:"a > b,b > c \\Rightarrow a > c "},{value:"a > b,c > d \\Rightarrow a+c > b+d "},{value:"a > b > 0,c > d > 0 \\Rightarrow ac bd "},{value:`\\begin{array}{c} \r
a \\gt b,c \\gt 0 \\Rightarrow ac \\gt bc \\ \r
a \\gt b,c \\lt 0 \\Rightarrow ac \\lt bc \r
\\end{array}`},{value:"\\left | a-b \\right | \\geqslant \\left | a \\right | -\\left | b \\right | "},{value:"-\\left | a \\right |\\leq a\\leqslant \\left | a \\right | "},{value:"\\left | a \\right |\\leqslant b \\Rightarrow -b \\leqslant a \\leqslant \\left | b \\right | "},{value:"\\left | a+b \\right | \\leqslant \\left | a \\right | + \\left | b \\right | "},{value:`\\begin{array}{c} \r
a \\gt b \\gt 0,n \\in N^{\\ast},n \\gt 1 \\ \r
\\Rightarrow a^{n}\\gt b^{n}, \\sqrt[n]{a}\\gt \\sqrt[n]{b} \r
\\end{array}`},{value:`\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2}\\leq \r
\\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) `},{value:`\\begin{array}{c} \r
a,b \\in R^{+} \\ \r
\\Rightarrow \\frac{a+b}{{2}}\\ge \\sqrt{ab} \\ \r
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
\\end{array}`},{value:`\\begin{array}{c} \r
a,b \\in R \\ \r
\\Rightarrow a^{2}+b^{2}\\gt 2ab \\ \r
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
\\end{array}`},{value:`\\begin{array}{c} \r
H_{n}=\\frac{n}{\\sum \\limits_{i=1}^{n}\\frac{1}{x_{i}}}= \\frac{n}{\\frac{1}{x_{1}}+ \\frac{1}{x_{2}}+ \\cdots + \\frac{1}{x_{n}}} \\ G_{n}=\\sqrt[n]{\\prod \\limits_{i=1}^{n}x_{i}}= \\sqrt[n]{x_{1}x_{2}\\cdots x_{n}} \\ A_{n}=\\frac{1}{n}\\sum \\limits_{i=1}^{n}x_{i}=\\frac{x_{1}+ x_{2}+ \\cdots + x_{n}}{n} \\ Q_{n}=\\sqrt{\\sum \\limits_{i=1}^{n}x_{i}^{2}}= \\sqrt{\\frac{x_{1}^{2}+ x_{2}^{2}+ \\cdots + x_{n}^{2}}{n}} \\ H_{n}\\leq G_{n}\\leq A_{n}\\leq Q_{n} \r
\\end{array}`}]}]},{name:"\u79EF\u5206",value:"\\frac{\\mathrm{d}\\partial}{\\partial x}",children:[{data:[{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}x^n=nx^{n-1} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}e^{ax}=a\\,e^{ax} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\ln(x)=\\frac{1}{x} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\sin x=\\cos x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cos x=-\\sin x "},{value:"\\int k\\mathrm{d}x = kx+C "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\tan x=\\sec^2 x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cot x=-\\csc^2 x "},{value:"\\int \\frac{1}{x}\\mathrm{d}x= \\ln \\left| x \\right| +C "},{value:"\\int \\frac{1}{\\sqrt{1-x^{2}}}\\mathrm{d}x= \\arcsin x +C "},{value:"\\int \\frac{1}{1+x^{2}}\\mathrm{d}x= \\arctan x +C "},{value:"\\int u \\frac{\\mathrm{d}v}{\\mathrm{d}x}\\,\\mathrm{d}x=uv-\\int \\frac{\\mathrm{d}u}{\\mathrm{d}x}v\\,\\mathrm{d}x "},{value:"f(x) = \\int_{-\\infty}^\\infty \\hat f(x)\\xi\\,e^{2 \\pi i \\xi x} \\,\\mathrm{d}\\xi "},{value:"\\int x^{\\mu}\\mathrm{d}x=\\frac{x^{\\mu +1}}{\\mu +1}+C, \\left({\\mu \\neq -1}\\right) "}]}]},{name:"\u4E09\u89D2",value:"e^{i \\theta}",children:[{name:"\u6C42\u548C Summation",data:[{value:"e^{i \\theta} "},{value:"\\left(\\frac{\\pi}{2}-\\theta \\right ) "},{value:"\\text{sin}^{2}\\frac{\\alpha}{2}=\\frac{1- \\text{cos}\\alpha}{2} "},{value:"\\text{cos}^{2}\\frac{\\alpha}{2}=\\frac{1+ \\text{cos}\\alpha}{2} "},{value:"\\text{tan}\\frac{\\alpha}{2}=\\frac{\\text{sin}\\alpha}{1+ \\text{cos}\\alpha} "},{value:"\\sin \\alpha + \\sin \\beta =2 \\sin \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\sin \\alpha - \\sin \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha + \\cos \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha - \\cos \\beta =-2\\sin \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"a^{2}=b^{2}+c^{2}-2bc\\cos A "},{value:"\\frac{\\sin A}{a}=\\frac{\\sin B}{b}=\\frac{\\sin C}{c}=\\frac{1}{2R} "},{value:"\\sin \\left ( \\frac{\\pi}{2}-\\alpha \\right ) = \\cos \\alpha "},{value:"\\sin \\left ( \\frac{\\pi}{2}+\\alpha \\right ) = \\cos \\alpha "}]}]},{name:"\u7EDF\u8BA1",value:"C_{r}^{n}",children:[{data:[{value:"C_{r}^{n} "},{value:"\\frac{n!}{r!(n-r)!} "},{value:"\\sum_{i=1}^{n}{X_i} "},{value:"\\sum_{i=1}^{n}{X_i^2} "},{value:"X_1, \\cdots,X_n "},{value:"\\frac{x-\\mu}{\\sigma} "},{value:"\\sum_{i=1}^{n}{(X_i - \\overline{X})^2} "},{value:`\\begin{array}{c} \r
\\text{\u82E5}P \\left( AB \\right) =P \\left( A \\right) P \\left( B \\right) \\\\ \r
\\text{\u5219}P \\left( A \\left| B\\right. \\right) =P \\left({B}\\right) \r
\\end{array}`},{value:"P(E) ={n \\choose k}p^k (1-p)^{n-k} "},{value:"P \\left( A \\right) = \\lim \\limits_{n \\to \\infty}f_{n}\\left ( A \\right ) "},{value:"P \\left( \\bigcup \\limits_{i=1}^{+ \\infty}A_{i}\\right) = \\prod \\limits_{i=1}^{+ \\infty}P{\\left( A_{i}\\right)} "},{value:`\\begin{array}{c} \r
P \\left( \\emptyset \\right) =0 \\\\ \r
P \\left( S \\right) =1 \r
\\end{array}`},{value:`\\begin{array}{c} \r
\\forall A \\in S \\\\ \r
P \\left( A \\right) \\ge 0 \r
\\end{array}`},{value:"P \\left( \\bigcup \\limits_{i=1}^{n}A_{i}\\right) = \\prod \\limits_{i=1}^{n}P \\left( A_{i}\\right) "},{value:`\\begin{array}{c} \r
S= \\binom{N}{n},A_{k}=\\binom{M}{k}\\cdot \\binom{N-M}{n-k} \\\\ \r
P\\left ( A_{k}\\right ) = \\frac{\\binom{M}{k}\\cdot \\binom{N-M}{n-k}}{\\binom{N}{n}} \r
\\end{array}`},{value:`\\begin{array}{c} \r
P_{n}=n! \\\\ \r
A_{n}^{k}=\\frac{n!}{\\left( n-k \\left) !\\right. \\right.} \r
\\end{array}`}]}]}],kt=R=>{mt.current.setValue(mt.current.getValue()+" "+R.value+" ")},Se=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:g.createElement(de.Z,{className:re.Z.lists,gutter:[10,10]},G.map((R,Mt)=>g.createElement(V.Z,{flex:"110px",className:re.Z.item},g.createElement("div",null,g.createElement(Z.Z,{value:`$$${R.value}$$`}),R.name),g.createElement("div",{className:re.Z.children},R.children.map((Ye,pe)=>g.createElement("div",{key:pe},g.createElement("h1",null,Ye.name),g.createElement(de.Z,{gutter:[10,10]},Ye.data.map((qe,it)=>g.createElement(V.Z,{key:it,onClick:()=>kt(qe),className:re.Z.diamond},g.createElement(Z.Z,{value:"`$$"+qe.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:g.createElement(de.Z,{className:re.Z.lists,gutter:[10,10]},ut.map((R,Mt)=>g.createElement(V.Z,{flex:"110px",className:re.Z.item},g.createElement("div",null,g.createElement(Z.Z,{value:"`$$"+R.value+"$$`"}),R.name),g.createElement("div",{className:re.Z.children},R.children.map((Ye,pe)=>g.createElement("div",{key:pe},Ye.name&&g.createElement("h1",null,Ye.name),g.createElement(de.Z,{gutter:[10,10]},Ye.data.map((qe,it)=>g.createElement(V.Z,{key:it,onClick:()=>kt(qe),className:re.Z.diamond},g.createElement(Z.Z,{value:"`$$"+qe.value+"$$`"}))))))))))}],N=()=>{var R=document.createElement("div");R.innerHTML=mt.current.getValue();var Mt=R.innerText;return fe&&fe(Mt),Mt};return(0,q.useImperativeHandle)(Me,()=>({getData:N})),g.createElement("div",{className:re.Z.mathWrap},g.createElement(Ke.default,{defaultActiveKey:"1",items:Se}),g.createElement("math-field",{locale:"zh_cn",className:re.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:mt,style:{width:800,marginTop:30,fontSize:18}},wt||""),le&&g.createElement("div",{className:re.Z.button},g.createElement(De.ZP,{size:"large",onClick:N,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});Ge.Z=ke},52:function(Tt,Ge,P){"use strict";P.r(Ge),P.d(Ge,{default:function(){return at}});var q=P(67294),de=P(35973),V=P(69677),Ke=P(2453),De=P(9430),Z=P(83062),re=P(71230),p=P(15746),g=P(78045),ke=P(96074),fe=P(57953),le=P(85673),wt=P(71577),Me=P(85418),mt=P(14446),G={flex_box_center:"flex_box_center___maKAy",flex_space_between:"flex_space_between___vD_VZ",flex_box_vertical_center:"flex_box_vertical_center___kwkiV",flex_box_center_end:"flex_box_center_end___BdkbU",flex_box_column:"flex_box_column___meEQB",bg:"bg___vBzoO",wrap:"wrap___rrSkg",programTitle:"programTitle___kPWjL",btnWrapper:"btnWrapper___F_tyj",btn:"btn___ToWSe",titleForExport:"titleForExport___lhBnq",flexRow:"flexRow___cvXQo",flexColumn:"flexColumn___cTDFf",flexJustifyBetween:"flexJustifyBetween___vy_7r",relative:"relative____B_F8",questionNumber:"questionNumber___V4g28",score:"score___dNKpj",selectTopicButton:"selectTopicButton___NO9DO",line:"line___j553x",dragTip:"dragTip___AaESI",typeActive:"typeActive___dLHVW",mouseTypeActive:"mouseTypeActive___N_Yv8",typeName:"typeName___bdcw3",typeNumber:"typeNumber___B6Fic",typeAction:"typeAction___O3dpz",setScore:"setScore___GA5cK",delete:"delete___O2OvN",modal:"modal___0ENtb",table:"table___ZRr4b",glassSeal:"glassSeal___C7Vpa",export_type_modal:"export_type_modal___ldAtg",export_type_modal_con:"export_type_modal_con___Y9iST",type_item:"type_item___cWirW",img_warp:"img_warp___G7xtB",img_warp_active:"img_warp_active___rw33a",divname:"divname___RLHHc"},ut=P(31814),kt=P(76553),Se=P(56443),N=P(52810),R=P(98769),Mt=P(28706),Ye=P(15835),pe=P(85725),qe=P(19575),it=P(71573),dr=P(35713),Rt=P(60580),ye=P(33170),b=P(67294),F=Object.defineProperty,H=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,We=(B,ne,Q)=>ne in B?F(B,ne,{enumerable:!0,configurable:!0,writable:!0,value:Q}):B[ne]=Q,Mr=(B,ne)=>{for(var Q in ne||(ne={}))se.call(ne,Q)&&We(B,Q,ne[Q]);if(H)for(var Q of H(ne))Ce.call(ne,Q)&&We(B,Q,ne[Q]);return B},nt=(B,ne,Q)=>new Promise((Qe,Ue)=>{var Yt=st=>{try{Qt(Q.next(st))}catch(St){Ue(St)}},qt=st=>{try{Qt(Q.throw(st))}catch(St){Ue(St)}},Qt=st=>st.done?Qe(st.value):Promise.resolve(st.value).then(Yt,qt);Qt((Q=Q.apply(B,ne)).next())});const{TextArea:hr}=V.default,ie={0:"\u5355\u9009\u9898",1:"\u591A\u9009\u9898",2:"\u5224\u65AD\u9898",3:"\u586B\u7A7A\u9898",4:"\u7B80\u7B54\u9898"},me=["A\uFF0E","B\uFF0E","C\uFF0E","D\uFF0E","E\uFF0E","F\uFF0E","G\uFF0E","H\uFF0E","I\uFF0E","J\uFF0E","K\uFF0E","L\uFF0E","M\uFF0E","N\uFF0E","O\uFF0E","P\uFF0E","Q\uFF0E","R\uFF0E","S\uFF0E","T\uFF0E","U\uFF0E","V\uFF0E","W\uFF0E","X\uFF0E","Y\uFF0E","Z\uFF0E"],J=({newExercisePaper:B,isExportBlank:ne=!1,paperlibrary:Q,user:Qe,globalSetting:Ue,loading:Yt,dispatch:qt})=>{var Qt,st,St,xe,Ft,Sr,Wr,Te,si,Ai,Li,Bi,Ur;const Vn=(0,de.useLocation)(),Pt=(0,de.useParams)(),[Ct]=(0,de.useSearchParams)(),[M,zt]=(0,q.useState)(),Vt=(0,q.useRef)(),[Oe,Cr]=(0,q.useState)(),[Ve,fr]=(0,q.useState)(),[ot,gt]=(0,q.useState)([]),[er,pr]=(0,q.useState)(!1),[tr,Zr]=(0,q.useState)(""),[ee,j]=(0,q.useState)(!1),[Ht,rr]=(0,q.useState)(!1),Et=Ct.get("isIntelligentAssistant");(0,q.useEffect)(()=>(qt({type:"globalSetting/footerToggle",payload:!1}),()=>{qt({type:"globalSetting/footerToggle",payload:!0})}),[]),(0,q.useEffect)(()=>{Vt.current=Pt==null?void 0:Pt.id,zt(Ct.get("defaultActiveKey")||"0"),bt(),Ee(),mr()},[Pt==null?void 0:Pt.id]),(0,q.useEffect)(()=>{var x;if((x=B.exerciseExportHeadData)!=null&&x.title){const k=B.exerciseExportHeadData;Cr(Mr({},k||{}));const{table:_}=k||{};let dt,Ne;(_!=null&&_.total_singles_scores||_!=null&&_.total_doubles_scores||_!=null&&_.total_nulls_scores||_!=null&&_.total_judges_scores||_!=null&&_.total_pros_scores||_!=null&&_.total_shixuns_scores||_!=null&&_.total_mains_scores||_!=null&&_.total_combination_scores||_!=null&&_.total_bpros_scores)&&(dt=Number(_==null?void 0:_.total_singles_scores)+Number(_==null?void 0:_.total_doubles_scores)+Number(_==null?void 0:_.total_nulls_scores)+Number(_==null?void 0:_.total_judges_scores)+Number(_==null?void 0:_.total_pros_scores)+Number(_==null?void 0:_.total_shixuns_scores)+Number(_==null?void 0:_.total_mains_scores)+Number(_==null?void 0:_.total_combination_scores)+Number(_==null?void 0:_.total_bpros_scores)),(_!=null&&_.singles_scores||_!=null&&_.doubles_scores||_!=null&&_.nulls_scores||_!=null&&_.judges_scores||_!=null&&_.pros_scores||_!=null&&_.bpros_scores||_!=null&&_.shixuns_scores||_!=null&&_.mains_scores||_!=null&&_.combination_scores)&&(Ne=Number(_==null?void 0:_.singles_scores)+Number(_==null?void 0:_.doubles_scores)+Number(_==null?void 0:_.nulls_scores)+Number(_==null?void 0:_.judges_scores)+Number(_==null?void 0:_.pros_scores)+Number(_==null?void 0:_.bpros_scores)+Number(_==null?void 0:_.shixuns_scores)+Number(_==null?void 0:_.mains_scores)+Number(_==null?void 0:_.combination_scores));const lt=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:_==null?void 0:_.total_singles_scores,doubles_score:_==null?void 0:_.total_doubles_scores,nulls_score:_==null?void 0:_.total_nulls_scores,judges_score:_==null?void 0:_.total_judges_scores,pros_score:_==null?void 0:_.total_pros_scores,bpros_score:_==null?void 0:_.total_bpros_scores,shixuns_score:_==null?void 0:_.total_shixuns_scores,mains_score:_==null?void 0:_.total_mains_scores,combinations_score:_==null?void 0:_.total_combination_scores,total_score:dt},{key:"2",name:"\u5B9E\u5F97\u5206",singles_score:_==null?void 0:_.singles_scores,doubles_score:_==null?void 0:_.doubles_scores,nulls_score:_==null?void 0:_.nulls_scores,judges_score:_==null?void 0:_.judges_scores,pros_score:_==null?void 0:_.pros_scores,bpros_score:_==null?void 0:_.bpros_scores,shixuns_score:_==null?void 0:_.shixuns_scores,mains_score:_==null?void 0:_.mains_scores,combinations_score:_==null?void 0:_.combination_scores,total_score:Ne},{key:"3",name:"\u8BC4\u5377\u4EBA"}],Ot=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:_==null?void 0:_.total_singles_scores,doubles_score:_==null?void 0:_.total_doubles_scores,nulls_score:_==null?void 0:_.total_nulls_scores,judges_score:_==null?void 0:_.total_judges_scores,pros_score:_==null?void 0:_.total_pros_scores,bpros_score:_==null?void 0:_.total_bpros_scores,shixuns_score:_==null?void 0:_.total_shixuns_scores,mains_score:_==null?void 0:_.total_mains_scores,combinations_score:_==null?void 0:_.combination_scores,total_score:dt},{key:"2",name:"\u5B9E\u5F97\u5206"},{key:"3",name:"\u8BC4\u5377\u4EBA"}];fr([...ne?Ot:lt])}},[B.exerciseExportHeadData]);const mr=()=>nt(void 0,null,function*(){var x;const k=yield(0,Se.cV)({id:Pt.id});k.status==0&&gt(k.data),yield Ee(),Ct.get("exportPDF")&&((x=Q.paperData)!=null&&x.questionList)&&(Ke.ZP.info("\u6B63\u5728\u5BFC\u51FA\u7A7A\u767D\u8BD5\u5377pdf"),(0,kt.F)(Fe.current.children,"\u5BFC\u51FA\u8BD5\u5377"))}),Ee=()=>nt(void 0,null,function*(){const x=yield(0,Se.Dq)(Pt.id);Cr(x||{});const{table:k}=x||{};let _,dt;(k!=null&&k.total_singles_scores||k!=null&&k.total_doubles_scores||k!=null&&k.total_nulls_scores||k!=null&&k.total_judges_scores||k!=null&&k.total_pros_scores||k!=null&&k.total_shixuns_scores||k!=null&&k.total_mains_scores||k!=null&&k.total_combination_scores||k!=null&&k.total_bpros_scores)&&(_=Number(k==null?void 0:k.total_singles_scores)+Number(k==null?void 0:k.total_doubles_scores)+Number(k==null?void 0:k.total_nulls_scores)+Number(k==null?void 0:k.total_judges_scores)+Number(k==null?void 0:k.total_pros_scores)+Number(k==null?void 0:k.total_shixuns_scores)+Number(k==null?void 0:k.total_mains_scores)+Number(k==null?void 0:k.total_combination_scores)+Number(k==null?void 0:k.total_bpros_scores)),(k!=null&&k.singles_scores||k!=null&&k.doubles_scores||k!=null&&k.nulls_scores||k!=null&&k.judges_scores||k!=null&&k.pros_scores||k!=null&&k.bpros_scores||k!=null&&k.shixuns_scores||k!=null&&k.mains_scores||k!=null&&k.combinations_score)&&(dt=Number(k==null?void 0:k.singles_scores)+Number(k==null?void 0:k.doubles_scores)+Number(k==null?void 0:k.nulls_scores)+Number(k==null?void 0:k.judges_scores)+Number(k==null?void 0:k.pros_scores)+Number(k==null?void 0:k.bpros_scores)+Number(k==null?void 0:k.shixuns_scores)+Number(k==null?void 0:k.mains_scores)+Number(k==null?void 0:k.combinations_score));const Ne=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:k==null?void 0:k.total_singles_scores,doubles_score:k==null?void 0:k.total_doubles_scores,nulls_score:k==null?void 0:k.total_nulls_scores,judges_score:k==null?void 0:k.total_judges_scores,pros_score:k==null?void 0:k.total_pros_scores,bpros_score:k==null?void 0:k.total_bpros_scores,shixuns_score:k==null?void 0:k.total_shixuns_scores,combinations_score:k==null?void 0:k.total_combination_scores,mains_score:k==null?void 0:k.total_mains_scores,total_score:_},{key:"2",name:"\u5B9E\u5F97\u5206",singles_score:k==null?void 0:k.singles_scores,doubles_score:k==null?void 0:k.doubles_scores,nulls_score:k==null?void 0:k.nulls_scores,judges_score:k==null?void 0:k.judges_scores,pros_score:k==null?void 0:k.pros_scores,bpros_score:k==null?void 0:k.bpros_scores,shixuns_score:k==null?void 0:k.shixuns_scores,mains_score:k==null?void 0:k.mains_scores,combinations_score:k==null?void 0:k.combination_scores,total_score:dt},{key:"3",name:"\u8BC4\u5377\u4EBA"}];return fr(ne?[{key:"1",name:"\u5E94\u5F97\u5206"},{key:"2",name:"\u5B9E\u5F97\u5206"},{key:"3",name:"\u8BC4\u5377\u4EBA"}]:Ne),x}),Kt=[{width:"9%",title:"\u9898\u578B",align:"center",dataIndex:"name",render:x=>b.createElement("a",null,x)},{width:"9%",title:((Qt=ot.find(x=>x.value==N.fw[0].nameType))==null?void 0:Qt.name)||N.fw[0].name,align:"center",dataIndex:"singles_score",render:x=>b.createElement("a",null,x==="0.0"?0:x)},{width:"9%",title:((st=ot.find(x=>x.value==N.fw[1].nameType))==null?void 0:st.name)||N.fw[1].name,align:"center",dataIndex:"doubles_score",render:x=>b.createElement("a",null,x==="0.0"?0:x)},{width:"9%",title:((St=ot.find(x=>x.value==N.fw[3].nameType))==null?void 0:St.name)||N.fw[3].name,align:"center",dataIndex:"nulls_score",render:x=>b.createElement("a",null,x==="0.0"?0:x)},{width:"9%",title:((xe=ot.find(x=>x.value==N.fw[2].nameType))==null?void 0:xe.name)||N.fw[2].name,align:"center",dataIndex:"judges_score",render:x=>b.createElement("a",null,x==="0.0"?0:x)},{width:"9%",title:((Ft=ot.find(x=>x.value==N.fw[6].nameType))==null?void 0:Ft.name)||N.fw[6].name,align:"center",dataIndex:"pros_score",render:x=>b.createElement("a",null,x==="0.0"?0:x)},{width:"9%",title:((Sr=ot.find(x=>x.value==N.fw[5].nameType))==null?void 0:Sr.name)||N.fw[5].name,align:"center",dataIndex:"shixuns_score",render:x=>b.createElement("a",null,x==="0.0"?0:x)},{width:"9%",title:((Wr=ot.find(x=>x.value==N.fw[4].nameType))==null?void 0:Wr.name)||N.fw[4].name,align:"center",dataIndex:"mains_score",render:x=>b.createElement("a",null,x==="0.0"?0:x)},{width:"9%",title:((Te=ot.find(x=>x.value==N.fw[7].nameType))==null?void 0:Te.name)||N.fw[7].name,align:"center",dataIndex:"combinations_score",render:x=>b.createElement("a",null,x==="0.0"?0:x)},{width:"10%",title:((si=ot.find(x=>x.value==N.fw[8].nameType))==null?void 0:si.name)||N.fw[8].name,align:"center",dataIndex:"bpros_score",render:x=>b.createElement("a",null,x==="0.0"?0:x)},{width:"9%",title:"\u603B\u5206",align:"center",dataIndex:"total_score",render:x=>b.createElement("a",null,x==="0.0"?0:x?parseFloat(x).toFixed(1):"")}],bt=x=>{qt({type:"paperlibrary/getPaperData",payload:Mr({id:Vt.current},x)})},Nt=(x,k)=>nt(void 0,null,function*(){if(!x.destination||!x.source)return;const _=k.questions[x.source.index].id,dt=x.destination.index+1;(yield qt({type:"paperlibrary/adjustPosition",payload:{id:Vt.current,itemId:_,position:dt}})).status!==-1&&bt()}),Ie=()=>{qt({type:"paperlibrary/setActionTabs",payload:{key:"Paperlibrary-SendToClass",params:{id:Vt.current}}})},Fe=(0,q.useRef)(),[He,et]=(0,q.useState)(!0),ir=()=>nt(void 0,null,function*(){et(!1),Zr(""),pr(!0)}),Er=()=>nt(void 0,null,function*(){et(!0),Zr(""),pr(!0)}),cn=()=>nt(void 0,null,function*(){var x;j(!0);const k=yield(0,Ye.Mb)({categoryId:Vt.current});j(!1),k!=null&&k.exercise_id&&(0,Mt.xg)(`/classrooms/coursesId/exercise/${k.exercise_id}/${(x=Qe.userInfo)==null?void 0:x.login}/initate_answer`)}),Hn=(x,k,_)=>{var dt,Ne,lt,Ot,vt,oi,jn,jt,ht,br,Jr,Wn,Un,Zn,vr,Jn,Xn,Ti,$n,Gn,Fi;return b.createElement(b.Fragment,null,!_&&b.createElement("div",{style:{display:"flex"},className:G.programTitle},b.createElement("span",{style:{flexShrink:0},className:"font18"},k+1,"."),b.createElement(pe.Z,{style:{maxWidth:1100},value:x.name||(x==null?void 0:x.shixun_name)}),b.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",(x==null?void 0:x.question_type)===7?`\u5171${x==null?void 0:x.sub_count}\u5C0F\u9898`:""," ",x.score,"\u5206\uFF09")),(x==null?void 0:x.question_type)===8&&b.createElement(pe.Z,{showProgramFill:!0,disabledFill:!0,value:qe.Base64.decode(((dt=x==null?void 0:x.program_attr)==null?void 0:dt.code)||"")}),(x==null?void 0:x.question_type)===5&&b.createElement("div",null,(Ne=x==null?void 0:x.examination_bank_shixun_challenges)==null?void 0:Ne.map((he,Ae)=>b.createElement("div",null,b.createElement("div",{key:Ae,style:{background:"#F0F7FD",color:"#3061D0",fontSize:18,padding:10,marginBottom:10}},b.createElement("i",{className:"iconfont icon-renwuguanka1",style:{marginRight:5}}),"\u7B2C",Ae+1,"\u5173 ",b.createElement("span",{className:"ml10"},he.challenge_name))))),(x==null?void 0:x.question_type)===6&&b.createElement("div",null,b.createElement("div",{style:{fontWeight:600,marginTop:4}},"\u5141\u8BB8\u7F16\u7A0B\u7684\u8BED\u8A00\uFF1A",(Ot=(lt=x==null?void 0:x.program_attr)==null?void 0:lt.languages)==null?void 0:Ot.join("/")),((oi=(vt=Q==null?void 0:Q.paperData)==null?void 0:vt.exam)==null?void 0:oi.show_hack_sets)&&b.createElement("div",{style:{marginBottom:10,border:"1px solid #F1F4F9"}},b.createElement("p",{style:{padding:"0px 10px",height:40,lineHeight:"40px",background:"#F1F4F9",color:"#3061D0"}},b.createElement("i",{className:"iconfont icon-ceshiyongli"})," \u6D4B\u8BD5\u7528\u4F8B\uFF1A"),b.createElement(De.default,{style:{margin:10},columns:[{title:"\u5E8F\u53F7",dataIndex:"name",key:"name",width:"10%",render:(he,Ae,Wt)=>Wt+1},{title:"\u6D4B\u8BD5\u7528\u4F8B\u8F93\u5165",dataIndex:"input",key:"input",width:"40%",render:(he,Ae,Wt)=>b.createElement(Z.Z,{title:b.createElement("pre",null,he)},b.createElement("div",{className:G.divname},he))},{title:"\u6D4B\u8BD5\u7528\u4F8B\u8F93\u51FA",dataIndex:"output",key:"output",width:"40%",render:(he,Ae,Wt)=>b.createElement(Z.Z,{title:b.createElement("pre",null,he)}," ",b.createElement("div",{className:G.divname},he))},{title:"\u662F\u5426\u53EF\u89C1",dataIndex:"visibility_cn",key:"visibility_cn",width:"10%"}],pagination:!1,dataSource:(jn=x==null?void 0:x.program_attr)==null?void 0:jn.hack_sets})),((ht=(jt=Q==null?void 0:Q.paperData)==null?void 0:jt.exam)==null?void 0:ht.show_hack_description)&&b.createElement("div",null,b.createElement(pe.Z,{className:G.content,value:((br=x==null?void 0:x.program_attr)==null?void 0:br.description)||"- -"}))),x.question_type===it.c.Single&&b.createElement(b.Fragment,null,(Jr=x.choices)==null?void 0:Jr.map(function(he,Ae){return b.createElement(re.Z,{key:Ae},b.createElement(p.Z,{flex:"1"},b.createElement("div",{style:{display:"flex"}},b.createElement("div",{style:{lineHeight:"24px",flexShrink:0}},me[Ae]),b.createElement(pe.Z,{value:he.choice_text||""}))))})),x.question_type===it.c.Multiple&&b.createElement(b.Fragment,null,(Wn=x.choices)==null?void 0:Wn.map(function(he,Ae){return b.createElement(re.Z,{key:Ae},b.createElement(p.Z,{flex:"1"},b.createElement("div",{style:{display:"flex"}},b.createElement("div",{style:{lineHeight:"24px",flexShrink:0}},me[Ae]),b.createElement(pe.Z,{value:he.choice_text||""}))))})),x.question_type===it.c.Judge&&b.createElement("div",{className:G.flexRow},(Un=x.choices)==null?void 0:Un.map(function(he,Ae){return b.createElement(re.Z,{key:Ae},b.createElement(p.Z,{flex:"25px"},b.createElement("div",{style:{width:25,overflow:"hidden"}},b.createElement(g.ZP,{disabled:!0,style:{width:25,marginLeft:Ae===1&&10}}))),b.createElement(p.Z,{flex:"1",style:{marginLeft:Ae===1&&10}},he.choice_text))})),x.question_type===it.c.Combine&&b.createElement(b.Fragment,null,(Zn=x.sub_questions)==null?void 0:Zn.map(function(he,Ae){return b.createElement("div",{style:{marginLeft:10}},b.createElement("div",{style:{display:"flex"},className:G.programTitle},b.createElement("span",{style:{flexShrink:0},className:"font18"},k+1,".",Ae+1),b.createElement(pe.Z,{value:he.name||(he==null?void 0:he.shixun_name)}),b.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",he.score,"\u5206\uFF09")),Hn(he,Ae,!0))})),He&&b.createElement("div",{style:{marginTop:10}},(x==null?void 0:x.question_type)<3&&(x==null?void 0:x.standard_answer_show)&&b.createElement("span",{className:"font16 "},"\u6B63\u786E\u7B54\u6848\uFF1A",x==null?void 0:x.standard_answer_show),!!((vr=x==null?void 0:x.standard_answer)!=null&&vr.length)&&He&&(x==null?void 0:x.question_type)===3&&b.createElement("div",null,(Jn=x==null?void 0:x.standard_answer)==null?void 0:Jn.map((he,Ae)=>b.createElement("div",null,b.createElement("span",null,"\u53C2\u8003\u7B54\u6848\uFF1A\uFF08\u586B\u7A7A",Ae+1,"\uFF09:"),b.createElement("div",null,he.answer_text.map(function(Wt,qa){return b.createElement(p.Z,{span:24,key:qa},(he==null?void 0:he.model)===1?b.createElement(hr,{autoSize:!0,disabled:!0,value:Wt}):b.createElement(dr.Z,{value:Wt,disabled:!0}))}))))),!!((Xn=x==null?void 0:x.standard_answer)!=null&&Xn.length)&&He&&(x==null?void 0:x.question_type)===8&&b.createElement("div",null,(Ti=x==null?void 0:x.standard_answer)==null?void 0:Ti.map((he,Ae)=>b.createElement("div",null,b.createElement("span",null,"\u53C2\u8003\u7B54\u6848\uFF1A\uFF08\u586B\u7A7A",Ae+1,"\uFF09:"),b.createElement("div",null,b.createElement(hr,{autoSize:!0,disabled:!0,value:(he==null?void 0:he.answer_text)||""}))))),!!(($n=x==null?void 0:x.answer_texts)!=null&&$n.length)&&(x==null?void 0:x.question_type)===4&&b.createElement("div",null,b.createElement("p",{className:"mt10 mb0"},"\u53C2\u8003\u7B54\u6848\uFF1A"),b.createElement("div",{style:{border:"1px solid #eee",background:"#f5f5f5",borderRadius:4,padding:5}},b.createElement(pe.Z,{value:(Gn=x==null?void 0:x.answer_texts)==null?void 0:Gn[0]}))),(x==null?void 0:x.question_type)===6&&b.createElement("div",null,b.createElement("p",{className:"mt10 mb0"},"\u53C2\u8003\u7B54\u6848\uFF1A",!(x!=null&&x.answer_text)&&"\u6682\u65E0"),(x==null?void 0:x.answer_text)&&b.createElement("div",{style:{border:"1px solid #eee",background:"#f5f5f5",borderRadius:4,padding:5}},b.createElement(pe.Z,{value:x==null?void 0:x.answer_text}))),(x==null?void 0:x.question_type)<=4&&((x==null?void 0:x.standard_answer_show)||((Fi=x==null?void 0:x.standard_answer)==null?void 0:Fi.length)>0)&&b.createElement(re.Z,{style:{marginTop:14}},b.createElement("span",{className:"font16 "},"\u89E3\u6790\uFF1A"),b.createElement(pe.Z,{className:G.renderHtml,value:(x==null?void 0:x.analysis)||"\u6682\u65E0\u89E3\u6790"}))),!_&&b.createElement(ke.Z,null))},gr=(0,q.useCallback)(()=>{var x,k;return b.createElement("div",null,b.createElement("div",{className:G.titleForExport},(k=(x=Q.paperData)==null?void 0:x.exam)==null?void 0:k.name),b.createElement("div",{style:{textAlign:"center",fontSize:"15px"}},"\u5171:\u3010",Oe==null?void 0:Oe.large_counts,"\u5927\u9898\u3011\u3010",Oe==null?void 0:Oe.total_count,"\u5C0F\u9898\u3011\u3010 \u6EE1\u5206",Oe==null?void 0:Oe.score,"\u5206\u3011 \u8003\u8BD5\u65F6\u95F4\uFF1A\u3010",(Oe==null?void 0:Oe.time)>-1?`${Oe==null?void 0:Oe.time}\u5206\u949F`:"\u4E0D\u9650","\u3011"),!!(Oe!=null&&Oe.exercise_description)&&b.createElement("pre",{style:{fontSize:14,marginBottom:30,marginTop:20,textAlign:"left",color:"#3A3A3A"}},b.createElement("b",null,"\u8BD5\u5377\u987B\u77E5\uFF1A"),Oe==null?void 0:Oe.exercise_description),b.createElement(De.default,{style:{margin:"20px auto"},className:G.table,columns:Kt,dataSource:[...Ve||[]],bordered:!0,pagination:!1}))},[Q.paperData]),Di=()=>nt(void 0,null,function*(){const x=yield(0,ye.ZP)("/api/intelligent_imports/save_recognize_papers.json",{method:"post",body:{examination_bank_id:Pt==null?void 0:Pt.id}});(x==null?void 0:x.status)===0&&de.history.replace("/paperlibrary")});return b.createElement("section",{className:G.bg},b.createElement(fe.Z,{spinning:Yt["paperlibrary/getPaperData"]},b.createElement(re.Z,{className:"pt20",justify:"space-between"},b.createElement(le.Z,{separator:">"},b.createElement(le.Z.Item,{href:"/paperlibrary"},"\u8BD5\u5377\u5E93"),b.createElement(le.Z.Item,{href:`/paperlibrary?defaultActiveKey=${M}`},M==="1"?"\u516C\u5F00":M==="2"?"\u56E2\u961F\u5171\u4EAB":"\u6211\u521B\u5EFA\u7684"),b.createElement(le.Z.Item,null,"\u8BD5\u5377\u8BE6\u60C5")),b.createElement("div",{className:G.btnWrapper},!Et&&b.createElement(wt.ZP,{onClick:Ie,className:G.btn,icon:b.createElement("i",{className:"iconfont icon-fasongtongzhi font14"})},"\u53D1\u9001\u81F3\u8BFE\u5802"),b.createElement(wt.ZP,{onClick:()=>de.history.push(`/paperlibrary/add/${Vt.current}?type=2${Et?"&isIntelligentAssistant=true":""}`),className:G.btn,icon:b.createElement("i",{className:"iconfont icon-bianji10 font14"})},"\u7F16\u8F91\u8BD5\u5377"),b.createElement(wt.ZP,{loading:ee,onClick:cn,className:G.btn,icon:b.createElement("i",{className:"iconfont icon-monikaoshi2 font14"})},"\u6A21\u62DF\u8003\u8BD5"),!Et&&b.createElement(Me.Z,{menu:{items:[{key:"1",label:b.createElement("div",{onClick:Er},"\u5BFC\u51FA\u7A7A\u767D\u8BD5\u5377+\u7B54\u6848")},{key:"2",label:b.createElement("div",{onClick:ir},"\u5BFC\u51FA\u7A7A\u767D\u8BD5\u5377")}]}},b.createElement(wt.ZP,{type:"primary",icon:b.createElement("i",{className:"iconfont icon-daochu1 font14"})},"\u5BFC\u51FA")),Et&&b.createElement(Rt.Z,{onClick:Di,type:"primary",icon:b.createElement("i",{className:"iconfont icon-baocun1 font14"})},"\u4FDD\u5B58\u8BD5\u5377"))),b.createElement("div",{className:`${G.wrap} pt20 pb20`,ref:Fe,id:"paperDomRef"},!((Li=(Ai=Q.paperData)==null?void 0:Ai.questionList)!=null&&Li.length)&&gr(),(Ur=(Bi=Q.paperData)==null?void 0:Bi.questionList)==null?void 0:Ur.map((x,k)=>{var _;return b.createElement(b.Fragment,null,(_=x.questions)==null?void 0:_.map((dt,Ne)=>{const lt=Math.floor(Ne/10);return Ne%10===0?b.createElement("div",{className:"abc",key:`group-${lt}`},k===0&&Ne===0&&gr(),Ne===0&&b.createElement("div",null,b.createElement("span",{className:"font16 c-light-primary"},x.number,"\u3001",x.name),b.createElement("span",{className:"c-grey-999"},"\uFF08\u5171",x.questions_count,"\u9898\uFF0C",(x==null?void 0:x.question_type)===7?`\u5305\u542B${x==null?void 0:x.sub_count}\u5C0F\u9898\uFF1B`:"","\u5171",x.questions_score,"\u5206\uFF09")),x.questions.slice(Ne,Ne+10).map((Ot,vt)=>b.createElement("div",{key:Ot.id},Hn(Ot,Ne+vt)))):null}))}))),b.createElement(ut.Z,null),b.createElement(mt.default,{width:450,title:"\u8BF7\u9009\u62E9\u9700\u8981\u5BFC\u51FA\u7684\u683C\u5F0F",open:er,onCancel:()=>{if(Ht){Ke.ZP.info("\u5BFC\u51FA\u4E2D\u8BF7\u52FF\u5173\u95ED\u7A97\u53E3");return}pr(!1)},okButtonProps:{loading:Ht},onOk:()=>nt(void 0,null,function*(){var x,k;if(rr(!0),tr==""){rr(!1),Ke.ZP.info("\u8BF7\u9009\u62E9\u4E00\u79CD\u5BFC\u51FA\u683C\u5F0F");return}else tr=="pdf"?yield(0,kt.F)(Fe.current.children,(k=(x=Q.paperData)==null?void 0:x.exam)==null?void 0:k.name):tr=="word"&&(0,R.ON)({id:Vt.current,middle_export:1,export_type:He?1:0});rr(!1),pr(!1)})},b.createElement("div",{className:G.export_type_modal},b.createElement("div",{className:G.export_type_modal_con},b.createElement("div",{className:G.type_item},b.createElement("div",{className:`${G.img_warp} ${tr=="pdf"?G.img_warp_active:""}`,onClick:()=>Zr("pdf")},b.createElement("img",{src:P(45614),width:70,height:70})),"pdf\u683C\u5F0F"),b.createElement("div",{className:G.type_item},b.createElement("div",{className:`${G.img_warp} ${tr=="word"?G.img_warp_active:""}`,onClick:()=>Zr("word")},b.createElement("img",{src:P(38347),width:70,height:70})),"word\u683C\u5F0F")))))};var at=(0,de.connect)(({paperlibrary:B,user:ne,loading:Q,globalSetting:Qe,newExercisePaper:Ue})=>({paperlibrary:B,user:ne,globalSetting:Qe,loading:Q.effects,newExercisePaper:Ue}))(J)},31814:function(Tt,Ge,P){"use strict";P.d(Ge,{Z:function(){return hr}});var q=P(67294),de=P(35973),V=P(69677),Ke=P(2453),De=P(14446),Z=P(31795),re=P(46303),p=P(9430),g=P(71577),ke=P(14375),fe=Object.defineProperty,le=Object.getOwnPropertySymbols,wt=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,mt=(ie,me,J)=>me in ie?fe(ie,me,{enumerable:!0,configurable:!0,writable:!0,value:J}):ie[me]=J,G=(ie,me)=>{for(var J in me||(me={}))wt.call(me,J)&&mt(ie,J,me[J]);if(le)for(var J of le(me))Me.call(me,J)&&mt(ie,J,me[J]);return ie};const ut=ie=>React.createElement("svg",G({width:14,height:14,xmlns:"http://www.w3.org/2000/svg"},ie),React.createElement("title",null,"\u9009\u62E9\u5907\u4EFD 2"),React.createElement("path",{d:"M6.74 0a6.74 6.74 0 1 0 0 13.48A6.74 6.74 0 0 0 6.74 0Zm3.636 5.017L5.817 9.576c-.09.09-.246.08-.348-.023l-.306-.305L3.12 7.204a.263.263 0 0 1 0-.372l.557-.557a.262.262 0 0 1 .372 0l1.605 1.606 3.794-3.793c.09-.09.246-.08.348.022l.557.557c.103.103.113.259.023.349Z",fill:"#68C79F",fillRule:"nonzero"}));var kt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTYuNzQgMGE2Ljc0IDYuNzQgMCAxIDAgMCAxMy40OEE2Ljc0IDYuNzQgMCAwIDAgNi43NCAwWm0zLjYzNiA1LjAxN0w1LjgxNyA5LjU3NmMtLjA5LjA5LS4yNDYuMDgtLjM0OC0uMDIzbC0uMzA2LS4zMDVMMy4xMiA3LjIwNGEuMjYzLjI2MyAwIDAgMSAwLS4zNzJsLjU1Ny0uNTU3YS4yNjIuMjYyIDAgMCAxIC4zNzIgMGwxLjYwNSAxLjYwNiAzLjc5NC0zLjc5M2MuMDktLjA5LjI0Ni0uMDguMzQ4LjAyMmwuNTU3LjU1N2MuMTAzLjEwMy4xMTMuMjU5LjAyMy4zNDlaIiBmaWxsPSIjNjhDNzlGIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=",Se={flex_box_center:"flex_box_center___LsrKL",flex_space_between:"flex_space_between___sZBht",flex_box_vertical_center:"flex_box_vertical_center___QNt7D",flex_box_center_end:"flex_box_center_end___S9zs3",flex_box_column:"flex_box_column___Y5tcm",title:"title___t4qlt",tip:"tip___MtKbx",radioWrap:"radioWrap___fp3kY",row:"row___IoDN5",radio:"radio___vuEDI",colorFF0000:"colorFF0000____5DYm",pagination:"pagination___bvqCI",modalColumn:"modalColumn___szBPb",modalRow:"modalRow___mtd9M",sup:"sup___JDuYL",search:"search___wNY_F",bottom:"bottom___HvFhF",yes:"yes___xmznh",no:"no___vEJlu"},N=P(28706),R={sendToClass:"sendToClass___le_BX"},Mt="data:image/png;base64,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",Ye="data:image/png;base64,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",qe=({createState:ie,refreshLoading:me,onRefresh:J=()=>{},onCreate:at=()=>{}})=>q.createElement("div",{className:R.sendToClass},ie?q.createElement(q.Fragment,null,q.createElement("img",{src:Mt,alt:"\u7A7A"}),q.createElement("div",null,"\u60A8\u8FD8\u6CA1\u6709\u521B\u5EFA\u6559\u5B66\u8BFE\u5802\uFF0C\u65E0\u6CD5\u5C06\u8BD5\u5377\u53D1\u9001\u81F3\u6559\u5B66\u8BFE\u5802\u3002"),q.createElement(g.ZP,{onClick:at,type:"primary",ghost:!0},"\u7ACB\u5373\u521B\u5EFA")):q.createElement(q.Fragment,null,q.createElement("img",{src:Ye,alt:"\u7A7A"}),q.createElement("div",null,"\u5DF2\u521B\u5EFA\u6559\u5B66\u8BFE\u5802\uFF1F\u8BF7\u5237\u65B0\u5217\u8868"),q.createElement(g.ZP,{loading:me,onClick:J,type:"primary",ghost:!0},"\u7ACB\u5373\u5237\u65B0"))),it=P(93686),dr=P(60580),Rt=P(96486),ye=P(96332),b=P(67294),F=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable,Ce=(ie,me)=>{var J={};for(var at in ie)H.call(ie,at)&&me.indexOf(at)<0&&(J[at]=ie[at]);if(ie!=null&&F)for(var at of F(ie))me.indexOf(at)<0&&se.call(ie,at)&&(J[at]=ie[at]);return J},We=(ie,me,J)=>new Promise((at,B)=>{var ne=Ue=>{try{Qe(J.next(Ue))}catch(Yt){B(Yt)}},Q=Ue=>{try{Qe(J.throw(Ue))}catch(Yt){B(Yt)}},Qe=Ue=>Ue.done?at(Ue.value):Promise.resolve(Ue.value).then(ne,Q);Qe((J=J.apply(ie,me)).next())});const Mr=V.default.Search,nt=ie=>{var me=ie,{paperlibrary:J,globalSetting:at,loading:B,dispatch:ne}=me,Q=Ce(me,["paperlibrary","globalSetting","loading","dispatch"]),Qe,Ue,Yt;const[qt,Qt]=(0,q.useState)(""),[st,St]=(0,q.useState)([]),[xe,Ft]=(0,q.useState)([]),[Sr,Wr]=(0,q.useState)(!1),[Te,si]=(0,q.useState)(!0),[Ai,Li]=(0,q.useState)(!0),[Bi,Ur]=(0,q.useState)(!0),[Vn,Pt]=(0,q.useState)(!1),[Ct,M]=(0,q.useState)(!1),zt=(Yt=(Ue=(Qe=J.actionTabs)==null?void 0:Qe.params)==null?void 0:Ue.data)==null?void 0:Yt.is_random,[Vt,Oe]=(0,q.useState)(!1),[Cr,Ve]=(0,q.useState)({});(0,q.useEffect)(()=>{ot()},[]);const fr=()=>{Ft([]),Qt(""),ot(!0),ne({type:"paperlibrary/setActionTabs",payload:{}})},ot=ee=>We(void 0,null,function*(){Li(!0);const j=yield ne({type:"paperlibrary/getCourseList",payload:{search:ee?"":qt}});j&&(St((j==null?void 0:j.courses)||[]),si(!0),Pt(!1)),Li(!1),Ur(!1)}),gt=ee=>{const j=parseInt(ee);return(0,Rt.isNaN)(j)?"":j},er=()=>We(void 0,null,function*(){var ee,j,Ht,rr,Et,mr,Ee;if(!xe.length){Ke.ZP.info("\u60A8\u9700\u8981\u9009\u62E9\u8BFE\u5802\uFF0C\u624D\u80FD\u53D1\u9001"),Wr(!0);return}const Kt=yield ne({type:"paperlibrary/postExistCourse",payload:{course_id:zt?xe==null?void 0:xe[0]:xe,examination_bank_ids:((j=(ee=J.actionTabs)==null?void 0:ee.params)==null?void 0:j.examination_bank_ids)||((rr=(Ht=J.actionTabs)==null?void 0:Ht.params)==null?void 0:rr.id)}}),bt=()=>We(void 0,null,function*(){var Nt,Ie,Fe,He,et,ir;M(!0);let Er=yield(0,it.Tr)({id:(Ie=(Nt=J.actionTabs)==null?void 0:Nt.params)==null?void 0:Ie.id,course_id:zt?xe==null?void 0:xe[0]:xe,type:(He=(Fe=J.actionTabs)==null?void 0:Fe.params)!=null&&He.isBatch?"batch_examination_bank":"examination_bank",examination_bank_ids:(ir=(et=J.actionTabs)==null?void 0:et.params)==null?void 0:ir.examination_bank_ids});M(!1),(Er==null?void 0:Er.student_count)===0?yield pr([]):Ve(Er),yield new Promise(cn=>setTimeout(()=>cn(),1e3))});if(Kt.status==0&&((Et=Kt.data)==null?void 0:Et.count)>0){De.default.confirm({icon:null,title:"\u63D0\u793A",centered:!0,width:596,content:b.createElement("div",{style:{userSelect:"none"}},"\u5F53\u524D\u6559\u5B66\u8BFE\u5802\u4E2D\u5DF2\u5B58\u5728\u8BD5\u5377",(Ee=(mr=Kt.data)==null?void 0:mr.list)==null?void 0:Ee.map((Nt,Ie)=>{var Fe;return b.createElement(b.Fragment,null,b.createElement("span",{style:{color:"#FA6400"}},"\u300A",Nt==null?void 0:Nt.name,"\u300B"),Ie!==((Fe=Kt.data)==null?void 0:Fe.count)-1&&b.createElement("span",null,"\u3001"))}),"\uFF0C\u8BF7\u786E\u5B9A\u662F\u5426\u9700\u8981\u91CD\u590D\u53D1\u9001\uFF1F"),onOk:()=>We(void 0,null,function*(){yield bt()})}),yield new Promise(Nt=>setTimeout(()=>Nt(),1e3));return}yield bt()}),pr=ee=>We(void 0,null,function*(){var j,Ht,rr,Et,mr,Ee;if(!zt){Oe(!0);const Ie=yield ne({type:(Ht=(j=J.actionTabs)==null?void 0:j.params)!=null&&Ht.isBatch?"paperlibrary/postBatchSendToCourse":"paperlibrary/sendToClass",payload:{course_id:zt?xe==null?void 0:xe[0]:xe,id:(Et=(rr=J.actionTabs)==null?void 0:rr.params)==null?void 0:Et.id,examination_bank_ids:(Ee=(mr=J.actionTabs)==null?void 0:mr.params)==null?void 0:Ee.examination_bank_ids,shixuns_info:ee.map(Fe=>({shixun_id:Fe.id,is_copy:Fe.is_copy,is_use:Fe.is_use,course_id:Fe.course_id}))}});Oe(!1),Ie&&Ie.status===0&&(ne({type:"paperlibrary/setActionTabs",payload:{}}),Ft([]),De.default.confirm({title:"\u63D0\u793A",okText:"\u7ACB\u5373\u524D\u5F80",cancelText:"\u7A0D\u540E\u518D\u8BF4",width:480,centered:!0,closable:!0,onOk:()=>{window.location.href=`${Ie.data[0].first_category_url}`},content:b.createElement("p",null,"\u8BD5\u5377\u53D1\u9001\u6210\u529F\uFF01\u76EE\u524D\u5904\u4E8E\u672A\u53D1\u5E03\u72B6\u6001\uFF0C\u662F\u5426\u524D\u5F80\u6559\u5B66\u8BFE\u5802\u8FDB\u884C\u53D1\u5E03\uFF1F")}),Ke.ZP.success("\u53D1\u9001\u6210\u529F"));return}Oe(!0),setTimeout(()=>{Oe(!1)},500);const Kt=st.find(Ie=>Ie.course_id===(xe==null?void 0:xe[0]));let bt=1,Nt=De.default.confirm({icon:null,className:"custom-modal-divider",centered:!0,width:500,maskClosable:!1,keyboard:!1,cancelButtonProps:{disabled:!1},title:"\u914D\u7F6E\u51FA\u5377\u6570\u91CF",content:b.createElement("div",{className:Se.modalColumn},b.createElement("div",{style:{color:"#676A6C",display:"flex",alignItems:"center"},className:"font14 mt20 mb10"},b.createElement("img",{style:{marginRight:5},src:ke.Z}),"\u968F\u673A\u7EC4\u5377\u7C7B\u578B\u7684\u8BD5\u5377\u6309\u7167\u51FA\u5377\u6570\u91CF\u5BF9\u6307\u5B9A\u8BFE\u5802\u751F\u6210\u4E0D\u91CD\u590D\u7684\u8BD5\u5377\u3002"),b.createElement("div",{style:{paddingLeft:18}},"\u8BFE\u5802\u540D\u79F0: ",Kt==null?void 0:Kt.course_name),b.createElement("div",{style:{paddingLeft:9},className:Se.modalRow},b.createElement("sup",{className:Se.sup},"*"),b.createElement("span",{style:{flexShrink:0}},"\u968F\u673A\u51FA\u5377\u6570\u91CF\uFF1A"),b.createElement(Z.Z,{parser:gt,style:{width:120},placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u6570\u91CF",min:1,defaultValue:bt,onChange:Ie=>{bt=Ie;const Fe=document.getElementById("model_error");bt<1||bt>50?Fe.style.display="block":Fe.style.display="none"}})),b.createElement("div",{style:{display:"none",marginLeft:115},id:"model_error",className:"c-red"},"\u8BF7\u8F93\u51651-50\u4E4B\u95F4\u7684\u6574\u6570")),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onCancel:fr,onOk:()=>We(void 0,null,function*(){var Ie,Fe;if(bt<1||bt>50){const et=document.getElementById("model_error");return et.style.display="block",Promise.reject()}Nt.update({cancelButtonProps:{disabled:!0}});const He=yield ne({type:"paperlibrary/sendToClass",payload:{course_id:xe==null?void 0:xe[0],id:(Fe=(Ie=J.actionTabs)==null?void 0:Ie.params)==null?void 0:Fe.id,num:bt,shixuns_info:ee.map(et=>({shixun_id:et.id,is_copy:et.is_copy,is_use:et.is_use}))}});Nt.update({cancelButtonProps:{disabled:!1}}),He&&He.status===0&&(De.default.destroyAll(),De.default.confirm({icon:null,className:"custom-modal-divider",centered:!0,width:500,title:"\u63D0\u793A",content:b.createElement("div",{className:Se.modalColumn},b.createElement("div",{style:{color:"#676A6C",display:"flex",alignItems:"center"},className:"font14 mt20 mb10"},b.createElement("img",{style:{marginRight:5},src:kt}),"\u751F\u6210\u8BD5\u5377\u6210\u529F\uFF0C\u524D\u5F80\u8BFE\u5802\u53BB\u67E5\u770B\u5427\uFF01")),okText:"\u524D\u5F80\u8BFE\u5802",cancelText:"\u8FD4\u56DE\u8BD5\u5377\u5E93",onCancel:()=>{fr()},onOk:()=>{fr(),setTimeout(()=>{var et,ir;const Er=(ir=(et=He==null?void 0:He.first_category_url)==null?void 0:et.split("/"))==null?void 0:ir[2];(0,N.xg)(`/classrooms/${Er}/exercise`)},1e3)}}))})})}),tr=()=>We(void 0,null,function*(){Pt(!0),yield ot()}),Zr=[{title:"\u8BFE\u5802\u540D\u79F0",dataIndex:"course_name",ellipsis:!0},{title:"\u5206\u73ED\u6570\u91CF",dataIndex:"course_group_count",width:90,ellipsis:!0},{title:"\u5B66\u5458\u4EBA\u6570",dataIndex:"course_member_count",width:90,ellipsis:!0}];return b.createElement("div",null,b.createElement(De.default,{centered:!0,keyboard:!1,closable:!1,open:J.actionTabs.key==="Paperlibrary-SendToClass",title:"\u53D1\u9001\u81F3\u8BFE\u5802",maskClosable:!1,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:B["paperlibrary/sendToClass"]||Ct||!!B["paperlibrary/postExistCourse"],width:752,footer:!1,onOk:er,destroyOnClose:!0,onCancel:fr},b.createElement("div",{className:Se.wrap},b.createElement("div",{className:"mb10"},b.createElement(Mr,{placeholder:"\u8F93\u5165\u8BFE\u5802\u540D\u79F0\u7684\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22",value:qt,className:Se.search,onChange:ee=>{Qt(ee.target.value),ee.target.value||ot(!0)},onSearch:ee=>{Qt(ee),ot(),Ft([])}})),b.createElement(re.Z,{loading:Bi},st.length?b.createElement("div",{className:Se.radioWrap},b.createElement(p.default,{bordered:!1,scroll:(st==null?void 0:st.length)<=7?{}:{y:350},loading:Ai,rowKey:"course_id",pagination:!1,dataSource:st,columns:Zr,onRow:ee=>({onClick:j=>{if(zt)Ft([ee==null?void 0:ee.course_id]);else{if(!zt&&!xe.includes(ee.course_id)&&xe.length>0)return;xe!=null&&xe.includes(ee==null?void 0:ee.course_id)?Ft(xe==null?void 0:xe.filter(Ht=>Ht!==(ee==null?void 0:ee.course_id))):Ft([...xe,ee==null?void 0:ee.course_id])}}}),rowSelection:{type:"radio",hideSelectAll:!0,selectedRowKeys:xe,onChange:ee=>{Ft(ee),Wr(!1)}}})):!qt&&!Ai&&b.createElement(qe,{createState:Te,refreshLoading:Vn,onRefresh:tr,onCreate:()=>{si(!1),(0,N.xg)("/classrooms/new")}})),Sr&&b.createElement("div",{className:Se.colorFF0000},"\u8BF7\u5148\u9009\u62E9\u8BFE\u5802"),b.createElement("div",{className:Se.bottom,style:{display:"flex",alignItems:"center"}},b.createElement("div",{style:{flex:1}},b.createElement("div",{className:Se.title},b.createElement("img",{src:ke.Z,style:{objectFit:"contain"}}),"\u9009\u62E9\u7684\u8BD5\u5377\u5C06\u4F1A\u53D1\u9001\u5230\u6307\u5B9A\u8BFE\u5802\u5E76\u4E3A\u73ED\u7EA7\u5B66\u5458\u751F\u6210\u8003\u8BD5\u8BD5\u5377")),b.createElement("div",null,b.createElement(g.ZP,{onClick:fr,className:Se.no,style:{marginRight:20}},"\u53D6\u6D88"),b.createElement(dr.Z,{onClick:er,className:Se.yes},"\u786E\u8BA4"))))),b.createElement(ye.Z,{resdata:Cr,type:"exercise",okloading:Vt,oktext:(Cr==null?void 0:Cr.can_copy_num)===0?"\u786E\u5B9A":"\u4E00\u952E\u590D\u5236\u5E76\u66FF\u6362",onok:ee=>{pr(ee)}}))};var hr=(0,de.connect)(({paperlibrary:ie,loading:me,globalSetting:J})=>({paperlibrary:ie,globalSetting:J,loading:me.effects}))(nt)},71573:function(Tt,Ge,P){"use strict";P.d(Ge,{c:function(){return de}});var q=(V=>(V.FirstPage="firstPage",V.PrevPage="prevPage",V.NextPage="nextPage",V))(q||{}),de=(V=>(V[V.Single=0]="Single",V[V.Multiple=1]="Multiple",V[V.Judge=2]="Judge",V[V.Fill=3]="Fill",V[V.Subjective=4]="Subjective",V[V.Shixun=5]="Shixun",V[V.Program=6]="Program",V[V.Combine=7]="Combine",V))(de||{})},19575:function(Tt,Ge,P){var q,de;(function(V,Ke){Tt.exports=Ke(V)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof P.g!="undefined"?P.g:this,function(V){"use strict";V=V||{};var Ke=V.Base64,De="2.6.4",Z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",re=function(F){for(var H={},se=0,Ce=F.length;se<Ce;se++)H[F.charAt(se)]=se;return H}(Z),p=String.fromCharCode,g=function(F){if(F.length<2){var H=F.charCodeAt(0);return H<128?F:H<2048?p(192|H>>>6)+p(128|H&63):p(224|H>>>12&15)+p(128|H>>>6&63)+p(128|H&63)}else{var H=65536+(F.charCodeAt(0)-55296)*1024+(F.charCodeAt(1)-56320);return p(240|H>>>18&7)+p(128|H>>>12&63)+p(128|H>>>6&63)+p(128|H&63)}},ke=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,fe=function(F){return F.replace(ke,g)},le=function(F){var H=[0,2,1][F.length%3],se=F.charCodeAt(0)<<16|(F.length>1?F.charCodeAt(1):0)<<8|(F.length>2?F.charCodeAt(2):0),Ce=[Z.charAt(se>>>18),Z.charAt(se>>>12&63),H>=2?"=":Z.charAt(se>>>6&63),H>=1?"=":Z.charAt(se&63)];return Ce.join("")},wt=V.btoa&&typeof V.btoa=="function"?function(F){return V.btoa(F)}:function(F){if(F.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return F.replace(/[\s\S]{1,3}/g,le)},Me=function(F){return wt(fe(String(F)))},mt=function(F){return F.replace(/[+\/]/g,function(H){return H=="+"?"-":"_"}).replace(/=/g,"")},G=function(F,H){return H?mt(Me(F)):Me(F)},ut=function(F){return G(F,!0)},kt;V.Uint8Array&&(kt=function(F,H){for(var se="",Ce=0,We=F.length;Ce<We;Ce+=3){var Mr=F[Ce],nt=F[Ce+1],hr=F[Ce+2],ie=Mr<<16|nt<<8|hr;se+=Z.charAt(ie>>>18)+Z.charAt(ie>>>12&63)+(typeof nt!="undefined"?Z.charAt(ie>>>6&63):"=")+(typeof hr!="undefined"?Z.charAt(ie&63):"=")}return H?mt(se):se});var Se=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,N=function(F){switch(F.length){case 4:var H=(7&F.charCodeAt(0))<<18|(63&F.charCodeAt(1))<<12|(63&F.charCodeAt(2))<<6|63&F.charCodeAt(3),se=H-65536;return p((se>>>10)+55296)+p((se&1023)+56320);case 3:return p((15&F.charCodeAt(0))<<12|(63&F.charCodeAt(1))<<6|63&F.charCodeAt(2));default:return p((31&F.charCodeAt(0))<<6|63&F.charCodeAt(1))}},R=function(F){return F.replace(Se,N)},Mt=function(F){var H=F.length,se=H%4,Ce=(H>0?re[F.charAt(0)]<<18:0)|(H>1?re[F.charAt(1)]<<12:0)|(H>2?re[F.charAt(2)]<<6:0)|(H>3?re[F.charAt(3)]:0),We=[p(Ce>>>16),p(Ce>>>8&255),p(Ce&255)];return We.length-=[0,0,2,1][se],We.join("")},Ye=V.atob&&typeof V.atob=="function"?function(F){return V.atob(F)}:function(F){return F.replace(/\S{1,4}/g,Mt)},pe=function(F){return Ye(String(F).replace(/[^A-Za-z0-9\+\/]/g,""))},qe=function(F){return R(Ye(F))},it=function(F){return String(F).replace(/[-_]/g,function(H){return H=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},dr=function(F){return qe(it(F))},Rt;V.Uint8Array&&(Rt=function(F){return Uint8Array.from(pe(it(F)),function(H){return H.charCodeAt(0)})});var ye=function(){var F=V.Base64;return V.Base64=Ke,F};if(V.Base64={VERSION:De,atob:pe,btoa:wt,fromBase64:dr,toBase64:G,utob:fe,encode:G,encodeURI:ut,btou:R,decode:dr,noConflict:ye,fromUint8Array:kt,toUint8Array:Rt},typeof Object.defineProperty=="function"){var b=function(F){return{value:F,enumerable:!1,writable:!0,configurable:!0}};V.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",b(function(){return dr(this)})),Object.defineProperty(String.prototype,"toBase64",b(function(F){return G(this,F)})),Object.defineProperty(String.prototype,"toBase64URI",b(function(){return G(this,!0)}))}}return V.Meteor&&(Base64=V.Base64),Tt.exports?Tt.exports.Base64=V.Base64:(q=[],de=function(){return V.Base64}.apply(Ge,q),de!==void 0&&(Tt.exports=de)),{Base64:V.Base64}})},84279:function(Tt,Ge,P){"use strict";var q=Object.defineProperty,de=Object.defineProperties,V=Object.getOwnPropertyDescriptors,Ke=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable,re=(e,t,r)=>t in e?q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,p=(e,t)=>{for(var r in t||(t={}))De.call(t,r)&&re(e,r,t[r]);if(Ke)for(var r of Ke(t))Z.call(t,r)&&re(e,r,t[r]);return e},g=(e,t)=>de(e,V(t)),ke=e=>typeof e=="symbol"?e:e+"",fe=(e,t)=>{var r={};for(var i in e)De.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&Ke)for(var i of Ke(e))t.indexOf(i)<0&&Z.call(e,i)&&(r[i]=e[i]);return r};function le(e){return Array.isArray(e)}var wt={en:{"keyboard.tooltip.symbols":"\u7B26\u53F7","keyboard.tooltip.greek":"\u5E0C\u814A\u5B57\u6BCD","keyboard.tooltip.numeric":"\u6570\u5B57","keyboard.tooltip.alphabetic":"\u7F57\u9A6C\u5B57\u6BCD","tooltip.cut to clipboard":"\u526A\u5207\u5230\u526A\u8D34\u677F","tooltip.copy to clipboard":"\u590D\u5236\u5230\u526A\u8D34\u677F","tooltip.paste from clipboard":"\u7C98\u8D34","tooltip.redo":"\u91CD\u505A","tooltip.toggle virtual keyboard":"\u5207\u6362\u865A\u62DF\u952E\u76D8","tooltip.undo":"\u64A4\u6D88","menu.insert matrix":"\u63D2\u5165\u77E9\u9635","menu.borders":"\u77E9\u9635\u5206\u9694\u7B26","menu.array.add row above":"\u5728\u540E\u9762\u6DFB\u52A0\u884C","menu.array.add row below":"\u5728\u524D\u9762\u6DFB\u52A0\u884C","menu.array.add column after":"\u5728\u540E\u9762\u6DFB\u52A0\u5217r","menu.array.add column before":"\u5728\u524D\u9762\u6DFB\u52A0\u5217","menu.array.delete row":"\u5220\u9664\u884C","menu.array.delete rows":"\u5220\u9664\u9009\u5B9A\u884C","menu.array.delete column":"\u5220\u9664\u5217","menu.array.delete columns":"\u5220\u9664\u9009\u5B9A\u7684\u5217","menu.mode":"\u6A21\u5F0F","menu.mode-math":"\u6570\u5B66","menu.mode-text":"\u6587\u672C","menu.mode-latex":"LaTeX","tooltip.blackboard":"\u9ED1\u677F","tooltip.bold":"\u7C97\u4F53","tooltip.italic":"\u659C\u4F53","tooltip.fraktur":"Fraktur","tooltip.script":"\u811A\u672C","tooltip.caligraphic":"\u8349\u4E66","tooltip.typewriter":"\u6253\u5B57\u673A","tooltip.roman-upright":"\u7F57\u9A6C\u76F4\u7ACB","tooltip.row-by-col":"%@ \xD7 %@","menu.font-style":"\u5B57\u4F53\u6837\u5F0F","menu.accent":"\u91CD\u97F3","menu.decoration":"\u88C5\u9970","menu.color":"\u989C\u8272","menu.background-color":"\u80CC\u666F","menu.evaluate":"\u8BA1\u7B97","menu.simplify":"\u7B80\u5316","menu.solve":"\u6C42\u89E3","menu.solve-for":"\u6C42\u89E3 %@","menu.cut":"\u526A\u5207","menu.copy":"\u590D\u5236","menu.copy-as-latex":"\u590D\u5236\u4E3A LaTeX","menu.copy-as-ascii-math":"\u590D\u5236\u4E3A ASCII Math","menu.copy-as-mathml":"\u590D\u5236\u4E3A MathML","menu.paste":"\u7C98\u8D34","menu.select-all":"\u5168\u9009","color.red":"\u7EA2\u8272","color.orange":"\u6A59\u8272","color.yellow":"\u9EC4\u8272","color.lime":"\u7EFF\u9EC4\u8272","color.green":"\u7EFF\u8272","color.teal":"\u9752\u8272","color.cyan":"\u84DD\u7EFF\u8272","color.blue":"\u84DD\u8272","color.indigo":"\u975B\u84DD\u8272","color.purple":"\u7D2B\u8272","color.magenta":"\u6D0B\u7EA2\u8272","color.black":"\u9ED1\u8272","color.dark-grey":"\u6DF1\u7070\u8272","color.grey":"\u7070\u8272","color.light-grey":"\u6D45\u7070\u8272","color.white":"\u767D\u8272"}};function Me(){return"window"in globalThis&&"document"in globalThis}function mt(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function G(){return typeof navigator.vibrate=="function"}function ut(){var e,t;if(!Me())return"other";const r=(t=(e=navigator.userAgentData)==null?void 0:e.platform)!=null?t:navigator.platform;return/^mac/i.test(r)?navigator.maxTouchPoints===5?"ios":"macos":/^win/i.test(r)?"windows":/android/i.test(navigator.userAgent)?"android":/iphone|ipod|ipad/i.test(navigator.userAgent)?"ios":/\bcros\b/i.test(navigator.userAgent)?"chromeos":"other"}function kt(){if(!Me())return!0;if(/firefox/i.test(navigator.userAgent)){const e=navigator.userAgent.match(/firefox\/(\d+)/i);return e?parseInt(e[1])>=78:!1}if(/trident/i.test(navigator.userAgent))return!1;if(/edge/i.test(navigator.userAgent)){const e=navigator.userAgent.match(/edg\/(\d+)/i);return e?parseInt(e[1])>=79:!1}return!0}function Se(){return HTMLElement.prototype.hasOwnProperty("popover")}var N={strings:wt,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return N._locale||(N._locale=Me()?navigator.language.slice(0,5):"en-US"),N._locale},set locale(e){N._locale=e,N._numberFormatter=void 0,N.dirty=!0},get numberFormatter(){return N._numberFormatter||(N._numberFormatter=new Intl.NumberFormat(N.locale)),N._numberFormatter},merge(e,t){if(typeof e=="string"&&t)N.strings[e]=p(p({},N.strings[e]),t),N.dirty=!0;else for(const r of Object.keys(e))N.merge(r,e[r])},get dirty(){return N._dirty},set dirty(e){N._dirty||N._dirty===e||(N._dirty=!0,setTimeout(()=>{N._dirty=!1,this._subscribers.forEach(t=>t==null?void 0:t())},0))},subscribe(e){return N._subscribers.push(e),N._subscribers.length-1},unsubscribe(e){e<0||e>=N._subscribers.length||(N._subscribers[e]=void 0)},update(e){let t=e.querySelectorAll("[data-l10n-tooltip]");for(const r of t){const i=r.getAttribute("data-l10n-tooltip");if(i){const n=R(i);n&&r.setAttribute("data-tooltip",n)}}t=e.querySelectorAll("[data-l10n-arial-label]");for(const r of t){const i=r.getAttribute("data-l10n-arial-label");if(i){const n=R(i);n&&r.setAttribute("aria-label",n)}}}};function R(e,...t){if(e===void 0)return;let r="";const i=N.locale;N.strings[i]&&(r=N.strings[i][e]);const n=i.slice(0,2);if(!r&&N.strings[n]&&(r=N.strings[n][e]),r||(r=N.strings.en[e]),!r)return;const a=/(%@|%([0-9]+)\$@)/g;let s=a.exec(r),o=0;for(;s;){if(t[o++]){const c=s[2]?parseInt(s[2],10)-1:o-1;let u=t[c];typeof u=="number"&&(u=N.numberFormatter.format(u)),r=r.replace(s[1],u)}s=a.exec(r)}return r=r.replace(/%%/g,"%"),r}var Mt={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},Ye={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},pe={red:"#fbbbb6",orange:"#ffe0c2",yellow:"#fff1c2",lime:"#d0e8b9",green:"#bceac4",teal:"#b9f1f1",cyan:"#b8e5c9",blue:"#b6d9fb",indigo:"#d1c2f0",purple:"#e3baf8",magenta:"#f9c8e0",black:"#353535","dark-grey":"#8C8C8C",grey:"#D0D0D0","light-grey":"#F0F0F0",white:"#ffffff"},qe={red:"#d7170b",orange:"#fe8a2b",yellow:"#ffc02b",lime:"#63b215",green:"#21ba3a",teal:"#17cfcf",cyan:"#13a7ec",blue:"#0d80f2",indigo:"#63c",purple:"#a219e6",magenta:"#eb4799",black:"#000","dark-grey":"#666",grey:"#A6A6A6","light-grey":"#d4d5d2",white:"#ffffff"},it={Red:"red",Orange:"orange",Yellow:"yellow",LimeGreen:"lime",Green:"green",TealBlue:"teal",Blue:"blue",Violet:"indigo",Purple:"purple",Magenta:"magenta",Black:"black",Gray:"grey",White:"white"},dr={Apricot:"#FBB982",Aquamarine:"#00B5BE",Bittersweet:"#C04F17",Black:"#221E1F",Blue:"#2D2F92",BlueGreen:"#00B3B8",BlueViolet:"#473992",BrickRed:"#B6321C",Brown:"#792500",BurntOrange:"#F7921D",CadetBlue:"#74729A",CarnationPink:"#F282B4",Cerulean:"#00A2E3",CornflowerBlue:"#41B0E4",Cyan:"#00AEEF",Dandelion:"#FDBC42",DarkOrchid:"#A4538A",Emerald:"#00A99D",ForestGreen:"#009B55",Fuchsia:"#8C368C",Goldenrod:"#FFDF42",Gray:"#949698",Green:"#00A64F",GreenYellow:"#DFE674",JungleGreen:"#00A99A",Lavender:"#F49EC4",Limegreen:"#8DC73E",Magenta:"#EC008C",Mahogany:"#A9341F",Maroon:"#AF3235",Melon:"#F89E7B",MidnightBlue:"#006795",Mulberry:"#A93C93",NavyBlue:"#006EB8",OliveGreen:"#3C8031",Orange:"#F58137",OrangeRed:"#ED135A",Orchid:"#AF72B0",Peach:"#F7965A",Periwinkle:"#7977B8",PineGreen:"#008B72",Plum:"#92268F",ProcessBlue:"#00B0F0",Purple:"#99479B",RawSienna:"#974006",Red:"#ED1B23",RedOrange:"#F26035",RedViolet:"#A1246B",Rhodamine:"#EF559F",RoyalBlue:"#0071BC",RoyalPurple:"#613F99",RubineRed:"#ED017D",Salmon:"#F69289",SeaGreen:"#3FBC9D",Sepia:"#671800",SkyBlue:"#46C5DD",SpringGreen:"#C6DC67",Tan:"#DA9D76",TealBlue:"#00AEB3",Thistle:"#D883B7",Turquoise:"#00B4CE",Violet:"#58429B",VioletRed:"#EF58A0",White:"#FFFFFF",WildStrawberry:"#EE2967",Yellow:"#FFF200",YellowGreen:"#98CC70",YellowOrange:"#FAA21A"};function Rt(e){var t,r,i,n,a,s;const o=e.split("!");let l,c,u,d=255,h=255,f=255,m=-1;const y=o.length>0&&o[0].startsWith("-");y&&(o[0]=o[0].slice(1));for(let A=0;A<o.length;A++){l=d,c=h,u=f;const v=(t=o[A].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:t[1],S=v==null?void 0:v.toLowerCase(),L=v&&(s=(a=(n=(i=(r=qe[S])!=null?r:qe[it[v]])!=null?i:Ye[v])!=null?n:dr[v])!=null?a:Mt[v])!=null?s:o[A].trim();let C=L.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(C!=null&&C[1]&&C[2]&&C[3])d=Math.max(0,Math.min(255,Number.parseInt(C[1],16))),h=Math.max(0,Math.min(255,Number.parseInt(C[2],16))),f=Math.max(0,Math.min(255,Number.parseInt(C[3],16)));else if(C=L.match(/^#([\da-f]{3})$/i),C!=null&&C[1]){const z=Number.parseInt(C[1][0],16),I=Number.parseInt(C[1][1],16),O=Number.parseInt(C[1][2],16);d=Math.max(0,Math.min(255,z*16+z)),h=Math.max(0,Math.min(255,I*16+I)),f=Math.max(0,Math.min(255,O*16+O))}else if(C=L.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),C!=null&&C[1]&&C[2]&&C[3])d=Math.max(0,Math.min(255,Number.parseInt(C[1]))),h=Math.max(0,Math.min(255,Number.parseInt(C[2]))),f=Math.max(0,Math.min(255,Number.parseInt(C[3])));else return;m>=0&&(d=(1-m)*d+m*l,h=(1-m)*h+m*c,f=(1-m)*f+m*u,m=-1),A+1<o.length&&(m=Math.max(0,Math.min(100,Number.parseInt(o[++A])))/100)}return m>=0&&(d=m*d+(1-m)*l,h=m*h+(1-m)*c,f=m*f+(1-m)*u),y&&(d=255-d,h=255-h,f=255-f),"#"+("00"+Math.round(d).toString(16)).slice(-2)+("00"+Math.round(h).toString(16)).slice(-2)+("00"+Math.round(f).toString(16)).slice(-2)}function ye(e){var t,r;return e=e.trim(),(r=(t=pe[e.toLowerCase()])!=null?t:pe[it[e]])!=null?r:Rt(e)}function b(e){if(!e||e[0]!=="#")return;e=e.slice(1);let t;return e.length<=4?(t={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},e.length===4&&(t.a=parseInt(e[3]+e[3],16)/255)):(t={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},e.length===8&&(t.a=parseInt(e[6]+e[7],16)/255)),t&&t.a===void 0&&(t.a=1),t}function F(e,t,r){return r<0&&(r+=6),r>=6&&(r-=6),r<1?(t-e)*r+e:r<3?t:r<4?(t-e)*(4-r)+e:e}function H(e){let[t,r,i]=[e.h,e.s,e.l];t=(t+360)%360/60,i=Math.max(0,Math.min(i,1)),r=Math.max(0,Math.min(r,1));const n=i<=.5?i*(r+1):i+r-i*r,a=i*2-n;return{r:Math.round(255*F(a,n,t+2)),g:Math.round(255*F(a,n,t)),b:Math.round(255*F(a,n,t-2))}}function se(e){return e<0?0:e>255?255:Math.round(e)}function Ce(e){const{r:t,g:r,b:i}=e;let n=((1<<24)+(se(t)<<16)+(se(r)<<8)+se(i)).toString(16).slice(1);return n[0]===n[1]&&n[2]===n[3]&&n[4]===n[5]&&n[6]===n[7]&&(n=n[0]+n[2]+n[4]),"#"+n}function We(e){let{r:t,g:r,b:i}=e;t=t/255,r=r/255,i=i/255;const n=Math.min(t,r,i),a=Math.max(t,r,i),s=a-n;let o,l;a===n?o=0:t===a?o=(r-i)/s:r===a?o=2+(i-t)/s:i===a&&(o=4+(t-r)/s),o=Math.min(o*60,360),o<0&&(o+=360);const c=(n+a)/2;return a===n?l=0:c<=.5?l=s/(a+n):l=s/(2-a-n),{h:o,s:l,l:c}}function Mr(e){let t=b(e);if(!t)return e;let{h:r,s:i,l:n}=We(t);return i+=.1,n-=.1,Ce(H({h:r,s:i,l:n}))}var nt={60:"\\lt",62:"\\gt",111:"o",38:"\\&",123:"\\lbrace",125:"\\rbrace",91:"\\lbrack",93:"\\rbrack",58:"\\colon",160:"~",172:"\\neg",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8224:"\\dagger",8225:"\\ddagger",8230:"\\ldots",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",39:"\\prime",8592:"\\gets",8594:"\\to",9651:"\\triangle",9661:"\\triangledown",8715:"\\owns",8727:"\\ast",8739:"\\vert",8741:"\\Vert",8743:"\\land",8744:"\\lor",8901:"\\cdot",8904:"\\bowtie",8800:"\\ne",8804:"\\le",8805:"\\ge",8869:"\\bot",10231:"\\biconditional",10232:"\\impliedby",10233:"\\implies",10234:"\\iff",8450:"\\mathbb{C}",8469:"\\mathbb{N}",8473:"\\mathbb{P}",8474:"\\mathbb{Q}",8477:"\\mathbb{R}",8484:"\\mathbb{Z}",8461:"\\mathbb{H}",8476:"\\Re",8465:"\\Im",42:"\\ast",11036:"\\square",9633:"\\square",8720:"\\coprod",8716:"\\not\\ni",9671:"\\diamond",8846:"\\uplus",8851:"\\sqcap",8852:"\\sqcup",8768:"\\wr",8750:"\\oint",8226:"\\textbullet",8722:"-",978:"\\Upsilon"},hr={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},ie=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"main",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function me(e,t,r){if(!/[A-Za-z\d]/.test(e)||(r==="up"&&(r=void 0),!t&&!r))return e;const i=e.codePointAt(0);if(i===void 0)return e;for(const n of ie)if((!t||n.variant===t)&&(!r||n.style===r)&&i>=n.offset&&i<n.offset+n.len){const a=n.start+i-n.offset;return String.fromCodePoint(hr[a]||a)}return e}function J(e){var t;if((e<119808||e>120831)&&(e<8448||e>8527))return{char:String.fromCodePoint(e)};for(const r in hr)if(hr[r]===e){e=(t=r.codePointAt(0))!=null?t:0;break}for(const r of ie)if(e>=r.start&&e<r.start+r.len)return{char:String.fromCodePoint(e-r.start+r.offset),variant:r.variant,style:r.style};return{char:String.fromCodePoint(e)}}function at(e){var t;let r="";for(const i of e){if("{}<>[]$&#^_%:'\u02DC".includes(i)){r+=i;continue}const n=(t=i.codePointAt(0))!=null?t:0;let a=nt[n];if(a)a.startsWith("\\")?r+=a+" ":r+=a;else{const{char:s,variant:o,style:l}=J(n);switch(a=s,o){case"double-struck":a=`\\mathbb{${a}}`;break;case"fraktur":a=`\\mathfrak{${a}}`;break;case"script":a=`\\mathscr{${a}}`;break;case"sans-serif":a=`\\mathsf{${a}}`;break;case"monospace":a=`\\mathtt{${a}}`;break;case"calligraphic":a=`\\mathcal{${a}}`;break}switch(l){case"bold":a=`\\mathbf{${a}}`;break;case"italic":a=`\\mathit{${a}}`;break;case"bolditalic":a=`\\mathbfit{${a}}`;break}r+=a}}return r}function B(e){return e?Array.isArray(e)?e:typeof e=="object"&&"group"in e?e.group:[]:[]}var ne={},Q=p({},nt),Qe={},Ue={},Yt={darr:"\\downarrow",dArr:"\\Downarrow",Darr:"\\Downarrow",lang:"\\langle",rang:"\\rangle",uarr:"\\uparrow",uArr:"\\Uparrow",Uarr:"\\Uparrow",N:"\\mathbb{N}",R:"\\mathbb{R}",Z:"\\mathbb{Z}",alef:"\\aleph",alefsym:"\\aleph",Alpha:"\\mathrm{A}",Beta:"\\mathrm{B}",bull:"\\bullet",Chi:"\\mathrm{X}",clubs:"\\clubsuit",cnums:"\\mathbb{C}",Complex:"\\mathbb{C}",Dagger:"\\ddagger",diamonds:"\\diamondsuit",empty:"\\emptyset",Epsilon:"\\mathrm{E}",Eta:"\\mathrm{H}",exist:"\\exists",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",Harr:"\\Leftrightarrow",hearts:"\\heartsuit",image:"\\Im",infin:"\\infty",Iota:"\\mathrm{I}",isin:"\\in",Kappa:"\\mathrm{K}",larr:"\\leftarrow",lArr:"\\Leftarrow",Larr:"\\Leftarrow",lrarr:"\\leftrightarrow",lrArr:"\\Leftrightarrow",Lrarr:"\\Leftrightarrow",Mu:"\\mathrm{M}",natnums:"\\mathbb{N}",Nu:"\\mathrm{N}",Omicron:"\\mathrm{O}",plusmn:"\\pm",rarr:"\\rightarrow",rArr:"\\Rightarrow",Rarr:"\\Rightarrow",real:"\\Re",reals:"\\mathbb{R}",Reals:"\\mathbb{R}",Rho:"\\mathrm{P}",sdot:"\\cdot",sect:"\\S",spades:"\\spadesuit",sub:"\\subset",sube:"\\subseteq",supe:"\\supseteq",Tau:"\\mathrm{T}",thetasym:"\\vartheta",weierp:"\\wp",Zeta:"\\mathrm{Z}"},qt={varGamma:"\\mathit{\\Gamma}",varDelta:"\\mathit{\\Delta}",varTheta:"\\mathit{\\Theta}",varLambda:"\\mathit{\\Lambda}",varXi:"\\mathit{\\Xi}",varPi:"\\mathit{\\Pi}",varSigma:"\\mathit{\\Sigma}",varUpsilon:"\\mathit{\\Upsilon}",varPhi:"\\mathit{\\Phi}",varPsi:"\\mathit{\\Psi}",varOmega:"\\mathit{\\Omega}",pmod:{def:"\\quad(\\operatorname{mod}\\ #1)",args:1,expand:!1,captureSelection:!1},mod:{def:"\\quad\\operatorname{mod}\\,\\,#1",args:1,expand:!1},bmod:{def:"\\;\\mathbin{\\operatorname{mod }}",expand:!1}},Qt={bra:{def:"\\mathinner{\\langle{#1}|}",args:1,captureSelection:!1},ket:{def:"\\mathinner{|{#1}\\rangle}",args:1,captureSelection:!1},braket:{def:"\\mathinner{\\langle{#1}\\rangle}",args:1,captureSelection:!1},set:{def:"\\mathinner{\\lbrace #1 \\rbrace}",args:1,captureSelection:!1},Bra:{def:"\\left\\langle #1\\right|",args:1,captureSelection:!1},Ket:{def:"\\left|#1\\right\\rangle",args:1,captureSelection:!1},Braket:{def:"\\left\\langle{#1}\\right\\rangle",args:1,captureSelection:!1},Set:{def:"\\left\\lbrace #1 \\right\\rbrace",args:1,captureSelection:!1}},st={iff:{primitive:!0,captureSelection:!0,def:"\\;\u27FA\\;"},nicefrac:"^{#1}\\!\\!/\\!_{#2}",phase:{def:"\\enclose{phasorangle}{#1}",args:1,captureSelection:!1},rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}",mathstrut:{def:"\\vphantom{(}",primitive:!0},angl:"\\enclose{actuarial}{#1}",angln:"\\enclose{actuarial}{n}",anglr:"\\enclose{actuarial}{r}",anglk:"\\enclose{actuarial}{k}",mathtools:{primitive:!0,package:{ordinarycolon:":",vcentcolon:"\\mathrel{\\mathop\\ordinarycolon}",dblcolon:'{\\mathop{\\char"2237}}',coloneqq:'{\\mathop{\\char"2254}}',Coloneqq:'{\\mathop{\\char"2237\\char"3D}}',coloneq:'{\\mathop{\\char"3A\\char"2212}}',Coloneq:'{\\mathop{\\char"2237\\char"2212}}',eqqcolon:'{\\mathop{\\char"2255}}',Eqqcolon:'{\\mathop{\\char"3D\\char"2237}}',eqcolon:'{\\mathop{\\char"2239}}',Eqcolon:'{\\mathop{\\char"2212\\char"2237}}',colonapprox:'{\\mathop{\\char"003A\\char"2248}}',Colonapprox:'{\\mathop{\\char"2237\\char"2248}}',colonsim:'{\\mathop{\\char"3A\\char"223C}}',Colonsim:'{\\mathop{\\char"2237\\char"223C}}',colondash:"\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",Colondash:"\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}"}},ratio:"\\vcentcolon",coloncolon:"\\dblcolon",colonequals:"\\coloneq",coloncolonequals:"\\Coloneq",equalscolon:"\\eqcolon",equalscoloncolon:"\\Eqcolon",colonminus:"\\colondash",coloncolonminus:"\\Colondash",minuscolon:"\\dashcolon",minuscoloncolon:"\\Dashcolon",coloncolonapprox:"\\Colonapprox",coloncolonsim:"\\Colonsim",simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",simcoloncolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcoloncolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",notni:"\\mathrel{\\char`\u220C}",limsup:"\\operatorname*{lim\\,sup}",liminf:"\\operatorname*{lim\\,inf}",injlim:"\\operatorname*{inj\\,lim}",projlim:"\\operatorname*{proj\\,lim}",varlimsup:"\\operatorname*{\\overline{lim}}",varliminf:"\\operatorname*{\\underline{lim}}",varinjlim:"\\operatorname*{\\underrightarrow{lim}}",varprojlim:"\\operatorname*{\\underleftarrow{lim}}",argmin:"\\operatorname*{arg\\,min}",argmax:"\\operatorname*{arg\\,max}",plim:"\\mathop{\\operatorname{plim}}\\limits",tripledash:{def:"\\vphantom{-}\\raise{4mu}{\\mkern1.5mu\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2mu}}",expand:!0},"braket.sty":{package:Qt},"amsmath.sty":{package:qt,primitive:!0},"texvc.sty":{package:Yt,primitive:!1}},St={" ":32,"\\!":33,"\\#":35,"\\$":36,"\\%":37,"\\&":38,"-":45,"\\textunderscore":95,"\\euro":8364,"\\maltese":10016,"\\{":123,"\\}":125,"\\textbraceleft":123,"\\textbraceright":125,"\\lbrace":123,"\\rbrace":125,"\\lbrack":91,"\\rbrack":93,"\\nobreakspace":160,"\\ldots":8230,"\\textellipsis":8230,"\\backslash":92,"`":8216,"'":8217,"``":8220,"''":8221,"\\degree":176,"\\textasciicircum":94,"\\textasciitilde":126,"\\textasteriskcentered":42,"\\textbackslash":92,"\\textbullet":8226,"\\textdollar":36,"\\textsterling":163,"\\textdagger":8224,"\\textdaggerdbl":8225,"\u2013":8211,"\u2014":8212,"\u2018":8216,"\u2019":8217,"\u201C":8220,"\u201D":8221,'"':8221,"\\ss":223,"\\ae":230,"\\oe":339,"\\AE":198,"\\OE":338,"\\O":216,"\\i":305,"\\j":567,"\\aa":229,"\\AA":197},xe=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,Ft,Sr;kt()?(Ft=new RegExp("\\p{Letter}","u"),Sr=new RegExp("[0-9\\p{Letter}]","u")):(Ft=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,Sr=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function Wr(e,t,r="mord",i){t!==void 0&&(ne[e]={definitionType:"symbol",type:r,variant:i,codepoint:t},Q[t]||(Q[t]=e))}function Te(e,t,r){if(typeof e=="string"){for(let i=0;i<e.length;i++){const n=e.charAt(i);Wr(n,n.codePointAt(0))}return}for(const[i,n,a,s]of e)Wr(i,n,a!=null?a:t,s!=null?s:r)}function si(e,t){for(let r=e;r<=t;r++)Wr(String.fromCodePoint(r),r)}function Ai(e){var t;return(t=Ue[e])!=null?t:null}function Li(e,t){var r,i;if(t.length===0||t==="\\"||!t.startsWith("\\"))return[];const n=[];for(const s in Qe)s.startsWith(t)&&!Qe[s].infix&&n.push({match:s,frequency:(r=Qe[s].frequency)!=null?r:0});for(const s in ne)s.startsWith(t)&&n.push({match:s,frequency:(i=ne[s].frequency)!=null?i:0});const a=t.substring(1);for(const s of Object.keys(e.options.macros))s.startsWith(a)&&n.push({match:"\\"+s,frequency:0});return n.sort((s,o)=>{var l,c;return s.frequency===o.frequency?s.match.length===o.match.length?s.match<o.match?-1:1:s.match.length-o.match.length:((l=o.frequency)!=null?l:0)-((c=s.frequency)!=null?c:0)}),n.map(s=>s.match)}function Bi(e){let t="auto";const r=e.match(/:([^=]+)/);return r&&(t=r[1].trim()),t}function Ur(e){if(!e)return[];const t=[];let r=e.split("]");if(r[0].startsWith("[")){t.push({isOptional:!0,type:Bi(r[0].slice(1))});for(let i=1;i<=r.length;i++)t.push(...Ur(r[i]))}else if(r=e.split("}"),r[0].startsWith("{")){t.push({isOptional:!1,type:Bi(r[0].slice(1))});for(let i=1;i<=r.length;i++)t.push(...Ur(r[i]))}return t}function Vn(e){if(!e)return"";let t="",r=!0;for(const i of e)typeof i.value=="string"?t+=i.value:r=!1;return r?t:""}function Pt(e,t){typeof e=="string"&&(e=[e]);const r={tabular:!1,params:[],createAtom:t};for(const i of e)Ue[i]=r}function Ct(e,t,r){typeof e=="string"&&(e=[e]);const n={tabular:!0,params:Ur(t),createAtom:r};for(const a of e)Ue[a]=n}function M(e,t,r){var i,n;r||(r={});const a={definitionType:"function",params:Ur(t),ifMode:r.ifMode,isFunction:(i=r.isFunction)!=null?i:!1,applyMode:r.applyMode,infix:(n=r.infix)!=null?n:!1,parse:r.parse,createAtom:r.createAtom,applyStyle:r.applyStyle,serialize:r.serialize,render:r.render};if(typeof e=="string")Qe["\\"+e]=a;else for(const s of e)Qe["\\"+s]=a}var zt;function Vt(e){return zt||(zt=Cr(st)),e?Cr(p(p({},zt),e)):zt}function Oe(e,t){var r,i,n,a;if(typeof e=="string"){let s=0;const o=e;return/(^|[^\\])#1/.test(o)&&(s=1),/(^|[^\\])#2/.test(o)&&(s=2),/(^|[^\\])#3/.test(o)&&(s=3),/(^|[^\\])#4/.test(o)&&(s=4),/(^|[^\\])#5/.test(o)&&(s=5),/(^|[^\\])#6/.test(o)&&(s=6),/(^|[^\\])#7/.test(o)&&(s=7),/(^|[^\\])#8/.test(o)&&(s=8),/(^|[^\\])#9/.test(o)&&(s=9),{expand:(r=t==null?void 0:t.expand)!=null?r:!0,captureSelection:(i=t==null?void 0:t.captureSelection)!=null?i:!0,args:s,def:o}}return p({expand:(n=t==null?void 0:t.expand)!=null?n:!0,captureSelection:(a=t==null?void 0:t.captureSelection)!=null?a:!0,args:0},e)}function Cr(e){if(!e)return{};const t={};for(const r of Object.keys(e)){const i=e[r];if(i==null)delete t[r];else if(typeof i=="object"&&"package"in i)for(const n of Object.keys(i.package))t[n]=Oe(i.package[n],{expand:!i.primitive,captureSelection:i.captureSelection});else t[r]=Oe(i)}return t}function Ve(e,t="math"){if(!e||e.length===0)return null;let r=null;if(e.startsWith("\\")){if(r=Qe[e],r)return!r.ifMode||r.ifMode===t?r:null;t==="math"?r=ne[e]:St[e]&&(r={definitionType:"symbol",type:"mord",codepoint:St[e]})}else if(t==="math"){if(r=ne[e],!r&&e.length===1){const i=ot("math",e.codePointAt(0));return i.startsWith("\\")?g(p({},Ve(i,"math")),{command:i}):null}}else St[e]?r={definitionType:"symbol",type:"mord",codepoint:St[e]}:t==="text"&&(r={definitionType:"symbol",type:"mord",codepoint:e.codePointAt(0)});return r!=null?r:null}function fr(e,t){if(!e.startsWith("\\"))return null;const r=e.slice(1);return t[r]}function ot(e,t){if(t===void 0)return"";if(e==="math"&&Q[t])return Q[t];if(e==="text"){const r=Object.keys(St).find(i=>St[i]===t);return r||String.fromCodePoint(t)}return String.fromCodePoint(t)}var gt=[0,.68889,0,0,.72222],er=[0,.68889,0,0,.66667],pr=[0,.68889,0,0,.77778],tr=[0,.68889,0,0,.61111],Zr=[.16667,.68889,0,0,.77778],ee=[0,.68889,0,0,.55556],j=[0,0,0,0,.25],Ht=[0,.825,0,0,2.33334],rr=[0,.9,0,0,2.33334],Et=[0,.68889,0,0,.54028],mr=[-.03598,.46402,0,0,.5],Ee=[-.13313,.36687,0,0,1],Kt=[.01354,.52239,0,0,1],bt=[.01354,.52239,0,0,1.11111],Nt=[0,.54986,0,0,1],Ie=[0,.69224,0,0,.5],Fe=[0,.43056,0,0,1],He=[.08198,.58198,0,0,.77778],et=[.19444,.69224,0,0,.41667],ir=[.1808,.675,0,0,1],Er=[.19444,.69224,0,0,.83334],cn=[.13667,.63667,0,0,1],Hn=[-.064,.437,0,0,1.334],gr=[.08167,.58167,0,0,.77778],Di=[0,.69224,0,0,.72222],x=[0,.69224,0,0,.66667],k=[-.13313,.36687,0,0,.77778],_=[.06062,.54986,0,0,.77778],dt=[0,.69224,0,0,.77778],Ne=[.25583,.75583,0,0,.77778],lt=[.25142,.75726,0,0,.77778],Ot=[.20576,.70576,0,0,.77778],vt=[.30274,.79383,0,0,.77778],oi=[.22958,.72958,0,0,.77778],jn=[.1808,.675,0,0,.77778],jt=[.13667,.63667,0,0,.77778],ht=[.13597,.63597,0,0,.77778],br=[.03517,.54986,0,0,.77778],Jr=[0,.675,0,0,.77778],Wn=[.19444,.69224,0,0,.61111],Un=[0,.54986,0,0,.76042],Zn=[0,.54986,0,0,.66667],vr=[.0391,.5391,0,0,.77778],Jn=[.03517,.54986,0,0,1.33334],Xn=[.38569,.88569,0,0,.77778],Ti=[.23222,.74111,0,0,.77778],$n=[.19444,.69224,0,0,.77778],Gn=[0,.37788,0,0,.5],Fi=[0,.54986,0,0,.72222],he=[0,.69224,0,0,.83334],Ae=[.11111,.69224,0,0,.66667],Wt=[.26167,.75726,0,0,.77778],qa=[.48256,.98256,0,0,.77778],Ql=[.28481,.79383,0,0,.77778],ec=[.08167,.58167,0,0,.22222],tc=[.08167,.58167,0,0,.38889],rc=[0,.43056,.04028,0,.66667],ic=[.41951,.91951,0,0,.77778],nc=[.24982,.74947,0,0,.38865],ac=[.08319,.58283,0,0,.75623],sc=[0,.10803,0,0,.27764],_o=[0,.47534,0,0,.50181],Yn=[.18906,.47534,0,0,.50181],oc=[0,.69141,0,0,.50181],lc=[.24982,.74947,0,0,.27764],wo=[0,.69141,0,0,.21471],Va=[.25,.75,0,0,.44722],nr=[0,.64444,0,0,.575],un=[.08556,.58556,0,0,.89444],Ha=[0,.69444,0,0,.89444],ja=[0,.68611,0,0,.9],ko=[0,.68611,0,0,.86944],li=[.25,.75,0,0,.575],Wa=[.25,.75,0,0,.31944],Pi=[0,.69444,0,0,.63889],dn=[0,.69444,0,0,.31944],cc=[0,.44444,0,0,.63889],uc=[0,.44444,0,0,.51111],ci=[0,.69444,0,0,.575],yr=[.13333,.63333,0,0,.89444],dc=[0,.44444,0,0,.31944],hc=[0,.69444,0,0,.86944],fc=[0,.68611,0,0,.69166],Ua=[0,.68611,0,0,.83055],Mo=[0,.68611,0,0,.89444],So=[0,.69444,0,0,.60278],pc=[.19444,.69444,0,0,.51111],mc=[0,.69444,0,0,.83055],Ar=[-.10889,.39111,0,0,1.14999],gc=[.19444,.69444,0,0,.575],Qn=[.19444,.69444,0,0,1.14999],bc=[.19444,.69444,0,0,.70277],vc=[.05556,.75,0,0,.575],Co=[0,.68611,0,0,.95833],yc=[.08556,.58556,0,0,.76666],Eo=[-.02639,.47361,0,0,.575],xc=[0,.44444,0,0,.89444],zi=[0,.55556,0,0,.76666],_c=[-.10889,.39111,0,0,.89444],Ao=[.00222,.50222,0,0,.89444],ui=[.19667,.69667,0,0,.89444],wc=[.08556,.58556,0,0,1.14999],Lo=[0,.69444,0,0,.70277],Za=[-.02778,.47222,0,0,.575],Ja=[.25,.75,0,0,.51111],kc=[-.13889,.36111,0,0,1.14999],Mc=[.19444,.69444,0,0,1.02222],Xa=[.12963,.69444,0,0,.89444],Sc=[.19444,.69444,0,0,.44722],di=[0,.64444,.13167,0,.59111],Cc=[.19444,.64444,.13167,0,.59111],Bo=[0,.68611,.17208,0,.8961],Ec=[.19444,.44444,.105,0,.53222],Ac=[0,.44444,.085,0,.82666],Lc=[0,.69444,.06709,0,.59111],$a=[0,.69444,.12945,0,.35555],Bc=[0,.69444,0,0,.94888],Do=[0,.69444,.11472,0,.59111],Dc=[0,.68611,.10778,0,.88555],Tc=[0,.69444,.07939,0,.62055],Ga=[0,.69444,.12417,0,.30667],hi=[0,.64444,.13556,0,.51111],Fc=[.19444,.64444,.13556,0,.51111],Ya=[0,.68333,.16389,0,.74333],Pc=[.19444,.43056,.08847,0,.46],zc=[0,.43056,.07514,0,.71555],Kc=[0,.69444,.06646,0,.51111],Nc=[0,.69444,0,0,.83129],Oc=[0,.69444,.1225,0,.51111],Ic=[0,.68333,.09403,0,.76666],Rc=[0,.68333,.11111,0,.76666],qc=[0,.69444,.06961,0,.51444],Xr=[0,.69444,0,0,.27778],hn=[.25,.75,0,0,.38889],ar=[0,.64444,0,0,.5],Ki=[0,.69444,0,0,.77778],Ni=[0,.68333,0,0,.75],ea=[0,.68333,0,0,.77778],Vc=[0,.68333,0,0,.68056],ta=[0,.68333,0,0,.72222],$r=[.25,.75,0,0,.5],Qa=[.25,.75,0,0,.27778],Ze=[0,.69444,0,0,.5],fn=[0,.69444,0,0,.55556],To=[0,.43056,0,0,.44445],ra=[0,.43056,0,0,.5],Hc=[.19444,.43056,0,0,.55556],jc=[0,.43056,0,0,.55556],sr=[.08333,.58333,0,0,.77778],Wc=[0,.43056,0,0,.27778],Uc=[0,.66786,0,0,.27778],Zc=[0,.69444,0,0,.75],Jc=[0,.66786,0,0,.5],Xc=[0,.68333,0,0,.625],Fo=[.19444,.69444,0,0,.44445],ia=[0,.69444,0,0,.72222],$c=[.19444,.69444,0,0,.5],na=[.19444,.69444,0,0,1],Gc=[.011,.511,0,0,1.126],Po=[.19444,.69444,0,0,.61111],zo=[.05556,.75,0,0,.5],Yc=[0,.68333,0,0,.83334],Qc=[.0391,.5391,0,0,.66667],Ko=[-.05555,.44445,0,0,.5],eu=[0,.43056,0,0,.77778],Oi=[0,.55556,0,0,.66667],es=[-.03625,.46375,0,0,.77778],tu=[-.01688,.48312,0,0,.77778],ru=[.0391,.5391,0,0,1],fi=[0,.69444,0,0,.61111],ts=[-.03472,.46528,0,0,.5],rs=[.25,.75,0,0,.44445],iu=[-.14236,.35764,0,0,1],is=[.244,.744,0,0,.412],nu=[.19444,.69444,0,0,.88889],ns=[.12963,.69444,0,0,.77778],au=[.19444,.69444,0,0,.38889],su=[.011,.511,0,0,1.638],ou=[.19444,.69444,0,0,0],as=[0,.44444,0,0,.575],aa=[.19444,.44444,0,0,.575],lu=[0,.68611,0,0,.75555],cu=[0,.69444,0,0,.66759],uu=[0,.68611,0,0,.80555],du=[0,.68611,.08229,0,.98229],hu=[0,.68611,0,0,.76666],fu=[0,.44444,0,0,.58472],pu=[.19444,.44444,0,0,.6118],sa=[.19444,.43056,0,0,.5],mu=[0,.68333,.02778,.08334,.76278],gu=[0,.68333,.08125,.05556,.83125],bu=[0,.43056,0,.05556,.48472],vu=[.19444,.43056,0,.08334,.51702],yu=[.25,.75,0,0,.42778],ft=[0,.69444,0,0,.55],Gr=[0,.69444,0,0,.73334],pi=[0,.69444,0,0,.79445],xu=[0,.69444,0,0,.51945],No=[0,.69444,0,0,.70278],_u=[0,.69444,0,0,.76389],wu=[.25,.75,0,0,.34306],Oo=[0,.69444,0,0,.56111],ku=[0,.69444,0,0,.25556],Mu=[.19444,.45833,0,0,.56111],Su=[0,.45833,0,0,.56111],ss=[0,.69444,0,0,.30556],Cu=[0,.69444,0,0,.58056],Eu=[0,.69444,0,0,.67223],Io=[0,.69444,0,0,.85556],Ro=[0,.69444,0,0,.55834],Lr=[0,.65556,.11156,0,.5],qo=[0,.69444,.08094,0,.70834],Vo=[.17014,0,0,0,.44445],Au=[0,.69444,.0799,0,.5],Lu=[0,.69444,0,0,.73752],Bu=[0,.69444,.09205,0,.5],Du=[0,.69444,.09031,0,.77778],Ho=[0,.69444,.07816,0,.27778],Tu=[0,.69444,.00316,0,.5],Fu=[.19444,.69444,0,0,.83334],Pu=[.05556,.75,0,0,.83334],zu=[0,.75,0,0,.5],Ku=[.125,.08333,0,0,.27778],Nu=[0,.08333,0,0,.27778],Br=[0,.65556,0,0,.5],jo=[0,.69444,0,0,.47222],Yr=[0,.69444,0,0,.66667],Ou=[0,.69444,0,0,.59722],Wo=[0,.69444,0,0,.54167],Uo=[0,.69444,0,0,.70834],Iu=[.25,.75,0,0,.28889],Zo=[0,.69444,0,0,.51667],Ru=[0,.44444,0,0,.44445],qu=[.19444,.44444,0,0,.51667],Vu=[0,.44444,0,0,.38333],Hu=[0,.44444,0,0,.51667],ju=[0,.69444,0,0,.83334],Wu=[.35001,.85,0,0,.45834],Uu=[.35001,.85,0,0,.57778],Zu=[.35001,.85,0,0,.41667],Ju=[.35001,.85,0,0,.58334],os=[0,.72222,0,0,.55556],Xu=[1e-5,.6,0,0,.66667],$u=[1e-5,.6,0,0,.77778],Gu=[.25001,.75,0,0,.94445],Yu=[.306,.805,.19445,0,.47222],Qu=[.30612,.805,.19445,0,.47222],pn=[.25001,.75,0,0,.83334],mn=[.35001,.85,0,0,.47222],Jo=[.25001,.75,0,0,1.11111],e0=[.65002,1.15,0,0,.59722],t0=[.65002,1.15,0,0,.81111],r0=[.65002,1.15,0,0,.47222],i0=[.65002,1.15,0,0,.66667],ls=[0,.75,0,0,1],n0=[.55001,1.05,0,0,1.27778],a0=[.862,1.36,.44445,0,.55556],s0=[.86225,1.36,.44445,0,.55556],gn=[.55001,1.05,0,0,1.11111],cs=[.65002,1.15,0,0,.52778],o0=[.65002,1.15,0,0,.61111],Xo=[.55001,1.05,0,0,1.51112],l0=[.95003,1.45,0,0,.73611],c0=[.95003,1.45,0,0,1.04445],u0=[.95003,1.45,0,0,.52778],us=[.95003,1.45,0,0,.75],ds=[0,.75,0,0,1.44445],hs=[.95003,1.45,0,0,.58334],d0=[1.25003,1.75,0,0,.79167],h0=[1.25003,1.75,0,0,1.27778],f0=[1.25003,1.75,0,0,.58334],fs=[1.25003,1.75,0,0,.80556],ps=[0,.825,0,0,1.8889],ms=[1.25003,1.75,0,0,.63889],gs=[.64502,1.155,0,0,.875],p0=[1e-5,.6,0,0,.875],$o=[-99e-5,.601,0,0,.66667],bs=[.64502,1.155,0,0,.66667],m0=[1e-5,.9,0,0,.88889],g0=[.65002,1.15,0,0,.88889],b0=[.90001,0,0,0,.88889],v0=[-.00499,.605,0,0,1.05556],vs=[0,.12,0,0,.45],K=[0,.61111,0,0,.525],xr=[.08333,.69444,0,0,.525],y0=[-.08056,.53055,0,0,.525],x0=[-.05556,.55556,0,0,.525],At=[0,.43056,0,0,.525],oa=[.22222,.43056,0,0,.525],_0=[0,0,0,0,.525],sf={"AMS-Regular":{32:j,65:gt,66:er,67:gt,68:gt,69:er,70:tr,71:pr,72:pr,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:pr,76:er,77:[0,.68889,0,0,.94445],78:gt,79:Zr,80:tr,81:Zr,82:gt,83:ee,84:er,85:gt,86:gt,87:[0,.68889,0,0,1],88:gt,89:gt,90:er,107:ee,160:j,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:ee,295:Et,710:Ht,732:rr,770:Ht,771:rr,989:gr,1008:rc,8245:[0,.54986,0,0,.275],8463:Et,8487:gt,8498:ee,8502:er,8503:[0,.68889,0,0,.44445],8504:er,8513:[0,.68889,0,0,.63889],8592:mr,8594:mr,8602:Ee,8603:Ee,8606:Kt,8608:Kt,8610:bt,8611:bt,8619:Nt,8620:Nt,8621:[-.13313,.37788,0,0,1.38889],8622:Ee,8624:Ie,8625:Ie,8630:Fe,8631:Fe,8634:He,8635:He,8638:et,8639:et,8642:et,8643:et,8644:ir,8646:ir,8647:ir,8648:Er,8649:ir,8650:Er,8651:Kt,8652:Kt,8653:Ee,8654:Ee,8655:Ee,8666:cn,8667:cn,8669:[-.13313,.37788,0,0,1],8672:Hn,8674:Hn,8705:[0,.825,0,0,.5],8708:ee,8709:gr,8717:[0,.43056,0,0,.42917],8722:mr,8724:[.08198,.69224,0,0,.77778],8726:gr,8733:dt,8736:Di,8737:Di,8738:[.03517,.52239,0,0,.72222],8739:ec,8740:[.25142,.74111,0,0,.27778],8741:tc,8742:[.25142,.74111,0,0,.5],8756:x,8757:x,8764:k,8765:[-.13313,.37788,0,0,.77778],8769:k,8770:es,8774:vt,8776:tu,8778:gr,8782:_,8783:_,8785:He,8786:He,8787:He,8790:dt,8791:oi,8796:[.08198,.91667,0,0,.77778],8806:Ne,8807:Ne,8808:lt,8809:lt,8812:[.25583,.75583,0,0,.5],8814:Ot,8815:Ot,8816:vt,8817:vt,8818:oi,8819:oi,8822:jn,8823:jn,8828:jt,8829:jt,8830:oi,8831:oi,8832:Ot,8833:Ot,8840:vt,8841:vt,8842:ht,8843:ht,8847:br,8848:br,8858:He,8859:He,8861:He,8862:Jr,8863:Jr,8864:Jr,8865:Jr,8872:[0,.69224,0,0,.61111],8873:Di,8874:[0,.69224,0,0,.88889],8876:tr,8877:tr,8878:gt,8879:gt,8882:br,8883:br,8884:jt,8885:jt,8888:[0,.54986,0,0,1.11111],8890:Hc,8891:Wn,8892:Wn,8901:[0,.54986,0,0,.27778],8903:gr,8905:gr,8906:gr,8907:dt,8908:dt,8909:[-.03598,.46402,0,0,.77778],8910:Un,8911:Un,8912:br,8913:br,8914:Zn,8915:Zn,8916:x,8918:vr,8919:vr,8920:Jn,8921:Jn,8922:Xn,8923:Xn,8926:jt,8927:jt,8928:vt,8929:vt,8934:Ti,8935:Ti,8936:Ti,8937:Ti,8938:Ot,8939:Ot,8940:vt,8941:vt,8994:$n,8995:$n,9416:[.15559,.69224,0,0,.90222],9484:Ie,9488:Ie,9492:Gn,9496:Gn,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:Jr,9633:Jr,9650:Fi,9651:Fi,9654:br,9660:Fi,9661:Fi,9664:br,9674:Ae,9733:[.19444,.69224,0,0,.94445],10003:he,10016:he,10731:Ae,10846:[.19444,.75583,0,0,.61111],10877:jt,10878:jt,10885:Ne,10886:Ne,10887:ht,10888:ht,10889:Wt,10890:Wt,10891:qa,10892:qa,10901:jt,10902:jt,10933:lt,10934:lt,10935:Wt,10936:Wt,10937:Wt,10938:Wt,10949:Ne,10950:Ne,10955:Ql,10956:Ql,57350:ec,57351:tc,57352:gr,57353:rc,57356:lt,57357:lt,57358:ic,57359:vt,57360:vt,57361:ic,57366:lt,57367:lt,57368:lt,57369:lt,57370:ht,57371:ht},"Caligraphic-Regular":{32:j,65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:j},"Fraktur-Regular":{32:j,33:[0,.69141,0,0,.29574],34:wo,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:nc,41:nc,42:[0,.62119,0,0,.27764],43:ac,44:sc,45:ac,46:sc,47:[.24982,.74947,0,0,.50181],48:_o,49:_o,50:_o,51:Yn,52:Yn,53:Yn,54:oc,55:Yn,56:oc,57:Yn,58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:lc,93:lc,94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:j,8216:wo,8217:wo,58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:j,33:[0,.69444,0,0,.35],34:So,35:[.19444,.69444,0,0,.95833],36:vc,37:[.05556,.75,0,0,.95833],38:Ha,39:dn,40:Va,41:Va,42:[0,.75,0,0,.575],43:yr,44:[.19444,.15556,0,0,.31944],45:Vu,46:[0,.15556,0,0,.31944],47:li,48:nr,49:nr,50:nr,51:nr,52:nr,53:nr,54:nr,55:nr,56:nr,57:nr,58:dc,59:[.19444,.44444,0,0,.31944],60:un,61:_c,62:un,63:[0,.69444,0,0,.54305],64:Ha,65:ko,66:[0,.68611,0,0,.81805],67:Ua,68:[0,.68611,0,0,.88194],69:lu,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:ja,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:fc,77:[0,.68611,0,0,1.09166],78:ja,79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:ko,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:Wa,92:li,93:Wa,94:ci,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:Pi,99:uc,100:Pi,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:Pi,105:dn,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:dn,109:[0,.44444,0,0,.95833],110:cc,111:as,112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:cc,118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:uc,123:li,124:Wa,125:li,126:[.35,.34444,0,0,.575],160:j,163:[0,.69444,0,0,.86853],168:ci,172:[0,.44444,0,0,.76666],176:hc,177:yr,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:yr,216:[.04861,.73472,0,0,.89444],223:Ou,230:[0,.44444,0,0,.83055],247:yr,248:[.09722,.54167,0,0,.575],305:dc,338:[0,.68611,0,0,1.16944],339:xc,567:[.19444,.44444,0,0,.35139],710:ci,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:ci,715:ci,728:ci,729:dn,730:hc,732:ci,733:ci,915:fc,916:Co,920:Mo,923:uu,926:hu,928:ja,931:Ua,933:Mo,934:Ua,936:Mo,937:Ua,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:dn,8217:dn,8220:So,8221:So,8224:pc,8225:pc,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:cu,8465:mc,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:mc,8501:Lo,8592:Ar,8593:gc,8594:Ar,8595:gc,8596:Ar,8597:li,8598:Qn,8599:Qn,8600:Qn,8601:Qn,8636:Ar,8637:Ar,8640:Ar,8641:Ar,8656:Ar,8657:bc,8658:Ar,8659:bc,8660:Ar,8661:[.25,.75,0,0,.70277],8704:Pi,8706:[0,.69444,.06389,0,.62847],8707:Pi,8709:vc,8711:Co,8712:yc,8715:yc,8722:yr,8723:yr,8725:li,8726:li,8727:Za,8728:Eo,8729:Eo,8730:[.18,.82,0,0,.95833],8733:xc,8734:[0,.44444,0,0,1.14999],8736:Di,8739:Wa,8741:li,8743:zi,8744:zi,8745:zi,8746:zi,8747:[.19444,.69444,.12778,0,.56875],8764:_c,8768:[.19444,.69444,0,0,.31944],8771:Ao,8776:[.02444,.52444,0,0,.89444],8781:Ao,8801:Ao,8804:ui,8805:ui,8810:wc,8811:wc,8826:un,8827:un,8834:un,8835:un,8838:ui,8839:ui,8846:zi,8849:ui,8850:ui,8851:zi,8852:zi,8853:yr,8854:yr,8855:yr,8856:yr,8857:yr,8866:Lo,8867:Lo,8868:Ha,8869:Ha,8900:Eo,8901:[-.02639,.47361,0,0,.31944],8902:Za,8968:Ja,8969:Ja,8970:Ja,8971:Ja,8994:kc,8995:kc,9651:Mc,9657:Za,9661:Mc,9667:Za,9711:Qn,9824:Xa,9825:Xa,9826:Xa,9827:Xa,9837:[0,.75,0,0,.44722],9838:Sc,9839:Sc,10216:Va,10217:Va,10815:ja,10927:ui,10928:ui,57376:ou},"Main-BoldItalic":{32:j,33:[0,.69444,.11417,0,.38611],34:Tc,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:$a,40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:di,49:di,50:di,51:di,52:Cc,53:di,54:di,55:Cc,56:di,57:di,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:Do,64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:Bo,73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:Bo,79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:Lc,95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:Ec,104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:Ec,114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:j,168:[0,.69444,.11473,0,.59111],176:Bc,184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:Ac,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:Ac,567:[.19444,.44444,.04611,0,.385],710:Lc,711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:$a,730:Bc,732:Do,733:Do,915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:Bo,931:[0,.68611,.11431,0,.82666],933:Dc,934:[0,.68611,.05632,0,.82666],936:Dc,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:$a,8217:$a,8220:[0,.69444,.16772,0,.62055],8221:Tc},"Main-Italic":{32:j,33:Ga,34:qc,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:Ga,40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:hi,49:hi,50:hi,51:hi,52:Fc,53:hi,54:hi,55:Fc,56:hi,57:hi,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:Oc,64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:Ya,73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:Ya,79:Ic,80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:Ya,86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:Kc,95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:Pc,104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:Pc,114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:j,168:[0,.66786,.10474,0,.51111],176:Nc,184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:zc,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:zc,710:Kc,711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:Nc,732:[0,.66786,.11585,0,.51111],733:Oc,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:Ic,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:Ya,931:[0,.68333,.12028,0,.71555],933:Rc,934:[0,.68333,.05986,0,.71555],936:Rc,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:Ga,8217:Ga,8220:[0,.69444,.1685,0,.51444],8221:qc,8463:Et},"Main-Regular":{32:j,33:Xr,34:Ze,35:Fu,36:zo,37:Pu,38:Ki,39:Xr,40:hn,41:hn,42:zu,43:sr,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:$r,48:ar,49:ar,50:ar,51:ar,52:ar,53:ar,54:ar,55:ar,56:ar,57:ar,58:Wc,59:[.19444,.43056,0,0,.27778],60:vr,61:k,62:vr,63:jo,64:Ki,65:Ni,66:[0,.68333,0,0,.70834],67:ta,68:[0,.68333,0,0,.76389],69:Vc,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:Ni,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:ea,76:Xc,77:[0,.68333,0,0,.91667],78:Ni,79:ea,80:Vc,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:ta,85:Ni,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:Ni,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:Qa,92:$r,93:Qa,94:Ze,95:[.31,.12056,.02778,0,.5],97:ra,98:fn,99:To,100:fn,101:To,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:fn,105:Uc,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:Xr,109:[0,.43056,0,0,.83334],110:jc,111:ra,112:Hc,113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:jc,118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:To,123:$r,124:Qa,125:$r,126:[.35,.31786,0,0,.5],160:j,163:[0,.69444,0,0,.76909],167:Fo,168:Jc,172:[0,.43056,0,0,.66667],176:Zc,177:sr,182:Po,184:Vo,198:[0,.68333,0,0,.90278],215:sr,216:[.04861,.73194,0,0,.77778],223:Ze,230:[0,.43056,0,0,.72222],247:sr,248:[.09722,.52778,0,0,.5],305:Wc,338:[0,.68333,0,0,1.01389],339:eu,567:[.19444,.43056,0,0,.30556],710:Ze,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:Ze,715:Ze,728:Ze,729:Uc,730:Zc,732:Jc,733:Ze,915:Xc,916:Yc,920:ea,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:Ni,931:ta,933:ea,934:ta,936:ea,937:ta,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:Xr,8217:Xr,8220:Ze,8221:Ze,8224:Fo,8225:Fo,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:Et,8465:ia,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:ia,8501:fi,8592:Ee,8593:$c,8594:Ee,8595:$c,8596:Ee,8597:$r,8598:na,8599:na,8600:na,8601:na,8614:[.011,.511,0,0,1],8617:Gc,8618:Gc,8636:Ee,8637:Ee,8640:Ee,8641:Ee,8652:[.011,.671,0,0,1],8656:Ee,8657:Po,8658:Ee,8659:Po,8660:Ee,8661:[.25,.75,0,0,.61111],8704:fn,8706:[0,.69444,.05556,.08334,.5309],8707:fn,8709:zo,8711:Yc,8712:Qc,8715:Qc,8722:sr,8723:sr,8725:$r,8726:$r,8727:ts,8728:Ko,8729:Ko,8730:[.2,.8,0,0,.83334],8733:eu,8734:Fe,8736:Di,8739:Qa,8741:$r,8743:Oi,8744:Oi,8745:Oi,8746:Oi,8747:[.19444,.69444,.11111,0,.41667],8764:k,8768:[.19444,.69444,0,0,.27778],8771:es,8773:[-.022,.589,0,0,1],8776:tu,8781:es,8784:[-.133,.67,0,0,.778],8801:es,8804:ht,8805:ht,8810:ru,8811:ru,8826:vr,8827:vr,8834:vr,8835:vr,8838:ht,8839:ht,8846:Oi,8849:ht,8850:ht,8851:Oi,8852:Oi,8853:sr,8854:sr,8855:sr,8856:sr,8857:sr,8866:fi,8867:fi,8868:Ki,8869:Ki,8872:[.249,.75,0,0,.867],8900:Ko,8901:[-.05555,.44445,0,0,.27778],8902:ts,8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:rs,8969:rs,8970:rs,8971:rs,8994:iu,8995:iu,9136:is,9137:is,9651:nu,9657:ts,9661:nu,9667:ts,9711:na,9824:ns,9825:ns,9826:ns,9827:ns,9837:[0,.75,0,0,.38889],9838:au,9839:au,10216:hn,10217:hn,10222:is,10223:is,10229:[.011,.511,0,0,1.609],10230:su,10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:su,10815:Ni,10927:ht,10928:ht,57376:ou},"Math-BoldItalic":{32:j,48:as,49:as,50:as,51:aa,52:aa,53:aa,54:nr,55:aa,56:nr,57:aa,65:ko,66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:du,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:lu,77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:cu,105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:fu,112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:j,915:[0,.68611,.15972,0,.65694],916:Co,920:[0,.68611,.03194,0,.86722],923:uu,926:[0,.68611,.07458,0,.84125],928:du,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:hu,936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:fu,960:[0,.44444,.03704,0,.68241],961:pu,962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:pu,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:j,48:ra,49:ra,50:ra,51:sa,52:sa,53:sa,54:ar,55:sa,56:ar,57:sa,65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:gu,73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:mu,80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:bu,112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:j,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:mu,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:gu,931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:bu,960:[0,.43056,.03588,0,.57003],961:vu,962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:vu,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:j,33:[0,.69444,0,0,.36667],34:Ro,35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:ss,40:yu,41:yu,42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:ft,49:ft,50:ft,51:ft,52:ft,53:ft,54:ft,55:ft,56:ft,57:ft,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:xu,64:Gr,65:Gr,66:Gr,67:No,68:pi,69:[0,.69444,0,0,.64167],70:fi,71:Gr,72:pi,73:[0,.69444,0,0,.33056],74:xu,75:_u,76:Cu,77:[0,.69444,0,0,.97778],78:pi,79:pi,80:No,81:[.10556,.69444,0,0,.79445],82:No,83:fi,84:Gr,85:_u,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:Gr,89:[0,.69444,.0275,0,.73334],90:Eu,91:wu,93:wu,94:ft,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:Oo,99:[0,.45833,0,0,.48889],100:Oo,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:Oo,105:ku,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:ku,109:[0,.45833,0,0,.86667],110:Su,111:[0,.45833,0,0,.55],112:Mu,113:Mu,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:Su,118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:j,168:ft,176:Gr,180:ft,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:ft,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:ft,729:ss,730:Gr,732:ft,733:ft,915:Cu,916:[0,.69444,0,0,.91667],920:Io,923:Eu,926:Gr,928:pi,931:pi,933:Io,934:pi,936:Io,937:pi,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:ss,8217:ss,8220:Ro,8221:Ro},"SansSerif-Italic":{32:j,33:[0,.69444,.05733,0,.31945],34:Tu,35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:Ho,40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:Ku,45:[0,.44444,.01946,0,.33333],46:Nu,47:[.25,.75,.13164,0,.5],48:Lr,49:Lr,50:Lr,51:Lr,52:Lr,53:Lr,54:Lr,55:Lr,56:Lr,57:Lr,58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:Yr,66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:qo,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:Wo,77:[0,.69444,.08094,0,.875],78:qo,79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:Au,95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:j,168:[0,.67937,.06385,0,.5],176:Lu,184:Vo,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:Au,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:Bu,715:Ze,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:Lu,732:[0,.67659,.08826,0,.5],733:Bu,915:[0,.69444,.13372,0,.54167],916:ju,920:[0,.69444,.07555,0,.77778],923:fi,926:[0,.69444,.12816,0,.66667],928:qo,931:[0,.69444,.11983,0,.72222],933:Du,934:[0,.69444,.04603,0,.72222],936:Du,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:Ho,8217:Ho,8220:[0,.69444,.14205,0,.5],8221:Tu},"SansSerif-Regular":{32:j,33:[0,.69444,0,0,.31945],34:Ze,35:Fu,36:zo,37:Pu,38:[0,.69444,0,0,.75834],39:Xr,40:hn,41:hn,42:zu,43:sr,44:Ku,45:[0,.44444,0,0,.33333],46:Nu,47:$r,48:Br,49:Br,50:Br,51:Br,52:Br,53:Br,54:Br,55:Br,56:Br,57:Br,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:jo,64:Yr,65:Yr,66:Yr,67:Pi,68:[0,.69444,0,0,.72223],69:Ou,70:[0,.69444,0,0,.56945],71:Yr,72:Uo,73:Xr,74:jo,75:[0,.69444,0,0,.69445],76:Wo,77:[0,.69444,0,0,.875],78:Uo,79:[0,.69444,0,0,.73611],80:Pi,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:fn,84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:Yr,89:[0,.69444,.025,0,.66667],90:fi,91:Iu,93:Iu,94:Ze,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:Zo,99:Ru,100:Zo,101:Ru,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:Zo,105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:Hu,111:[0,.44444,0,0,.5],112:qu,113:qu,114:[0,.44444,.01389,0,.34167],115:Vu,116:[0,.57143,0,0,.36111],117:Hu,118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:j,168:[0,.67937,0,0,.5],176:Yr,184:Vo,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:Ze,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:Ze,715:Ze,728:Ze,729:[0,.67937,0,0,.27778],730:Yr,732:[0,.67659,0,0,.5],733:Ze,915:Wo,916:ju,920:Ki,923:fi,926:Yr,928:Uo,931:ia,933:Ki,934:ia,936:Ki,937:ia,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:Xr,8217:Xr,8220:Ze,8221:Ze},"Script-Regular":{32:j,65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:j},"Size1-Regular":{32:j,40:Wu,41:Wu,47:Uu,91:Zu,92:Uu,93:Zu,123:Ju,125:Ju,160:j,710:os,732:os,770:os,771:os,8214:[-99e-5,.601,0,0,.77778],8593:Xu,8595:Xu,8657:$u,8659:$u,8719:Gu,8720:Gu,8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:Qu,8748:Yu,8749:Yu,8750:Qu,8896:pn,8897:pn,8898:pn,8899:pn,8968:mn,8969:mn,8970:mn,8971:mn,9168:$o,10216:mn,10217:mn,10752:Jo,10753:Jo,10754:Jo,10756:pn,10758:pn},"Size2-Regular":{32:j,40:e0,41:e0,47:t0,91:r0,92:t0,93:r0,123:i0,125:i0,160:j,710:ls,732:ls,770:ls,771:ls,8719:n0,8720:n0,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:s0,8748:a0,8749:a0,8750:s0,8896:gn,8897:gn,8898:gn,8899:gn,8968:cs,8969:cs,8970:cs,8971:cs,10216:o0,10217:o0,10752:Xo,10753:Xo,10754:Xo,10756:gn,10758:gn},"Size3-Regular":{32:j,40:l0,41:l0,47:c0,91:u0,92:c0,93:u0,123:us,125:us,160:j,710:ds,732:ds,770:ds,771:ds,8730:[.95003,1.45,0,0,1],8968:hs,8969:hs,8970:hs,8971:hs,10216:us,10217:us},"Size4-Regular":{32:j,40:d0,41:d0,47:h0,91:f0,92:h0,93:f0,123:fs,125:fs,160:j,710:ps,732:ps,770:ps,771:ps,8730:[1.25003,1.75,0,0,1],8968:ms,8969:ms,8970:ms,8971:ms,9115:gs,9116:p0,9117:gs,9118:gs,9119:p0,9120:gs,9121:bs,9122:$o,9123:bs,9124:bs,9125:$o,9126:bs,9127:m0,9128:g0,9129:b0,9130:[0,.3,0,0,.88889],9131:m0,9132:g0,9133:b0,9143:[.88502,.915,0,0,1.05556],10216:fs,10217:fs,57344:v0,57345:v0,57680:vs,57681:vs,57682:vs,57683:vs},"Typewriter-Regular":{32:_0,33:K,34:K,35:K,36:xr,37:xr,38:K,39:K,40:xr,41:xr,42:[0,.52083,0,0,.525],43:y0,44:[.13889,.125,0,0,.525],45:y0,46:[0,.125,0,0,.525],47:xr,48:K,49:K,50:K,51:K,52:K,53:K,54:K,55:K,56:K,57:K,58:At,59:[.13889,.43056,0,0,.525],60:x0,61:[-.19549,.41562,0,0,.525],62:x0,63:K,64:K,65:K,66:K,67:K,68:K,69:K,70:K,71:K,72:K,73:K,74:K,75:K,76:K,77:K,78:K,79:K,80:K,81:[.13889,.61111,0,0,.525],82:K,83:K,84:K,85:K,86:K,87:K,88:K,89:K,90:K,91:xr,92:xr,93:xr,94:K,95:[.09514,0,0,0,.525],96:K,97:At,98:K,99:At,100:K,101:At,102:K,103:oa,104:K,105:K,106:[.22222,.61111,0,0,.525],107:K,108:K,109:At,110:At,111:At,112:oa,113:oa,114:At,115:At,116:[0,.55358,0,0,.525],117:At,118:At,119:At,120:At,121:oa,122:At,123:xr,124:xr,125:xr,126:K,127:K,160:_0,176:K,184:[.19445,0,0,0,.525],305:At,567:oa,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:K,715:K,728:K,730:K,770:K,771:K,776:K,915:K,916:K,920:K,923:K,926:K,928:K,931:K,933:K,934:K,936:K,937:K,8216:K,8217:K,8242:K,9251:[.11111,.21944,0,0,.525]}},of=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,bn=10,_r=.25,lf=1.2,mi=.431,w0={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[mi,mi,mi],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.5,.732,.925],num2:[.394,.384,.5],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[_r,_r,_r],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04]},Go=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Yo=5,k0={"\xA0":" ","\u200B":" ",\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function vn(e,t){e===void 0&&(e=77);const r=sf[t][e];if(r)return{defaultMetrics:!1,depth:r[0],height:r[1],italic:r[2],skew:r[3],width:r[4]};if(e===11034)return{defaultMetrics:!0,depth:.2,height:.8,italic:0,skew:0,width:.8};const i=String.fromCodePoint(e);if(i in k0)e=k0[i].codePointAt(0);else if(of.test(i))return e=77,{defaultMetrics:!0,depth:.2,height:.9,italic:0,skew:0,width:1};return{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0,width:.8}}var Qo={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],longrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],longleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],longleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],longrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],longleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],longleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],longRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716],longLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},el={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34],overarc:[1061,159,.3],underarc:[1061,159,.3]},M0={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,overarc:"M529 0c179 0 524 115 524 115 5 1 9 5 9 10 0 1-1 2-1 3l-4 22c-1 5-5 9-11 9h-2s-338-93-512-92c-174 0-513 92-513 92h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13 0 0 342-115 520-115z",underarc:`m 529 160
c -179 0 -524 -115 -524 -115
c -5 -1 -9 -5 -9 -10
c 0 -1 1 -2 1 -3
l 4 -22
c 1 -5 5 -9 11 -9
h 2
s 338 93 512 92
c 174 0 513 -92 513 -92
h 2
c 5 0 9 4 11 9
l 5 22
c 1 6 -2 12 -8 13
c 0 0 -342 115 -520 115
z
`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,widetilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,widetilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,widetilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,widetilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`};function cf(e){if(el[e]){const[c,u,d]=el[e],h=`<span class="stretchy" style="height:${d}em"><svg width="100%" height="${d}em" viewBox="0 0 ${c} ${u}" preserveAspectRatio="none" ><path fill="currentcolor" d="${M0[e]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*d/2)/100}em;min-width:0">${h}</span>`}const[t,r,i,n]=Qo[e];let a,s;const o=i/1e3;t.length===3?(a=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],s=["xMinYMin","xMidYMin","xMaxYMin"]):t.length===2?(a=["slice-1-of-2","slice-2-of-2"],s=["xMinYMin","xMaxYMin"]):(a=["slice-1-of-1"],s=[n]);const l=t.map((c,u)=>`<span class="${a[u]}" style=height:${o}em><svg width=400em height=${o}em viewBox="0 0 400000 ${i}" preserveAspectRatio="${s[u]} slice"><path fill="currentcolor" d="${M0[c]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${o}em;min-width:${r}em;">${l}</span>`}function uf(e){return Qo[e]?Qo[e][2]/1e3:el[e][2]}function df(e){const t=[];for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(i===13&&e.charCodeAt(r+1)===10&&(i=10,r++),(i===13||i===12)&&(i=10),i===0&&(i=65533),i>=55296&&i<=56319){const n=e.charCodeAt(r+1);if(n>=56320&&n<=57343){const a=i-55296,s=n-56320;i=jr(2,16)+a*jr(2,10)+s,r++}}t.push(i)}return t}var ys=8205,hf=[[ys,1],[65038,2],[127995,5],[129456,4],[917536,96]],xs,S0=[127462,127487];function C0(e){var t;if(xs===void 0){xs={};for(const r of hf)for(let i=r[0];i<=r[0]+r[1]-1;i++)xs[i]=!0}return(t=xs[e])!=null?t:!1}function ff(e){return e>=S0[0]&&e<=S0[1]}function E0(e){if(/^[\u0020-\u00FF]*$/.test(e))return e;const t=[],r=df(e);let i=0;for(;i<r.length;){const n=r[i++],a=r[i];if(a===ys){const s=i-1;for(i+=2;r[i]===ys;)i+=2;t.push(String.fromCodePoint(...r.slice(s,i-s+1)))}else if(C0(a)){const s=i-1;for(;C0(r[i]);)i+=r[i]===ys?2:1;t.push(String.fromCodePoint(...r.slice(s,2*i-s-1)))}else ff(n)?(i+=1,t.push(String.fromCodePoint(...r.slice(i-2,2)))):t.push(String.fromCodePoint(n))}return t}var pf=class{constructor(e){this.obeyspaces=!1,this.pos=0,this.s=E0(e)}end(){return this.pos>=this.s.length}get(){return this.pos<this.s.length?this.s[this.pos++]:""}peek(){return this.s[this.pos]}match(e){const t=typeof this.s=="string"?e.exec(this.s.slice(this.pos)):e.exec(this.s.slice(this.pos).join(""));return t!=null&&t[0]?(this.pos+=t[0].length,t[0]):""}next(){if(this.end())return null;if(!this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]+/)||this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]/))return"<space>";const e=this.get();if(e==="\\"){if(!this.end()){let t=this.match(/^[a-zA-Z\*]+/);return t?this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]*/):t=this.get(),"\\"+t}}else{if(e==="{")return"<{>";if(e==="}")return"<}>";if(e==="^"){if(this.peek()==="^"){this.get();const t=this.match(/^(\^(\^(\^(\^[\da-f])?[\da-f])?[\da-f])?[\da-f])?[\da-f]{2}/);if(t)return String.fromCodePoint(Number.parseInt(t.slice(t.lastIndexOf("^")+1),16))}return e}else if(e==="#"){if(!this.end()){let t=!1;if(/[\d?@]/.test(this.peek())&&(t=!0,this.pos+1<this.s.length)){const r=this.s[this.pos+1];t=/[^\dA-Za-z]/.test(r)}return t?"#"+this.get():"#"}}else if(e==="$")return this.peek()==="$"?(this.get(),"<$$>"):"<$>"}return e}};function mf(e,t){var r,i,n,a;const s=[];let o=e.next();if(o&&o!=="\\relax"){if(o==="\\noexpand")o=e.next(),o&&s.push(o);else if(o==="\\obeyspaces")e.obeyspaces=!0;else if(o==="\\bgroup")s.push("<{>");else if(o==="\\egroup")s.push("<}>");else if(o==="\\string"){if(o=e.next(),o)if(o.startsWith("\\"))for(const l of o)s.push(l==="\\"?"\\backslash":l);else o==="<{>"?s.push("\\{"):o==="<space>"?s.push("~"):o==="<}>"&&s.push("\\}")}else if(o==="\\csname"){for(;e.peek()==="<space>";)e.next();let l="",c=!1,u=[];do{if(u.length===0)if(/^#[\d?@]$/.test(e.peek())){const d=e.get().slice(1);u=_s((i=(r=t==null?void 0:t(d))!=null?r:t==null?void 0:t("?"))!=null?i:"\\placeholder{}",t),o=u[0]}else o=e.next(),u=o?[o]:[];c=u.length===0,!c&&o==="\\endcsname"&&(c=!0,u.shift()),c||(c=o==="<$>"||o==="<$$>"||o==="<{>"||o==="<}>"||typeof o=="string"&&o.length>1&&o.startsWith("\\")),c||(l+=u.shift())}while(!c);l&&s.push("\\"+l),s.push(...u)}else if(o!=="\\endcsname")if(o.length>1&&o.startsWith("#")){const l=o.slice(1);s.push(..._s((a=(n=t==null?void 0:t(l))!=null?n:t==null?void 0:t("?"))!=null?a:"\\placeholder{}",t))}else s.push(o)}return s}function _s(e,t=null){const r=[];let i="";for(const s of e.toString().split(/\r?\n/)){i&&r.push(i),i=" ";const o=s.match(/((?:\\%)|[^%])*/);o!==null&&r.push(o[0])}const n=new pf(at(r.join(""))),a=[];do a.push(...mf(n,t));while(!n.end());return a}function X(e){let t="";const r=[];for(const i of e)i&&(t&&/^[a-zA-Z\*]/.test(i)&&r.push(t),r.push(i),/^\\[a-zA-Z]+\*?[\"\'][^\ ]+$/.test(i)&&r.push(" "),t=/\\[a-zA-Z]+\*?$/.test(i)?" ":"");return r.join("")}function _e(e,...t){return console.assert(e.startsWith("\\")),t.length===0?e:X([e,...t.map(r=>`{${r}}`)])}function Ii(e){return X(e.map(t=>{var r;return(r={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[t])!=null?r:t}))}var A0=class Ra{constructor(t){Ra._registry[t]=this}static createAtom(t,r,i){return Ra._registry[t].createAtom(r,Ve(r,t),i)}static serialize(t,r){var i;if(!t||t.length===0)return"";if((i=r.skipStyles)!=null&&i){const n=[];for(const a of L0(t)){const s=Ra._registry[a[0].mode];n.push(...s.serialize(a,r))}return X(n)}return X(bf(t,r))}static getFont(t,r,i){return Ra._registry[t].getFont(r,i)}};A0._registry={};var Ut=A0;function L0(e){const t=[];let r=[],i="NONE";for(const n of e)n.type!=="first"&&(n.mode!==i?(r.length>0&&t.push(r),r=[n],i=n.mode):r.push(n));return r.length>0&&t.push(r),t}function gi(e,t){const r=[];let i=[],n;for(const a of e)if(a.type!=="first"&&a.style){let s;t==="variant"?(s=a.style.variant,a.style.variantStyle&&a.style.variantStyle!=="up"&&(s+="-"+a.style.variantStyle)):s=a.style[t],s===n?i.push(a):(i.length>0&&r.push(i),i=[a],n=s)}return i.length>0&&r.push(i),r}function B0(e,t){var r;const{parent:i}=e[0],n=i==null?void 0:i.computedStyle.color,a=[];for(const s of L0(e)){const o=t.defaultMode;for(const l of gi(s,"color")){const c=l[0].computedStyle,u=Ut._registry[l[0].mode].serialize(l,g(p({},t),{defaultMode:o==="text"?"text":"math"}));!t.skipStyles&&c.color&&c.color!=="none"&&(!i||n!==c.color)?a.push(_e("\\textcolor",(r=c.verbatimColor)!=null?r:c.color,X(u))):a.push(X(u))}}return a}function gf(e,t){const{parent:r}=e[0],i=r==null?void 0:r.computedStyle.backgroundColor;return gi(e,"backgroundColor").map(n=>{var a;if(n.length>0||n[0].type!=="box"){const s=n[0].computedStyle;if(s.backgroundColor&&s.backgroundColor!=="none"&&(!r||i!==s.backgroundColor))return _e("\\colorbox",(a=s.verbatimBackgroundColor)!=null?a:s.backgroundColor,X(B0(n,g(p({},t),{defaultMode:"text"}))))}return X(B0(n,t))})}function bf(e,t){if(e.length===0)return[];const{parent:r}=e[0],i=r==null?void 0:r.computedStyle.fontSize,n=[];for(const a of gi(e,"fontSize")){const s=a[0].computedStyle.fontSize,o=gf(a,t);o&&(s&&s!=="auto"&&(!r||i!==s)?n.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][s],...o):n.push(...o))}return n}function tl(e){return e?{mord:"ord",mbin:"bin",mop:"op",mrel:"rel",mopen:"open",mclose:"close",mpunct:"punct",minner:"inner",spacing:"ignore",latex:"latex",composition:"inner",error:"inner",placeholder:"ord",supsub:"ignore"}[e]:void 0}function la(e){if(e.length===0)return"ord";const t=tl(e[0].type),r=tl(e[e.length-1].type);return t&&t===r?t:"ord"}function ca(e,t){if(typeof e=="string")return e;if(typeof e=="number"){console.assert(Number.isFinite(e));const r=Math.ceil(100*e)/100;return r===0?"0":r.toString()+(t!=null?t:"")}return""}var D=class Sh{constructor(t,r){var i,n,a,s,o;if(typeof t=="number"?this.value=String.fromCodePoint(t):typeof t=="string"?this.value=t:le(t)?this.children=t.filter(c=>c!==null):t&&t instanceof Sh&&(this.children=[t]),this.children)for(const c of this.children)c.parent=this;this.type=(i=r==null?void 0:r.type)!=null?i:"ignore",this.isSelected=(r==null?void 0:r.isSelected)===!0,r!=null&&r.caret&&(this.caret=r.caret),this.classes=(n=r==null?void 0:r.classes)!=null?n:"",this.isTight=(a=r==null?void 0:r.isTight)!=null?a:!1,r!=null&&r.attributes&&(this.attributes=r.attributes);let l=r==null?void 0:r.fontFamily;r!=null&&r.style&&this.value&&(l=(o=Ut.getFont((s=r.mode)!=null?s:"math",this,g(p({variant:"normal"},r.style),{letterShapeStyle:r.letterShapeStyle})))!=null?o:void 0),l||(l="Main-Regular"),this._height=0,this._depth=0,this._width=0,this.hasExplicitWidth=!1,this.skew=0,this.italic=0,this.maxFontSize=0,this.scale=1,(r==null?void 0:r.maxFontSize)!==void 0&&(this.maxFontSize=r.maxFontSize),vf(this,l)}set atomID(t){t===void 0||t.length===0||(this.id=t)}selected(t){if(this.isSelected!==t&&(this.isSelected=t,this.children))for(const r of this.children)r.selected(t)}setStyle(t,r,i){if(r===void 0)return;const n=ca(r,i);n.length>0&&(this.cssProperties||(this.cssProperties={}),this.cssProperties[t]=n)}setTop(t){Number.isFinite(t)&&Math.abs(t)>.01&&(this.cssProperties||(this.cssProperties={}),this.cssProperties.top=ca(t,"em"),this.height-=t,this.depth+=t)}get left(){var t;return(t=this.cssProperties)!=null&&t["margin-left"]?Number.parseFloat(this.cssProperties["margin-left"]):0}set left(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-left"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-left"]=ca(t,"em")))}set right(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-right"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-right"]=ca(t,"em")))}set bottom(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-bottom"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-bottom"]=ca(t,"em")))}get width(){return this._width*this.scale}set width(t){this._width=t,this.hasExplicitWidth=!0}set softWidth(t){}get height(){return this._height*this.scale}set height(t){this._height=t}get depth(){return this._depth*this.scale}set depth(t){this._depth=t}wrap(t){const r=t.parent;if(!r)return this;t.isPhantom&&this.setStyle("opacity",0);const i=t.color;i&&i!==r.color&&this.setStyle("color",i);let n=t.backgroundColor;this.isSelected&&(n=Mr(n)),n&&n!==r.backgroundColor&&(this.setStyle("background-color",n),this.setStyle("display","inline-block"));const a=t.scalingFactor;return this.scale=a,this.skew*=a,this.italic*=a,this}toMarkup(){var t,r,i,n;let a=(t=this.value)!=null?t:"";if(this.children)for(const f of this.children)a+=f.toMarkup();let s="";if(this.svgBody)s=cf(this.svgBody);else if(this.svgOverlay){s='<span style="',s+="display: inline-block;",s+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`,s+=`vertical-align:${Math.floor(100*this.depth)/100}em;`,s+='">',s+=a,s+="</span>",s+='<svg style="position:absolute;overflow:visible;',s+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`;const f=(r=this.cssProperties)==null?void 0:r.padding;f?(s+=`top:${f};`,s+=`left:${f};`,s+=`width:calc(100% - 2 * ${f} );`):s+="top:0;left:0;width:100%;",s+="z-index:2;",s+='"',this.svgStyle&&(s+=this.svgStyle),s+=` viewBox="0 0 ${Math.floor(100*this.width)/100} ${Math.floor(100*(this.height+this.depth))/100}"`,s+=`>${this.svgOverlay}</svg>`}let o="";const l=this.classes.split(" ");l.push((i={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?i:""),this.caret==="latex"&&l.push("ML__latex-caret"),this.isSelected&&l.push("ML__selected");const c=l.length===1?l[0]:l.filter((f,m,y)=>f.length>0&&y.indexOf(f)===m).join(" ");if(c.length>0&&(o+=` class="${c}"`),this.id&&(o+=` data-atom-id=${this.id}`),this.cssId&&(o+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(o+=" "+Object.keys(this.attributes).map(f=>`${f}="${this.attributes[f]}"`).join(" ")),this.htmlData){const f=this.htmlData.split(",");for(const m of f){const y=m.match(/([^=]+)=(.+$)/);if(y){const A=y[1].trim().replace(/ /g,"-");A&&(o+=` data-${A}="${y[2]}" `)}else{const A=m.trim().replace(/ /g,"-");A&&(o+=` data-${A} `)}}}const u=(n=this.cssProperties)!=null?n:{};this.hasExplicitWidth&&u.width===void 0&&(u.width=`${Math.ceil(this._width*100)/100}em`);const d=Object.keys(u).map(f=>`${f}:${u[f]}`);if(this.scale!==void 0&&this.scale!==1&&(a.length>0||s.length>0)&&d.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const f=this.htmlStyle.split(";");let m="";for(const y of f){const A=y.match(/([^=]+):(.+$)/);if(A){const v=A[1].trim().replace(/ /g,"-");v&&(m+=`${v}:${A[2]};`)}}m&&(o+=` style="${m}"`)}d.length>0&&(o+=` style="${d.join(";")}"`);let h="";return o.length>0||s.length>0?h=`<span${o}>${a}${s}</span>`:h=a,this.caret==="text"?h+='<span class="ML__text-caret"></span>':this.caret==="math"&&(h+='<span class="ML__caret"></span>'),h}tryCoalesceWith(t){if(this.svgBody||!this.value||t.svgBody||!t.value)return!1;const r=this.children&&this.children.length>0,i=t.children&&t.children.length>0;if(r||i)return!1;if(t.cssProperties||this.cssProperties){for(const l of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(t.cssProperties&&l in t.cssProperties||this.cssProperties&&l in this.cssProperties)return!1}const n=this.cssProperties?Object.keys(this.cssProperties).length:0,a=t.cssProperties?Object.keys(t.cssProperties).length:0;if(n!==a)return!1;if(n>0){for(const l of Object.keys(this.cssProperties))if(this.cssProperties[l]!==t.cssProperties[l])return!1}const s=this.classes.trim().replace(/\s+/g," ").split(" "),o=t.classes.trim().replace(/\s+/g," ").split(" ");if(s.length!==o.length)return!1;s.sort(),o.sort();for(const[l,c]of s.entries())if(c==="vertical-separator"||c!==o[l])return!1;return this.value+=t.value,this.height=Math.max(this.height,t.height),this.depth=Math.max(this.depth,t.depth),this._width=this._width+t._width,this.maxFontSize=Math.max(this.maxFontSize,t.maxFontSize),this.italic=t.italic,!0}};function rl(e){if(!e||e.length===0)return[];e[0].children=rl(e[0].children);const t=[e[0]];for(let r=1;r<e.length;r++)t[t.length-1].tryCoalesceWith(e[r])||(e[r].children=rl(e[r].children),t.push(e[r]));return t}function ws(e){return e.children&&(e.children=rl(e.children)),e}function ks(e,t){if(!e)return new D(null,t);const r=new D(null,{classes:"ML__strut",type:"ignore"});r.setStyle("height",Math.max(0,e.height),"em");const i=[r];if(e.depth!==0){const n=new D(null,{classes:"ML__strut--bottom",type:"ignore"});n.setStyle("height",e.height+e.depth,"em"),n.setStyle("vertical-align",-e.depth,"em"),i.push(n)}return i.push(e),new D(i,g(p({},t),{type:"lift"}))}function Ms(e){const t=uf(e)/2,r=new D(null,{maxFontSize:0});return r.height=t+.166,r.depth=t-.166,r.svgBody=e,r}function vf(e,t){var r;if(e.type==="latex"){e.height=.9,e.depth=.2,e._width=1;return}if(e.value){e.height=-1/0,e.depth=-1/0,e._width=0,e.skew=-1/0,e.italic=-1/0;for(let i=0;i<e.value.length;i++){const n=vn(e.value.codePointAt(i),t);e.height=Math.max(e.height,n.height),e.depth=Math.max(e.depth,n.depth),e._width+=n.width,e.skew=n.skew,e.italic=n.italic}return}if(e.children&&e.children.length>0){let i=-1/0,n=-1/0,a=0;for(const s of e.children)s.height>i&&(i=s.height),s.depth>n&&(n=s.depth),a=Math.max(a,(r=s.maxFontSize)!=null?r:0);e.height=i,e.depth=n,e._width=e.children.reduce((s,o)=>s+o.width,0),e.maxFontSize=a}}function yf(e){if("individualShift"in e){const t=e.individualShift;let r=t[0];const i=[r],n=-r.shift-r.box.depth;let a=n;for(let s=1;s<t.length;s++){const o=t[s],l=-o.shift-a-o.box.depth,c=l-(r.box.height+r.box.depth);a=a+l,i.push(c),i.push(o),r=o}return[i,n]}if("top"in e){let t=e.top;for(const r of e.children)t-=typeof r=="number"?r:r.box.height+r.box.depth;return[e.children,t]}else{if("bottom"in e)return[e.children,-e.bottom];if("firstBaseline"in e){const t=e.firstBaseline[0];if(typeof t=="number")throw new Error("First child must be an element.");return[e.firstBaseline,-t.box.depth]}else if("shift"in e){const t=e.children[0];if(typeof t=="number")throw new Error("First child must be an element.");return[e.children,-t.box.depth-e.shift]}}return[null,0]}function xf(e){var t;const[r,i]=yf(e);if(!r)return[[],0,0];const n=new D(null,{classes:"pstrut"});let a=0;for(const m of r)if(typeof m!="number"){const y=m.box;a=Math.max(a,y.maxFontSize,y.height)}a+=2,n.height=a,n.setStyle("height",a,"em");const s=[];let o=i,l=i,c=i,u=0;for(const m of r){if(typeof m=="number")c+=m;else{const y=m.box,A=(t=m.classes)!=null?t:[],v=new D([n,y],{classes:A.join(" "),style:m.style});y.setStyle("height",y.height+y.depth,"em"),y.setStyle("display","inline-block"),v.setStyle("top",-a-c-y.depth,"em"),m.marginLeft&&v.setStyle("margin-left",m.marginLeft,"em"),m.marginRight&&v.setStyle("margin-right",m.marginRight,"em"),s.push(v),c+=y.height+y.depth,u=Math.max(u,v.width)}o=Math.min(o,c),l=Math.max(l,c)}s.forEach(m=>{m.softWidth=u});const d=new D(s,{classes:"vlist"});if(d.softWidth=u,d.height=l,d.setStyle("height",l,"em"),o>=0)return[[new D(d,{classes:"vlist-r"})],l,-o];const h=new D(new D(null),{classes:"vlist"});h.height=-o,h.setStyle("height",-o,"em");const f=new D(8203,{classes:"vlist-s",maxFontSize:0});return f.softWidth=0,f.height=0,f.depth=0,[[new D([d,f],{classes:"vlist-r"}),new D(h,{classes:"vlist-r"})],l,-o]}var je=class extends D{constructor(e,t){var r;const[i,n,a]=xf(e);super(i.length===1?i[0]:i,{type:t==null?void 0:t.type,classes:((r=t==null?void 0:t.classes)!=null?r:"")+" vlist-t"+(i.length===2?" vlist-t2":"")}),this.height=n,this.depth=a,this.softWidth=i.reduce((s,o)=>Math.max(s,o.width),0)}};function _f(e,t){var r,i,n,a,s;const o=e.metrics,l=new D(t.base),c=(r=t.baseShift)!=null?r:0,u=(i=t.slant)!=null?i:0;let d=0,h=0;t.above&&(d=(n=t.aboveShift)!=null?n:Math.max(o.bigOpSpacing1,o.bigOpSpacing3-t.above.depth)),t.below&&(h=(a=t.belowShift)!=null?a:Math.max(o.bigOpSpacing2,o.bigOpSpacing4-t.below.height));let f=null;if(t.below&&t.above){const m=o.bigOpSpacing5+t.below.height+t.below.depth+h+l.depth+c;f=new je({bottom:m,children:[o.bigOpSpacing5,{box:t.below,marginLeft:-u,classes:["ML__center"]},h,{box:l,classes:["ML__center"]},d,{box:t.above,marginLeft:u,classes:["ML__center"]},o.bigOpSpacing5]}).wrap(e)}else if(t.below&&!t.above)f=new je({top:l.height-c,children:[o.bigOpSpacing5,{box:t.below,marginLeft:-u,classes:["ML__center"]},h,{box:l,classes:["ML__center"]}]}).wrap(e);else if(!t.below&&t.above){const m=l.depth+c;f=new je({bottom:m,children:[{box:l,classes:["ML__center"]},d,{box:t.above,marginLeft:u,classes:["ML__center"]},o.bigOpSpacing5]}).wrap(e)}else{const m=l.depth+c;f=new je({bottom:m,children:[{box:l},o.bigOpSpacing5]}).wrap(e)}return new D(f,{type:(s=t.type)!=null?s:"op"})}var il=7,Ss=6,Cs=5,Ri=4,yn=3,Zt=2,qi=1,yt=0,bi=class{constructor(e,t,r){this.id=e,this.sizeDelta=t,this.cramped=r;const i={"-4":2,"-3":1,0:0}[t];this.metrics=Object.keys(w0).reduce((n,a)=>g(p({},n),{[a]:w0[a][i]}),{})}getFontSize(e){return Math.max(1,e+this.sizeDelta)}get sup(){return Dr[[yt,qi,yt,qi,Zt,yn,Zt,yn][this.id]]}get sub(){return Dr[[yt,yt,yt,yt,Zt,Zt,Zt,Zt][this.id]]}get fracNum(){return Dr[[yt,qi,yt,qi,Zt,yn,Ri,Cs][this.id]]}get fracDen(){return Dr[[yt,yt,yt,yt,Zt,Zt,Ri,Ri][this.id]]}get cramp(){return Dr[[yt,yt,Zt,Zt,Ri,Ri,Ss,Ss][this.id]]}get isTight(){return this.sizeDelta<0}},ua={7:new bi(il,0,!1),6:new bi(Ss,0,!0),5:new bi(Cs,0,!1),4:new bi(Ri,0,!0),3:new bi(yn,-3,!1),2:new bi(Zt,-3,!0),1:new bi(qi,-4,!1),0:new bi(yt,-4,!0)},Dr=g(p({},ua),{displaystyle:ua[il],textstyle:ua[Cs],scriptstyle:ua[yn],scriptscriptstyle:ua[qi]});function D0(e,t){var r;if(!e)return 0;const i={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:3/4,em:bn,bp:803/800,dd:1238/1157,pc:12,in:72.27,mu:10/18}[(r=e.unit)!=null?r:"pt"];if(Number.isFinite(t)){const n=jr(10,t);return Math.round(e.dimension/bn*i*n)/n}return e.dimension*i}function T0(e,t){if(e===null)return 0;const r=D0(e)/bn;if(Number.isFinite(t)){const i=jr(10,t);return Math.round(r*i)/i}return r}function nl(e){var t;return`${e.dimension}${(t=e.unit)!=null?t:"pt"}`}function wf(e){let t=nl(e.glue);return e.grow&&e.grow.dimension!==0&&(t+=` plus ${nl(e.grow)}`),e.shrink&&e.shrink.dimension!==0&&(t+=` minus ${nl(e.shrink)}`),t}function ct(e){var t,r;if(e==null)return null;let i="";if("dimension"in e&&(i=`${e.dimension}${(t=e.unit)!=null?t:"pt"}`),"glue"in e&&(i=wf(e)),"number"in e)if(!("base"in e)||e.base==="decimal")i=Number(e.number).toString();else if(e.base==="alpha")i=`\`${String.fromCodePoint(e.number)}`;else{const n=Math.round(e.number)>>>0;e.base==="hexadecimal"?(i=Number(n).toString(16).toUpperCase(),n<=255?i=i.padStart(2,"0"):n<=65535?i=i.padStart(4,"0"):n<=16777215?i=i.padStart(6,"0"):i=i.padStart(8,"0"),i=`"${i}`):e.base==="octal"&&(i=Number(n).toString(8),n<=63?i=i.padStart(2,"0"):n<=30583?i=i.padStart(4,"0"):i=i.padStart(8,"0"),i=`'${i}`)}return"register"in e&&("factor"in e&&(e.factor===-1?i="-":e.factor!==1&&(i=Number(e.factor).toString())),"global"in e&&e.global&&(i+="\\global"),i+=`\\${e.register}`),"string"in e&&(i=e.string),(r=e.relax)!=null&&r&&(i+="\\relax"),i}function Tr(e,t){return e==null?null:"number"in e?g(p({},e),{number:e.number*t}):"register"in e?"factor"in e&&e.factor?g(p({},e),{factor:e.factor*t}):g(p({},e),{factor:t}):"dimension"in e?g(p({},e),{dimension:e.dimension*t}):"glue"in e?e.shrink&&e.grow?{glue:Tr(e.glue,t),shrink:Tr(e.shrink,t),grow:Tr(e.grow,t)}:e.shrink?{glue:Tr(e.glue,t),shrink:Tr(e.shrink,t)}:e.grow?{glue:Tr(e.glue,t),grow:Tr(e.grow,t)}:{glue:Tr(e.glue,t)}:null}var kf={"p@":{dimension:1},"z@":{dimension:0},maxdimen:{dimension:16383.99999},hfuzz:{dimension:.1},vfuzz:{dimension:.1},overfullrule:{dimension:5},hsize:{dimension:6.5,unit:"in"},vsize:{dimension:8.9,unit:"in"},parindent:{dimension:20},maxdepth:{dimension:4},splitmaxdepth:{register:"maxdimen"},boxmaxdepth:{register:"maxdimen"},delimitershortfall:{dimension:5},nulldelimiterspace:{dimension:1.2,unit:"pt"},scriptspace:{dimension:.5},topskip:{dimension:10},splittopskip:{dimension:10},normalbaselineskip:{dimension:12},normallineskip:{dimension:1},normallineskiplimit:{dimension:0},jot:{dimension:3},doublerulesep:{dimension:2},arrayrulewidth:{dimension:.4},arraycolsep:{dimension:5},fboxsep:{dimension:3},fboxrule:{dimension:.4},"z@skip":{glue:{dimension:0},shrink:{dimension:0},grow:{dimension:0}},hideskip:{glue:{dimension:-1e3},grow:{dimension:1,unit:"fill"}},"@flushglue":{glue:{dimension:0},grow:{dimension:1,unit:"fill"}},parskip:{glue:{dimension:0},grow:{dimension:1}},abovedisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},abovedisplayshortskip:{glue:{dimension:0},grow:{dimension:3}},belowdisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},belowdisplayshortskip:{glue:{dimension:7},grow:{dimension:3},shrink:{dimension:4}},parfillskip:{glue:{dimension:0},grow:{dimension:1,unit:"fil"}},thinmuskip:{glue:{dimension:3,unit:"mu"}},medmuskip:{glue:{dimension:4,unit:"mu"},grow:{dimension:2,unit:"mu"},shrink:{dimension:4,unit:"mu"}},thickmuskip:{glue:{dimension:5,unit:"mu"},grow:{dimension:5,unit:"mu"}},smallskipamount:{glue:{dimension:3},grow:{dimension:1},shrink:{dimension:1}},medskipamount:{glue:{dimension:6},grow:{dimension:2},shrink:{dimension:3}},bigskipamount:{glue:{dimension:12},grow:{dimension:2},shrink:{dimension:4}},pretolerance:100,tolerance:200,hbadness:1e3,vbadness:1e3,linepenalty:10,hyphenpenalty:50,exhyphenpenalty:50,binoppenalty:700,relpenalty:500,clubpenalty:150,widowpenalty:150,displaywidowpenalty:50,brokenpenalty:100,predisplaypenalty:1e4,doublehyphendemerits:1e4,finalhyphendemerits:5e3,adjdemerits:1e4,tracinglostchars:1,uchyph:1,delimiterfactor:901,defaulthyphenchar:"\\-",defaultskewchar:-1,newlinechar:-1,showboxbreadth:5,showboxdepth:3,errorcontextlines:5,interdisplaylinepenalty:100,interfootnotelinepenalty:100,baselineSkip:1.2,arraystretch:1,month:new Date().getMonth()+1,day:new Date().getDate(),year:new Date().getFullYear()};function F0(){return p({},kf)}function al(){return{registers:F0(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:N.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:Rt,backgroundColorMap:ye,getMacro:e=>fr(e,Vt())}}var $=class Ch{constructor(t,r){var i,n,a,s,o,l,c,u,d,h,f,m,y,A,v;let S;t!=null&&t.parent?(this.parent=t.parent,S=t.parent,this.registers={}):(S=p(p({},al()),(i=t==null?void 0:t.from)!=null?i:{}),this.registers=S.registers),S.atomIdsSettings&&(this.atomIdsSettings=p({},S.atomIdsSettings)),this.renderPlaceholder=S.renderPlaceholder,this.isPhantom=(s=(a=t==null?void 0:t.isPhantom)!=null?a:(n=this.parent)==null?void 0:n.isPhantom)!=null?s:!1,this.letterShapeStyle=S.letterShapeStyle,this.minFontScale=S.minFontScale,r!=null&&r.color&&r.color!=="none"?this.color=r.color:this.color=(l=(o=this.parent)==null?void 0:o.color)!=null?l:"",r!=null&&r.backgroundColor&&r.backgroundColor!=="none"?this.backgroundColor=r.backgroundColor:this.backgroundColor=(u=(c=this.parent)==null?void 0:c.backgroundColor)!=null?u:"",r!=null&&r.fontSize&&r.fontSize!=="auto"&&r.fontSize!==((d=this.parent)==null?void 0:d.size)?this.size=r.fontSize:this.size=(f=(h=this.parent)==null?void 0:h.size)!=null?f:Yo;let L=(y=(m=this.parent)==null?void 0:m.mathstyle)!=null?y:Dr.displaystyle;if(typeof(t==null?void 0:t.mathstyle)=="string"){if(S instanceof Ch)switch(t.mathstyle){case"cramp":L=L.cramp;break;case"superscript":L=L.sup;break;case"subscript":L=L.sub;break;case"numerator":L=L.fracNum;break;case"denominator":L=L.fracDen;break}switch(t.mathstyle){case"textstyle":L=Dr.textstyle;break;case"displaystyle":L=Dr.displaystyle;break;case"scriptstyle":L=Dr.scriptstyle;break;case"scriptscriptstyle":L=Dr.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=L,this.smartFence=S.smartFence,this.placeholderSymbol=S.placeholderSymbol,this.colorMap=(A=S.colorMap)!=null?A:C=>C,this.backgroundColorMap=(v=S.backgroundColorMap)!=null?v:C=>C,this.getMacro=S.getMacro,console.assert(this.parent!==void 0||this.registers!==void 0)}makeID(){if(!this.atomIdsSettings)return;if(this.atomIdsSettings.overrideID)return this.atomIdsSettings.overrideID;if(typeof this.atomIdsSettings.seed!="number")return`${Date.now().toString(36).slice(-2)}${Math.floor(Math.random()*1e5).toString(36)}`;const t=this.atomIdsSettings.seed.toString(36);return this.atomIdsSettings.seed+=1,t}scale(t){return t*this.effectiveFontSize}get scalingFactor(){return this.parent?this.effectiveFontSize/this.parent.effectiveFontSize:1}get isDisplayStyle(){return this.mathstyle.id===il||this.mathstyle.id===Ss}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(Go[Math.max(1,this.size+this.mathstyle.sizeDelta)],this.minFontScale)}getRegister(t){var r;if((r=this.registers)!=null&&r[t])return this.registers[t];if(this.parent)return this.parent.getRegister(t)}getRegisterAsNumber(t){const r=this.getRegister(t);if(typeof r=="number")return r;if(typeof r=="string")return Number(r)}getRegisterAsGlue(t){var r;if((r=this.registers)!=null&&r[t]){const i=this.registers[t];return typeof i=="object"&&"glue"in i?i:typeof i=="object"&&"dimension"in i?{glue:{dimension:i.dimension}}:typeof i=="number"?{glue:{dimension:i}}:void 0}if(this.parent)return this.parent.getRegisterAsGlue(t)}getRegisterAsEm(t,r){return T0(this.getRegisterAsDimension(t),r)}getRegisterAsDimension(t){var r;if((r=this.registers)!=null&&r[t]){const i=this.registers[t];return typeof i=="object"&&"glue"in i?i.glue:typeof i=="object"&&"dimension"in i?i:typeof i=="number"?{dimension:i}:void 0}if(this.parent)return this.parent.getRegisterAsDimension(t)}setRegister(t,r){if(r===void 0){delete this.registers[t];return}this.registers[t]=r}evaluate(t){if(!t||!("register"in t))return t;let r=this;if("global"in t&&t.global)for(;r.parent;)r=r.parent;let i=1;"factor"in t&&t.factor!==1&&t.factor!==void 0&&(i=t.factor);const n=r.getRegister(t.register);if(n===void 0)return;if(typeof n=="string")return{string:Number(n).toString()+n};if(typeof n=="number")return{number:i*n};const a=r.evaluate(n);if(a!==void 0)return"string"in a?{string:Number(n).toString()+a.string}:"number"in a?{number:i*a.number}:"dimension"in a?g(p({},a),{dimension:i*a.dimension}):"glue"in a?g(p({},a),{glue:g(p({},a.glue),{dimension:i*a.glue.dimension}),shrink:a.shrink?g(p({},a.shrink),{dimension:i*a.shrink.dimension}):void 0,grow:a.grow?g(p({},a.grow),{dimension:i*a.grow.dimension}):void 0}):t}toDimension(t){const r=this.evaluate(t);return r===void 0?null:"dimension"in r?r:"glue"in r?r.glue:"number"in r?{dimension:r.number}:null}toEm(t,r){if(t===null)return 0;const i=this.toDimension(t);return i===null?0:D0(i,r)/bn}toNumber(t){if(t===null)return null;const r=this.evaluate(t);return r===void 0?null:"number"in r?r.number:"dimension"in r?r.dimension:"glue"in r?r.glue.dimension:"string"in r?Number(r.string):null}toColor(t){var r,i;if(t===null)return null;const n=this.evaluate(t);return n===void 0?null:"string"in n?(i=(r=this.colorMap)==null?void 0:r.call(this,n.string))!=null?i:n.string:null}toBackgroundColor(t){var r,i;if(t===null)return null;const n=this.evaluate(t);return n===void 0?null:"string"in n?(i=(r=this.backgroundColorMap)==null?void 0:r.call(this,n.string))!=null?i:n.string:null}},xn=["body","above","below","superscript","subscript"];function Vi(e){return typeof e=="string"&&xn.includes(e)}function Es(e){return e!==void 0&&Array.isArray(e)&&e.length===2}var w=class ni{constructor(t){var r,i,n,a,s,o;this.type=t.type,typeof t.value=="string"&&(this.value=t.value),this.command=(i=(r=t.command)!=null?r:this.value)!=null?i:"",this.mode=(n=t.mode)!=null?n:"math",t.isFunction&&(this.isFunction=!0),t.limits&&(this.subsupPlacement=t.limits),this.style=p({},t.style),this.displayContainsHighlight=(a=t.displayContainsHighlight)!=null?a:!1,this.captureSelection=(s=t.captureSelection)!=null?s:!1,this.skipBoundary=(o=t.skipBoundary)!=null?o:!1,t.verbatimLatex!==void 0&&t.verbatimLatex!==null&&(this.verbatimLatex=t.verbatimLatex),t.args&&(this.args=t.args),t.body&&(this.body=t.body),this._changeCounter=0}static createBox(t,r,i){var n;if(!r)return null;const a=Mf(r),s=[];for(const l of a){const c=l[0].style,u=Sf(t,l,{style:{color:c.color,backgroundColor:c.backgroundColor,fontSize:c.fontSize}});u&&s.push(u)}if(s.length===0)return null;const o=((n=i==null?void 0:i.classes)!=null?n:"").trim();return s.length===1&&!o&&!(i!=null&&i.type)?s[0].wrap(t):new D(s,{classes:o,type:i==null?void 0:i.type}).wrap(t)}static serialize(t,r){return Ut.serialize(t,r)}static commonAncestor(t,r){if(t===r||t.parent===r.parent)return t.parent;const i=new WeakSet;let{parent:n}=t;for(;n;)i.add(n),n=n.parent;for(n=r.parent;n;){if(i.has(n))return n;n=n.parent}console.assert(!!n)}static fromJson(t){return typeof t=="string"?new ni({type:"mord",value:t,mode:"math"}):new ni(t)}get latexMode(){return this.mode==="math"?"math":"text"}toJson(){const t={};if(this.type&&(t.type=this.type),this.mode!=="math"&&(t.mode=this.mode),this.command&&this.command!==this.value&&(t.command=this.command),this.value!==void 0&&(t.value=this.value),this.style&&Object.keys(this.style).length>0&&(t.style=p({},this.style)),this.verbatimLatex!==void 0&&(t.verbatimLatex=this.verbatimLatex),this.subsupPlacement&&(t.subsupPlacement=this.subsupPlacement),this.explicitSubsupPlacement&&(t.explicitSubsupPlacement=!0),this.isFunction&&(t.isFunction=!0),this.displayContainsHighlight&&(t.displayContainsHighlight=!0),this.isExtensibleSymbol&&(t.isExtensibleSymbol=!0),this.skipBoundary&&(t.skipBoundary=!0),this.captureSelection&&(t.captureSelection=!0),this.args&&(t.args=Cf(this.args)),this._branches)for(const r of Object.keys(this._branches))this._branches[r]&&(t[r]=this._branches[r].filter(i=>i.type!=="first").map(i=>i.toJson()));return t.type==="mord"&&Object.keys(t).length===2&&"value"in t?t.value:t}get changeCounter(){return this.parent?this.parent.changeCounter:this._changeCounter}set isDirty(t){if(t){this.parent||this._changeCounter++,"verbatimLatex"in this&&(this.verbatimLatex=void 0),this._children=void 0;let{parent:r}=this;for(;r;)r.parent||r._changeCounter++,"verbatimLatex"in r&&(r.verbatimLatex=void 0),r._children=void 0,r=r.parent}}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Ve(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,t):this.body&&this.command?X([_e(this.command,this.bodyToLatex(t)),this.supsubToLatex(t)]):this.body?X([this.bodyToLatex(t),this.supsubToLatex(t)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(t){var r;return Ut.serialize(this.body,g(p({},t),{defaultMode:(r=t.defaultMode)!=null?r:this.latexMode}))}aboveToLatex(t){return Ut.serialize(this.above,t)}belowToLatex(t){return Ut.serialize(this.below,t)}supsubToLatex(t){let r="";if(t=g(p({},t),{defaultMode:"math"}),this.branch("subscript")!==void 0){const i=Ut.serialize(this.subscript,t);i.length===0?r+="_{}":i.length===1?/^[0-9]$/.test(i)?r+=`_${i}`:r+=`_{${i}}`:r+=`_{${i}}`}if(this.branch("superscript")!==void 0){const i=Ut.serialize(this.superscript,t);i.length===0?r+="^{}":i.length===1?i==="\u2032"?r+="^\\prime ":i==="\u2033"?r+="^\\doubleprime ":/^[0-9]$/.test(i)?r+=`^${i}`:r+=`^{${i}}`:r+=`^{${i}}`}return r}get treeDepth(){let t=1,r=this.parent;for(;r;)r=r.parent,t+=1;return t}get inCaptureSelection(){let t=this;for(;t;){if(t.captureSelection)return!0;t=t.parent}return!1}get parentPrompt(){let t=this.parent;for(;t;){if(t.type==="prompt"&&!t.captureSelection)return t;t=t.parent}return null}branch(t){if(Vi(t)&&this._branches)return this._branches[t]}get branches(){if(!this._branches)return[];const t=[];for(const r of xn)this._branches[r]&&t.push(r);return t}createBranch(t){return console.assert(Vi(t)),Vi(t)?(this._branches?this._branches[t]||(this._branches[t]=[this.makeFirstAtom(t)]):this._branches={[t]:[this.makeFirstAtom(t)]},this.isDirty=!0,this._branches[t]):[]}get row(){return Es(this.parentBranch)?this.parentBranch[0]:-1}get col(){return Es(this.parentBranch)?this.parentBranch[1]:-1}get body(){var t;return(t=this._branches)==null?void 0:t.body}set body(t){this.setChildren(t,"body")}get superscript(){var t;return(t=this._branches)==null?void 0:t.superscript}set superscript(t){this.setChildren(t,"superscript")}get subscript(){var t;return(t=this._branches)==null?void 0:t.subscript}set subscript(t){this.setChildren(t,"subscript")}get above(){var t;return(t=this._branches)==null?void 0:t.above}set above(t){this.setChildren(t,"above")}get below(){var t;return(t=this._branches)==null?void 0:t.below}set below(t){this.setChildren(t,"below")}get computedStyle(){var t,r;const i=typeof this.style.verbatimColor=="string",n=typeof this.style.verbatimBackgroundColor=="string",a=p(p({},(r=(t=this.parent)==null?void 0:t.computedStyle)!=null?r:{}),this.style);return delete a.variant,delete a.variantStyle,n||delete a.verbatimBackgroundColor,i||delete a.verbatimColor,a}applyStyle(t){this.isDirty=!0,this.style=p(p({},this.style),t),this.style.fontFamily==="none"&&delete this.style.fontFamily,this.style.fontShape==="auto"&&delete this.style.fontShape,this.style.fontSeries==="auto"&&delete this.style.fontSeries,this.style.color==="none"&&(delete this.style.color,delete this.style.verbatimColor),this.style.backgroundColor==="none"&&(delete this.style.backgroundColor,delete this.style.verbatimBackgroundColor),this.style.fontSize==="auto"&&delete this.style.fontSize;for(const r of this.children)r.applyStyle(t)}getInitialBaseElement(){var t,r,i;return this.hasEmptyBranch("body")?this:(console.assert(((t=this.body)==null?void 0:t[0].type)==="first"),(i=(r=this.body[1])==null?void 0:r.getInitialBaseElement())!=null?i:this)}getFinalBaseElement(){return this.hasEmptyBranch("body")?this:this.body[this.body.length-1].getFinalBaseElement()}isCharacterBox(){return this.type==="leftright"||this.type==="genfrac"||this.type==="subsup"||this.type==="delim"||this.type==="array"||this.type==="surd"?!1:this.getFinalBaseElement().type==="mord"}hasEmptyBranch(t){const r=this.branch(t);return r?(console.assert(r.length>0),console.assert(r[0].type==="first"),r.length===1):!0}setChildren(t,r){var i;if(!t||(console.assert(Vi(r)),!Vi(r)))return;console.assert(((i=t[0])==null?void 0:i.type)!=="first");const n=[this.makeFirstAtom(r),...t];this._branches?this._branches[r]=n:this._branches={[r]:n};for(const a of t)a.parent=this,a.parentBranch=r;this.isDirty=!0}makeFirstAtom(t){const r=new ni({type:"first",mode:this.mode});return r.parent=this,r.parentBranch=t,r}addChild(t,r){console.assert(t.type!=="first"),this.createBranch(r).push(t),this.isDirty=!0,t.parent=this,t.parentBranch=r}addChildBefore(t,r){console.assert(r.parentBranch!==void 0);const i=this.createBranch(r.parentBranch);i.splice(i.indexOf(r),0,t),this.isDirty=!0,t.parent=this,t.parentBranch=r.parentBranch}addChildAfter(t,r){console.assert(r.parentBranch!==void 0);const i=this.createBranch(r.parentBranch);i.splice(i.indexOf(r)+1,0,t),this.isDirty=!0,t.parent=this,t.parentBranch=r.parentBranch}addChildren(t,r){const i=this.createBranch(r);for(const n of t)n.parent=this,n.parentBranch=r,i.push(n);this.isDirty=!0}addChildrenAfter(t,r){console.assert(t.length===0||t[0].type!=="first"),console.assert(r.parentBranch!==void 0);const i=this.createBranch(r.parentBranch);i.splice(i.indexOf(r)+1,0,...t),this.isDirty=!0;for(const n of t)n.parent=this,n.parentBranch=r.parentBranch;return t[t.length-1]}removeBranch(t){const r=this.branch(t);if(Vi(t)&&(this._branches[t]=void 0),!r)return[];for(const i of r)i.parent=void 0,i.parentBranch=void 0;return console.assert(r[0].type==="first"),r.shift(),this.isDirty=!0,r}removeChild(t){if(console.assert(t.parent===this),t.type==="first")return;const r=this.branch(t.parentBranch),i=r.indexOf(t);console.assert(i>=0),r.splice(i,1),this.isDirty=!0,t.parent=void 0,t.parentBranch=void 0}get siblings(){return this.parent?this.parent.branch(this.parentBranch):[]}get firstSibling(){return this.siblings[0]}get lastSibling(){const{siblings:t}=this;return t[t.length-1]}get isFirstSibling(){return this===this.firstSibling}get isLastSibling(){return this===this.lastSibling}get hasNoSiblings(){return this.siblings.length===1}get leftSibling(){console.assert(this.parent!==void 0);const t=this.parent.branch(this.parentBranch);return t[t.indexOf(this)-1]}get rightSibling(){console.assert(this.parent!==void 0);const t=this.parent.branch(this.parentBranch);return t[t.indexOf(this)+1]}get hasChildren(){return!!(this._branches&&this.children.length>0)}get firstChild(){return console.assert(this.hasChildren),this.children[0]}get lastChild(){console.assert(this.hasChildren);const{children:t}=this;return t[t.length-1]}get children(){if(this._children)return this._children;if(!this._branches)return[];const t=[];for(const r of xn)if(this._branches[r])for(const i of this._branches[r])t.push(...i.children),t.push(i);return this._children=t,t}render(t){if(this.type==="first"&&!t.atomIdsSettings)return null;const r=Ve(this.command,this.mode);if(r!=null&&r.render)return r.render(this,t);const i=new $({parent:t},this.style);let n=this.createBox(i,{classes:this.parent?"":"ML__base"});return n?(!this.subsupPlacement&&(this.superscript||this.subscript)&&(n=this.attachSupsub(i,{base:n})),n.wrap(i)):null}attachSupsub(t,r){var i;const n=r.base,a=this.superscript,s=this.subscript;if(!a&&!s)return n;let o=null,l=null;const c=(i=r.isCharacterBox)!=null?i:this.isCharacterBox();let u=0;if(a){const y=new $({parent:t,mathstyle:"superscript"});o=ni.createBox(y,a),c||(u=n.height-t.metrics.supDrop*y.scalingFactor)}let d=0;if(s){const y=new $({parent:t,mathstyle:"subscript"});l=ni.createBox(y,s),c||(d=n.depth+t.metrics.subDrop*y.scalingFactor)}let h;t.isDisplayStyle?h=t.metrics.sup1:t.isCramped?h=t.metrics.sup3:h=t.metrics.sup2;const f=.5/bn/t.scalingFactor;let m=null;if(l&&o){u=Math.max(u,h,o.depth+.25*t.metrics.xHeight),d=Math.max(d,t.metrics.sub2);const y=t.metrics.defaultRuleThickness;if(u-o.depth-(l.height-d)<4*y){d=4*y-(u-o.depth)+l.height;const v=.8*t.metrics.xHeight-(u-o.depth);v>0&&(u+=v,d-=v)}const A=this.isExtensibleSymbol&&n.italic?-n.italic:0;m=new je({individualShift:[{box:l,shift:d,marginLeft:A},{box:o,shift:-u}]}).wrap(t)}else l&&!o?(d=Math.max(d,t.metrics.sub1,l.height-.8*mi),m=new je({shift:d,children:[{box:l,marginRight:f,marginLeft:this.isCharacterBox()?-n.italic:0}]})):!l&&o&&(u=Math.max(u,h,o.depth+.25*mi),m=new je({shift:-u,children:[{box:o,marginRight:f}]}));return new D([n,new D(m,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:r.type})}attachLimits(t,r){const i=this.superscript?ni.createBox(new $({parent:t,mathstyle:"superscript"},this.style),this.superscript):null,n=this.subscript?ni.createBox(new $({parent:t,mathstyle:"subscript"},this.style),this.subscript):null;return!i&&!n?r.base.wrap(t):_f(t,g(p({},r),{above:i,below:n}))}bind(t,r){if(!r||t.isPhantom||this.value==="\u200B")return r;let i=this.parent;for(;i&&!i.captureSelection;)i=i.parent;return i!=null&&i.captureSelection||(this.id||(this.id=t.makeID()),r.atomID=this.id),r}createBox(t,r){var i,n,a,s;const o=(i=this.value)!=null?i:this.body,l=(n=r==null?void 0:r.boxType)!=null?n:tl(this.type);let c=(a=r==null?void 0:r.classes)!=null?a:"";this.mode==="text"&&(c+=" ML__text");const u=typeof o=="string"||o===void 0?new D(o!=null?o:null,{type:l,isSelected:this.isSelected,mode:this.mode,maxFontSize:t.scalingFactor,style:g(p({variant:"normal"},this.style),{fontSize:Math.max(1,t.size+t.mathstyle.sizeDelta)}),letterShapeStyle:t.letterShapeStyle,classes:c}):(s=ni.createBox(t,o,{type:l,classes:c}))!=null?s:new D(null);return t.isTight&&(u.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(u.italic=0),u.right=u.italic,this.bind(t,u),this.caret&&!this.superscript&&!this.subscript&&(u.caret=this.caret),u}isDigit(){var t;return this.type==="mord"&&this.value?/^[\d,\.]$/.test(this.value):this.type==="group"&&((t=this.body)==null?void 0:t.length)===2?this.body[0].type==="first"&&this.body[1].value===",":!1}asDigit(){var t;return this.type==="mord"&&this.value&&/^[\d,\.]$/.test(this.value)?this.value:this.type==="group"&&((t=this.body)==null?void 0:t.length)===2&&this.body[0].type==="first"&&this.body[1].value===","?".":""}};function Mf(e){let t;const r=[];let i=[];for(const n of e)if(!t&&!n.style)i.push(n);else{const a=n.computedStyle;t&&a.color===t.color&&a.backgroundColor===t.backgroundColor&&a.fontSize===t.fontSize?i.push(n):(i.length>0&&r.push(i),i=[n],t=a)}return i.length>0&&r.push(i),r}function Sf(e,t,r){var i,n,a,s,o;if(!t||t.length===0)return null;const l=new $({parent:e},r.style),c=!((i=l.atomIdsSettings)!=null&&i.groupNumbers);let u=[];if(t.length===1){const h=t[0],f=h.render(l);f&&(c&&h.isSelected&&f.selected(!0),u=[f])}else{let h="",f=!0;for(const m of t){(n=l.atomIdsSettings)!=null&&n.groupNumbers&&h&&(f&&m.isDigit()||!f&&sl(m))&&(l.atomIdsSettings.overrideID=h);const y=m.render(l);l.atomIdsSettings&&(l.atomIdsSettings.overrideID=void 0),y&&((a=l.atomIdsSettings)!=null&&a.groupNumbers&&((m.isDigit()||sl(m))&&(!h||f!==m.isDigit())&&(f=m.isDigit(),h=(s=m.id)!=null?s:""),h&&(!(m.isDigit()||sl(m))||!m.hasEmptyBranch("superscript")||!m.hasEmptyBranch("subscript"))&&(h="")),c&&m.isSelected&&y.selected(!0),u.push(y))}}if(u.length===0)return null;const d=new D(u,g(p({isTight:l.isTight},r),{type:(o=r.type)!=null?o:"lift"}));return d.isSelected=u.every(h=>h.isSelected),d.wrap(l)}function sl(e){return e.mode==="text"}function Cf(e){return e.map(t=>t===null?"<null>":Array.isArray(t)&&t[0]instanceof w?{atoms:t.map(r=>r.toJson())}:typeof t=="object"&&"group"in t?{group:t.group.map(r=>r.toJson())}:t)}var da=class Eh extends w{constructor(t,r,i){super({type:"text",command:t,mode:"text",displayContainsHighlight:!0}),this.value=r,this.verbatimLatex=r,this.applyStyle(i)}static fromJson(t){return new Eh(t.command,t.value,t.style)}render(t){const r=this.createBox(t);return this.caret&&(r.caret=this.caret),r}_serialize(t){var r;return(r=this.verbatimLatex)!=null?r:ot("text",this.value.codePointAt(0))}};function Ef(e,t){if(e.direction===t.direction){const r=e.ranges.length;if(t.ranges.length===r){let i=0;for(;i<r&&Af(e.ranges[i],t.ranges[i])==="equal";)i++;return i===r?"equal":"different"}}return"different"}function Af(e,t){return e[0]===t[0]&&e[1]===t[1]?"equal":"different"}function pt(e){let t=1/0,r=-1/0;for(const i of e.ranges)t=Math.min(t,i[0],i[1]),r=Math.max(r,i[0],i[1]);return[t,r]}function vi(e){return typeof e=="number"&&!Number.isNaN(e)}function As(e){return Array.isArray(e)&&e.length===2}function Ls(e){return e!=null&&typeof e=="object"&&"ranges"in e&&Array.isArray(e.ranges)}function Lf(e,t){const r=e.at(t);let i;if(r){i=r.mode;let n=r.parent;for(;!i&&n;)n&&(i=n.mode),n=n.parent}return i}function Bf(e,t){if(!t)return"";if(typeof t=="string")return t;if(!e||t.after===void 0)return t.value;let r=!1,i=!1,n=!1,a=!1,s=!1,o=!1,l=!1,c=!1,u=!1,d=!1,h=!1,f=!1,m=!1,y=!1,A=!1,v=e[0],S=0;for(;v!=null&&v.type&&/^(subsup|placeholder)$/.test(v.type);)S+=1,v=e[S];return r=!v||v.type==="first",v&&(y=v.mode==="text",i=!y&&v.type==="mord"&&Ft.test(v.value),n=!y&&v.type==="mord"&&/\d+$/.test(v.value),a=!y&&v.isFunction,s=v.type==="genfrac",o=v.type==="surd",l=v.type==="mbin",c=v.type==="mrel",u=v.type==="mop"||v.type==="operator"||v.type==="extensible-symbol",d=v.type==="mpunct"||v.type==="minner",h=v.type==="array",f=v.type==="mopen",m=v.type==="mclose"||v.type==="leftright",A=v.type==="space"),t.after.includes("nothing")&&r||t.after.includes("letter")&&i||t.after.includes("digit")&&n||t.after.includes("function")&&a||t.after.includes("frac")&&s||t.after.includes("surd")&&o||t.after.includes("binop")&&l||t.after.includes("relop")&&c||t.after.includes("operator")&&u||t.after.includes("punct")&&d||t.after.includes("array")&&h||t.after.includes("openfence")&&f||t.after.includes("closefence")&&m||t.after.includes("text")&&y||t.after.includes("space")&&A?t.value:""}function ol(e,t,r){return r?Bf(e,r[t]):""}var P0={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\doubleprime}","'''":"^{\\prime\\prime\\prime}","''''":"^{\\prime\\prime\\prime\\prime}",alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:"\\pi",Pi:"\\Pi",theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:"\\nabla",grad:"\\nabla",del:"\\partial",deg:{after:"digit+space",value:"\\degree"},infty:"\\infty","\u221E":"\\infty",oo:{after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"\u2211":"\\sum",sum:"\\sum_{#?}^{#?}",int:"\\int_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt{#?}","\u2206":"\\differentialD","\u2202":"\\differentialD",arcsin:"\\arcsin",arccos:"\\arccos",arctan:"\\arctan",arcsec:"\\arcsec",arccsc:"\\arccsc",arsinh:"\\arsinh",arcosh:"\\arcosh",artanh:"\\artanh",arcsech:"\\arcsech",arccsch:"\\arccsch",arg:"\\arg",ch:"\\ch",cosec:"\\cosec",cosh:"\\cosh",cot:"\\cot",cotg:"\\cotg",coth:"\\coth",csc:"\\csc",ctg:"\\ctg",cth:"\\cth",sec:"\\sec",sinh:"\\sinh",sh:"\\sh",tanh:"\\tanh",tg:"\\tg",th:"\\th",sin:"\\sin",cos:"\\cos",tan:"\\tan",lg:"\\lg",lb:"\\lb",log:"\\log",ln:"\\ln",exp:"\\exp",lim:"\\lim_{#?}",dx:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD x"},dy:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD y"},dt:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD t"},AA:"\\forall",EE:"\\exists","!EE":"\\nexists","&&":"\\land",xin:{after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},sint:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\sin t"},in:{after:"nothing+letter+closefence",value:"\\in"},"!in":"\\notin",NN:"\\mathbb{N}",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",xx:"\\times","+-":"\\pm","\u2260":"\\ne","!=":"\\ne","\u2265":"\\ge",">=":"\\ge","\u2264":"\\le","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","\u2248":"\\approx","?=":"\\questeq","\xF7":"\\div","\xAC":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},nu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},\u00B5:"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega",\u03A9:"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\liminf_{#?}",limsup:"\\limsup_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\bmod{#?}","(mod":"\\pmod{#?}",max:"\\max",min:"\\min",erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:"\\operatorname{bessel}",mean:"\\operatorname{mean}",median:"\\operatorname{median}",fft:"\\operatorname{fft}",lcm:"\\operatorname{lcm}",gcd:"\\operatorname{gcd}",randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:"\\operatorname{Re}",Im:"\\operatorname{Im}",mm:{after:"nothing+digit+operator",value:"\\operatorname{mm}"},cm:{after:"nothing+digit+operator",value:"\\operatorname{cm}"},km:{after:"nothing+digit+operator",value:"\\operatorname{km}"},kg:{after:"nothing+digit+operator",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","-->...":"\\longrightarrow\\cdots","->":"\\to","|->":"\\mapsto","-->":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","*":"\\cdot","**":"\\star","***":"\\ast","//":"\\slash","\\\\":"\\backslash",setminus:"\\backslash","|><":"\\ltimes","><|":"\\rtimes","|><|":"\\bowtie","-:":"\\div",divide:"\\div","@":"\\circ","^^":"\\wedge","^^^":"\\bigwedge",vv:"\\vee",vvv:"\\bigvee",nn:"\\cap",nnn:"\\bigcap",uu:"\\cup",uuu:"\\bigcup","-=":"\\equiv","~=":"\\cong",lt:"<","lt=":"\\leq",gt:">","gt=":"\\geq","-<":"\\prec","-lt":"\\prec","-<=":"\\preceq",">-=":"\\succeq",prop:"\\propto",diamond:"\\diamond",square:"\\square",iff:"\\iff",sub:"\\subset",sup:"\\supset",sube:"\\subseteq",supe:"\\supseteq",uarr:"\\uparrow",darr:"\\downarrow",rarr:"\\rightarrow",rArr:"\\Rightarrow",larr:"\\leftarrow",lArr:"\\Leftarrow",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",aleph:"\\aleph",and:"\\land",or:"\\lor",not:"\\neg","_|_":"\\bot",TT:"\\top","|--":"\\vdash","|==":"\\models","|__":"\\lfloor","__|":"\\rfloor","|~":"\\lceil","~|":"\\rceil",">->":"\\rightarrowtail","->>":"\\twoheadrightarrow",">->>":"\\twoheadrightarrowtail",frac:"\\frac{#?}{#?}",cbrt:"\\sqrt[3]{#?}",nthroot:"\\sqrt[#?]{#?}"};function Bs(e,t){var r;let i=(r=t==null?void 0:t.format)!=null?r:"auto";return i==="auto"&&([i,e]=Df(e)),i==="ascii-math"?(e=e.replace(/\u2061/gu,""),e=e.replace(/\u3016/gu,"{"),e=e.replace(/\u3017/gu,"}"),e=e.replace(/([^\\])sinx/g,"$1\\sin x"),e=e.replace(/([^\\])cosx/g,"$1\\cos x "),e=e.replace(/\u2013/g,"-"),["ascii-math",Lt(e,{inlineShortcuts:t==null?void 0:t.inlineShortcuts})]):["latex",e]}function Lt(e,t){var r,i,n;if(!e)return"";let a=!1,s;const o=(r=t.inlineShortcuts)!=null?r:P0;if(!a&&(e.startsWith("^")||e.startsWith("_"))&&(s=Hi(e.slice(1),{inlineShortcuts:o,noWrap:!0}),e=e[0]+"{"+s.match+"}",e+=Lt(s.rest,t),a=!0),a||(s=e.match(/^(sqrt|\u221A)(.*)/),s&&(s=Hi(s[2],{inlineShortcuts:o,noWrap:!0}),e="\\sqrt{"+((i=s.match)!=null?i:"\\placeholder{}")+"}",e+=Lt(s.rest,t),a=!0)),a||(s=e.match(/^(\\cbrt|\u221B)(.*)/),s&&(s=Hi(s[2],{inlineShortcuts:o,noWrap:!0}),e="\\sqrt[3]{"+((n=s.match)!=null?n:"\\placeholder{}")+"}",e+=Lt(s.rest,t),a=!0)),a||(s=e.match(/^abs(.*)/),s&&(s=Hi(s[1],{inlineShortcuts:o,noWrap:!0}),e="\\left|"+s.match+"\\right|",e+=Lt(s.rest,t),a=!0)),a||(s=e.match(/^["”“](.*?)["”“](.*)/),s&&(e="\\text{"+s[1]+"}",e+=Lt(s[2],t),a=!0)),a||(s=e.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),s&&(e=z0(s[1],o),e+=Lt(s[2],t),a=!0)),!a&&/^([fgh])[^a-zA-Z]/.test(e)&&(s=Hi(e.slice(1),{inlineShortcuts:o,noWrap:!0}),e=e[1]==="("?e[0]+"\\left("+s.match+"\\right)":e[0]+s.match,e+=Lt(s.rest,t),a=!0),a||(s=e.match(/^([a-zA-Z]+)(.*)/),s&&(e=z0(s[1],o),e+=Lt(s[2],t),a=!0)),!a)if(s=Hi(e,{inlineShortcuts:o,noWrap:!0}),s.match&&s.rest[0]==="/"){const l=Hi(s.rest.slice(1),{inlineShortcuts:o,noWrap:!0});l.match&&(e="\\frac{"+s.match+"}{"+l.match+"}"+Lt(l.rest,t)),a=!0}else s.match&&(e=e.startsWith("(")?"\\left("+s.match+"\\right)"+Lt(s.rest,t):s.match+Lt(s.rest,t),a=!0);return a||(s=e.match(/^(\s+)(.*)$/),s&&(e=" "+Lt(s[2],t),a=!0)),e}function Hi(e,t){let r="";e=e.trim();let i=e,n=e.charAt(0),a={"(":")","{":"}","[":"]"}[n];if(a){let s=1,o=1;for(;o<e.length&&s>0;)e[o]===n&&s++,e[o]===a&&s--,o++;s===0?(t.noWrap&&n==="("?r=Lt(e.substring(1,o-1),t):(n==="{"&&a==="}"&&(n="\\{",a="\\}"),r="\\left"+n+Lt(e.substring(1,o-1),t)+"\\right"+a),i=e.slice(Math.max(0,o))):(r=e.substring(1,o),i="")}else{let s=e.match(/^([a-zA-Z]+)/);if(s){let o=ol(null,e,t.inlineShortcuts);if(o)return o=o.replace("_{#?}",""),o=o.replace("^{#?}",""),{match:o,rest:e.slice(o.length)}}if(s=e.match(/^([a-zA-Z])/),s)return{match:s[1],rest:e.slice(1)};if(s=e.match(/^(-)?\d+(\.\d*)?/),s)return{match:s[0],rest:e.slice(s[0].length)};/^\\(left|right)/.test(e)||(s=e.match(/^(\\[a-zA-Z]+)/),s&&(i=e.slice(s[1].length),r=s[1]))}return{match:r,rest:i}}function z0(e,t){let r=ol(null,e,t);return r?(r=r.replace("_{#?}",""),r=r.replace("^{#?}",""),r+=" "):r=e,r}var K0=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function ll(e){const t=e.trim();for(const r of K0)if(t.startsWith(r[0])&&t.endsWith(r[1]))return[!0,t.substring(r[0].length,t.length-r[1].length)];return[!1,e]}function Df(e){if(e=e.trim(),e.length<=1)return["latex",e];let t;return[t,e]=ll(e),t?["latex",e]:e.startsWith("`")&&e.endsWith("`")?(e=e.substring(1,e.length-1),["ascii-math",e]):e.includes("\\")?["latex",e]:/\$.+\$/.test(e)?["latex",`\\text{${e}}`]:[void 0,e]}var Tf="$$",Ff="$$",Pf=(e,t,r)=>(K0.some(i=>t.startsWith(i[0])&&t.endsWith(i[1]))||(t=`${Tf} ${t} ${Ff}`),t),N0=class xo{constructor(t){xo._modes[t]=this}static onPaste(t,r,i){var n;if(!r.contentEditable&&r.userSelect==="none")return r.model.announce("plonk"),!1;if(typeof i=="string"){const s=new DataTransfer;s.setData("text/plain",i),i=s}const a=new ClipboardEvent("paste",{clipboardData:i,cancelable:!0});return(n=r.host)!=null&&n.dispatchEvent(a)?xo._modes[t].onPaste(r,i):!1}static copyToClipboard(t,r){if(!t.contentEditable&&t.userSelect==="none"){t.model.announce("plonk");return}const i=t.model,n=i.selectionIsCollapsed?[0,i.lastOffset]:pt(i.selection),a=i.getValue(n,r);navigator.clipboard.writeText(a).then(()=>{},()=>t.model.announce("plonk"))}static onCopy(t,r){var i;if(!r.clipboardData)return;if(!t.contentEditable&&t.userSelect==="none"){t.model.announce("plonk");return}const n=t.model,a=n.selectionIsCollapsed?[0,n.lastOffset]:pt(n.selection);let s=n.getAtoms(a);if(s.every(o=>o.mode==="text"||!o.mode))r.clipboardData.setData("text/plain",s.filter(o=>o instanceof da).map(o=>o.value).join(""));else if(s.every(o=>o.mode==="latex"))r.clipboardData.setData("text/plain",n.getAtoms(a,{includeChildren:!0}).map(o=>{var l;return(l=o.value)!=null?l:""}).join(""));else{let o;s.length===1&&s[0].verbatimLatex!==void 0?o=s[0].verbatimLatex:o=n.getValue(a,"latex-expanded"),r.clipboardData.setData("application/x-latex",o);try{r.clipboardData.setData("text/plain",t.options.onExport(t,o,a))}catch(l){}if(s.length===1){const l=s[0];(l.type==="root"||l.type==="group")&&(s=l.body.filter(c=>c.type!=="first"))}try{r.clipboardData.setData("application/json+mathlive",JSON.stringify(s.map(l=>l.toJson())))}catch(l){}if((i=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&i.ComputeEngine){const l=window.MathfieldElement.computeEngine;if(l)try{const c=l.jsonSerializationOptions;l.jsonSerializationOptions={metadata:["latex"]};const u=l.parse(n.getValue(a,"latex-unstyled"));l.jsonSerializationOptions=c;const d=JSON.stringify(u.json);d&&r.clipboardData.setData("application/json",d)}catch(c){}}}r.preventDefault()}static insert(t,r,i={}){var n;const a=i.mode==="auto"?t.mode:(n=i.mode)!=null?n:t.mode;return xo._modes[a].insert(t,r,i)}onPaste(t,r){return!1}insert(t,r,i){return!1}};N0._modes={};var be=N0,zf=[{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendSelectionBackward"},{key:"shift+[ArrowRight]",command:"extendSelectionForward"},{key:"shift+[ArrowUp]",command:"extendSelectionUpward"},{key:"shift+[ArrowDown]",command:"extendSelectionDownward"},{key:"[Backspace]",command:"deleteBackward"},{key:"alt+[Delete]",command:"deleteBackward"},{key:"[Delete]",command:"deleteForward"},{key:"alt+[Backspace]",command:"deleteForward"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"shift+alt+[ArrowLeft]",command:"extendToPreviousWord"},{key:"shift+alt+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"shift+ctrl+[ArrowLeft]",command:"extendToGroupStart"},{key:"shift+ctrl+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Home]",command:"moveToMathfieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathfieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"shift+cmd+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathfieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathfieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"shift+cmd+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",command:"moveToNextGroup"},{key:"shift+[Tab]",command:"moveToPreviousGroup"},{key:"[Escape]",ifMode:"math",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"text",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"latex",command:["complete","complete",{selectItem:"true"}]},{key:"\\",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[IntlBackslash]",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[Tab]",ifMode:"latex",command:["complete","accept-suggestion"]},{key:"[Return]",ifMode:"latex",command:"complete"},{key:"[Enter]",ifMode:"latex",command:"complete"},{key:"shift+[Escape]",ifMode:"latex",command:["complete","reject"]},{key:"[ArrowDown]",ifMode:"latex",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"latex",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deleteBackward"},{key:"[Undo]",command:"undo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"cmd+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"ctrl+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"cmd+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"ctrl+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"cmd+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+y",command:"redo"},{key:"shift+ctrl+z",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+z",command:"redo"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathfieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathfieldEnd"},{key:"shift+ctrl+b",ifPlatform:"macos",command:"extendSelectionBackward"},{key:"shift+ctrl+f",ifPlatform:"macos",command:"extendSelectionForward"},{key:"shift+ctrl+p",ifPlatform:"macos",command:"extendSelectionUpward"},{key:"shift+ctrl+n",ifPlatform:"macos",command:"extendSelectionDownward"},{key:"shift+ctrl+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"shift+ctrl+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"alt+ctrl+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"alt+ctrl+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"shift+alt+ctrl+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"shift+alt+ctrl+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deleteBackward"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteForward"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Return]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Return]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"alt+p",ifMode:"math",command:["insert","\\pi"]},{key:"alt+v",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"alt+o",ifMode:"math",command:["insert","\\emptyset"]},{key:"alt+d",ifMode:"math",command:["insert","\\differentialD"]},{key:"shift+alt+o",ifMode:"math",command:["insert","\\varnothing"]},{key:"shift+alt+d",ifMode:"math",command:["insert","\\partial"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","\\backslash"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+alt+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleContextMenu"},{key:"alt+shift+[Space]",command:"toggleVirtualKeyboard"},{key:"alt+ctrl+[ArrowUp]",command:["speak","all",{withHighlighting:!1}]},{key:"alt+ctrl+[ArrowDown]",command:["speak","selection",{withHighlighting:!1}]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["switchMode","text","",""]},{key:"shift+alt+[KeyT]",ifMode:"math",command:["switchMode","text","",""]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"text",command:["switchMode","math","",""]},{key:"shift+alt+[KeyT]",ifMode:"text",command:["switchMode","math","",""]},{key:"/",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+shift+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrack #0 \\right\\rbrack"]},{key:"ctrl+[Minus]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"moveToSubscript"},{key:"shift+alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrace #0 \\right\\rbrace"]},{key:"ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"shift+ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"shift+cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"ctrl+[Backspace]",ifMode:"math",command:"removeRow"},{key:"cmd+[Backspace]",ifMode:"math",command:"removeRow"},{key:"alt+[Tab]",ifMode:"math",command:"addColumnAfter"},{key:"shift+alt+[Tab]",ifMode:"math",command:"addColumnBefore"},{key:"alt+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Enter]",ifMode:"math",command:"addRowBefore"},{key:"alt+[Return]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Return]",ifMode:"math",command:"addRowBefore"},{key:"shift+[Backspace]",ifMode:"math",command:"removeColumn"},{key:"alt+[Digit5]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","$\\infty"]},{key:"alt+[Digit9]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert",")"]},{key:"alt+|",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","|"]},{key:"shift+[Backquote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\~"]},{key:"[Backquote]",ifLayout:["windows.french","linux.french"],ifMode:"math",command:["insert","^2"]},{key:"[Backquote]",ifLayout:["windows.german","linux.german"],ifMode:"math",command:["insert","^"]},{key:"[IntlBackslash]",ifLayout:["apple.german"],ifMode:"math",command:["insert","^"]}],Kf={"\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\infty":"alt+[Digit5]","\\differentialD":"alt+d","\\partial":"shift+alt+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"shift+alt+o","\\~":"~"};function ji(e){var t;return((t=e.element)==null?void 0:t.mathfield)===e}function Nf(e){var t,r;return(r=(t=e.querySelector(".ML__caret"))!=null?t:e.querySelector(".ML__text-caret"))!=null?r:e.querySelector(".ML__latex-caret")}function ha(e){const t=Nf(e);if(!t)return null;const r=t.getBoundingClientRect();return{x:r.right,y:r.bottom,height:r.height}}function Of(e){var t;if(!e.parent)return"root";let r=(t=e.parent.id)!=null?t:"";return r+=typeof e.parentBranch=="string"?"-"+e.parentBranch:`-${e.parentBranch[0]}/${e.parentBranch[0]}`,r}function O0(e,t,r){if(!t)return null;const i=e.field.getBoundingClientRect(),n=t.right-t.left,a=t.bottom-t.top,s=Math.ceil(t.left-i.left+e.field.scrollLeft*r),o=Math.ceil(t.top-i.top);return{left:s,right:s+n,top:o,bottom:o+a}}function I0(e){const t=e.getBoundingClientRect(),r=parseInt(getComputedStyle(e).marginRight),i={top:t.top-1,bottom:t.bottom,left:t.left,right:t.right-1+r};if(e.children.length===0||e.tagName.toUpperCase()==="SVG")return i;for(const n of e.children)if(n.nodeType===1&&"atomId"in n.dataset&&!n.classList.contains("pstrut")){const a=I0(n);i.left=Math.min(i.left,a.left),i.right=Math.max(i.right,a.right),i.top=Math.min(i.top,a.top),i.bottom=Math.max(i.bottom,a.bottom)}return i}function fa(e,t){var r,i;if(!t.id)return null;let n=(i=(r=e.atomBoundsCache)==null?void 0:r.get(t.id))!=null?i:null;if(n!==null)return n;const a=e.field.querySelector(`[data-atom-id="${t.id}"]`);return n=a?I0(a):null,e.atomBoundsCache&&(n?e.atomBoundsCache.set(t.id,n):e.atomBoundsCache.delete(t.id)),n!=null?n:null}function If(e,t,r){const i=new Map;for(const n of e.model.getAtoms(t,{includeChildren:!0})){if(r!=null&&r.excludeAtomsWithBackground&&n.style.backgroundColor)continue;const a=e.field,s=a.offsetWidth;let l=Math.floor(a.getBoundingClientRect().width)/s;l=isNaN(l)?1:l;const c=O0(e,fa(e,n),l);if(c){const u=Of(n);if(i.has(u)){const d=i.get(u);i.set(u,{left:Math.min(d.left,c.left),right:Math.max(d.right,c.right),top:Math.min(d.top,c.top),bottom:Math.max(d.bottom,c.bottom)})}else i.set(u,c)}}return[...i.values()]}function R0(e,t){return e.model.selection.ranges.reduce((r,i)=>r.concat(...If(e,i,t)),[])}function cl(e,t){return e==="*"||t==="none"?!0:t==="same-origin"?!window.origin||e===window.origin:typeof t=="function"?t(e):!1}function q0(e){let t=0,r=0;const i=e.offsetWidth,n=e.offsetHeight;for(;e instanceof HTMLElement;)t+=e.offsetTop,r+=e.offsetLeft,e=e.offsetParent;return new DOMRect(r,t,i,n)}var Rf=`@keyframes ML__caret-blink {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0;
}
}
.ML__container {
display: inline-flex;
flex-flow: row;
justify-content: space-between;
align-items: flex-end;
min-height: 39px;
/* Need some room for the virtual keyboard toggle */
width: 100%;
/* Encourage browsers to consider allocating a hardware accelerated
layer for this element. */
isolation: isolate;
/* Prevent the browser from trying to interpret touch gestures in the field */
/* "Disabling double-tap to zoom removes the need for browsers to
delay the generation of click events when the user taps the screen." */
touch-action: none;
--_caret-color: var(--caret-color, hsl(var(--_hue), 40%, 49%));
--_selection-color: var(--selection-color, #000);
--_selection-background-color: var(--selection-background-color, hsl(var(--_hue), 70%, 85%));
--_text-highlight-background-color: var(--highlight-text, hsla(var(--_hue), 40%, 50%, 0.1));
--_contains-highlight-background-color: var(--contains-highlight-background-color, hsl(var(--_hue), 40%, 95%));
--_smart-fence-color: var(--smart-fence-color, currentColor);
--_smart-fence-opacity: var(--smart-fence-opacity, 0.5);
--_latex-color: var(--latex-color, hsl(var(--_hue), 80%, 40%));
--_correct-color: var(--correct-color, #10a000);
--_incorrect-color: var(--incorrect-color, #a01b00);
--_composition-background-color: var(--composition-background-color, #fff1c2);
--_composition-text-color: var(--composition-text-color, black);
--_composition-underline-color: var(--composition-underline-color, transparent);
}
/* This is the actual field content (formula) */
.ML__content {
display: flex;
align-items: center;
align-self: center;
position: relative;
overflow: hidden;
padding: 2px 3px 2px 1px;
width: 100%;
}
.ML__virtual-keyboard-toggle,
.ML__menu-toggle {
box-sizing: border-box;
display: flex;
align-self: center;
align-items: center;
flex-shrink: 0;
flex-direction: column;
justify-content: center;
width: 34px;
height: 34px;
padding: 0;
margin-right: 4px;
cursor: pointer;
/* Avoid some weird blinking with :hover */
border-radius: 8px;
border: 1px solid transparent;
transition: background 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
color: hsl(var(--_hue), 40%, 50%);
fill: currentColor;
background: transparent;
}
.ML__virtual-keyboard-toggle:hover,
.ML__menu-toggle:hover {
background: hsla(0, 0%, 70%, 0.3);
color: #333;
fill: currentColor;
}
.ML__virtual-keyboard-toggle > span,
.ML__menu-toggle > span {
display: flex;
align-self: center;
align-items: center;
}
/* The invisible element used to capture keyboard events. We're just trying
really hard to make sure it doesn't show. */
.ML__keyboard-sink {
display: inline-block;
resize: none;
outline: none;
border: none;
/* Need these for Microsoft Edge */
position: fixed;
clip: rect(0 0 0 0);
/* Need this to prevent iOS Safari from auto-zooming */
font-size: 1em;
font-family: KaTeX_Main;
line-height: 0.5;
/* On Chromium, if this is 0, no keyboard events are received */
}
[part="placeholder"] {
color: var(--neutral-400);
}
.ML__composition {
background: var(--_composition-background-color);
color: var(--_composition-text-color);
text-decoration: underline var(--_composition-underline-color);
}
.ML__caret::after {
content: '';
visibility: hidden;
width: 0;
display: inline-block;
height: 0.76em;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_caret-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.045em;
bottom: -0.05em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__text-caret::after {
content: '';
visibility: hidden;
width: 0;
display: inline-block;
height: 0.76em;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_caret-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.045em;
bottom: -0.05em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__latex-caret::after {
content: '';
visibility: hidden;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_latex-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.019em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__focused .ML__latex-caret::after,
.ML__focused .ML__text-caret::after,
.ML__focused .ML__caret::after {
visibility: visible;
}
.ML__focused .ML__text {
background: var(--_text-highlight-background-color);
}
/* When using smartFence, the anticipated closing fence is displayed
with this style */
.ML__smart-fence__close {
opacity: var(--_smart-fence-opacity);
color: var(--_smart-fence-color);
}
.ML__selected,
.ML__focused .ML__selected .ML__contains-caret,
.ML__focused .ML__selected .ML__smart-fence__close,
.ML__focused .ML__selected .ML__placeholder {
color: var(--_selection-color);
opacity: 1;
}
.ML__selection {
box-sizing: border-box;
background: var(--_selection-background-color) !important;
}
.ML__contains-caret.ML__close,
.ML__contains-caret.ML__open,
.ML__contains-caret > .ML__close,
.ML__contains-caret > .ML__open,
.ML__contains-caret .ML__sqrt-sign,
.ML__contains-caret .ML__sqrt-line {
color: var(--_caret-color);
}
.ML__contains-highlight {
box-sizing: border-box;
background: transparent;
}
.ML__focused .ML__contains-highlight {
background: var(--_contains-highlight-background-color);
}
.ML__raw-latex {
font-family: 'Berkeley Mono', 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
font-weight: 400;
font-size: 0.8em;
letter-spacing: -0.05em;
color: var(--_latex-color);
}
.ML__suggestion {
color: var(--neutral-500);
}
.ML__virtual-keyboard-toggle.is-visible.is-pressed:hover {
background: hsl(var(--_hue), 25%, 35%);
color: #fafafa;
fill: currentColor;
}
.ML__virtual-keyboard-toggle:focus {
outline: none;
border-radius: 8px;
border: 2px solid hsl(var(--_hue), 40%, 50%);
}
.ML__virtual-keyboard-toggle.is-pressed,
.ML__virtual-keyboard-toggle.is-active:hover,
.ML__virtual-keyboard-toggle.is-active {
background: hsl(var(--_hue), 25%, 35%);
color: #fafafa;
fill: currentColor;
}
/* Add an attribute 'data-tooltip' to automatically show a
tooltip over a element on hover.
*/
[data-tooltip] {
position: relative;
}
[data-tooltip]::after {
content: attr(data-tooltip);
position: absolute;
display: block;
z-index: 2;
pointer-events: none;
right: auto;
top: calc(-100% - 4px);
width: max-content;
max-width: 200px;
padding: 8px 8px;
border-radius: 4px;
background: #616161;
color: #fff;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
text-align: center;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-style: normal;
font-weight: 400;
font-size: 13px;
/* Phone */
opacity: 0;
transform: scale(0.5);
}
@media only screen and (max-width: 767px) {
[data-tooltip]::after {
padding: 8px 16px;
font-size: 16px;
}
}
menu [data-tooltip]::after {
left: 100%;
top: 0%;
}
menu .ML__base {
cursor: default;
}
/** Don't display if we're tracking, i.e. have the pointer down */
.tracking [data-tooltip]:hover::after {
/* Use visibility, not display. Display will remove the after from the DOM, and the override below will not work */
visibility: hidden;
}
/** But do display if tracking and inside a menu */
.tracking menu li[data-tooltip]:hover::after,
[data-tooltip]:hover::after {
visibility: visible;
opacity: 1;
transform: scale(1);
transition-property: opacity, scale;
transition-duration: 0.15s;
transition-delay: 1s;
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.ML__prompt {
border-radius: 2px;
}
.ML__editablePromptBox {
outline: 1px solid #acacac;
border-radius: 2px;
z-index: -1;
}
.ML__focusedPromptBox {
outline: highlight auto 1px;
}
.ML__lockedPromptBox {
background-color: rgba(142, 142, 141, 0.4);
z-index: -1;
}
.ML__correctPromptBox {
outline: 1px solid var(--_correct-color);
box-shadow: 0 0 5px var(--_correct-color);
}
.ML__incorrectPromptBox {
outline: 1px solid var(--_incorrect-color);
box-shadow: 0 0 5px var(--_incorrect-color);
}
.variant-submenu {
display: flex;
flex-direction: column;
padding: 8px;
}
.variant-submenu [part=menu-item] {
font-size: 2rem;
text-align: center;
margin: 0;
}
.insert-matrix-submenu {
display: grid;
padding: 8px;
align-content: center;
justify-content: center;
grid-template-columns: repeat(5, minmax(0, 1fr));
}
.insert-matrix-submenu [part=menu-item] {
font-size: 21px;
border: none;
border-radius: 0;
line-height: 21px;
text-align: center;
padding: 0;
margin: 0;
}
.border-submenu [part=menu-item] {
font-size: 2rem;
line-height: 1.2;
text-align: center;
}
.swatches-submenu {
--_swatch-size: 2rem;
--_columns: 4;
display: flex;
flex-flow: wrap;
padding: 8px;
max-width: calc(var(--_columns) * (var(--_swatch-size) + 18px) + 16px);
box-sizing: border-box;
}
.menu-swatch {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: fit-content;
height: fit-content;
margin: 2px;
padding: 0;
background: var(--neutral-200);
}
.menu-swatch > .label {
padding: 0;
margin: 0;
line-height: 0;
}
.menu-swatch > .label > span {
display: inline-block;
margin: 6px;
min-width: var(--_swatch-size);
min-height: var(--_swatch-size);
border-radius: 50%;
}
.menu-swatch.active {
background: var(--neutral-100);
scale: 1.4;
}
.menu-swatch.active > .label > span {
border-radius: 2px;
}
.menu-swatch .ui-checkmark,
.menu-swatch .ui-mixedmark {
position: absolute;
margin: 0;
padding: 0;
color: white;
}
.menu-swatch.dark-contrast .ui-checkmark,
.menu-swatch.dark-contrast .ui-mixedmark {
color: #000;
}
`,qf=`.ML__container {
min-height: auto !important;
--_hue: var(--hue, 212);
--_placeholder-color: var(--placeholder-color, hsl(var(--_hue), 40%, 49%));
--_placeholder-opacity: var(--placeholder-opacity, 0.4);
--_text-font-family: var(--text-font-family, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif);
}
.ML__sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
.ML__is-inline {
display: inline-block;
}
.ML__base {
visibility: inherit;
display: inline-block;
position: relative;
cursor: text;
padding: 0;
margin: 0;
box-sizing: content-box;
border: 0;
outline: 0;
vertical-align: baseline;
font-weight: inherit;
font-family: inherit;
font-style: inherit;
text-decoration: none;
width: min-content;
}
.ML__strut,
.ML__strut--bottom {
display: inline-block;
min-height: 0.5em;
}
.ML__small-delim {
font-family: KaTeX_Main;
}
/* Text mode */
.ML__text {
font-family: var(--_text-font-family);
white-space: pre;
}
/* Use cmr for 'math upright' */
.ML__cmr {
font-family: KaTeX_Main;
font-style: normal;
}
.ML__mathit {
font-family: KaTeX_Math;
/* The KaTeX_Math font is italic by default, so the font-style below is only
useful when a fallback font is used
*/
font-style: italic;
}
.ML__mathbf {
font-family: KaTeX_Main;
font-weight: bold;
}
/* Lowercase greek symbols should stick to math font when \\mathbf is applied
to match TeX idiosyncratic behavior */
.lcGreek.ML__mathbf {
font-family: KaTeX_Math;
font-weight: normal;
}
.ML__mathbfit {
font-family: KaTeX_Math;
font-weight: bold;
font-style: italic;
}
.ML__ams {
font-family: KaTeX_AMS;
}
/* Blackboard */
.ML__bb {
font-family: KaTeX_AMS;
}
.ML__cal {
font-family: KaTeX_Caligraphic;
}
.ML__frak {
font-family: KaTeX_Fraktur;
}
.ML__tt {
font-family: KaTeX_Typewriter;
}
.ML__script {
font-family: KaTeX_Script;
}
.ML__sans {
font-family: KaTeX_SansSerif;
}
.ML__series_ul {
font-weight: 100;
}
.ML__series_el {
font-weight: 100;
}
.ML__series_l {
font-weight: 200;
}
.ML__series_sl {
font-weight: 300;
}
.ML__series_sb {
font-weight: 500;
}
.ML__bold,
.ML__boldsymbol {
font-weight: 700;
}
.ML__series_eb {
font-weight: 800;
}
.ML__series_ub {
font-weight: 900;
}
.ML__series_uc {
font-stretch: ultra-condensed;
}
.ML__series_ec {
font-stretch: extra-condensed;
}
.ML__series_c {
font-stretch: condensed;
}
.ML__series_sc {
font-stretch: semi-condensed;
}
.ML__series_sx {
font-stretch: semi-expanded;
}
.ML__series_x {
font-stretch: expanded;
}
.ML__series_ex {
font-stretch: extra-expanded;
}
.ML__series_ux {
font-stretch: ultra-expanded;
}
.ML__it {
font-style: italic;
}
.ML__shape_ol {
-webkit-text-stroke: 1px black;
text-stroke: 1px black;
color: transparent;
}
.ML__shape_sc {
font-variant: small-caps;
}
.ML__shape_sl {
font-style: oblique;
}
/* First level emphasis */
.ML__emph {
color: #bc2612;
}
/* Second level emphasis */
.ML__emph .ML__emph {
color: #0c7f99;
}
.ML__highlight {
color: #007cb2;
background: #edd1b0;
}
.ML__center {
text-align: center;
}
.ML__label_padding {
padding: 0 0.5em;
}
.ML__frac-line {
width: 100%;
min-height: 1px;
}
.ML__frac-line:after {
content: '';
display: block;
margin-top: max(-1px, -0.04em);
min-height: max(1px, 0.04em);
/* Ensure the line is visible when printing even if "turn off background images" is on*/
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
/* There's a bug since Chrome 62 where
sub-pixel border lines don't draw at some zoom
levels (110%, 90%).
Setting the min-height used to work around it, but that workaround
broke in Chrome 84 or so.
Setting the background (and the min-height) seems to work for now.
*/
background: currentColor;
box-sizing: content-box;
/* Vuetify sets the box-sizing to inherit
causes the fraction line to not draw at all sizes (see #26) */
/* On some versions of Firefox on Windows, the line fails to
draw at some zoom levels, but setting the transform triggers
the hardware accelerated path, which works */
transform: translate(0, 0);
}
.ML__sqrt {
display: inline-block;
}
.ML__sqrt-sign {
display: inline-block;
position: relative;
}
.ML__sqrt-line {
display: inline-block;
height: max(1px, 0.04em);
width: 100%;
}
.ML__sqrt-line:before {
content: '';
display: block;
margin-top: min(-1px, -0.04em);
min-height: max(1px, 0.04em);
/* Ensure the line is visible when printing even if "turn off background images" is on*/
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
background: currentColor;
/* On some versions of Firefox on Windows, the line fails to
draw at some zoom levels, but setting the transform triggers
the hardware accelerated path, which works */
transform: translate(0, 0);
}
.ML__sqrt-line:after {
border-bottom-width: 1px;
content: ' ';
display: block;
margin-top: -0.1em;
}
.ML__sqrt-index {
margin-left: 0.27777778em;
margin-right: -0.55555556em;
}
.ML__delim-size1 {
font-family: KaTeX_Size1;
}
.ML__delim-size2 {
font-family: KaTeX_Size2;
}
.ML__delim-size3 {
font-family: KaTeX_Size3;
}
.ML__delim-size4 {
font-family: KaTeX_Size4;
}
.ML__delim-mult .delim-size1 > span {
font-family: KaTeX_Size1;
}
.ML__delim-mult .delim-size4 > span {
font-family: KaTeX_Size4;
}
.ML__accent-body > span {
font-family: KaTeX_Main;
width: 0;
}
.ML__accent-vec {
position: relative;
left: 0.24em;
}
/** The markup for a LaTeX formula, either in an editable mathfield or
in a static display.
*/
.ML__latex {
display: inline-block;
direction: ltr;
text-align: left;
text-indent: 0;
text-rendering: auto;
font-family: KaTeX_Main, 'Times New Roman', serif;
font-style: normal;
font-size-adjust: none;
font-stretch: normal;
font-variant-caps: normal;
letter-spacing: normal;
line-height: 1.2;
word-wrap: normal;
word-spacing: normal;
white-space: nowrap;
text-shadow: none;
-webkit-user-select: none;
user-select: none;
width: min-content;
}
.ML__latex .style-wrap {
position: relative;
}
.ML__latex .mfrac {
display: inline-block;
}
.ML__latex .left-right {
display: inline-block;
}
.ML__latex .vlist-t {
display: inline-table;
table-layout: fixed;
border-collapse: collapse;
}
.ML__latex .vlist-r {
display: table-row;
}
.ML__latex .vlist {
display: table-cell;
vertical-align: bottom;
position: relative;
}
.ML__latex .vlist > span {
display: block;
height: 0;
position: relative;
}
.ML__latex .vlist > span > span {
display: inline-block;
}
.ML__latex .vlist > span > .pstrut {
overflow: hidden;
width: 0;
}
.ML__latex .vlist-t2 {
margin-right: -2px;
}
.ML__latex .vlist-s {
display: table-cell;
vertical-align: bottom;
font-size: 1px;
width: 2px;
min-width: 2px;
}
.ML__latex .msubsup {
text-align: left;
}
.ML__latex .negativethinspace {
display: inline-block;
margin-left: -0.16667em;
height: 0.71em;
}
.ML__latex .thinspace {
display: inline-block;
width: 0.16667em;
height: 0.71em;
}
.ML__latex .mediumspace {
display: inline-block;
width: 0.22222em;
height: 0.71em;
}
.ML__latex .thickspace {
display: inline-block;
width: 0.27778em;
height: 0.71em;
}
.ML__latex .enspace {
display: inline-block;
width: 0.5em;
height: 0.71em;
}
.ML__latex .quad {
display: inline-block;
width: 1em;
height: 0.71em;
}
.ML__latex .qquad {
display: inline-block;
width: 2em;
height: 0.71em;
}
.ML__latex .llap,
.ML__latex .rlap {
width: 0;
position: relative;
display: inline-block;
}
.ML__latex .llap > .inner,
.ML__latex .rlap > .inner {
position: absolute;
}
.ML__latex .llap > .fix,
.ML__latex .rlap > .fix {
display: inline-block;
}
.ML__latex .llap > .inner {
right: 0;
}
.ML__latex .rlap > .inner {
left: 0;
}
.ML__latex .rule {
display: inline-block;
border: solid 0;
position: relative;
box-sizing: border-box;
}
.ML__latex .overline .overline-line,
.ML__latex .underline .underline-line {
width: 100%;
}
.ML__latex .overline .overline-line:before,
.ML__latex .underline .underline-line:before {
content: '';
border-bottom-style: solid;
border-bottom-width: max(1px, 0.04em);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
display: block;
}
.ML__latex .overline .overline-line:after,
.ML__latex .underline .underline-line:after {
border-bottom-style: solid;
border-bottom-width: max(1px, 0.04em);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
content: '';
display: block;
margin-top: -1px;
}
.ML__latex .stretchy {
display: block;
position: absolute;
width: 100%;
left: 0;
overflow: hidden;
}
.ML__latex .stretchy:before,
.ML__latex .stretchy:after {
content: '';
}
.ML__latex .stretchy svg {
display: block;
position: absolute;
width: 100%;
height: inherit;
fill: currentColor;
stroke: currentColor;
fill-rule: nonzero;
fill-opacity: 1;
stroke-width: 1;
stroke-linecap: butt;
stroke-linejoin: miter;
stroke-miterlimit: 4;
stroke-dasharray: none;
stroke-dashoffset: 0;
stroke-opacity: 1;
}
.ML__latex .slice-1-of-2 {
display: inline-flex;
position: absolute;
left: 0;
width: 50.2%;
overflow: hidden;
}
.ML__latex .slice-2-of-2 {
display: inline-flex;
position: absolute;
right: 0;
width: 50.2%;
overflow: hidden;
}
.ML__latex .slice-1-of-3 {
display: inline-flex;
position: absolute;
left: 0;
width: 25.1%;
overflow: hidden;
}
.ML__latex .slice-2-of-3 {
display: inline-flex;
position: absolute;
left: 25%;
width: 50%;
overflow: hidden;
}
.ML__latex .slice-3-of-3 {
display: inline-flex;
position: absolute;
right: 0;
width: 25.1%;
overflow: hidden;
}
.ML__latex .slice-1-of-1 {
display: inline-flex;
position: absolute;
width: 100%;
left: 0;
overflow: hidden;
}
.ML__latex .nulldelimiter {
display: inline-block;
}
.ML__latex .op-group {
display: inline-block;
}
.ML__latex .op-symbol {
position: relative;
}
.ML__latex .op-symbol.small-op {
font-family: KaTeX_Size1;
}
.ML__latex .op-symbol.large-op {
font-family: KaTeX_Size2;
}
.ML__latex .mtable .vertical-separator {
display: inline-block;
min-width: 1px;
box-sizing: border-box;
}
.ML__latex .mtable .arraycolsep {
display: inline-block;
}
.ML__latex .mtable .col-align-m > .vlist-t {
text-align: center;
}
.ML__latex .mtable .col-align-c > .vlist-t {
text-align: center;
}
.ML__latex .mtable .col-align-l > .vlist-t {
text-align: left;
}
.ML__latex .mtable .col-align-r > .vlist-t {
text-align: right;
}
.ML__error {
display: inline-block;
background-image: radial-gradient(ellipse at center, hsl(341, 100%, 40%), rgba(0, 0, 0, 0) 70%);
background-color: hsla(341, 100%, 40%, 0.1);
background-repeat: repeat-x;
background-size: 3px 3px;
padding-bottom: 3px;
background-position: 0 100%;
}
.ML__error > .ML__error {
background: transparent;
padding: 0;
}
.ML__placeholder {
color: var(--_placeholder-color);
opacity: var(--_placeholder-opacity);
padding-left: 0.4ex;
padding-right: 0.4ex;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}
.ML__notation {
position: absolute;
box-sizing: border-box;
line-height: 0;
}
/* This class is used to implement the \`\\mathtip\` and \`\\texttip\` commands
For UI elements, see \`[data-ML__tooltip]\`
*/
.ML__tooltip-container {
position: relative;
transform: scale(0);
}
.ML__tooltip-container .ML__tooltip-content {
position: fixed;
display: inline-table;
visibility: hidden;
z-index: 2;
width: max-content;
max-width: 400px;
padding: 12px 12px;
border-radius: 8px;
background: #616161;
--_selection-color: #fff;
color: #fff;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
opacity: 0;
transition: opacity 0.15s cubic-bezier(0.4, 0, 1, 1);
}
.ML__tooltip-container .ML__tooltip-content .ML__text {
white-space: normal;
}
.ML__tooltip-container .ML__tooltip-content .ML__base {
display: contents;
}
.ML__tooltip-container:hover .ML__tooltip-content {
visibility: visible;
opacity: 1;
font-size: 0.75em;
transform: scale(1) translate(0, 3em);
}
`,Vf=`#mathlive-environment-popover.is-visible {
visibility: visible;
}
#mathlive-environment-popover {
--_environment-panel-height: var(--environment-panel-height, 70px);
--_accent-color: var(--accent-color, #aaa);
--_background: var(--environment-panel-background, #fff);
--_button-background: var(--environment-panel-button-background, white);
--_button-background-hover: var(--environment-panel-button-background-hover, #f5f5f7);
--_button-background-active: var(--environment-panel-button-background-active, #f5f5f7);
--_button-text: var(--environment-panel-button-text, #e3e4e8);
position: absolute;
width: calc(var(--_environment-panel-height) * 2);
height: var(--_environment-panel-height);
border-radius: 4px;
border: 1.5px solid var(--_accent-color);
background-color: var(--_background);
box-shadow: 0 0 30px 0 var(--environment-shadow, rgba(0, 0, 0, 0.4));
pointer-events: all;
visibility: hidden;
}
#mathlive-environment-popover .MLEP__array-buttons {
height: calc(var(--_environment-panel-height) * 5/4);
width: calc(var(--_environment-panel-height) * 5/4);
margin-left: calc(0px - var(--_environment-panel-height) * 0.16);
margin-top: calc(0px - var(--_environment-panel-height) * 0.19);
}
#mathlive-environment-popover .MLEP__array-buttons .font {
fill: white;
}
#mathlive-environment-popover .MLEP__array-buttons circle {
fill: #7f7f7f;
transition: fill 300ms;
}
#mathlive-environment-popover .MLEP__array-buttons .MLEP__array-insert-background {
fill-opacity: 1;
fill: var(--_background);
stroke: var(--_accent-color);
stroke-width: 3px;
}
#mathlive-environment-popover .MLEP__array-buttons line {
stroke: var(--_accent-color);
stroke-opacity: 0;
stroke-width: 40;
pointer-events: none;
transition: stroke-opacity 300ms;
stroke-linecap: round;
}
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover circle {
fill: var(--_accent-color);
}
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover line {
stroke-opacity: 1;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls {
height: 100%;
width: 50%;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options {
width: var(--_environment-panel-height);
height: var(--_environment-panel-height);
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: space-around;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg {
pointer-events: all;
margin-top: 2px;
width: calc(var(--_environment-panel-height) / 3 * 28 / 24);
height: calc(var(--_environment-panel-height) / 3 - 2px);
border-radius: calc(var(--_environment-panel-height) / 25);
background-color: var(--_button-background);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg:hover {
background-color: var(--_button-background-hover);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg line {
stroke: var(--_button-text);
stroke-width: 2;
stroke-linecap: round;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg rect,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path {
fill-opacity: 0;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active {
pointer-events: none;
background-color: var(--_button-background-active);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active path,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active line {
stroke: var(--_accent-color);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active circle {
fill: var(--_accent-color);
}
`,Hf=`/* The element that display info while in latex mode */
#mathlive-suggestion-popover {
background-color: rgba(97, 97, 97);
color: #fff;
text-align: center;
border-radius: 8px;
position: fixed;
z-index: 1;
display: none;
flex-direction: column;
justify-content: center;
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}
#mathlive-suggestion-popover.top-tip::after {
content: '';
position: absolute;
top: -15px;
left: calc(50% - 15px);
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 15px solid rgba(97, 97, 97);
font-size: 1rem;
}
#mathlive-suggestion-popover.bottom-tip::after {
content: '';
position: absolute;
bottom: -15px;
left: calc(50% - 15px);
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-top: 15px solid rgba(97, 97, 97);
font-size: 1rem;
}
#mathlive-suggestion-popover.is-animated {
transition: all 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
animation: ML__fade-in cubic-bezier(0, 0, 0.2, 1) 0.15s;
}
#mathlive-suggestion-popover.is-visible {
display: flex;
}
@keyframes ML__fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* The wrapper class for the entire content of the popover panel */
#mathlive-suggestion-popover ul {
display: flex;
flex-flow: column;
list-style: none;
margin: 0;
padding: 0;
align-items: flex-start;
max-height: 400px;
overflow-y: auto;
}
#mathlive-suggestion-popover li {
display: flex;
flex-direction: row;
justify-content: space-between;
margin: 8px;
padding: 8px;
width: calc(100% - 16px - 16px);
column-gap: 1em;
border-radius: 8px;
cursor: pointer;
/* Since the content can be clicked on, provide feedback on hover */
}
#mathlive-suggestion-popover li a {
color: #5ea6fd;
padding-top: 0.3em;
margin-top: 0.4em;
display: block;
}
#mathlive-suggestion-popover li a:hover {
color: #5ea6fd;
text-decoration: underline;
}
#mathlive-suggestion-popover li:hover,
#mathlive-suggestion-popover li.is-pressed,
#mathlive-suggestion-popover li.is-active {
background: rgba(255, 255, 255, 0.1);
}
/* The command inside a popover (inside a #mathlive-suggestion-popover) */
.ML__popover__command {
font-size: 1.6rem;
font-family: KaTeX_Main;
}
.ML__popover__current {
background: #5ea6fd;
color: #fff;
}
.ML__popover__latex {
font-family: 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
align-self: center;
}
/* The keyboard shortcuts for a symbol as displayed in the popover */
.ML__popover__keybinding {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 0.8em;
opacity: 0.7;
}
/* Style for the character that joins the modifiers of a keyboard shortcut
(usually a "+" sign)*/
.ML__shortcut-join {
opacity: 0.5;
}
`,jf=`/* The element that displays the keys as the user type them */
#mathlive-keystroke-caption-panel {
visibility: hidden;
/*min-width: 160px;*/
/*background-color: rgba(97, 97, 200, .95);*/
background: var(--secondary, hsl(var(--_hue), 19%, 26%));
border-color: var(--secondary-border, hsl(0, 0%, 91%));
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
text-align: center;
border-radius: 6px;
padding: 16px;
position: absolute;
z-index: 1;
display: flex;
flex-direction: row-reverse;
justify-content: center;
--keystroke: white;
--on-keystroke: #555;
--keystroke-border: #f7f7f7;
}
@media (prefers-color-scheme: dark) {
body:not([theme='light']) #mathlive-keystroke-caption-panel {
--keystroke: hsl(var(--_hue), 50%, 30%);
--on-keystroke: hsl(0, 0%, 98%);
--keystroke-border: hsl(var(--_hue), 50%, 25%);
}
}
body[theme='dark'] #mathlive-keystroke-caption-panel {
--keystroke: hsl(var(--_hue), 50%, 30%);
--on-keystroke: hsl(0, 0%, 98%);
--keystroke-border: hsl(var(--_hue), 50%, 25%);
}
#mathlive-keystroke-caption-panel > span {
min-width: 14px;
/*height: 8px;*/
margin: 0 8px 0 0;
padding: 4px;
background-color: var(--keystroke);
color: var(--on-keystroke);
fill: currentColor;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 1em;
border-radius: 6px;
border: 2px solid var(--keystroke-border);
/*box-shadow: 0 7px 14px rgba(0,0,0,0.25), 0 5px 5px rgba(0,0,0,0.22);*/
}
`,Wf=`.ML__keyboard {
--_keyboard-height: 0;
--_keyboard-zindex: var(--keyboard-zindex, 105);
--_accent-color: var(--keyboard-accent-color, #0c75d8);
--_background: var(--keyboard-background, #cacfd7);
--_border: var(--keyboard-border, #ddd);
--_padding-horizontal: var(--keyboard-padding-horizontal, 0px);
--_padding-top: var(--keyboard-padding-top, 5px);
--_padding-bottom: var(--keyboard-padding-bottom, 0px);
--_row-padding-left: var(--keyboard-row-padding-left, 0px);
--_row-padding-right: var(--keyboard-row-padding-right, 0px);
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
--_toolbar-text-active: var(--keyboard-toolbar-text-active, var(--_accent-color));
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
--_toolbar-font-size: var(--keyboard-toolbar-font-size, '135%');
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
--_keycap-background: var(--keycap-background, white);
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
--_keycap-border: var(--keycap-border, #e5e6e9);
--_keycap-border-bottom: var(--keycap-border-bottom, #8d8f92);
--_keycap-text: var(--keycap-text, #000);
--_keycap-text-active: var(--keycap-text-active, #fff);
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
--_keycap-primary-background: var(--keycap-primary-background, var(--_accent-color));
--_keycap-primary-text: var(--keycap-primary-text, #ddd);
--_keycap-primary-background-hover: var(--keycap-primary-background-hover, #0d80f2);
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
--_keycap-height: var(--keycap-height, 60px);
/* Keycap width (incl. margin) */
--_keycap-max-width: var(--keycap-max-width, 100px);
--_keycap-gap: var(--keycap-gap, 8px);
--_keycap-font-size: var(--keycap-font-size, clamp(16px, 4cqw, 24px));
--_keycap-small-font-size: var(--keycap-small-font-size, calc(var(--keycap-font-size) * 0.8));
--_keycap-extra-small-font-size: var(--keycap-extra-small-font-size, calc(var(--keycap-font-size) / 1.42));
--_variant-panel-background: var(--variant-panel-background, #fff);
--_variant-keycap-text: var(--variant-keycap-text, var(--_keycap-text));
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
--_variant-keycap-length: var(--variant-keycap-length, 70px);
--_variant-keycap-font-size: var(--variant-keycap-font-size, 30px);
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 12px);
--_keycap-shift-font-size: var(--keycap-shift-font-size, 16px);
--_keycap-shift-color: var(--keycap-shift-color, var(--_accent-color));
--_box-placeholder-color: var(--box-placeholder-color, var(--_accent-color));
--_box-placeholder-pressed-color: var(--box-placeholder-pressed-color, var(--keycap-text-pressed));
}
.is-math-mode .MLK__rows .if-text-mode,
.is-text-mode .MLK__rows .if-math-mode {
display: none;
}
.if-can-undo,
.if-can-redo,
.if-can-copy,
.if-can-cut,
.if-can-paste {
opacity: 0.4;
pointer-events: none;
}
.can-undo .if-can-undo,
.can-redo .if-can-redo,
.can-copy .if-can-copy,
.can-cut .if-can-cut,
.can-paste .if-can-paste {
opacity: 1;
pointer-events: all;
}
body > .ML__keyboard {
position: fixed;
--_padding-bottom: calc(var(--keyboard-padding-bottom, 0px) + env(safe-area-inset-bottom, 0));
}
body > .ML__keyboard.is-visible > .MLK__backdrop {
box-shadow: 0 -5px 6px rgba(0, 0, 0, 0.08);
border-top: 1px solid var(--_border);
}
body > .ML__keyboard.backdrop-is-transparent.is-visible > .MLK__backdrop {
box-shadow: none;
border: none;
}
body > .ML__keyboard.is-visible.animate > .MLK__backdrop {
transition: 0.28s cubic-bezier(0, 0, 0.2, 1);
transition-property: transform, opacity;
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.ML__keyboard {
position: relative;
overflow: hidden;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: var(--_keyboard-zindex);
box-sizing: border-box;
outline: none;
border: none;
margin: 0;
padding: 0;
line-height: 1;
overflow-wrap: unset;
text-align: left;
vertical-align: baseline;
cursor: auto;
white-space: pre;
box-shadow: none;
opacity: 1;
transform: none;
pointer-events: none;
}
.ML__keyboard :where(div) {
box-sizing: border-box;
outline: none;
border: none;
margin: 0;
padding: 0;
line-height: 1;
overflow-wrap: unset;
text-align: left;
vertical-align: baseline;
cursor: auto;
white-space: pre;
box-shadow: none;
transform: none;
}
.MLK__backdrop {
position: absolute;
bottom: calc(-1 * var(--_keyboard-height));
width: 100%;
height: var(--_keyboard-height);
box-sizing: border-box;
padding-top: var(--_padding-top);
padding-bottom: var(--_padding-bottom);
padding-left: var(--_padding-horizontal);
padding-right: var(--_padding-horizontal);
opacity: 0;
visibility: hidden;
transform: translate(0, 0);
background: var(--_background);
}
.backdrop-is-transparent .MLK__backdrop {
background: transparent;
}
/* If a custom layout has a custom container/backdrop
(backdrop-is-transparent), make sure to let pointer event go through. */
.backdrop-is-transparent .MLK__plate {
background: transparent;
pointer-events: none;
}
/* If a custom layout has a custom container/backdrop, make sure to
allow pointer events on it. */
.backdrop-is-transparent .MLK__layer > div > div {
pointer-events: all;
}
.ML__keyboard.is-visible > .MLK__backdrop {
transform: translate(0, calc(-1 * var(--_keyboard-height)));
opacity: 1;
visibility: visible;
}
.caps-lock-indicator {
display: none;
width: 8px;
height: 8px;
background: #0cbc0c;
box-shadow: inset 0 0 4px 0 #13ca13, 0 0 4px 0 #a9ef48;
border-radius: 8px;
right: 8px;
top: 8px;
position: absolute;
}
.ML__keyboard.is-caps-lock .caps-lock-indicator {
display: block;
}
.ML__keyboard.is-caps-lock .shift {
background: var(--_keycap-background-active);
color: var(--_keycap-text-active);
}
.MLK__plate {
position: absolute;
top: var(--_padding-top);
left: var(--_padding-horizontal);
width: calc(100% - 2 * var(--_padding-horizontal));
margin: 0;
padding: 0;
box-sizing: border-box;
container-type: inline-size;
touch-action: none;
-webkit-user-select: none;
user-select: none;
pointer-events: all;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 16px;
/* Size of toolbar labels */
font-weight: 400;
text-shadow: none;
}
.ML__box-placeholder {
color: var(--_box-placeholder-color);
}
.MLK__tex {
font-family: KaTeX_Main, KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__tex-math {
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
font-style: italic;
}
.MLK__layer {
display: none;
outline: none;
}
.MLK__layer.is-visible {
display: flex;
flex-flow: column;
}
/* Keyboard layouts are made or rows of keys... */
.MLK__rows {
--_keycap-width: min(var(--_keycap-max-width), 10cqw);
display: flex;
flex-flow: column;
align-items: center;
border-collapse: separate;
clear: both;
border: 0;
margin: 0;
margin-bottom: var(--_keycap-gap);
gap: var(--_keycap-gap);
/* If the styling include, e.g., some shadows, they will be
cut off by the overflow. In that case, set the padding to
compensate. */
padding-left: var(--_row-padding-left);
padding-right: var(--_row-padding-right);
overflow: visible;
touch-action: none;
}
.MLK__rows > .MLK__row {
display: flex;
flex-flow: row;
justify-content: center;
width: 100%;
gap: var(--_keycap-gap);
margin: 0;
padding: 0;
/* For the alignment of the text on some modifiers (e.g. shift) */
/* Extra spacing between two adjacent keys */
}
.MLK__rows > .MLK__row .tex {
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__rows > .MLK__row .tex-math {
font-family: KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__rows > .MLK__row .big-op {
font-size: calc(1.25 * var(--_keycap-font-size));
}
.MLK__rows > .MLK__row .small {
font-size: var(--_keycap-small-font-size);
}
.MLK__rows > .MLK__row .bottom {
justify-content: flex-end;
}
.MLK__rows > .MLK__row .left {
align-items: flex-start;
padding-left: 12px;
}
.MLK__rows > .MLK__row .right {
align-items: flex-end;
padding-right: 12px;
}
.MLK__rows > .MLK__row .w0 {
width: 0;
}
.MLK__rows > .MLK__row .w5 {
width: calc(0.5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w15 {
width: calc(1.5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w20 {
width: calc(2 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w40 {
width: calc(4 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w50 {
width: calc(5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .MLK__keycap.w50 {
font-size: 80%;
padding-top: 10px;
font-weight: 100;
}
.MLK__rows > .MLK__row .separator {
background: transparent;
border: none;
pointer-events: none;
}
.MLK__rows > .MLK__row .horizontal-rule {
height: 6px;
margin-top: 3px;
margin-bottom: 0;
width: 100%;
border-radius: 0;
border-top: var(--_horizontal-rule);
}
.MLK__rows > .MLK__row .ghost {
background: var(--_toolbar-background);
border: none;
color: var(--_toolbar-text);
}
.MLK__rows > .MLK__row .ghost:hover {
background: var(--_toolbar-background-hover);
}
.MLK__rows > .MLK__row .bigfnbutton {
font-size: var(--_keycap-extra-small-font-size);
}
.MLK__rows > .MLK__row .shift,
.MLK__rows > .MLK__row .action {
color: var(--_keycap-secondary-text);
background: var(--_keycap-secondary-background);
border-color: var(--_keycap-secondary-border);
border-bottom-color: var(--_keycap-secondary-border-bottom);
line-height: 0.8;
font-size: min(1rem, var(--_keycap-small-font-size));
font-weight: 600;
padding: 8px 12px 8px 12px;
}
.MLK__rows > .MLK__row .shift:hover,
.MLK__rows > .MLK__row .action:hover {
background: var(--_keycap-secondary-background-hover);
}
.MLK__rows > .MLK__row .action.primary {
background: var(--_keycap-primary-background);
color: var(--_keycap-primary-text);
}
.MLK__rows > .MLK__row .action.primary:hover {
background: var(--_keycap-primary-background-hover);
color: var(--_keycap-primary-text);
}
.MLK__rows > .MLK__row .shift.selected,
.MLK__rows > .MLK__row .action.selected {
color: var(--_toolbar-text-active);
}
.MLK__rows > .MLK__row .shift.selected.is-pressed,
.MLK__rows > .MLK__row .action.selected.is-pressed,
.MLK__rows > .MLK__row .shift.selected.is-active,
.MLK__rows > .MLK__row .action.selected.is-active {
color: white;
}
.MLK__rows > .MLK__row .warning {
background: #cd0030;
color: white;
}
.MLK__rows > .MLK__row .warning svg.svg-glyph {
width: 24px;
height: 24px;
min-height: 24px;
}
/** A regular keycap
* Use the :where() pseudo-class to give it a very low specifity,
* so that it can be overriden by custom style.
*/
:where(.MLK__rows > .MLK__row div) {
display: flex;
flex-flow: column;
align-items: center;
justify-content: space-evenly;
width: calc(var(--_keycap-width) - var(--_keycap-gap));
height: var(--_keycap-height);
box-sizing: border-box;
padding: 0;
vertical-align: top;
text-align: center;
float: left;
color: var(--_keycap-text);
fill: currentColor;
font-size: var(--_keycap-font-size);
background: var(--_keycap-background);
border: 1px solid var(--_keycap-border);
border-bottom-color: var(--_keycap-border-bottom);
border-radius: 6px;
cursor: pointer;
touch-action: none;
/* Keys with a variants panel */
position: relative;
overflow: hidden;
-webkit-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
:where(.MLK__rows > .MLK__row div):hover {
overflow: visible;
background: var(--_keycap-background-hover);
}
:where(.MLK__rows > .MLK__row div) .ML__latex {
pointer-events: none;
touch-action: none;
}
:where(.MLK__rows > .MLK__row div) svg.svg-glyph {
margin: 8px 0;
width: 20px;
height: 20px;
min-height: 20px;
}
:where(.MLK__rows > .MLK__row div) svg.svg-glyph-lg {
margin: 8px 0;
width: 24px;
height: 24px;
min-height: 24px;
}
:where(.MLK__rows > .MLK__row div).MLK__tex-math {
font-size: 25px;
}
:where(.MLK__rows > .MLK__row div).is-pressed {
background: var(--_keycap-background-pressed);
color: var(--_keycap-text-pressed);
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
:where(.MLK__rows > .MLK__row div).action.is-active,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
:where(.MLK__rows > .MLK__row div).action.is-pressed {
z-index: calc(var(--_keyboard-zindex) - 5);
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active aside,
:where(.MLK__rows > .MLK__row div).action.is-active aside,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed aside,
:where(.MLK__rows > .MLK__row div).action.is-pressed aside {
display: none;
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active .MLK__shift,
:where(.MLK__rows > .MLK__row div).action.is-active .MLK__shift,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed .MLK__shift,
:where(.MLK__rows > .MLK__row div).action.is-pressed .MLK__shift {
display: none;
}
:where(.MLK__rows > .MLK__row div).shift.is-pressed,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
:where(.MLK__rows > .MLK__row div).action.is-pressed {
background: var(--_keycap-background-pressed);
color: var(--_keycap-text-pressed);
}
:where(.MLK__rows > .MLK__row div).shift.is-active,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
:where(.MLK__rows > .MLK__row div).action.is-active {
background: var(--_keycap-background-active);
color: var(--_keycap-text-active);
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
}
:where(.MLK__rows > .MLK__row div) small {
color: var(--_keycap-secondary-text);
}
:where(.MLK__rows > .MLK__row div) aside {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 10px;
line-height: 10px;
color: var(--_keycap-secondary-text);
}
/* Add an attribute 'data-tooltip' to display a tooltip on hover.
Note there are a different set of tooltip rules for the keyboard toggle
(it's in a different CSS tree) */
.ML__keyboard [data-tooltip] {
position: relative;
}
.ML__keyboard [data-tooltip]::after {
position: absolute;
display: inline-table;
content: attr(data-tooltip);
top: inherit;
bottom: 100%;
width: max-content;
max-width: 200px;
padding: 8px 8px;
background: #616161;
color: #fff;
text-align: center;
z-index: 2;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
border-radius: 2px;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-weight: 400;
font-size: 12px;
transition: all 0.15s cubic-bezier(0.4, 0, 1, 1) 1s;
opacity: 0;
transform: scale(0.5);
}
.ML__keyboard [data-tooltip]:hover {
position: relative;
}
.ML__keyboard [data-tooltip]:hover::after {
opacity: 1;
transform: scale(1);
}
.MLK__toolbar {
align-self: center;
display: flex;
flex-flow: row;
justify-content: space-between;
width: 100%;
max-width: 996px;
min-height: 32px;
/* Icons for undo/redo, etc. */
}
.MLK__toolbar svg {
height: 20px;
width: 20px;
}
.MLK__toolbar > .left {
position: relative;
display: flex;
justify-content: flex-start;
flex-flow: row;
}
.MLK__toolbar > .right {
display: flex;
justify-content: flex-end;
flex-flow: row;
}
.MLK__toolbar > div > div {
/* "button" in the toolbar */
display: flex;
align-items: center;
justify-content: center;
color: var(--_toolbar-text);
fill: currentColor;
background: var(--_toolbar-background);
font-size: var(--_toolbar-font-size);
padding: 4px 15px;
cursor: pointer;
width: max-content;
min-width: 42px;
min-height: 34px;
border: none;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 8px;
padding-top: 8px;
margin-top: 0;
margin-bottom: 4px;
margin-left: 4px;
margin-right: 4px;
border-radius: 8px;
box-shadow: none;
border-bottom: 2px solid transparent;
}
.MLK__toolbar > div > div:not(.disabled):not(.selected):hover {
background: var(--_toolbar-background-hover);
}
.MLK__toolbar > div > div.disabled svg,
.MLK__toolbar > div > div.disabled:hover svg,
.MLK__toolbar > div > div.disabled.is-pressed svg {
color: var(--_toolbar-text);
opacity: 0.2;
}
.MLK__toolbar > div > div:hover,
.MLK__toolbar > div > div:active,
.MLK__toolbar > div > div.is-pressed,
.MLK__toolbar > div > div.is-active {
color: var(--_toolbar-text-active);
}
.MLK__toolbar > div > div.selected {
color: var(--_toolbar-text-active);
background: var(--_toolbar-background-selected);
border-radius: 0;
border-bottom-color: var(--_toolbar-text-active);
padding-bottom: 4px;
margin-bottom: 8px;
}
/* This is the element that displays variants on press+hold */
.MLK__variant-panel {
visibility: hidden;
position: fixed;
display: flex;
flex-flow: row wrap-reverse;
justify-content: center;
align-content: center;
margin: 0;
padding: 0;
bottom: auto;
top: 0;
box-sizing: content-box;
transform: none;
z-index: calc(var(--_keyboard-zindex) + 1);
touch-action: none;
max-width: 350px;
background: var(--_variant-panel-background);
text-align: center;
border-radius: 6px;
padding: 6px;
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
transition: none;
}
.MLK__variant-panel.is-visible {
visibility: visible;
}
.MLK__variant-panel.compact {
--_variant-keycap-length: var(--variant-keycap-length, 50px);
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 10px);
}
.MLK__variant-panel .item {
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
font-size: var(--_variant-keycap-font-size);
height: var(--_variant-keycap-length);
width: var(--_variant-keycap-length);
margin: 0;
box-sizing: border-box;
border-radius: 5px;
border: 1px solid transparent;
background: transparent;
pointer-events: all;
cursor: pointer;
color: var(--_variant-keycap-text);
fill: currentColor;
}
@media (max-height: 412px) {
.MLK__variant-panel .item {
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-length: var(--variant-keycap-length, 50px);
}
}
.MLK__variant-panel .item .ML__latex {
pointer-events: none;
}
.MLK__variant-panel .item.is-active {
background: var(--_variant-keycap-background-active);
color: var(--_variant-keycap-text-active);
}
.MLK__variant-panel .item.is-pressed {
background: var(--_variant-keycap-background-pressed);
color: var(--_variant-keycap-text-pressed);
}
.MLK__variant-panel .item.small {
font-size: var(--_keycap-small-font-size);
}
.MLK__variant-panel .item.swatch-button {
box-sizing: border-box;
background: #fbfbfb;
}
.MLK__variant-panel .item.swatch-button > span {
display: inline-block;
margin: 6px;
width: calc(100% - 12px);
height: calc(100% - 12px);
border-radius: 50%;
}
.MLK__variant-panel .item.swatch-button:hover {
background: #f0f0f0;
}
.MLK__variant-panel .item.swatch-button:hover > span {
border-radius: 2px;
}
.MLK__variant-panel .item.box > div,
.MLK__variant-panel .item.box > span {
border: 1px dashed rgba(0, 0, 0, 0.24);
}
.MLK__variant-panel .item .warning {
min-height: 60px;
min-width: 60px;
background: #cd0030;
color: white;
padding: 5px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 5px;
}
.MLK__variant-panel .item .warning.is-pressed,
.MLK__variant-panel .item .warning.is-active {
background: red;
}
.MLK__variant-panel .item .warning svg.svg-glyph {
width: 50px;
height: 50px;
}
.MLK__variant-panel .item aside {
font-size: var(--_variant-keycap-aside-font-size);
line-height: 12px;
opacity: 0.78;
padding-top: 2px;
}
.MLK__keycap {
position: relative;
}
.MLK__shift {
display: block;
position: absolute;
right: 4px;
top: 4px;
font-size: var(--_keycap-shift-font-size);
color: var(--_keycap-shift-color);
}
.hide-shift .MLK__shift {
display: none;
}
@media (max-width: 414px) {
.MLK__variant-panel {
max-width: 350px;
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-length: var(--variant-keycap-length, 50px);
}
}
/* @xs breakpoint: iPhone 5 */
@container (max-width: 414px) {
.MLK__rows {
--_keycap-gap: max(var(--_keycap-gap, 2px), 2px);
--_keycap-height: max(var(--_keycap-height), 42px);
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
}
.MLK__toolbar > div > div {
font-size: 100%;
margin-left: 2px;
margin-right: 2px;
}
.MLK__rows .shift,
.MLK__rows .action {
font-size: 65%;
}
.MLK__rows .warning svg.svg-glyph {
width: 14px;
height: 14px;
min-height: 14px;
}
}
@container (max-width: 744px) {
.MLK__rows {
--_keycap-gap: max(var(--keycap-gap, 2px), 2px);
--_keycap-height: max(var(--keycap-height, 52px), 52px);
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
}
.MLK__toolbar > div > div {
padding-left: 0;
padding-right: 0;
}
.MLK__tooltip::after {
padding: 8px 16px;
font-size: 16px;
}
.MLK__rows > .MLK__row > div.fnbutton {
font-size: 16px;
}
.MLK__rows > .MLK__row > div.bigfnbutton {
font-size: calc(var(--_keycap-extra-small-font-size) / 1.55);
}
.MLK__rows > .MLK__row > div.small {
font-size: 13px;
}
.MLK__rows > .MLK__row > div > aside {
display: none;
}
.MLK__shift {
display: none;
}
}
/* Medium breakpoint: larger phones */
@container (max-width: 768px) {
.MLK__rows {
--_keycap-height: max(var(--keycap-height, 42px), 42px);
}
.MLK__rows > .MLK__row > div > small {
font-size: 14px;
}
}
@media (max-height: 768px) {
.MLK__rows {
--_keycap-height: max(var(--keycap-height, 42px), 42px);
}
.MLK__rows > .MLK__row > div > small {
font-size: 14px;
}
}
@container (max-width: 1444px) {
.MLK__rows .if-wide {
display: none;
}
}
@media (prefers-color-scheme: dark) {
.ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
--_background: var(--keyboard-background, #151515);
--_border: var(--keyboard-border, transparent);
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
--keyboard-toolbar-background-hover: #303030;
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
--_keycap-background: var(--keycap-background, #1f2022);
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
--_keycap-border: var(--_keycap-border, transparent);
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
--_keycap-text: var(--keycap-text, #e3e4e8);
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
--keycap-secondary-border: transparent;
--keycap-secondary-border-bottom: transparent;
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
--_variant-panel-background: var(--variant-panel-background, #303030);
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
}
}
/* Same as the media query, but with a class */
[theme='dark'] .ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
--_background: var(--keyboard-background, #151515);
--_border: var(--keyboard-border, transparent);
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
--keyboard-toolbar-background-hover: #303030;
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
--_keycap-background: var(--keycap-background, #1f2022);
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
--_keycap-border: var(--_keycap-border, transparent);
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
--_keycap-text: var(--keycap-text, #e3e4e8);
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
--keycap-secondary-border: transparent;
--keycap-secondary-border-bottom: transparent;
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
--_variant-panel-background: var(--variant-panel-background, #303030);
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
}
[theme='light'] .ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0c75d8);
--_background: var(--keyboard-background, #cacfd7);
--_border: var(--keyboard-border, #ddd);
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
--_keycap-background: var(--keycap-background, white);
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
--_keycap-border: var(--_keycap-border, #e5e6e9);
--_keycap-border-bottom: var(--_keycap-border-bottom, #8d8f92);
--_keycap-text: var(--keycap-text, #000);
--_keycap-text-active: var(--keycap-text-active, #fff);
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
--_variant-panel-background: var(--variant-panel-background, #fff);
--_variant-keycap-text: var(--variant-keycap-textvar, var(--_keycap-text));
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
}
`,Uf=`:host {
--primary-color: #5898ff;
--primary-color-dimmed: #c0c0f0;
--primary-color-dark: var(--blue-500);
--primary-color-light: var(--blue-100);
--primary-color-reverse: #ffffff;
--secondary-color: #ff8a65;
--secondary-color-dimmed: #f0d5c5;
--secondary-color-dark: var(--orange-500);
--secondary-color-light: var(--orange-100);
--secondary-color-reverse: #ffffff;
--link-color: #5898ff;
--link-color-dimmed: #c5c5c5;
--link-color-dark: #121212;
--link-color-light: #e2e2e2;
--link-color-reverse: #ffffff;
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--neutral-100: #f5f5f5;
--neutral-200: #eeeeee;
--neutral-300: #e0e0e0;
--neutral-400: #bdbdbd;
--neutral-500: #9e9e9e;
--neutral-600: #757575;
--neutral-700: #616161;
--neutral-800: #424242;
--neutral-900: #212121;
--red-25: #fff8f7;
--red-50: #fff1ef;
--red-100: #ffeae6;
--red-200: #ffcac1;
--red-300: #ffa495;
--red-400: #ff7865;
--red-500: #f21c0d;
--red-600: #e50018;
--red-700: #d30024;
--red-800: #bd002c;
--red-900: #a1002f;
--orange-25: #fffbf8;
--orange-50: #fff7f1;
--orange-100: #fff3ea;
--orange-200: #ffe1c9;
--orange-300: #ffcca2;
--orange-400: #ffb677;
--orange-500: #fe9310;
--orange-600: #f58700;
--orange-700: #ea7c00;
--orange-800: #dc6d00;
--orange-900: #ca5b00;
--brown-25: #fff8ef;
--brown-50: #fff1df;
--brown-100: #ffe9ce;
--brown-200: #ebcca6;
--brown-300: #cdaf8a;
--brown-400: #af936f;
--brown-500: #856a47;
--brown-600: #7f5e34;
--brown-700: #78511f;
--brown-800: #6e4200;
--brown-900: #593200;
--yellow-25: #fffdf9;
--yellow-50: #fffcf2;
--yellow-100: #fffaec;
--yellow-200: #fff2ce;
--yellow-300: #ffe8ab;
--yellow-400: #ffdf85;
--yellow-500: #ffcf33;
--yellow-600: #f1c000;
--yellow-700: #dfb200;
--yellow-800: #c9a000;
--yellow-900: #ad8a00;
--lime-25: #f4ffee;
--lime-50: #e9ffdd;
--lime-100: #ddffca;
--lime-200: #a8fb6f;
--lime-300: #94e659;
--lime-400: #80d142;
--lime-500: #63b215;
--lime-600: #45a000;
--lime-700: #268e00;
--lime-800: #007417;
--lime-900: #005321;
--green-25: #f5fff5;
--green-50: #ebffea;
--green-100: #e0ffdf;
--green-200: #a7ffa7;
--green-300: #5afa65;
--green-400: #45e953;
--green-500: #17cf36;
--green-600: #00b944;
--green-700: #00a34a;
--green-800: #008749;
--green-900: #00653e;
--teal-25: #f3ffff;
--teal-50: #e6fffe;
--teal-100: #d9fffe;
--teal-200: #8dfffe;
--teal-300: #57f4f4;
--teal-400: #43e5e5;
--teal-500: #17cfcf;
--teal-600: #00c2c0;
--teal-700: #00b5b1;
--teal-800: #00a49e;
--teal-900: #009087;
--cyan-25: #f7fcff;
--cyan-50: #eff8ff;
--cyan-100: #e7f5ff;
--cyan-200: #c2e6ff;
--cyan-300: #95d5ff;
--cyan-400: #61c4ff;
--cyan-500: #13a7ec;
--cyan-600: #069eda;
--cyan-700: #0095c9;
--cyan-800: #0088b2;
--cyan-900: #0a7897;
--blue-25: #f7faff;
--blue-50: #eef5ff;
--blue-100: #e5f1ff;
--blue-200: #bfdbff;
--blue-300: #92c2ff;
--blue-400: #63a8ff;
--blue-500: #0d80f2;
--blue-600: #0077db;
--blue-700: #006dc4;
--blue-800: #0060a7;
--blue-900: #005086;
--indigo-25: #f8f7ff;
--indigo-50: #f1efff;
--indigo-100: #eae7ff;
--indigo-200: #ccc3ff;
--indigo-300: #ac99ff;
--indigo-400: #916aff;
--indigo-500: #63c;
--indigo-600: #5a21b2;
--indigo-700: #4e0b99;
--indigo-800: #3b0071;
--indigo-900: #220040;
--purple-25: #fbf7ff;
--purple-50: #f8f0ff;
--purple-100: #f4e8ff;
--purple-200: #e4c4ff;
--purple-300: #d49aff;
--purple-400: #c36aff;
--purple-500: #a219e6;
--purple-600: #9000c4;
--purple-700: #7c009f;
--purple-800: #600073;
--purple-900: #3d0043;
--magenta-25: #fff8fb;
--magenta-50: #fff2f6;
--magenta-100: #ffebf2;
--magenta-200: #ffcddf;
--magenta-300: #ffa8cb;
--magenta-400: #ff7fb7;
--magenta-500: #eb4799;
--magenta-600: #da3689;
--magenta-700: #c82179;
--magenta-800: #b00065;
--magenta-900: #8a004c;
}
@media (prefers-color-scheme: dark) {
:host {
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--semantic-bg-blue: var(--blue-25);
--semantic-bg-red: var(--red-25);
--semantic-bg-orange: var(--orange-25);
--semantic-bg-green: var(--green-25);
--neutral-100: #121212;
--neutral-200: #424242;
--neutral-300: #616161;
--neutral-400: #757575;
--neutral-500: #9e9e9e;
--neutral-600: #bdbdbd;
--neutral-700: #e0e0e0;
--neutral-800: #eeeeee;
--neutral-900: #f5f5f5;
}
}
:host([theme='dark']) {
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--semantic-bg-blue: var(--blue-25);
--semantic-bg-red: var(--red-25);
--semantic-bg-orange: var(--orange-25);
--semantic-bg-green: var(--green-25);
--neutral-100: #121212;
--neutral-200: #424242;
--neutral-300: #616161;
--neutral-400: #757575;
--neutral-500: #9e9e9e;
--neutral-600: #bdbdbd;
--neutral-700: #e0e0e0;
--neutral-800: #eeeeee;
--neutral-900: #f5f5f5;
}
/* @media (prefers-color-scheme: dark) {
:host {
--label-color: #fff;
--active-label-color: #000;
--menu-bg: #525252;
--active-bg: #5898ff;
--active-bg-dimmed: #5c5c5c;
}
} */
:host {
--ui-font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol';
--ui-font-size: 14px;
--ui-line-height: 1.5;
--ui-letter-spacing: 0.007em;
--mono-font-family: 'Berkeley Mono', 'JetBrains Mono', 'IBM Plex Mono',
'Source Code Pro', Menlo, Monaco, 'Courier New', monospace;
--ui-layer-1: var(--neutral-100);
--ui-layer-2: var(--neutral-200);
--ui-layer-3: var(--neutral-300);
--ui-layer-4: var(--neutral-400);
--ui-layer-5: var(--neutral-500);
--ui-layer-6: var(--neutral-600);
--ui-border-color: var(--primary-color);
--ui-border-radius: 4px;
--ui-text: var(--neutral-900);
--ui-text-secondary: var(--neutral-700);
--ui-text-placeholder: var(--neutral-500);
--ui-text-muted: var(--neutral-300);
/** A field is a UI element in which a user can type data, for
* example an input or textarea element.
*/
--ui-field-bg: var(--neutral-100);
--ui-field-bg-hover: var(--neutral-100);
--ui-field-bg-disabled: var(--neutral-300);
--ui-field-bg-invalid: var(--red-100);
--ui-field-bg-focus: var(--neutral-100);
--ui-field-border: 0.5px solid var(--border-color);
--ui-field-border-hover: 0.5px solid var(--border-color);
--ui-field-border-disabled: 0.5px solid var(--border-color);
--ui-field-border-invalid: 0.5px solid var(--border-color);
--ui-field-border-focus: 0.5px solid var(--border-color);
--ui-menu-bg: var(--neutral-100);
--ui-menu-text: var(--neutral-900);
--ui-menu-bg-hover: var(--neutral-200);
--ui-menu-text-hover: var(--neutral-900);
/** The \`active\` state is used for the state of menu items
* when they are selected.
*/
--ui-menu-bg-active: var(--primary-color);
--ui-menu-text-active: var(--primary-color-reverse);
/** The \`active-muted\` set is used for the state of
* submenus when they are open.
*/
--ui-menu-bg-active-muted: var(--neutral-300);
--ui-menu-text-active-muted: var(--neutral-900);
/* --ui-menu-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.302),
0 2px 6px 2px rgba(60, 64, 67, 0.149); */
--ui-menu-shadow: 0 0 2px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.2);
--ui-menu-divider: 0.5px solid #c7c7c7;
/* var(--neutral-300); */
--ui-menu-z-index: 10000;
--page-bg: var(--neutral-100);
--content-bg: var(--neutral-200);
}
@media (prefers-color-scheme: dark) {
:host {
--ui-menu-bg: var(--neutral-200);
}
}
:host([theme='dark']) {
--ui-menu-bg: var(--neutral-200);
}
/* PingFang SC is a macOS font. Microsoft Yahei is a Windows font.
Noto is a Linux/Android font.
*/
:lang(zh-cn),
:lang(zh-sg),
:lang(zh-my),
:lang(zh) {
--ui-font-family: -apple-system, system-ui, 'PingFang SC', 'Hiragino Sans GB',
'Noto Sans CJK SC', 'Noto Sans SC', 'Noto Sans', 'Microsoft Yahei UI',
'Microsoft YaHei New', 'Microsoft Yahei', '\u5FAE\u8F6F\u96C5\u9ED1', SimSun, '\u5B8B\u4F53',
STXihei, '\u534E\u6587\u7EC6\u9ED1', sans-serif;
}
:lang(zh-tw),
:lang(zh-hk),
:lang(zh-mo) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans',
'Microsoft JhengHei UI', 'Microsoft JhengHei', '\u5FAE\u8EDF\u6B63\u9ED1\u9AD4', '\u65B0\u7D30\u660E\u9AD4',
'PMingLiU', '\u7D30\u660E\u9AD4', 'MingLiU', sans-serif;
}
:lang(ja),
:lang(ja-jp),
:lang(ja-jp-mac) {
--ui-font-family: -apple-system, system-ui, 'Hiragino Sans',
'Hiragino Kaku Gothic ProN', 'Noto Sans CJK JP', 'Noto Sans JP', 'Noto Sans',
'\u6E38\u30B4\u30B7\u30C3\u30AF', '\u6E38\u30B4\u30B7\u30C3\u30AF\u4F53', YuGothic, 'Yu Gothic', '\u30E1\u30A4\u30EA\u30AA', Meiryo,
'\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF', 'MS PGothic', sans-serif;
}
:lang(ko),
:lang(ko-kr),
:lang(ko-kr-std) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
'Noto Sans', 'Malgun Gothic', '\uB9D1\uC740 \uACE0\uB515', 'Apple SD Gothic Neo',
'\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo', 'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
}
:lang(ko-kr-apple) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
'Noto Sans', 'Apple SD Gothic Neo', '\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo',
'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
}
:lang(zh-cn),
:lang(zh-sg),
:lang(zh-my),
:lang(zh),
:lang(zh-tw),
:lang(zh-hk),
:lang(zh-mo),
:lang(ja),
:lang(ja-jp),
:lang(ja-jp-mac),
:lang(ko),
:lang(ko-kr),
:lang(ko-kr-std),
:lang(ko-kr-apple) {
--ui-font-size: 1rem;
--ui-line-height: 1.7;
--ui-letter-spacing: 0;
}
:dir(rtl) {
--ui-line-height: auto;
--ui-letter-spacing: 0;
}
`,Zf=`.ui-menu *,
.ui-menu ::before,
.ui-menu ::after {
box-sizing: border-box;
}
.ui-menu {
display: none;
color-scheme: light dark;
-webkit-user-select: none;
/* Important: Safari iOS doesn't respect user-select */
user-select: none;
cursor: default;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0 0 0 0);
--active-label-color: #fff;
/* ui-menu-text-active */
--label-color: #121212;
/* ui-menu-text */
--menu-bg: #e2e2e2;
/* ui-menu-background */
--active-bg: #5898ff;
/* ui-menu-background-active */
--active-bg-dimmed: #c5c5c5;
/* ui-menu-background-active-muted */
}
/** Use the :where pseudo selector to make the specificity of the
* selector 0, so that it can be overridden by the user.
*/
:where(.ui-menu-container) {
position: absolute;
overflow: visible;
width: auto;
height: auto;
z-index: 10000;
border-radius: 8px;
background: var(--ui-menu-bg);
box-shadow: var(--ui-menu-shadow);
list-style: none;
padding: 6px 0 6px 0;
margin: 0;
user-select: none;
cursor: default;
color: var(--ui-menu-text);
font-weight: normal;
font-style: normal;
text-shadow: none;
text-transform: none;
letter-spacing: 0;
outline: none;
opacity: 1;
/* The [popover] elements have a 1px solid black border. Ugh. */
border: none;
width: fit-content;
height: fit-content;
}
:where(.ui-menu-container > li) {
display: flex;
flex-flow: row;
align-items: center;
padding: 1px 7px 1px 7px;
margin-top: 0;
margin-left: 6px;
margin-right: 6px;
border-radius: 4px;
white-space: nowrap;
position: relative;
outline: none;
fill: currentColor;
user-select: none;
cursor: default;
text-align: left;
color: inherit;
font-family: var(--ui-font-family);
font-size: var(--ui-font-size);
line-height: var(--ui-line-height);
letter-spacing: var(--ui-letter-spacing);
}
:where(.ui-menu-container > li > .label) {
appearance: none;
background: none;
outline: none;
width: 100%;
margin: 0;
padding: 1px 2px 1px 1px;
overflow: visible;
border: 1px solid transparent;
white-space: nowrap;
text-align: start;
}
:where(.ui-menu-container > li:has(.heading)) {
margin-top: 0.5em;
}
:where(.ui-menu-container > li > .label.heading) {
font-weight: bold;
opacity: 0.4;
}
:where(.ui-menu-container > li.indent > .label) {
margin-inline-start: 12px;
}
:where(.ui-menu-container > li > .label.indent) {
margin-inline-start: 12px;
}
:where(.ui-menu-container > li[role='divider']) {
border-bottom: 1px solid var(--ui-menu-divider);
border-radius: 0;
padding: 0;
margin-left: 15px;
margin-right: 15px;
padding-top: 5px;
margin-bottom: 5px;
width: calc(100% - 30px);
/** 100% - (margin-left + margin-right) */
}
:where(.ui-menu-container > li[aria-disabled='true']) {
opacity: 0.5;
}
:where(.ui-menu-container > li.active) {
background: var(--ui-menu-bg-active);
background: -apple-system-control-accent;
color: var(--ui-menu-text-active);
}
:where(.ui-menu-container > li.active.is-submenu-open) {
background: var(--ui-menu-bg-active-muted);
color: inherit;
}
:where(.ui-menu-container > li[aria-haspopup='true'] > .label) {
padding-inline-end: 0;
}
:where(.ui-menu-container > li[aria-haspopup='true'].active::after) {
color: var(--ui-menu-text-active);
}
/** Keyboard shortcut */
:where(.ui-menu-container > li > kbd) {
font-family: var(--ui-font-family);
margin-inline-start: 12px;
opacity: 0.4;
}
:where(.ui-menu-container > li.active > kbd) {
opacity: 0.85;
}
.ui-trailing-chevron {
display: flex;
margin-inline-start: 24px;
width: 10px;
height: 10px;
margin-bottom: 4px;
}
.ui-trailing-chevron:dir(rtl) {
transform: scaleX(-1);
}
.ui-checkmark {
display: flex;
margin-inline-end: -11px;
margin-inline-start: -4px;
margin-top: 2px;
width: 16px;
height: 16px;
}
.ui-mixedmark {
display: flex;
margin-inline-end: -11px;
margin-inline-start: -4px;
margin-top: 2px;
width: 16px;
height: 16px;
}
`,yi;function Wi(e){let t="";switch(e){case"mathfield-element":t=`
:host { display: inline-block; background-color: field; color: fieldtext; border-width: 1px; border-style: solid; border-color: #acacac; border-radius: 2px; padding:4px;}
:host([hidden]) { display: none; }
:host([disabled]), :host([disabled]:focus), :host([disabled]:focus-within) { outline: none; opacity: .5; }
:host(:focus), :host(:focus-within) {
outline: Highlight auto 1px; /* For Firefox */
outline: -webkit-focus-ring-color auto 1px;
}
:host([readonly]:focus), :host([readonly]:focus-within),
:host([read-only]:focus), :host([read-only]:focus-within) {
outline: none;
}
@media (hover: none) and (pointer: coarse) {
:host(:not(:focus)) :first-child { pointer-events: none !important; }
}`;break;case"core":t=qf;break;case"mathfield":t=Rf;break;case"environment-popover":t=Vf;break;case"suggestion-popover":t=Hf;break;case"keystroke-caption":t=jf;break;case"virtual-keyboard":t=Wf;break;case"ui":t=Uf;break;case"menu":t=Zf;break;default:debugger}return t}function _n(e){return yi||(yi={}),yi[e]||(yi[e]=new CSSStyleSheet,yi[e].replaceSync(Wi(e))),yi[e]}var Qr;function ei(e){var t;if(!("adoptedStyleSheets"in document)){if(window.document.getElementById(`mathlive-style-${e}`))return;const r=window.document.createElement("style");r.id=`mathlive-style-${e}`,r.append(window.document.createTextNode(Wi(e))),window.document.head.appendChild(r);return}if(Qr||(Qr={}),((t=Qr[e])!=null?t:0)!==0)Qr[e]+=1;else{const r=_n(e);document.adoptedStyleSheets=[...document.adoptedStyleSheets,r],Qr[e]=1}}function xi(e){if("adoptedStyleSheets"in document&&Qr!=null&&Qr[e]&&(Qr[e]-=1,Qr[e]<=0)){const t=yi[e];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(r=>r!==t)}}var Ds=class Ah extends w{constructor(t){var r;super(g(p({},t),{type:"accent",body:(r=t.body)!=null?r:void 0})),t.accentChar?this.accent=t.accentChar:this.svgAccent=t==null?void 0:t.svgAccent,this.skipBoundary=!0,this.captureSelection=!0}static fromJson(t){return new Ah(t)}toJson(){return g(p({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(t){var r;const i=new $({parent:t,mathstyle:"cramp"},this.style),n=(r=w.createBox(i,this.body))!=null?r:new D("\u25A2",{style:this.style});let a=0;!this.hasEmptyBranch("body")&&this.body.length===2&&this.body[1].isCharacterBox()&&(a=n.skew);let s=Math.min(n.height,mi),o;if(this.svgAccent)o=Ms(this.svgAccent),s=i.metrics.bigOpSpacing1-s;else if(this.accent){const c=new D(this.accent,{fontFamily:"Main-Regular"});c.italic=0;const u=this.accent===8407?" ML__accent-vec":"";o=new D(new D(c),{classes:"ML__accent-body"+u})}o=new je({shift:0,children:[{box:new D(n)},-s,{box:o,marginLeft:n.left+2*a,classes:["ML__center"]}]});const l=new D(o,{type:"lift"});return this.caret&&(l.caret=this.caret),this.bind(i,l.wrap(i)),this.attachSupsub(i,{base:l})}},Ts={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\lparen":"\\rparen","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},Fs=Object.fromEntries(Object.entries(Ts).map(([e,t])=>[t,e]));function Ps(e){var t;return(t={"[":91,"]":93,"(":40,")":41,"\\mid":8739,"|":8739,"\u2223":8739,"\u2225":8741,"\\|":8739,"\\{":123,"\\}":125,"\\lbrace":123,"\\rbrace":125,"\\lparen":40,"\\rparen":41,"\\lbrack":91,"\\rbrack":93,"\\vert":8739,"\\lvert":8739,"\\mvert":8739,"\\rvert":8739,"\\Vert":8741,"\\lVert":8741,"\\mVert":8741,"\\rVert":8741,"\\parallel":8741,"\\shortparallel":8741,"\\langle":10216,"\\rangle":10217,"\\lfloor":8970,"\\rfloor":8971,"\\lceil":8968,"\\rceil":8969,"\\ulcorner":9484,"\\urcorner":9488,"\\llcorner":9492,"\\lrcorner":9496,"\\lgroup":10222,"\\rgroup":10223,"\\lmoustache":9136,"\\rmoustache":9137,"\\surd":8730}[e])!=null?t:e.codePointAt(0)}function Jf(e,t,r,i){var n;const s=new D(Ps(e),{fontFamily:"Main-Regular",isSelected:i.isSelected,classes:"ML__small-delim "+((n=i.classes)!=null?n:"")}).wrap(t);return r&&s.setTop((1-t.scalingFactor)*_r),s}function V0(e,t,r,i,n){var a,s;const o=new $({parent:i,mathstyle:"textstyle"},n==null?void 0:n.style),l=new D(Ps(e),{fontFamily:`Size${t}-Regular`,isSelected:n.isSelected,classes:((a=n.classes)!=null?a:"")+` ML__delim-size${t}`,type:(s=n.type)!=null?s:"ignore"}).wrap(o);return r&&l.setTop((1-o.scalingFactor)*_r),l}function H0(e,t,r,i,n){var a;let s,o,l,c;s=l=c=Ps(e),o=null;let u="Size1-Regular";e==="\\vert"||e==="\\lvert"||e==="\\rvert"||e==="\\mvert"||e==="\\mid"?l=s=c=8739:e==="\\Vert"||e==="\\lVert"||e==="\\rVert"||e==="\\mVert"||e==="\\|"?l=s=c=8741:e==="\\uparrow"?l=c=9168:e==="\\Uparrow"?l=c=8214:e==="\\downarrow"?s=l=9168:e==="\\Downarrow"?s=l=8214:e==="\\updownarrow"?(s=8593,l=9168,c=8595):e==="\\Updownarrow"?(s=8657,l=8214,c=8659):e==="["||e==="\\lbrack"?(s=9121,l=9122,c=9123,u="Size4-Regular"):e==="]"||e==="\\rbrack"?(s=9124,l=9125,c=9126,u="Size4-Regular"):e==="\\lfloor"||e==="\u230A"?(l=s=9122,c=9123,u="Size4-Regular"):e==="\\lceil"||e==="\u2308"?(s=9121,l=c=9122,u="Size4-Regular"):e==="\\rfloor"||e==="\u230B"?(l=s=9125,c=9126,u="Size4-Regular"):e==="\\rceil"||e==="\u2309"?(s=9124,l=c=9125,u="Size4-Regular"):e==="("||e==="\\lparen"?(s=9115,l=9116,c=9117,u="Size4-Regular"):e===")"||e==="\\rparen"?(s=9118,l=9119,c=9120,u="Size4-Regular"):e==="\\{"||e==="\\lbrace"?(s=9127,o=9128,c=9129,l=9130,u="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(s=9131,o=9132,c=9133,l=9130,u="Size4-Regular"):e==="\\lgroup"||e==="\u27EE"?(s=9127,c=9129,l=9130,u="Size4-Regular"):e==="\\rgroup"||e==="\u27EF"?(s=9131,c=9133,l=9130,u="Size4-Regular"):e==="\\lmoustache"||e==="\u23B0"?(s=9127,c=9133,l=9130,u="Size4-Regular"):e==="\\rmoustache"||e==="\u23B1"?(s=9131,c=9129,l=9130,u="Size4-Regular"):e==="\\surd"?(s=57345,c=9143,l=57344,u="Size4-Regular"):e==="\\ulcorner"?(s=9484,l=c=32):e==="\\urcorner"?(s=9488,l=c=32):e==="\\llcorner"?(c=9492,l=s=32):e==="\\lrcorner"&&(s=9496,l=s=32);const d=vn(s,u),h=d.height+d.depth,f=vn(l,u),m=f.height+f.depth,y=vn(c,u),A=y.height+y.depth;let v=0,S=1;if(o!==null){const Xe=vn(o,u);v=Xe.height+Xe.depth,S=2}const L=h+A+v,C=Math.max(0,Math.ceil((t-L)/(S*m))),z=L+C*S*m;let I=_r;r&&(I=I*i.scalingFactor);const O=z/2-I,U=.008,oe=[];oe.push({box:new D(c,{fontFamily:u})}),oe.push(-U);const T=new D(l,{fontFamily:u});if(o===null)for(let Xe=0;Xe<C;Xe++)oe.push({box:T});else{for(let Xe=0;Xe<C;Xe++)oe.push({box:T});oe.push(-U),oe.push({box:new D(o,{fontFamily:u})}),oe.push(-U);for(let Xe=0;Xe<C;Xe++)oe.push({box:T})}oe.push(-U),oe.push({box:new D(s,{fontFamily:u})});let $t="";u==="Size1-Regular"?$t=" delim-size1":u==="Size4-Regular"&&($t=" delim-size4");const Ir=new je({bottom:O,children:oe},{classes:$t});return new D(Ir,g(p({},n!=null?n:{}),{classes:((a=n==null?void 0:n.classes)!=null?a:"")+" ML__delim-mult"}))}var j0=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),Xf=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),W0=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),$f=[0,1.2,1.8,2.4,3];function Gf(e,t,r,i){return e===void 0||e==="."?Ui(r,i.classes):(e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle"),j0.has(e)||W0.has(e)?V0(e,t,!1,r,i):Xf.has(e)?H0(e,$f[t],!1,r,i):(console.assert(!1,"Unknown delimiter '"+e+"'"),null))}var Yf=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Qf=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],ep=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function tp(e){return e.type==="small"?"Main-Regular":e.type==="large"?"Size"+e.size+"-Regular":(console.assert(e.type==="stack"),"Size4-Regular")}function rp(e,t,r,i){const n={"-4":0,"-3":1,0:2}[i.mathstyle.sizeDelta];for(let a=n;a<r.length&&r[a].type!=="stack";a++){const s=vn(e,tp(r[a]));if(s.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let o=s.height+s.depth;if(r[a].type==="small"&&(r[a].mathstyle==="scriptscriptstyle"?o*=Math.max(Go[Math.max(1,i.size-2)],i.minFontScale):r[a].mathstyle==="scriptstyle"&&(o*=Math.max(Go[Math.max(1,i.size-1)],i.minFontScale))),o>t)return r[a]}return r[r.length-1]}function zs(e,t,r,i,n,a){if(!t||t.length===0||t===".")return Ui(n);t==="<"||t==="\\lt"?t="\\langle":(t===">"||t==="\\gt")&&(t="\\rangle");let s;W0.has(t)?s=Yf:j0.has(t)?s=ep:s=Qf;const o=rp(Ps(t),r,s,n),l=new $({parent:n,mathstyle:o.mathstyle},a==null?void 0:a.style);return o.type==="small"?Jf(t,l,i,g(p({},a),{type:e})):o.type==="large"?V0(t,o.size,i,l,g(p({},a),{type:e})):(console.assert(o.type==="stack"),H0(t,r,i,l,g(p({},a),{type:e})))}function pa(e,t,r,i,n,a){if(t===".")return Ui(n,a==null?void 0:a.classes);const s=_r*n.scalingFactor,o=901,l=5/bn,c=Math.max(r-s,i+s),u=Math.max(c/500*o,2*c-l);return zs(e,t,u,!0,n,a)}function Ui(e,t){const r=new D(null,{classes:" nulldelimiter "+(t!=null?t:""),type:"ignore"});return r.width=e.getRegisterAsEm("nulldelimiterspace"),r.wrap(new $({parent:e,mathstyle:"textstyle"}))}var ti=class Lh extends w{constructor(t){var r;super({type:"placeholder",command:"\\placeholder",mode:(r=t==null?void 0:t.mode)!=null?r:"math",style:t==null?void 0:t.style}),this.captureSelection=!0}static fromJson(t){return new Lh(t)}toJson(){return super.toJson()}render(t){let r;return this.value=t.placeholderSymbol,typeof t.renderPlaceholder=="function"?r=t.renderPlaceholder(t):r=this.createBox(t),this.caret&&(r.classes+=" ML__placeholder-selected"),r}_serialize(t){return t.skipPlaceholders?"":"\\placeholder{}"}},U0=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],Z0=["cases","dcases","rcases"],J0=["align","align*","aligned","gather","gathered","split"],ip=["array","subequations","eqnarray"];function np(e){return ip.concat(J0).concat(Z0).concat(U0).includes(e)}function X0(e){return U0.includes(e)}function ap(e){return Z0.includes(e)}function sp(e){return J0.includes(e)}function op(e,t,r){let i=0;for(const c of r)"align"in c&&(i+=1);let n=0;const a=[];for(const c of t){let u=0;for(n=Math.max(n,Math.min(c.length,i));u<c.length;){const d=[],h=Math.min(c.length,u+i);for(;u<h;){const f=c[u];f.length===0?d.push([new w({type:"first",mode:e.mode})]):f[0].type!=="first"?d.push([new w({type:"first",mode:e.mode}),...f]):(console.assert(!f.slice(1).some(m=>m.type==="first")),d.push(f)),u+=1}a.push(d)}}a.length>0&&a[a.length-1].length===1&&a[a.length-1][0].length===1&&a[a.length-1][0][0].type==="first"&&a.pop();const s=[];for(const c of a){if(c.length!==n)for(let u=c.length;u<n;u++)c.push([new w({type:"first",mode:e.mode}),new ti]);s.push(c)}let o=0,l=0;for(const c of s){l=0;for(const u of c){for(const d of u)d.parent=e,d.parentBranch=[o,l];l+=1}o+=1}return e.isDirty=!0,s}var ae=class Bh extends w{constructor(t,r,i,n={}){var a;super({type:"array"}),this.environmentName=t,this.rowGaps=i,n.mathstyleName&&(this.mathstyleName=n.mathstyleName),n.columns&&(n.columns.length===0?this.colFormat=[{align:"l"}]:this.colFormat=n.columns),this.colFormat||(this.colFormat=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]),this.array=op(this,r,this.colFormat),n.leftDelim&&(this.leftDelim=n.leftDelim),n.rightDelim&&(this.rightDelim=n.rightDelim),n.arraycolsep!==void 0&&(this.arraycolsep=n.arraycolsep),this.colSeparationType=n.colSeparationType,n.arraystretch!==void 0&&(this.arraystretch=n.arraystretch),this.minColumns=(a=n.minColumns)!=null?a:1}static fromJson(t){return new Bh(t.environmentName,t.array,t.rowGaps,t)}toJson(){const t=g(p({},super.toJson()),{environmentName:this.environmentName,array:this.array.map(r=>r.map(i=>i.map(n=>n.toJson()))),rowGaps:this.rowGaps,columns:this.colFormat,colSeparationType:this.colSeparationType});return this.arraystretch!==void 0&&(t.arraystretch=this.arraystretch),this.arraycolsep!==void 0&&(t.arraycolsep=this.arraycolsep),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),t}branch(t){var r;if(Es(t))return(r=this.array[t[0]][t[1]])!=null?r:void 0}createBranch(t){var r;return Es(t)?(this.isDirty=!0,(r=this.branch(t))!=null?r:[]):[]}get rowCount(){return this.array.length}get colCount(){return this.array[0].length}get maxColumns(){return this.colFormat.filter(t=>!!t.align).length}removeBranch(t){if(Vi(t))return super.removeBranch(t);const r=this.branch(t);return this.array[t[0]][t[1]]=void 0,r.forEach(i=>{i.parent=void 0,i.parentBranch=void 0}),console.assert(r[0].type==="first"),r.shift(),this.isDirty=!0,r}get hasChildren(){return this.children.length>0}get children(){const t=[];for(const r of this.array)for(const i of r)if(i)for(const n of i)t.push(...n.children),t.push(n);return[...t,...super.children]}render(t){var r,i,n,a,s,o;const l=new $({parent:t,mathstyle:this.mathstyleName},this.style),c=l.getRegisterAsEm("arrayrulewidth"),u=l.getRegisterAsEm("arraycolsep"),d=l.getRegisterAsEm("doublerulesep"),h=(i=(r=this.arraystretch)!=null?r:l.getRegisterAsNumber("arraystretch"))!=null?i:1;let f=typeof this.arraycolsep=="number"?this.arraycolsep:u;this.colSeparationType==="small"&&(f=.2778*(new $({parent:t,mathstyle:"scriptstyle"}).scalingFactor/t.scalingFactor));const m=h*lf,y=.7*m,A=.3*m;let v=0;const S=[];let L=0;const C=this.array.length;for(let ue=0;ue<C;++ue){const ze=this.array[ue];L=Math.max(L,ze.length);const $e=new $({parent:l,mathstyle:this.mathstyleName},this.style);let Rr=y/$e.scalingFactor,qr=A/$e.scalingFactor;const Vr={cells:[],height:0,depth:0,pos:0};for(const kr of ze){const Yl=(n=w.createBox($e,kr,{type:"ignore"}))!=null?n:new D(null,{type:"ignore"});qr=Math.max(qr,Yl.depth),Rr=Math.max(Rr,Yl.height),Vr.cells.push(Yl)}let Hr=(a=T0(this.rowGaps[ue]))!=null?a:0;Hr>0&&(Hr+=A,qr=Math.max(qr,Hr),Hr=0),ue<C-1&&!X0(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(qr+=l.getRegisterAsEm("jot")),Vr.height=Rr,Vr.depth=qr,v+=Rr,Vr.pos=v,v+=qr+Hr,S.push(Vr)}const z=v/2+_r,I=[];for(let ue=0;ue<L;ue++){const ze=[];for(const $e of S){const Rr=$e.cells[ue];Rr.depth=$e.depth,Rr.height=$e.height,ze.push({box:Rr,shift:$e.pos-z})}ze.length>0&&I.push(new je({individualShift:ze}))}const O=[];let U=!1,oe=!1,T=0,$t=!this.leftDelim;const{colFormat:Ir}=this;for(const ue of Ir){if("align"in ue&&T>=I.length)break;if("align"in ue)U?O.push(Ns(2*f)):(oe||$t)&&O.push(Ns(f)),O.push(new D(I[T],{classes:"col-align-"+ue.align})),T++,U=!0,oe=!1,$t=!1;else if("gap"in ue){if(typeof ue.gap=="number")O.push(Ns(ue.gap));else{const ze=lp(t,S,z,ue.gap);ze&&O.push(ze)}U=!1,oe=!1,$t=!1}else if("separator"in ue){const ze=new D(null,{classes:"vertical-separator"});ze.height=v,ze.setStyle("height",v,"em"),ze.setStyle("border-right",`${c}em ${ue.separator} currentColor`),ze.setStyle("vertical-align",-(v-z),"em");let $e=0;oe?$e=d-c:U&&($e=f-c),ze.left=$e,O.push(ze),U=!1,oe=!0,$t=!1}}U&&!this.rightDelim&&O.push(Ns(f));const cr=new D(O,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(cr.caret=this.caret),this.bind(t,cr);const Xe=cr.height,Gt=cr.depth,Dt=this.bind(t,new D([this.bind(t,pa("open",(s=this.leftDelim)!=null?s:".",Xe,Gt,l,{isSelected:this.isSelected})),cr,this.bind(t,pa("close",(o=this.rightDelim)!=null?o:".",Xe,Gt,l,{isSelected:this.isSelected}))],{type:"ord"}));return Dt?(Dt.setStyle("display","inline-block"),this.caret&&(Dt.caret=this.caret),this.bind(t,this.attachSupsub(t,{base:Dt}))):null}_serialize(t){var r;const i=[];if(this.environmentName==="lines"?i.push("{\\displaylines"):i.push(`\\begin{${this.environmentName}}`),this.environmentName==="array"){if(i.push("{"),this.colFormat!==void 0)for(const n of this.colFormat)"align"in n&&typeof n.align=="string"?i.push(n.align):"separator"in n&&n.separator==="solid"?i.push("|"):"separator"in n&&n.separator==="dashed"&&i.push(":");i.push("}")}for(let n=0;n<this.array.length;n++){for(let a=0;a<this.array[n].length;a++)a>0&&i.push(" & "),i.push(w.serialize(this.array[n][a],t));if(n<this.array.length-1){const a=this.rowGaps[n];a!=null&&a.dimension?i.push(`\\\\[${a.dimension} ${(r=a.unit)!=null?r:"pt"}] `):i.push("\\\\ ")}}return this.environmentName==="lines"?i.push("}"):i.push(`\\end{${this.environmentName}}`),X(i)}getCell(t,r){return this.array[t][r]}setCell(t,r,i){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.array[t][r]!==void 0);for(const a of this.array[t][r])a.parent=void 0,a.parentBranch=void 0;let n=i;(i.length===0||i[0].type!=="first")&&(n=[new w({type:"first",mode:this.mode}),...i]),this.array[t][r]=n;for(const a of n)a.parent=this,a.parentBranch=[t,r];this.isDirty=!0}addRowBefore(t){console.assert(this.type==="array"&&Array.isArray(this.array));const r=[];for(let i=0;i<this.colCount;i++)r.push(Ks(this));this.array.splice(t,0,r);for(let i=t;i<this.rowCount;i++)for(let n=0;n<this.colCount;n++){const a=this.array[i][n];if(a)for(const s of a)s.parentBranch=[i,n]}this.isDirty=!0}addRowAfter(t){console.assert(this.type==="array"&&Array.isArray(this.array));const r=[];for(let i=0;i<this.colCount;i++)r.push(Ks(this));this.array.splice(t+1,0,r);for(let i=t+1;i<this.rowCount;i++)for(let n=0;n<this.colCount;n++){const a=this.array[i][n];if(a)for(const s of a)s.parentBranch=[i,n]}this.isDirty=!0}removeRow(t){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.rowCount>t);const r=this.array.splice(t,1);for(const i of r)for(const n of i)if(n)for(const a of n)a.parent=void 0,a.parentBranch=void 0;for(let i=t;i<this.rowCount;i++)for(let n=0;n<this.colCount;n++){const a=this.array[i][n];if(a)for(const s of a)s.parentBranch=[i,n]}this.isDirty=!0}addColumnBefore(t){console.assert(this.type==="array"&&Array.isArray(this.array));for(const r of this.array)r.splice(t,0,Ks(this));for(let r=0;r<this.rowCount;r++)for(let i=t;i<this.colCount;i++){const n=this.array[r][i];if(n)for(const a of n)a.parentBranch=[r,i]}this.isDirty=!0}addColumnAfter(t){console.assert(this.type==="array"&&Array.isArray(this.array));for(const r of this.array)r.splice(t+1,0,Ks(this));for(let r=0;r<this.rowCount;r++)for(let i=t+1;i<this.colCount;i++){const n=this.array[r][i];if(n)for(const a of n)a.parentBranch=[r,i]}this.isDirty=!0}addColumn(){this.addColumnAfter(this.colCount-1)}removeColumn(t){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.colCount>t);for(const r of this.array){const i=r.splice(t,1);for(const n of i)if(n)for(const a of n)a.parent=void 0,a.parentBranch=void 0}for(let r=0;r<this.rowCount;r++)for(let i=t;i<this.colCount;i++){const n=this.array[r][i];if(n)for(const a of n)a.parentBranch=[r,i]}this.isDirty=!0}get cells(){const t=[];for(const r of this.array)for(const i of r)i&&t.push(i.filter(n=>n.type!=="first"));return t}};function Ks(e){const t=new w({type:"first",mode:e.mode});t.parent=e;const r=new ti;return r.parent=e,[t,r]}function Ns(e){const t=new D(null,{classes:"arraycolsep"});return t.width=e,t}function lp(e,t,r,i){if(!i)return null;const n=[];for(const a of t){const s=w.createBox(e,i,{type:"ignore"});s&&(s.depth=a.depth,s.height=a.height,n.push({box:s,shift:a.pos-r}))}return new je({individualShift:n}).wrap(e)}var _i=class Dh extends w{constructor(t){super({mode:t.mode,command:t.command,style:t.style,body:t.body,type:"box"}),this.framecolor=t.framecolor,this.backgroundcolor=t.backgroundcolor,this.padding=t.padding,this.offset=t.offset,this.border=t.border}static fromJson(t){return new Dh(t)}toJson(){return g(p({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(t){var r,i,n,a;const s=w.createBox(t,this.body,{type:"lift"});if(!s)return null;const o=t.toEm((r=this.offset)!=null?r:{dimension:0});s.depth+=o,s.setStyle("display","inline-block"),s.setStyle("position","relative"),s.setStyle("height",Math.floor(100*s.height+s.depth)/100,"em"),s.setStyle("vertical-align",-Math.floor(100*s.height)/100,"em");const l=new $({parent:t},this.style),c=l.toEm((i=this.padding)!=null?i:{register:"fboxsep"}),u=new D(null,{classes:"ML__box"});u.height=s.height+c,u.depth=s.depth+c,u.setStyle("box-sizing","border-box"),u.setStyle("position","absolute"),u.setStyle("top",-c+.3,"em"),u.setStyle("left",0),u.setStyle("height",u.height+u.depth,"em"),u.setStyle("width","100%"),this.backgroundcolor&&u.setStyle("background-color",(n=l.toColor(this.backgroundcolor))!=null?n:"transparent"),this.framecolor&&u.setStyle("border",`${l.getRegisterAsEm("fboxrule",2)}em solid ${(a=l.toColor(this.framecolor))!=null?a:"black"}`),this.border&&u.setStyle("border",this.border);const d=new D([u,s],{type:"lift"});return d.setStyle("display","inline-block"),d.setStyle("position","relative"),d.setStyle("line-height",0),d.height=s.height+c+(o>0?o:0),d.depth=s.depth+c+(o<0?-o:0),d.setStyle("padding-left",c,"em"),d.setStyle("padding-right",c,"em"),d.setStyle("height",Math.floor(100*(s.height+s.depth+2*c+Math.abs(o)))/100,"em"),d.setStyle("margin-top",-c,"em"),d.setStyle("top",Math.floor(100*(s.depth-s.height+2*c-o))/100,"em"),d.setStyle("vertical-align",Math.floor(100*(s.depth+2*c))/100,"em"),this.caret&&(d.caret=this.caret),this.attachSupsub(t,{base:d})}_serialize(t){return t.skipStyles?X([this.bodyToLatex(t),this.supsubToLatex(t)]):super._serialize(t)}},$0=class Th extends w{constructor(t,r){var i;super({type:"composition",mode:(i=r==null?void 0:r.mode)!=null?i:"math",value:t})}static fromJson(t){return new Th(t.value,t)}toJson(){return super.toJson()}get computedStyle(){return{}}render(t){const r=new D(this.value,{classes:"ML__composition",type:"composition"});return this.bind(t,r),this.caret&&(r.caret=this.caret),r}_serialize(t){return""}},Zi=class Fh extends w{constructor(t){super({type:"error",value:t,command:t,mode:"math"}),this.verbatimLatex=t}static fromJson(t){return new Fh(t.command)}toJson(){return super.toJson()}render(t){const r=this.createBox(t,{classes:"ML__error"});return this.caret&&(r.caret=this.caret),r}},G0=class Ph extends w{constructor(t,r,i){super({type:"group",mode:r,style:i}),this.body=t,this.boxType=t.length>1?"ord":"ignore",this.skipBoundary=!0,this.displayContainsHighlight=!1,t&&t.length===1&&t[0].command===","&&(this.captureSelection=!0)}static fromJson(t){return new Ph(t.body,t.mode,t.style)}render(t){const r=w.createBox(t,this.body,{type:this.boxType});return r?(this.caret&&(r.caret=this.caret),this.bind(t,r)):null}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Ve(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,t):`{${this.bodyToLatex(t)}}`}},Le=class zh extends w{constructor(t,r,i){super({type:"leftright",style:i.style,displayContainsHighlight:!0}),this.variant=t,this.body=r,this.leftDelim=i.leftDelim,this.rightDelim=i.rightDelim}static fromJson(t){var r;return new zh((r=t.variant)!=null?r:"",t.body,t)}toJson(){const t=super.toJson();return this.variant&&(t.variant=this.variant),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),t}_serialize(t){var r,i;const n=this.matchingRightDelim();return this.variant==="left...right"?X(["\\left",(r=this.leftDelim)!=null?r:".",this.bodyToLatex(t),"\\right",n]):this.variant==="mleft...mright"?X(["\\mleft",(i=this.leftDelim)!=null?i:".",this.bodyToLatex(t),"\\mright",n]):X([!this.leftDelim||this.leftDelim==="."?"":this.leftDelim,this.bodyToLatex(t),n])}matchingRightDelim(){var t,r;if(this.rightDelim&&this.rightDelim!=="?")return this.rightDelim;const i=(t=this.leftDelim)!=null?t:".";return(r=Ts[i])!=null?r:i}render(t){var r,i;const n=new $({parent:t},this.style);console.assert(this.body!==void 0);const a=new $({parent:t,mathstyle:"textstyle"},this.style),s=(r=w.createBox(n,this.body,{type:"inner"}))!=null?r:new D(null,{type:"inner"}),o=s.height/a.scalingFactor,l=s.depth/a.scalingFactor,c=[];if(this.leftDelim&&c.push(this.bind(a,pa("open",this.leftDelim,o,l,a,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),s&&(Y0(s.children,this,n,o,l),c.push(s)),this.rightDelim){let f=this.containsCaret?" ML__contains-caret":"",m=this.rightDelim;m==="?"&&(n.smartFence?(m=this.matchingRightDelim(),f+=" ML__smart-fence__close"):m="."),c.push(this.bind(a,pa("close",m,o,l,a,{isSelected:this.isSelected,classes:f+" ML__close",mode:this.mode,style:this.style})))}let u=this.variant==="mleft...mright";const d=this.leftSibling;d&&(!u&&d.isFunction&&(u=!0),!u&&d.type==="subsup"&&((i=d.leftSibling)!=null&&i.isFunction)&&(u=!0));const h=new D(c,{type:u?"close":"inner",classes:"left-right"});return h.setStyle("margin-top",`${-s.depth}em`),h.setStyle("height",`${s.height+s.depth}em`),this.caret&&(h.caret=this.caret),this.bind(n,h.wrap(n))}};function Y0(e,t,r,i,n){if(e)for(let a=0;a<e.length;a++){const s=e[a];s.type==="middle"?(e[a]=t.bind(r,pa("inner",s.value,i,n,r,{isSelected:t.isSelected})),e[a].caret=s.caret,e[a].isSelected=s.isSelected,e[a].cssId=s.cssId,e[a].htmlData=s.htmlData,e[a].htmlStyle=s.htmlStyle,e[a].attributes=s.attributes,e[a].cssProperties=s.cssProperties):s.children&&Y0(s.children,t,r,i,n)}}var Q0=class Kh extends w{constructor(t,r){var i;super({type:"macro",command:t,style:r.style}),this.body=r.body,r.captureSelection===void 0?r.args?this.captureSelection=!1:this.captureSelection=!0:this.captureSelection=r.captureSelection,this.macroArgs=r.args,this.expand=(i=r.expand)!=null?i:!1}static fromJson(t){return new Kh(t.command,t)}toJson(){const t=super.toJson();return this.expand&&(t.expand=!0),this.captureSelection!==void 0&&(t.captureSelection=this.captureSelection),this.macroArgs&&(t.args=this.macroArgs),t}_serialize(t){var r;return t.expandMacro&&this.expand?this.bodyToLatex(t):this.command+((r=this.macroArgs)!=null?r:"")}render(t){const r=w.createBox(t,this.body);return r?(this.caret&&(r.caret=this.caret),this.bind(t,r)):null}},cp=class Nh extends w{constructor(){super({type:"macro-argument"})}static fromJson(t){return new Nh}toJson(){return super.toJson()}_serialize(t){return""}render(t){return null}},ed=class Oh extends w{constructor(t,r,i=!1,n,a){var s;super({type:"prompt",mode:(s=a==null?void 0:a.mode)!=null?s:"math",style:a==null?void 0:a.style,command:"\\placeholder"}),this.body=n,this.correctness=r,this.placeholderId=t,this.locked=i,this.captureSelection=this.locked}static fromJson(t){return new Oh(t.placeholderId,t.correctness,t.locked,t.body,t)}toJson(){const t=super.toJson();return this.placeholderId&&(t.placeholderId=this.placeholderId),this.body||delete t.body,this.body&&(t.body=this.body.filter(r=>r.type!=="first").map(r=>r.toJson())),this.correctness&&(t.correctness=this.correctness),t.locked=this.locked,t}render(t){const r=new $({parent:t}),i=r.getRegisterAsEm("fboxsep"),n=i,a=i,s=w.createBox(t,this.body);if(!s)return null;s.height||(s.height=r.metrics.xHeight),s.setStyle("vertical-align",-s.height,"em"),this.correctness==="correct"?s.setStyle("color","var(--correct-color, var(--ML__correct-color))"):this.correctness==="incorrect"&&s.setStyle("color","var(--incorrect-color, var(--ML__incorrect-color))");const o=new D(s,{type:"ord"});o.setStyle("display","inline-block"),o.setStyle("height",s.height+s.depth,"em"),o.setStyle("vertical-align",-a,"em");let l="ML__prompt ";this.locked?l+=" ML__lockedPromptBox ":l+=" ML__editablePromptBox ",this.correctness==="correct"?l+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(l+=" ML__incorrectPromptBox "),this.containsCaret&&(l+=" ML__focusedPromptBox ");const c=new D(null,{classes:l,attributes:{part:"prompt"}});c.height=o.height+a,c.depth=o.depth+a,c.width=o.width+2*n,c.setStyle("box-sizing","border-box"),c.setStyle("position","absolute"),c.setStyle("height",o.height+o.depth+2*a,"em"),n===0&&c.setStyle("width","100%"),n!==0&&(c.setStyle("width",`calc(100% + ${2*n}em)`),c.setStyle("top",i,"em"),c.setStyle("left",-n,"em")),(!this.body||this.body.length===1)&&(c.width=3*n,c.setStyle("width",`calc(100% + ${3*n}em)`),c.setStyle("left",-1.5*n,"em"));let u="";this.correctness==="incorrect"&&(u+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),u&&(c.svgOverlay=u);const d=new D([c,o],{classes:"ML__prompt-atom"});return d.setStyle("position","relative"),d.setStyle("display","inline-block"),d.setStyle("line-height",0),d.height=o.height+a+.2,d.depth=o.depth+a,d.left=n,d.right=n,d.setStyle("height",o.height+a,"em"),d.setStyle("top",o.depth-o.height,"em"),d.setStyle("vertical-align",o.depth+a,"em"),d.setStyle("margin-left",.5,"em"),d.setStyle("margin-right",.5,"em"),this.caret&&(d.caret=this.caret),this.bind(r,this.attachSupsub(t,{base:d}))}_serialize(t){var r;const i=(r=this.bodyToLatex(t))!=null?r:"";if(t.skipPlaceholders)return i;let n="\\placeholder";return this.placeholderId&&(n+=`[${this.placeholderId}]`),this.correctness==="correct"?n+="[correct]":this.correctness==="incorrect"&&(n+="[incorrect]"),this.locked&&(n+="[locked]"),_e(n,i)}},Os=class Ih extends w{constructor(t){super({type:"subsup",style:t==null?void 0:t.style}),this.subsupPlacement="auto"}static fromJson(t){const r=new Ih(t);for(const i of xn)t[i]&&r.setChildren(t[i],i);return r}render(t){var r;const i=new $({parent:t,isPhantom:!0}),n=this.leftSibling,a=(r=n.render(i))!=null?r:new D(null),s=new D(null);return s.height=a.height,s.depth=a.depth,this.attachSupsub(t,{base:s,isCharacterBox:n.isCharacterBox(),type:"ignore"})}_serialize(t){return this.supsubToLatex(t)}};function wn(e){return e?!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(e):!1}var td=class{constructor(e,t,r){this.errors=[],this.index=0,this.endCount=0;var i,n,a,s;r!=null||(r={}),this.tokens=e,this.context=t instanceof $&&!(r!=null&&r.parseMode)&&!r.mathstyle?t:new $({from:t,mathstyle:r.mathstyle},r.style),this.args=(i=r.args)!=null?i:void 0,this.smartFence=this.context.smartFence,this.parsingContext={parent:void 0,mathlist:[],style:(n=r.style)!=null?n:{},parseMode:(a=r.parseMode)!=null?a:"math",mathstyle:(s=r.mathstyle)!=null?s:"displaystyle",tabular:!1}}beginContext(e){var t,r,i;const n=this.parsingContext,a={parent:n,mathlist:[],style:p({},n.style),parseMode:(t=e==null?void 0:e.mode)!=null?t:n.parseMode,mathstyle:(r=e==null?void 0:e.mathstyle)!=null?r:n.mathstyle,tabular:(i=e==null?void 0:e.tabular)!=null?i:!1};this.parsingContext=a}endContext(){this.parsingContext=this.parsingContext.parent}onError(e){this.errors.push(p({before:Ii(this.tokens.slice(this.index,this.index+10)),after:Ii(this.tokens.slice(Math.max(0,this.index-10),this.index))},e))}get mathlist(){return this.parsingContext.mathlist}set mathlist(e){this.parsingContext.mathlist=e}get parseMode(){return this.parsingContext.parseMode}set parseMode(e){this.parsingContext.parseMode=e}get tabularMode(){return this.parsingContext.tabular}get style(){let e=this.parsingContext;for(;e;){if(e.style)return p({},e.style);e=e.parent}return{}}set style(e){this.parsingContext.style=e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}next(){this.index+=1}get(){return this.endCount=0,this.index<this.tokens.length?this.tokens[this.index++]:""}peek(){return this.tokens[this.index]}match(e){return this.tokens[this.index]===e?(this.index++,!0):!1}lastSubsupAtom(){let e;return this.mathlist.length>0&&(e=this.mathlist[this.mathlist.length-1],e.type==="subsup"||e.subsupPlacement!==void 0)||(e=new Os({style:this.style}),this.mathlist.push(e)),e}hasPattern(e){return e.test(this.tokens[this.index])}hasInfixCommand(){var e;const{index:t}=this;if(t<this.tokens.length&&this.tokens[t].startsWith("\\")){const r=Ve(this.tokens[t],this.parseMode);return!r||r.definitionType==="symbol"||r.ifMode&&!r.ifMode.includes(this.parseMode)?!1:(e=r.infix)!=null?e:!1}return!1}matchColumnSeparator(){return!this.tabularMode||this.peek()!=="&"?!1:(this.index++,!0)}matchRowSeparator(){if(!this.tabularMode)return!1;const e=this.peek();return e!=="\\\\"&&e!=="\\cr"&&e!=="\\tabularnewline"?!1:(this.index++,!0)}placeholder(){var e;const t=(e=this.args)==null?void 0:e.call(this,"?");return t?xt(t,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new ti({mode:this.parseMode,style:this.style})]}skipWhitespace(){for(;this.match("<space>"););}skipUntilToken(e){let t=this.tokens[this.index];for(;t&&t!==e;)t=this.tokens[++this.index];t===e&&this.index++}skipFiller(){for(;this.match("\\relax")||this.match("<space>"););}matchKeyword(e){const t=this.index;let r=this.end(),i="";for(;!r;){const a=this.get();wn(a)?(i+=a,r=this.end()||i.length>=e.length):r=!0}const n=e.toUpperCase()===i.toUpperCase();return n||(this.index=t),n}scanString(){let e="";for(;!this.end();){const t=this.peek();if(t==="]")return e;if(t==="<space>")e+=" ";else if(t.startsWith("\\"))this.onError({code:"unexpected-command-in-string"}),e+=t.substring(1);else if(wn(t))e+=t;else return e;this.next()}return e}scanBalancedString(){let e="",t=this.end(),r=1;for(;!t;){const i=this.get();i==="<space>"?e+=" ":i==="<{>"?(e+="{",r+=1):i==="<}>"?(r-=1,r>0?e+="}":this.index-=1):i==="<$>"?e+="$":i==="<$$>"?e+="$$":e+=i,t=r===0||this.end()}return e}scanLiteralGroup(){var e;if(!this.match("<{>"))return"";let t="",r=1;for(;r>0&&!this.end();){const i=this.get();i==="<}>"?(r-=1,r>0&&(t+="}")):i==="<{>"?(r+=1,t+="{"):(/\\[a-zA-Z]+$/.test(t)&&/^[a-zA-Z]/.test(i)&&(t+=" "),t+=(e={"<space>":" ","<$$>":"$$","<$>":"$"}[i])!=null?e:i)}return t}scanNumber(e=!0){var t,r;let i=!1,n=this.peek();for(;n==="<space>"||n==="+"||n==="-";)this.get(),n==="-"&&(i=!i),n=this.peek();e=!!e;let a=10,s=/\d/;if(this.match("'"))a=8,s=/[0-7]/,e=!0;else if(this.match('"'))a=16,s=/[\dA-F]/,e=!0;else if(this.match("x"))a=16,s=/[\dA-Fa-f]/,e=!0;else if(this.match("`"))return n=this.get(),n?n.length===2&&n.startsWith("\\")?{number:(i?-1:1)*((t=n.codePointAt(1))!=null?t:0),base:"alpha"}:{number:(i?-1:1)*((r=n.codePointAt(0))!=null?r:0),base:"alpha"}:null;let o="";for(;this.hasPattern(s);)o+=this.get();if(!e&&(this.match(".")||this.match(",")))for(o+=".";this.hasPattern(s);)o+=this.get();const l=e?Number.parseInt(o,a):Number.parseFloat(o);return Number.isNaN(l)?null:{number:i?-l:l,base:a===16?"hexadecimal":a===8?"octal":"decimal"}}scanRegister(){var e;const t=this.index,r=this.scanNumber(!1);if(this.skipWhitespace(),this.match("\\relax"))return r;let i=!1;if(r===null)for(;;){const a=this.peek();if(a==="-")i=!i;else if(a!=="+")break;this.next(),this.skipWhitespace()}if(this.match("\\global")){this.skipWhitespace();const a=this.get();return a.startsWith("\\")?r?{register:a,global:!0,factor:(i?-1:1)*r.number}:i?{register:a,global:!0,factor:-1}:{register:a,global:!0}:(this.index=t,null)}let n=this.get();return n!=null&&n.startsWith("\\")?(n=n.substring(1),this.context.registers[n]?!i||r!==null?{register:n,factor:(i?-1:1)*((e=r==null?void 0:r.number)!=null?e:1)}:{register:n}:(this.index=t,null)):(this.index=t,null)}scanValue(){const e=this.scanRegister();if(e)return e;const t=this.index,r=this.scanGlueOrDimen();if(r&&("unit"in r||"glue"in r&&"unit"in r.glue))return r;this.index=t;const i=this.scanNumber();if(i)return i;if(this.end()||!wn(this.peek()))return null;const n=this.scanString();return n.length>0?{string:n}:null}scanDimen(){const e=this.scanNumber(!1);if(e===null)return null;const t=e.number;this.skipWhitespace(),this.matchKeyword("true"),this.skipWhitespace();let r;return this.matchKeyword("pt")?r="pt":this.matchKeyword("mm")?r="mm":this.matchKeyword("cm")?r="cm":this.matchKeyword("ex")?r="ex":this.matchKeyword("px")?r="px":this.matchKeyword("em")?r="em":this.matchKeyword("bp")?r="bp":this.matchKeyword("dd")?r="dd":this.matchKeyword("pc")?r="pc":this.matchKeyword("in")?r="in":this.matchKeyword("mu")&&(r="mu"),r?{dimension:t,unit:r}:{dimension:t}}scanGlueOrDimen(){const e=this.scanDimen();if(e===null)return null;if(this.skipWhitespace(),this.match("\\relax"))return e;const t={glue:e};if(this.matchKeyword("plus")){const r=this.scanDimen();if(r)t.grow=r;else return t}if(this.skipWhitespace(),this.match("\\relax"))return t;if(this.skipWhitespace(),this.matchKeyword("minus")){const r=this.scanDimen();if(r)t.shrink=r;else return t}return!t.grow&&!t.shrink?e:t}scanColspec(){this.skipWhitespace();const e=[];for(;!this.end()&&!(this.peek()==="<}>"||this.peek()==="]");){const t=this.get();t==="c"||t==="r"||t==="l"?e.push({align:t}):t==="|"?e.push({separator:"solid"}):t===":"?e.push({separator:"dashed"}):t==="@"&&(this.match("<{>")&&(this.beginContext({mode:"math"}),e.push({gap:this.scan(r=>r==="<}>")}),this.endContext()),this.match("<}>")||this.onError({code:"unbalanced-braces"}))}return e}scanModeSet(){let e;if(this.match("\\(")&&(e="textstyle"),!e&&this.match("\\[")&&(e="displaystyle"),!e)return null;this.beginContext({mode:"math",mathstyle:e});const t=this.scan(r=>r===(e==="displaystyle"?"\\]":"\\)"));return this.match(e==="displaystyle"?"\\]":"\\)")||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),t}scanModeShift(){let e="";if(this.match("<$>")&&(e="<$>"),!e&&this.match("<$$>")&&(e="<$$>"),!e)return null;this.beginContext({mode:"math",mathstyle:"textstyle"});const t=this.scan(r=>r===e);return this.match(e)||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),t}scanEnvironment(){if(!this.match("\\begin"))return null;const e=this.scanArgument("string");if(!e)return null;const t=Ai(e);if(!t)return this.onError({code:"unknown-environment",arg:e}),null;const r=[];if(t.params)for(const o of t.params)if(o.isOptional)r.push(this.scanOptionalArgument(o.type));else{const l=this.scanArgument(o.type);l||this.onError({code:"missing-argument",arg:e}),r.push(l)}this.beginContext({tabular:t.tabular});const i=[],n=[];let a=[],s=!1;do if(this.end()&&(this.onError({code:"unbalanced-environment",arg:e}),s=!0),!s&&this.match("\\end")&&(this.scanArgument("string")!==e&&this.onError({code:"unbalanced-environment",arg:e}),s=!0),!s)if(this.matchColumnSeparator())a.push(this.mathlist),this.mathlist=[];else if(this.matchRowSeparator()){a.push(this.mathlist),this.mathlist=[];let o=null;this.skipWhitespace(),this.match("[")&&(o=this.scanDimen(),this.skipWhitespace(),this.match("]")),n.push(o!=null?o:{dimension:0}),i.push(a),a=[]}else this.mathlist.push(...this.scan(o=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(o)));while(!s);return a.push(this.mathlist),a.length>0&&i.push(a),this.endContext(),t.createAtom(e,i,n,r)}scanExpression(){const e=this.mathlist;if(this.mathlist=[],this.parseExpression()){const t=this.mathlist;return this.mathlist=e,t}return this.mathlist=e,null}scan(e){this.beginContext(),e||(e=s=>s==="<}>");let t="",r=null,i=[],n=null;for(;!this.end()&&!e(this.peek());)this.hasInfixCommand()&&!t?(t=this.get(),r=Ve(t,"math"),r&&(i=this.scanArguments(r)[1]),n=this.mathlist,this.mathlist=[]):this.parseExpression();let a;return t?(console.assert(!!r),i.unshift(this.mathlist),n&&i.unshift(n),a=[r.createAtom({command:t,args:i,style:this.style,mode:this.parseMode})]):a=this.mathlist,this.endContext(),a}scanGroup(){const e=this.index;if(!this.match("<{>"))return null;const t=this.scan(i=>i==="<}>");this.match("<}>")||this.onError({code:"unbalanced-braces"});const r=new G0(t,this.parseMode,this.style);return r.verbatimLatex=Ii(this.tokens.slice(e,this.index)),r}scanSmartFence(){if(this.skipWhitespace(),!this.match("("))return null;this.beginContext();let e=1;for(;!this.end()&&e!==0;)this.match("(")&&(e+=1),this.match(")")&&(e-=1),e!==0&&this.parseExpression();const t=new Le("",this.mathlist,{leftDelim:"(",rightDelim:e===0?")":"?"});return this.endContext(),t}scanDelim(){this.skipWhitespace();const e=this.peek();if(!e)return this.onError({code:"unexpected-end-of-string"}),null;if(!wn(e)&&!e.startsWith("\\"))return null;this.next();const t=Ve(e,"math");return t?t.definitionType==="function"&&t.ifMode&&!t.ifMode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:e}),null):t.definitionType==="symbol"&&(t.type==="mopen"||t.type==="mclose")||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:(this.onError({code:"unexpected-delimiter",arg:e}),null):(this.onError({code:"unknown-command",arg:e}),null)}scanLeftRight(){var e;if(this.match("\\right"))return this.onError({code:"unbalanced-braces"}),new Zi("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new Zi("\\mright");let t="\\right";if(!this.match("\\left")){if(!this.match("\\mleft"))return null;t="\\mright"}const r=this.scanDelim();if(!r)return this.onError({code:"unexpected-delimiter"}),new Zi(t==="\\right"?"\\left":"\\mleft");for(this.beginContext();!this.end()&&!this.match(t);)this.parseExpression();const i=this.mathlist;this.endContext();const n=(e=this.scanDelim())!=null?e:".";return new Le(t==="\\right"?"left...right":"mleft...mright",i,{leftDelim:r,rightDelim:n,style:this.style})}parseSupSub(){if(this.parseMode!=="math")return!1;let e=this.peek();if(e!=="^"&&e!=="_"&&e!=="'")return!1;const t=this.lastSubsupAtom();for(;e==="^"||e==="_"||e==="'";)this.match("'")?this.match("'")?t.addChild(new w({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):t.addChild(new w({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&t.addChildren(B(this.scanArgument("expression")),e==="_"?"subscript":"superscript"),e=this.peek();return!0}parseLimits(){if(this.parseMode!=="math")return!1;const e=this.match("\\limits"),t=!e&&this.match("\\nolimits"),r=!t&&!e&&this.match("\\displaylimits");if(!e&&!t&&!r)return!1;const i=this.mathlist.length>0?this.mathlist[this.mathlist.length-1]:null;return i===null?!1:(i.explicitSubsupPlacement=!0,e&&(i.subsupPlacement="over-under"),t&&(i.subsupPlacement="adjacent"),r&&(i.subsupPlacement="auto"),!0)}scanArguments(e){if(!(e!=null&&e.params))return[void 0,[]];let t;const r=[];let i=e.infix?2:0;for(;i<e.params.length;){const n=e.params[i];n.type==="rest"?r.push(this.scan(a=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline","\\right"].includes(a))):n.isOptional?r.push(this.scanOptionalArgument(n.type)):n.type.endsWith("*")?t=n.type.slice(0,-1):r.push(this.scanArgument(n.type)),i+=1}return[t,r]}scanSymbolOrLiteral(){const e=this.peek();if(!e)return null;this.next();let t;if(wn(e)){const r=Ut.createAtom(this.parseMode,e,p({},this.style));return r?[r]:null}if(t=this.scanMacro(e),t)return[t];if(e.startsWith("\\")){const r=Ve(e,this.parseMode);if(!r)return this.onError({code:"unknown-command",arg:e}),[new Zi(e)];if(r.definitionType==="symbol"){const i=p({},this.style);r.variant&&(i.variant=r.variant),t=new w({type:r.type,command:e,style:i,value:String.fromCodePoint(r.codepoint),mode:this.parseMode,verbatimLatex:e})}else{if(r.applyMode||r.applyStyle||r.infix)return this.onError({code:"invalid-command",arg:e}),[new Zi(e)];r.createAtom&&(t=r.createAtom({command:e,args:[],style:this.style,mode:this.parseMode}))}}return t?[t]:null}scanArgument(e){var t;this.skipFiller();const r=this.parseMode;if(e==="auto"&&(e=r),!this.match("<{>")){if(e==="string")return this.scanString();if(e==="value")return this.scanValue();if(e==="delim")return(t=this.scanDelim())!=null?t:".";if(e==="expression")return this.scanExpression();if(e==="math"){e!==r&&this.beginContext({mode:"math"});const n=this.scanSymbolOrLiteral();return e!==r&&this.endContext(),n}if(e==="text"){e!==r&&this.beginContext({mode:"text"});const n=this.scanSymbolOrLiteral();return e!==r&&this.endContext(),n}return e==="balanced-string"||console.assert(!1),null}if(e==="text"){this.beginContext({mode:"text"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const n=this.mathlist;return this.endContext(),{group:n}}if(e==="math"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const n=this.mathlist;return this.endContext(),{group:n}}let i=null;if(e==="expression"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const n=this.mathlist;return this.endContext(),{group:n}}return e==="string"?i=this.scanString():e==="balanced-string"?i=this.scanBalancedString():e==="colspec"?i=this.scanColspec():e==="value"&&(i=this.scanValue()),this.skipUntilToken("<}>"),i}scanOptionalArgument(e){if(e=e==="auto"?this.parseMode:e,this.skipFiller(),!this.match("["))return null;let t=null;for(;!this.end()&&!this.match("]");)if(e==="string")t=this.scanString();else if(e==="value")t=this.scanValue();else if(e==="colspec")t=this.scanColspec();else if(e==="bbox"){const r={},i=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const n of i){const a=n.match(/^\s*([\d.]+)\s*([a-z]{2})/);if(a)r.padding={dimension:parseInt(a[1]),unit:a[2]};else{const s=n.match(/^\s*border\s*:\s*(.*)/);s?r.border=s[1]:r.backgroundcolor={string:n}}}t=r}else e==="math"&&(this.beginContext({mode:"math"}),t=this.mathlist.concat(this.scan(r=>r==="]")),this.endContext());return t}scanSymbolOrCommand(e){var t,r,i;if(e==="\\placeholder"){const o=this.scanOptionalArgument("string"),l=this.scanOptionalArgument("math"),c=w.serialize(l,{defaultMode:"math"});let u=[],d;!d&&c==="correct"?d="correct":!d&&c==="incorrect"?d="incorrect":c!==""&&(u=l);const h=this.scanOptionalArgument("string")==="locked",f=this.scanArgument("auto");let m;return f&&Array.isArray(f)&&f.length>0?m=f:f&&typeof f=="object"&&"group"in f?m=f.group:m=u,o?[new ed(o,d,h,m!=null?m:u,{mode:this.parseMode,style:this.style})]:[new ti({mode:this.parseMode,style:this.style})]}if(e==="\\renewcommand"||e==="\\newcommand"||e==="\\providecommand"||e==="\\def"){const o=this.index,l=this.scanLiteralGroup()||this.next();if(!l)return null;if(this.context.registers[l.substring(1)]){const c=this.scanArgument("string");c!==null&&(this.context.registers[l.substring(1)]=c);const u=X([e,Ii(this.tokens.slice(o,this.index))]);return[new w({type:"text",value:"",verbatimLatex:u})]}}let n=this.scanMacro(e);if(n)return[n];const a=Ve(e,this.parseMode);if(!a)return this.parseMode==="text"?(/[a-zA-Z]/.test((t=this.peek())!=null?t:"")&&(e+=" "),[...e].map(o=>new w({type:"text",value:o,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:e}),[new Zi(e)]);const s=this.index;if(a.definitionType==="symbol"){const o=p({},this.style);a.variant&&(o.variant=a.variant),n=new w({type:a.type,command:e,style:o,value:String.fromCodePoint(a.codepoint),mode:this.parseMode})}else{if(a.ifMode&&!a.ifMode.includes(this.parseMode))return[];const o=this.parseMode;a.applyMode&&(this.parseMode=a.applyMode);let l,c=[];if(a.parse?c=a.parse(this):[l,c]=this.scanArguments(a),this.parseMode=o,a.applyMode&&!a.applyStyle&&!a.createAtom)return B(c[0]);if(a.infix)return this.onError({code:"too-many-infix-commands",arg:e}),null;if(typeof a.createAtom=="function")n=a.createAtom({command:e,args:c,style:this.style,mode:this.parseMode}),l&&(n.body=B(this.scanArgument(l)));else if(typeof a.applyStyle=="function"){const u=p(p({},this.style),a.applyStyle(e,c,this.context)),d=this.parseMode;if(a.applyMode&&(this.parseMode=a.applyMode),l){const h=this.style;this.style=u;const f=this.scanArgument(l);return this.style=h,this.parseMode=d,B(f)}this.style=u}else n=new w({type:"mord",command:(r=a.command)!=null?r:e,style:p({},this.style),value:e,mode:(i=a.applyMode)!=null?i:this.parseMode})}if(!n)return null;if(n instanceof w&&n.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(e)){const o=X([e,Ii(this.tokens.slice(s,this.index))]);o&&(n.verbatimLatex=o)}if(n.verbatimLatex===null&&(n.verbatimLatex=void 0),n.isFunction&&this.smartFence){const o=this.scanSmartFence();if(o)return[n,o]}return[n]}scanSymbolCommandOrLiteral(){const e=this.get();if(!e)return null;if(wn(e)){const t=Ut.createAtom(this.parseMode,e,p({},this.style));if(!t)return null;if(t.isFunction&&this.smartFence){const r=this.scanSmartFence();if(r)return[t,r]}return[t]}return e.startsWith("\\")?this.scanSymbolOrCommand(e):e==="<space>"?this.parseMode==="text"?[new da(" "," ",this.style)]:null:(e==="<}>"?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:e}),null)}scanMacro(e){var t;const r=this.context.getMacro(e);if(!r)return null;const i=this.index,n=r.args,a={"?":(t=this.args)==null?void 0:t.call(this,"?")};for(let s=1;s<=n;s++){let o=this.scanLiteralGroup();if(!o){const l=this.index;this.scanExpression(),o=Ii(this.tokens.slice(l,this.index))}a[s]=o}return new Q0(e,{expand:r.expand,captureSelection:r.captureSelection,args:i===this.index?null:Ii(this.tokens.slice(i,this.index)),style:this.parsingContext.style,body:xt(r.def,{context:this.context,parseMode:this.parseMode,args:s=>a[s],mathstyle:this.parsingContext.mathstyle,style:this.parsingContext.style})})}parseExpression(){var e,t,r,i;let n=(i=(r=(t=(e=this.scanEnvironment())!=null?e:this.scanModeShift())!=null?t:this.scanModeSet())!=null?r:this.scanGroup())!=null?i:this.scanLeftRight();if(n===null){if(this.parseSupSub()||this.parseLimits())return!0;n=this.scanSymbolCommandOrLiteral()}return n?(Array.isArray(n)?this.mathlist.push(...n):this.mathlist.push(n),!0):!1}};function xt(e,t){var r,i,n,a;const s=(r=t==null?void 0:t.args)!=null?r:void 0,o=new td(_s(e,s),t==null?void 0:t.context,{args:s,mathstyle:(i=t==null?void 0:t.mathstyle)!=null?i:"displaystyle",parseMode:(n=t==null?void 0:t.parseMode)!=null?n:"math",style:(a=t==null?void 0:t.style)!=null?a:{}}),l=[];for(;!o.end();)l.push(...o.scan(()=>!1));return l}function rd(e,t){var r;const i=new td(_s(e,null),t==null?void 0:t.context,{mathstyle:"displaystyle",parseMode:(r=t==null?void 0:t.parseMode)!=null?r:"math"});for(;!i.end();)i.scan();return i.errors}var id=class Rh extends w{constructor(t,r){super({type:"chem"},{command:t,mode:"math"});const i=we.go(E.go(r,t==="\\pu"?"pu":"ce"),!1);this.body=xt(i),this._verbatimLatex=t+"{"+r+"}",this.arg=r,this.captureSelection=!0}static fromJson(t){return new Rh(t.command,t.arg)}set verbatimLatex(t){}get verbatimLatex(){return this._verbatimLatex}toJson(){return g(p({},super.toJson()),{arg:this.arg})}render(t){const r=w.createBox(t,this.body,{type:"inner"});return this.caret&&(r.caret=this.caret),this.bind(t,r)}_serialize(t){return console.assert(this.verbatimLatex!==void 0),this.verbatimLatex}};M(["ce","pu"],"{chemformula:balanced-string}",{createAtom:e=>{var t;return new id(e.command,(t=e.args[0])!=null?t:"")}});var E={go:function(e,t){if(!e)return[];t===void 0&&(t="ce");var r="0",i={};i.parenthesisLevel=0,e=e.replace(/\n/g," "),e=e.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),e=e.replace(/[\u2026]/g,"...");for(var n,a=10,s=[];;){n!==e?(a=10,n=e):a--;var o=E.stateMachines[t],l=o.transitions[r]||o.transitions["*"];e:for(var c=0;c<l.length;c++){var u=E.patterns.match_(l[c].pattern,e);if(u){for(var d=l[c].task,h=0;h<d.action_.length;h++){var f;if(o.actions[d.action_[h].type_])f=o.actions[d.action_[h].type_](i,u.match_,d.action_[h].option);else if(E.actions[d.action_[h].type_])f=E.actions[d.action_[h].type_](i,u.match_,d.action_[h].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+d.action_[h].type_+")"];E.concatArray(s,f)}if(r=d.nextState||r,e.length>0){if(d.revisit||(e=u.remainder),!d.toContinue)break e}else return s}}if(a<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(e,t){if(t)if(Object.prototype.toString.call(t)==="[object Array]")for(var r=0;r<t.length;r++)e.push(t[r]);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.slice(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.slice(1),remainder:e.substr(t[0].length)}:null},"state of aggregation $":function(e){var t=E.patterns.findObserveGroups(e,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(t&&t.remainder.match(/^($|[\s,;\)\]\}])/))return t;var r=e.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return r?{match_:r[0],remainder:e.substr(r[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(e){return E.patterns.findObserveGroups(e,"^{","","","}")},"^($...$)":function(e){return E.patterns.findObserveGroups(e,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(e){return E.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(e){return E.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(e){return E.patterns.findObserveGroups(e,"_{","","","}")},"_($...$)":function(e){return E.patterns.findObserveGroups(e,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(e){return E.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(e){return E.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(e){return E.patterns.findObserveGroups(e,"","{","}","")},"{(...)}":function(e){return E.patterns.findObserveGroups(e,"{","","","}")},"$...$":function(e){return E.patterns.findObserveGroups(e,"","$","$","")},"${(...)}$":function(e){return E.patterns.findObserveGroups(e,"${","","","}$")},"$(...)$":function(e){return E.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 E.patterns.findObserveGroups(e,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(e){return E.patterns.findObserveGroups(e,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(e){return E.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(e){return E.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 E.patterns.findObserveGroups(e,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(e){return E.patterns.findObserveGroups(e,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(e){return E.patterns.findObserveGroups(e,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(e){return E.patterns.findObserveGroups(e,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(e){return E.patterns.findObserveGroups(e,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(e){return E.patterns.findObserveGroups(e,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(e){return E.patterns.findObserveGroups(e,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(e){return E.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 r=E.patterns.findObserveGroups(e,"","$","$","");return r&&(t=r.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,r,i,n,a,s,o,l,c){var u=function(v,S){if(typeof S=="string")return v.indexOf(S)!==0?null:S;var L=v.match(S);return L?L[0]:null},d=function(v,S,L){for(var C=0;S<v.length;){var z=v.charAt(S),I=u(v.substr(S),L);if(I!==null&&C===0)return{endMatchBegin:S,endMatchEnd:S+I.length};if(z==="{")C++;else if(z==="}"){if(C===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];C--}S++}return C>0,null},h=u(e,t);if(h===null||(e=e.substr(h.length),h=u(e,r),h===null))return null;var f=d(e,h.length,i||n);if(f===null)return null;var m=e.substring(0,i?f.endMatchEnd:f.endMatchBegin);if(a||s){var y=this.findObserveGroups(e.substr(f.endMatchEnd),a,s,o,l);if(y===null)return null;var A=[m,y.match_];return{match_:c?A.join(""):A,remainder:y.remainder}}else return{match_:m,remainder:e.substr(f.endMatchEnd)}},match_:function(e,t){var r=E.patterns.patterns[e];if(r===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+e+")"];if(typeof r=="function")return E.patterns.patterns[e](t);var i=t.match(r);if(i){var n;return i[2]?n=[i[1],i[2]]:i[1]?n=i[1]:n=i[0],{match_:n,remainder:t.substr(i[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,r){return{type_:r}},"insert+p1":function(e,t,r){return{type_:r,p1:t}},"insert+p1+p2":function(e,t,r){return{type_:r,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 E.go(t,"text")},"{text}":function(e,t){var r=["{"];return E.concatArray(r,E.go(t,"text")),r.push("}"),r},"tex-math":function(e,t){return E.go(t,"tex-math")},"tex-math tight":function(e,t){return E.go(t,"tex-math tight")},bond:function(e,t,r){return{type_:"bond",kind_:r||t}},"color0-output":function(e,t){return{type_:"color0",color:t[0]}},ce:function(e,t){return E.go(t)},"1/2":function(e,t){var r=[];t.match(/^[+\-]/)&&(r.push(t.substr(0,1)),t=t.substr(1));var i=t.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return i[1]=i[1].replace(/\$/g,""),r.push({type_:"frac",p1:i[1],p2:i[2]}),i[3]&&(i[3]=i[3].replace(/\$/g,""),r.push({type_:"tex-math",p1:i[3]})),r},"9,9":function(e,t){return E.go(t,"9,9")}},createTransitions:function(e){var t,r,i,n,a={};for(t in e)for(r in e[t])for(i=r.split("|"),e[t][r].stateArray=i,n=0;n<i.length;n++)a[i[n]]=[];for(t in e)for(r in e[t])for(i=e[t][r].stateArray||[],n=0;n<i.length;n++){var s=e[t][r];if(s.action_){s.action_=[].concat(s.action_);for(var o=0;o<s.action_.length;o++)typeof s.action_[o]=="string"&&(s.action_[o]={type_:s.action_[o]})}else s.action_=[];for(var l=t.split("|"),c=0;c<l.length;c++)if(i[n]==="*")for(var u in a)a[u].push({pattern:l[c],task:s});else a[i[n]].push({pattern:l[c],task:s})}return a},stateMachines:{}};E.stateMachines={ce:{transitions:E.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 r;if((e.d||"").match(/^[0-9]+$/)){var i=e.d;e.d=void 0,r=this.output(e),e.b=i}else r=this.output(e);return E.actions["o="](e,t),r},"d= kv":function(e,t){e.d=t,e.dType="kv"},"charge or bond":function(e,t){if(e.beginsWithBond){var r=[];return E.concatArray(r,this.output(e)),E.concatArray(r,E.actions.bond(e,t,"-")),r}else e.d=t},"- after o/d":function(e,t,r){var i=E.patterns.match_("orbital",e.o||""),n=E.patterns.match_("one lowercase greek letter $",e.o||""),a=E.patterns.match_("one lowercase latin letter $",e.o||""),s=E.patterns.match_("$one lowercase latin letter$ $",e.o||""),o=t==="-"&&(i&&i.remainder===""||n||a||s);o&&!e.a&&!e.b&&!e.p&&!e.d&&!e.q&&!i&&a&&(e.o="$"+e.o+"$");var l=[];return o?(E.concatArray(l,this.output(e)),l.push({type_:"hyphen"})):(i=E.patterns.match_("digits",e.d||""),r&&i&&i.remainder===""?(E.concatArray(l,E.actions["d="](e,t)),E.concatArray(l,this.output(e))):(E.concatArray(l,this.output(e)),E.concatArray(l,E.actions.bond(e,t,"-")))),l},"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:E.go(t,"o")}},comma:function(e,t){var r=t.replace(/\s*$/,""),i=r!==t;return i&&e.parenthesisLevel===0?{type_:"comma enumeration L",p1:r}:{type_:"comma enumeration M",p1:r}},output:function(e,t,r){var i;if(!e.r)i=[],!e.a&&!e.b&&!e.p&&!e.o&&!e.q&&!e.d&&!r||(e.sb&&i.push({type_:"entitySkip"}),!e.o&&!e.q&&!e.d&&!e.b&&!e.p&&r!==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"&&E.patterns.match_("d-oxidation$",e.d||"")?e.dType="oxidation":e.o&&e.dType==="kv"&&!e.q&&(e.dType=void 0),i.push({type_:"chemfive",a:E.go(e.a,"a"),b:E.go(e.b,"bd"),p:E.go(e.p,"pq"),o:E.go(e.o,"o"),q:E.go(e.q,"pq"),d:E.go(e.d,e.dType==="oxidation"?"oxidation":"bd"),dType:e.dType}));else{var n;e.rdt==="M"?n=E.go(e.rd,"tex-math"):e.rdt==="T"?n=[{type_:"text",p1:e.rd||""}]:n=E.go(e.rd);var a;e.rqt==="M"?a=E.go(e.rq,"tex-math"):e.rqt==="T"?a=[{type_:"text",p1:e.rq||""}]:a=E.go(e.rq),i={type_:"arrow",r:e.r,rd:n,rq:a}}for(var s in e)s!=="parenthesisLevel"&&s!=="beginsWithBond"&&delete e[s];return i},"oxidation-output":function(e,t){var r=["{"];return E.concatArray(r,E.go(t,"oxidation")),r.push("}"),r},"frac-output":function(e,t){return{type_:"frac-ce",p1:E.go(t[0]),p2:E.go(t[1])}},"overset-output":function(e,t){return{type_:"overset",p1:E.go(t[0]),p2:E.go(t[1])}},"underset-output":function(e,t){return{type_:"underset",p1:E.go(t[0]),p2:E.go(t[1])}},"underbrace-output":function(e,t){return{type_:"underbrace",p1:E.go(t[0]),p2:E.go(t[1])}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:E.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,r){return{type_:"operator",kind_:r||t}}}},a:{transitions:E.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:E.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:E.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 r in e)delete e[r];return t}}}},pq:{transitions:E.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:E.go(t,"o")}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:E.go(t[1],"pq")}}}},bd:{transitions:E.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:E.go(t[1],"bd")}}}},oxidation:{transitions:E.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:E.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 r in e)delete e[r];return t}}}},"tex-math tight":{transitions:E.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 r in e)delete e[r];return t}}}},"9,9":{transitions:E.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:E.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 r=[];return t[0]==="+-"||t[0]==="+/-"?r.push("\\pm "):t[0]&&r.push(t[0]),t[1]&&(E.concatArray(r,E.go(t[1],"pu-9,9")),t[2]&&(t[2].match(/[,.]/)?E.concatArray(r,E.go(t[2],"pu-9,9")):r.push(t[2])),(t[3]||t[4])&&(t[3]==="e"||t[4]==="*"?r.push({type_:"cdot"}):r.push({type_:"times"}))),t[5]&&r.push("10^{"+t[5]+"}"),r},"number^":function(e,t){var r=[];return t[0]==="+-"||t[0]==="+/-"?r.push("\\pm "):t[0]&&r.push(t[0]),E.concatArray(r,E.go(t[1],"pu-9,9")),r.push("^{"+t[2]+"}"),r},operator:function(e,t,r){return{type_:"operator",kind_:r||t}},space:function(){return{type_:"pu-space-1"}},output:function(e){var t,r=E.patterns.match_("{(...)}",e.d||"");r&&r.remainder===""&&(e.d=r.match_);var i=E.patterns.match_("{(...)}",e.q||"");if(i&&i.remainder===""&&(e.q=i.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 n={d:E.go(e.d,"pu"),q:E.go(e.q,"pu")};e.o==="//"?t={type_:"pu-frac",p1:n.d,p2:n.q}:(t=n.d,n.d.length>1||n.q.length>1?t.push({type_:" / "}):t.push({type_:"/"}),E.concatArray(t,n.q))}else t=E.go(e.d,"pu-2");for(var a in e)delete e[a];return t}}},"pu-2":{transitions:E.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 r=E.patterns.match_("{(...)}",e.rm||"");r&&r.remainder===""?t=E.go(r.match_,"pu"):t={type_:"rm",p1:e.rm}}for(var i in e)delete e[i];return t}}},"pu-9,9":{transitions:E.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 r=e.text_.length%3;r===0&&(r=3);for(var i=e.text_.length-3;i>0;i-=3)t.push(e.text_.substr(i,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(0,r)),t.reverse()}else t.push(e.text_);for(var n in e)delete e[n];return t},"output-o":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){for(var r=e.text_.length-3,i=0;i<r;i+=3)t.push(e.text_.substr(i,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(i))}else t.push(e.text_);for(var n in e)delete e[n];return t}}}};var we={go:function(e,t){if(!e)return"";for(var r="",i=!1,n=0;n<e.length;n++){var a=e[n];typeof a=="string"?r+=a:(r+=we._go2(a),a.type_==="1st-level escape"&&(i=!0))}return!t&&!i&&r&&(r="{"+r+"}"),r},_goInner:function(e){return e&&we.go(e,!0)},_go2:function(e){var t;switch(e.type_){case"chemfive":t="";var r={a:we._goInner(e.a),b:we._goInner(e.b),p:we._goInner(e.p),o:we._goInner(e.o),q:we._goInner(e.q),d:we._goInner(e.d)};r.a&&(r.a.match(/^[+\-]/)&&(r.a="{"+r.a+"}"),t+=r.a+"\\,"),(r.b||r.p)&&(t+="{\\vphantom{X}}",t+="^{\\hphantom{"+(r.b||"")+"}}_{\\hphantom{"+(r.p||"")+"}}",t+="{\\vphantom{X}}",t+="^{\\smash[t]{\\vphantom{2}}\\llap{"+(r.b||"")+"}}",t+="_{\\vphantom{2}\\llap{\\smash[t]{"+(r.p||"")+"}}}"),r.o&&(r.o.match(/^[+\-]/)&&(r.o="{"+r.o+"}"),t+=r.o),e.dType==="kv"?((r.d||r.q)&&(t+="{\\vphantom{X}}"),r.d&&(t+="^{"+r.d+"}"),r.q&&(t+="_{\\smash[t]{"+r.q+"}}")):e.dType==="oxidation"?(r.d&&(t+="{\\vphantom{X}}",t+="^{"+r.d+"}"),r.q&&(t+="{\\vphantom{X}}",t+="_{\\smash[t]{"+r.q+"}}")):(r.q&&(t+="{\\vphantom{X}}",t+="_{\\smash[t]{"+r.q+"}}"),r.d&&(t+="{\\vphantom{X}}",t+="^{"+r.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 "+we._goInner(e.p1);break;case"state of aggregation subscript":t="\\mskip1mu "+we._goInner(e.p1);break;case"bond":if(t=we._getBond(e.kind_),!t)throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+e.kind_+")"];break;case"frac":var i="\\frac{"+e.p1+"}{"+e.p2+"}";t="\\mathchoice{\\textstyle"+i+"}{"+i+"}{"+i+"}{"+i+"}";break;case"pu-frac":var n="\\frac{"+we._goInner(e.p1)+"}{"+we._goInner(e.p2)+"}";t="\\mathchoice{\\textstyle"+n+"}{"+n+"}{"+n+"}{"+n+"}";break;case"tex-math":t=e.p1+" ";break;case"frac-ce":t="\\frac{"+we._goInner(e.p1)+"}{"+we._goInner(e.p2)+"}";break;case"overset":t="\\overset{"+we._goInner(e.p1)+"}{"+we._goInner(e.p2)+"}";break;case"underset":t="\\underset{"+we._goInner(e.p1)+"}{"+we._goInner(e.p2)+"}";break;case"underbrace":t="\\underbrace{"+we._goInner(e.p1)+"}_{"+we._goInner(e.p2)+"}";break;case"color":t="{\\color{"+e.color1+"}{"+we._goInner(e.color2)+"}}";break;case"color0":t="\\color{"+e.color+"}";break;case"arrow":var a={rd:we._goInner(e.rd),rq:we._goInner(e.rq)},s=we._getArrow(e.r);a.rd||a.rq?e.r==="<=>"||e.r==="<=>>"||e.r==="<<=>"||e.r==="<-->"?(s="\\long"+s,a.rd&&(s="\\overset{"+a.rd+"}{"+s+"}"),a.rq&&(e.r==="<-->"?s="\\underset{\\lower2mu{"+a.rq+"}}{"+s+"}":s="\\underset{\\lower6mu{"+a.rq+"}}{"+s+"}"),s=" {}\\mathrel{"+s+"}{} "):(a.rq&&(s+="[{"+a.rq+"}]"),s+="{"+a.rd+"}",s=" {}\\mathrel{\\x"+s+"}{} "):s=" {}\\mathrel{\\long"+s+"}{} ",t=s;break;case"operator":t=we._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 \\bullet\\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"rightarrow";case"\u2192":return"rightarrow";case"\u27F6":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<-->":return"leftrightarrows";case"<=>":return"rightleftharpoons";case"\u21CC":return"rightleftharpoons";case"<=>>":return"Rightleftharpoons";case"<<=>":return"Leftrightharpoons";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"{\\rlap{\\lower.1em{-}}\\raise.1em{\\tripledash}}";case"~=":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"~--":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"-~-":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{-}}\\tripledash}";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."]}}};function Dg(e){}function Tg(e){}var nd=class qh extends w{constructor(t){super(g(p({},t),{type:"delim"})),this.value=t.delim,this.size=t.size}static fromJson(t){return new qh(t)}toJson(){return g(p({},super.toJson()),{delim:this.value,size:this.size})}render(t){return new D(this.value,{type:"middle"})}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Ve(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,t):_e(this.command,this.value)}},ad=class Vh extends w{constructor(t){super(g(p({},t),{type:"sizeddelim",value:t.delim})),this.delimType=t.delimType,this.size=t.size}static fromJson(t){return new Vh(t)}toJson(){return g(p({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(t){let r=Gf(this.value,this.size,t,{classes:{open:"mopen",close:"mclose"}[this.delimType],type:this.delimType,isSelected:this.isSelected});return r?(r=this.bind(t,r),this.caret&&(r.caret=this.caret),r):null}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Ve(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,t):_e(this.command,this.value)}},ma=class Hh extends w{constructor(t,r,i,n){var a,s;super({type:"enclose",command:t,style:n.style}),this.body=r,this.backgroundcolor=n.backgroundcolor,i.updiagonalarrow&&(i.updiagonalstrike=!1),i.box&&(i.left=!1,i.right=!1,i.bottom=!1,i.top=!1),this.notation=i,this.shadow=(a=n.shadow)!=null?a:"none",this.strokeWidth=(s=n.strokeWidth)!=null?s:"0.06em",this.strokeWidth||(this.strokeWidth="0.06em"),this.strokeStyle=n.strokeStyle,this.svgStrokeStyle=n.svgStrokeStyle,this.strokeColor=n.strokeColor,this.borderStyle=n.borderStyle,this.padding=n.padding,this.captureSelection=!1}static fromJson(t){return new Hh(t.command,t.body,t.notation,t)}toJson(){return g(p({},super.toJson()),{notation:this.notation,shadow:this.shadow,strokeWidth:this.strokeWidth,strokeStyle:this.strokeStyle,svgStrokeStyle:this.svgStrokeStyle,strokeColor:this.strokeColor,borderStyle:this.borderStyle,padding:this.padding})}_serialize(t){var r;if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const i=Ve(this.command,this.mode);if(i!=null&&i.serialize)return i.serialize(this,t);let n=(r=this.command)!=null?r:"";if(this.command==="\\enclose"){n+="{"+Object.keys(this.notation).join(" ")+"}";let a="",s="";this.backgroundcolor&&this.backgroundcolor!=="transparent"&&(a+=s+'mathbackground="'+this.backgroundcolor+'"',s=","),this.shadow&&this.shadow!=="auto"&&(a+=s+'shadow="'+this.shadow+'"',s=","),this.strokeWidth||this.strokeStyle!=="solid"?(a+=s+this.borderStyle,s=","):this.strokeColor&&this.strokeColor!=="currentColor"&&(a+=s+'mathcolor="'+this.strokeColor+'"',s=","),a&&(n+=`[${a}]`)}return _e(n,this.bodyToLatex(t))}render(t){const r=new $({parent:t},this.style),i=w.createBox(r,this.body);if(!i)return null;const n=up(this.borderStyle),a=r.toEm(!this.padding||this.padding==="auto"?{register:"fboxsep"}:{string:this.padding});i.setStyle("position","relative"),i.setStyle("display","inline-block"),i.setStyle("top",a,"em"),i.setStyle("height",i.height+i.depth,"em"),i.setStyle("width",i.width,"em");const s=new D(null,{classes:"ML__notation"});let o=i.height+i.depth+2*a;const l=i.width+2*a;let c="";if(this.notation.horizontalstrike&&(c+=this.line(3,50,97,50)),this.notation.verticalstrike&&(c+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(c+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(c+=this.line(3,3,97,97)),this.notation.updiagonalarrow){c+=this.line(a.toString(),(a+i.depth+i.height).toString(),(a+i.width).toString(),a.toString());const m=.03*Math.sqrt(l*l+o*o)*1,y=i.width*m,A=(i.depth+i.height)*m,v=a+i.width;let S=a;S+A-.4*y<0&&(S=.4*y-A),c+='<polygon points="',c+=`${v},${S} ${v-y-.4*A},${S+A-.4*y} `,c+=`${v-.7*y},${S+.7*A} ${v-y+.4*A},${S+A+.4*y} `,c+=`${v},${S}`,c+=`" stroke='none' fill="${this.strokeColor}"`,c+="/>"}let u=0;if(this.notation.phasorangle){const h=sd(r),f=(i.height+i.depth+2*h+a).toString(),m=(i.height+i.depth)/2;c+=this.line(a.toString(),f,(a+m+i.width).toString(),f),c+=this.line(a.toString(),f,(a+m).toString(),(a-h).toString()),o+=h,u=m,i.left+=o/2-a}if(this.notation.longdiv){const h=sd(r);o+=h,c+=this.line(a.toString(),a.toString(),(a+i.width).toString(),a.toString());const f=.3;u=f+h,i.left+=f+h,i.setTop(a+h),c+='<path d="',c+=`M ${a} ${a} a${f} ${(i.depth+i.height+2*h)/2}, 0, 1, 1, 0 ${i.depth+i.height+2*h} "`,c+=` stroke-width="${dp(r)}" stroke="${this.strokeColor}" fill="none"`,c+="/>"}if(s.width=i.width+2*a+u,s.height=i.height+a,s.depth=i.depth+a,s.setStyle("box-sizing","border-box"),s.setStyle("left",`calc(-${n} / 2 )`),s.setStyle("height",`${Math.floor(100*o)/100}em`),s.setStyle("top",`calc(${n} / 2 )`),this.backgroundcolor&&s.setStyle("background-color",this.backgroundcolor),this.notation.box&&s.setStyle("border","1px solid red"),this.notation.actuarial&&(s.setStyle("border-top",this.borderStyle),s.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(s.setStyle("border-bottom",this.borderStyle),s.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(s.setStyle("border-radius","8px"),s.setStyle("border",this.borderStyle)),this.notation.circle&&(s.setStyle("border-radius","50%"),s.setStyle("border",this.borderStyle)),this.notation.top&&s.setStyle("border-top",this.borderStyle),this.notation.left&&s.setStyle("border-left",this.borderStyle),this.notation.right&&s.setStyle("border-right",this.borderStyle),this.notation.bottom&&s.setStyle("border-bottom",this.borderStyle),c){let h="";this.shadow==="auto"&&(h+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(h+=`filter: drop-shadow(${this.shadow})`),h+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,h+=' stroke-linecap="round"',this.svgStrokeStyle&&(h+=` stroke-dasharray="${this.svgStrokeStyle}"`),s.svgStyle=h,s.svgOverlay=c}const d=new D([s,i]);return d.setStyle("position","relative"),d.setStyle("vertical-align",a,"em"),d.setStyle("height",`${Math.floor(100*(i.height+i.depth+2*a))/100}em`),d.setStyle("display","inline-block"),d.height=s.height,d.depth=s.depth,d.width=s.width-2*a,d.left=a,d.right=a,this.caret&&(d.caret=this.caret),d.wrap(r)}line(t,r,i,n){return`<line x1="${Is(t)}" y1="${Is(r)}" x2="${Is(i)}" y2="${Is(n)}" vector-effect="non-scaling-stroke"></line>`}};function Is(e){return typeof e=="number"?`${Math.floor(100*e)/100}%`:e}function up(e){if(!e)return"1px";const t=e.match(/([0-9][a-zA-Z\%]+)/);return t===null?"1px":t[1]}function dp(e){return(Math.floor(100*e.metrics.sqrtRuleThickness/e.scalingFactor)/100/10).toString()+"em"}function sd(e){const t=e.isDisplayStyle?mi:e.metrics.defaultRuleThickness;return e.metrics.defaultRuleThickness+e.scalingFactor*t/4}var kn=class jh extends w{constructor(t,r,i){var n,a;super(g(p({},i),{type:"genfrac",displayContainsHighlight:!0})),this.above=t,this.below=r,this.hasBarLine=(n=i==null?void 0:i.hasBarLine)!=null?n:!0,this.continuousFraction=(a=i==null?void 0:i.continuousFraction)!=null?a:!1,this.numerPrefix=i==null?void 0:i.numerPrefix,this.denomPrefix=i==null?void 0:i.denomPrefix,this.mathstyleName=i==null?void 0:i.mathstyleName,this.leftDelim=i==null?void 0:i.leftDelim,this.rightDelim=i==null?void 0:i.rightDelim,this.fractionNavigationOrder=i==null?void 0:i.fractionNavigationOrder}static fromJson(t){return new jh(t.above,t.below,t)}toJson(){const t={};return this.continuousFraction&&(t.continuousFraction=!0),this.numerPrefix&&(t.numerPrefix=this.numerPrefix),this.denomPrefix&&(t.denomPrefix=this.denomPrefix),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),this.hasBarLine||(t.hasBarLine=!1),this.mathstyleName&&(t.mathstyleName=this.mathstyleName),this.fractionNavigationOrder&&(t.fractionNavigationOrder=this.fractionNavigationOrder),p(p({},super.toJson()),t)}get children(){if(this._children)return this._children;const t=[];if(this.fractionNavigationOrder==="denominator-numerator"){for(const r of this.below)t.push(...r.children),t.push(r);for(const r of this.above)t.push(...r.children),t.push(r)}else{for(const r of this.above)t.push(...r.children),t.push(r);for(const r of this.below)t.push(...r.children),t.push(r)}return this._children=t,t}render(t){var r,i;const n=new $({parent:t,mathstyle:this.mathstyleName},this.style),a=n.metrics,s=new $({parent:n,mathstyle:this.continuousFraction?"":"numerator"},this.style),o=this.numerPrefix?new D([new D(this.numerPrefix),w.createBox(s,this.above)],{isTight:s.isTight,type:"ignore"}):(r=w.createBox(s,this.above,{type:"ignore"}))!=null?r:new D(null,{type:"ignore"}),l=new $({parent:n,mathstyle:this.continuousFraction?"":"denominator"},this.style),c=this.denomPrefix?new D([new D(this.denomPrefix),w.createBox(l,this.below,{type:"ignore"})]):(i=w.createBox(l,this.below,{type:"ignore"}))!=null?i:new D(null,{type:"ignore"}),u=this.hasBarLine?a.defaultRuleThickness:0;let d,h=0,f;n.isDisplayStyle?(d=s.metrics.num1,h=u>0?3*u:7*u,f=l.metrics.denom1):(u>0?(d=s.metrics.num2,h=u):(d=s.metrics.num3,h=3*a.defaultRuleThickness),f=l.metrics.denom2);const m=[];this.isSelected&&m.push("ML__selected");const y=o.depth,A=c.height;let v;if(u<=0){const O=d-y-(A-f);O<h&&(d+=(h-O)/2,f+=(h-O)/2),v=new je({individualShift:[{box:o,shift:-d,classes:[...m,"ML__center"]},{box:c,shift:f,classes:[...m,"ML__center"]}]}).wrap(n)}else{const O=new D(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});O.softWidth=Math.max(o.width,c.width),O.height=u/2,O.depth=u/2;const U=_r+u/2;d<h+y+U&&(d=h+y+U);const oe=_r-u/2;f<h+A-oe&&(f=h+A-oe),v=new je({individualShift:[{box:c,shift:f,classes:[...m,"ML__center"]},{box:O,shift:-oe,classes:m},{box:o,shift:-d,classes:[...m,"ML__center"]}]}).wrap(n)}const S=n.isDisplayStyle?a.delim1:a.delim2,L=this.leftDelim?this.bind(t,zs("open",this.leftDelim,S,!0,t,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Ui(n,"open");let C=null;this.continuousFraction?C=new D(null,{type:"close"}):this.rightDelim?C=this.bind(t,zs("close",this.rightDelim,S,!0,t,{style:this.style,mode:this.mode,isSelected:this.isSelected})):C=Ui(n,"close");const z=new D([L,v,C],{isTight:n.isTight,type:"inner",classes:"mfrac"}),I=this.bind(t,z);return this.caret&&(I.caret=this.caret),this.attachSupsub(t,{base:I})}},tt=class Wh extends w{constructor(t,r){var i;super({type:"latex",value:t,mode:"latex"}),this.isSuggestion=(i=r==null?void 0:r.isSuggestion)!=null?i:!1,this.isError=!1}static fromJson(t){const r=new Wh(t.value);return t.isSuggestion&&(r.isSuggestion=!0),t.isError&&(r.isError=!0),r}toJson(){const t={};return this.isSuggestion&&(t.isSuggestion=!0),this.isError&&(t.isError=!0),p({type:"latex",value:this.value},t)}get computedStyle(){return{}}render(t){const r=new D(this.value,{classes:this.isSuggestion?"ML__suggestion":this.isError?"ML__error":"",type:"latex",maxFontSize:1});return r?(this.caret&&(r.caret=this.caret),this.bind(t,r)):null}},ga=class Uh extends w{constructor(t){super({type:"latexgroup",mode:"latex"}),this.body=[...t].map(r=>new tt(r)),this.skipBoundary=!1}static fromJson(t){return new Uh("")}toJson(){return super.toJson()}render(t){const r=w.createBox(t,this.body);return r?(this.caret&&(r.caret=this.caret),this.bind(t,r)):null}_serialize(t){var r,i;return(i=(r=this.body)==null?void 0:r.map(n=>n.value).join(""))!=null?i:""}},ul=class Zh extends w{constructor(t,r){super(g(p({},r),{type:"extensible-symbol",isFunction:r==null?void 0:r.isFunction})),this.value=t,this.variant=r==null?void 0:r.variant,this.subsupPlacement=r==null?void 0:r.limits}static fromJson(t){return new Zh(t.symbol,t)}toJson(){const t=super.toJson();return this.variant&&(t.variant=this.variant),this.subsupPlacement&&(t.limits=this.subsupPlacement),this.isExtensibleSymbol&&(t.isExtensibleSymbol=!0),this.value&&(t.symbol=this.value),t}render(t){var r;const i=t.isDisplayStyle&&this.value!=="\\smallint",n=new D(this.value,{fontFamily:i?"Size2-Regular":"Size1-Regular",classes:"op-symbol "+(i?"large-op":"small-op"),type:"op",maxFontSize:t.scalingFactor,isSelected:this.isSelected});if(!n)return null;n.right=n.italic;const a=(n.height-n.depth)/2-_r*t.scalingFactor,s=n.italic;n.setTop(a);let o=n;if(this.superscript||this.subscript){const l=(r=this.subsupPlacement)!=null?r:"auto";o=l==="over-under"||l==="auto"&&t.isDisplayStyle?this.attachLimits(t,{base:n,baseShift:a,slant:s}):this.attachSupsub(t,{base:n})}return new D(this.bind(t,o),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(t)}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Ve(this.command,this.mode);if(r!=null&&r.serialize)return r.serialize(this,t);const i=[];return i.push(this.command),this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&i.push("\\limits"),this.subsupPlacement==="adjacent"&&i.push("\\nolimits"),this.subsupPlacement==="auto"&&i.push("\\displaylimits")),i.push(this.supsubToLatex(t)),X(i)}},Ji=class Jh extends w{constructor(t){const r=t.body;super(g(p({},t),{type:"overlap",body:typeof r=="string"?[new w({value:r})]:r,style:t==null?void 0:t.style})),this.skipBoundary=!0,this.align=t==null?void 0:t.align,this.boxType=t==null?void 0:t.boxType}static fromJson(t){return new Jh(t)}toJson(){const t={};return this.align&&(t.align=this.align),this.boxType&&(t.boxType=this.boxType),p(p({},super.toJson()),t)}render(t){const r=w.createBox(t,this.body,{classes:"inner"});return r?(this.caret&&(r.caret=this.caret),this.bind(t,new D([r,new D(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},or=class Xh extends w{constructor(t){var r,i,n,a;super({type:"overunder",command:t.command,style:t.style,mode:t.mode,body:t.body,skipBoundary:(r=t.skipBoundary)!=null?r:!0}),this.subsupPlacement=t.supsubPlacement,this.svgAbove=t.svgAbove,this.svgBelow=t.svgBelow,this.svgBody=t.svgBody,this.above=t.above,this.below=t.below,this.boxType=(i=t.boxType)!=null?i:"ord",this.paddedBody=(n=t.paddedBody)!=null?n:!1,this.paddedLabels=(a=t.paddedLabels)!=null?a:!1}static fromJson(t){return new Xh(t)}toJson(){const t=super.toJson();return this.skipBoundary||(t.skipBoundary=!1),this.subsupPlacement&&(t.subsupPlacement=this.subsupPlacement),this.svgAbove&&(t.svgAbove=this.svgAbove),this.svgBelow&&(t.svgBelow=this.svgBelow),this.svgBody&&(t.svgBody=this.svgBody),this.boxType!=="ord"&&(t.boxType=this.boxType),this.paddedBody&&(t.paddedBody=!0),this.paddedLabels&&(t.paddedLabels=!0),t}render(t){let r=this.svgBody?Ms(this.svgBody):w.createBox(t,this.body,{type:"ignore"});const i=new $({parent:t,mathstyle:"scriptstyle"},this.style);let n=null;this.svgAbove?n=Ms(this.svgAbove):this.above&&(n=w.createBox(i,this.above,{type:"ignore"}));let a=null;this.svgBelow?a=Ms(this.svgBelow):this.below&&(a=w.createBox(i,this.below,{type:"ignore"})),this.paddedBody&&(r=new D([Ui(t,"open"),r,Ui(t,"close")],{type:"ignore"}));let s=hp(t,{base:r,above:n,below:a,type:this.boxType==="bin"||this.boxType==="rel"?this.boxType:"ord",paddedAboveBelow:this.paddedLabels});return s?(this.subsupPlacement==="over-under"?s=this.attachLimits(t,{base:s,type:s.type}):s=this.attachSupsub(t,{base:s}),this.caret&&(s.caret=this.caret),this.bind(t,s)):null}};function hp(e,t){if(!t.base)return null;if(!t.above&&!t.below){const o=new D(t.base,{type:t.type});return o.setStyle("position","relative"),o}let r=0;t.above&&(r=e.metrics.bigOpSpacing5);let i=null;const n=t.base,a=0,s=["ML__center"];if(t.paddedAboveBelow&&s.push("ML__label_padding"),t.below&&t.above){const o=e.metrics.bigOpSpacing5+t.below.height+t.below.depth+n.depth+a;i=new je({bottom:o,children:[e.metrics.bigOpSpacing5,{box:t.below,classes:s},{box:n,classes:["ML__center"]},r,{box:t.above,classes:s},e.metrics.bigOpSpacing5]})}else t.below?i=new je({top:n.height-a,children:[e.metrics.bigOpSpacing5,{box:t.below,classes:s},{box:n,classes:["ML__center"]}]}):t.above&&(i=new je({bottom:n.depth+a,children:[{box:n,classes:["ML__center"]},r,{box:t.above,classes:s},e.metrics.bigOpSpacing5]}));return new D(i,{type:t.type})}var ba=class $h extends w{constructor(t){var r,i,n,a;super(g(p({},t),{type:"phantom"})),this.captureSelection=!0,this.isInvisible=(r=t.isInvisible)!=null?r:!1,this.smashDepth=(i=t.smashDepth)!=null?i:!1,this.smashHeight=(n=t.smashHeight)!=null?n:!1,this.smashWidth=(a=t.smashWidth)!=null?a:!1}static fromJson(t){return new $h(t)}toJson(){const t={};return this.isInvisible&&(t.isInvisible=!0),this.smashDepth&&(t.smashDepth=!0),this.smashHeight&&(t.smashHeight=!0),this.smashWidth&&(t.smashWidth=!0),p(p({},super.toJson()),t)}render(t){const r=new $({parent:t,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),w.createBox(r,this.body,{classes:"inner"});const i=w.createBox(this.isInvisible?r:t,this.body);if(!i)return null;if(this.smashWidth){const n=new D(null,{classes:"fix"});return new D([i,n],{classes:"rlap"}).wrap(t)}if(!this.smashHeight&&!this.smashDepth)return i;if(this.smashHeight&&(i.height=0),this.smashDepth&&(i.depth=0),i.children)for(const n of i.children)this.smashHeight&&(n.height=0),this.smashDepth&&(n.depth=0);return new je({firstBaseline:[{box:i}]},{type:i.type}).wrap(t)}},va=class Gh extends w{constructor(t){var r;super(p({type:"spacing"},t)),this.width=t==null?void 0:t.width,this._braced=(r=t==null?void 0:t.braced)!=null?r:!1}static fromJson(t){return new Gh(t)}toJson(){const t=super.toJson();return this.width!==void 0&&(t.width=this.width),this._braced&&(t.braced=!0),t}render(t){var r;if(this.command==="space")return new D(this.mode==="math"?null:" ");let i;if(this.width!==void 0)i=new D(null,{classes:"mspace"}),i.left=t.toEm(this.width);else{const n=(r={"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\>":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[this.command])!=null?r:"mediumspace";i=new D(null,{classes:n})}return i=this.bind(t,i),this.caret&&(i.caret=this.caret),i}_serialize(t){var r;if(!t.expandMacro&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const i=Ve(this.command,this.mode);if(i!=null&&i.serialize)return i.serialize(this,t);const n=(r=this.command)!=null?r:"";return this.width===void 0?n:this._braced&&!("register"in this.width)?`${n}{${ct(this.width)}}`:`${n}${ct(this.width)}`}},od=class Yh extends w{constructor(t){var r;super(g(p({},t),{type:"surd",mode:(r=t.mode)!=null?r:"math",style:t.style,displayContainsHighlight:!0,body:t.body})),this.above=t.index}static fromJson(t){return new Yh(g(p({},t),{index:t.above}))}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Ve(this.command,this.mode);if(r!=null&&r.serialize)return r.serialize(this,t);const i=this.command,n=this.bodyToLatex(t);return this.above&&!this.hasEmptyBranch("above")?_e(`${i}[${this.aboveToLatex(t)}]`,n):/^[0-9]$/.test(n)?`${i}${n}`:_e(i,n)}get children(){if(this._children)return this._children;const t=[];if(this.above)for(const r of this.above)t.push(...r.children),t.push(r);if(this.body)for(const r of this.body)t.push(...r.children),t.push(r);return this._children=t,t}render(t){var r;const i=new $({parent:t,mathstyle:"cramp"},this.style),n=(r=w.createBox(i,this.body,{type:"inner"}))!=null?r:new D(null),a=i.scalingFactor,s=i.metrics.defaultRuleThickness/a,o=t.isDisplayStyle?mi:s,l=new D(null,{classes:"ML__sqrt-line",style:this.style});l.height=s,l.softWidth=n.width;let c=a*(s+o/4);const d=Math.max(a*2*o,n.height+n.depth)+c+s,h=new $({parent:t},this.style),f=this.bind(h,new D(zs("inner","\\surd",d,!1,h,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!f)return null;const m=f.height+f.depth-s;m>n.height+n.depth+c&&(c=(c+m-(n.height+n.depth))/2),f.setTop(f.height-n.height-c);const y=this.bind(t,new je({firstBaseline:[{box:new D(n)},c-2*s,{box:l},s]})),A=w.createBox(new $({parent:t,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!A){const L=new D([f,y],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return L.setStyle("display","inline-block"),L.setStyle("height",L.height+L.depth,"em"),this.caret&&(L.caret=this.caret),this.bind(t,L)}const v=new je({shift:-.6*(Math.max(f.height,y.height)-Math.max(f.depth,y.depth)),children:[{box:A}]}),S=new D([new D(v,{classes:"ML__sqrt-index",type:"ignore"}),f,y],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return S.height=f.height,S.depth=f.depth,this.caret&&(S.caret=this.caret),this.bind(t,S)}},fp=class extends D{constructor(e){super(null,{type:"skip"}),this._width=e}toMarkup(){return`<span style="display:inline-block;width:${Math.ceil(this.width*100)/100}em"></span>`}};function Rs(e,t){if(!e.parent)return;const r=e.parent.children,i=r.indexOf(e);let n=i-1;for(;n>=0&&r[n].type==="ignore";)n-=1;if(n<0&&e.parent.parent&&e.parent.type==="lift"){Rs(e.parent,t);return}i>0&&r[i-1].type==="skip"?r[i-1].width+=t:r.splice(i,0,new fp(t))}var pp={ord:{op:3,bin:4,rel:5,inner:3},op:{ord:3,op:3,rel:5,inner:3},bin:{ord:4,op:4,open:4,inner:4},rel:{ord:5,op:5,open:5,inner:5},close:{op:3,bin:4,rel:5,inner:3},punct:{ord:3,op:3,rel:3,open:3,punct:3,inner:3},inner:{ord:3,op:3,bin:4,rel:5,open:3,punct:3,inner:3}},mp={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function gp(e){xa(e,(t,r)=>{r.type==="bin"&&(!t||/^(middle|bin|op|rel|open|punct)$/.test(t.type))&&(r.type="ord"),(t==null?void 0:t.type)==="bin"&&/^(rel|close|punct)$/.test(r.type)&&(t.type="ord"),r.type!=="ignore"&&(t=r)})}function ya(e,t){if(!e.children)return e;const r=e.children;gp(r);const i=t.getRegisterAsEm("thinmuskip"),n=t.getRegisterAsEm("medmuskip"),a=t.getRegisterAsEm("thickmuskip");return xa(r,(s,o)=>{var l,c,u;if(!s)return;const d=s.type,h=o.isTight?(l=mp[d])!=null?l:null:(c=pp[d])!=null?c:null,f=(u=h==null?void 0:h[o.type])!=null?u:null;f===3&&Rs(o,i),f===4&&Rs(o,n),f===5&&Rs(o,a)}),e}function xa(e,t,r=void 0){if(!e)return r;e=[...e];for(const i of e)i.type==="lift"?r=xa(i.children,t,r):i.type==="ignore"?xa(i.children,t):(t(r,i),xa(i.children,t),r=i);return r}var dl=class Qh extends w{constructor(t){super({type:"tooltip",command:t.command,mode:t.mode,style:t.style,body:t.body,displayContainsHighlight:!0}),this.tooltip=new w({type:"root",mode:t.content,body:t.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(t){return new Qh(g(p({},t),{tooltip:wi(t.tooltip)}))}toJson(){var t;const r=(t=this.tooltip.body)==null?void 0:t.filter(i=>i.type!=="first").map(i=>i.toJson());return g(p({},super.toJson()),{tooltip:r})}render(t){const r=w.createBox(new $,this.body);if(!r)return null;const i=new $({parent:t,mathstyle:"displaystyle"},{fontSize:Yo}),n=ws(ya(new D(this.tooltip.render(i),{classes:"ML__tooltip-content"}),i)),a=new D([n,r],{classes:"ML__tooltip-container"});return this.caret&&(a.caret=this.caret),this.bind(t,a)}},Xi=class ef extends w{constructor(t,r){super(g(p({},r),{type:"operator",isFunction:r==null?void 0:r.isFunction})),this.value=t,this.variant=r==null?void 0:r.variant,this.variantStyle=r==null?void 0:r.variantStyle,this.subsupPlacement=r==null?void 0:r.limits}static fromJson(t){return new ef(t.symbol,t)}toJson(){const t=super.toJson();return this.variant&&(t.variant=this.variant),this.variantStyle&&(t.variantStyle=this.variantStyle),this.subsupPlacement&&(t.limits=this.subsupPlacement),this.value&&(t.symbol=this.value),t}render(t){var r;const i=new D(this.value,{type:"op",mode:"math",maxFontSize:t.scalingFactor,style:{variant:this.variant,variantStyle:this.variantStyle},isSelected:this.isSelected,letterShapeStyle:t.letterShapeStyle});let n=i;if(this.superscript||this.subscript){const a=(r=this.subsupPlacement)!=null?r:"auto";n=a==="over-under"||a==="auto"&&t.isDisplayStyle?this.attachLimits(t,{base:i}):this.attachSupsub(t,{base:i})}return new D(this.bind(t,n),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(t)}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Ve(this.command,this.mode);if(r!=null&&r.serialize)return r.serialize(this,t);const i=[this.command];return this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&i.push("\\limits"),this.subsupPlacement==="adjacent"&&i.push("\\nolimits"),this.subsupPlacement==="auto"&&i.push("\\displaylimits")),i.push(this.supsubToLatex(t)),X(i)}};function wi(e){if(le(e))return e.map(i=>wi(i));if(typeof e=="string")return w.fromJson(e);e=p({},e);for(const i of xn)e[i]&&(e[i]=wi(e[i]));e.args&&(e.args=bp(e.args)),e.array&&(e.array=wi(e.array));const t=e.type;let r;t==="accent"&&(r=Ds.fromJson(e)),t==="array"&&(r=ae.fromJson(e)),t==="box"&&(r=_i.fromJson(e)),t==="chem"&&(r=id.fromJson(e)),t==="composition"&&(r=$0.fromJson(e)),t==="delim"&&(r=nd.fromJson(e)),t==="enclose"&&(r=ma.fromJson(e)),t==="error"&&(r=Zi.fromJson(e)),t==="extensible-symbol"&&(r=ul.fromJson(e)),t==="genfrac"&&(r=kn.fromJson(e)),t==="group"&&(r=G0.fromJson(e)),t==="latex"&&(r=tt.fromJson(e)),t==="latexgroup"&&(r=ga.fromJson(e)),t==="leftright"&&(r=Le.fromJson(e)),t==="macro"&&(r=Q0.fromJson(e)),t==="macro-argument"&&(r=cp.fromJson(e)),t==="operator"&&(r=Xi.fromJson(e)),t==="overlap"&&(r=Ji.fromJson(e)),t==="overunder"&&(r=or.fromJson(e)),t==="placeholder"&&(r=ti.fromJson(e)),t==="prompt"&&(r=ed.fromJson(e)),t==="phantom"&&(r=ba.fromJson(e)),t==="sizeddelim"&&(r=ad.fromJson(e)),t==="spacing"&&(r=va.fromJson(e)),t==="subsup"&&(r=Os.fromJson(e)),t==="surd"&&(r=od.fromJson(e)),t==="text"&&(r=da.fromJson(e)),t==="tooltip"&&(r=dl.fromJson(e)),r||(console.assert(!t||["first","mbin","mrel","mclose","minner","mop","mopen","mord","mpunct","root","space"].includes(t),`MathLive 0.98.5: an unexpected atom type "${t}" was encountered. Add new atom constructors to \`fromJson()\` in "atom.ts"`),r=w.fromJson(e));for(const i of xn)e[i]&&r.setChildren(e[i],i);return e.verbatimLatex!==void 0&&(r.verbatimLatex=e.verbatimLatex),e.subsupPlacement&&(r.subsupPlacement=e.subsupPlacement),e.explicitSubsupPlacement&&(r.explicitSubsupPlacement=!0),e.isFunction&&(r.isFunction=!0),e.isExtensibleSymbol&&(r.isExtensibleSymbol=!0),e.skipBoundary&&(r.skipBoundary=!0),e.captureSelection&&(r.captureSelection=!0),r}function bp(e){if(e&&Array.isArray(e))return e.map(t=>t==="<null>"?null:typeof t=="object"&&"group"in t?{group:t.group.map(r=>wi(r))}:typeof t=="object"&&"atoms"in t?t.atoms.map(r=>wi(r)):t)}var ld={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML__bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},hl={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[\dA-Z ]$/,fraktur:/^[\dA-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^]$/,monospace:/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/,"sans-serif":/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/},cd=/^[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5]$/,vp=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,yp=[/^[a-z]$/,/^[A-Z]$/,cd,vp],xp={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},_p=class extends Ut{constructor(){super("math")}createAtom(e,t,r){var i,n,a,s;if(t===null)return new w({type:"mord",mode:"math",command:e,value:e,style:r});const o=window.MathfieldElement.isFunction((i=t.command)!=null?i:e);if(t.definitionType==="symbol"){const c=new w({type:(n=t.type)!=null?n:"mord",mode:"math",command:(a=t.command)!=null?a:e,value:String.fromCodePoint(t.codepoint),style:r});return o&&(c.isFunction=!0),e.startsWith("\\")&&(c.verbatimLatex=e),c}const l=new w({type:"mord",mode:"math",command:(s=t.command)!=null?s:e,value:e,style:r});return o&&(l.isFunction=!0),e.startsWith("\\")&&(l.verbatimLatex=e),l}serialize(e,t){const r=wp(e,g(p({},t),{defaultMode:"math"}));return r.length===0||t.defaultMode!=="text"?r:["$ ",...r," $"]}getFont(e,t){console.assert(t.variant!==void 0);let{variant:r}=t,{variantStyle:i}=t;r==="normal"&&!i&&/[\u00A3\u0131\u0237]/.test(e.value)&&(r="main",i="italic"),r==="normal"&&!i&&e.value.length===1&&yp.forEach((o,l)=>{var c;o.test(e.value)&&xp[(c=t.letterShapeStyle)!=null?c:"tex"][l]==="it"&&(i="italic")}),i==="up"&&(i=void 0);const n=i?r+"-"+i:r;console.assert(ld[n]!==void 0);const[a,s]=ld[n];return hl[r]&&!hl[r].test(e.value)?(e.value=me(e.value,r,i),null):(cd.test(e.value)&&(e.classes+=" lcGreek"),s&&(e.classes+=" "+s),a)}};function wp(e,t){const{parent:r}=e[0],i=ud(r);return gi(e,"variant").map(n=>{const a=ud(n[0]);let s="";a&&a!==i&&(s={calligraphic:"\\mathcal",fraktur:"\\mathfrak","double-struck":"\\mathbb",script:"\\mathscr",monospace:"\\mathtt","sans-serif":"\\mathsf",normal:"\\mathrm","normal-italic":"\\mathnormal","normal-bold":"\\mathbf","normal-bolditalic":"\\mathbfit",ams:"","ams-italic":"\\mathit","ams-bold":"\\mathbf","ams-bolditalic":"\\mathbfit",main:"","main-italic":"\\mathit","main-bold":"\\mathbf","main-bolditalic":"\\mathbfit"}[a],console.assert(s!==void 0));const o=X(n.map(l=>l._serialize(t)));return s?_e(s,o):o})}function ud(e){if(!e)return"";const{style:t}=e;if(t.variant===void 0)return"";let r=t.variant;return!["calligraphic","fraktur","double-struck","script","monospace","sans-serif"].includes(t.variant)&&t.variantStyle&&t.variantStyle!=="up"&&(r+="-"+t.variantStyle),r}new _p;function kp(e,t){return e.map(r=>r._serialize(t))}function Mp(e,t){return gi(e,"fontShape").map(r=>{const i=kp(r,t),{fontShape:n}=r[0].style;let a="";return n==="it"&&(a="\\textit"),n==="sl"&&(a="\\textsl"),n==="sc"&&(a="\\textsc"),n==="n"&&(a="\\textup"),!a&&n?`{${_e("\\fontshape",n)}${X(i)}}`:a?_e(a,X(i)):X(i)})}function Sp(e,t){return gi(e,"fontSeries").map(r=>{const i=Mp(r,t),{fontSeries:n}=r[0].style;let a="";return n==="b"&&(a="\\textbf"),n==="l"&&(a="\\textlf"),n==="m"&&(a="\\textmd"),n&&!a?`{${_e("\\fontseries",n)}${X(i)}}`:a?_e(a,X(i)):X(i)})}function Cp(e,t){return gi(e,"fontSize").map(r=>{var i,n;const a=Sp(r,t),s=(n=["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][(i=r[0].style.fontSize)!=null?i:""])!=null?n:"";return s?`${s} ${X(a)}`:X(a)})}function Ep(e,t,r){return gi(e,"fontFamily").map(i=>{var n,a;const s=Cp(i,t),o=(a={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(n=i[0].style.fontFamily)!=null?n:""])!=null?a:"";return o?`\\${o}{${X(s)}}`:i[0].style.fontFamily?`{\\fontfamily{${i[0].style.fontFamily}} ${X(s)}}`:r?`\\text{${X(s)}}`:X(s)})}var dd={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},Ap=class extends Ut{constructor(){super("text")}createAtom(e,t,r){return t&&t.definitionType==="symbol"?new da(e,String.fromCodePoint(t.codepoint),r!=null?r:{}):null}serialize(e,t){return Ep(e,g(p({},t),{defaultMode:"text"}),t.defaultMode!=="text")}getFont(e,t){var r,i,n,a,s;const{fontFamily:o}=t;if(dd[o]?e.classes+=" "+dd[o]:o&&e.setStyle("font-family",o),t.fontShape&&(e.classes+=" ",e.classes+=(r={it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape])!=null?r:""),t.fontSeries){const l=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);l&&(e.classes+=" ",e.classes+=(n={ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[(i=l[1])!=null?i:""])!=null?n:"",e.classes+=" ",e.classes+=(s={uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[(a=l[2])!=null?a:""])!=null?s:"")}return"Main-Regular"}};new Ap;var Lp=class extends Ut{constructor(){super("latex")}createAtom(e){return new tt(e)}serialize(e,t){return e.filter(r=>r instanceof tt&&!r.isSuggestion).map(r=>r.value)}getFont(){return null}};new Lp;var Bp={id:"dvorak",locale:"en",displayName:"Dvorak",virtualLayout:"dvorak",platform:"",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["x","X","\u2248","\u02DB"],KeyC:["j","J","\u2206","\xD4"],KeyD:["e","E","\xB4","\xB4"],KeyE:[".",">","\u2265","\u02D8"],KeyF:["u","U","\xA8","\xA8"],KeyG:["i","I","\u02C6","\u02C6"],KeyH:["d","D","\u2202","\xCE"],KeyI:["c","C","\xE7","\xC7"],KeyJ:["h","H","\u02D9","\xD3"],KeyK:["t","T","\u2020","\u02C7"],KeyL:["n","N","\u02DC","\u02DC"],KeyM:["m","M","\xB5","\xC2"],KeyN:["b","B","\u222B","\u0131"],KeyO:["r","R","\xAE","\u2030"],KeyP:["l","L","\xAC","\xD2"],KeyQ:["'",'"',"\xE6","\xC6"],KeyR:["p","P","\u03C0","\u220F"],KeyS:["o","O","\xF8","\xD8"],KeyT:["y","Y","\xA5","\xC1"],KeyU:["g","G","\xA9","\u02DD"],KeyV:["k","K","\u02DA","\uF8FF"],KeyW:[",","<","\u2264","\xAF"],KeyX:["q","Q","\u0153","\u0152"],KeyY:["f","F","\u0192","\xCF"],KeyZ:[";",":","\u2026","\xDA"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["[","{","\u201C","\u201D"],Equal:["]","}","\u2018","\u2019"],BracketLeft:["/","?","\xF7","\xBF"],BracketRight:["=","+","\u2260","\xB1"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:["s","S","\xDF","\xCD"],Quote:["-","_","\u2013","\u2014"],Backquote:["`","~","`","`"],Comma:["w","W","\u2211","\u201E"],Period:["v","V","\u221A","\u25CA"],Slash:["z","Z","\u03A9","\xB8"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},fl={id:"apple.en-intl",displayName:"English (international)",virtualLayout:"qwerty",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u0131"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\xCE"],KeyE:["e","E","\xB4","\xB4"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\u02DD"],KeyH:["h","H","\u02D9","\xD3"],KeyI:["i","I","\u02C6","\u02C6"],KeyJ:["j","J","\u2206","\xD4"],KeyK:["k","K","\u02DA","\uF8FF"],KeyL:["l","L","\xAC","\xD2"],KeyM:["m","M","\xB5","\xC2"],KeyN:["n","N","\u02DC","\u02DC"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE","\u2030"],KeyS:["s","S","\xDF","\xCD"],KeyT:["t","T","\u2020","\u02C7"],KeyU:["u","U","\xA8","\xA8"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\u02DB"],KeyY:["y","Y","\xA5","\xC1"],KeyZ:["z","Z","\u03A9","\xB8"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["-","_","\u2013","\u2014"],Equal:["=","+","\u2260","\xB1"],BracketLeft:["[","{","\u201C","\u201D"],BracketRight:["]","}","\u2018","\u2019"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:[";",":","\u2026","\xDA"],Quote:["'",'"',"\xE6","\xC6"],Backquote:["`","\u02DC","`","`"],Comma:[",","<","\u2264","\xAF"],Period:[".",">","\u2265","\u02D8"],Slash:["/","?","\xF7","\xBF"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},hd={id:"windows.en-intl",displayName:"English (international)",platform:"windows",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","\xE1","\xC1"],KeyB:["b","B","",""],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\xE9","\xC9"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","\xED","\xCD"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","\xF8","\xD8"],KeyM:["m","M","\xB5",""],KeyN:["n","N","\xF1","\xD1"],KeyO:["o","O","\xF3","\xD3"],KeyP:["p","P","\xF6","\xD6"],KeyQ:["q","Q","\xE4","\xC4"],KeyR:["r","R","\xAE",""],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\xFE","\xDE"],KeyU:["u","U","\xFA","\xDA"],KeyV:["v","V","",""],KeyW:["w","W","\xE5","\xC5"],KeyX:["x","X","",""],KeyY:["y","Y","\xFC","\xDC"],KeyZ:["z","Z","\xE6","\xC6"],Digit1:["1","!","\xA1","\xB9"],Digit2:["2","@","\xB2",""],Digit3:["3","#","\xB3",""],Digit4:["4","$","\xA4","\xA3"],Digit5:["5","%","\u20AC",""],Digit6:["6","^","\xBC",""],Digit7:["7","&","\xBD",""],Digit8:["8","*","\xBE",""],Digit9:["9","(","\u2018",""],Digit0:["0",")","\u2019",""],Space:[" "," ","",""],Minus:["-","_","\xA5",""],Equal:["=","+","\xD7","\xF7"],BracketLeft:["[","{","\xAB",""],BracketRight:["]","}","\xBB",""],Backslash:["\\","|","\xAC","\xA6"],Semicolon:[";",":","\xB6","\xB0"],Quote:["'",'"',"\xB4","\xA8"],Backquote:["`","~","",""],Comma:[",","<","\xE7","\xC7"],Period:[".",">","",""],Slash:["/","?","\xBF",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}},fd={id:"linux.en",displayName:"English",platform:"linux",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},Dp={id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","\u2021","\u03A9"],KeyB:["b","B","\xDF","\u222B"],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\xEA","\xCA"],KeyF:["f","F","\u0192","\xB7"],KeyG:["g","G","\uFB01","\uFB02"],KeyH:["h","H","\xCC","\xCE"],KeyI:["i","I","\xEE","\xEF"],KeyJ:["j","J","\xCF","\xCD"],KeyK:["k","K","\xC8","\xCB"],KeyL:["l","L","\xAC","|"],KeyM:[",","?","\u221E","\xBF"],KeyN:["n","N","~","\u0131"],KeyO:["o","O","\u0153","\u0152"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xAE","\u201A"],KeyS:["s","S","\xD2","\u2211"],KeyT:["t","T","\u2020","\u2122"],KeyU:["u","U","\xBA","\xAA"],KeyV:["v","V","\u25CA","\u221A"],KeyW:["z","Z","\xC2","\xC5"],KeyX:["x","X","\u2248","\u2044"],KeyY:["y","Y","\xDA","\u0178"],KeyZ:["w","W","\u2039","\u203A"],Digit1:["&","1","\uF8FF","\xB4"],Digit2:["\xE9","2","\xEB","\u201E"],Digit3:['"',"3","\u201C","\u201D"],Digit4:["'","4","\u2018","\u2019"],Digit5:["(","5","{","["],Digit6:["\xA7","6","\xB6","\xE5"],Digit7:["\xE8","7","\xAB","\xBB"],Digit8:["!","8","\xA1","\xDB"],Digit9:["\xE7","9","\xC7","\xC1"],Digit0:["\xE0","0","\xF8","\xD8"],Space:[" "," "," "," "],Minus:[")","\xB0","}","]"],Equal:["-","_","\u2014","\u2013"],BracketLeft:["^","\xA8","\xF4","\xD4"],BracketRight:["$","*","\u20AC","\xA5"],Backslash:["`","\xA3","@","#"],Semicolon:["m","M","\xB5","\xD3"],Quote:["\xF9","%","\xD9","\u2030"],Backquote:["<",">","\u2264","\u2265"],Comma:[";",".","\u2026","\u2022"],Period:[":","/","\xF7","\\"],Slash:["=","+","\u2260","\xB1"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","\u2022","\u0178"],NumpadEqual:["=","=","=","="]}},Tp={id:"windows.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["\xE9","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["\xE8","7","`",""],Digit8:["_","8","\\",""],Digit9:["\xE7","9","^",""],Digit0:["\xE0","0","@",""],Space:[" "," ","",""],Minus:[")","\xB0","]",""],Equal:["=","+","}",""],BracketLeft:["^","\xA8","",""],BracketRight:["$","\xA3","\xA4",""],Backslash:["*","\xB5","",""],Semicolon:["m","M","",""],Quote:["\xF9","%","",""],Backquote:["\xB2","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","\xA7","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Fp={id:"linux.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"linux",score:0,mapping:{KeyA:["q","Q","@","\u03A9"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:[",","?","\u0301","\u030B"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["z","Z","\xAB","<"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["w","W","\u0142","\u0141"],Digit1:["&","1","\xB9","\xA1"],Digit2:["\xE9","2","~","\u215B"],Digit3:['"',"3","#","\xA3"],Digit4:["'","4","{","$"],Digit5:["(","5","[","\u215C"],Digit6:["-","6","|","\u215D"],Digit7:["\xE8","7","`","\u215E"],Digit8:["_","8","\\","\u2122"],Digit9:["\xE7","9","^","\xB1"],Digit0:["\xE0","0","@","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:[")","\xB0","]","\xBF"],Equal:["=","+","}","\u0328"],BracketLeft:["\u0302","\u0308","\u0308","\u030A"],BracketRight:["$","\xA3","\xA4","\u0304"],Backslash:["*","\xB5","\u0300","\u0306"],Semicolon:["m","M","\xB5","\xBA"],Quote:["\xF9","%","\u0302","\u030C"],Backquote:["\xB2","~","\xAC","\xAC"],Comma:[";",".","\u2500","\xD7"],Period:[":","/","\xB7","\xF7"],Slash:["!","\xA7","\u0323","\u0307"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"]}},Pp={id:"apple.german",locale:"de",displayName:"German",virtualLayout:"qwertz",platform:"apple",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u2039"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\u2122"],KeyE:["e","E","\u20AC","\u2030"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\xCC"],KeyH:["h","H","\xAA","\xD3"],KeyI:["i","I","\u2044","\xDB"],KeyJ:["j","J","\xBA","\u0131"],KeyK:["k","K","\u2206","\u02C6"],KeyL:["l","L","@","\uFB02"],KeyM:["m","M","\xB5","\u02D8"],KeyN:["n","N","~","\u203A"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\xAB","\xBB"],KeyR:["r","R","\xAE","\xB8"],KeyS:["s","S","\u201A","\xCD"],KeyT:["t","T","\u2020","\u02DD"],KeyU:["u","U","\xA8","\xC1"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\xD9"],KeyY:["z","Z","\u03A9","\u02C7"],KeyZ:["y","Y","\xA5","\u2021"],Digit1:["1","!","\xA1","\xAC"],Digit2:["2",'"',"\u201C","\u201D"],Digit3:["3","\xA7","\xB6","#"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","[","\uFB01"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","\u02DC"],Digit9:["9",")","}","\xB7"],Digit0:["0","=","\u2260","\xAF"],Space:[" "," "," "," "],Minus:["\xDF","?","\xBF","\u02D9"],Equal:["\xB4","`","'","\u02DA"],BracketLeft:["\xFC","\xDC","\u2022","\xB0"],BracketRight:["+","*","\xB1","\uF8FF"],Backslash:["#","'","\u2018","\u2019"],Semicolon:["\xF6","\xD6","\u0153","\u0152"],Quote:["\xE4","\xC4","\xE6","\xC6"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u221E","\u02DB"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","\xB0","\u201E","\u201C"],NumpadEqual:["=","=","=","="]}},zp={id:"windows.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","\xB5",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"\xB2",""],Digit3:["3","\xA7","\xB3",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["\xDF","?","\\","\u1E9E"],Equal:["\xB4","`","",""],BracketLeft:["\xFC","\xDC","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["\xF6","\xD6","",""],Quote:["\xE4","\xC4","",""],Backquote:["^","\xB0","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}},Kp={id:"linux.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201C","\u2018"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0323","\u0307"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","\u201D","\u2019"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\u017F","\u1E9E"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201E","\u201A"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xAB","\u2039"],KeyY:["z","Z","\u2190","\xA5"],KeyZ:["y","Y","\xBB","\u203A"],Digit1:["1","!","\xB9","\xA1"],Digit2:["2",'"',"\xB2","\u215B"],Digit3:["3","\xA7","\xB3","\xA3"],Digit4:["4","$","\xBC","\xA4"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["\xDF","?","\\","\xBF"],Equal:["\u0301","\u0300","\u0327","\u0328"],BracketLeft:["\xFC","\xDC","\u0308","\u030A"],BracketRight:["+","*","~","\xAF"],Backslash:["#","'","\u2019","\u0306"],Semicolon:["\xF6","\xD6","\u030B","\u0323"],Quote:["\xE4","\xC4","\u0302","\u030C"],Backquote:["\u0302","\xB0","\u2032","\u2033"],Comma:[",",";","\xB7","\xD7"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],PrintScreen:["","","",""],PageUp:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",",","",","],IntlBackslash:["<",">","|","\u0331"],AltRight:["\r","\r","\r","\r"],MetaRight:[".",".",".","."]}},Np={id:"apple.spanish",locale:"es",displayName:"Spanish ISO",platform:"apple",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\xDF",""],KeyC:["c","C","\xA9"," "],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0192","\uFB01"],KeyG:["g","G","\uF8FF","\uFB02"],KeyH:["h","H","\u2122"," "],KeyI:["i","I"," "," "],KeyJ:["j","J","\xB6","\xAF"],KeyK:["k","K","\xA7","\u02C7"],KeyL:["l","L"," ","\u02D8"],KeyM:["m","M","\xB5","\u02DA"],KeyN:["n","N"," ","\u02D9"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE"," "],KeyS:["s","S","\u222B"," "],KeyT:["t","T","\u2020","\u2021"],KeyU:["u","U"," "," "],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\xE6","\xC6"],KeyX:["x","X","\u2211","\u203A"],KeyY:["y","Y","\xA5"," "],KeyZ:["z","Z","\u03A9","\u2039"],Digit1:["1","!","|","\u0131"],Digit2:["2",'"',"@","\u02DD"],Digit3:["3","\xB7","#","\u2022"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","\u221E","\u2030"],Digit6:["6","&","\xAC"," "],Digit7:["7","/","\xF7","\u2044"],Digit8:["8","(","\u201C","\u2018"],Digit9:["9",")","\u201D","\u2019"],Digit0:["0","=","\u2260","\u2248"],Space:[" "," "," "," "],Minus:["'","?","\xB4","\xB8"],Equal:["\xA1","\xBF","\u201A","\u02DB"],BracketLeft:["`","^","[","\u02C6"],BracketRight:["+","*","]","\xB1"],Backslash:["\xE7","\xC7","}","\xBB"],Semicolon:["\xF1","\xD1","~","\u02DC"],Quote:["\xB4","\xA8","{","\xAB"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u201E",""],Period:[".",":","\u2026","\u2026"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[",",",",",",","],IntlBackslash:["\xBA","\xAA","\\","\xB0"]}},Op={id:"windows.spanish",locale:"es",displayName:"Spanish",platform:"windows",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["z","Z","",""],Digit1:["1","!","|",""],Digit2:["2",'"',"@",""],Digit3:["3","\xB7","#",""],Digit4:["4","$","~",""],Digit5:["5","%","\u20AC",""],Digit6:["6","&","\xAC",""],Digit7:["7","/","",""],Digit8:["8","(","",""],Digit9:["9",")","",""],Digit0:["0","=","",""],Space:[" "," ","",""],Minus:["'","?","",""],Equal:["\xA1","\xBF","",""],BracketLeft:["`","^","[",""],BracketRight:["+","*","]",""],Backslash:["\xE7","\xC7","}",""],Semicolon:["\xF1","\xD1","",""],Quote:["\xB4","\xA8","{",""],Backquote:["\xBA","\xAA","\\",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Ip={id:"linux.spanish",locale:"es",displayName:"Spanish",platform:"linux",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["z","Z","\xAB","<"],Digit1:["1","!","|","\xA1"],Digit2:["2",'"',"@","\u215B"],Digit3:["3","\xB7","#","\xA3"],Digit4:["4","$","~","$"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["'","?","\\","\xBF"],Equal:["\xA1","\xBF","\u0303","~"],BracketLeft:["\u0300","\u0302","[","\u030A"],BracketRight:["+","*","]","\u0304"],Backslash:["\xE7","\xC7","}","\u0306"],Semicolon:["\xF1","\xD1","~","\u030B"],Quote:["\u0301","\u0308","{","{"],Backquote:["\xBA","\xAA","\\","\\"],Comma:[",",";","\u2500","\xD7"],Period:[".",":","\xB7","\xF7"],Slash:["-","_","\u0323","\u0307"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadEnter:["\r","\r","\r","\r"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}};function pd(e){const t=e.split("+"),r={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:t.pop()};return t.includes("shift")&&(r.shift=!0),t.includes("alt")&&(r.alt=!0),t.includes("ctrl")&&(r.ctrl=!0),t.includes("cmd")&&(r.cmd=!0),t.includes("win")&&(r.win=!0),t.includes("meta")&&(r.meta=!0),r}function Mn(e){let t="";return e.shift&&(t+="shift+"),e.alt&&(t+="alt+"),e.ctrl&&(t+="ctrl+"),e.cmd&&(t+="cmd+"),e.win&&(t+="win+"),e.meta&&(t+="meta+"),t+e.key}var Rp={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},_a=[],wa;function pl(){switch(ut()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function Jt(e){(!e.platform||e.platform===pl())&&_a.push(e)}function qp(e,t){var r;const i={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:""};if(!e)return i;for(const[n,a]of Object.entries(t.mapping)){if(a[0]===e)return i.key=`[${n}]`,i;if(a[1]===e)return i.shift=!0,i.key=`[${n}]`,i;if(a[2]===e)return i.alt=!0,i.key=`[${n}]`,i;if(a[3]===e)return i.shift=!0,i.alt=!0,i.key=`[${n}]`,i}return i.key=(r=Rp[e])!=null?r:"",i}function Vp(e){if(e.code)return e;const t=Object.entries(ka().mapping);let r=!1,i=!1,n="";for(let a=0;a<4;a++){for(const[s,o]of t)if(o[a]===e.key){n=s,a===3?(r=!0,i=!0):a===2?r=!0:a===1&&(i=!0);break}if(n)break}return new KeyboardEvent(e.type,g(p({},e),{altKey:r,shiftKey:i,code:n}))}function Hp(e){var t,r;if(!e||e.key==="Unidentified"||e.key==="Dead")return;const i=e.shiftKey&&e.altKey?3:e.altKey?2:e.shiftKey?1:0;for(const n of _a)((t=n.mapping[e.code])==null?void 0:t[i])===e.key?n.score+=1:(r=n.mapping[e.code])!=null&&r[i]&&(n.score=0);_a.sort((n,a)=>a.score-n.score)}function jp(e){wa=_a.find(t=>e.startsWith(t.locale))}function ka(){return wa!=null?wa:_a[0]}function Wp(){switch(pl()){case"apple":return fl;case"windows":return hd;case"linux":return fd}return fl}switch(pl()){case"apple":Jt(fl),Jt(Dp),Jt(Np),Jt(Pp);break;case"windows":Jt(hd),Jt(Tp),Jt(Op),Jt(zp);break;case"linux":Jt(fd),Jt(Fp),Jt(Ip),Jt(Kp);break}Jt(Bp);function ml(e){var t;const r=/macos|ios/.test(ut()),i=e.split("+");let n="";for(const a of i)n&&(n+=r?"\u2009":'<span class="ML__shortcut-join">+</span>'),a.startsWith("[Key")?n+=a.slice(4,5):a.startsWith("Key")?n+=a.slice(3,4):a.startsWith("[Digit")?n+=a.slice(6,7):a.startsWith("Digit")?n+=a.slice(5,6):n+=(t={cmd:"\u2318",meta:r?"\u2318":"Ctrl",shift:r?"\u21E7":"Shift",alt:r?"\u2325":"Alt",ctrl:r?"\u2303":"Ctrl","\n":r?"\u23CE":"Return","[return]":r?"\u23CE":"Return","[enter]":r?"\u2324":"Enter","[tab]":r?"\u21E5":"Tab","[escape]":"Esc","[backspace]":r?"\u232B":"Backspace","[delete]":r?"\u2326":"Del","[pageup]":r?"\u21DE":"Page Up","[pagedown]":r?"\u21DF":"Page Down","[home]":r?"\u2912":"Home","[end]":r?"\u2913":"End","[space]":"Space","[equal]":"=","[minus]":"-","[comma]":",","[slash]":"/","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* &#128290;",numpaddivide:"/ &#128290;",numpadsubtract:"- &#128290;",numpadadd:"+ &#128290;",numpaddecimal:". &#128290;",numpadcomma:", &#128290;",help:"help",left:"\u21E0",up:"\u21E1",right:"\u21E2",down:"\u21E3","[arrowleft]":"\u21E0","[arrowup]":"\u21E1","[arrowright]":"\u21E2","[arrowdown]":"\u21E3"}[a.toLowerCase()])!=null?t:a.toUpperCase();return n}function qs(e){if(e instanceof MouseEvent||e instanceof PointerEvent)return{x:e.clientX,y:e.clientY};if(e instanceof TouchEvent){const t=[...e.touches].reduce((i,n)=>({x:i.x+n.clientX,y:i.y+n.clientY}),{x:0,y:0}),r=e.touches.length;return{x:t.x/r,y:t.y/r}}}function $i(e){const t={alt:!1,control:!1,shift:!1,meta:!1};return(e instanceof MouseEvent||e instanceof PointerEvent||e instanceof TouchEvent||e instanceof KeyboardEvent)&&(e.altKey&&(t.alt=!0),e.ctrlKey&&(t.control=!0),e.metaKey&&(t.meta=!0),e.shiftKey&&(t.shift=!0)),t}function Up(e,t){return!e&&t||e&&!t?!1:!e||!t?!0:e.alt===t.alt&&e.control===t.control&&e.shift===t.shift&&e.meta===t.meta}var Zp=new Set(["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"]);function Vs(e){return e.ctrlKey||e.metaKey||["Dead","Process"].includes(e.key)?!1:e.code===""?!0:Zp.has(e.code)}function Hs(){var e;let t=document.activeElement;for(;(e=t==null?void 0:t.shadowRoot)!=null&&e.activeElement;)t=t.shadowRoot.activeElement;return t}var Fr=class ai{static get scrim(){return ai._scrim||(ai._scrim=new ai),ai._scrim}static open(t){ai.scrim.open(t)}static close(){ai.scrim.close()}static get state(){return ai.scrim.state}static get element(){return ai.scrim.element}constructor(t){var r,i;this.lightDismiss=(r=t==null?void 0:t.lightDismiss)!=null?r:!0,this.translucent=(i=t==null?void 0:t.translucent)!=null?i:!1,this.state="closed"}get element(){if(this._element)return this._element;const t=document.createElement("div");return t.setAttribute("role","presentation"),t.style.position="fixed",t.style.contain="content",t.style.top="0",t.style.left="0",t.style.right="0",t.style.bottom="0",t.style.zIndex="var(--scrim-zindex, 10099)",t.style.outline="none",this.translucent?(t.style.background="rgba(255, 255, 255, .2)",t.style.backdropFilter="contrast(40%)"):t.style.background="transparent",this._element=t,t}open(t){var r;if(this.state!=="closed")return;this.state="opening",this.onDismiss=t==null?void 0:t.onDismiss,this.savedActiveElement=Hs();const{element:i}=this;((r=t==null?void 0:t.root)!=null?r:document.body).appendChild(i),i.addEventListener("click",this),document.addEventListener("touchmove",this,!1),document.addEventListener("scroll",this,!1);const n=window.innerWidth-document.documentElement.clientWidth;this.savedMarginRight=document.body.style.marginRight,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden";const a=Number.parseFloat(getComputedStyle(document.body).marginRight);document.body.style.marginRight=`${a+n}px`,t!=null&&t.child&&i.append(t.child),this.state="open"}close(){var t,r,i,n;if(this.state!=="open"){console.assert(this.element.parentElement!==null);return}this.state="closing",typeof this.onDismiss=="function"&&this.onDismiss(),this.onDismiss=void 0;const{element:a}=this;a.removeEventListener("click",this),document.removeEventListener("touchmove",this,!1),document.removeEventListener("scroll",this,!1),a.remove(),document.body.style.overflow=(t=this.savedOverflow)!=null?t:"",document.body.style.marginRight=(r=this.savedMarginRight)!=null?r:"",Hs()!==this.savedActiveElement&&((n=(i=this.savedActiveElement)==null?void 0:i.focus)==null||n.call(i)),a.innerHTML="",this.state="closed"}handleEvent(t){this.lightDismiss&&(t.target===this._element&&t.type==="click"?(this.close(),t.preventDefault(),t.stopPropagation()):t.target===document&&(t.type==="touchmove"||t.type==="scroll")&&(this.close(),t.preventDefault(),t.stopPropagation()))}};function Jp(e,t,r){let i=null,n=null,a=!1,s=!1,o=!1;const l=new AbortController,c=l.signal;return e.addEventListener("keydown",u=>{if(a||u.key==="Process"||u.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(u.code)){i=null;return}i=u,n=null,r.onKeystroke(u)?e.textContent="":i=null},{capture:!0,signal:c}),e.addEventListener("keypress",u=>{a||(i&&n&&r.onKeystroke(i),n=u)},{capture:!0,signal:c}),e.addEventListener("compositionstart",u=>{e.textContent="",a=!0,r.onCompositionStart(u.data)},{capture:!0,signal:c}),e.addEventListener("compositionupdate",u=>{a&&r.onCompositionUpdate(u.data)},{capture:!0,signal:c}),e.addEventListener("compositionend",u=>{e.textContent="",a&&(a=!1,r.onCompositionEnd(u.data))},{capture:!0,signal:c}),e.addEventListener("beforeinput",u=>u.stopImmediatePropagation(),{signal:c}),e.addEventListener("input",u=>{var d;if(!a&&(e.textContent="",u.inputType!=="insertCompositionText")){if(u.inputType==="insertFromPaste"){u.preventDefault(),u.stopPropagation();return}r.onInput((d=u.data)!=null?d:""),u.preventDefault(),u.stopPropagation()}},{signal:c}),e.addEventListener("paste",u=>{e.focus({preventScroll:!0}),e.textContent="",r.onPaste(u)||u.preventDefault(),u.stopImmediatePropagation()},{signal:c}),e.addEventListener("cut",u=>r.onCut(u),{capture:!0,signal:c}),e.addEventListener("copy",u=>r.onCopy(u),{capture:!0,signal:c}),e.addEventListener("blur",u=>{var d,h;if(((h=(d=u.relatedTarget)==null?void 0:d._mathfield)==null?void 0:h.element)===t){e.focus({preventScroll:!0}),u.preventDefault(),u.stopPropagation();return}const f=Fr.state;if(f==="open"||f==="opening"){u.preventDefault(),u.stopPropagation();return}if(u.relatedTarget===u.target.getRootNode().host){u.preventDefault(),u.stopPropagation();return}o||s||(o=!0,i=null,n=null,r.onBlur(),o=!1)},{capture:!0,signal:c}),e.addEventListener("focus",u=>{o||s||(s=!0,r.onFocus(),s=!1)},{capture:!0,signal:c}),{dispose:()=>l.abort(),cancelComposition:()=>{a&&(e.blur(),requestAnimationFrame(()=>e.focus({preventScroll:!0})))},blur:()=>{typeof e.blur=="function"&&e.blur()},focus:()=>{!s&&typeof e.focus=="function"&&e.focus({preventScroll:!0})},hasFocus:()=>Hs()===e,setAriaLabel:u=>e.setAttribute("aria-label",u),setValue:u=>{var d;e.textContent=u,e.style.left="-1000px",(d=window.getSelection())==null||d.selectAllChildren(e)},moveTo:(u,d)=>{e.style.top=`${d}px`,e.style.left=`${u}px`}}}function Sn(e){var t;if(!e||!Vs(e))return"";let r;return e.key==="Unidentified"&&e.target&&(r=e.target.value),r=(t=r!=null?r:e.key)!=null?t:e.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(r)&&(r=""),r}function md(e){e=Vp(e);const t=[];return e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),t.length===0?`[${e.code}]`:(t.push(`[${e.code}]`),t.join("+"))}function Xp(e){if(Me()){const t=ut(),r=e.startsWith("!"),i=e.endsWith(t);if(r&&!i||!r&&i)return!0}return e==="!other"?!1:e==="other"}function $p(e,t,r){if(e.length===0)return"";const i=Mn(pd(md(r))),n=Mn({key:r.key,shift:r.shiftKey,alt:r.altKey,ctrl:r.ctrlKey,meta:r.metaKey||r.ctrlKey&&/macos|ios/.test(ut()),cmd:!1,win:!1});for(let a=e.length-1;a>=0;a--)if((e[a].key===i||e[a].key===n)&&(!e[a].ifMode||e[a].ifMode===t))return e[a].command;return""}function gd(e){let t=e;return le(t)&&(t=t.length>0?t[0]+"("+t.slice(1).join("")+")":""),t}function Gp(e,t){let r=[];if(typeof t=="string"){const a=Kf[t];le(a)?r=a.slice():a&&r.push(a)}const i=gd(t),n=new RegExp("^"+i.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const a of e)n.test(gd(a.command))&&r.push(a.key);return r.map(ml)}function Yp(e,t){if(e.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(e.ifPlatform))throw new Error(`Unexpected platform "${e.ifPlatform}" for keybinding ${e.key}`);if(e.ifLayout!==void 0&&(t.score===0||!e.ifLayout.includes(t.id)))return;const r=pd(e.key);let i=e.ifPlatform;if(r.cmd){if(i&&i!=="macos"&&i!=="ios")throw new Error('Unexpected "cmd" modifier with platform "'+i+`"
"cmd" modifier can only be used with macOS or iOS platform.`);i||(i=ut()==="ios"?"ios":"macos"),r.win=!1,r.cmd=!1,r.meta=!0}if(r.win){if(i&&i!=="windows")throw new Error('Unexpected "win" modifier with platform "'+i+`"
"win" modifier can only be used with Windows platform.`);i="windows",r.win=!1,r.cmd=!1,r.meta=!0}if(i&&!Xp(i))return;if(/^\[.+\]$/.test(r.key))return g(p({},e),{key:Mn(r)});const n=qp(r.key,t);if(!n)return g(p({},e),{key:Mn(r)});if(n.shift&&r.shift||n.alt&&r.alt)throw new Error(`The keybinding ${e.key} (${gl(e.command)}) is conflicting with the key combination ${Mn(n)} using the ${t.displayName} keyboard layout`);return n.shift=n.shift||r.shift,n.alt=n.alt||r.alt,n.meta=r.meta,n.ctrl=r.ctrl,g(p({},e),{key:Mn(n)})}function gl(e){if(Array.isArray(e)){const t=[...e];return t.shift()+"("+t.map(r=>typeof r=="string"?`"${r}"`:r.toString()).join(", ")+")"}return e}function Qp(e,t){const r=[],i=[];for(const n of e)try{const a=Yp(n,t);if(!a)continue;const s=i.find(o=>o.key===a.key&&o.ifMode===a.ifMode);if(s)throw new Error(`Ambiguous key binding ${n.key} (${gl(n.command)}) matches ${s.key} (${gl(s.command)}) with the ${t.displayName} keyboard layout`);i.push(a)}catch(a){a instanceof Error&&r.push(a.message)}return[i,r]}var em=class extends be{constructor(){super("latex")}createAtom(e){return new tt(e)}onPaste(e,t){if(!t)return!1;const r=typeof t=="string"?t:t.getData("application/x-latex")||t.getData("text/plain");return r&&e.model.contentWillChange({inputType:"insertFromPaste",data:r})?(e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,r)&&(e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),Be(e)),e.startRecording(),!0):!1}insert(e,t,r){if(!e.contentWillChange({data:t,inputType:"insertText"}))return!1;r||(r={}),r.insertionMode||(r.insertionMode="replaceSelection"),r.selectionMode||(r.selectionMode="placeholder");const{silenceNotifications:i}=e;r.silenceNotifications&&(e.silenceNotifications=!0);const n=e.silenceNotifications;e.silenceNotifications=!0,r.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(pt(e.selection)):r.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):r.insertionMode==="insertBefore"?e.collapseSelection("backward"):r.insertionMode==="insertAfter"&&e.collapseSelection("forward");const a=[];for(const l of t)xe.test(l)&&a.push(new tt(l));let s=e.at(e.position);if(s instanceof ga&&(s=s.lastChild),!(s.parent instanceof ga)){const l=new ga("");s.parent.addChildAfter(l,s),s=l.firstChild}const o=s.parent.addChildrenAfter(a,s);return e.silenceNotifications=n,r.selectionMode==="before"||(r.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(o)):o&&(e.position=e.offsetOf(o))),e.contentDidChange({data:t,inputType:"insertText"}),e.silenceNotifications=i,!0}};function tm(e){return e.atoms.find(t=>t.type==="latexgroup")}function Ma(e){var t,r;const i=e.atoms.find(n=>n.type==="latexgroup");return i?(r=(t=i.body)==null?void 0:t.filter(n=>n.type==="latex"))!=null?r:[]:[]}function bd(e,t){var r;let i=0,n=!1;const a=Number.isFinite(t==null?void 0:t.before)?(r=t==null?void 0:t.before)!=null?r:0:e.lastOffset;for(;i<=a&&!n;){const l=e.at(i);n=l instanceof tt&&l.isSuggestion,n||i++}if(!n)return[void 0,void 0];let s=i,o=!1;for(;s<=a&&!o;){const l=e.at(s);o=!(l instanceof tt&&l.isSuggestion),o||s++}return[i-1,s-1]}new em;function js(e){const t=Ma(e.model).filter(r=>r.isSuggestion);if(t.length!==0){e.model.position=e.model.offsetOf(t[0].leftSibling);for(const r of t)r.parent.removeChild(r)}}function Sa(e,t){var r;const{model:i}=e;js(e);for(const u of Ma(i))u.isError=!1;if(!i.selectionIsCollapsed||e.options.popoverPolicy==="off"){En(e);return}const n=[];let a=i.at(i.position);for(;a&&a instanceof tt&&/^[a-zA-Z\*]$/.test(a.value);)a=a.leftSibling;if(a&&a instanceof tt&&a.value==="\\")for(n.push(a),a=a.rightSibling;a&&a instanceof tt&&/^[a-zA-Z\*]$/.test(a.value);)n.push(a),a=a.rightSibling;const s=n.map(u=>u.value).join(""),o=Li(e,s);if(o.length===0){if(/^\\[a-zA-Z\*]+$/.test(s))for(const u of n)u.isError=!0;En(e);return}const l=(r=t==null?void 0:t.atIndex)!=null?r:0;e.suggestionIndex=l<0?o.length-1:l%o.length;const c=o[e.suggestionIndex];if(c!==s){const u=n[n.length-1];u.parent.addChildrenAfter([...c.slice(s.length-c.length)].map(d=>new tt(d,{isSuggestion:!0})),u),Gi(e,{interactive:!0})}im(e,o)}function vd(e){const[t,r]=bd(e,{before:e.position});if(t===void 0||r===void 0)return!1;let i=!1;return e.getAtoms([t,r]).forEach(n=>{n.isSuggestion&&(n.isSuggestion=!1,i=!0)}),i}function Cn(e,t="accept",r){var i,n;En(e);const a=tm(e.model);if(!a)return!1;if(t==="accept-suggestion"||t==="accept-all"){const c=Ma(e.model).filter(u=>u.isSuggestion);if(c.length!==0){for(const u of c)u.isSuggestion=!1;e.model.position=e.model.offsetOf(c[c.length-1])}if(t==="accept-suggestion")return c.length!==0}const o=Ma(e.model).filter(c=>!c.isSuggestion).map(c=>c.value).join(""),l=a.leftSibling;return a.parent.removeChild(a),e.model.position=e.model.offsetOf(l),e.switchMode((i=r==null?void 0:r.mode)!=null?i:"math"),t==="reject"||(be.insert(e.model,o,{selectionMode:(n=r==null?void 0:r.selectItem)!=null&&n?"item":"placeholder",format:"latex",mode:"math"}),e.snapshot(),e.model.announce("replacement"),e.switchMode("math")),!0}function Ws(e){var t;let r=document.getElementById(e);return r?r.dataset.refcount=Number(Number.parseInt((t=r.dataset.refcount)!=null?t:"0")+1).toString():(r=document.createElement("div"),r.setAttribute("aria-hidden","true"),r.dataset.refcount="1",r.id=e,document.body.append(r)),r}function bl(e){var t;const r=document.getElementById(e);if(!r)return;const i=Number.parseInt((t=r.getAttribute("data-refcount"))!=null?t:"0");i<=1?r.remove():r.dataset.refcount=Number(i-1).toString()}function rm(e,t){const r=new $({from:e.context}),i=new w({mode:"math",type:"root",body:xt(t,{context:r})}),n=ws(ya(new D(i.render(r),{classes:"ML__base"}),r));return ks(n,{classes:"ML__latex"}).toMarkup()}function im(e,t){var r;if(t.length===0){En(e);return}let i="";for(const[a,s]of t.entries()){const o=s,l=rm(e,s),c=Gp(e.keybindings,o).join("<br>");i+=`<li role="button" data-command="${o}" ${a===e.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${o}</span><span class="ML__popover__command">${l}</span>`,c&&(i+=`<span class="ML__popover__keybinding">${c}</span>`),i+="</li>"}const n=nm(e,`<ul>${i}</ul>`);vl()&&((r=n.querySelector(".ML__popover__current"))==null||r.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var a;n&&!vl()&&(n.classList.add("is-visible"),Us(e),(a=n.querySelector(".ML__popover__current"))==null||a.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function vl(){const e=document.getElementById("mathlive-suggestion-popover");return e?e.classList.contains("is-visible"):!1}function Us(e,t){var r;if(!e.element||e.element.mathfield!==e||!vl())return;if(((r=e.model.at(e.model.position))==null?void 0:r.type)!=="latex"){En(e);return}if(t!=null&&t.deferred){setTimeout(()=>Us(e),32);return}const i=ha(e.field);if(!i)return;const n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,a=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,s=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,l=window.mathVirtualKeyboard.boundingRect.height,c=document.getElementById("mathlive-suggestion-popover");i.x+c.offsetWidth/2>a-s?c.style.left=`${a-c.offsetWidth-s}px`:i.x-c.offsetWidth/2<0?c.style.left="0":c.style.left=`${i.x-c.offsetWidth/2}px`;const u=i.y-i.height;n-o-l-i.y<u?(c.classList.add("ML__popover--reverse-direction"),c.classList.remove("top-tip"),c.classList.add("bottom-tip"),c.style.top=`${i.y-i.height-c.offsetHeight-15}px`):(c.classList.remove("ML__popover--reverse-direction"),c.classList.add("top-tip"),c.classList.remove("bottom-tip"),c.style.top=`${i.y+15}px`)}function En(e){e.suggestionIndex=0;const t=document.getElementById("mathlive-suggestion-popover");t&&(t.classList.remove("is-visible"),t.innerHTML="")}function nm(e,t){let r=document.getElementById("mathlive-suggestion-popover");return r||(r=Ws("mathlive-suggestion-popover"),ei("suggestion-popover"),ei("core"),r.addEventListener("pointerdown",i=>i.preventDefault()),r.addEventListener("click",i=>{let n=i.target;for(;n&&!n.dataset.command;)n=n.parentElement;n&&(Cn(e,"reject"),be.insert(e.model,n.dataset.command,{selectionMode:"placeholder",format:"latex",mode:"math"}),e.dirty=!0,e.focus())})),r.innerHTML=window.MathfieldElement.createHTML(t),r}function am(){document.getElementById("mathlive-suggestion-popover")&&(bl("mathlive-suggestion-popover"),xi("suggestion-popover"),xi("core"))}function sm(){const e=String(new Error().stack).replace(/^Error.*\n/,"").split(`
`);if(e.length===0)return console.error(`Can't use relative paths to specify assets location because the sourcefile location could not be determined (unexpected stack trace format "${new Error().stack}").`),"";let t=e[1],r=t.match(/http.*\.ts[\?:]/);return r&&(t=e[2]),r=t.match(/(https?:.*):[0-9]+:[0-9]+/),r||(r=t.match(/at (.*(\.ts))[\?:]/),r||(r=t.match(/at (.*(\.mjs|\.js))[\?:]/))),r?r[1]:(console.error(e),console.error(`Can't use relative paths to specify assets location because the source file location could not be determined (unexpected location "${t}").`),"")}var Zs=null,yd,xd,yl=((xd=(yd=globalThis==null?void 0:globalThis.document)==null?void 0:yd.currentScript)==null?void 0:xd.src)||sm();function _d(e){return Ei(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(e))return new URL(e).href;if(Zs===null)try{const t=yield fetch(yl,{method:"HEAD"});t.status===200&&(Zs=t.url)}catch(t){console.error(`Invalid URL "${e}" (relative to "${yl}")`)}return new URL(e,Zs!=null?Zs:yl).href})}function om(e,t,r={}){return new FontFace(e,`url(${t}.woff2) format('woff2')`,r)}var Xt="not-loaded";function lm(){return Ei(this,null,function*(){return Xt="not-loaded",Js()})}function Js(){return Ei(this,null,function*(){var e;if(Xt!=="not-loaded")return;if(Xt="loading",(e=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?e:!1){Xt="ready";return}if(document.body.classList.remove("ML__fonts-did-not-load"),"fonts"in document){const r=["KaTeX_Main","KaTeX_Math","KaTeX_AMS","KaTeX_Caligraphic","KaTeX_Fraktur","KaTeX_SansSerif","KaTeX_Script","KaTeX_Typewriter","KaTeX_Size1","KaTeX_Size2","KaTeX_Size3","KaTeX_Size4"],i=Array.from(document.fonts).map(s=>s.family);if(r.every(s=>i.includes(s))){Xt="ready";return}if(!window.MathfieldElement.fontsDirectory){Xt="not-loaded";return}const n=yield _d(window.MathfieldElement.fontsDirectory);if(!n){document.body.classList.add("ML__fonts-did-not-load"),Xt="error";return}const a=[["KaTeX_Main-Regular"],["KaTeX_Main-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_Main-Bold",{weight:"bold"}],["KaTeX_Main-Italic",{style:"italic"}],["KaTeX_Math-Italic",{style:"italic"}],["KaTeX_Math-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_AMS-Regular"],["KaTeX_Caligraphic-Regular"],["KaTeX_Caligraphic-Bold",{weight:"bold"}],["KaTeX_Fraktur-Regular"],["KaTeX_Fraktur-Bold",{weight:"bold"}],["KaTeX_SansSerif-Regular"],["KaTeX_SansSerif-Bold",{weight:"bold"}],["KaTeX_SansSerif-Italic",{style:"italic"}],["KaTeX_Script-Regular"],["KaTeX_Typewriter-Regular"],["KaTeX_Size1-Regular"],["KaTeX_Size2-Regular"],["KaTeX_Size3-Regular"],["KaTeX_Size4-Regular"]].map(s=>om(s[0].replace(/-[a-zA-Z]+$/,""),`${n}/${s[0]}`,s[1]));try{(yield Promise.all(a.map(o=>{try{return o.load()}catch(l){}}))).forEach(o=>document.fonts.add(o)),Xt="ready";return}catch(s){console.error(`MathLive 0.98.5: The math fonts could not be loaded from "${n}"`,{cause:s}),document.body.classList.add("ML__fonts-did-not-load")}Xt="error"}})}function cm(e){let t=0;for(let r=0;r<e.length;r++)t=t*31+e.charCodeAt(r),t=t|0;return Math.abs(t)}function Be(e,t){e&&(e.dirty||(e.dirty=!0,requestAnimationFrame(()=>{ji(e)&&e.dirty&&(e.atomBoundsCache=new Map,Gi(e,t),e.atomBoundsCache=void 0)})))}function um(e,t){var r;t=t!=null?t:{};const i=new $({from:g(p({},e.context),{atomIdsSettings:{seed:t.forHighlighting?cm(w.serialize([e.model.root],{expandMacro:!1,defaultMode:e.options.defaultMode})):"random",groupNumbers:(r=t.forHighlighting)!=null?r:!1},letterShapeStyle:e.options.letterShapeStyle}),mathstyle:e.options.defaultMode==="inline-math"?"textstyle":"displaystyle"}),n=e.model.root.render(i);return ks(ya(n,i),{classes:e.hasEditablePrompts?"ML__latex ML__prompting":"ML__latex",attributes:{translate:"no","aria-hidden":"true"}})}function wd(e,t){const{model:r}=e;r.root.caret=void 0,r.root.isSelected=!1,r.root.containsCaret=!0;for(const n of r.atoms)n.caret=void 0,n.isSelected=!1,n.containsCaret=!1;if(r.selectionIsCollapsed){const n=r.at(r.position);n.caret=e.model.mode;let a=n.parent;for(;a;)a.containsCaret=!0,a=a.parent}else{const n=r.getAtoms(r.selection,{includeChildren:!0});for(const a of n)a.isSelected=!0}return um(e,t).toMarkup()}function Gi(e,t){if(!ji(e))return;t!=null||(t={});const r=e.element.querySelector("[part=virtual-keyboard-toggle]");r&&(r.style.display=e.hasEditableContent?"":"none");const i=e.field;if(!i)return;const n=e.isSelectionEditable&&e.hasFocus(),a=i.classList.contains("ML__focused");a&&!n?i.classList.remove("ML__focused"):!a&&n&&i.classList.add("ML__focused");let s=wd(e,t);const o=e.element.querySelector("[part=menu-toggle]");if(o&&(e.model.atoms.length<=1||e.disabled||e.readOnly&&!e.hasEditableContent||e.userSelect==="none"?o.style.display="none":o.style.display=""),e.model.atoms.length<=1){const l=e.options.contentPlaceholder;l&&(s+=`<span part=placeholder class="ML__content-placeholder">${Je(l)}</span>`)}i.innerHTML=window.MathfieldElement.createHTML(s),Xs(e,t.interactive),e.dirty=!1}function Xs(e,t){const r=e.field;if(!r)return;for(const o of r.querySelectorAll(".ML__selection, .ML__contains-highlight"))o.remove();!(t!=null&&t)&&Xt!=="error"&&Xt!=="ready"&&setTimeout(()=>{Xt==="ready"?Xs(e):setTimeout(()=>Xs(e),128)},32);const i=e.model,n=r.offsetWidth,a=r.getBoundingClientRect().width;let s=Math.floor(a)/n;if(s=isNaN(s)?1:s,i.selectionIsCollapsed){Us(e,{deferred:!0});let o=i.at(i.position);for(;o&&o.type!=="prompt"&&!(o.containsCaret&&o.displayContainsHighlight);)o=o.parent;if(o!=null&&o.containsCaret&&o.displayContainsHighlight){const l=O0(e,fa(e,o),s);if(l){l.left/=s,l.right/=s,l.top/=s,l.bottom/=s;const c=document.createElement("div");c.classList.add("ML__contains-highlight"),c.style.position="absolute",c.style.left=`${l.left+1}px`,c.style.top=`${Math.ceil(l.top)}px`,c.style.width=`${Math.ceil(l.right-l.left)}px`,c.style.height=`${Math.ceil(l.bottom-l.top)}px`,r.insertBefore(c,r.childNodes[0])}}return}for(const o of dm(R0(e,{excludeAtomsWithBackground:!0}))){o.left/=s,o.right/=s,o.top/=s,o.bottom/=s;const l=document.createElement("div");l.classList.add("ML__selection"),l.style.position="absolute",l.style.left=`${o.left}px`,l.style.top=`${o.top}px`,l.style.width=`${Math.ceil(o.right-o.left)}px`,l.style.height=`${Math.ceil(o.bottom-o.top-1)}px`,r.insertBefore(l,r.childNodes[0])}}function dm(e){let t=[];for(const r of e){let i=!1;for(const n of t)if(r.left===n.left&&r.right===n.right&&r.top===n.top&&r.bottom===n.bottom){i=!0;break}i||t.push(r)}e=t,t=[];for(const r of e){let i=0;for(const n of e)if(r.left>=n.left&&r.right<=n.right&&r.top>=n.top&&r.bottom<=n.bottom&&(i+=1,i>1))break;i===1&&t.push(r)}return t}var kd=3,Pr;function It(e,t){t=p({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},t!=null?t:{}),Pr||(Pr={});for(const r of Object.keys(e))console.assert(!Pr[r],"Selector already defined: ",r),Pr[r]=g(p({},t),{fn:e[r]})}function xl(e){let t;if(Array.isArray(e)){if(e[0]==="performWithFeedback")return xl(e[1]);t=e[0]}else t=e;return t=t.replace(/-\w/g,r=>r[1].toUpperCase()),Pr[t]}function An(e){var t;return(t=xl(e))==null?void 0:t.target}function hm(e,t){var r;if(!t)return!1;let i,n=[],a=!1,s=!1;le(t)?(i=t[0],n=t.slice(1)):i=t,i=i.replace(/-\w/g,c=>c[1].toUpperCase());const o=Pr[i],l=o==null?void 0:o.target;if(l==="model"){if(!e.isSelectionEditable&&(o!=null&&o.changeContent))return e.model.announce("plonk"),!1;/^(delete|add)/.test(i)&&(i!=="deleteBackward"&&e.flushInlineShortcutBuffer(),e.snapshot(i)),/^complete/.test(i)||js(e),Pr[i].fn(e.model,...n),Sa(e),s=!0,a=!0}else if(l==="virtual-keyboard")s=(r=window.mathVirtualKeyboard.executeCommand(t))!=null?r:!1,a=!0;else if(Pr[i]){if(!e.isSelectionEditable&&(o!=null&&o.changeContent))return e.model.announce("plonk"),!1;/^(undo|redo)/.test(i)&&e.flushInlineShortcutBuffer(),s=Pr[i].fn(e,...n),a=!0}else throw new Error(`Unknown command "${i}"`);return l!=="virtual-keyboard"&&(!e.model.selectionIsCollapsed||o!=null&&o.changeSelection&&t!=="deleteBackward")&&(e.flushInlineShortcutBuffer(),o!=null&&o.changeContent||e.stopCoalescingUndo(),e.defaultStyle={}),s&&Be(e),a}function fm(e,t){var r;if(!e)return!1;e.focus(),vh.keypressVibration&&G()&&navigator.vibrate(kd);const i=xl(t);window.MathfieldElement.playSound((r=i==null?void 0:i.audioFeedback)!=null?r:"keypress");const n=e.executeCommand(t);return e.scrollIntoView(),n}It({performWithFeedback:(e,t)=>fm(e,t)});function pm(e){return Sa(e,{atIndex:e.suggestionIndex+1}),!1}function mm(e){return Sa(e,{atIndex:e.suggestionIndex-1}),!1}It({complete:Cn},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),It({nextSuggestion:pm,previousSuggestion:mm},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var $s="mathlive#virtual-keyboard-message";function _l(e){var t;return e.type!=="message"?!1:((t=e.data)==null?void 0:t.type)===$s}var gm=class tf{constructor(){this.targetOrigin=window.origin,this.originValidator="none",this._boundingRect=new DOMRect(0,0,0,0),this._isShifted=!1,window.addEventListener("message",this),this.sendMessage("proxy-created"),this.listeners={}}static get singleton(){return this._singleton||(this._singleton=new tf),this._singleton}set alphabeticLayout(t){this.sendMessage("update-setting",{alphabeticLayout:t})}set layouts(t){this.sendMessage("update-setting",{layouts:t})}get normalizedLayouts(){return[]}set editToolbar(t){this.sendMessage("update-setting",{editToolbar:t})}set actionKeycap(t){this.sendMessage("update-setting",{actionKeycap:t})}set shiftKeycap(t){this.sendMessage("update-setting",{shiftKeycap:t})}set backspaceKeycap(t){this.sendMessage("update-setting",{backspaceKeycap:t})}set tabKeycap(t){this.sendMessage("update-setting",{tabKeycap:t})}set container(t){throw new Error("Container inside an iframe cannot be changed")}show(t){this.sendMessage("show",t)}hide(t){this.sendMessage("hide",t)}get isShifted(){return this._isShifted}get visible(){return this._boundingRect.height>0}set visible(t){t?this.show():this.hide()}get boundingRect(){return this._boundingRect}executeCommand(t){return this.sendMessage("execute-command",{command:t}),!0}updateToolbar(t){this.sendMessage("update-toolbar",t)}update(t){this.sendMessage("update-setting",t)}connect(){this.sendMessage("connect")}disconnect(){this.sendMessage("disconnect")}addEventListener(t,r,i){this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].has(r)||this.listeners[t].add(r)}dispatchEvent(t){return!this.listeners[t.type]||this.listeners[t.type].size===0?!0:(this.listeners[t.type].forEach(r=>{typeof r=="function"?r(t):r==null||r.handleEvent(t)}),!t.defaultPrevented)}removeEventListener(t,r,i){this.listeners[t]&&this.listeners[t].delete(r)}handleEvent(t){if(_l(t)){if(!cl(t.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${t.origin}) cannot be handled`,"SecurityError");this.handleMessage(t.data)}}handleMessage(t){const{action:r}=t;if(r==="execute-command"){const{command:i}=t;An(i)==="virtual-keyboard"&&this.executeCommand(i);return}if(r==="synchronize-proxy"){this._boundingRect=t.boundingRect,this._isShifted=t.isShifted;return}if(r==="geometry-changed"){this._boundingRect=t.boundingRect,this.dispatchEvent(new Event("geometrychange"));return}}sendMessage(t,r={}){if(!window.top)throw new DOMException("A frame does not have access to the top window and can\u2018t communicate with the keyboard. Review virtualKeyboardTargetOrigin and originValidator on mathfields embedded in an iframe","SecurityError");window.top.postMessage(p({type:$s,action:t},r),this.targetOrigin)}},Md={numeric:{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",rows:[[{latex:"x",shift:"y",variants:["y","z","t","r","x^2","x^n","x^{#?}","x_n","x_i","x_{#?}",{latex:"f(#?)",class:"small"},{latex:"g(#?)",class:"small"}]},{latex:"n",shift:"a",variants:["i","j","p","k","a","u"]},"[separator-5]","[7]","[8]","[9]","[/]","[separator-5]",{latex:"\\exponentialE",shift:"\\ln",variants:["\\exp","\\times 10^{#?}","\\ln","\\log_{10}","\\log"]},{latex:"\\imaginaryI",variants:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"]},{latex:"\\pi",shift:"\\sin",variants:["\\prod",{latex:"\\theta",aside:"theta"},{latex:"\\rho",aside:"rho"},{latex:"\\tau",aside:"tau"},"\\sin","\\cos","\\tan"]}],[{label:"<",latex:"<",class:"hide-shift",shift:{latex:"\\le",label:"\u2264"}},{label:">",latex:">",class:"hide-shift",shift:{latex:"\\ge",label:"\u2265"}},"[separator-5]","[4]","[5]","[6]","[*]","[separator-5]",{class:"hide-shift",latex:"#@^2}",shift:"#@^{\\prime}}"},{latex:"#@^{#0}}",class:"hide-shift",shift:"#@_{#?}"},{class:"hide-shift",latex:"\\sqrt{#0}",shift:{latex:"\\sqrt[#0]{#?}}"}}],["[(]","[)]","[separator-5]","[1]","[2]","[3]","[-]","[separator-5]",{latex:"\\int^{\\infty}_{0}\\!#?\\,\\mathrm{d}x",class:"small hide-shift",shift:"\\int",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{class:"hide-shift",latex:"\\forall",shift:"\\exists"},{label:"[backspace]",width:1}],[{label:"[shift]",width:2},"[separator-5]","[0]","[.]","[=]","[+]","[separator-5]","[left]","[right]",{label:"[action]",width:1}]]},greek:{label:"&alpha;&beta;&gamma;",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"<i>&#x03c6;</i>",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"<i>&#x03c2;</i>",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"<i>&#x03f5;</i>",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"<i>&rho;</i>",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"<i>&tau;</i>",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"<i>&upsilon;</i>",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"<i>&theta;</i>",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"<i>&iota;</i>",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"<i>&omicron;</i>",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"<i>&pi;</i>",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"<i>&alpha;</i>",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"<i>&sigma;</i>",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"<i>&delta;</i>",class:"MLK__tex hide-shift",insert:"\\delta",aside:"delta",shift:"\\Delta"},{latex:"\\phi",class:"MLK__tex hide-shift",insert:"\\phi",aside:"phi",shift:"\\Phi"},{label:"<i>&gamma;</i>",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"<i>&eta;</i>",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"<i>&xi;</i>",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"<i>&kappa;</i>",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"<i>&lambda;</i>",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"<i>&zeta;</i>",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"<i>&chi;</i>",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"<i>&psi;</i>",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"<i>&omega;</i>",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"<i>&beta;</i>",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"<i>&nu;</i>",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"<i>&mu;</i>",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"<i>&#x03b5;</i>",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"<i>&#x03d1;</i>",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"<i>&#x3f0;</i>",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"<i>&#x03d6;</i>",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"<i>&#x03f1;</i>",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"&infin;\u2260\u2208",labelClass:"MLK__tex",tooltip:"keyboard.tooltip.symbols",rows:[[{latex:"\\sin",shift:"\\sin^{-1}",variants:[{class:"small",latex:"\\sinh"},{class:"small",latex:"\\sin^{-1}"},{class:"small",latex:"\\arsinh"}]},"\\ln",{latex:"\\mathrm{abs}",insert:"\\mathrm{abs}\\left(#0\\right)"},{latex:"\\rarr",shift:"\\rArr",variants:[{latex:"\\implies",aside:"implies"},{latex:"\\to",aside:"to"},"\\dashv",{latex:"\\roundimplies",aside:"round implies"}]},{latex:"\\exists",variants:["\\nexists"],shift:"\\nexists"},{latex:"\\in",shift:"\\notin",variants:["\\notin","\\owns"]},"\\cup",{latex:"\\overrightarrow{#@}",shift:"\\overleftarrow{#@}",variants:["\\overleftarrow{#@}","\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"]},{class:"small",latex:"\\lim_{#?}",shift:"\\lim_{x\\to\\infty}",variants:[{class:"small",latex:"\\liminf_{#?}"},{class:"small",latex:"\\limsup_{#?}"}]},"\\exponentialE"],[{latex:"\\cos",shift:"\\cos^{-1}",variants:[{class:"small",latex:"\\cosh"},{class:"small",latex:"\\cos^{-1}"},{class:"small",latex:"\\arcosh"}]},{latex:"\\log",shift:"\\log_{10}",variants:["\\log_{#0}","\\log_{10}"]},"\\left\\vert#0\\right\\vert",{latex:"\\larr",shift:"\\lArr",variants:[{latex:"\\impliedby",aside:"implied by"},{latex:"\\gets",aside:"gets"},"\\lArr","\\vdash",{latex:"\\models",aside:"models"}]},{latex:"\\forall",shift:"\\lnot",variants:[{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"}]},{latex:"\\ni",shift:"\\not\\owns"},"\\cap",{latex:"\\overline{#@}",shift:"\\underline{#@}",variants:["\\overbrace{#@}","\\overlinesegment{#@}","\\overleftrightarrow{#@}","\\overrightarrow{#@}","\\overleftarrow{#@}","\\overgroup{#@}","\\underbrace{#@}","\\underlinesegment{#@}","\\underleftrightarrow{#@}","\\underrightarrow{#@}","\\underleftarrow{#@}","\\undergroup{#@}"]},{class:"hide-shift",latex:"\\int",shift:"\\iint",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\smallint",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\intop","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"]},{latex:"\\pi",shift:"\\tau",variants:["\\tau"]}],[{latex:"\\tan",shift:"\\tan^{-1}",variants:[{class:"small",latex:"\\tanh"},{class:"small",latex:"\\tan^{-1}"},{class:"small",latex:"\\artanh"},{class:"small",latex:"\\arctan"},{class:"small",latex:"\\arctg"},{class:"small",latex:"\\tg"}]},{latex:"\\exp",insert:"\\exp\\left(#0\\right)",variants:["\\exponentialE^{#0}"]},"\\left\\Vert#0\\right\\Vert",{latex:"\\lrArr",shift:"\\leftrightarrow",variants:[{latex:"\\iff",aside:"if and only if"},"\\leftrightarrow","\\leftrightarrows","\\Leftrightarrow",{latex:"^\\biconditional",aside:"biconditional"}]},{latex:"\\vert",shift:"!"},{latex:"#@^{\\complement}",aside:"complement",variants:[{latex:"\\setminus",aside:"set minus"},{latex:"\\smallsetminus",aside:"small set minus"}]},{latex:"\\subset",shift:"\\subseteq",variants:["\\subset","\\subseteq","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsubseteq","\\supset","\\supseteq","\\supsetneq","\\supsetneqq","\\nsupset","\\nsupseteq"]},{latex:"#@^{\\prime}",shift:"#@^{\\doubleprime}",variants:["#@^{\\doubleprime}","#@\\degree"]},{latex:"\\mathrm{d}",shift:"\\partial",variants:["\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{latex:"\\infty",variants:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"]}],[{label:"[shift]",width:2},{class:"box",latex:",",shift:";",variants:[";","?"]},{class:"box",latex:"\\colon",shift:"\\Colon",variants:[{latex:"\\Colon",aside:"such that",class:"box"},{latex:":",aside:"ratio",class:"box"},{latex:"\\vdots",aside:"",class:"box"},{latex:"\\ddots",aside:"",class:"box"},{latex:"\\ldotp",aside:"low dot",class:"box"},{latex:"\\cdotp",aside:"center dot",class:"box"},{latex:"\\ldots",aside:"low ellipsis",class:"box"},{latex:"\\cdots",aside:"center ellipsis",class:"box"},{latex:"\\therefore",aside:"therefore",class:"box"},{latex:"\\because",aside:"because",class:"box"}]},{class:"box",latex:"\\cdot",aside:"centered dot",shift:"\\ast",variants:["\\circ","\\bigcirc","\\bullet","\\odot","\\oslash","\\circledcirc","\\ast","\\star","\\times","\\doteq","\\doteqdot"]},"[separator]","[left]","[right]",{label:"[backspace]",width:1,class:"action hide-shift"},{label:"[action]",width:1}]]},compact:{label:"compact",rows:[["[+]","[-]","[*]","[/]","[=]","[.]","[(]","[)]","\\sqrt{#0}","#@^{#?}"],["[1]","[2]","[3]","[4]","[5]","[6]","[7]","[8]","[9]","[0]"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]},minimalist:{label:"minimalist",layers:[{style:`
.minimalist-backdrop {
display: flex;
justify-content: center;
}
.minimalist-container {
--keycap-height: 40px;
--keycap-max-width: 53px;
--keycap-small-font-size: 12px;
background: var(--keyboard-background);
padding: 20px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border: 1px solid var(--keyboard-border);
box-shadow: 0 0 32px rgb(0 0 0 / 30%);
}
`,backdrop:"minimalist-backdrop",container:"minimalist-container",rows:[["+","-","\\times",{latex:"\\frac{#@}{#0}",class:"small"},"=","[.]","(",")",{latex:"\\sqrt{#0}",class:"small"},{latex:"#@^{#?}",class:"small"}],["1","2","3","4","5","6","7","8","9","0"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]}]},"numeric-only":{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",id:"numeric-only",rows:[["7","8","9","[separator]",{label:"[backspace]",width:2}],["4","5","6","[separator]","[separator]","[separator]"],["1","2","3","[separator]","[separator]","[separator]"],["0",{label:"[.]",variants:[]},"-","[separator]","[left]","[right]"]]}},Gs={0:["\\varnothing","\\infty"],1:["\\frac{1}{#@}","#@^{-1}","\\times 10^{#?}","\\phi","\\imaginaryI"],2:["\\frac{1}{2}","#@^2","\\sqrt2","\\exponentialE"],3:["\\frac{1}{3}","#@^3","\\sqrt3","\\pi"],4:["\\frac{1}{4}","#@^4"],5:["\\frac{1}{5}","#@^5","\\sqrt5"],6:["\\frac{1}{6}","#@^6"],7:["\\frac{1}{7}","#@^7"],8:["\\frac{1}{8}","#@^8"],9:["\\frac{1}{9}","#@^9"],".":[".",",",";","\\colon"],",":["{,}",".",";","\\colon"],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"},"\xE0","\xE1","\xE2","\xE4","\xE6"],b:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"},"\xE7"],d:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn\u2019t"},"\xE8","\xE9","\xEA","\xEB"],g:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"},"\xEC","\xED","\xEE","\xEF"],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\mathbb{N}",aside:"set of natural numbers"},"\xF1"],o:["\xF8","\u0153","\xF2","\xF3","\xF4","\xF6","\u0153"],p:[{latex:"\\mathbb{P}",aside:"set of primes"}],q:[{latex:"\\mathbb{Q}",aside:"set of rational numbers"}],r:[{latex:"\\mathbb{R}",aside:"set of real numbers"}],u:["\xF9","\xFA","\xFB","\xFC"],z:[{latex:"\\mathbb{Z}",aside:"set of integers"}],y:["\xFD","\xFF"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space<br>\u207B\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\,\\char"2039',insert:"\\,",aside:"thin space<br>\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\:\\char"2039',insert:"\\:",aside:"medium space<br>\u2074\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\;\\char"2039',insert:"\\;",aside:"thick space<br>\u2075\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\ \\char"2039',insert:"\\ ",aside:"\u2153 em"},{latex:'\\char"203A\\enspace\\char"2039',insert:"\\enspace",aside:"\xBD em"},{latex:'\\char"203A\\quad\\char"2039',insert:"\\quad",aside:"1 em"},{latex:'\\char"203A\\qquad\\char"2039',insert:"\\qquad",aside:"2 em"}]},Ca;function Sd(e,t){var r,i,n;const a=ki.singleton;if(!a)return;const s=Ln(e),o=(i=(r=a.getKeycap(s==null?void 0:s.id))==null?void 0:r.variants)!=null?i:"";if(typeof o=="string"&&!Cd(o)||Array.isArray(o)&&o.length===0){t==null||t();return}const l={};let c="";for(const y of vm(o)){const A=Ad(y),v=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);l[v]=A;const[S,L]=Ys(A);c+=`<div id=${v} class="item ${L}">${S}</div>`}const u=document.createElement("div");u.setAttribute("aria-hidden","true"),u.className="MLK__variant-panel",u.style.height="auto";const d=Object.keys(l).length;let h=5;d===1?h=1:d===2||d===4?h=2:d===3||d===5||d===6?h=3:d>=7&&d<14&&(h=4),u.style.width=`calc(var(--variant-keycap-length) * ${h} + 12px)`,u.innerHTML=vh.createHTML(c),Fr.open({root:(n=a==null?void 0:a.container)==null?void 0:n.querySelector(".ML__keyboard"),child:u}),Ca=new AbortController;const{signal:f}=Ca,m=e==null?void 0:e.getBoundingClientRect();if(m){m.top-u.clientHeight<0&&(u.style.width="auto",d<=6?u.style.height="56px":d<=12?u.style.height="108px":d<=18?u.style.height="205px":u.classList.add("compact"));const y=Math.max(0,Math.min(window.innerWidth-u.offsetWidth,(m.left+m.right-u.offsetWidth)/2)),A=m.top-u.clientHeight+5;u.style.transform=`translate(${y}px, ${A}px)`,u.classList.add("is-visible"),requestAnimationFrame(()=>{u.addEventListener("pointerup",v=>{const S=Ln(v.target);!(S!=null&&S.id)||!l[S.id]||(wl(l[S.id]),Ea(),t==null||t(),v.preventDefault())},{capture:!0,passive:!1,signal:f}),u.addEventListener("pointerenter",v=>{const S=Ln(v.target);!(S!=null&&S.id)||!l[S.id]||S.classList.add("is-active")},{capture:!0,signal:f}),u.addEventListener("pointerleave",v=>{const S=Ln(v.target);!(S!=null&&S.id)||!l[S.id]||S.classList.remove("is-active")},{capture:!0,signal:f}),window.addEventListener("pointercancel",()=>{Ea(),t==null||t()},{signal:f}),window.addEventListener("pointerup",()=>{Ea(),t==null||t()},{signal:f})})}}function Ea(){Ca==null||Ca.abort(),Ca=null,Fr.state==="open"&&Fr.close()}function bm(e){if(e==="foreground-color"){const t=[];for(const r of Object.keys(qe))t.push({class:"swatch-button",label:'<span style="border: 3px solid '+qe[r]+'"></span>',command:["applyStyle",{color:r}]});return t}if(e==="background-color"){const t=[];for(const r of Object.keys(pe))t.push({class:"swatch-button",label:'<span style="background:'+pe[r]+'"></span>',command:["applyStyle",{backgroundColor:r}]});return t}}function Cd(e){return Gs[e]!==void 0}function vm(e){var t;return typeof e!="string"?e:(Gs[e]||(Gs[e]=(t=bm(e))!=null?t:[]),Gs[e])}function ym(e){return typeof e=="string"?e:Object.entries(e).map(([t,r])=>`${t}:${r} !important`).join(";")}function xm(e){return Object.keys(e).map(t=>`${t} {${ym(e[t])}}`).join("")}function Aa(e){if(!e)return"";const t=new $,r=new w({mode:"math",type:"root",body:xt(e,{context:t,args:n=>n==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),i=ws(ya(new D(r.render(t),{classes:"ML__base"}),t));return ks(i,{classes:"ML__latex"}).toMarkup()}function La(e){var t;if(Array.isArray(e))return e.map(i=>La(i)).flat();const r=typeof e=="string"?{markup:e}:e;return"rows"in r&&Array.isArray(r.rows)&&(r.rows=r.rows.map(i=>i.map(n=>Ad(n)))),(t=r.id)!=null||(r.id="ML__layer_"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36)),[r]}function _m(){var e,t;let i=window.mathVirtualKeyboard.alphabeticLayout;if(i==="auto"){const o=ka();o&&(i=o.virtualLayout),(!i||i==="auto")&&(i=(e={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[N.locale.slice(0,2)])!=null?e:"qwerty")}const n={qwerty:["qwertyuiop"," asdfghjkl ","^zxcvbnm~"],azerty:["azertyuiop","qsdfghjklm","^ wxcvbn ~"],qwertz:["qwertzuiop"," asdfghjkl ","^yxcvbnm~"],dvorak:["^ pyfgcrl ","aoeuidhtns","qjkxbmwvz~"],colemak:[" qwfpgjluy ","arstdhneio","^zxcvbkm~"]},a=(t=n[i])!=null?t:n.qwerty,s=i==="azerty"?[[{label:"1",variants:"1"},{label:"2",shift:{latex:"\xE9"},variants:"2"},{label:"3",shift:{latex:"\xF9"},variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{label:"(",latex:"("},variants:"5"},{label:"6",shift:{label:")",latex:")"},variants:"6"},{label:"7",shift:{latex:"\xE8"},variants:"7"},{label:"8",shift:{latex:"\xEA"},variants:"8"},{label:"9",shift:{latex:"\xE7"},variants:"9"},{label:"0",shift:{latex:"\xE0"},variants:"0"}]]:[[{label:"1",variants:"1"},{label:"2",variants:"2"},{label:"3",variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{latex:"\\frac{#@}{#?}"},variants:"5"},{label:"6",shift:{latex:"#@^#?"},variants:"6"},{label:"7",variants:"7"},{label:"8",shift:{latex:"\\times"},variants:"8"},{label:"9",shift:{label:"(",latex:"("},variants:"9"},{label:"0",shift:{label:")",latex:")"},variants:"0"}]];for(const o of a){const l=[];for(const c of o)/[a-z]/.test(c)?l.push({label:c,class:"hide-shift",shift:{label:c.toUpperCase()},variants:Cd(c)?c:void 0}):c==="~"?i!=="dvorak"?l.push("[backspace]"):l.push({label:"[backspace]",width:1}):c==="^"?l.push("[shift]"):c===" "&&l.push("[separator-5]");s.push(l)}return s.push(["[-]","[+]","[=]",{label:" ",width:1.5},{label:",",shift:";",variants:".",class:"hide-shift"},"[.]","[left]","[right]",{label:"[action]",width:1.5}]),{label:"abc",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.alphabetic",layers:La({rows:s})}}function Ed(e){if(e==="alphabetic")return _m();if(typeof e=="string")return console.assert(Md[e]!==void 0,`MathLive 0.98.5: unknown keyboard layout "${e}"`),Ed(Md[e]);let t;if("rows"in e&&Array.isArray(e.rows)){console.assert(!("layers"in e||"markup"in e),'MathLive 0.98.5: when providing a "rows" property, "layers" and "markup" are ignored');const n=e,{rows:a}=n,s=fe(n,["rows"]);t=g(p({},s),{layers:La({rows:e.rows})})}else if("markup"in e&&typeof e.markup=="string"){const n=e,{markup:a}=n,s=fe(n,["markup"]);t=g(p({},s),{layers:La(e.markup)})}else t=p({},e),"layers"in e?t.layers=La(e.layers):console.error('MathLive 0.98.5: provide either a "rows", "markup" or "layers" property');let r=!1,i=!1;for(const n of t.layers)if(n.rows)for(const a of n.rows.flat()){Bn(a)&&(r=!0);const s=a.command;typeof s=="string"&&["undo","redo","cut","copy","paste"].includes(s)&&(i=!0)}return(!("displayShiftedKeycaps"in e)||e.displayShiftedKeycaps===void 0)&&(t.displayShiftedKeycaps=r),(!("displayEditToolbar"in e)||e.displayEditToolbar===void 0)&&(t.displayEditToolbar=!i),t}function wm(e,t){var r,i;let n='<div class="left">';if(e.normalizedLayouts.length>1)for(const[a,s]of e.normalizedLayouts.entries()){const o=s,l=[a===t?"selected":"layer-switch"];o.tooltip&&l.push("MLK__tooltip"),o.labelClass&&l.push(...o.labelClass.split(" ")),n+=`<div class="${l.join(" ")}"`,o.tooltip&&(n+=" data-tooltip='"+((r=R(o.tooltip))!=null?r:o.tooltip)+"' "),a!==t&&(n+=`data-layer="${o.layers[0].id}"`),n+=`>${(i=o.label)!=null?i:"untitled"}</div>`}return n+="</div>",n}function km(e,t){let r="";if(e.editToolbar==="none")return"";const n=[];t.selectionIsCollapsed?n.push("undo","redo","pasteFromClipboard"):n.push("cutToClipboard","copyToClipboard","pasteFromClipboard");const a={undo:`<div class='action ${t.canUndo===!1?"disabled":""}'
data-command='"undo"'
data-tooltip='${R("tooltip.undo")}'>
<svg><use xlink:href='#svg-undo' /></svg>
</div>`,redo:`<div class='action ${t.canRedo===!1?"disabled":""}'
data-command='"redo"'
data-tooltip='${R("tooltip.redo")}'>
<svg><use xlink:href='#svg-redo' /></svg>
</div>`,cutToClipboard:`
<div class='action'
data-command='"cutToClipboard"'
data-tooltip='${R("tooltip.cut to clipboard")}'>
<svg><use xlink:href='#svg-cut' /></svg>
</div>
`,copyToClipboard:`
<div class='action'
data-command='"copyToClipboard"'
data-tooltip='${R("tooltip.copy to clipboard")}'>
<svg><use xlink:href='#svg-copy' /></svg>
</div>
`,pasteFromClipboard:`
<div class='action'
data-command='"pasteFromClipboard"'
data-tooltip='${R("tooltip.paste from clipboard")}'>
<svg><use xlink:href='#svg-paste' /></svg>
</div>
`};return r+=n.map(s=>a[s]).join(""),r}function Mm(e){for(const t of e)Sm(t)}function Sm(e){const t=ki.singleton;if(!t)return;const r={};if(!e.id){if(e.hasAttribute("data-label")&&(r.label=e.dataset.label),e.hasAttribute("data-latex")&&(r.latex=e.dataset.latex),e.hasAttribute("data-key")&&(r.key=e.dataset.key),e.hasAttribute("data-insert")&&(r.insert=e.dataset.insert),e.hasAttribute("data-variants")&&(r.variants=e.dataset.variants),e.hasAttribute("data-aside")&&(r.aside=e.dataset.aside),e.className&&(r.class=e.className),!r.label&&!r.latex&&!r.key&&!r.insert&&(r.latex=e.innerText,r.label=e.innerHTML),e.hasAttribute("data-command"))try{r.command=JSON.parse(e.dataset.command)}catch(i){}e.id=t.registerKeycap(r)}if(!e.innerHTML){const[i,n]=Ys(r);e.innerHTML=window.MathfieldElement.createHTML(i)}}function Cm(){ei("virtual-keyboard"),ei("core"),Js()}function Em(){xi("core"),xi("virtual-keyboard")}var Am=`<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-delete-backward" viewBox="0 0 576 512">
<path d="M432.1 208.1L385.9 256L432.1 303C442.3 312.4 442.3 327.6 432.1 336.1C423.6 346.3 408.4 346.3 399 336.1L352 289.9L304.1 336.1C295.6 346.3 280.4 346.3 271 336.1C261.7 327.6 261.7 312.4 271 303L318.1 256L271 208.1C261.7 199.6 261.7 184.4 271 175C280.4 165.7 295.6 165.7 304.1 175L352 222.1L399 175C408.4 165.7 423.6 165.7 432.1 175C442.3 184.4 442.3 199.6 432.1 208.1V208.1zM512 64C547.3 64 576 92.65 576 128V384C576 419.3 547.3 448 512 448H205.3C188.3 448 172 441.3 160 429.3L9.372 278.6C3.371 272.6 0 264.5 0 256C0 247.5 3.372 239.4 9.372 233.4L160 82.75C172 70.74 188.3 64 205.3 64L512 64zM528 128C528 119.2 520.8 112 512 112H205.3C201 112 196.9 113.7 193.9 116.7L54.63 256L193.9 395.3C196.9 398.3 201 400 205.3 400H512C520.8 400 528 392.8 528 384V128z"/>
</symbol>
<symbol id="svg-shift" viewBox="0 0 384 512">
<path d="M2.438 252.3C7.391 264.2 19.06 272 32 272h80v160c0 26.51 21.49 48 48 48h64C250.5 480 272 458.5 272 432v-160H352c12.94 0 24.61-7.797 29.56-19.75c4.953-11.97 2.219-25.72-6.938-34.88l-160-176C208.4 35.13 200.2 32 192 32S175.6 35.13 169.4 41.38l-160 176C.2188 226.5-2.516 240.3 2.438 252.3zM192 86.63L313.4 224H224v208H160V224H70.63L192 86.63z"/>
</symbol>
<symbol id="svg-commit" viewBox="0 0 512 512">
<path d="M135 432.1l-128-128C2.344 300.3 0 294.2 0 288s2.344-12.28 7.031-16.97l128-128c9.375-9.375 24.56-9.375 33.94 0s9.375 24.56 0 33.94L81.94 264H464v-208C464 42.75 474.8 32 488 32S512 42.75 512 56V288c0 13.25-10.75 24-24 24H81.94l87.03 87.03c9.375 9.375 9.375 24.56 0 33.94S144.4 442.3 135 432.1z"/>
</symbol>
<symbol id="circle-plus" viewBox="0 0 512 512"><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344c0 13.3 10.7 24 24 24s24-10.7 24-24V280h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H280V168c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H168c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"/></symbol>
<symbol id="svg-command" viewBox="0 0 640 512">
<path d="M34.495 36.465l211.051 211.05c4.686 4.686 4.686 12.284 0 16.971L34.495 475.535c-4.686 4.686-12.284 4.686-16.97 0l-7.071-7.07c-4.686-4.686-4.686-12.284 0-16.971L205.947 256 10.454 60.506c-4.686-4.686-4.686-12.284 0-16.971l7.071-7.07c4.686-4.687 12.284-4.687 16.97 0zM640 468v-10c0-6.627-5.373-12-12-12H300c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h328c6.627 0 12-5.373 12-12z"/>
</symbol>
<symbol id="svg-undo" viewBox="0 0 512 512">
<path d="M20 8h10c6.627 0 12 5.373 12 12v110.625C85.196 57.047 165.239 7.715 256.793 8.001 393.18 8.428 504.213 120.009 504 256.396 503.786 393.181 392.834 504 256 504c-63.926 0-122.202-24.187-166.178-63.908-5.113-4.618-5.354-12.561-.482-17.433l7.069-7.069c4.503-4.503 11.749-4.714 16.482-.454C150.782 449.238 200.935 470 256 470c117.744 0 214-95.331 214-214 0-117.744-95.331-214-214-214-82.862 0-154.737 47.077-190.289 116H180c6.627 0 12 5.373 12 12v10c0 6.627-5.373 12-12 12H20c-6.627 0-12-5.373-12-12V20c0-6.627 5.373-12 12-12z"/>
</symbol>
<symbol id="svg-redo" viewBox="0 0 512 512">
<path d="M492 8h-10c-6.627 0-12 5.373-12 12v110.625C426.804 57.047 346.761 7.715 255.207 8.001 118.82 8.428 7.787 120.009 8 256.396 8.214 393.181 119.166 504 256 504c63.926 0 122.202-24.187 166.178-63.908 5.113-4.618 5.354-12.561.482-17.433l-7.069-7.069c-4.503-4.503-11.749-4.714-16.482-.454C361.218 449.238 311.065 470 256 470c-117.744 0-214-95.331-214-214 0-117.744 95.331-214 214-214 82.862 0 154.737 47.077 190.289 116H332c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h160c6.627 0 12-5.373 12-12V20c0-6.627-5.373-12-12-12z"/>
</symbol>
<symbol id="svg-arrow-left" viewBox="0 0 320 512">
<path d="M206.7 464.6l-183.1-191.1C18.22 267.1 16 261.1 16 256s2.219-11.97 6.688-16.59l183.1-191.1c9.152-9.594 24.34-9.906 33.9-.7187c9.625 9.125 9.938 24.37 .7187 33.91L73.24 256l168 175.4c9.219 9.5 8.906 24.78-.7187 33.91C231 474.5 215.8 474.2 206.7 464.6z"/>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 320 512">
<path d="M113.3 47.41l183.1 191.1c4.469 4.625 6.688 10.62 6.688 16.59s-2.219 11.97-6.688 16.59l-183.1 191.1c-9.152 9.594-24.34 9.906-33.9 .7187c-9.625-9.125-9.938-24.38-.7187-33.91l168-175.4L78.71 80.6c-9.219-9.5-8.906-24.78 .7187-33.91C88.99 37.5 104.2 37.82 113.3 47.41z"/>
</symbol>
<symbol id="svg-tab" viewBox="0 0 448 512">
<path d="M32 217.1c0-8.8 7.2-16 16-16h144v-93.9c0-7.1 8.6-10.7 13.6-5.7l143.5 143.1c6.3 6.3 6.3 16.4 0 22.7L205.6 410.4c-5 5-13.6 1.5-13.6-5.7v-93.9H48c-8.8 0-16-7.2-16-16v-77.7m-32 0v77.7c0 26.5 21.5 48 48 48h112v61.9c0 35.5 43 53.5 68.2 28.3l143.6-143c18.8-18.8 18.8-49.2 0-68L228.2 78.9c-25.1-25.1-68.2-7.3-68.2 28.3v61.9H48c-26.5 0-48 21.6-48 48zM436 64h-8c-6.6 0-12 5.4-12 12v360c0 6.6 5.4 12 12 12h8c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12z"/>
</symbol>
<symbol id="svg-paste" viewBox="0 0 512 512"><path d="M160 32c11.6 0 21.3 8.2 23.5 19.2C185 58.6 191.6 64 199.2 64H208c8.8 0 16 7.2 16 16V96H96V80c0-8.8 7.2-16 16-16h8.8c7.6 0 14.2-5.4 15.7-12.8C138.7 40.2 148.4 32 160 32zM64 64h2.7C65 69 64 74.4 64 80V96c0 17.7 14.3 32 32 32H224c17.7 0 32-14.3 32-32V80c0-5.6-1-11-2.7-16H256c17.7 0 32 14.3 32 32h32c0-35.3-28.7-64-64-64H210.6c-9-18.9-28.3-32-50.6-32s-41.6 13.1-50.6 32H64C28.7 32 0 60.7 0 96V384c0 35.3 28.7 64 64 64H192V416H64c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32zM288 480c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32h96v56c0 22.1 17.9 40 40 40h56V448c0 17.7-14.3 32-32 32H288zM416 165.3L474.7 224H424c-4.4 0-8-3.6-8-8V165.3zM448 512c35.3 0 64-28.7 64-64V235.9c0-12.7-5.1-24.9-14.1-33.9l-59.9-59.9c-9-9-21.2-14.1-33.9-14.1H288c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H448z"/></symbol>
<symbol id="svg-cut" viewBox="0 0 512 512"><path d="M485.6 444.2L333.6 314.9C326.9 309.2 326.1 299.1 331.8 292.4C337.5 285.6 347.6 284.8 354.4 290.5L506.4 419.8C513.1 425.5 513.9 435.6 508.2 442.4C502.5 449.1 492.4 449.9 485.6 444.2zM485.7 67.76C492.5 62.07 502.5 62.94 508.2 69.69C513.9 76.45 513.1 86.55 506.3 92.24L208.5 343.1C218.3 359.7 224 379.2 224 400C224 461.9 173.9 512 112 512C50.14 512 0 461.9 0 400C0 338.1 50.14 288 112 288C141.5 288 168.4 299.4 188.4 318.1L262.2 256L188.4 193.9C168.4 212.6 141.5 224 112 224C50.14 224 0 173.9 0 112C0 50.14 50.14 0 112 0C173.9 0 224 50.14 224 112C224 132.8 218.3 152.3 208.5 168.9L287 235.1L485.7 67.76zM32 112C32 156.2 67.82 192 112 192C156.2 192 192 156.2 192 112C192 67.82 156.2 32 112 32C67.82 32 32 67.82 32 112zM112 480C156.2 480 192 444.2 192 400C192 355.8 156.2 320 112 320C67.82 320 32 355.8 32 400C32 444.2 67.82 480 112 480z"/></symbol>
<symbol id="svg-copy" viewBox="0 0 512 512"><path d="M272 416C263.2 416 256 423.2 256 432V448c0 17.67-14.33 32-32 32H64c-17.67 0-32-14.33-32-32V192c0-17.67 14.33-32 32-32h112C184.8 160 192 152.8 192 144C192 135.2 184.8 128 176 128H63.99c-35.35 0-64 28.65-64 64l.0098 256C0 483.3 28.65 512 64 512h160c35.35 0 64-28.65 64-64v-16C288 423.2 280.8 416 272 416zM502.6 86.63l-77.25-77.25C419.4 3.371 411.2 0 402.7 0H288C252.7 0 224 28.65 224 64v256c0 35.35 28.65 64 64 64h160c35.35 0 64-28.65 64-64V109.3C512 100.8 508.6 92.63 502.6 86.63zM416 45.25L466.7 96H416V45.25zM480 320c0 17.67-14.33 32-32 32h-160c-17.67 0-32-14.33-32-32V64c0-17.67 14.33-32 32-32h96l.0026 64c0 17.67 14.33 32 32 32H480V320z"/>
</symbol>
<symbol id="svg-angle-double-right" viewBox="0 0 512 512"><path d="M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"/>
</symbol>
<symbol id="svg-angle-double-left" viewBox="0 0 512 512"><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"/>
</symbol>
<symbol id="svg-trash" viewBox="0 0 448 512">
<path d="M336 64l-33.6-44.8C293.3 7.1 279.1 0 264 0h-80c-15.1 0-29.3 7.1-38.4 19.2L112 64H24C10.7 64 0 74.7 0 88v2c0 3.3 2.7 6 6 6h26v368c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V96h26c3.3 0 6-2.7 6-6v-2c0-13.3-10.7-24-24-24h-88zM184 32h80c5 0 9.8 2.4 12.8 6.4L296 64H152l19.2-25.6c3-4 7.8-6.4 12.8-6.4zm200 432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V96h320v368zm-176-44V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm-80 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm160 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12z"/>
</symbol>
<symbol id="svg-keyboard-down" viewBox="0 0 576 512"><path d="M64 48c-8.8 0-16 7.2-16 16V240c0 8.8 7.2 16 16 16H512c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H64zM0 64C0 28.7 28.7 0 64 0H512c35.3 0 64 28.7 64 64V240c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM159 359c9.4-9.4 24.6-9.4 33.9 0l95 95 95-95c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L305 505c-4.5 4.5-10.6 7-17 7s-12.5-2.5-17-7L159 393c-9.4-9.4-9.4-24.6 0-33.9zm1-167c0-8.8 7.2-16 16-16H400c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V192zM120 88h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H120c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H200c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H280c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H360c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H440c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16z"/></symbol>
</svg>`;function Lm(e){e.resetKeycapRegistry(),Cm();const t=document.createElement("div");t.className="ML__keyboard";const r=document.createElement("div");r.className="MLK__plate",r.innerHTML=window.MathfieldElement.createHTML(Am+e.normalizedLayouts.map((s,o)=>Bm(e,s,o)).join(""));const i=document.createElement("div");i.className="MLK__backdrop",i.appendChild(r),t.appendChild(i),t.addEventListener("pointerdown",Tm,{passive:!1});const n=t.querySelectorAll(".ML__edit-toolbar");if(n)for(const s of n)s.addEventListener("click",o=>{var l,c;let u=o.target,d="";for(;u&&!d;)d=(l=u==null?void 0:u.getAttribute("data-command"))!=null?l:"",u=(c=u==null?void 0:u.parentElement)!=null?c:null;d&&e.executeCommand(JSON.parse(d))});Mm(t.querySelectorAll(".MLK__keycap, .action, .fnbutton, .bigfnbutton"));const a=t.querySelectorAll(".MLK__layer");console.assert(a.length>0,"No virtual keyboards available");for(const s of a)s.addEventListener("pointerdown",o=>o.preventDefault());return e.currentLayer=e.latentLayer,t}function Bm(e,t,r){const i=[];if(!("layers"in t))return"";for(const n of t.layers)i.push(`<div tabindex="-1" class="MLK__layer" id="${n.id}">`),(e.normalizedLayouts.length>1||t.displayEditToolbar)&&(i.push("<div class='MLK__toolbar' role='toolbar'>"),i.push(wm(e,r)),t.displayEditToolbar&&i.push('<div class="ML__edit-toolbar right"></div>'),i.push("</div>")),i.push(Dm(e,n)),i.push("</div>");return i.join("")}function Dm(e,t){if(typeof t=="string")return t;let r="";if(typeof t.style=="string"?r+=`<style>${t.style}</style>`:typeof t.style=="object"&&(r+=`<style>${xm(t.style)}</style>`),t.backdrop&&(r+=`<div class='${t.backdrop}'>`),t.container&&(r+=`<div class='${t.container}'>`),t.rows){r+="<div class=MLK__rows>";for(const i of t.rows){r+="<div dir='ltr' class=MLK__row>";for(const n of i)if(n){const a=e.registerKeycap(n),[s,o]=Ys(n);/(^|\s)separator/.test(o)?r+=`<div class="${o}"`:r+=`<div tabindex="-1" id="${a}" class="${o}"`,n.tooltip&&(r+=` data-tooltip="${n.tooltip}"`),r+=`>${s}</div>`}r+="</div>"}r+="</div>"}else t.markup&&(r+=t.markup);return t.container&&(r+="</div>"),t.backdrop&&(r+="</div>"),r}function Ys(e,t={shifted:!1}){var r,i,n,a,s,o,l;let c="",u=(r=e.class)!=null?r:"";if(t.shifted&&Bn(e)&&(u+=" is-active"),t.shifted&&"shift"in e)typeof e.shift=="string"?c=Aa(e.shift):typeof e.shift=="object"&&(c=e.shift.label?e.shift.label:(i=Aa(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?i:""),typeof e.shift=="object"&&(u=(a=(n=e.shift.class)!=null?n:e.class)!=null?a:"");else{if(c=e.label?e.label:(s=Aa(e.latex||e.insert||"")||e.key)!=null?s:"",e.shift){let d;typeof e.shift=="string"?d=Aa(e.shift):e.shift.label?d=e.shift.label:d=(o=Aa(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?o:"",c+=`<span class="MLK__shift">${d}</span>`}e.aside&&(c+=`<aside>${e.aside}</aside>`)}return e.layer&&!/layer-switch/.test(u)&&(u+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(u)||(u+=" MLK__keycap"),!/\bw[0-9]+\b/.test(u)&&e.width&&(u+=(l={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[e.width])!=null?l:""),[c,u||"MLK__keycap"]}var Yi={"[left]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-left /></svg>",command:["performWithFeedback","moveToPreviousChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-left /></svg>",command:["performWithFeedback","extendSelectionBackward"]}},"[right]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-right /></svg>",command:["performWithFeedback","moveToNextChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-right /></svg>",command:["performWithFeedback","extendSelectionForward"]}},"[up]":{class:"action hide-shift",label:"\u2191",command:["performWithFeedback","moveUp"],shift:{label:"\u219F",command:["performWithFeedback","extendSelectionUpward"]}},"[down]":{class:"action hide-shift",label:"\u2193",command:["performWithFeedback","moveDown"],shift:{label:"\u21A1",command:["performWithFeedback","extendSelectionDownward"]}},"[return]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[action]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{label:"<svg class=svg-glyph><use xlink:href=#circle-plus /></svg>",command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[hr]":{class:"separator horizontal-rule"},"[hide-keyboard]":{class:"action",command:["hideVirtualKeyboard"],width:1.5,label:"<svg class=svg-glyph-lg><use xlink:href=#svg-keyboard-down /></svg>"},"[.]":{variants:".",command:["performWithFeedback","insertDecimalSeparator"],shift:",",class:"big-op hide-shift",label:"."},"[,]":{variants:",",command:["performWithFeedback","insertDecimalSeparator"],shift:".",class:"big-op hide-shift",label:","},"[+]":{variants:[{latex:"\\sum_{#0}^{#0}",class:"small"},"\\oplus"],latex:"+",label:"+",class:"big-op hide-shift",shift:{latex:"\\sum",insert:"\\sum",class:"small"}},"[-]":{variants:["\\pm","\\ominus"],latex:"-",label:"&#x2212;",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"&divide;"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"&times;",shift:{latex:"\\times"},class:"big-op hide-shift"},"[=]":{variants:["\\neq","\\equiv","\\varpropto","\\thickapprox","\\lt","\\gt","\\le","\\ge"],latex:"=",label:"=",shift:{label:"\u2260",latex:"\\ne"},class:"big-op hide-shift"},"[backspace]":{class:"action bottom right hide-shift",width:1.5,command:["performWithFeedback","deleteBackward"],label:"<svg class=svg-glyph><use xlink:href=#svg-delete-backward /></svg>",shift:{class:"action warning",label:"<svg class=svg-glyph><use xlink:href=#svg-trash /></svg>",command:"deleteAll"}},"[undo]":{class:"ghost if-can-undo",command:"undo",label:"<svg class=svg-glyph><use xlink:href=#svg-undo /></svg>",tooltip:"tooltip.undo"},"[redo]":{class:"ghost if-can-redo",command:"redo",label:"<svg class=svg-glyph><use xlink:href=#svg-redo /></svg>",tooltip:"tooltip.redo"},"[(]":{variants:[{latex:"\\lbrack",key:"["},"\\langle","\\lfloor","\\lceil",{latex:"\\lbrace",key:"{"}],key:"(",label:"(",shift:{label:"[",key:"["},class:"hide-shift"},"[)]":{variants:[{latex:"\\rbrack",key:"]"},"\\rangle","\\rfloor","\\rceil",{latex:"\\rbrace",key:"]"}],key:")",label:")",shift:{label:"]",latex:"\\rbrack"},class:"hide-shift"},"[0]":{variants:"0",latex:"0",label:"0",shift:"\\infty",class:"hide-shift"},"[1]":{variants:"1",latex:"1",label:"1",shift:"#@^{-1}",class:"hide-shift"},"[2]":{variants:"2",latex:"2",label:"2",shift:"#@^2",class:"hide-shift"},"[3]":{variants:"3",latex:"3",label:"3",shift:"#@^3",class:"hide-shift"},"[4]":{variants:"4",latex:"4",label:"4",shift:"#@^4",class:"hide-shift"},"[5]":{variants:"5",latex:"5",label:"5",shift:"#@^5",class:"hide-shift"},"[6]":{variants:"6",latex:"6",label:"6",shift:"#@^6",class:"hide-shift"},"[7]":{variants:"7",latex:"7",label:"7",shift:"#@^7",class:"hide-shift"},"[8]":{variants:"8",latex:"8",label:"8",shift:"#@^8",class:"hide-shift"},"[9]":{variants:"9",latex:"9",label:"9",shift:"#@^9",class:"hide-shift"},"[separator-5]":{class:"separator",width:.5},"[separator]":{class:"separator"},"[separator-10]":{class:"separator"},"[separator-15]":{class:"separator",width:1.5},"[separator-20]":{class:"separator",width:2},"[separator-50]":{class:"separator",width:5},"[shift]":{class:"shift bottom left",width:1.5,label:"<span class=caps-lock-indicator></span><svg class=svg-glyph><use xlink:href=#svg-shift /></svg>"},"[foreground-color]":{variants:"foreground-color",command:["applyStyle",{color:"red"}],label:"<span style='border-radius: 50%;width:22px;height:22px; border: 3px solid #cc2428; box-sizing: border-box'>"},"[background-color]":{variants:"background-color",command:["applyStyle",{backgroundColor:"yellow"}],label:"<span style='border-radius: 50%;width:22px;height:22px; background:#fff590; box-sizing: border-box'></span>"}};function Ad(e){var t;if(typeof e=="string"){if(e==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(e="[,]"),!Yi[e])return{latex:e};e={label:e}}let r;return"label"in e&&e.label&&Yi[e.label]&&(r=g(p(p({},Yi[e.label]),e),{label:Yi[e.label].label})),"key"in e&&e.key&&Yi[e.key]&&(r=g(p(p({},Yi[e.key]),e),{key:Yi[e.key].key})),r?(r.command==="insertDecimalSeparator"&&(r.label=(t=window.MathfieldElement.decimalSeparator)!=null?t:"."),e.label==="[action]"&&(r=p(p({},r),window.mathVirtualKeyboard.actionKeycap)),e.label==="[shift]"&&(r=p(p({},r),window.mathVirtualKeyboard.shiftKeycap)),e.label==="[backspace]"&&(r=p(p({},r),window.mathVirtualKeyboard.backspaceKeycap)),e.label==="[tab]"&&(r=p(p({},r),window.mathVirtualKeyboard.tabKeycap)),r):e}var Ba;function Tm(e){var t;if(e.button!==0)return;const r=ki.singleton;if(!r)return;let i=e.target;for(;i&&!i.getAttribute("data-layer");)i=i.parentElement;if(i){r.currentLayer=(t=i.getAttribute("data-layer"))!=null?t:"",e.preventDefault();return}const n=Ln(e.target);if(!(n!=null&&n.id))return;const a=r.getKeycap(n.id);if(!a)return;console.assert(e.type==="pointerdown");const s=new AbortController,o=s.signal;n.classList.add("is-pressed"),n.addEventListener("pointerenter",Qs(s),{capture:!0,signal:o}),n.addEventListener("pointerleave",Qs(s),{capture:!0,signal:o}),n.addEventListener("pointercancel",Qs(s),{signal:o}),n.addEventListener("pointerup",Qs(s),{signal:o}),Bn(a)&&(n.classList.add("is-active"),r.shiftPressCount++),a.variants&&(Ba&&clearTimeout(Ba),Ba=setTimeout(()=>{n.classList.contains("is-pressed")&&(n.classList.remove("is-pressed"),n.classList.add("is-active"),e.target&&"releasePointerCapture"in e.target&&e.target.releasePointerCapture(e.pointerId),Sd(n,()=>{s.abort(),n==null||n.classList.remove("is-active")}))},300)),e.preventDefault()}function Qs(e){return t=>{const r=Ln(t.target);if(!(r!=null&&r.id))return;const i=ki.singleton;if(!i)return;const n=i.getKeycap(r.id);if(n){if(t.type==="pointerenter"&&t.target===r&&t.isPrimary&&r.classList.add("is-pressed"),t.type==="pointercancel"){r.classList.remove("is-pressed"),Bn(n)&&(i.shiftPressCount--,r.classList.toggle("is-active",i.isShifted)),e.abort();return}if(t.type==="pointerleave"&&t.target===r){r.classList.remove("is-pressed"),Bn(n)&&(i.shiftPressCount--,r.classList.toggle("is-active",i.isShifted));return}if(t.type==="pointerup"){Ba&&clearTimeout(Ba),Bn(n)?r.classList.toggle("is-active",i.isShifted):r.classList.contains("is-pressed")&&(r.classList.remove("is-pressed"),i.isShifted&&n.shift?typeof n.shift=="string"?i.executeCommand(["insert",n.shift,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]):wl(n.shift):wl(n),i.shiftPressCount===1&&!t.shiftKey&&(i.shiftPressCount=0)),e.abort(),t.preventDefault();return}}}}function wl(e){var t;let r=e.command;!r&&e.insert&&(r=["insert",e.insert,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),!r&&e.key&&(r=["typedText",e.key,{focus:!0,feedback:!0,simulateKeystroke:!0}]),!r&&e.latex&&(r=["insert",e.latex,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),r||(r=["typedText",e.label,{focus:!0,feedback:!0,simulateKeystroke:!0}]),(t=ki.singleton)==null||t.executeCommand(r)}function Fm(e){if(e.nodeType!==1)return!1;const t=e.classList;return t.contains("MLK__keycap")||t.contains("shift")||t.contains("action")||t.contains("fnbutton")||t.contains("bigfnbutton")}function Ln(e){if(!e)return;let t=e;for(;t&&!Fm(t);)t=t.parentElement;return t!=null?t:void 0}function Bn(e){return!!e.class&&/(^|\s)shift($|\s)/.test(e.class)}var ki=class rf{constructor(){this.originalContainerBottomPadding=null,this.keycapRegistry={},this._shiftPressCount=0;var t,r,i;this.targetOrigin=window.origin,this.originValidator="none",this._alphabeticLayout="auto",this._layouts=Object.freeze(["default"]),this._editToolbar="default",this._container=(r=(t=window.document)==null?void 0:t.body)!=null?r:null,this._visible=!1,this._rebuilding=!1,this.observer=new ResizeObserver(n=>{this.adjustBoundingRect(),this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect})}),this.listeners={};try{(i=window.top)==null||i.addEventListener("message",this)}catch(n){window.addEventListener("message",this)}document.body.addEventListener("focusin",n=>{const a=n.target;a!=null&&a.isConnected&&setTimeout(()=>{const s=Ld();s&&!s.readOnly&&s.mathVirtualKeyboardPolicy==="auto"&&mt()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",n=>{n.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{Ld()||this.hide()},300)})}get currentLayer(){var t,r,i;return(i=(r=(t=this._element)==null?void 0:t.querySelector(".MLK__layer.is-visible"))==null?void 0:r.id)!=null?i:""}set currentLayer(t){var r;if(!this._element){this.latentLayer=t;return}let i=t?this._element.querySelector(`#${t}.MLK__layer`):null;i||(i=this._element.querySelector(".MLK__layer")),i&&((r=this._element.querySelector(".MLK__layer.is-visible"))==null||r.classList.remove("is-visible"),i.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(t){var r;this._shiftPressCount=t>2||t<0?0:t,(r=this._element)==null||r.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(t){const r="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[r]=t,r}getKeycap(t){return t?this.keycapRegistry[t]:void 0}getLayer(t){const r=this.normalizedLayouts;for(const i of r)for(const n of i.layers)if(n.id===t)return n}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(t){this._alphabeticLayout=t,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(t){this._actionKeycap=typeof t=="string"?{label:t}:t}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(t){this._shiftKeycap=typeof t=="string"?{label:t}:t}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(t){this._backspaceKeycap=typeof t=="string"?{label:t}:t}get tabKeycap(){return this._tabKeycap}set tabKeycap(t){this._tabKeycap=typeof t=="string"?{label:t}:t}get layouts(){return this._layouts}set layouts(t){this.updateNormalizedLayouts(t),this.rebuild()}updateNormalizedLayouts(t){const r=Array.isArray(t)?[...t]:[t],i=r.findIndex(n=>n==="default");i>=0&&r.splice(i,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(r),this._normalizedLayouts=r.map(n=>Ed(n))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(t){this._editToolbar=t,this.rebuild()}get container(){return this._container}set container(t){this._container=t,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new rf}catch(t){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(t,r,i){this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].has(r)||this.listeners[t].add(r)}dispatchEvent(t){return!this.listeners[t.type]||this.listeners[t.type].size===0?!0:(this.listeners[t.type].forEach(r=>{typeof r=="function"?r(t):r==null||r.handleEvent(t)}),!t.defaultPrevented)}removeEventListener(t,r,i){this.listeners[t]&&this.listeners[t].delete(r)}get element(){return this._element}set element(t){var r;this._element!==t&&((r=this._element)==null||r.remove(),this._element=t)}get visible(){return this._visible}set visible(t){t?this.show():this.hide()}get boundingRect(){var t;if(!this._visible)return new DOMRect;const r=(t=this._element)==null?void 0:t.getElementsByClassName("MLK__plate")[0];return r?r.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var t,r;const i=this.boundingRect.height;if(this.container===document.body){(t=this._element)==null||t.style.setProperty("--_keyboard-height",`calc(${i}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const n=i-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${n}px)`:`${n}px`}else(r=this._element)==null||r.style.setProperty("--_keyboard-height",`${i}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const t=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=t,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;const t=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(t&&(t.backdrop||t.container)));const r=this._element.querySelectorAll(".MLK__layer.is-visible .MLK__keycap, .MLK__layer.is-visible .action, .fnbutton, .MLK__layer.is-visible .bigfnbutton, .MLK__layer.is-visible .shift");if(r)for(const i of r){const n=this.getKeycap(i.id);if(n){const[a,s]=Ys(n,{shifted:this.isShifted});i.innerHTML=window.MathfieldElement.createHTML(a),i.className=s}}}show(t){var r;if(this._visible)return;const i=this.container;if(i&&window.mathVirtualKeyboard&&this.stateWillChange(!0)){if(this._element||(this.buildAndAttachElement(),this.adjustBoundingRect()),!this._visible){const n=this._element.getElementsByClassName("MLK__plate")[0];if(n&&this.observer.observe(n),i===window.document.body){const a=i.style.paddingBottom;this.originalContainerBottomPadding=a;const s=n.offsetHeight-1;i.style.paddingBottom=a?`calc(${a} + ${s}px)`:`${s}px`}window.addEventListener("mouseup",this),window.addEventListener("blur",this),window.addEventListener("keydown",this,{capture:!0}),window.addEventListener("keyup",this,{capture:!0}),(r=this._element)==null||r.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.currentLayer=this.latentLayer}this._visible=!0,t!=null&&t.animate?requestAnimationFrame(()=>{this._element&&(this._element.classList.add("animate"),this._element.addEventListener("transitionend",()=>{var n;return(n=this._element)==null?void 0:n.classList.remove("animate")},{once:!0}),this._element.classList.add("is-visible"),this.stateChanged())}):(this._element.classList.add("is-visible"),this.stateChanged())}}hide(t){var r;const i=this.container;if(i&&this._visible&&this.stateWillChange(!1)){if(this._visible=!1,this._element){this.latentLayer=this.currentLayer;const n=this._element.getElementsByClassName("MLK__plate")[0];n&&this.observer.unobserve(n),window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("keydown",this,{capture:!0}),window.removeEventListener("keyup",this,{capture:!0}),window.removeEventListener("contextmenu",this,{capture:!0}),Ea(),Em(),(r=this._element)==null||r.remove(),this._element=void 0,this.originalContainerBottomPadding!==null&&(i.style.paddingBottom=this.originalContainerBottomPadding)}this.stateChanged()}}get height(){var t,r;return(r=(t=this.element)==null?void 0:t.offsetHeight)!=null?r:0}buildAndAttachElement(){var t;console.assert(!this.element),this.element=Lm(this),window.addEventListener("contextmenu",this,{capture:!0}),this.element.addEventListener("contextmenu",r=>{r.shiftKey||((r.ctrlKey||r.button===2)&&Sd(r.target),r.preventDefault(),r.stopPropagation())},{capture:!0}),(t=this.container)==null||t.appendChild(this.element)}handleEvent(t){if(_l(t)){if(!cl(t.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${t.origin}) cannot be handled`,"SecurityError");t.data.action==="disconnect"?this.connectedMathfieldWindow=void 0:t.data.action!=="update-setting"&&t.data.action!=="proxy-created"&&t.data.action!=="execute-command"&&(console.assert(t.source!==void 0),this.connectedMathfieldWindow=t.source),this.handleMessage(t.data,t.source)}if(this._element)switch(t.type){case"mouseup":case"blur":document.body.style.userSelect="",this.shiftPressCount=0;break;case"contextmenu":t.button!==2&&t.preventDefault();break;case"keydown":{t.key==="Shift"&&!t.repeat&&(this.shiftPressCount=1);break}case"keyup":{(t.key==="Shift"||!t.getModifierState("Shift")&&this.shiftPressCount!==2)&&(this.shiftPressCount=0);break}}}handleMessage(t,r){const{action:i}=t;if(i==="execute-command"){const{command:n}=t,a=An(n);if(window.top!==void 0&&a!=="virtual-keyboard")return;this.executeCommand(n);return}if((i==="connect"||i==="show")&&this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},r),i!=="disconnect"&&window===window.top){if(i==="show"){typeof t.animate!="undefined"?this.show({animate:t.animate}):this.show();return}if(i==="hide"){typeof t.animate!="undefined"?this.hide({animate:t.animate}):this.hide();return}if(i==="update-setting"){t.alphabeticLayout&&(this.alphabeticLayout=t.alphabeticLayout),t.layouts&&(this.layouts=t.layouts),t.editToolbar&&(this.editToolbar=t.editToolbar);return}if(i==="proxy-created"){this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},r);return}}}sendMessage(t,r,i){if(i||(i=this.connectedMathfieldWindow),this.targetOrigin===null||this.targetOrigin==="null"||i===window){window.dispatchEvent(new MessageEvent("message",{source:window,data:p({type:$s,action:t},r)}));return}if(i)i.postMessage(p({type:$s,action:t},r),{targetOrigin:this.targetOrigin});else if(r.command&&this.dispatchEvent(new CustomEvent("math-virtual-keyboard-command",{detail:r.command})),t==="execute-command"&&Array.isArray(r.command)&&r.command[0]==="insert"){const n=r.command[1].split("");for(const a of n)this.dispatchEvent(new KeyboardEvent("keydown",{key:a,bubbles:!0})),this.dispatchEvent(new KeyboardEvent("keyup",{key:a,bubbles:!0}))}}stateWillChange(t){return this.dispatchEvent(new CustomEvent("before-virtual-keyboard-toggle",{detail:{visible:t},bubbles:!0,cancelable:!0,composed:!0}))}stateChanged(){this.dispatchEvent(new Event("virtual-keyboard-toggle")),this._visible||(this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect}))}focus(){this.sendMessage("focus",{})}blur(){this.sendMessage("blur",{})}updateToolbar(t){const r=this._element;if(!r)return;r.classList.toggle("is-math-mode",t.mode==="math"),r.classList.toggle("is-text-mode",t.mode==="text"),r.classList.toggle("can-undo",t.canUndo),r.classList.toggle("can-redo",t.canRedo),r.classList.toggle("can-copy",!t.selectionIsCollapsed),r.classList.toggle("can-copy",!t.selectionIsCollapsed),r.classList.toggle("can-paste",!0);const i=r.querySelectorAll(".ML__edit-toolbar");if(i)for(const n of i)n.innerHTML=km(this,t)}update(t){this._style=t.style,this.updateToolbar(t)}connect(){this.connectedMathfieldWindow=window}disconnect(){this.connectedMathfieldWindow=void 0}executeCommand(t){let r,i=[],n=An(t);return le(t)?(r=t[0],r==="performWithFeedback"&&(t=t.slice(1),n=An(t)),i=t.slice(1)):r=t,r=r.replace(/-\w/g,a=>a[1].toUpperCase()),n==="virtual-keyboard"?Pr[r].fn(void 0,...i):(this.sendMessage("execute-command",{command:t}),!1)}dispose(){window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("message",this)}};function Ld(){var e,t;let r=Hs(),i=null;for(;r;){if("host"in r&&((t=(e=r.host)==null?void 0:e.tagName)==null?void 0:t.toLowerCase())==="math-field"){i=r.host;break}r=r.parentNode}return i}if(Me()&&!("mathVirtualKeyboard"in window))if(window===window.top){const e=ki.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>e})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>gm.singleton,configurable:!0});function eo(e){const t={};for(const r of Object.keys(e))switch(r){case"scriptDepth":const i=e.scriptDepth;if(le(i))t.scriptDepth=[i[0],i[1]];else if(typeof i=="number")t.scriptDepth=[i,i];else if(typeof i=="string"){const[a,s]=i.split(",").map(o=>parseInt(o.trim()));t.scriptDepth=[a,s]}else throw new TypeError("Unexpected value for scriptDepth");break;case"mathVirtualKeyboardPolicy":let n=e.mathVirtualKeyboardPolicy.toLowerCase();if(n==="sandboxed"){if(window!==window.top){const a=ki.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>a})}n="manual"}t.mathVirtualKeyboardPolicy=n;break;case"letterShapeStyle":e.letterShapeStyle==="auto"?N.locale.startsWith("fr")?t.letterShapeStyle="french":t.letterShapeStyle="tex":t.letterShapeStyle=e.letterShapeStyle;break;case"defaultMode":["text","math","inline-math"].includes(e.defaultMode)?t.defaultMode=e.defaultMode:(console.error('MathLive 0.98.5: valid values for defaultMode are "text", "math" or "inline-math"'),t.defaultMode="math");break;case"macros":t.macros=Cr(e.macros);break;default:le(e[r])?t[r]=[...e[r]]:typeof e[r]=="object"&&!(e[r]instanceof Element)&&r!=="computeEngine"?t[r]=p({},e[r]):t[r]=e[r]}return t}function Qi(e,t){let r;typeof t=="string"?r=[t]:t===void 0?r=Object.keys(e):r=t;const i={};for(const n of r)e[n]===null?i[n]=null:le(e[n])?i[n]=[...e[n]]:typeof e[n]=="object"&&!(e[n]instanceof Element)&&n!=="computeEngine"?i[n]=p({},e[n]):i[n]=e[n];return typeof t=="string"?i[t]:i}function to(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:Rt,backgroundColorMap:ye,letterShapeStyle:N.locale.startsWith("fr")?"french":"tex",minFontScale:0,smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,isImplicitFunction:e=>["\\sin","\\cos","\\tan","\\arcsin","\\arccos","\\arctan","\\arcsec","\\arccsc","\\arsinh","\\arcosh","\\artanh","\\arcsech","\\arccsch","\\arg","\\ch","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\sec","\\sinh","\\sh","\\tanh","\\tg","\\th","\\lg","\\lb","\\log","\\ln"].includes(e),mathModeSpace:"",placeholderSymbol:"\u25A2",contentPlaceholder:"",popoverPolicy:"auto",environmentPopoverPolicy:"off",keybindings:zf,inlineShortcuts:P0,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:Pf,value:""}}function Bd(e){return e.defaultMode==="inline-math"?"math":e.defaultMode}function Mi(e,t){!e||!t||(le(e)?e.forEach(r=>Mi(r,t)):typeof e=="object"&&!e.style.color&&!e.style.backgroundColor&&!e.style.fontFamily&&!e.style.fontShape&&!e.style.fontSeries&&!e.style.fontSize&&!e.style.variant&&!e.style.variantStyle&&(e.applyStyle(t),Mi(e.body,t),Mi(e.above,t),Mi(e.below,t),Mi(e.subscript,t),Mi(e.superscript,t)))}function kl(e,t,r,i){function n(s,o){for(const l of a)if(l.style[s]!==o)return!1;return!0}if(t=e.normalizeRange(t),t[0]===t[1])return!1;const a=e.getAtoms(t,{includeChildren:!0});i.operation==="toggle"&&(r.color&&n("color",r.color)&&(r.color="none",delete r.verbatimColor),r.backgroundColor&&n("backgroundColor",r.backgroundColor)&&(r.backgroundColor="none",delete r.verbatimBackgroundColor),r.fontFamily&&n("fontFamily",r.fontFamily)&&(r.fontFamily="none"),r.fontSeries&&n("fontSeries",r.fontSeries)&&(r.fontSeries="auto"),r.fontShape&&n("fontShape",r.fontShape)&&(r.fontShape="auto"),r.fontSize&&n("fontSize",r.fontSize)&&(r.fontSize=Yo),r.variant&&n("variant",r.variant)&&(r.variant="normal"),r.variantStyle&&n("variantStyle",r.variantStyle)&&(r.variantStyle=""));for(const s of a)s.applyStyle(r);return!0}function Pm(e,t){const r=e.at(e.position);if(r.type==="composition")r.value=t;else{const{caret:i}=r;r.caret=void 0;const n=new $0(t,{mode:r.mode});n.caret=i,r.parent.addChildAfter(n,r),e.position+=1}}function zm(e){const t=e.at(e.position);t.type==="composition"&&(t.parent.removeChild(t),e.position-=1)}Pt(["math","displaymath"],lr),Pt("center",lr),M("displaylines","",{parse:e=>{const t=[];let r=[];e.beginContext({tabular:!0});do{if(e.end()||e.match("<}>"))break;e.matchColumnSeparator()||e.matchRowSeparator()?(t.push([r]),r=[]):r.push(...e.scan(i=>["<}>","&","\\cr","\\\\","\\tabularnewline"].includes(i)))}while(!0);return e.endContext(),t.push([r]),t},createAtom:e=>new ae("lines",e.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),Ct("array","{columns:colspec}",(e,t,r,i)=>new ae(e,Ml(t),r,{columns:i[0],mathstyleName:"textstyle"})),Ct(["equation","equation*","subequations"],"",(e,t,r)=>new ae(e,Ml(t),r,{columns:[{align:"c"}]})),Ct(["multline","multline*"],"",lr),Ct(["align","align*","aligned","eqnarray"],"",lr),Ct("split","",lr),Ct(["gather","gathered"],"",lr),Ct(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",lr),Ct(["smallmatrix","smallmatrix*"],"[columns:colspec]",lr),Ct(["cases","dcases","rcases"],"",lr);function Km(e){for(const t of e)for(const r of t)if(r.length>0)return!1;return!0}function Ml(e,t=1){return Km(e)?Array(t).fill([[new w({type:"first"}),new ti]]):e.map(r=>r.length===0?[[new w({type:"first"})]]:r.map(i=>i.length===0?[new w({type:"first"})]:(i[0].type!=="first"&&i.unshift(new w({type:"first"})),i)))}function lr(e,t=[[[]]],r=[],i=[]){switch(t=Ml(t,["split","align","align*","aligned","eqnarray"].includes(e)?2:1),e){case"math":return new ae(e,t,r,{mathstyleName:"textstyle"});case"displaymath":return new ae(e,t,r,{mathstyleName:"textstyle"});case"center":return new ae(e,t,r,{columns:[{align:"c"}]});case"multline":case"multline*":return new ae(e,t,r,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new ae(e,t,r,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new ae(e,t,r,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new ae(e,t,r,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:en(i[0])});case"bmatrix":case"bmatrix*":return new ae(e,t,r,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:en(i[0])});case"Bmatrix":case"Bmatrix*":return new ae(e,t,r,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:en(i[0])});case"vmatrix":case"vmatrix*":return new ae(e,t,r,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:en(i[0])});case"Vmatrix":case"Vmatrix*":return new ae(e,t,r,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:en(i[0])});case"matrix":case"matrix*":return new ae(e,t,r,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:en(i==null?void 0:i[0])});case"smallmatrix":case"smallmatrix*":return new ae(e,t,r,{mathstyleName:"scriptstyle",columns:en(i==null?void 0:i[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new ae(e,t,r,{mathstyleName:e==="dcases"?"displaystyle":"textstyle",arraystretch:1.2,leftDelim:"\\lbrace",rightDelim:".",columns:[{align:"l"},{gap:1},{align:"l"}]});case"rcases":return new ae(e,t,r,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new ae(e,t,r,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let n=0;for(const o of t)n=Math.max(n,o.length);const a=[{gap:0},{align:"r"},{gap:.25},{align:"l"}];let s=2;for(;s<n;)a.push({gap:1},{align:"r"},{gap:.25},{align:"l"}),s+=2;return a.push({gap:0}),new ae(e,t,r,{arraycolsep:0,columns:a,minColumns:2})}}return new ae(e,t,r,{mathstyleName:"textstyle"})}function en(e){return e!=null?e:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}]}function Nm(e,t){let r=e.at(e.position);for(;r&&!(r.parent instanceof ae);)r=r.parent;if(r&&r.type==="array"&&r.environmentName,!r||!(r.parent instanceof ae)){const i=e.at(e.position);if(r=i,!r.parent.parent){let n=e.extractAtoms([e.position,e.lastOffset]),a=e.extractAtoms([0,e.position]);a.length===0&&(a=no()),n.length===0&&(n=no());let s;return t.endsWith("column")?(s=lr("split",[[a,n]]),e.root=s,tn(s,0,0)?rn(e,s,0,0):tn(s,0,1)?rn(e,s,0,1):e.position=e.offsetOf(i)):(s=lr("lines",[[a],[n]]),e.root=s,tn(s,0,0)?rn(e,s,0,0):tn(s,1,0)?rn(e,s,1,0):e.position=e.offsetOf(i)),[void 0,[0,0]]}if(r.parent instanceof Le){const n=r.parent;let a=e.extractAtoms([e.position,e.offsetOf(n.lastChild)]),s=e.extractAtoms([e.offsetOf(n.firstChild),e.position]);s.length===0&&(s=no()),a.length===0&&(a=no());let o="pmatrix";const l=n.leftDelim,c=n.rightDelim;l==="("&&(c===")"||c==="?")?o="pmatrix":(l==="["||l==="\\lbrack")&&(c==="]"||c==="\\rbrack"||c==="?")?o="bmatrix":l==="\\vert"&&c==="\\vert"?o="vmatrix":l==="\\Vert"&&c==="\\Vert"?o="Vmatrix":(l==="{"||l==="\\lbrace")&&(c==="."||c==="?")&&(o="cases");const u=lr(o,t.endsWith("column")?[[s,a]]:[[s],[a]]);return n.parent.addChildBefore(u,n),n.parent.removeChild(n),tn(u,0,0)?rn(e,u,0,0):t.endsWith("column")?tn(u,0,1)?rn(e,u,0,1):e.position=e.offsetOf(r):tn(u,1,0)?rn(e,u,1,0):e.position=e.offsetOf(r),[void 0,[0,0]]}}return r&&r.parent instanceof ae?[r.parent,r.parentBranch]:[void 0,[0,0]]}function tn(e,t,r){const i=e.getCell(t,r);return!i||i.length!==2?!1:i[1].type==="placeholder"}function Om(e,t,r,i){const n=t.getCell(r,i);return n?[e.offsetOf(n[0]),e.offsetOf(n[n.length-1])]:-1}function rn(e,t,r,i){const n=Om(e,t,r,i);typeof n!="number"&&e.setSelection(n)}function ro(e,t,r,i,n){const a=t.getCell(r,i);a&&e.setPositionHandlingPlaceholder(e.offsetOf(a[n==="start"?0:a.length-1]))}function io(e,t){const[r,[i,n]]=Nm(e,t);if(r)switch(t){case"after row":r.addRowAfter(i),ro(e,r,i+1,0,"end");break;case"after column":if(r.maxColumns<=r.colCount){e.announce("plonk");return}r.addColumnAfter(n),ro(e,r,i,n+1,"end");break;case"before row":r.addRowBefore(i),ro(e,r,i,0,"start");break;case"before column":if(r.maxColumns<=r.colCount){e.announce("plonk");return}r.addColumnBefore(n),ro(e,r,i,n,"start");break}}function Dd(e){return e.contentWillChange({inputType:"insertText"})?(io(e,"after row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function Im(e){return e.contentWillChange({inputType:"insertText"})?(io(e,"before row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function Td(e){return e.contentWillChange({inputType:"insertText"})?(io(e,"after column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function Rm(e){return e.contentWillChange({inputType:"insertText"})?(io(e,"before column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function Fd(e,t){if(!e.contentWillChange({}))return!1;e.mathfield.snapshot();let r=".",i=".";switch(t){case"pmatrix":case"pmatrix*":r="(",i=")";break;case"bmatrix":case"bmatrix*":r="[",i="]";break;case"Bmatrix":case"Bmatrix*":r="\\lbrace",i="\\rbrace";break;case"vmatrix":case"vmatrix*":r="\\vert",i="\\vert";break;case"Vmatrix":case"Vmatrix*":r="\\Vert",i="\\Vert";break;case"matrix":case"matrix*":r=".",i=".";break;case"cases":case"dcases":r="\\lbrace";break;case"rcases":i="\\rbrace";break}const n=e.at(e.position),a=n.type==="array"?n:e.parentEnvironment;return a.environmentName=t,a.leftDelim=r,a.rightDelim=i,e.contentDidChange({}),!0}function Pd(e,t){let r=e.at(e.position);for(;r&&!(Array.isArray(r.parentBranch)&&r.parent instanceof ae);)r=r.parent;if(Array.isArray(r==null?void 0:r.parentBranch)&&(r==null?void 0:r.parent)instanceof ae){const i=r.parent,n=r.parentBranch;let a;switch(t){case"row":if(i.rowCount>1){i.removeRow(n[0]);const s=i.getCell(Math.max(0,n[0]-1),n[1]);a=e.offsetOf(s[s.length-1])}break;case"column":if(i.colCount>i.minColumns){i.removeColumn(n[1]);const s=i.getCell(n[0],Math.max(0,n[1]-1));a=e.offsetOf(s[s.length-1])}break}a&&e.setPositionHandlingPlaceholder(a)}}function qm(e){return e.contentWillChange({inputType:"deleteContent"})?(Pd(e,"row"),e.contentDidChange({inputType:"deleteContent"}),!0):!1}function Vm(e){return e.contentWillChange({inputType:"deleteContent"})?(Pd(e,"column"),e.contentDidChange({inputType:"deleteContent"}),!0):!1}It({addRowAfter:Dd,addColumnAfter:Td,addRowBefore:Im,addColumnBefore:Rm,removeRow:qm,removeColumn:Vm,setEnvironment:Fd},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function no(){return[new ti]}var zd=class nf{constructor(t){this.recording=!1,this.model=t,this.reset()}reset(){this.stack=[],this.index=-1,this.lastOp=""}startRecording(){this.recording=!0}stopRecording(){this.recording=!1}canUndo(){return this.index-1>=0}canRedo(){return this.stack.length-1>this.index}stopCoalescing(t){t&&this.index>=0&&(this.stack[this.index].selection=t),this.lastOp=""}undo(){return this.canUndo()?(this.model.setState(this.stack[this.index-1],{silenceNotifications:!1,type:"undo"}),this.index-=1,this.lastOp="",!0):!1}redo(){return this.canRedo()?(this.index+=1,this.model.setState(this.stack[this.index],{silenceNotifications:!1,type:"redo"}),this.lastOp="",!0):!1}pop(){this.canUndo()&&(this.stack.splice(this.index,this.stack.length-this.index),this.index-=1)}snapshot(t){return this.recording?(t&&t===this.lastOp&&this.pop(),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push(this.model.getState()),this.index+=1,this.stack.length>nf.maximumDepth&&(this.stack.shift(),this.index-=1),this.lastOp=t!=null?t:"",!0):!1}};zd.maximumDepth=1e3;var Hm=zd;function Sl(e,t,r){if(e.at(t).mode!=="text")return t;const i=r==="backward"?-1:1;let n;if(Sr.test(e.at(t).value)){let a=t,s;do s=e.at(a).mode==="text"&&Sr.test(e.at(a).value),a+=i;while(e.at(a)&&s);n=e.at(a)?a-2*i:a-i}else if(/\s/.test(e.at(t).value)){let a=t;for(;e.at(a)&&e.at(a).mode==="text"&&/\s/.test(e.at(a).value);)a+=i;if(!e.at(a))n=a-i;else{let s=!0;do s=e.at(a).mode==="text"&&!/\s/.test(e.at(a).value),a+=i;while(e.at(a)&&s);n=e.at(a)?a-2*i:a-i}}else{let a=t;for(;e.at(a)&&e.at(a).mode==="text"&&!/\s/.test(e.at(a).value);)a+=i;n=e.at(a)?a:a-i;let s=!0;for(;e.at(a)&&s;)s=e.at(a).mode==="text"&&/\s/.test(e.at(a).value),s&&(n=a),a+=i;n=e.at(a)?a-2*i:a-i}return n-(i>0?0:1)}function Dn(e,t,r){var i,n,a,s,o,l,c;const u=e.position;(i=r==null?void 0:r.extend)!=null&&i||e.collapseSelection(t);let d=e.at(e.position);if(t==="forward"&&(d.type==="subsup"?(d=d.rightSibling,d||(d=e.at(e.position+1))):d=e.at(e.position+1)),!d)return e.announce("plonk"),!1;let h=e.offsetOf(d);if(d instanceof da)h=Sl(e,h,t);else if(d instanceof tt)if(d.isSuggestion)for(console.assert(t==="forward");d&&d instanceof tt;)d.isSuggestion=!1,h=e.offsetOf(d),d=d.rightSibling;else if(t==="forward"){if(d=d.rightSibling,!d||!(d instanceof tt))return e.announce("plonk"),!1;for(;d&&d instanceof tt&&/[a-zA-Z\*]/.test(d.value);)h=e.offsetOf(d),d=d.rightSibling}else{if(d=d.leftSibling,!d||!(d instanceof tt))return e.announce("plonk"),!1;for(;d&&d instanceof tt&&/[a-zA-Z\*]/.test(d.value);)h=e.offsetOf(d),d=d.leftSibling}else if(t==="forward"&&d.type==="mopen"){let f=0;do d.type==="mopen"?f+=1:d.type==="mclose"&&(f-=1),d=d.rightSibling;while(!d.isLastSibling&&f!==0);h=e.offsetOf(d.leftSibling)}else if(t==="backward"&&d.type==="mclose"){let f=0;do d.type==="mopen"?f+=1:d.type==="mclose"&&(f-=1),d=d.leftSibling;while(!d.isFirstSibling&&f!==0);h=e.offsetOf(d)}else if(t==="backward")if(d.type==="first")for(;h>0&&d.type==="first";)h-=1,d=e.at(h);else{const f=d.type;d.type==="subsup"&&(h=e.offsetOf(e.at(h).leftSibling)),h-=1;let m=(n=e.at(h))==null?void 0:n.type;for(;h>=0&&m===f;)((a=e.at(h))==null?void 0:a.type)==="subsup"?h=e.offsetOf(e.at(h).leftSibling):h-=1,m=e.at(h).type}else{const{type:f}=d;let m=(s=e.at(h))==null?void 0:s.type;const{lastOffset:y}=e;for(;h<=y&&(m===f||m==="subsup");){for(;((o=e.at(h).rightSibling)==null?void 0:o.type)==="subsup";)h=e.offsetOf(e.at(h).rightSibling);h+=1,m=(l=e.at(h))==null?void 0:l.type}h-=1}if((c=r==null?void 0:r.extend)!=null&&c){if(!e.setSelection(e.anchor,h))return e.announce("plonk"),!1}else{if(h===e.position)return e.announce("plonk"),!1;e.position=h}return e.announce("move",u),e.mathfield.stopCoalescingUndo(),!0}function zr(e,t,r){var i,n;if(r=r!=null?r:{extend:!1},e.mathfield.adoptStyle=t==="backward"?"right":"left",t!=="forward"){const[o,l]=bd(e);o!==void 0&&l!==void 0&&e.deleteAtoms([o,l])}if(t==="upward")return Wm(e,r);if(t==="downward")return Um(e,r);if(r.extend){let o=ao(e,e.position,t);o<0&&(o=0),o>e.lastOffset&&(o=e.lastOffset);const l=e.setSelection(e.anchor,o);return e.mathfield.stopCoalescingUndo(),l}if(e.selectionIsPlaceholder){e.collapseSelection(t);const o=zr(e,t);return e.mathfield.stopCoalescingUndo(),o}let a=e.position;const s=a;if(e.collapseSelection(t)?(a=e.position,Kd(e,a)||(a=ao(e,a,t))):a=ao(e,a,t),a<0||a>e.lastOffset){let o=!0;return e.silenceNotifications||(o=(n=(i=e.mathfield.host)==null?void 0:i.dispatchEvent(new CustomEvent("move-out",{detail:{direction:t},cancelable:!0,bubbles:!0,composed:!0})))!=null?n:!0),o&&e.announce("plonk"),o}return e.setPositionHandlingPlaceholder(a),e.mathfield.stopCoalescingUndo(),e.announce("move",s),!0}function ao(e,t,r){return t=t+(r==="forward"?1:-1),t<0||t>e.lastOffset||Kd(e,t)?t:ao(e,t,r)}function Kd(e,t){var r;const i=e.at(t);let n=i.parent;for(;n&&!n.inCaptureSelection;)n=n.parent;return!(n!=null&&n.inCaptureSelection||(r=i.parent)!=null&&r.skipBoundary&&(!i.isFirstSibling&&i.isLastSibling||i.type==="first")||e.mathfield.hasEditablePrompts&&!i.parentPrompt)}function jm(e,t,r){let i=1/0,n=0;for(;n<t.length;n++){const a=q0(e.getHTMLElement(t[n])).right,s=Math.abs(r-a);if(s<=i)i=s;else break}return t[n-1]}function so(e,t,r,i,n){const a=e.mathfield.hasEditablePrompts,s=a?r.filter(c=>c.type==="prompt"&&!c.captureSelection):r,o=q0(e.mathfield.getHTMLElement(t)).right,l=e.offsetOf(jm(e.mathfield,s,o))-(a?1:0);if(i){const[c,u]=e.selection.ranges[0];let d;l<(n==="up"?c:u)?d={ranges:[[l,u]],direction:"backward"}:d={ranges:[[c,l]],direction:"forward"},e.setSelection(d)}else e.setPositionHandlingPlaceholder(l);e.announce(`move ${n}`)}function Wm(e,t){var r,i;const n=(r=t==null?void 0:t.extend)!=null?r:!1;n||e.collapseSelection("backward");const a=()=>{var l,c;let u=!0;return e.silenceNotifications||(u=(c=(l=e.mathfield.host)==null?void 0:l.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?c:!0),e.announce(u?"plonk":"line"),u},s=e.at(e.position);let o=s;for(;o&&o.parentBranch!=="below"&&!(Array.isArray(o.parentBranch)&&o.parent instanceof ae);)o=o.parent;if(Array.isArray(o==null?void 0:o.parentBranch)&&o.parent instanceof ae){const l=o.parent;if(o.parentBranch[0]<1)return a();const c=o.parentBranch[0]-1,u=l.array[c][o.parentBranch[1]];if(!u.some(h=>h.type==="prompt"&&!h.captureSelection)&&e.mathfield.hasEditablePrompts)return a();so(e,s,u,n,"up")}else if(o){const l=(i=o.parent.branch("above"))!=null?i:o.parent.createBranch("above");if(!l.some(u=>u.type==="prompt"&&u.placeholderId)&&e.mathfield.hasEditablePrompts)return a();so(e,s,l,n,"up")}else return a();return e.mathfield.stopCoalescingUndo(),!0}function Um(e,t){var r,i;const n=(r=t==null?void 0:t.extend)!=null?r:!1;n||e.collapseSelection("forward");const a=()=>{var l,c;let u=!0;return e.silenceNotifications||(u=(c=(l=e.mathfield.host)==null?void 0:l.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?c:!0),e.announce(u?"plonk":"line"),u},s=e.at(e.position);let o=s;for(;o&&o.parentBranch!=="above"&&!(Array.isArray(o.parentBranch)&&o.parent instanceof ae);)o=o.parent;if(Array.isArray(o==null?void 0:o.parentBranch)&&o.parent instanceof ae){const l=o.parent;if(o.parentBranch[0]+1>l.array.length-1)return a();const c=o.parentBranch[0]+1,u=l.array[c][o.parentBranch[1]];if(!u.some(h=>h.type==="prompt"&&!h.captureSelection)&&e.mathfield.hasEditablePrompts)return a();so(e,s,u,n,"down")}else if(o){const l=(i=o.parent.branch("below"))!=null?i:o.parent.createBranch("below");if(!l.some(u=>u.type==="prompt")&&e.mathfield.hasEditablePrompts)return a();so(e,s,l,n,"down")}else return a();return!0}function Nd(e){const t=e.position,r=e.at(t).parent;return r!=null&&r.parent?(e.position=e.offsetOf(r),e.mathfield.stopCoalescingUndo(),e.announce("move",t),!0):(e.announce("plonk"),!1)}function Zm(e){let t=0,r=e.at(e.position),i=!1;for(;r;)(!r.hasEmptyBranch("superscript")||!r.hasEmptyBranch("subscript"))&&(t+=1),r.hasEmptyBranch("superscript")?r.hasEmptyBranch("subscript")||(i=!1):i=!0,r=r.parent;return i?t:0}function Jm(e){let t=0,r=e.at(e.position),i=!1;for(;r;)(!r.hasEmptyBranch("superscript")||!r.hasEmptyBranch("subscript"))&&(t+=1),r.hasEmptyBranch("superscript")?r.hasEmptyBranch("subscript")||(i=!0):i=!1,r=r.parent;return i?t:0}function Od(e){var t;if(e.collapseSelection(),Zm(e)>=e.mathfield.options.scriptDepth[1])return e.announce("plonk"),!1;let r=e.at(e.position);return r.subsupPlacement===void 0&&(((t=r.rightSibling)==null?void 0:t.type)!=="subsup"&&r.parent.addChildAfter(new Os({style:r.computedStyle}),r),r=r.rightSibling),r.createBranch("superscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(r.superscript[0]))),!0}function Id(e){var t;if(e.collapseSelection(),Jm(e)>=e.mathfield.options.scriptDepth[0])return e.announce("plonk"),!1;let r=e.at(e.position);return r.subsupPlacement===void 0&&(((t=e.at(e.position+1))==null?void 0:t.type)!=="subsup"&&r.parent.addChildAfter(new Os({style:e.at(e.position).computedStyle}),r),r=e.at(e.position+1)),r.createBranch("subscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(r.subscript[0]))),!0}function Xm(){function e(l){const c=[],u=[];return[...l.querySelectorAll(`input, select, textarea, a[href], button,
[tabindex], audio[controls], video[controls],
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(t).forEach((h,f)=>{const m=i(h);m===0?c.push(h):u.push({documentOrder:f,tabIndex:m,node:h})}),u.sort((h,f)=>h.tabIndex===f.tabIndex?h.documentOrder-f.documentOrder:h.tabIndex-f.tabIndex).map(h=>h.node).concat(c)}function t(l){return!(!r(l)||n(l)||i(l)<0)}function r(l){return!(l.disabled||l.type==="hidden"&&l.tagName.toUpperCase()==="INPUT"||o(l))}function i(l){var c;const u=Number.parseInt((c=l.getAttribute("tabindex"))!=null?c:"NaN",10);return Number.isNaN(u)?l.contentEditable==="true"||(l.nodeName==="AUDIO"||l.nodeName==="VIDEO")&&l.getAttribute("tabindex")===null?0:l.tabIndex:u}function n(l){return l.tagName.toUpperCase()==="INPUT"&&l.type==="radio"&&!s(l)}function a(l,c){for(const u of l)if(u.checked&&u.form===c)return u;return null}function s(l){var c;if(!l.name)return!0;const d=((c=l.form)!=null?c:l.ownerDocument).querySelectorAll('input[type="radio"][name="'+l.name+'"]'),h=a(d,l.form);return!h||h===l}function o(l){if(!Me()||l===document.activeElement||l.contains(document.activeElement))return!1;if(getComputedStyle(l).visibility==="hidden")return!0;const c=l.getBoundingClientRect();if(c.width===0||c.height===0)return!0;for(;l;){if(getComputedStyle(l).display==="none")return!0;l=l.parentElement}return!1}return Me()?e(document.body):[]}function _t(e,t,r="forward"){const i=e.position;if(Array.isArray(t)){const n=e.offsetOf(t[0]),a=e.offsetOf(t[t.length-1]);return r==="forward"?e.setSelection(n,a):e.setSelection(a,n),e.announce("move",i),e.mathfield.stopCoalescingUndo(),!0}return r==="forward"?_t(e,[t.leftSibling,t]):_t(e,[t,t.leftSibling])}function wr(e,t){const r=e.position;if(typeof t=="number"&&(t=e.at(t)),t.type==="prompt")e.setSelection(e.offsetOf(t.firstChild),e.offsetOf(t.lastChild));else{const i=e.offsetOf(t);t.type==="placeholder"?e.setSelection(i-1,i):e.position=i}return e.announce("move",r),e.mathfield.stopCoalescingUndo(),!0}function oo(e,t,r=!0){var i,n;const a=t==="forward"?1:-1;e.at(e.anchor).type==="placeholder"&&zr(e,t);let s;const o=e.at(e.anchor).parentPrompt;o?t==="forward"?s=e.offsetOf(o)+1:s=e.offsetOf(o.leftSibling):s=Math.max(e.position+a,0);const l=Cl(e,s,t);if(!l||t==="forward"&&e.offsetOf(l)<s||t==="backward"&&e.offsetOf(l)>s){if(!r||!((n=(i=e.mathfield.host)==null?void 0:i.dispatchEvent(new CustomEvent("move-out",{detail:{direction:t},cancelable:!0,bubbles:!0,composed:!0})))==null||n))return e.announce("plonk"),!1;const u=Xm();if(!document.activeElement||u.length<=1)return e.announce("plonk"),!1;let d=u.indexOf(document.activeElement)+a;return d<0&&(d=u.length-1),d>=u.length&&(d=0),u[d].focus(),e.mathfield.stopCoalescingUndo(),!0}return wr(e,l),!0}function Cl(e,t=0,r="forward"){return e.findAtom(i=>i.type==="placeholder"||i.type==="prompt"||!e.mathfield.readOnly&&i.treeDepth>2&&i.isFirstSibling&&i.isLastSibling,t,r)}It({moveToOpposite:e=>{const t={superscript:"subscript",subscript:"superscript",above:"below",below:"above"},r=e.at(e.position),{parent:i}=r;if(!i)return e.announce("plonk"),!1;const n=r.parentBranch;let a;if(typeof n=="string"&&(a=t[n]),!a){const o=r.subsupPlacement?Id(e):Od(e);return e.mathfield.stopCoalescingUndo(),o}i.branch(a)||i.createBranch(a);const s=e.setSelection(e.getBranchRange(e.offsetOf(i),a));return e.mathfield.stopCoalescingUndo(),s},moveBeforeParent:e=>{const{parent:t}=e.at(e.position);return t?(e.position=e.offsetOf(t),e.mathfield.stopCoalescingUndo(),!0):(e.announce("plonk"),!1)},moveAfterParent:e=>Nd(e),moveToNextChar:e=>zr(e,"forward"),moveToPreviousChar:e=>zr(e,"backward"),moveUp:e=>zr(e,"upward"),moveDown:e=>zr(e,"downward"),moveToNextWord:e=>Dn(e,"forward"),moveToPreviousWord:e=>Dn(e,"backward"),moveToGroupStart:e=>{const t=e.offsetOf(e.at(e.position).firstSibling);return t===e.position?(e.announce("plonk"),!1):(e.position=t,e.mathfield.stopCoalescingUndo(),!0)},moveToGroupEnd:e=>{const t=e.offsetOf(e.at(e.position).lastSibling);return t===e.position?(e.announce("plonk"),!1):(e.position=t,e.mathfield.stopCoalescingUndo(),!0)},moveToNextGroup:e=>{var t,r,i,n;if(e.position===e.lastOffset&&e.anchor===e.lastOffset)return oo(e,"forward");const a=e.at(e.position);if(a.mode==="text"){if(e.selectionIsCollapsed){let h=a;for(;h&&h.mode==="text";)h=h.leftSibling;let f=a;for(;((t=f.rightSibling)==null?void 0:t.mode)==="text";)f=f.rightSibling;if(h&&f)return _t(e,[h,f])}if(a.rightSibling.mode==="text"){let h=a;for(;h&&h.mode==="text";)h=h.rightSibling;return h?(wr(e,(r=h.leftSibling)!=null?r:h),e.mathfield.switchMode("math"),!0):wr(e,e.lastOffset)}}const o=e.at(e.anchor).parentPrompt,l=o?e.offsetOf(o)+1:Math.max(e.position+1,0),c=Cl(e,l,"forward");if(c)return wr(e,c);const u=Rd(e,a,h=>h.type==="leftright"||h.type==="text","forward");if(u){if(u.mode==="text"){let h=u;for(;h&&h.mode==="text";)h=h.rightSibling;return _t(e,[(i=u.leftSibling)!=null?i:u,(n=h.leftSibling)!=null?n:h])}return _t(e,u)}const d=a.parent;if(d){if(d.type==="leftright"||d.type==="surd")return _t(e,d);if(a.parentBranch==="superscript"&&d.subscript)return _t(e,d.subscript);if(a.parentBranch==="above"&&d.below)return _t(e,d.below);if(a.parentBranch==="superscript"||a.parentBranch==="subscript")return wr(e,d);if(a.parentBranch==="above"||a.parentBranch==="below")return _t(e,d)}return wr(e,e.lastOffset)},moveToPreviousGroup:e=>{var t;if(e.position===0&&e.anchor===0)return oo(e,"backward");let r=e.at(e.position);const i=r.mode;if(i==="text"){if(e.selectionIsCollapsed){let o=r;for(;o&&o.mode==="text";)o=o.leftSibling;let l=r;for(;((t=l.rightSibling)==null?void 0:t.mode)==="text";)l=l.rightSibling;if(o&&l)return _t(e,[o,l])}for(;r&&r.mode==="text";)r=r.leftSibling;return r?wr(e,r):wr(e,0)}const n=e.at(e.anchor).parentPrompt,a=n?e.offsetOf(n.leftSibling):Math.max(e.position-1,0),s=Cl(e,a,"backward");if(s)return wr(e,s);if(i==="math"){const o=Rd(e,r,c=>c.type==="leftright"||c.type==="text","backward");if(o){if(o.mode==="text"){let c=o;for(;c&&c.mode==="text";)c=c.leftSibling;return _t(e,[o,c])}return _t(e,o)}const l=r.parent;if(l){if(l.type==="leftright"||l.type==="surd")return _t(e,l);if(r.parentBranch==="subscript"&&l.superscript)return _t(e,l.superscript);if(r.parentBranch==="below"&&l.above)return _t(e,l.above);if(r.parentBranch==="superscript"||r.parentBranch==="subscript")return wr(e,l);if(r.parentBranch==="above"||r.parentBranch==="below")return _t(e,l)}return wr(e,0)}return!1},moveToMathfieldStart:e=>e.selectionIsCollapsed&&e.position===0?(e.announce("plonk"),!1):(e.position=0,e.mathfield.stopCoalescingUndo(),!0),moveToMathfieldEnd:e=>e.selectionIsCollapsed&&e.position===e.lastOffset?(e.announce("plonk"),!1):(e.position=e.lastOffset,e.mathfield.stopCoalescingUndo(),!0),moveToSuperscript:Od,moveToSubscript:Id},{target:"model",changeSelection:!0}),It({moveToNextPlaceholder:e=>oo(e,"forward"),moveToPreviousPlaceholder:e=>oo(e,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function Rd(e,t,r,i){if(i==="forward"){let a=t.rightSibling;for(;a&&!r(a);)a=a.rightSibling;return a}let n=t.leftSibling;for(;n&&!r(n);)n=n.leftSibling;return n}function lo(e,t,r){typeof t=="function"&&(r=t,t=1/0),t===void 0&&(t=1/0);let i=e.position,n=!1,a="";for(;!n;){const s=e.at(i);n=t===0||s===void 0||s.type==="first"||s.mode!=="math"||!(s.type&&/mord|mpunct|operator/.test(s.type)||s.type==="mop"&&/[a-zA-Z ]+/.test(s.value))||!s.hasEmptyBranch("superscript")||!s.hasEmptyBranch("subscript")||typeof r=="function"&&!r(s),n||(s.mode="text",s.command=s.value,s.verbatimLatex=void 0,a+=s.value),i-=1,t-=1}e.contentDidChange({data:a,inputType:"insertText"})}function nn(e,t,r){typeof t=="function"&&(r=t,t=1/0),t===void 0&&(t=1/0);let i=e.position,n=!1;const a=[];for(;!n;){const s=e.at(i);n=t===0||!s||s.type==="first"||s.isFirstSibling||s.mode!=="text"||s.value===" "||typeof r=="function"&&!r(s),n||(a.push(w.serialize([s],{defaultMode:"math"})),s.mode="math"),i-=1,t-=1}El(e),e.contentDidChange({data:X(a),inputType:"insertText"})}function El(e){var t;let r=e.position-1;for(;r>=0&&((t=e.at(r))==null?void 0:t.mode)==="math";)r-=1;if(!(r<0)&&e.at(r).mode==="text"&&e.at(r).value===" "&&e.at(r-1).mode==="math"){e.at(r-1).parent.removeChild(e.at(r-1));const i=e.silenceNotifications;e.silenceNotifications=!0,e.position-=1,e.silenceNotifications=i,e.contentDidChange({inputType:"deleteContent"})}}function $m(e){let t="",r=e.position,i=!1;for(;!i;){const n=e.at(r);i=!(n&&(n.mode==="text"||n.mode==="math"&&n.type&&/mord|mpunct/.test(n.type))),i||(t=n.value+t),r-=1}return t}function Gm(e,t,r){const{model:i}=e;if(i.mode==="latex"||!i.at(i.position).isLastSibling||!r||!Vs(r))return!1;const n=Sn(r);if(!i.selectionIsCollapsed)return!!(e.model.mode==="text"&&/[/_^]/.test(n));const a=$m(i)+n;if(e.model.mode==="text"){if(t==="Esc"||/[/\\]/.test(n))return!0;if(/[\^_]/.test(n))return/(^|\s)[a-zA-Z][^_]$/.test(a)&&nn(i,1),!0;const s={")":"(","}":"{","]":"["}[n],{parent:o}=i.at(i.position);if(s&&o instanceof Le&&o.leftDelim===s)return!0;if(/(^|[^a-zA-Z])(a|I) $/.test(a))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(n))return!0;if(/(^|[^a-zA-Z'])[a-zA-Z] $/.test(a))return nn(i,1),!1;if(/\D\.[^\d\s]$/.test(a)){nn(i,1);const l=i.at(i.position);return l.value="\u22C5",l.style.variant="normal",l.command="\\cdot",l.verbatimLatex=void 0,i.contentDidChange({data:"\\cdot",inputType:"insertText"}),!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(a)||/\.\d$/.test(a)||/\([\d+\-.]$/.test(a))return nn(i,1),!0;if(/\([a-z][,;]$/.test(a))return nn(i,2),!0;if(/[\d+\-=><*|]$/.test(n))return El(i),!0}else{if(t==="[Space]")return lo(i,void 0,s=>/[a-z][:,;.]$/.test(s.value)),!0;if(/[a-zA-Z]{3,}$/.test(a)&&!/(dxd|abc|xyz|uvw)$/.test(a))return lo(i,void 0,s=>/[a-zA-Z]/.test(s.value)),!0;if(/(^|\W)(if)$/i.test(a))return lo(i,1),!0;if(/(\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5){3,}$/u.test(a)&&!/(αβγ)$/.test(a))return lo(i,void 0,s=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5)/u.test(s.value)),!0;if(n==="?"||n==="."&&!/[\d-+]\.$/.test(a))return!0}return!1}function Ym(e,t){if(!e.isSelectionEditable||!e.keystrokeCaptionVisible)return;const r=qd(),i=e.element.getBoundingClientRect();r.style.left=`${i.left}px`,r.style.top=`${i.top-64}px`,r.innerHTML=window.MathfieldElement.createHTML("<span>"+(ml(t)||t)+"</span>"+r.innerHTML),r.style.visibility="visible",setTimeout(()=>{r.childNodes.length>0&&r.childNodes[r.childNodes.length-1].remove(),r.childNodes.length===0&&(r.style.visibility="hidden")},3e3)}function Qm(e){if(e.keystrokeCaptionVisible=!e.keystrokeCaptionVisible,e.keystrokeCaptionVisible){const t=qd();t.innerHTML=""}else{const t=Ws("mathlive-keystroke-caption-panel");t.style.visibility="hidden"}return!1}function qd(){const e=document.getElementById("mathlive-keystroke-caption-panel");return e||(ei("keystroke-caption"),ei("core"),Ws("mathlive-keystroke-caption-panel"))}function e1(){document.getElementById("mathlive-keystroke-caption-panel")&&(bl("mathlive-keystroke-caption-panel"),xi("core"),xi("keystroke-caption"))}function Vd(e,t){var r,i,n;const{model:a}=e,s=md(t);if(t.isTrusted){Hp(t);const f=ka();e.keyboardLayout!==f.id&&(e.keyboardLayout=f.id,e._keybindings=void 0)}if(clearTimeout(e.inlineShortcutBufferFlushTimer),e.inlineShortcutBufferFlushTimer=0,Ym(e,s),t.isTrusted&&t.defaultPrevented)return e.flushInlineShortcutBuffer(),!1;let o,l="",c;const u=e.inlineShortcutBuffer;if(e.isSelectionEditable){if(a.mode==="math")if(s==="[Backspace]")u.pop();else if(!Vs(t))e.flushInlineShortcutBuffer();else{const f=Sn(t),m=[...(i=(r=u[u.length-1])==null?void 0:r.keystrokes)!=null?i:[],f];u.push({state:a.getState(),keystrokes:m,leftSiblings:t1(e)});let y=0,A="";for(;!o&&y<m.length;)c=u.length-(m.length-y),A=m.slice(y).join(""),o=ol(u[c].leftSiblings,A,e.options.inlineShortcuts),!o&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(A)&&(o=e.options.onInlineShortcut(e,A)),y+=1;e.flushInlineShortcutBuffer({defer:!0})}e.options.smartMode&&(o?e.switchMode("math"):Gm(e,s,t)&&(e.switchMode({math:"text",text:"math"}[a.mode]),l=""))}if(!o){if(l||(l=$p(e.keybindings,a.mode,t)),!l&&(s==="[Enter]"||s==="[Return]")){let f=!1;return a.contentWillChange({inputType:"insertLineBreak"})&&(e.host&&(f=!e.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),f||t.preventDefault&&(t.preventDefault(),t.stopPropagation()),a.contentDidChange({inputType:"insertLineBreak"})),f}if((!l||s==="[Space]")&&a.mode==="math"){if(s==="[Space]"){if(e.adoptStyle="none",e.flushInlineShortcutBuffer(),e.options.mathModeSpace)return be.insert(a,e.options.mathModeSpace,{format:"latex",mode:"math"}),e.snapshot("insert-space"),l="",e.dirty=!0,e.scrollIntoView(),t.preventDefault&&(t.preventDefault(),t.stopPropagation()),!1;const f=a.at(a.position+1),m=a.at(a.position-1);if((f==null?void 0:f.mode)==="text"||(m==null?void 0:m.mode)==="text")return be.insert(a," ",{mode:"text"}),e.snapshot("insert-space"),e.dirty=!0,e.scrollIntoView(),!1}(n=a.at(a.position))!=null&&n.isDigit()&&window.MathfieldElement.decimalSeparator===","&&Sn(t)===","&&(l="insertDecimalSeparator")}}if(!o&&!l){if(a.mathfield.smartFence){if(Ll(a,Sn(t),e.effectiveStyle))return e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}else{const{parent:f}=a.at(a.position);if(f instanceof Le&&f.rightDelim==="?"&&a.at(a.position).isLastSibling&&/^[)}\]|]$/.test(s))return e.snapshot(),f.isDirty=!0,f.rightDelim=s,a.position+=1,a.selectionDidChange(),a.contentDidChange({data:Sn(t),inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1;if(!a.selectionIsCollapsed){const m=Sn(t);if(m==="("||m==="{"||m==="["){const y={"(":"(","{":"\\lbrace","[":"\\lbrack"}[m],A={"(":")","{":"\\rbrace","[":"\\rbrack"}[m],[v,S]=pt(a.selection);return e.snapshot(),a.position=S,be.insert(a,A,{format:"latex"}),a.position=v,be.insert(a,y,{format:"latex"}),a.setSelection(v+1,S+1),a.contentDidChange({data:m,inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}}}return!0}const d=a.at(Math.max(a.position,a.anchor)),{parent:h}=d;if(l==="moveAfterParent"&&(h==null?void 0:h.type)==="leftright"&&d.isLastSibling&&e.options.smartFence&&Ll(a,".",e.defaultStyle)&&(l="",Be(e)),e.keyboardDelegate.cancelComposition(),l)e.executeCommand(l);else if(o){const f=e.effectiveStyle;a.setState(u[c].state);const m=u[u.length-1].keystrokes;for(const y of m)be.insert(a,y,{silenceNotifications:!0,style:f});e.snapshot("insert-shortcut"),a.setState(u[c].state),a.deferNotifications({content:!0,selection:!0,data:o,type:"insertText"},()=>(be.insert(a,o,{format:"latex",style:f}),El(e.model),o.endsWith(" ")&&(e.switchMode("text"),be.insert(a," ",{style:f,mode:"text"})),e.snapshot(),a.selectionIsCollapsed||e.flushInlineShortcutBuffer(),!0)),e.dirty=!0,a.announce("replacement")}return e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}function Al(e,t,r){const{model:i}=e;if(!e.isSelectionEditable){i.announce("plonk");return}r!=null||(r={}),r.focus&&e.focus(),r.feedback&&window.MathfieldElement.playSound("keypress"),typeof r.mode=="string"&&(e.switchMode(r.mode),e.snapshot());let n=E0(t);const a=window.mathVirtualKeyboard;if(a!=null&&a.isShifted&&(n=typeof n=="string"?n.toUpperCase():n.map(l=>l.toUpperCase())),r.simulateKeystroke){let l=!0;for(const c of n)Vd(e,new KeyboardEvent("keypress",{key:c}))&&(l=!1);if(l)return}const s=i.at(i.position),o=p(p({},s.computedStyle),e.defaultStyle);if(i.selectionIsCollapsed||(i.deleteAtoms(pt(i.selection)),e.snapshot("delete")),i.mode==="latex")i.deferNotifications({content:!0,selection:!0,data:t,type:"insertText"},()=>{js(e);for(const l of n)be.insert(i,l);e.snapshot("insert-latex"),Sa(e)});else if(i.mode==="text"){for(const l of n)be.insert(i,l,{style:o});e.snapshot("insert-text")}else if(i.mode==="math")for(const l of n)r1(e,l,o,s);e.dirty=!0,e.scrollIntoView()}function t1(e){const t=e.model,r=[];let i=t.at(Math.min(t.position,t.anchor));for(;i.type!=="first";)r.push(i),i=i.leftSibling;return r}function r1(e,t,r,i){const n=e.model;let a={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(t===" "&&e.options.mathModeSpace&&(a=["insert",e.options.mathModeSpace]),a){e.executeCommand(a);return}if(/\d/.test(t)&&e.options.smartSuperscript&&i.parentBranch==="superscript"&&i.parent.type!=="mop"&&i.parent.type!=="operator"&&i.parent.type!=="extensible-symbol"&&i.hasNoSiblings){i1(n),be.insert(n,t,{style:r}),e.snapshot(),Nd(n),e.snapshot();return}if(/[a-zA-Z0-9]/.test(t)&&e.adoptStyle!=="none"){const s=e.adoptStyle==="left"?i:i.parent?i.rightSibling:null;(s==null?void 0:s.type)==="mord"&&/[a-zA-Z0-9]/.test(s.value)&&(r=p({},r),s.style.variant&&(r.variant=s.style.variant),s.style.variantStyle&&(r.variantStyle=s.style.variantStyle))}be.insert(n,t,{style:r}),e.snapshot(`insert-${n.at(n.position).type}`)}function i1(e){e.selectionIsCollapsed||(e.deleteAtoms(pt(e.selection)),e.mathfield.snapshot("delete"))}function Ll(e,t,r){if(!t||e.mode!=="math")return!1;const i=e.at(e.position),{parent:n}=i,a={"(":"(",")":")","{":"\\lbrace","}":"\\rbrace","[":"\\lbrack","]":"\\rbrack","|":"|"}[t];if(!a)return!1;const s=Fs[a],o=Ts[a];if(!e.selectionIsCollapsed){e.mathfield.snapshot();const[l,c]=pt(e.selection),u=e.extractAtoms([l,c]),d=n.addChildrenAfter([new Le("left...right",u,{leftDelim:a,rightDelim:o})],e.at(l));return e.setSelection(e.offsetOf(d.firstChild),e.offsetOf(d.lastChild)),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:a,inputType:"insertText"}),!0}if(a==="|"){const l=n instanceof Le?n.leftDelim+n.rightDelim:"";if(l==="\\lbrace\\rbrace"||l==="\\{\\}"||l==="\\lbrace?")return e.mathfield.snapshot(),be.insert(e,"\\,\\middle\\vert\\,",{format:"latex",style:r}),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:a,inputType:"insertText"}),!0}if(o){if(n instanceof Le&&n.firstChild===i&&(n.leftDelim==="?"||n.leftDelim==="."))return n.leftDelim=a,n.isDirty=!0,e.mathfield.snapshot(),e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(!(n instanceof Le)){let d=i;for(;d&&!(d.type==="mclose"&&d.value===o);)d=d.rightSibling;if(d){e.mathfield.snapshot();const h=e.extractAtoms([e.offsetOf(i),e.offsetOf(d)]);return h.pop(),n.addChildrenAfter([new Le("left...right",h,{leftDelim:a,rightDelim:o})],i),e.position=e.offsetOf(n.firstChild)+1,e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}}const l=e.offsetOf(i.lastSibling);let c;for(c=e.position;c<=l;c++){const d=e.at(c);if(d instanceof Le&&(d.leftDelim==="?"||d.leftDelim===".")&&Hd(a,d.rightDelim))break}const u=e.at(c);if(c<=l&&u instanceof Le){u.leftDelim=a,e.mathfield.snapshot();let d=e.extractAtoms([e.position,c-1]);return d=d.filter(h=>h.type!=="first"),u.addChildren(d,u.parentBranch),e.position+=1,e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(n instanceof Le&&(n.leftDelim==="?"||n.leftDelim===".")&&Hd(a,n.rightDelim)){n.isDirty=!0,n.leftDelim=a,e.mathfield.snapshot();const d=e.extractAtoms([e.offsetOf(i.firstSibling),e.position]);for(const h of d)n.parent.addChildBefore(h,n);return e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(!(n instanceof Le&&n.leftDelim==="|")){if(e.mathfield.snapshot(),be.insert(e,`\\left${a}\\right?`,{format:"latex",style:r}),i.lastSibling.type!=="first"){const d=e.offsetOf(i.lastSibling),h=e.extractAtoms([e.position,d]);e.at(e.position).body=h,e.position-=1}return e.mathfield.snapshot("insert-fence"),!0}}if(s){let l=i;for(;l;){if(l.type==="mopen"&&l.value===s){e.mathfield.snapshot();const f=l.leftSibling,m=e.extractAtoms([e.offsetOf(l.leftSibling),e.offsetOf(i)]);m.shift();const y=new Le("left...right",m,{leftDelim:s,rightDelim:a});return n.addChildrenAfter([y],f),e.position=e.offsetOf(y),e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}l=l.leftSibling}if(n instanceof Le&&i.isLastSibling&&Bl(n.leftDelim,a))return e.mathfield.snapshot(),n.isDirty=!0,n.rightDelim=a,e.position+=1,e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;const c=e.offsetOf(i.firstSibling);let u;for(u=e.position;u>=c;u--){const f=e.at(u);if(f instanceof Le&&(f.rightDelim==="?"||f.rightDelim===".")&&Bl(f.leftDelim,a))break}const d=e.at(u);if(u>=c&&d instanceof Le)return e.mathfield.snapshot(),d.rightDelim=a,d.addChildren(e.extractAtoms([u,e.position]),d.parentBranch),e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(n instanceof Le&&(n.rightDelim==="?"||n.rightDelim===".")&&Bl(n.leftDelim,a))return e.mathfield.snapshot(),n.isDirty=!0,n.rightDelim=a,n.parent.addChildren(e.extractAtoms([e.position,e.offsetOf(i.lastSibling)]),n.parentBranch),e.position=e.offsetOf(n),e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;const h=n.parent;return h instanceof Le&&(h.rightDelim==="?"||h.rightDelim===".")&&e.at(e.position).isLastSibling?(e.position=e.offsetOf(h),Ll(e,a,r)):!1}return!1}function Bl(e,t){return e?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e)?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(t):Ts[e]===t:!0}function Hd(e,t){return t?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(t)?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e):Fs[t]===e:!0}It({undo:e=>(e.undo(),!0),redo:e=>(e.redo(),!0),scrollIntoView:e=>(e.scrollIntoView(),!0),scrollToStart:e=>(e.field.scroll(0,0),!0),scrollToEnd:e=>{const t=e.field.getBoundingClientRect();return e.field.scroll(t.left-window.scrollX,0),!0},toggleKeystrokeCaption:Qm,toggleContextMenu:e=>{const t=e.toggleContextMenu();return t||e.model.announce("plonk"),t},plonk:e=>(e.model.announce("plonk"),!0),switchMode:(e,t,r,i)=>(e.switchMode(t,r,i),!0),insert:(e,t,r)=>e.insert(t,r),typedText:(e,t,r)=>(Al(e,t,r),!0),insertDecimalSeparator:e=>{const t=e.model;return t.mode==="math"&&window.MathfieldElement.decimalSeparator===","&&t.at(Math.max(t.position,t.anchor)).isDigit()?(e.insert("{,}",{format:"latex"}),e.snapshot("insert-mord"),!0):(e.insert("."),!0)},commit:e=>{var t;return e.model.contentWillChange({inputType:"insertLineBreak"})&&((t=e.host)==null||t.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),e.model.contentDidChange({inputType:"insertLineBreak"})),!0},insertPrompt:(e,t,r)=>{const i=e.getPrompts();let n="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),a=0;for(;i.includes(n)&&a<100;){if(a===99)return console.error("could not find a unique ID after 100 tries"),!1;n="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),a++}return e.insert(`\\placeholder[${t!=null?t:n}]{}`,r),!0}}),It({copyToClipboard:e=>(e.focus(),e.model.selectionIsCollapsed&&e.select(),"queryCommandSupported"in document&&document.queryCommandSupported("copy")?document.execCommand("copy"):e.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("copy",{bubbles:!0,composed:!0})),!1)},{target:"mathfield"}),It({cutToClipboard:e=>(e.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("cut")?document.execCommand("cut"):e.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("cut",{bubbles:!0,composed:!0})),!0),pasteFromClipboard:e=>(e.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("paste")?(document.execCommand("paste"),!0):(navigator.clipboard.readText().then(t=>{t&&e.model.contentWillChange({inputType:"insertFromPaste",data:t})?(e.stopCoalescingUndo(),e.stopRecording(),e.insert(t,{mode:e.model.mode})&&(Sa(e),e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),Be(e))):e.model.announce("plonk"),e.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function n1(e,t){e.flushInlineShortcutBuffer(),e.stopCoalescingUndo();const r=Dl(e,t),{model:i}=e;return i.selectionIsCollapsed?(e.defaultStyle.fontSeries&&r.fontSeries===e.defaultStyle.fontSeries&&(r.fontSeries="auto"),r.fontShape&&r.fontShape===e.defaultStyle.fontShape&&(r.fontShape="auto"),r.color&&r.color===e.defaultStyle.color&&(r.color="none"),r.backgroundColor&&r.backgroundColor===e.defaultStyle.backgroundColor&&(r.backgroundColor="none"),r.fontSize&&r.fontSize===e.defaultStyle.fontSize&&(r.fontSize="auto"),e.defaultStyle=p(p({},e.defaultStyle),r)):e.model.deferNotifications({content:!0,type:"insertText"},()=>{i.selection.ranges.forEach(n=>kl(i,n,r,{operation:"toggle"})),e.snapshot("style-change")}),!0}It({applyStyle:n1},{target:"mathfield",canUndo:!0,changeContent:!0});function Dl(e,t){var r,i,n,a,s,o,l,c,u,d;const h={};if(typeof t.color=="string"){const m=(i=e.colorMap((r=t.color)!=null?r:t.verbatimColor))!=null?i:"none";m!==t.color&&(h.verbatimColor=(n=t.verbatimColor)!=null?n:t.color),h.color=m}if(typeof t.backgroundColor=="string"){const m=(s=e.backgroundColorMap((a=t.backgroundColor)!=null?a:t.verbatimBackgroundColor))!=null?s:"none";m!==t.backgroundColor&&(h.verbatimBackgroundColor=(o=t.verbatimBackgroundColor)!=null?o:t.backgroundColor),h.backgroundColor=m}typeof t.fontFamily=="string"&&(h.fontFamily=t.fontFamily),typeof t.series=="string"&&(h.fontSeries=t.series),typeof t.fontSeries=="string"&&(h.fontSeries=t.fontSeries.toLowerCase()),h.fontSeries&&(h.fontSeries=(l={bold:"b",medium:"m",normal:"m"}[h.fontSeries])!=null?l:h.fontSeries),typeof t.shape=="string"&&(h.fontShape=t.shape),typeof t.fontShape=="string"&&(h.fontShape=t.fontShape.toLowerCase()),h.fontShape&&(h.fontShape=(c={italic:"it",up:"n",upright:"n",normal:"n"}[h.fontShape])!=null?c:h.fontShape),t.variant&&(h.variant=t.variant.toLowerCase()),t.variantStyle&&(h.variantStyle=t.variantStyle.toLowerCase());const f=(u=t.size)!=null?u:t.fontSize;return typeof f=="number"?h.fontSize=Math.max(1,Math.min(10,f)):typeof f=="string"&&(h.fontSize=(d={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[f.toLowerCase()])!=null?d:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[f]),h}function Tl(e){let[t,r]=pt(e.selection);if(t=jd(e,t,"backward"),r=jd(e,r,"forward"),t===r){const i=e.at(t);if(i.type==="leftright")return e.setSelection(e.offsetOf(i.firstChild)-1,r);if(i.type==="first"&&(i.parent.type==="leftright"||i.parent.type==="surd"))return e.setSelection(t-1,e.offsetOf(i.parent.lastChild)+1);e.setSelection(t-1,r)}else e.setSelection(t,r);return!0}function jd(e,t,r){var i,n,a;let s=e.at(t);if(!s)return t;const o=r==="forward"?1:-1;if(s.mode==="text"){for(;s&&!(s.mode!=="text"||!Sr.test(s.value));)t+=o,s=e.at(t);return r==="backward"?t-1:t}if(s.mode==="latex"){if(/[a-zA-Z\*]/.test(s.value))if(r==="backward")for(;s&&s.mode==="latex"&&s.value!=="\\"&&/[a-zA-Z]/.test(s.value);)t+=o,s=e.at(t);else for(;s&&s.mode==="latex"&&/[a-zA-Z\*]/.test(s.value);)t+=o,s=e.at(t);else if(s.value==="{"){if(r==="forward"){for(;s&&s.mode==="latex"&&s.value!=="}";)t+=o,s=e.at(t);return t}return t-1}else if(s.value==="}"){if(r==="backward"){for(;s&&s.mode==="latex"&&s.value!=="{";)t+=o,s=e.at(t);return t-1}return t}return t-1}if(s.mode==="math"){if(s.isDigit()){for(;(i=e.at(t+o))!=null&&i.isDigit();)t+=o;return r==="backward"?t-1:t}if(s.style.variant||s.style.variantStyle){let l=(n=e.at(t))==null?void 0:n.style;for(;l&&l.variant===s.style.variant&&l.variantStyle===s.style.variantStyle;)l=(a=e.at(t+o))==null?void 0:a.style,t+=o;return r==="backward"?t-1:t}return t}return t}It({selectGroup:e=>{const t=Tl(e);return t||e.announce("plonk"),t},selectAll:e=>e.setSelection(0,e.lastOffset),extendSelectionForward:e=>zr(e,"forward",{extend:!0}),extendSelectionBackward:e=>zr(e,"backward",{extend:!0}),extendToNextWord:e=>Dn(e,"forward",{extend:!0}),extendToPreviousWord:e=>Dn(e,"backward",{extend:!0}),extendSelectionUpward:e=>zr(e,"upward",{extend:!0}),extendSelectionDownward:e=>zr(e,"downward",{extend:!0}),extendToNextBoundary:e=>Dn(e,"forward",{extend:!0}),extendToPreviousBoundary:e=>Dn(e,"backward",{extend:!0}),extendToGroupStart:e=>{const t=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).firstSibling));return t||e.announce("plonk"),t},extendToGroupEnd:e=>{const t=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).lastSibling));return t||e.announce("plonk"),t},extendToMathFieldStart:e=>{const t=e.setSelection(e.anchor,0);return t||e.announce("plonk"),t},extendToMathFieldEnd:e=>{const t=e.setSelection(e.anchor,e.lastOffset);return t||e.announce("plonk"),t}},{target:"model",changeSelection:!0});var an=null,Da=0,co=class ur{static start(t,r,i,n){var a;ur.element=t,(a=ur.controller)==null||a.abort(),ur.controller=new AbortController;const s={signal:ur.controller.signal};"PointerEvent"in window?(t.addEventListener("pointermove",i,s),t.addEventListener("pointerup",n,s),t.addEventListener("pointercancel",n,s),Fl(r)&&(ur.pointerId=r.pointerId,t.setPointerCapture(r.pointerId))):(window.addEventListener("mousemove",i,s),window.addEventListener("blur",n,s),window.addEventListener("mouseup",n,s))}static stop(){var t;(t=ur.controller)==null||t.abort(),ur.controller=void 0,typeof ur.pointerId=="number"&&(ur.element.releasePointerCapture(ur.pointerId),ur.pointerId=void 0)}};function Fl(e){return e!==null&&globalThis.PointerEvent!==void 0&&e instanceof PointerEvent}function Wd(e,t){var r;if(t.buttons>1)return;e.atomBoundsCache=new Map;const i=e;let n,a=!1,s=!1,o="none",l=!1,c=!1;const u=t.clientX,d=t.clientY,h=Date.now(),f=i.field,m=setInterval(()=>{l?f.scroll({top:0,left:f.scrollLeft-16}):c&&f.scroll({top:0,left:f.scrollLeft+16})},32);function y(){co.stop(),a=!1,clearInterval(m),e.element.classList.remove("tracking"),t&&t.preventDefault()}function A(S){if(!i.hasFocus()){y();return}const L=S.clientX,C=S.clientY,z=Fl(S)&&S.pointerType==="touch"?20:5;if(Date.now()<h+500&&Math.abs(u-L)<z&&Math.abs(d-C)<z){S.preventDefault(),S.stopPropagation();return}const I=f.getBoundingClientRect();c=L>I.right,l=L<I.left;let O=n;Fl(S)&&(S.isPrimary||(O=Ta(i,S.clientX,S.clientY,{bias:0})));const U=Ta(i,L,C,{bias:L<=u?L===u?0:-1:1});O>=0&&U>=0&&(i.model.extendSelectionTo(O,U),Be(e)),s&&Tl(i.model)}an&&Math.abs(an.x-u)<5&&Math.abs(an.y-d)<5&&Date.now()<an.time+500?(Da+=1,an.time=h):(an={x:u,y:d,time:h},Da=1);const v=f.getBoundingClientRect();if(u>=v.left&&u<=v.right&&d>=v.top&&d<=v.bottom){if(e.flushInlineShortcutBuffer(),e.adoptStyle="left",n=Ta(e,u,d,{bias:0}),n>=0){if(e.element.classList.add("tracking"),t.shiftKey){const S=e.model.selectionIsCollapsed;e.model.extendSelectionTo(e.model.anchor,n),vd(e.model)||S?o="all":o="selection"}else e.model.at(n).type==="placeholder"?(e.model.setSelection(n-1,n),o="selection"):((r=e.model.at(n).rightSibling)==null?void 0:r.type)==="placeholder"?(e.model.setSelection(n,n+1),o="selection"):(e.model.position=n,vd(e.model)?o="all":o="selection");e.defaultStyle={},t.detail===3||Da>2?(y(),(t.detail===3||Da===3)&&(e.model.selection={ranges:[[0,e.model.lastOffset]]},o="all")):a||(a=!0,co.start(f,t,A,y),(t.detail===2||Da===2)&&(s=!0,Tl(e.model),o="all"))}e.hasFocus()||(o="none",e.focus({preventScroll:!0}))}else an=null;e.stopCoalescingUndo(),o!=="none"&&(e.model.selectionIsCollapsed&&(o="all"),Be(e)),t.preventDefault()}function a1(e,t,r){if(e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom)return 0;const i=e-(r.left+r.right)/2,n=t-(r.top+r.bottom)/2;return i*i+n*n}function Ud(e,t,r,i,n){if(!r.id)return[1/0,null];if(t.has(r.id))return t.get(r.id);const a=fa(e,r);if(!a)return[1/0,null];let s=[1/0,null];if(r.hasChildren&&!r.captureSelection&&i>=a.left&&i<=a.right)for(const o of r.children){const l=Ud(e,t,o,i,n);l[0]<=s[0]&&(s=l)}return s[1]||(s=[a1(i,n,a),r]),t.set(r.id,s),s}function s1(e,t,r){const[,i]=Ud(e,new Map,e.model.root,t,r);return i}function Ta(e,t,r,i){var n;const a=e.field.querySelector(".ML__latex").getBoundingClientRect();if(!a)return 0;if(t>a.right||r>a.bottom+8)return e.model.lastOffset;if(t<a.left||r<a.top-8)return 0;i=i!=null?i:{},i.bias=(n=i.bias)!=null?n:0;let s=s1(e,t,r);const o=[];let l=s;for(;l;)o.unshift(l),l=l.parent;for(const u of o)if(u.captureSelection){s=u;break}let c=e.model.offsetOf(s);if(c<0)return-1;if(s.leftSibling)if(i.bias===0&&s.type!=="placeholder"){const u=fa(e,s);u&&t<(u.left+u.right)/2&&(c=e.model.offsetOf(s.leftSibling))}else i.bias<0&&(c=e.model.offsetOf(s.leftSibling));return c}var o1=class extends be{constructor(){super("math")}onPaste(e,t){if(!t||!e.model.contentWillChange({data:typeof t=="string"?t:null,dataTransfer:typeof t=="string"?null:t,inputType:"insertFromPaste"}))return!1;let r="",i="auto",n=typeof t!="string"?t.getData("application/json+mathlive"):"";if(n)try{const a=JSON.parse(n);if(a&&Array.isArray(a)){e.snapshot();const s=wi(a),{model:o}=e;o.selectionIsCollapsed||o.deleteAtoms(pt(o.selection));const l=o.at(o.position);if(l.parent instanceof ae){console.assert(l.parentBranch!==void 0);const c=[];let u=[];s[0].type==="first"&&s.shift(),s[s.length-1].type==="first"&&s.pop();for(const m of s)m.type==="first"&&u.length>0?(c.push(u),u=[m]):u.push(m);u.length>0&&c.push(u);let d=Number(l.parentBranch[0]),h=Number(l.parentBranch[1]);const f=l.parent.maxColumns;for(;l.parent.colCount-h<c.length&&l.parent.colCount<f;)l.parent.addColumn();l.parent.addChildrenAfter(c[0],l);for(let m=1;m<c.length;m++)h++,h>=f&&(h=0,l.parent.addRowAfter(d),d++),l.parent.setCell(d,h,c[m])}else l.parent.addChildrenAfter(s.filter(c=>c.type!=="first"),l);return o.position=o.offsetOf(s[s.length-1]),o.contentDidChange({inputType:"insertFromPaste"}),Be(e),!0}}catch(a){}if(n=typeof t!="string"?t.getData("application/json"):"",n&&window.MathfieldElement.computeEngine)try{const a=JSON.parse(n);if(typeof a=="object"&&"latex"in a&&a.latex&&(r=a.latex),!r){const s=window.MathfieldElement.computeEngine.box(a);s&&!s.has("Error")&&(r=s.latex)}r||(i="latex")}catch(a){}if(!r&&typeof t!="string"&&(r=t.getData("application/x-latex"),r&&(i="latex")),r||(r=typeof t=="string"?t:t.getData("text/plain")),r){let a;return[a,r]=ll(r),i==="auto"&&a&&(i="latex"),e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,r,{format:i})&&(e.startRecording(),e.snapshot("paste"),Be(e)),e.startRecording(),!0}return!1}insert(e,t,r){var i,n;const a=typeof t=="string"?t:(n=(i=window.MathfieldElement.computeEngine)==null?void 0:i.box(t).latex)!=null?n:"";if(!r.silenceNotifications&&!e.contentWillChange({data:a,inputType:"insertText"}))return!1;r.insertionMode||(r.insertionMode="replaceSelection"),r.selectionMode||(r.selectionMode="placeholder"),r.format||(r.format="auto");const{silenceNotifications:s}=e;r.silenceNotifications&&(e.silenceNotifications=!0);const o=e.silenceNotifications;e.silenceNotifications=!0;const l={"?":"\\placeholder{}","@":"\\placeholder{}"};l[0]=r.insertionMode==="replaceAll"?"":e.getValue(e.selection,"latex-unstyled"),r.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(pt(e.selection)):r.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):r.insertionMode==="insertBefore"?e.collapseSelection("backward"):r.insertionMode==="insertAfter"&&e.collapseSelection("forward"),!e.at(e.position).isLastSibling&&e.at(e.position+1).type==="placeholder"?e.deleteAtoms([e.position,e.position+1]):e.at(e.position).type==="placeholder"&&e.deleteAtoms([e.position-1,e.position]);let c=-1;l[0]?l["@"]=l[0]:typeof t=="string"&&/(^|[^\\])#@/.test(t)&&(c=c1(e),c>=0&&(l["@"]=e.getValue(c,e.position,"latex"))),l[0]||(l[0]=l["?"]);let u=!1;const d=L=>(u=!0,l[L]);let[h,f]=Zd(e,t,d,r);if(!f)return!1;const m=f.length===1&&f[0].type==="genfrac";m&&c>=0&&typeof e.mathfield.options.isImplicitFunction=="function"&&e.mathfield.options.isImplicitFunction(e.at(e.position).command)?(l["@"]=l["?"],u=!1,[h,f]=Zd(e,t,d,r)):c>=0&&e.deleteAtoms([c,e.position]);const{parent:y}=e.at(e.position),A=y.hasEmptyBranch("body");if(m&&h!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&y instanceof Le&&y.leftDelim==="("&&A){const L=y.parent,C=y.parentBranch;L.removeChild(y),L.setChildren(f,C)}const v=e.at(e.position);v.parent.addChildrenAfter(f,v),h==="latex"&&typeof t=="string"&&(y==null?void 0:y.type)==="root"&&A&&!u&&(y.verbatimLatex=t),e.silenceNotifications=o;const S=f[f.length-1];if(r.selectionMode==="placeholder"){const L=f.flatMap(C=>[C,...C.children]).find(C=>C.type==="placeholder");if(L){const C=e.offsetOf(L);e.setSelection(C-1,C),e.announce("move")}else S&&(e.position=e.offsetOf(S))}else r.selectionMode==="before"||(r.selectionMode==="after"?S&&(e.position=e.offsetOf(S)):r.selectionMode==="item"&&e.setSelection(e.anchor,e.offsetOf(S)));return e.contentDidChange({data:a,inputType:"insertText"}),e.silenceNotifications=s,!0}};function Zd(e,t,r,i){var n;let a,s=[];if(typeof t!="string"||i.format==="math-json"){const o=window.MathfieldElement.computeEngine;if(!o)return["math-json",[]];[a,t]=["latex",o.box(t).latex],s=xt(t,{context:e.mathfield.context})}else typeof t=="string"&&i.format==="ascii-math"?([a,t]=Bs(t,{format:"ascii-math",inlineShortcuts:e.mathfield.options.inlineShortcuts}),s=xt(t,{context:e.mathfield.context}),a!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&uo(s)):(i.format==="auto"||(n=i.format)!=null&&n.startsWith("latex"))&&(i.format==="auto"&&([a,t]=Bs(t,{format:"auto",inlineShortcuts:e.mathfield.options.inlineShortcuts})),i.format==="latex"&&([,t]=ll(t)),s=xt(t,{context:e.mathfield.context,args:r}),i.format!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&uo(s));return Mi(s,i.style),[a!=null?a:"latex",s]}function l1(e){if(!e||(console.assert(e[0].type==="first"),e.length>1))return null;const t=e[0];return t instanceof Le&&t.leftDelim==="("&&t.rightDelim===")"?t.removeBranch("body"):null}function uo(e){if(e){for(let t=0;e[t];t++){const r=e[t];if(r instanceof Le&&r.leftDelim==="("){let i=0,n=0,a=0;for(let s=0;r.body[s];s++)r.body[s].type==="genfrac"&&(i++,n=s),a++;a===0&&i===1&&(e[t]=r.body[n])}}for(const t of e){for(const r of t.branches)if(!t.hasEmptyBranch(r)){uo(t.branch(r));const i=l1(t.branch(r));i&&t.setChildren(i,r)}if(t instanceof ae)for(const r of t.cells)uo(r)}}}function c1(e){let t=e.at(e.position);if(t.mode==="text"){for(;!t.isFirstSibling&&t.mode==="text";)t=t.leftSibling;return e.offsetOf(t)}const r=t;let i=!1;if(t.type==="mclose"){const n=Fs[t.value];for(;!t.isFirstSibling&&!(t.type==="mopen"&&t.value===n);)t=t.leftSibling;t.isFirstSibling||(t=t.leftSibling),i=!0}else t.type==="leftright"&&(t=t.leftSibling,i=!0);if(i)for(;!t.isFirstSibling&&(t.isFunction||Jd(t));)t=t.leftSibling;else{const n=[];for(;!t.isFirstSibling&&(Jd(t)||n.length>0);)t.type==="mclose"&&n.unshift(t.value),t.type==="mopen"&&n.length>0&&t.value===Fs[n[0]]&&n.shift(),t=t.leftSibling}return r===t?-1:e.offsetOf(t)}function Jd(e){return e.isDigit()?!0:e.type&&/^(mord|surd|subsup|leftright|mop|mclose)$/.test(e.type)?!e.isExtensibleSymbol:!1}new o1;var u1=class extends be{constructor(){super("text")}onPaste(e,t){if(!t)return!1;const r=typeof t=="string"?t:t.getData("text/plain");return r&&e.model.contentWillChange({inputType:"insertFromPaste",data:r})?(e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,r)&&(e.model.contentDidChange({inputType:"insertFromPaste"}),e.startRecording(),e.snapshot("paste"),Be(e)),e.startRecording(),!0):!1}insert(e,t,r={}){if(!e.contentWillChange({data:t,inputType:"insertText"}))return!1;r.insertionMode||(r.insertionMode="replaceSelection"),r.selectionMode||(r.selectionMode="placeholder"),r.format||(r.format="auto");const{silenceNotifications:i}=e;r.silenceNotifications&&(e.silenceNotifications=!0);const n=e.silenceNotifications;e.silenceNotifications=!0,r.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(pt(e.selection)):r.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):r.insertionMode==="insertBefore"?e.collapseSelection("backward"):r.insertionMode==="insertAfter"&&e.collapseSelection("forward");const a=d1(t,e.mathfield.context);if(Mi(a,r.style),!a)return!1;const s=e.at(e.position),o=s.parent.addChildrenAfter(a,s);return e.silenceNotifications=n,r.selectionMode==="before"||(r.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(o)):o&&(e.position=e.offsetOf(o))),e.contentDidChange({data:t,inputType:"insertText"}),e.silenceNotifications=i,!0}};function d1(e,t){return e=e.replace(/\\/g,"\\textbackslash "),e=e.replace(/#/g,"\\#"),e=e.replace(/\$/g,"\\$"),e=e.replace(/%/g,"\\%"),e=e.replace(/&/g,"\\&"),e=e.replace(/_/g,"\\_"),e=e.replace(/{/g,"\\textbraceleft "),e=e.replace(/}/g,"\\textbraceright "),e=e.replace(/lbrace/g,"\\textbraceleft "),e=e.replace(/rbrace/g,"\\textbraceright "),e=e.replace(/\^/g,"\\textasciicircum "),e=e.replace(/~/g,"\\textasciitilde "),e=e.replace(/£/g,"\\textsterling "),xt(e,{context:t,parseMode:"text"})}new u1;function Kr(e){return{value:e.model.getValue(),selectionIsCollapsed:e.model.selectionIsCollapsed,canUndo:e.canUndo(),canRedo:e.canRedo(),style:e.selectionStyle,mode:e.model.mode}}var ge=4,Bt=20,Re=2*(Bt+ge),ho=(e,t)=>`
<line x1="${e+Bt}" y1="${t+Bt}"
x2="${e>t?e+Bt:7*Bt+10*ge}"
y2="${e<t?t+Bt:7*Bt+10*ge}"/>
<svg id="plus" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<path class="font" d="m33.33,20c0,1.84-1.49,3.34-3.33,3.34h-6.67v6.66c0,1.84-1.49,3.34-3.33,3.34s-3.34-1.5-3.34-3.34v-6.66h-6.66c-1.84,0-3.34-1.5-3.34-3.34s1.5-3.33,3.34-3.33h6.66v-6.67c0-1.84,1.5-3.33,3.34-3.33s3.33,1.49,3.33,3.33v6.67h6.67c1.84,0,3.33,1.49,3.33,3.33Z"/>
</svg>`,Xd=(e,t)=>`
<line x1="${e+Bt}" y1="${t+Bt}"
x2="${e>t?e+Bt:7*Bt+10*ge}"
y2="${e<t?t+Bt:7*Bt+10*ge}"/>
<svg id="minus" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<path class="font" d="m33.33,20c0,1.84-1.49,3.33-3.33,3.33H10c-1.84,0-3.34-1.49-3.34-3.33s1.5-3.34,3.34-3.34h20c1.84,0,3.33,1.5,3.33,3.34Z"/>
</svg>`,fo=(e,t,r)=>`
<svg id="arrow" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<g transform="rotate(${r})" transform-origin="20 20">
<path class="font" d="m17.7,7.23h4.6c.52,0,.94.42.94.94v13.82c0,.52.42.94.94.94h3.39c.83,0,1.25,1.01.66,1.6l-7.56,7.56c-.37.37-.96.37-1.32,0l-7.56-7.56c-.59-.59-.17-1.6.66-1.6h3.39c.52,0,.94-.42.94-.94v-13.82c0-.52.42-.94.94-.94Z"/>
</g>
</svg>`,h1=`
<svg class="MLEP__array-buttons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox=
"-2 -2 ${8*Bt+10*ge+5} ${8*Bt+10*ge+5}">
<rect
class="MLEP__array-insert-background rows"
x="0"
y="${Re+ge}"
height="${3*Re}"
width="${Re}"
rx="${Re/2}"/>
<rect
class="MLEP__array-insert-background columns"
x="${Re+ge}"
y="0"
height="${Re}"
width="${3*Re}"
rx="${Re/2}"/>
<g data-command='"moveDown"'>
${fo(2*(ge+Re),2*ge+3*Re,0)}
</g>
<g data-command='"moveUp"'>
${fo(2*(ge+Re),2*ge+Re,180)}
</g>
<g data-command='"moveToNextWord"'>
${fo(2*ge+3*Re,2*(ge+Re),-90)}
</g>
<g data-command='"moveToPreviousWord"'>
${fo(2*ge+Re,2*(ge+Re),90)}
</g>
<g>
<g data-command='"addColumnBefore"'>
${ho(2*ge+Re,ge)}
</g>
<g data-command='"removeColumn"'>
${Xd(2*ge+2*Re,ge)}
</g>
<g data-command='"addColumnAfter"'>
${ho(2*ge+3*Re,ge)}
</g>
<g data-command='"addRowBefore"'>
${ho(ge,2*ge+Re)}
</g>
<g data-command='"removeRow"'>
${Xd(ge,2*ge+2*Re)}
</g>
<g data-command='"addRowAfter"'>
${ho(ge,2*ge+3*Re)}
</g>
</svg>`,f1=e=>`
<svg id="matrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","matrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/></svg>`,p1=e=>`
<svg id="pmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","pmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4c-3.96,4.6-3.96,11.4,0,16"/>
<path class="cls-2" d="m22,4c3.96,4.6,3.96,11.4,0,16"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/></svg>`,$d=e=>`
<svg id="Bmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","Bmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
<path class="cls-2" d="m22,4c1.1,0,2,.9,2,2v3c0,1.66.9,3,2,3-1.1,0-2,1.34-2,3v3c0,1.1-.9,2-2,2"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
</svg>`,m1=e=>`
<svg id="bmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","bmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4h-3v16h3"/>
<path class="cls-2" d="m22,4h3v16h-3"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
</svg>`,g1=e=>`
<svg id="vmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","vmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
<line class="cls-2" x1="4" y1="4" x2="4" y2="20"/>
<line class="cls-2" x1="24" y1="4" x2="24" y2="20"/>
</svg>`,b1=e=>`
<svg id="Vmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="-3.5 -3 35 30"
data-command='["setEnvironment","Vmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
<line class="cls-2" x1="6" y1="4" x2="6" y2="20"/>
<line class="cls-2" x1="22" y1="4" x2="22" y2="20"/>
<line class="cls-2" x1="2" y1="4" x2="2" y2="20"/>
<line class="cls-2" x1="26" y1="4" x2="26" y2="20"/>
</svg>`,v1=e=>`
<svg id="cases" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","cases"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m10,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
<circle cx="13" cy="8" r="1"/>
<circle cx="13" cy="16" r="1"/>
<circle cx="21" cy="8" r="1"/>
<circle cx="21" cy="16" r="1"/>
</svg>`,y1=e=>`
<svg id="rcases" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","rcases"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m18,20c1.1,0,2-.9,2-2v-3c0-1.66.9-3,2-3-1.1,0-2-1.34-2-3v-3c0-1.1-.9-2-2-2"/>
<circle cx="15" cy="8" r="1"/>
<circle cx="15" cy="16" r="1"/>
<circle cx="7" cy="8" r="1"/>
<circle cx="7" cy="16" r="1"/>
</svg>`,Pl={matrix:f1,pmatrix:p1,bmatrix:m1,Bmatrix:$d,vmatrix:g1,Vmatrix:b1},zl={cases:v1,rcases:y1,Bmatrix:$d};function x1(e){var t,r;const i=(t=e.model.parentEnvironment)==null?void 0:t.array;if(!i)return;let n=0;i.forEach(m=>{(!n||m.length>n)&&(n=m.length)});let a=document.getElementById("mathlive-environment-popover");a||(a=Ws("mathlive-environment-popover"),ei("environment-popover"),ei("core"),a.setAttribute("aria-hidden","true"));let s;const o=a.querySelector(".MLEP__environment-controls");o?s=o:(s=document.createElement("div"),a.innerHTML="",a.appendChild(s)),s.className="MLEP__environment-controls",s.style.display="flex",s.style.width="100%",s.style.height="100%",s.style.boxSizing="border-box",s.innerHTML=h1;let l=[],c="";const u=e.model.parentEnvironment.environmentName;if(X0(u)){const m=w1(u);c=Pl[m]("active");const y=Pl,{[m]:A}=y,v=fe(y,[ke(m)]);l=Object.values(v).map(S=>S("inactive"))}else if(ap(u)){const m=k1(u);c=zl[m]("active");const y=zl,{[m]:A}=y,v=fe(y,[ke(m)]);l=Object.values(v).map(S=>S("inactive"))}else sp(u)&&(c=Pl.matrix("active"),l=Object.values(zl).map(m=>m("inactive")));const d=document.createElement("div");d.className="MLEP__environment-delimiter-controls",d.style.display="flex",d.style.flexDirection="column",d.innerHTML=`
<div class='MLEP__array-delimiter-options'>
${c}
${l.join("")}
</div>`,c&&s.appendChild(d),s.querySelectorAll("[data-command]").forEach(m=>{const y=m.dataset.command;let A=y;try{A=JSON.parse(y)}catch(v){}m.addEventListener("mousedown",v=>v.preventDefault()),A&&m.addEventListener("click",()=>e.executeCommand(A))});const f=(r=e.field)==null?void 0:r.getBoundingClientRect();f&&(a.style.top=`${window.scrollY+(f.top-a.clientHeight-15)}px`,a.style.left=`${f.left+20}px`,a.classList.add("is-visible"))}function Kl(){const e=document.getElementById("mathlive-environment-popover");e==null||e.classList.remove("is-visible")}function _1(){document.getElementById("mathlive-environment-popover")&&(bl("mathlive-environment-popover"),xi("environment-popover"),xi("core"))}function po(e){if(!e.hasFocus())return;let t=!1;if(e.model.mode==="math"){const r=e.model.parentEnvironment;if(r!=null&&r.array&&np(r.environmentName)){const i=e.options.environmentPopoverPolicy;t=i==="auto"||i==="on"}}t?x1(e):Kl()}function w1(e){return e.replace("*","")}function k1(e){return e==="dcases"?"cases":e}function Gd(e){const t=getComputedStyle(e).direction;return t==="ltr"||t==="rtl"?t:"ltr"}function Yd(e,t,r){return t==="left"||t==="leading"&&r==="ltr"||t==="trailing"&&r==="rtl"?e.left:e.right}function Nl(e,t,r,i){return r==="middle"?e-t/2:r==="start"&&i==="rtl"||r==="end"&&i==="ltr"||r==="top"||r==="right"?Math.max(0,e-t):e}function M1(e,t,r,i){return r==="middle"?e-t/2:r==="start"&&i==="ltr"||r==="end"&&i==="rtl"||r==="top"||r==="right"?e:e-t}function S1(e,t){var r,i,n;const a=(r=Gd(e))!=null?r:"ltr";e.style.position="fixed",e.style.left="",e.style.top="",e.style.right="",e.style.bottom="",e.style.height="",e.style.width="";const s=e.getBoundingClientRect(),o=Number.isFinite(t.maxHeight)?Math.min(t.maxHeight,window.innerHeight):window.innerHeight;let l=Math.min(o,(i=t.height)!=null?i:s.height),c=Nl(t.location.y,l,t.verticalPos,a);c+l>window.innerHeight-8&&(t.alternateLocation?(c=Nl(t.alternateLocation.y,l,t.verticalPos,a),c+l>window.innerHeight-8&&(c=void 0)):c=void 0),Number.isFinite(c)||(c=Math.max(8,window.innerHeight-8-l),8+l>window.innerHeight-8&&(e.style.bottom="8px")),l=Math.min(c+l,window.innerHeight-8)-c;const u=Number.isFinite(t.maxWidth)?Math.min(t.maxWidth,window.innerWidth):window.innerWidth;let d=Math.min(u,(n=t.width)!=null?n:s.width),h=Nl(t.location.x,d,t.horizontalPos,a);h+d>window.innerWidth-8&&(t.alternateLocation?(h=M1(t.alternateLocation.x,d,t.verticalPos,a),h+d>window.innerWidth-8&&(h=void 0)):h=void 0),Number.isFinite(h)||(h=Math.max(8,window.innerWidth-8-d),8+d>window.innerWidth-8&&(e.style.right="8px")),d=Math.min(h+d,window.innerWidth-8)-h,a==="rtl"?e.style.right=`${Math.ceil(window.innerWidth-h-d).toString()}px`:e.style.left=`${Math.ceil(h).toString()}px`,e.style.top=`${Math.ceil(c).toString()}px`,l!==s.height&&(e.style.height=`${Math.ceil(l).toString()}px`),d!==s.width&&(e.style.width=`${Math.ceil(d).toString()}px`)}function C1(e,t){return Math.hypot(t.x-e.x,t.y-e.y)}function Tn(e){return"submenu"in e}function Nr(e){return"type"in e&&e.type==="command"||"onMenuSelect"in e||"id"in e}function Ol(e){return"type"in e&&e.type==="divider"}function Il(e){return"type"in e&&e.type==="heading"}var Qd={};function Rl(e){let t=Qd[e];if(!t){let r;switch(e){case"checkmark":r=`<span aria-hidden="true" class="ui-checkmark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"></path></svg>
</span>`;break;case"trailing-chevron":r='<span aria-hidden="true" class="ui-trailing-chevron"><svg focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg></span>';break;case"mixedmark":r='<span aria-hidden="true" class="ui-mixedmark"><svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 512 512"><path fill="currentColor" d="M0 256c0-13.3 10.7-24 24-24H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24z"/></svg></span>'}if(r){const i=document.createElement("template");i.innerHTML=r,Qd[e]=i,t=i}}if(t){if("content"in t)return t.content.cloneNode(!0);const r=document.createElement("svg");return r.innerHTML=t.innerHTML,r}}var eh=80,th=class{constructor(e,t){this._element=null;var r;this.parentMenu=t,this._declaration=e,Tn(e)?(this.type="submenu",this.submenu=new rh(e.submenu,{parentMenu:t,submenuClass:e.submenuClass,columnCount:e.columnCount})):this.type=(r=e.type)!=null?r:"command",this.hasCheck=Nr(e)&&e.checked!==void 0}get rootMenu(){return this.parentMenu.rootMenu}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}dispose(){var e,t;(e=this._abortController)==null||e.abort(),this._abortController=void 0,(t=this._element)==null||t.remove(),this._element=null,this.submenu&&this.submenu.dispose(),this.submenu=void 0}get menuItem(){return this._declaration}get label(){var e;return(e=this._label)!=null?e:""}set label(e){e===void 0&&(e=""),e!==this._label&&(this._label=e,this.dirty=!0)}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.dirty=!0)}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.element&&(e?this.element.removeAttribute("aria-disabled"):this.element.setAttribute("aria-disabled","true")),this.dirty=!0}get checked(){return this._checked}set checked(e){this._checked=e,this.dirty=!0}get tooltip(){return this._tooltip}set tooltip(e){e!==this._tooltip&&(this._tooltip=e,this.dirty=!0)}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){e!==this._ariaLabel&&(this._ariaLabel=e,this.dirty=!0)}get active(){var e,t;return(t=(e=this.element)==null?void 0:e.classList.contains("active"))!=null?t:!1}set active(e){this.element&&this.element.classList.toggle("active",e)}updateState(e){var t,r,i;const n=this._declaration;if(Ol(n)){this.enabled=!1,this.checked=!1;return}Il(n)&&(this.enabled=!1,this.checked=!1,this.visible=!0),Nr(n)&&(this.checked=Nr(n)&&((t=Fn(n.checked,e))!=null?t:!1)),(Nr(n)||Tn(n))&&(this.enabled=(r=Fn(n.enabled,e))!=null?r:!0,this.visible=(i=Fn(n.visible,e))!=null?i:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(e),this.submenu.visible||(this.visible=!1))),(Nr(n)||Il(n)||Tn(n))&&(this.label=Fn(n.label,e),this.tooltip=Fn(n.tooltip,e),this.ariaLabel=Fn(n.ariaLabel,e)),this._element&&this.updateElement()}set dirty(e){console.assert(e===!0),e&&this.parentMenu&&(this.parentMenu.dirty=!0)}updateElement(){if(!this.visible||!this.element)return;const e=this.element;e.textContent="",this.enabled?e.removeAttribute("aria-disabled"):e.setAttribute("aria-disabled","true"),this.checked===!0?(e.setAttribute("aria-checked","true"),e.append(Rl("checkmark"))):this.checked==="mixed"?(e.setAttribute("aria-checked","mixed"),e.append(Rl("mixedmark"))):e.removeAttribute("aria-checked"),this.ariaLabel&&e.setAttribute("aria-label",this.ariaLabel);const t=document.createElement("span");if(t.className=this.parentMenu.hasCheck?"label indent":"label",this.type==="heading"&&t.classList.add("heading"),t.innerHTML=this.label,e.append(t),this._tooltip&&e.setAttribute("data-tooltip",this._tooltip),Nr(this._declaration)&&this._declaration.keyboardShortcut){const r=document.createElement("kbd");r.innerHTML=ml(this._declaration.keyboardShortcut),e.append(r)}this.type==="submenu"&&e.append(Rl("trailing-chevron"))}get element(){if(this._element)return this._element;if(Ol(this._declaration)){const r=document.createElement("li");return r.setAttribute("part","menu-divider"),r.setAttribute("role","divider"),this._element=r,r}const e=document.createElement("li");this._element=e,(Nr(this._declaration)||Il(this._declaration)||Tn(this._declaration))&&this._declaration.class&&(e.className=this._declaration.class),e.setAttribute("part","menu-item"),e.setAttribute("tabindex","-1"),this.hasCheck?e.setAttribute("role","menuitemcheckbox"):e.setAttribute("role","menuitem"),this.type==="submenu"&&(e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false"));const t=this.abortController.signal;return e.addEventListener("pointerenter",this,{signal:t}),e.addEventListener("pointerleave",this,{signal:t}),e.addEventListener("pointerup",this,{signal:t}),e.addEventListener("click",this,{signal:t}),this._element}dispatchSelect(){if(!Nr(this._declaration))return;const e=new CustomEvent("menu-select",{cancelable:!0,bubbles:!0,detail:{modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data}});this.parentMenu.dispatchEvent(e)&&typeof this._declaration.onMenuSelect=="function"&&this._declaration.onMenuSelect({modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data})}handleEvent(e){var t;if(!(!this.visible||!this.enabled)){if(e.type==="click"){this.rootMenu.state==="modal"&&this.select(),e.stopPropagation(),e.preventDefault();return}if(e.type==="pointerenter"){const r=e;this.rootMenu.cancelDelayedOperation(),this.parentMenu.isSubmenuOpen&&((t=this.parentMenu.activeMenuItem)!=null&&t.movingTowardSubmenu(r))?this.rootMenu.scheduleOperation(()=>{this.parentMenu.activeMenuItem=this,this.openSubmenu()}):(this.parentMenu.activeMenuItem=this,this.openSubmenu({withDelay:!0}));return}if(e.type==="pointerleave"){this.rootMenu.activeSubmenu===this.parentMenu&&(this.parentMenu.activeMenuItem=null);return}if(e.type==="pointerup"){this.rootMenu.state!=="modal"&&this.select(),e.stopPropagation(),e.preventDefault();return}}}select(){if(this.rootMenu.cancelDelayedOperation(),this.type==="submenu"){this.openSubmenu();return}this.active=!1,setTimeout(()=>{this.active=!0,setTimeout(()=>{this.rootMenu.hide(),this.dispatchSelect()},eh)},eh)}openSubmenu(e){var t;if(this.type!=="submenu"||!this.element)return;if((t=e==null?void 0:e.withDelay)!=null&&t){this.rootMenu.scheduleOperation(()=>this.openSubmenu());return}const r=this.element.getBoundingClientRect(),i=Gd(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:Yd(r,"trailing",i),y:r.top-4},alternateLocation:{x:Yd(r,"leading",i),y:r.top-4}})}movingTowardSubmenu(e){if(!this.element||this.type!=="submenu")return!1;const t=this.rootMenu.lastMoveEvent;if(!t)return!1;const r=e.timeStamp-t.timeStamp;if(r>500)return!1;const i=e.clientX-t.clientX;if(E1(i,t.clientY-e.clientY,r)<=.2)return!1;let a="right";if(this.submenu.element){const s=this.submenu.element.getBoundingClientRect(),o=this.element.getBoundingClientRect();s.left<o.left+o.width/2&&(a="left")}return a==="right"?i>0:i<0}};function E1(e,t,r){return Math.hypot(e,t)/r}function Fn(e,t){return e===void 0||typeof e!="function"?e:(t!=null||(t={alt:!1,control:!1,shift:!1,meta:!1}),e(t))}var rh=class qn{constructor(t,r){this._element=null,this._activeMenuItem=null,this._dirty=!0;var i,n;this.parentMenu=(i=r==null?void 0:r.parentMenu)!=null?i:null,this._submenuClass=r==null?void 0:r.submenuClass,this.columnCount=(n=r==null?void 0:r.columnCount)!=null?n:1,this.isSubmenuOpen=!1,this.menuItems=t}get children(){return this._menuItems}set menuItems(t){const r=this.parentMenu;this.dispose(),this.parentMenu=r,t=[...t],this._menuItems=t.map(i=>i.onCreate?i.onCreate(i,this):new th(i,this)),this.hasCheck=void 0,this.dirty=!0}dispose(){var t;this.hide(),this._element&&this._element.remove(),this._abortController&&this._abortController.abort(),(t=this._menuItems)==null||t.forEach(r=>r.dispose()),this._menuItems=[],this._activeMenuItem=null,this.parentMenu=null}handleEvent(t){if(t.type==="wheel"&&this._element){const r=t;this._element.scrollBy(0,r.deltaY),t.stopPropagation()}}dispatchEvent(t){return this.rootMenu.dispatchEvent(t)}get rootMenu(){return this.parentMenu.rootMenu}updateState(t){var r,i,n;this._menuItems.forEach(c=>c.updateState(t));const a=this.hasCheck;this.hasCheck=this._menuItems.some(c=>c.visible&&c.hasCheck),this.hasCheck!==a&&this._menuItems.forEach(c=>c.updateState(t));let s,o=0;for(const c of this._menuItems)c.type==="heading"?(s&&o===0&&(s.visible=!1),s=c,o=0):c.type==="divider"&&s?(s.visible=o>0,s=void 0,o=0):s&&c.visible&&(o+=1);s&&(s.visible=o>0);let l=!0;for(const c of this._menuItems)c.type==="divider"?(c.visible=!l,l=!0):c.visible&&(l=!1);(r=this.activeMenuItem)!=null&&r.visible||(this.activeMenuItem=null),!((i=this.activeMenuItem)!=null&&i.enabled)&&((n=this.activeMenuItem)==null?void 0:n.type)==="submenu"&&this._activeMenuItem.submenu.hide(),this._dirty=!1}get enabled(){return this.updateIfDirty(),this._menuItems.some(t=>t.type!=="divider"&&t.visible&&t.enabled)}get visible(){return this.updateIfDirty(),this._menuItems.some(t=>t.type!=="divider"&&t.visible)}set dirty(t){console.assert(t===!0),this._dirty!==t&&t&&this.parentMenu&&(this._dirty=!0,this.parentMenu.dirty=!0)}updateIfDirty(){this._dirty&&this.updateState(this.rootMenu.modifiers)}updateElement(){var t;if(this._element){this._element.textContent="";for(const{element:r,visible:i}of this._menuItems)r&&i&&this._element.append(r);(t=this._element.querySelector("li:first-of-type"))==null||t.setAttribute("tabindex","0")}}get element(){if(this._element)return this._element;const t=document.createElement("menu");t.setAttribute("role","menu"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-orientation","vertical"),t.setAttribute("part","ui-menu-container"),this._submenuClass&&t.classList.add(this._submenuClass),t.classList.add("ui-menu-container"),this._abortController||(this._abortController=new AbortController);const r=this._abortController.signal;return t.addEventListener("focus",this,{signal:r}),t.addEventListener("wheel",this,{passive:!0,signal:r}),this._element=t,this.updateElement(),t}get activeMenuItem(){return this._activeMenuItem}set activeMenuItem(t){var r,i,n,a;if(this.rootMenu.cancelDelayedOperation(),t!==this._activeMenuItem){if(this.activeMenuItem){const s=this.activeMenuItem;s.active=!1,(r=s.submenu)==null||r.hide()}if(!((i=t==null?void 0:t.visible)==null||i)){this._activeMenuItem=null;return}this._activeMenuItem=t,t&&(t.active=!0)}t?(n=t.element)==null||n.focus({preventScroll:!0}):(a=this._element)==null||a.focus({preventScroll:!0})}get firstMenuItem(){this.updateIfDirty();let t=0,r=!1;const i=this._menuItems;for(;!r&&t<=i.length-1;){const n=i[t];r=n.type!=="divider"&&n.visible&&n.enabled,t+=1}return r?i[t-1]:null}get lastMenuItem(){this.updateIfDirty();const t=this._menuItems;let r=t.length-1,i=!1;for(;!i&&r>=0;){const n=t[r];i=n.type!=="divider"&&n.visible&&n.enabled,r-=1}return i?t[r+1]:null}nextMenuItem(t){if(t===0)return this._activeMenuItem;if(!this._activeMenuItem)return t>0?this.firstMenuItem:this.lastMenuItem;if(!this.firstMenuItem||!this.lastMenuItem||!this._activeMenuItem)return null;this.updateIfDirty();const r=this._menuItems.indexOf(this.firstMenuItem),i=this._menuItems.indexOf(this.lastMenuItem);let n=this._menuItems.indexOf(this._activeMenuItem),a=1;for(;n>=r&&n<=i;){n+=t>0?1:-1;const s=this._menuItems[n];if(!s)break;if(s.visible&&s.enabled){if(a===Math.abs(t))return this._menuItems[n];a+=1}}return t>0?this.lastMenuItem:this.firstMenuItem}getMenuItemColumn(t){this.updateIfDirty();const i=this._menuItems.filter(n=>n.visible&&n.enabled).indexOf(t);return i<0?-1:i%this.columnCount}static get collator(){return qn._collator||(qn._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),qn._collator}findMenuItem(t){var r;this.updateIfDirty();const i=this._menuItems.filter(o=>o.type!=="divider"&&o.visible&&o.enabled);if(i.length===0)return null;const n=Math.max(...i.map(o=>o.label.length))-t.length;if(n<0)return null;let a=null,s=0;for(;s<n&&!a;)a=(r=i.find(o=>qn.collator.compare(t,o.label.substring(s,t.length))===0))!=null?r:null,s++;return a}show(t){return!this.visible||!t.container?!1:(this.updateElement(),t.container.appendChild(this.element),Se()&&(this.element.popover="manual",this.element.showPopover()),t.location&&S1(this.element,{location:t.location,alternateLocation:t.alternateLocation,verticalPos:"bottom",horizontalPos:"start"}),this.element.focus({preventScroll:!0}),this.parentMenu&&(this.parentMenu.openSubmenu=this),!0)}hide(){var t,r,i,n,a;this.openSubmenu=null,this.activeMenuItem=null,this.parentMenu&&(this.parentMenu.openSubmenu=null),Se()&&((t=this._element)!=null&&t.popover)&&this.element.hidePopover(),(i=(r=this.parentMenu)==null?void 0:r.element)==null||i.focus(),(a=(n=this._element)==null?void 0:n.parentNode)==null||a.removeChild(this._element)}set openSubmenu(t){var r,i,n,a;const s=t!==null;((r=this.activeMenuItem)==null?void 0:r.type)==="submenu"&&((i=this.activeMenuItem.element)==null||i.setAttribute("aria-expanded",s.toString())),(a=(n=this.activeMenuItem)==null?void 0:n.element)==null||a.classList.toggle("is-submenu-open",s),this.isSubmenuOpen=s}},ih=class af extends rh{constructor(t,r){var i;super(t),this.state="closed",this.typingBufferResetTimer=0,this.hysteresisTimer=0,this._updating=!1,this._host=(i=r==null?void 0:r.host)!=null?i:null,this.isDynamic=t.some(nh),this._modifiers={shift:!1,control:!1,alt:!1,meta:!1},this.typingBuffer="",this.state="closed"}get modifiers(){return this._modifiers}set modifiers(t){Up(this._modifiers,t)||(this._modifiers=t,this.dirty=!0)}get activeSubmenu(){let t=this;for(;t.isSubmenuOpen;)t=t.activeMenuItem.submenu;return t}set dirty(t){this._updating||(console.assert(t===!0),this._dirty!==t&&(this._dirty=!0,t&&setTimeout(()=>{this.updateState(this.modifiers),this.updateElement()})))}updateState(t){this._updating=!0,this.modifiers=t!=null?t:this.modifiers,super.updateState(this.modifiers),this._updating=!1}handleKeyupEvent(t){this.isDynamic&&(this.modifiers=$i(t)),t.stopImmediatePropagation()}handleKeydownEvent(t){var r,i,n;if(t.key==="Tab"||t.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=$i(t));let a=!0;const s=this.activeSubmenu,o=s.activeMenuItem;switch(t.key){case" ":case"Space":case"Return":case"Enter":o==null||o.select($i(t));break;case"ArrowRight":if((o==null?void 0:o.type)==="submenu")o.select($i(t)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!o)s.activeMenuItem=s.firstMenuItem;else{const l=(r=s.getMenuItemColumn(o))!=null?r:-1;if(l>=0&&l<((i=s.columnCount)!=null?i:1)-1){const c=s.nextMenuItem(1);c&&(s.activeMenuItem=c)}}break;case"ArrowLeft":if(s===this.rootMenu)o||(s.activeMenuItem=s.firstMenuItem);else if((o&&(n=s.getMenuItemColumn(o))!=null?n:-1)<=0||!o){s.hide();const c=s.parentMenu.activeMenuItem;if(c){const{element:u}=c;u==null||u.focus(),u==null||u.classList.remove("is-submenu-open")}}else{const c=s.nextMenuItem(-1);c&&(s.activeMenuItem=c)}break;case"ArrowDown":s.activeMenuItem=s.nextMenuItem(s.columnCount);break;case"ArrowUp":s.activeMenuItem=s.nextMenuItem(-s.columnCount);break;case"Home":case"PageUp":s.activeMenuItem=s.firstMenuItem;break;case"End":case"PageDown":s.activeMenuItem=s.lastMenuItem;break;case"Backspace":if(this.typingBuffer&&(this.typingBuffer=this.typingBuffer.slice(0,-1),this.typingBuffer)){clearTimeout(this.typingBufferResetTimer);const l=s.findMenuItem(this.typingBuffer);l&&(s.activeMenuItem=l),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(Vs(t)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=t.key;const l=s.findMenuItem(this.typingBuffer);l&&(s.activeMenuItem=l),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}else a=!1}a&&(t.preventDefault(),t.stopPropagation())}handleEvent(t){if(t.type==="keydown")this.handleKeydownEvent(t);else if(t.type==="keyup")this.handleKeyupEvent(t);else if(t.type==="pointermove")this.lastMoveEvent=t;else if(t.type==="pointerup"&&t.target===this.scrim)Number.isFinite(this.rootMenu._openTimestamp)&&Date.now()-this.rootMenu._openTimestamp<120?this.state="modal":this.state==="modal"&&this.hide();else if(t.type==="contextmenu"){t.preventDefault(),t.stopPropagation();return}super.handleEvent(t)}dispatchEvent(t){return this._host?this._host.dispatchEvent(t):!0}get scrim(){return Fr.element}connectScrim(t){const r=this.scrim;r.addEventListener("pointerup",this),r.addEventListener("contextmenu",this),r.addEventListener("keydown",this),r.addEventListener("keyup",this),r.addEventListener("pointermove",this),Fr.open({root:t,onDismiss:()=>this.hide()})}disconnectScrim(){const t=this.scrim;t.removeEventListener("pointerup",this),t.removeEventListener("contextmenu",this),t.removeEventListener("keydown",this),t.removeEventListener("keyup",this),t.removeEventListener("pointermove",this),Fr.state==="open"&&Fr.scrim.close()}get rootMenu(){return this}show(t){return this._onDismiss=t==null?void 0:t.onDismiss,t!=null&&t.modifiers&&(this.modifiers=t.modifiers),this.updateState(),this.connectScrim(t==null?void 0:t.target),super.show(g(p({},t),{container:this.scrim}))?(this._openTimestamp=Date.now(),this.state="open",!0):(this.disconnectScrim(),!1)}hide(){this.cancelDelayedOperation(),this.state!==void 0&&(this.state!=="closed"&&(this.activeMenuItem=null,Fr.element.parentElement.focus(),super.hide(),this.state="closed",this.disconnectScrim()),this._onDismiss&&(this._onDismiss(),this._onDismiss=void 0))}scheduleOperation(t){this.cancelDelayedOperation();const r=af.SUBMENU_DELAY;if(r<=0){t();return}this.hysteresisTimer=setTimeout(()=>{this.hysteresisTimer=0,t()},r)}cancelDelayedOperation(){this.hysteresisTimer&&(clearTimeout(this.hysteresisTimer),this.hysteresisTimer=0)}};ih.SUBMENU_DELAY=120;var A1=ih;function nh(e){return Ol(e)?!1:typeof e.label=="function"||typeof e.ariaLabel=="function"||typeof e.tooltip=="function"||(Nr(e)||Tn(e))&&(typeof e.enabled=="function"||typeof e.visible=="function")||Nr(e)&&typeof e.checked=="function"?!0:Tn(e)?e.submenu.some(nh):!1}var mo=class{};mo.DELAY=300,mo.MAX_DISTANCE=10;function L1(e){return new Promise((t,r)=>{const i=qs(e);i||t(!1);let n=i;const a=setTimeout(()=>{s.abort(),t(C1(n,i)<mo.MAX_DISTANCE)},mo.DELAY),s=new AbortController,o=s.signal;for(const l of["pointermove","pointerup","pointercancel"])window.addEventListener(l,c=>{if(c.type==="pointerup"||c.type==="pointercancel")clearTimeout(a),s.abort(),t(!1);else if(c.type==="pointermove"){const u=qs(c);u&&(n=u)}},{passive:!0,signal:o})})}function ah(e,t,r){return Ei(this,null,function*(){if(e.type==="contextmenu"){const i=e;if(r.show({target:t,location:qs(i),modifiers:$i(i)}))return e.preventDefault(),e.stopPropagation(),!0}if(e.type==="keydown"){const i=e;if(i.code==="ContextMenu"||i.code==="F10"&&i.shiftKey){const n=t==null?void 0:t.getBoundingClientRect();if(n&&r.show({target:t,location:{x:Math.ceil(n.left+n.width/2),y:Math.ceil(n.top+n.height/2)},modifiers:$i(i)}))return e.preventDefault(),e.stopPropagation(),!0}}if(e.type==="pointerdown"&&e.pointerType!=="mouse"&&e.button===0){let i=e.target;for(;i&&t!==i;)i=i.parentNode;if(!i||!r.visible)return!1;const n=qs(e);if(yield L1(e))return r.state!=="closed"?!1:(r.show({target:t,location:n}),!0)}return!1})}var sh={acute:714,grave:715,dot:729,ddot:168,mathring:730,tilde:126,bar:713,breve:728,check:711,hat:94,vec:8407};M(Object.keys(sh),"{body:auto}",{createAtom:e=>new Ds(g(p({},e),{body:B(e.args[0]),accentChar:sh[e.command.slice(1)]}))}),M(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:e=>{const t=Vn(B(e.args[0]));return new Ds(g(p({},e),{body:B(e.args[0]),svgAccent:e.command.slice(1)+(t.length>5?"4":["1","1","2","2","3","3"][t.length])}))}}),M(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:e=>new Ds(g(p({},e),{body:B(e.args[0]),svgAccent:"overarc"}))}),M(["underarc","underparen"],"{body:auto}",{createAtom:e=>new or(g(p({},e),{body:B(e.args[0]),svgBelow:"underarc"}))}),M("utilde","{body:auto}",{createAtom:e=>{const t=B(e.args[0]),r=Vn(t),i="widetilde"+(r.length>5?"4":["1","1","2","2","3","3"][r.length]);return new or(g(p({},e),{body:t,svgBelow:i,boxType:la(t)}))}}),M("^","{:string}",{createAtom:e=>{var t;return new w(g(p({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"\xE2",e:"\xEA",i:"\xEE",o:"\xF4",u:"\xFB",A:"\xC2",E:"\xCA",I:"\xCE",O:"\xD4",U:"\xDB"}[e.args[0]])!=null?t:"^"}))}}),M("`","{:string}",{createAtom:e=>{var t;return new w(g(p({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"\xE0",e:"\xE8",i:"\xEC",o:"\xF2",u:"\xF9",A:"\xC0",E:"\xC8",I:"\xCC",O:"\xD2",U:"\xD9"}[e.args[0]])!=null?t:"`"}))}}),M("'","{:string}",{createAtom:e=>{var t;return new w(g(p({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"\xE1",e:"\xE9",i:"\xED",o:"\xF3",u:"\xFA",A:"\xC1",E:"\xC9",I:"\xCD",O:"\xD3",U:"\xDA"}[e.args[0]])!=null?t:"'"}))}}),M('"',"{:string}",{createAtom:e=>{var t,r;return new w(g(p({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(r={a:"\xE4",e:"\xEB",i:"\xEF",o:"\xF6",u:"\xFC",A:"\xC4",E:"\xCB",I:"\xCB",O:"\xD6",U:"\xDC"}[e.args[0]])!=null?r:'"'+e.args[0]:'"'}))}}),M(".","{:string}",{createAtom:e=>{var t,r;return new w(g(p({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(r={a:"\u0227",e:"\u0117",i:"\u0307i",o:"\u022F",u:"\u0307u",A:"\u0226",E:"\u0116",I:"\u0130",O:"\u022E",U:"\u0307U"}[e.args[0]])!=null?r:"."+e.args[0]:"."}))}}),M("=","{:string}",{createAtom:e=>{var t,r;return new w(g(p({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(r={a:"\u0101",e:"\u0113",i:"\u012B",o:"\u014D",u:"\u016B",A:"\u0100",E:"\u0112",I:"\u012A",O:"\u014C",U:"\u016A"}[e.args[0]])!=null?r:"="+e.args[0]:"="}))}}),M("~","{:string}",{createAtom:e=>{var t;return new w(g(p({type:"mord"},e),{isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={n:"\xF1",N:"\xD1",a:"\xE3",o:"\xF5",A:"\xC3",O:"\xD5"}[e.args[0]])!=null?t:"\xB4"}))}}),M("c","{:string}",{createAtom:e=>{var t;return new w(g(p({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={c:"\xE7",C:"\xC7"}[e.args[0]])!=null?t:""}))}}),M("enclose","{notation:string}[style:string]{body:auto}",{createAtom:e=>{var t,r;const i=e.args,n={strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"none",svgStrokeStyle:void 0,borderStyle:void 0,style:(t=e.style)!=null?t:{}};if(i[1]){const s=i[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const o of s){const l=o.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(l)n.strokeWidth=l[1],n.strokeStyle=l[2],n.strokeColor=l[3];else{const c=o.match(/\s*([a-z]*)\s*=\s*"(.*)"/);c&&(c[1]==="mathbackground"?n.backgroundcolor=c[2]:c[1]==="mathcolor"?n.strokeColor=c[2]:c[1]==="padding"?n.padding=c[2]:c[1]==="shadow"&&(n.shadow=c[2]))}}n.strokeStyle==="dashed"?n.svgStrokeStyle="5,5":n.strokeStyle==="dotted"&&(n.svgStrokeStyle="1,5")}n.borderStyle=`${n.strokeWidth} ${n.strokeStyle} ${n.strokeColor}`;const a={};return((r=i[0])!=null?r:"").split(/[, ]/).filter(s=>s.length>0).forEach(s=>{a[s.toLowerCase()]=!0}),new ma(e.command,B(i[2]),a,n)}}),M("cancel","{body:auto}",{createAtom:e=>{var t;return new ma(e.command,B(e.args[0]),{updiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}}),M("bcancel","{body:auto}",{createAtom:e=>{var t;return new ma(e.command,B(e.args[0]),{downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}}),M("xcancel","{body:auto}",{createAtom:e=>{var t;return new ma(e.command,B(e.args[0]),{updiagonalstrike:!0,downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}}),M(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:e=>{var t;return new or(g(p({},e),{body:B((t=e.args)==null?void 0:t[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:e.command.slice(1)}))}}),M("overbrace","{:auto}",{createAtom:e=>new or(g(p({},e),{body:B(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:e.command.slice(1)}))}),M(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:e=>new or(g(p({},e),{body:B(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:e.command.slice(1)}))}),M(["underbrace"],"{:auto}",{createAtom:e=>new or(g(p({},e),{body:B(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:e.command.slice(1)}))}),M(["xrightarrow","longrightarrow","xleftarrow","longleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","longleftrightarrow","xLeftrightarrow","xrightleftharpoons","longrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xleftrightarrows","longleftrightarrows","xRightleftharpoons","longRightleftharpoons","xLeftrightharpoons","longLeftrightharpoons"],"[:auto]{:auto}",{createAtom:e=>{var t,r,i,n,a;return new or(g(p({},e),{svgBody:e.command.slice(1),above:((r=B((t=e.args)==null?void 0:t[1]))==null?void 0:r.length)===0?void 0:B((i=e.args)==null?void 0:i[1]),below:(a=B((n=e.args)==null?void 0:n[0]))!=null?a:null,skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,paddedLabels:!0,boxType:"rel"}))},serialize:(e,t)=>e.command+(e.hasEmptyBranch("below")?"":`[${e.belowToLatex(t)}]`)+`{${e.aboveToLatex(t)}}${e.supsubToLatex(t)}`}),M(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","cotg","coth","ctg","cth","csc","cosec","deg","dim","exp","gcd","hom","inf","ker","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th","arcsec","arccsc","arsinh","arcosh","artanh","arcsech","arccsch"],"",{isFunction:!0,ifMode:"math",createAtom:e=>new Xi(e.command.slice(1),g(p({},e),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),M(["liminf","limsup"],"",{ifMode:"math",createAtom:e=>new Xi({"\\liminf":"lim inf","\\limsup":"lim sup"}[e.command],g(p({},e),{limits:"over-under",variant:"main"}))}),M(["lim","mod"],"",{ifMode:"math",createAtom:e=>new Xi(e.command.slice(1),g(p({},e),{limits:"over-under",variant:"main"}))}),M(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:e=>new Xi(e.command.slice(1),g(p({},e),{limits:"over-under",isFunction:!0,variant:"main"}))}),M(["ang"],"{:math}",{ifMode:"math",createAtom:e=>new w(g(p({},e),{body:B(e.args[0])})),serialize:(e,t)=>`\\ang{${e.bodyToLatex(t)}}`,render:(e,t)=>{const r=e.createBox(t),i=r.caret;r.caret=void 0;const n=new D("\xB0",{style:g(p({},e.style),{variant:"normal",variantStyle:"up"})});return new D([r,n],{type:"inner",isSelected:e.isSelected,caret:i})}}),M("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:e=>new od(g(p({},e),{body:B(e.args[1]),index:e.args[0]?B(e.args[0]):void 0}))}),M(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:e=>{const t=p({},e),r=e.command,i=e.args;switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":t.hasBarLine=!0;break;case"\\atopfrac":t.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":t.hasBarLine=!1,t.leftDelim="(",t.rightDelim=")";break;case"\\cfrac":t.hasBarLine=!0,t.continuousFraction=!0;break;default:}switch(r){case"\\dfrac":case"\\dbinom":t.mathstyleName="displaystyle";break;case"\\tfrac":case"\\tbinom":t.mathstyleName="textstyle";break;default:}return new kn(i[0]?B(i[0]):[new ti],i[1]?B(i[1]):[new ti],t)},serialize:(e,t)=>{const r=e.aboveToLatex(t),i=e.belowToLatex(t);return/^[0-9]$/.test(r)&&/^[0-9]$/.test(i)?`${e.command}${r}${i}`:_e(e.command,r,i)}}),M(["brace","brack"],"",{infix:!0,createAtom:e=>new kn(B(e.args[0]),B(e.args[1]),g(p({},e),{hasBarLine:!1,leftDelim:e.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:e.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(e,t)=>X([e.aboveToLatex(t),e.command,e.belowToLatex(t)])}),M(["over","atop","choose"],"",{infix:!0,createAtom:e=>{let t,r;const i=e.args;return e.command==="\\choose"&&(t="(",r=")"),new kn(B(i[0]),B(i[1]),g(p({},e),{hasBarLine:e.command==="\\over",leftDelim:t,rightDelim:r}))},serialize:(e,t)=>X([e.aboveToLatex(t),e.command,e.belowToLatex(t)])}),M(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0,createAtom:e=>{var t,r;const i=e.args;return new kn(B(i[0]),B(i[1]),g(p({},e),{leftDelim:(t=i[2])!=null?t:".",rightDelim:(r=i[3])!=null?r:".",hasBarLine:!1}))},serialize:(e,t)=>`${e.aboveToLatex(t)} ${e.command}${e.leftDelim}${e.rightDelim}${e.belowToLatex(t)}`}),M("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:e=>new kn(B(e.args[0]),B(e.args[1]),g(p({},e),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),M(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:e=>new ul({coprod:"\u2210",bigvee:"\u22C1",bigwedge:"\u22C0",biguplus:"\u2A04",bigcap:"\u22C2",bigcup:"\u22C3",intop:"\u222B",prod:"\u220F",sum:"\u2211",bigotimes:"\u2A02",bigoplus:"\u2A01",bigodot:"\u2A00",bigsqcup:"\u2A06",smallint:"\u222B"}[e.command.slice(1)],g(p({},e),{limits:"auto",variant:"main"}))}),M("smallint","",{ifMode:"math",createAtom:e=>new Xi("\u222B",g(p({},e),{limits:"adjacent",variant:"main"}))});var oh={int:"\u222B",iint:"\u222C",iiint:"\u222D",oint:"\u222E",oiint:"\u222F",oiiint:"\u2230",intclockwise:"\u2231",varointclockwise:"\u2232",ointctrclockwise:"\u2233",intctrclockwise:"\u2A11",sqcup:"\u2294",sqcap:"\u2293",uplus:"\u228E",wr:"\u2240",amalg:"\u2A3F",Cap:"\u22D2",Cup:"\u22D3",doublecap:"\u22D2",doublecup:"\u22D3"};M(Object.keys(oh),"",{ifMode:"math",createAtom:e=>{const t=e.command,r=oh[t.slice(1)];return new ul(r,g(p({},e),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[r]}))}}),M(["Re","Im"],"",{ifMode:"math",createAtom:e=>new Xi({"\\Re":"\u211C","\\Im":"\u2111"}[e.command],g(p({},e),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),M("middle","{:delim}",{ifMode:"math",createAtom:e=>{var t;return new nd(g(p({},e),{delim:(t=e.args[0])!=null?t:"|",size:1}))}}),M("the","{:value}",{createAtom:e=>new w(g(p({},e),{captureSelection:!0,verbatimLatex:null})),render:(e,t)=>{var r;const i=new $({parent:t},e.style);let n="";e.isSelected&&(n+=" ML__selected");const a=i.evaluate(e.args[0]);return new D(((r=ct(a))!=null?r:"").split("").map(s=>new D(s,{type:"ord",classes:n,mode:e.mode,isSelected:e.isSelected,style:p({variant:"main"},e.style)})),{type:"lift",style:e.style,caret:e.caret,isSelected:e.isSelected,classes:n}).wrap(i)},serialize:e=>{var t;return`\\the${(t=ct(e.args[0]))!=null?t:"\\relax"}`}}),M("mathtip","{:auto}{:math}",{createAtom:e=>new dl(g(p({},e),{body:B(e.args[0]),tooltip:B(e.args[1]),content:"math"})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\texttip{${e.bodyToLatex(t)}}{${w.serialize([e.tooltip],g(p({},t),{defaultMode:"math"}))}}`}),M("texttip","{:auto}{:text}",{createAtom:e=>new dl(g(p({},e),{body:B(e.args[0]),tooltip:B(e.args[1]),content:"text"})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\texttip{${e.bodyToLatex(t)}}{${w.serialize([e.tooltip],g(p({},t),{defaultMode:"text"}))}}`}),M("error","{:math}",{createAtom:e=>new w(g(p({},e),{body:B(e.args[0])})),serialize:(e,t)=>`\\error{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__error"})}),M("ensuremath","{:math}",{createAtom:e=>new w(g(p({},e),{body:B(e.args[0])})),serialize:(e,t)=>`${e.command}{${e.bodyToLatex(g(p({},t),{defaultMode:"math"}))}}`}),M("color","{:value}",{applyStyle:(e,t,r)=>{var i,n;return{verbatimColor:(i=ct(t[0]))!=null?i:void 0,color:r.toColor((n=t[0])!=null?n:{string:"red"})}}}),M("textcolor","{:value}{content:auto*}",{applyStyle:(e,t,r)=>{var i,n;return{verbatimColor:(i=ct(t[0]))!=null?i:void 0,color:r.toColor((n=t[0])!=null?n:{string:"red"})}}}),M("boxed","{content:math}",{createAtom:e=>new _i(g(p({},e),{body:B(e.args[0]),framecolor:{string:"black"}}))}),M("colorbox","{:value}{:text*}",{applyStyle:(e,t,r)=>{var i,n;return{verbatimBackgroundColor:(i=ct(t[0]))!=null?i:void 0,backgroundColor:r.toBackgroundColor((n=t[0])!=null?n:{string:"yellow"})}}}),M("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:e=>{var t,r;return new _i(g(p({},e),{body:B(e.args[2]),framecolor:(t=e.args[0])!=null?t:{string:"blue"},backgroundcolor:(r=e.args[1])!=null?r:{string:"yellow"}}))},serialize:(e,t)=>{var r,i;return t.skipStyles?e.bodyToLatex(g(p({},t),{defaultMode:"text"})):_e(e.command,(r=ct(e.framecolor))!=null?r:"",(i=ct(e.backgroundcolor))!=null?i:"",e.bodyToLatex(g(p({},t),{defaultMode:"text"})))}}),M("bbox","[:bbox]{body:auto}",{createAtom:e=>{var t;const r=e.args[0],i=B(e.args[1]);return r?new _i(g(p({},e),{body:i,padding:r.padding,border:r.border,backgroundcolor:(t=r.backgroundcolor)!=null?t:void 0})):new _i(g(p({},e),{body:i}))},serialize:(e,t)=>{var r,i;if(t.skipStyles)return e.bodyToLatex(t);let n=e.command;if(Number.isFinite(e.padding)||e.border!==void 0||e.backgroundcolor!==void 0){const a=[];e.padding&&a.push((r=ct(e.padding))!=null?r:""),e.border&&a.push(`border: ${e.border}`),e.backgroundcolor&&a.push((i=ct(e.backgroundcolor))!=null?i:""),n+=`[${a.join(",")}]`}return _e(n,e.bodyToLatex(t))}}),M(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:e=>new w(g(p({},e),{body:B(e.args[0])})),render:(e,t)=>{const r=new $({parent:t,mathstyle:e.command.slice(1)},e.style),i=w.createBox(r,e.body,{type:"lift"});return e.caret&&(i.caret=e.caret),e.bind(t,i)},serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`{${X([e.command,e.bodyToLatex(t)])}}`}),M(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{applyStyle:e=>({fontSize:{"\\tiny":1,"\\scriptsize":2,"\\footnotesize":3,"\\small":4,"\\normalsize":5,"\\large":6,"\\Large":7,"\\LARGE":8,"\\huge":9,"\\Huge":10}[e]})}),M("fontseries","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var r;return{fontSeries:(r=t[0])!=null?r:"auto"}}}),M("fontshape","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var r;return{fontShape:(r=t[0])!=null?r:"auto"}}}),M("fontfamily","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var r;return{fontFamily:(r=t[0])!=null?r:"roman"}}}),M("selectfont","",{ifMode:"text",applyStyle:()=>({})}),M("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),M(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:e=>new w(g(p({},e),{body:B(e.args[0])})),serialize:(e,t)=>`${e.command}{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__boldsymbol"})}),M("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),M("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),M("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),M("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),M("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),M("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),M("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),M("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),M("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),M("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),M("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),M("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),M("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),M("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),M("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),M("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),M("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),M("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),M("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),M("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),M("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),M("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),M("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),M("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),M("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),M("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),M("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),M(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),M(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),M("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),M("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),M("mbox","{:text}",{ifMode:"math",createAtom:e=>new w(g(p({},e),{type:"mord",body:B(e.args[0]),mode:"math"})),serialize:(e,t)=>_e("\\mbox",e.bodyToLatex(g(p({},t),{defaultMode:"text"})))}),M("text","{:text}",{ifMode:"math",applyMode:"text"}),M(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:e=>new w(g(p({},e),{body:B(e.args[1])})),serialize:(e,t)=>!e.args[0]||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`,render:(e,t)=>{var r;return e.createBox(t,{classes:(r=e.args[0])!=null?r:""})}}),M(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:e=>new w(g(p({},e),{body:B(e.args[1])})),serialize:(e,t)=>{var r;return!((r=e.args)!=null&&r[0])||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var r;const i=e.createBox(t);return i.cssId=(r=e.args[0])!=null?r:"",i}}),M("htmlData","{data:string}{content:auto}",{createAtom:e=>new w(g(p({},e),{body:B(e.args[1])})),serialize:(e,t)=>{var r;return!((r=e.args)!=null&&r[0])||t.skipStyles?e.bodyToLatex(t):`\\htmlData{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var r;const i=e.createBox(t);return i.htmlData=(r=e.args[0])!=null?r:"",i}}),M(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:e=>new w(g(p({},e),{body:B(e.args[1])})),serialize:(e,t)=>{var r;return!((r=e.args)!=null&&r[0])||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var r;const i=e.createBox(t);return i.htmlStyle=(r=e.args[0])!=null?r:"",i}}),M("em","{:rest}",{createAtom:e=>new w(g(p({},e),{body:B(e.args[0])})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`{\\em ${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__emph",boxType:"lift"})}),M("emph","{:auto}",{createAtom:e=>new w(g(p({},e),{body:B(e.args[1])})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\emph{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__emph",boxType:"lift"})});var lh={"\\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}};M(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:e=>{var t;return new ad(g(p({},e),{delim:(t=e.args[0])!=null?t:".",size:lh[e.command].size,delimType:lh[e.command].mclass}))}}),M(["hspace","hspace*"],"{width:value}",{createAtom:e=>{var t;return new va(g(p({},e),{width:(t=e.args[0])!=null?t:{dimension:0}}))}}),M(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:e=>{var t;return new va(g(p({},e),{width:(t=e.args[0])!=null?t:{dimension:0}}))}}),M("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:e=>new w(e),render:(e,t)=>{let r=0;const i=t.mathstyle.id;(i===Cs||i===Ri)&&(r=1),(i===yn||i===Zt)&&(r=2),(i===qi||i===yt)&&(r=3);const n=B(e.args[r]);return w.createBox(t,n)},serialize:(e,t)=>`\\mathchoice{${w.serialize(e.args[0],t)}}{${w.serialize(e.args[1],t)}}{${w.serialize(e.args[2],t)}}{${w.serialize(e.args[3],t)}}`}),M("mathop","{:auto}",{createAtom:e=>new w(g(p({},e),{type:"mop",body:B(e.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(e,t)=>{var r;let i=w.createBox(t,e.body);if(e.superscript||e.subscript){const n=(r=e.subsupPlacement)!=null?r:"auto";i=n==="over-under"||n==="auto"&&t.isDisplayStyle?e.attachLimits(t,{base:i}):e.attachSupsub(t,{base:i})}return new D(e.bind(t,i),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,t)=>{const r=[_e(e.command,e.bodyToLatex(t))];return e.explicitSubsupPlacement&&(e.subsupPlacement==="over-under"&&r.push("\\limits"),e.subsupPlacement==="adjacent"&&r.push("\\nolimits"),e.subsupPlacement==="auto"&&r.push("\\displaylimits")),r.push(e.supsubToLatex(t)),X(r)}}),M(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:e=>new w(g(p({},e),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[e.command],body:B(e.args[0])}))}),M(["operatorname","operatorname*"],"{operator:math}",{createAtom:e=>{const t=B(e.args[0]).map(r=>{var i;return r.type!=="first"&&(r.type="mord",r.value=(i={"\u2217":"*","\u2212":"-"}[r.value])!=null?i:r.value,r.isFunction=!1,!r.style.variant&&!r.style.variantStyle&&(r.style.variant="main",r.style.variantStyle="up")),r});return new w(g(p({},e),{type:"mop",body:t,isFunction:!0,limits:e.command==="\\operatorname"?"adjacent":"over-under"}))},render:(e,t)=>{var r;let i=w.createBox(t,e.body);if(e.superscript||e.subscript){const n=(r=e.subsupPlacement)!=null?r:"auto";i=n==="over-under"||n==="auto"&&t.isDisplayStyle?e.attachLimits(t,{base:i}):e.attachSupsub(t,{base:i})}return e.caret&&(i.caret=e.caret),new D(e.bind(t,i),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,t)=>{const r=[_e(e.command,e.bodyToLatex(t))];return e.explicitSubsupPlacement&&(e.subsupPlacement==="over-under"&&r.push("\\limits"),e.subsupPlacement==="adjacent"&&r.push("\\nolimits"),e.subsupPlacement==="auto"&&r.push("\\displaylimits")),r.push(e.supsubToLatex(t)),X(r)}}),M(["char","unicode"],"{charcode:value}",{createAtom:e=>new w(g(p({},e),{type:e.mode==="text"?"text":"mord"})),serialize:e=>{var t;return`${e.command}${ct((t=e.args[0])!=null?t:{number:10067,base:"hexadecimal"})}`},render:(e,t)=>{let r=t.evaluate(e.args[0]);return(!r||!("number"in r))&&(r={number:10067,base:"hexadecimal"}),e.value=String.fromCodePoint(r.number),e.createBox(t)}}),M("rule","[raise:value]{width:value}{thickness:value}",{createAtom:e=>new w(e),render:(e,t)=>{var r,i,n;const a=new $({parent:t,mathstyle:"textstyle"},e.style),s=a.toEm((r=e.args[0])!=null?r:{dimension:0}),o=a.toEm((i=e.args[1])!=null?i:{dimension:10}),l=a.toEm((n=e.args[2])!=null?n:{dimension:10}),c=new D(null,{classes:"rule",type:"ord"});return c.width=o,c.height=l+s,c.depth=-s,c.setStyle("border-right-width",o,"em"),c.setStyle("border-top-width",l,"em"),c.setStyle("border-color",e.style.color),c.setStyle("vertical-align",s,"em"),e.isSelected&&c.setStyle("opacity","50%"),e.bind(a,c),e.caret&&(c.caret=e.caret),c.wrap(t)},serialize:e=>`\\rule${e.args[0]?`[${ct(e.args[0])}]`:""}{${ct(e.args[1])}}{${ct(e.args[2])}}`}),M(["overline","underline"],"{:auto}",{createAtom:e=>new w(g(p({},e),{body:B(e.args[0])})),render:(e,t)=>{const r=e.command.substring(1),i=new $({parent:t,mathstyle:"cramp"},e.style),n=w.createBox(i,e.body);if(!n)return null;const a=i.metrics.defaultRuleThickness/i.scalingFactor,s=new D(null,{classes:r+"-line"});s.height=a,s.maxFontSize=a*1.125*i.scalingFactor;let o;return r==="overline"?o=new je({shift:0,children:[{box:n},3*a,{box:s},a]}):o=new je({top:n.height,children:[a,{box:s},3*a,{box:n}]}),e.caret&&(o.caret=e.caret),new D(o,{classes:r,type:"ignore"})}}),M("overset","{:auto}{base:auto}",{createAtom:e=>{const t=B(e.args[1]);return new or(g(p({},e),{above:B(e.args[0]),body:t,skipBoundary:!1,boxType:la(t)}))},serialize:(e,t)=>_e(e.command,e.aboveToLatex(t),e.bodyToLatex(t))}),M("underset","{:auto}{base:auto}",{createAtom:e=>{const t=B(e.args[1]);return new or(g(p({},e),{below:B(e.args[0]),body:t,skipBoundary:!1,boxType:la(t)}))},serialize:(e,t)=>_e(e.command,e.belowToLatex(t),e.bodyToLatex(t))}),M("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:e=>{const t=B(e.args[2]);return new or(g(p({},e),{above:B(e.args[0]),below:B(e.args[1]),body:t,skipBoundary:!1,boxType:la(t)}))},serialize:(e,t)=>_e(e.command,e.belowToLatex(t),e.bodyToLatex(t))}),M(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:e=>new or(g(p({},e),{body:B(e.args[2]),above:B(e.args[1]),below:B(e.args[0]),skipBoundary:!1,boxType:e.command==="\\stackrel"?"rel":"bin"})),serialize:(e,t)=>_e(e.command,e.aboveToLatex(t),e.bodyToLatex(t))}),M("smash","[:string]{:auto}",{createAtom:e=>{var t,r,i,n;return new ba(g(p({},e),{body:B(e.args[1]),smashHeight:(r=(t=e.args[0])==null?void 0:t.includes("t"))!=null?r:!0,smashDepth:(n=(i=e.args[0])==null?void 0:i.includes("b"))!=null?n:!0}))}}),M(["vphantom"],"{:auto}",{createAtom:e=>new ba(g(p({},e),{body:B(e.args[0]),isInvisible:!0,smashWidth:!0}))}),M(["hphantom"],"{:auto}",{createAtom:e=>new ba(g(p({},e),{body:B(e.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),M(["phantom"],"{:auto}",{createAtom:e=>new ba(g(p({},e),{body:B(e.args[0]),isInvisible:!0}))}),M("not","{:math}",{createAtom:e=>{const t=B(e.args[0]);return t.length===0?new w(g(p({},e),{type:"mrel",value:"\uE020"})):new w(g(p({},e),{body:[new Ji(g(p({},e),{body:"\uE020",align:"right"})),...t],captureSelection:!0}))},serialize:(e,t)=>{const r=e.args[0],i=r&&typeof r=="object"&&"group"in r;return e.value!=="\uE020"?i?`\\not{${w.serialize(r.group,t)}}`:`\\not${w.serialize(r,t)}`:i?"\\not{}":"\\not"},render:(e,t)=>{if(e.value)return e.createBox(t);const i=e.args[0]&&typeof e.args[0]=="object"&&"group"in e.args[0]?"ord":la(B(e.args[0])),n=w.createBox(t,e.body,{type:i});return e.caret&&(n.caret=e.caret),e.bind(t,n)}}),M(["ne","neq"],"",{createAtom:e=>new w(g(p({},e),{type:"mrel",body:[new Ji(g(p({},e),{body:"\uE020",align:"right",boxType:"rel"})),new w(g(p({},e),{value:"="}))],captureSelection:!0})),serialize:e=>e.command}),M("rlap","{:auto}",{createAtom:e=>new Ji(g(p({},e),{body:B(e.args[0]),align:"right"}))}),M("llap","{:auto}",{createAtom:e=>new Ji(g(p({},e),{body:B(e.args[0]),align:"left"}))}),M("mathrlap","{:math}",{createAtom:e=>new Ji(g(p({},e),{body:B(e.args[0]),align:"left"}))}),M("mathllap","{:math}",{createAtom:e=>new Ji(g(p({},e),{body:B(e.args[0]),align:"left"}))}),M("raisebox","{:value}{:text}",{createAtom:e=>{var t;return new _i(g(p({},e),{body:B(e.args[1]),padding:{dimension:0},offset:(t=e.args[0])!=null?t:{dimension:0}}))},serialize:(e,t)=>{var r;return _e("\\raisebox",(r=ct(e.offset))!=null?r:"0pt",e.bodyToLatex(t))}}),M("raise","{:value}{:auto}",{createAtom:e=>{var t;return new _i(g(p({},e),{body:B(e.args[1]),padding:{dimension:0},offset:(t=e.args[0])!=null?t:{dimension:0}}))},serialize:(e,t)=>{var r;return _e("\\raise",(r=ct(e.offset))!=null?r:"0pt",e.bodyToLatex(t))}}),M("lower","{:value}{:auto}",{createAtom:e=>{var t;return new _i(g(p({},e),{body:B(e.args[1]),padding:{dimension:0},offset:(t=Tr(e.args[0],-1))!=null?t:{dimension:0}}))},serialize:(e,t)=>{var r,i;return _e("\\lower",(i=ct(Tr((r=e.offset)!=null?r:{dimension:0},-1)))!=null?i:"0pt",e.bodyToLatex(t))}}),Te("0123456789/@.?!"),si(65,90),si(97,122),Te([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),Te([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),Te([["\\backslash",92],["\\nabla",8711],["\\partial",8706],["\\ell",8467],["\\hbar",8463],["\\Q",81,"mord","double-struck"],["\\C",67,"mord","double-struck"],["\\P",80,"mord","double-struck"],["\\pounds",163],["\\euro",8364]]),Te([["\\rightarrow",8594],["\\to",8594],["\\leftarrow",8592],["\\gets",8592],["\\Rightarrow",8658],["\\Leftarrow",8656],["\\longrightarrow",10230],["\\longleftarrow",10229],["\\Longrightarrow",10233],["\\implies",10233],["\\Longleftarrow",10232],["\\impliedby",10232],["\\longleftrightarrow",10231],["\\biconditional",10231],["\\Longleftrightarrow",10234],["\\mapsto",8614],["\\longmapsto",10236],["\\uparrow",8593],["\\downarrow",8595],["\\Uparrow",8657],["\\Downarrow",8659],["\\updownarrow",8597],["\\Updownarrow",8661],["\\hookrightarrow",8618],["\\hookleftarrow",8617],["\\rightharpoonup",8640],["\\leftharpoonup",8636],["\\rightharpoondown",8641],["\\leftharpoondown",8637],["\\searrow",8600],["\\nearrow",8599],["\\swarrow",8601],["\\nwarrow",8598],["\\originalof",8886],["\\laplace",8886],["\\imageof",8887],["\\Laplace",8887]],"mrel"),Te([["\\mapsfrom",8612,"mrel"],["\\Mapsfrom",10502,"mrel"],["\\MapsTo",10503,"mrel"],["\\Yup",8516,"mord"],["\\lightning",8623,"mrel"],["\\leftarrowtriangle",8701,"mrel"],["\\rightarrowtriangle",8702,"mrel"],["\\leftrightarrowtriangle",8703,"mrel"],["\\boxdot",8865,"mbin"],["\\bigtriangleup",9651,"mbin"],["\\bigtriangledown",9661,"mbin"],["\\boxbar",9707,"mbin"],["\\Lbag",10181,"mopen"],["\\Rbag",10182,"mclose"],["\\llbracket",10214,"mopen"],["\\rrbracket",10215,"mclose"],["\\longmapsfrom",10235,"mrel"],["\\Longmapsfrom",10237,"mrel"],["\\Longmapsto",10238,"mrel"],["\\boxslash",10692,"mbin"],["\\boxbslash",10693,"mbin"],["\\boxast",10694,"mbin"],["\\boxcircle",10695,"mbin"],["\\boxbox",10696,"mbin"],["\\fatsemi",10783,"mop"],["\\leftslice",10918,"mrel"],["\\rightslice",10919,"mrel"],["\\interleave",10996,"mbin"],["\\biginterleave",11004,"mop"],["\\sslash",11005,"mbin"],["\\talloblong",11006,"mbin"]]),Te([["\\lbrace",123,"mopen"],["\\rbrace",125,"mclose"],["\\lparen",40,"mopen"],["\\rparen",41,"mclose"],["\\langle",10216,"mopen"],["\\rangle",10217,"mclose"],["\\lfloor",8970,"mopen"],["\\rfloor",8971,"mclose"],["\\lceil",8968,"mopen"],["\\rceil",8969,"mclose"],["\\vert",8739],["\\lvert",8739,"mopen"],["\\rvert",8739,"mclose"],["\\|",8741],["\\Vert",8741],["\\mVert",8741],["\\lVert",8741,"mopen"],["\\rVert",8741,"mclose"],["\\lbrack",91,"mopen"],["\\rbrack",93,"mclose"],["\\{",123,"mopen"],["\\}",125,"mclose"],["(",40,"mopen"],[")",41,"mclose"],["[",91,"mopen"],["]",93,"mclose"],["\\ulcorner",9484,"mopen","ams"],["\\urcorner",9488,"mclose","ams"],["\\llcorner",9492,"mopen","ams"],["\\lrcorner",9496,"mclose","ams"],["\\lgroup",10222,"mopen"],["\\rgroup",10223,"mclose"],["\\lmoustache",9136,"mopen"],["\\rmoustache",9137,"mclose"]]),Te([["\\dashrightarrow",8674],["\\dashleftarrow",8672],["\\Rrightarrow",8667],["\\Lleftarrow",8666],["\\leftrightarrows",8646],["\\rightleftarrows",8644],["\\curvearrowright",8631],["\\curvearrowleft",8630],["\\rightrightarrows",8649],["\\leftleftarrows",8647],["\\upuparrows",8648],["\\downdownarrows",8650],["\\vartriangle",9651],["\\triangleq",8796],["\\vartriangleleft",8882],["\\trianglelefteq",8884],["\\ntriangleleft",8938],["\\ntrianglelefteq",8940],["\\vartriangleright",8883],["\\trianglerighteq",8885],["\\ntriangleright",8939],["\\ntrianglerighteq",8941],["\\blacktriangleleft",9664],["\\blacktriangleright",9654],["\\leftarrowtail",8610],["\\rightarrowtail",8611],["\\looparrowright",8620],["\\looparrowleft",8619],["\\twoheadleftarrow",8606],["\\twoheadrightarrow",8608],["\\twoheadrightarrowtail",10518],["\\rightleftharpoons",8652],["\\leftrightharpoons",8651],["\\Rsh",8625],["\\Lsh",8624],["\\circlearrowright",8635],["\\circlearrowleft",8634],["\\restriction",8638],["\\upharpoonright",8638],["\\upharpoonleft",8639],["\\downharpoonright",8642],["\\downharpoonleft",8643],["\\rightsquigarrow",8669],["\\leadsto",8669],["\\leftrightsquigarrow",8621],["\\multimap",8888],["\\nleftarrow",8602],["\\nrightarrow",8603],["\\nRightarrow",8655],["\\nLeftarrow",8653],["\\nleftrightarrow",8622],["\\nLeftrightarrow",8654],["\\nvrightarrow",8696],["\\nvtwoheadrightarrow",10496],["\\nvrightarrowtail",10516],["\\nvtwoheadrightarrowtail",10519],["\\shortparallel",8741],["\\nless",8814],["\\nleqslant",57360],["\\lneq",10887],["\\lneqq",8808],["\\nleqq",57361],["\\lvertneqq",57356],["\\lnsim",8934],["\\lnapprox",10889],["\\nprec",8832],["\\npreceq",8928],["\\precnsim",8936],["\\precnapprox",10937],["\\nsim",8769],["\\nshortmid",57350],["\\nmid",8740],["\\nvdash",8876],["\\nvDash",8877],["\\ngtr",8815],["\\ngeqslant",57359],["\\ngeqq",57358],["\\gneq",10888],["\\gneqq",8809],["\\gvertneqq",57357],["\\gnsim",8935],["\\gnapprox",10890],["\\nsucc",8833],["\\nsucceq",8929],["\\succnsim",8937],["\\succnapprox",10938],["\\ncong",8774],["\\nshortparallel",57351],["\\nparallel",8742],["\\nVDash",8879],["\\nsupseteqq",57368],["\\supsetneq",8843],["\\varsupsetneq",57371],["\\supsetneqq",10956],["\\varsupsetneqq",57369],["\\nVdash",8878],["\\precneqq",10933],["\\succneqq",10934],["\\nsubseteqq",57366],["\\leqslant",10877],["\\geqslant",10878],["\\gtrsim",8819],["\\approxeq",8778],["\\thickapprox",8776],["\\lessapprox",10885],["\\gtrapprox",10886],["\\precapprox",10935],["\\succapprox",10936],["\\thicksim",8764],["\\succsim",8831],["\\precsim",8830],["\\backsim",8765],["\\eqsim",8770],["\\backsimeq",8909],["\\lesssim",8818],["\\nleq",8816],["\\ngeq",8817],["\\smallsmile",8995],["\\smallfrown",8994],["\\leqq",8806],["\\eqslantless",10901],["\\lll",8920],["\\lessgtr",8822],["\\lesseqgtr",8922],["\\lesseqqgtr",10891],["\\risingdotseq",8787],["\\fallingdotseq",8786],["\\subseteqq",10949],["\\Subset",8912],["\\sqsubset",8847],["\\preccurlyeq",8828],["\\curlyeqprec",8926],["\\vDash",8872],["\\Vvdash",8874],["\\bumpeq",8783],["\\Bumpeq",8782],["\\geqq",8807],["\\eqslantgtr",10902],["\\ggg",8921],["\\gtrless",8823],["\\gtreqless",8923],["\\gtreqqless",10892],["\\supseteqq",10950],["\\Supset",8913],["\\sqsupset",8848],["\\succcurlyeq",8829],["\\curlyeqsucc",8927],["\\Vdash",8873],["\\shortmid",8739],["\\between",8812],["\\pitchfork",8916],["\\varpropto",8733],["\\backepsilon",8717],["\\llless",8920],["\\gggtr",8921],["\\doteqdot",8785],["\\Doteq",8785],["\\eqcirc",8790],["\\circeq",8791],["\\therefore",8756],["\\because",8757]],"mrel","ams"),Te([["+",43],["-",8722],["\u2212",8722],["\\pm",177],["\\mp",8723],["*",8727],["\\times",215],["\\div",247],["\\divides",8739],["\\cdot",8901],["\\cap",8745],["\\cup",8746],["\\setminus",8726],["\\land",8743],["\\wedge",8743],["\\lor",8744],["\\vee",8744],["\\circ",8728],["\\bigcirc",9711],["\\bullet",8729],["\\oplus",8853],["\\ominus",8854],["\\otimes",8855],["\\odot",8857],["\\oslash",8856],["\\bigtriangleup",9651],["\\bigtriangledown",9661],["\\triangleleft",9667],["\\triangleright",9657],["\\And",38],["\\dagger",8224],["\\dag",8224],["\\ddag",8225],["\\ddagger",8225],["\\ast",8727],["\\star",8902],["\\bigstar",9733],["\\diamond",8900]],"mbin"),Te([["\\lhd",8882],["\\rhd",8883],["\\lessdot",8918],["\\gtrdot",8919],["\\ltimes",8905],["\\rtimes",8906],["\\leftthreetimes",8907],["\\rightthreetimes",8908],["\\intercal",8890],["\\dotplus",8724],["\\doublebarwedge",10846],["\\divideontimes",8903],["\\centerdot",8901],["\\smallsetminus",8726],["\\barwedge",8892],["\\veebar",8891],["\\nor",8891],["\\curlywedge",8911],["\\curlyvee",8910],["\\boxminus",8863],["\\boxplus",8862],["\\boxtimes",8864],["\\boxdot",8865],["\\circleddash",8861],["\\circledast",8859],["\\circledcirc",8858],["\\unlhd",8884],["\\unrhd",8885]],"mbin","ams"),Te([["\\surd",8730],["\\infty",8734],["\\prime",8242],["\\doubleprime",8243],["\\angle",8736],["`",8216],["\\$",36],["\\%",37],["\\_",95],["\\alpha",945],["\\beta",946],["\\gamma",947],["\\delta",948],["\\epsilon",1013],["\\varepsilon",949],["\\zeta",950],["\\eta",951],["\\theta",952],["\\vartheta",977],["\\iota",953],["\\kappa",954],["\\varkappa",1008,"mord","ams"],["\\lambda",955],["\\mu",956],["\\nu",957],["\\xi",958],["\\omicron",111],["\\pi",960],["\\varpi",982],["\\rho",961],["\\varrho",1009],["\\sigma",963],["\\varsigma",962],["\\tau",964],["\\phi",981],["\\varphi",966],["\\upsilon",965],["\\chi",967],["\\psi",968],["\\omega",969],["\\Gamma",915],["\\Delta",916],["\\Theta",920],["\\Lambda",923],["\\Xi",926],["\\Pi",928],["\\Sigma",931],["\\Upsilon",933],["\\Phi",934],["\\Psi",936],["\\Omega",937],["\\digamma",989,"mord","ams"],["\\emptyset",8709]]),Te([["=",61],["<",60],["\\lt",60],[">",62],["\\gt",62],["\\le",8804],["\\leq",8804],["\\ge",8805],["\\geq",8805],["\\ll",8810],["\\gg",8811],["\\coloneq",8788],["\\coloneqq",8788],["\\colonequals",8788],["\\measeq",8797],["\\eqdef",8798],["\\questeq",8799],[":",58],["\\cong",8773],["\\equiv",8801],["\\prec",8826],["\\preceq",10927],["\\succ",8827],["\\succeq",10928],["\\perp",8869],["\\propto",8733],["\\Colon",8759],["\\smile",8995],["\\frown",8994],["\\sim",8764],["\\doteq",8784],["\\bowtie",8904],["\\Join",8904],["\\asymp",8781],["\\sqsubseteq",8849],["\\sqsupseteq",8850],["\\approx",8776],["\\~",126],["\\leftrightarrow",8596],["\\Leftrightarrow",8660],["\\models",8872],["\\vdash",8866],["\\dashv",8867],["\\roundimplies",10608],["\\in",8712],["\\notin",8713],["\\ni",8715],["\\owns",8715],["\\subset",8834],["\\supset",8835],["\\subseteq",8838],["\\supseteq",8839],["\\differencedelta",8710],["\\mvert",8739],["\\parallel",8741],["\\simeq",8771]],"mrel"),Te([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),Te([["\\wp",8472],["\\aleph",8501]]),Te([["\\blacktriangle",9650],["\\hslash",8463],["\\Finv",8498],["\\Game",8513],["\\eth",240],["\\mho",8487],["\\Bbbk",107],["\\yen",165],["\\square",9633],["\\Box",9633],["\\blacksquare",9632],["\\circledS",9416],["\\circledR",174],["\\triangledown",9661],["\\blacktriangledown",9660],["\\checkmark",10003],["\\diagup",9585],["\\measuredangle",8737],["\\sphericalangle",8738],["\\backprime",8245],["\\backdoubleprime",8246],["\\Diamond",9674],["\\lozenge",9674],["\\blacklozenge",10731],["\\varnothing",8709],["\\complement",8705],["\\maltese",10016],["\\beth",8502],["\\daleth",8504],["\\gimel",8503]],"mord","ams"),Te([["\\ ",160],["~",160]],"space"),M(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:e=>new va(e)}),M("space","",{createAtom:e=>new va(e)}),Te([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),Te([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),Te([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var ch="<mo>&#x2061;</mo>",go="<mo>&#8290;</mo>";function bo(e){return e.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ce(e,t){return!e||!t.generateID?"":` extid="${e}"`}function B1(e,t,r){var i,n,a,s,o,l,c,u,d,h,f;let m=!1;t=t!=null?t:e.atoms.length;let y="",A="",v=e.atoms[e.index];const S=(n=(i=v.style)==null?void 0:i.variant)!=null?n:"",L=(s=(a=v.style)==null?void 0:a.variantStyle)!=null?s:"";let C="";if(S||L){const I=me(v.value,(o=v.style)==null?void 0:o.variant,(l=v.style)==null?void 0:l.variantStyle);if(I!==v.value)return e.index+=1,y=`<mi${ce(v.id,r)}>${I}</mi>`,ri(y,e,r)||(e.mathML+=y,e.lastType="mi"),!0;C=(c={upnormal:"normal",boldnormal:"bold",italicmain:"italic",bolditalicmain:"bold-italic","updouble-struck":"double-struck","double-struck":"double-struck",boldfraktur:"bold-fraktur",calligraphic:"script",upcalligraphic:"script",script:"script",boldscript:"bold-script",boldcalligraphic:"bold-script",fraktur:"fraktur","upsans-serif":"sans-serif","boldsans-serif":"bold-sans-serif","italicsans-serif":"sans-serif-italic","bolditalicsans-serif":"sans-serif-bold-italic",monospace:"monospace"}[L+S])!=null?c:"",C=` mathvariant="${C}"`}const z={"\\exponentialE":"&#x02147;","\\imaginaryI":"&#x2148;","\\differentialD":"&#x2146;","\\capitalDifferentialD":"&#x2145;","\\alpha":"&#x03b1;","\\pi":"&#x03c0;","\\infty":"&#x221e;","\\forall":"&#x2200;","\\nexists":"&#x2204;","\\exists":"&#x2203;","\\hbar":"\u210F","\\cdotp":"\u22C5","\\ldots":"\u2026","\\cdots":"\u22EF","\\ddots":"\u22F1","\\vdots":"\u22EE","\\ldotp":"."};if(v.command==="!")return e.index+=1,y="<mo>!</mo>",ri(y,e,r)||(e.mathML+=y,e.lastType="mo"),!0;if(z[v.command]){e.index+=1;let I=`<mi${ce(v.id,r)}${C}>${z[v.command]}</mi>`;return(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mtext"||e.lastType==="fence")&&(I=go+I),ri(I,e,r)||(e.mathML+=I,e.lastType="mi"),!0}if(v.command==="\\operatorname")A=Pn(v.body),e.index+=1;else if(S||L)for(;e.index<t&&(v.type==="mord"||v.type==="macro")&&!v.isDigit()&&S===((d=(u=v.style)==null?void 0:u.variant)!=null?d:"")&&L===((f=(h=v.style)==null?void 0:h.variantStyle)!=null?f:"");)A+=Pn([v]),e.index+=1,v=e.atoms[e.index];else(v.type==="mord"||v.type==="macro")&&!v.isDigit()&&(A+=Pn([v]),e.index+=1);if(A.length>0){m=!0,y=`<mi${C}>${A}</mi>`;const I=e.lastType;y.endsWith(">f</mi>")||y.endsWith(">g</mi>")?(y+=ch,e.lastType="applyfunction"):e.lastType=/^<mo>(.*)<\/mo>$/.test(y)?"mo":"mi",ri(y,e,r)||((I==="mi"||I==="mn"||I==="mtext"||I==="fence")&&(y=go+y),e.mathML+=y)}return m}function D1(e){return e.index<e.atoms.length&&e.atoms[e.index].superscript&&e.atoms[e.index].type==="subsup"}function T1(e){let t=-1,r=e.index,i=!1,n=!1;for(;r<e.atoms.length&&!i&&!n;){const a=e.atoms[r];i=!a.isDigit(),n=!i&&a.superscript!==void 0,r++}return n&&(t=r-1),t}function ri(e,t,r){var i;let n=t.atoms[t.index-1];if(!n)return!1;if(!n.superscript&&!n.subscript)if(((i=t.atoms[t.index])==null?void 0:i.type)==="subsup")n=t.atoms[t.index],t.index+=1;else return!1;const a=t.lastType;t.lastType="";const s=te(n.superscript,r);t.lastType="";const o=te(n.subscript,r);if(t.lastType=a,!s&&!o)return!1;let l="";return s&&o?l=`<msubsup>${e}${o}${s}</msubsup>`:s?l=`<msup>${e}${s}</msup>`:o&&(l=`<msub>${e}${o}</msub>`),t.mathML+=l,t.lastType="",!0}function F1(e,t,r){t=t!=null?t:e.atoms.length;const i=e.index;let n="";for(;e.index<t&&e.atoms[e.index].mode==="text";)n+=e.atoms[e.index].value?e.atoms[e.index].value:" ",e.index+=1;return n.length>0?(e.mathML+=`<mtext ${ce(e.atoms[i].id,r)}>${n}</mtext>`,e.lastType="mtext",!0):!1}function P1(e,t,r){t=t!=null?t:e.atoms.length;const i=e.index;let n="",a=T1(e);for(a>=0&&a<t&&(t=a);e.index<t&&e.atoms[e.index].isDigit();)n+=e.atoms[e.index].asDigit(),e.index+=1;return n.length<=0?!1:(n="<mn"+ce(e.atoms[i].id,r)+">"+n+"</mn>",a<0&&D1(e)&&(a=e.index,e.index+=1),ri(n,e,r)||(e.mathML+=n,e.lastType="mn"),!0)}function z1(e,t,r){let i=!1;t=t!=null?t:e.atoms.length;let n="",a="";if(e.index<t&&e.atoms[e.index].type==="mopen"){let s=!1,o=0;const l=e.index;let c=-1,u=l+1;for(;u<t&&!s;)e.atoms[u].type==="mopen"?o+=1:e.atoms[u].type==="mclose"&&(o-=1),o===-1&&(s=!0,c=u),u+=1;s&&(n="<mrow>",n+=sn(e.atoms[l],r),n+=te(e.atoms,r,l+1,c),n+=sn(e.atoms[c],r),n+="</mrow>",e.index=c+1,(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mfrac"||e.lastType==="fence")&&(e.mathML+=go),ri(n,e,r)&&(i=!0,e.lastType="",n=""),a="fence")}return n.length>0&&(i=!0,e.mathML+=n,e.lastType=a),i}function K1(e,t,r){let i=!1;t=t!=null?t:e.atoms.length;let n="",a="";const s=e.atoms[e.index];if(!s)return!1;const o={"\\ne":"&ne;","\\neq":"&neq;","\\pm":"&#177;","\\times":"&#215;","\\colon":":","\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"};if(o[s.command]){e.index+=1;const l=`<mo${ce(s.id,r)}>${o[s.command]}</mo>`;return ri(l,e,r)||(e.mathML+=l,e.lastType="mo"),!0}if(e.index<t&&(s.type==="mbin"||s.type==="mrel"))n+=ql(e.atoms[e.index],r),e.index+=1,a="mo";else if(e.index<t&&(s.type==="mop"||s.type==="operator"||s.type==="extensible-symbol")){if(s.subsupPlacement==="over-under"&&(s.superscript||s.subscript)){const l=sn(s,r);return s.superscript&&s.subscript?(n+="<munderover>"+l,n+=te(s.subscript,r),n+=te(s.superscript,r),n+="</munderover>"):s.superscript?(n+="<mover>"+l,n+=te(s.superscript,r),n+="</mover>"):s.subscript&&(n+="<munder>"+l,n+=te(s.subscript,r),n+="</munder>"),e.mathML+=n,e.lastType="mo",e.index+=1,!0}{const l=e.atoms[e.index],c=l.value==="\\operatorname",u=c?'<mi class="MathML-Unit"'+ce(l.id,r)+">"+Pn(l.value)+"</mi>":sn(l,r);n+=u,!c&&!/^<mo>(.*)<\/mo>$/.test(u)?(n+=ch,a="applyfunction"):a=c?"mi":"mo"}(e.lastType==="mi"||e.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(n)&&(n=go+n),e.index+=1}return n.length>0&&(i=!0,ri(n,e,r)||(e.mathML+=n,e.lastType=a)),i}function te(e,t,r,i){t!=null||(t={});const n={atoms:[],index:r!=null?r:0,mathML:"",lastType:""};if(typeof e=="number"||typeof e=="boolean")n.mathML=e.toString();else if(typeof e=="string")n.mathML=e;else if(e instanceof w)n.mathML=ql(e,t);else if(Array.isArray(e)){n.atoms=e;let a=0;for(i=i||(e?e.length:0);n.index<i;)if(F1(n,i,t)||P1(n,i,t)||B1(n,i,t)||K1(n,i,t)||z1(n,i,t))a+=1;else if(n.index<i){let s=ql(n.atoms[n.index],t);n.lastType==="mn"&&s.length>0&&n.atoms[n.index].type==="genfrac"&&(s="<mo>&#x2064;</mo>"+s),n.atoms[n.index].type==="genfrac"?n.lastType="mfrac":n.lastType="",n.index+=1,ri(s,n,t)?a+=1:s.length>0&&(n.mathML+=s,a+=1)}a>1&&(n.mathML="<mrow>"+n.mathML+"</mrow>")}return n.mathML}function sn(e,t){let r="";const i=Pn(e.value);return i&&(r="<mo"+ce(e.id,t)+">"+i+"</mo>"),r}function Pn(e){if(!e)return"";if(typeof e=="string")return bo(e);if(!Array.isArray(e)&&typeof e.body=="string")return bo(e.body);let t="";for(const r of e)typeof r.value=="string"&&(t+=r.value);return bo(t)}function ql(e,t){var r,i,n,a,s,o,l,c,u,d,h,f,m,y,A,v,S,L,C,z,I,O;if(e.mode==="text")return`<mi${ce(e.id,t)}>${e.value}</mi>`;const U={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",longleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",longrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",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",xrightleftharpoons:"\u21CC",longrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xleftrightarrows:"\u21C4",xRightleftharpoons:"\u21CC",longRightleftharpoons:"\u21CC",xLeftrightharpoons:"\u21CB",longLeftrightharpoons:"\u21CB"},oe={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let T="",$t="",Ir,cr,Xe,Gt,Dt,ue;const{command:ze}=e;if(e.command==="\\error")return`<merror${ce(e.id,t)}>${te(e.body,t)}</merror>`;const $e={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},Rr={"\\vec":"&#x20d7;","\\acute":"&#x00b4;","\\grave":"&#x0060;","\\dot":"&#x02d9;","\\ddot":"&#x00a8;","\\tilde":"&#x007e;","\\bar":"&#x00af;","\\breve":"&#x02d8;","\\check":"&#x02c7;","\\hat":"&#x005e;"};switch(e.type){case"first":break;case"group":case"root":T=te(e.body,t);break;case"array":if((e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(T+="<mrow>",e.leftDelim&&e.leftDelim!=="."&&(T+="<mo>"+($e[e.leftDelim]||e.leftDelim)+"</mo>")),T+="<mtable",e.colFormat){for(T+=' columnalign="',Xe=0;Xe<e.colFormat.length;Xe++)e.colFormat[Xe].align&&(T+={l:"left",c:"center",r:"right"}[e.colFormat[Xe].align]+" ");T+='"'}for(T+=">",cr=0;cr<e.array.length;cr++){for(T+="<mtr>",Ir=0;Ir<e.array[cr].length;Ir++)T+="<mtd>"+te(e.array[cr][Ir],t)+"</mtd>";T+="</mtr>"}T+="</mtable>",(e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(e.rightDelim&&e.rightDelim!=="."&&(T+="<mo>"+($e[e.leftDelim]||e.rightDelim)+"</mo>"),T+="</mrow>");break;case"genfrac":(e.leftDelim||e.rightDelim)&&(T+="<mrow>"),e.leftDelim&&e.leftDelim!=="."&&(T+="<mo"+ce(e.id,t)+">"+($e[e.leftDelim]||e.leftDelim)+"</mo>"),e.hasBarLine?(T+="<mfrac>",T+=te(e.above,t)||"<mi>&nbsp;</mi>",T+=te(e.below,t)||"<mi>&nbsp;</mi>",T+="</mfrac>"):(T+="<mtable"+ce(e.id,t)+">",T+="<mtr>"+te(e.above,t)+"</mtr>",T+="<mtr>"+te(e.below,t)+"</mtr>",T+="</mtable>"),e.rightDelim&&e.rightDelim!=="."&&(T+="<mo"+ce(e.id,t)+">"+($e[e.rightDelim]||e.rightDelim)+"</mo>"),(e.leftDelim||e.rightDelim)&&(T+="</mrow>");break;case"surd":e.hasEmptyBranch("above")?(T+="<msqrt"+ce(e.id,t)+">",T+=te(e.body,t),T+="</msqrt>"):(T+="<mroot"+ce(e.id,t)+">",T+=te(e.body,t),T+=te(e.above,t),T+="</mroot>");break;case"leftright":const qr=e,Vr=qr.leftDelim;T="<mrow>",Vr&&Vr!=="."&&(T+=`<mo${ce(e.id,t)}>${(r=$e[Vr])!=null?r:Vr}</mo>`),e.body&&(T+=te(e.body,t));const Hr=qr.matchingRightDelim();Hr&&Hr!=="."&&(T+=`<mo${ce(e.id,t)}>${(i=$e[Hr])!=null?i:Hr}</mo>`),T+="</mrow>";break;case"sizeddelim":case"delim":T+=`<mo${ce(e.id,t)}>${$e[e.value]||e.value}</mo>`;break;case"accent":T+='<mover accent="true"'+ce(e.id,t)+">",T+=te(e.body,t),T+="<mo>"+(Rr[ze]||e.accent)+"</mo>",T+="</mover>";break;case"line":case"overlap":break;case"overunder":Dt=e.above,Gt=e.below,(e.svgAbove||Dt)&&(e.svgBelow||Gt)?ue=e.body:Dt&&Dt.length>0?(ue=e.body,(a=(n=e.body)==null?void 0:n[0])!=null&&a.below?(Gt=e.body[0].below,ue=e.body[0].body):((o=(s=e.body)==null?void 0:s[0])==null?void 0:o.type)==="first"&&((c=(l=e.body)==null?void 0:l[1])!=null&&c.below)&&(Gt=e.body[1].below,ue=e.body[1].body)):Gt&&Gt.length>0&&(ue=e.body,(d=(u=e.body)==null?void 0:u[0])!=null&&d.above?(Dt=e.body[0].above,ue=e.body[0].body):((f=(h=e.body)==null?void 0:h[0])==null?void 0:f.type)==="first"&&((y=(m=e.body)==null?void 0:m[1])!=null&&y.above)&&(Dt=e.body[1].overscript,ue=e.body[1].body)),(e.svgAbove||Dt)&&(e.svgBelow||Gt)?(T+=`<munderover ${ce(e.id,t)}>`,T+=(A=U[e.svgBody])!=null?A:te(ue,t),T+=(v=U[e.svgBelow])!=null?v:te(Gt,t),T+=(S=U[e.svgAbove])!=null?S:te(Dt,t),T+="</munderover>"):e.svgAbove||Dt?(T+=`<mover ${ce(e.id,t)}>`+((L=U[e.svgBody])!=null?L:te(ue,t)),T+=(C=U[e.svgAbove])!=null?C:te(Dt,t),T+="</mover>"):(e.svgBelow||Gt)&&(T+=`<munder ${ce(e.id,t)}>`+((z=U[e.svgBody])!=null?z:te(ue,t)),T+=(I=U[e.svgBelow])!=null?I:te(Gt,t),T+="</munder>");break;case"placeholder":T+="?";break;case"mord":{T=typeof e.value=="string"?e.value:ze,ze==="\\char"?T="&#x"+("000000"+e.args[0].number.toString(16)).slice(-4)+";":T.length>0&&T.startsWith("\\")&&(typeof e.value=="string"&&e.value.charCodeAt(0)>255?T="&#x"+("000000"+e.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof e.value=="string"?T=e.value.charAt(0):(console.error("Did not expect this"),T=""));const kr=/\d/.test(T)?"mn":"mi";T=`<${kr}${ce(e.id,t)}>${bo(T)}</${kr}>`;break}case"mbin":case"mrel":case"minner":T=sn(e,t);break;case"mpunct":T='<mo separator="true"'+ce(e.id,t)+">"+ze+"</mo>";break;case"mop":case"operator":case"extensible-symbol":e.body!=="\u200B"&&(T="<mo"+ce(e.id,t)+">",T+=ze==="\\operatorname"?e.body:ze||e.body,T+="</mo>");break;case"box":T='<menclose notation="box"',e.backgroundcolor&&(T+=' mathbackground="'+e.backgroundcolor+'"'),T+=ce(e.id,t)+">"+te(e.body,t)+"</menclose>";break;case"spacing":T+='<mspace width="'+((O=oe[ze])!=null?O:0)+'em"/>';break;case"enclose":T='<menclose notation="';for(const kr in e.notation)Object.prototype.hasOwnProperty.call(e.notation,kr)&&e.notation[kr]&&(T+=$t+kr,$t=" ");T+=ce(e.id,t)+'">'+te(e.body,t)+"</menclose>";break;case"prompt":T='<menclose notation="roundexbox""">'+te(e.body,t)+"</menclose>";break;case"space":T+="&nbsp;";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":T+=sn(e,t);break;case"mclose":T+=sn(e,t);break;case"macro":{const kr=e.command+Pn(e.macroArgs);kr&&(T+=`<mo ${ce(e.id,t)}>${kr}</mo>`)}break;case"latexgroup":T+=te(e.body,t);break;case"latex":T+="<mtext"+ce(e.id,t)+">"+e.value+"</mtext>";break;case"tooltip":T+=te(e.body,t);break;case"text":T+=`<mtext ${ce(e.id,t)}x>${e.value}</mtext>`;break;default:if(e.command==="\\displaystyle")return`<mrow ${ce(e.id,t)} displaystyle="true">${te(e.body,t)}</mrow>`;if(e.command==="\\textstyle")return`<mrow ${ce(e.id,t)} displaystyle="false">${te(e.body,t)}</mrow>`;console.info("Unexpected element in conversion to MathML:",e)}return T}var zn={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"imaginary eye ","\\imaginaryJ":"imaginary jay ","\\sum":"Summation ","\\prod":"Product ","+":"plus ","-":"minus ",";":'<break time="150ms"/> semi-colon <break time="150ms"/>',",":'<break time="150ms"/> comma <break time="150ms"/>',"|":'<break time="150ms"/>Vertical bar<break time="150ms"/>',"(":'<break time="150ms"/>Open paren. <break time="150ms"/>',")":'<break time="150ms"/> Close paren. <break time="150ms"/>',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\pm":"plus or minus","\\mp":"minus or plus","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","\\ne":"is not equal to ","\\neq":"is not equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","\u200B":"","\u2212":"minus ",":":'<break time="150ms"/> such that <break time="200ms"/> ',"\\colon":'<break time="150ms"/> such that <break time="200ms"/> ',"\\hbar":"etch bar ","\\iff":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\Longleftrightarrow":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set <break time="150ms"/><say-as interpret-as="character">n</say-as>',"\\C":'the set <break time="150ms"/><say-as interpret-as="character">c</say-as>',"\\Z":'the set <break time="150ms"/><say-as interpret-as="character">z</say-as>',"\\Q":'the set <break time="150ms"/><say-as interpret-as="character">q</say-as>',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdot":"times ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lparen":'<break time="150ms"/>open paren<break time="150ms"/>',"\\rparen":'<break time="150ms"/>close paren<break time="150ms"/>',"\\lbrace":'<break time="150ms"/>open brace<break time="150ms"/>',"\\{":'<break time="150ms"/>open brace<break time="150ms"/>',"\\rbrace":'<break time="150ms"/>close brace<break time="150ms"/>',"\\}":'<break time="150ms"/>close brace<break time="150ms"/>',"\\langle":'<break time="150ms"/>left angle bracket<break time="150ms"/>',"\\rangle":'<break time="150ms"/>right angle bracket<break time="150ms"/>',"\\lfloor":'<break time="150ms"/>open floor<break time="150ms"/>',"\\rfloor":'<break time="150ms"/>close floor<break time="150ms"/>',"\\lceil":'<break time="150ms"/>open ceiling<break time="150ms"/>',"\\rceil":'<break time="150ms"/>close ceiling<break time="150ms"/>',"\\vert":'<break time="150ms"/>vertical bar<break time="150ms"/>',"\\mvert":'<break time="150ms"/>divides<break time="150ms"/>',"\\lvert":'<break time="150ms"/>left vertical bar<break time="150ms"/>',"\\rvert":'<break time="150ms"/>right vertical bar<break time="150ms"/>',"\\lbrack":'<break time="150ms"/> open square bracket <break time="150ms"/>',"\\rbrack":'<break time="150ms"/> close square bracket <break time="150ms"/>',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"},Vl={array:"array",matrix:"matrix",pmatrix:"parenthesis matrix",bmatrix:"square brackets matrix",Bmatrix:"braces matrix",vmatrix:"bars matrix",Vmatrix:"double bars matrix","matrix*":"matrix",smallmatrix:"small matrix"};function N1(e){let t="";return e.startsWith("\\")&&(t=" "+e.replace("\\","")+" "),t}function Fa(e){let t=0;if(le(e))for(const r of e)r.type!=="first"&&(t+=1);return t===1}function O1(e){if(le(e)){for(const t of e)if(t.type!=="first"&&t.id)return t.id.toString()}return""}function uh(e){let t="";if(le(e))for(const r of e)r.type!=="first"&&typeof r.value=="string"&&(t+=r.value);return t}function I1(e){return e?e.map(t=>t.value).join(""):""}function W(e,t){var r,i,n,a,s;function o(u){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(u)?` <say-as interpret-as="character">${u}</say-as>`:/[A-Z]/.test(u)?`capital <say-as interpret-as="character">${u.toLowerCase()}</say-as>`:u:/[a-z]/.test(u)?" '"+u.toUpperCase()+"'":/[A-Z]/.test(u)?" 'capital "+u.toUpperCase()+"'":u}function l(u){return"<emphasis>"+u+"</emphasis>"}if(!t)return"";let c="";if(le(t)){let u=!1,d=!1;for(let h=0;h<t.length;h++)t[h].type!=="first"&&(t[h].mode!=="text"&&(d=!1),h<t.length-2&&t[h].type==="mopen"&&t[h+2].type==="mclose"&&t[h+1].type==="mord"?(c+=" of ",c+=l(W(e,t[h+1])),h+=2):t[h].mode==="text"?d?c+=(r=t[h].value)!=null?r:" ":(d=!0,c+=W("text",t[h])):t[h].isDigit()?u?c+=t[h].asDigit():(u=!0,c+=W(e,t[h])):(u=!1,c+=W(e,t[h])))}else if(t.mode==="text")t.id&&e==="math"&&(c+='<mark name="'+t.id.toString()+'"/>'),c+=t.value;else{t.id&&e==="math"&&(c+='<mark name="'+t.id.toString()+'"/>');let u="",d="",h="",f=!1;const{command:m}=t;switch(m){case"\\vec":return"vector "+W(e,t.body);case"\\acute":return W(e,t.body)+" acute";case"\\grave":return W(e,t.body)+" grave";case"\\dot":return"dot over"+W(e,t.body);case"\\ddot":return"double dot over"+W(e,t.body);case"\\mathring":return"ring over"+W(e,t.body);case"\\tilde":case"\\widetilde":return"tilde over"+W(e,t.body);case"\\bar":return W(e,t.body)+" bar";case"\\breve":return W(e,t.body)+" breve";case"\\check":case"\\widecheck":return"check over "+W(e,t.body);case"\\hat":case"\\widehat":return"hat over"+W(e,t.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+W(e,t.body);case"\\underarc":case"\\underparen":return"arc under "+W(e,t.body)}switch(t.type){case"prompt":const y=t.body.length>1?'start input . <break time="500ms"/> '+W(e,t.body)+'. <break time="500ms"/> end input':"blank";c+=' <break time="300ms"/> '+y+'. <break time="700ms"/>'+((i=t.correctness)!=null?i:"")+' . <break time="700ms"/> ';break;case"array":const A=t.array,v=t.environmentName;if(Object.keys(Vl).includes(v)){c+=` begin ${Vl[v]} `;for(let C=0;C<A.length;C++){C>0&&(c+=","),c+=` row ${C+1} `;for(let z=0;z<A[C].length;z++)z>0&&(c+=","),c+=` column ${z+1}: `,c+=W("math",A[C][z])}c+=` end ${Vl[v]} `}break;case"group":m==="\\ne"?c+=" not equal ":(m==="\\not"&&(c+=" not "),c+=W("math",t.body));break;case"root":c+=W("math",t.body);break;case"genfrac":if(u=W("math",t.above),d=W("math",t.below),Fa(t.above)&&Fa(t.below)){const z={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[uh(t.above)+"/"+uh(t.below)];z?c=z:c+=u+" over "+d}else c+=' the fraction <break time="150ms"/>'+u+' over <break time="150ms"/>'+d+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(h=W("math",t.body),t.hasEmptyBranch("above"))c+=Fa(t.body)?" the square root of "+h+" , ":' the square root of <break time="200ms"/>'+h+'. <break time="200ms"/> End square root';else{let C=W("math",t.above);C=C.trim();const z=C.replace(/<mark([^/]*)\/>/g,"");z==="3"?c+=' the cube root of <break time="200ms"/>'+h+'. <break time="200ms"/> End cube root':z==="n"?c+=' the nth root of <break time="200ms"/>'+h+'. <break time="200ms"/> End root':c+=' the root with index: <break time="200ms"/>'+C+', of <break time="200ms"/>'+h+'. <break time="200ms"/> End root'}break;case"leftright":{const C=t;c+=(n=C.leftDelim?zn[C.leftDelim]:void 0)!=null?n:C.leftDelim,c+=W("math",t.body),c+=(a=C.rightDelim?zn[C.rightDelim]:void 0)!=null?a:C.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const S=m.replace(/^\\/g,""),L=Vt()[S];L&&(L!=null&&L.expand?c+=W("math",t.body):c+=`${S} `);break;case"placeholder":c+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(m==="\\mathbin"||m==="\\mathrel"||m==="\\mathopen"||m==="\\mathclose"||m==="\\mathpunct"||m==="\\mathord"||m==="\\mathinner"){c=W(e,t.body);break}let C=t.isDigit()?t.asDigit():t.value,z=t.command;if((t.type==="delim"||t.type==="sizeddelim")&&(z=t.value,C=z),e==="text")c+=C;else{if(t.type==="mbin"&&(c+='<break time="150ms"/>'),C){const I=zn[C]||(z?zn[z.trim()]:"");if(I)c+=" "+I;else{const O=z?N1(z.trim()):"";c+=O||o(C)}}else c+=W("math",t.body);t.type==="mbin"&&(c+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(t.value!=="\u200B"){const C=t.command;if(C==="\\sum")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let z=W("math",t.superscript);z=z.trim();let I=W("math",t.subscript);I=I.trim(),c+=' the summation from <break time="200ms"/>'+I+'<break time="200ms"/> to <break time="200ms"/>'+z+'<break time="200ms"/> of <break time="150ms"/>',f=!0}else if(t.hasEmptyBranch("subscript"))c+=" the summation of";else{let z=W("math",t.subscript);z=z.trim(),c+=' the summation from <break time="200ms"/>'+z+'<break time="200ms"/> of <break time="150ms"/>',f=!0}else if(C==="\\prod")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let z=W("math",t.superscript);z=z.trim();let I=W("math",t.subscript);I=I.trim(),c+=' the product from <break time="200ms"/>'+I+'<break time="200ms"/> to <break time="200ms"/>'+z+'<break time="200ms"/> of <break time="150ms"/>',f=!0}else if(t.hasEmptyBranch("subscript"))c+=" the product of ";else{let z=W("math",t.subscript);z=z.trim(),c+=' the product from <break time="200ms"/>'+z+'<break time="200ms"/> of <break time="150ms"/>',f=!0}else if(C==="\\int")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let z=W("math",t.superscript);z=z.trim();let I=W("math",t.subscript);I=I.trim(),c+=' the integral from <break time="200ms"/>'+l(I)+'<break time="200ms"/> to <break time="200ms"/>'+l(z)+' <break time="200ms"/> of ',f=!0}else c+=' the integral of <break time="200ms"/> ';else if(typeof t.value=="string"){const z=(s=zn[t.value])!=null?s:t.command?zn[t.command]:void 0;c+=z||" "+t.value}else t.command&&(t.command==="\\mathop"?c+=W("math",t.body):t.command==="\\operatorname"?c+=I1(t.body):c+=t.command.startsWith("\\")?" "+t.command.slice(1):" "+t.command)}break;case"enclose":h=W("math",t.body),c+=" crossed out "+h+". End crossed out.";break;case"space":case"spacing":break}if(!f&&!t.hasEmptyBranch("superscript")){let y=W(e,t.superscript);y=y.trim();const A=y.replace(/<[^>]*>/g,"");if(Fa(t.superscript)){if(e==="math"){const v=O1(t.superscript);v&&(c+='<mark name="'+v+'"/>')}A==="\u2032"?c+=" prime ":A==="2"?c+=" squared ":A==="3"?c+=" cubed ":Number.isNaN(Number.parseInt(A))?c+=" to the "+y+"; ":c+=' to the <say-as interpret-as="ordinal">'+A+"</say-as> power; "}else Number.isNaN(Number.parseInt(A))?c+=" raised to the "+y+"; ":c+=' raised to the <say-as interpret-as="ordinal">'+A+"</say-as> power; "}if(!f&&!t.hasEmptyBranch("subscript")){let y=W("math",t.subscript);y=y.trim(),c+=Fa(t.subscript)?" sub "+y:" subscript "+y+". End subscript. "}}return c}function Kn(e){var t,r;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const n=te(e);if(n){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(t=window.MathfieldElement.textToSpeechRulesOptions)!=null?t:{},window.MathfieldElement.textToSpeechRulesOptions=g(p({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=g(p({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=g(p({},window.MathfieldElement.textToSpeechRulesOptions),{rate:window.MathfieldElement.speechEngineRate}));const a=(r=window.SRE)!=null?r:window.sre.System.getInstance();window.MathfieldElement.textToSpeechRulesOptions&&a.setupEngine(window.MathfieldElement.textToSpeechRulesOptions);let s="";try{s=a.toSpeech(n)}catch(o){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",o)}return s}return""}let i=W("math",e);if(window.MathfieldElement.textToSpeechMarkup==="ssml"){let n="";window.MathfieldElement.speechEngineRate&&(n='<prosody rate="'+window.MathfieldElement.speechEngineRate+'">'),i='<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"><amazon:auto-breaths>'+n+"<p><s>"+i+"</s></p>"+(n?"</prosody>":"")+"</amazon:auto-breaths></speak>"}else window.MathfieldElement.textToSpeechMarkup==="mac"&&ut()==="macos"?i=i.replace(/<mark([^/]*)\/>/g,"").replace(/<emphasis>/g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(/<break time="(\d*)ms"\/>/g,"[[slc $1]]").replace(/<say-as[^>]*>/g,"").replace(/<\/say-as>/g,""):i=i.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return i}var Pa={"\\ne":"\u2260","\\neq":"\u2260","\u2212":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega","\\exponentialE":"e","\\imaginaryI":"i","\\imaginaryJ":"j","\\!":" ","\\,":" ","\\:":" ","\\>":" ","\\;":" ","\\enskip":" ","\\enspace":" ","\\qquad":" ","\\quad":" ","\\infty":"oo"},za={"\\pm":"+-","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrack":"[","\\rbrack":"]","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"(:","\\rangle":":)","\\sum":" sum ","\\prod":" prod ","\\bigcap":" nnn ","\\bigcup":" uuu ","\\int":" int ","\\oint":" oint ","\\ge":">=","\\le":"<=","\\ne":"!=","\\neq":"!=","\\lt":"<","\\gt":">","\\gets":"<-","\\to":"->","\\land":" and ","\\lor":" or ","\\lnot":" not ","\\forall":" AA ","\\exists":" EE ","\\in":" in ","\\notin":" !in ","\\mapsto":"|->","\\implies":"=>","\\iff":"<=>","\\cdot":"*","\\ast":"**","\\star":"***","\\times":"xx","\\div":"-:","\\ltimes":"|><","\\rtimes":"><|","\\bowtie":"|><|","\\circ":"@"};function R1(e){let t="";for(const r of e){const i=t[t.length-1];i!==void 0&&/\d/.test(i)&&/^\d/.test(r)&&(t+=" "),t+=r}return t}function Pe(e){var t,r,i,n,a,s,o,l,c,u,d,h,f;if(!e)return"";if(le(e)){if(e.length===0)return"";if(e[0].mode==="latex")return e.map(Pe).join("");if(e[0].mode==="text"){let L=0,C="";for(;((t=e[L])==null?void 0:t.mode)==="text";)C+=e[L].body?Pe(e[L].body):e[L].value,L++;return`"${C}" ${Pe(e.slice(L))}`}let v=0;const S=[];for(;e[v]&&e[v].mode==="math";){let L="";for(;e[v]&&e[v].type==="mord"&&/\d/.test(e[v].value);)L+=e[v++].value;L?S.push(L):S.push(Pe(e[v++]))}return S.push(Pe(e.slice(v))),R1(S)}if(e.mode==="text")return`"${e.value}"`;let m="";const{command:y}=e;let A;if(y==="\\placeholder")return`(${Pe(e.body)})`;switch(e.type){case"accent":const v={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[y];m=`${v!=null?v:""} ${Pe(e.body)} `;break;case"first":return"";case"latexgroup":return e.body.map(O=>O.value).join("");case"group":case"root":m=(r=Pa[y])!=null?r:Pe(e.body);break;case"genfrac":{const O=e;(O.leftDelim||O.rightDelim)&&(m=O.leftDelim==="."||!O.leftDelim?"{:":O.leftDelim),O.hasBarLine?(m+="(",m+=Pe(O.above),m+=")/(",m+=Pe(O.below),m+=")"):(m+="("+Pe(O.above)+"),",m+="("+Pe(O.below)+")"),(O.leftDelim||O.rightDelim)&&(m+=O.rightDelim==="."||!O.rightDelim?"{:":O.rightDelim)}break;case"surd":m+=e.hasEmptyBranch("above")?"sqrt("+Pe(e.body)+")":"root("+Pe(e.above)+")("+Pe(e.body)+")";break;case"latex":m=e.value;break;case"leftright":{const O=e,U=O.leftDelim;m+=U==="."||!U?"{:":U,m+=Pe(O.body);const oe=O.matchingRightDelim();m+=oe==="."||!oe?":}":oe}break;case"sizeddelim":case"delim":m=e.value;break;case"overlap":break;case"overunder":break;case"mord":m=(n=(i=Pa[y])!=null?i:y)!=null?n:typeof e.value=="string"?e.value:"",m.startsWith("\\")&&(m+=" "),A=y?y.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,A?m=String.fromCodePoint(Number.parseInt("0x"+A[1])):m.length>0&&m.startsWith("\\")&&(m=typeof e.value=="string"?e.value.charAt(0):e.command),m=q1(m,e.style);break;case"mbin":case"mrel":case"minner":m=(s=(a=Pa[y])!=null?a:za[y])!=null?s:e.value;break;case"mopen":case"mclose":m=e.value;break;case"mpunct":m=(o=za[y])!=null?o:y;break;case"mop":case"operator":case"extensible-symbol":e.value!=="\u200B"&&(za[y]?m=za[y]:m=y==="\\operatorname"?Pe(e.body):(l=e.value)!=null?l:y,m+=" ");break;case"array":const S=e.array,L=e.environmentName,C=(c={bmatrix:["[","]"],"bmatrix*":["[","]"]}[L])!=null?c:["(",")"],z=[];for(const O of S){const U=[];for(const oe of O)U.push(C[0]+Pe(oe)+C[1]);z.push(U.join(","))}const I=(u={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[L])!=null?u:["(",")"];m=I[0]+z.join(",")+I[1];break;case"box":break;case"spacing":m=(d=Pa[y])!=null?d:" ";break;case"enclose":m="("+Pe(e.body)+")";break;case"space":m=" ";break;case"subsup":m="";break;case"macro":m=(f=(h=Pa[y])!=null?h:za[y])!=null?f:Pe(e.body);break}if(!e.hasEmptyBranch("subscript")){m+="_";const v=Pe(e.subscript);m+=v.length!==1?`(${v})`:v}if(!e.hasEmptyBranch("superscript")){m+="^";const v=Pe(e.superscript);m+=v.length!==1?`(${v})`:v}return m}function q1(e,t){if(!t)return e;let r=e;return t.variant==="double-struck"&&(r=`bbb "${r}"`),t.variant==="script"&&(r=`cc "${r}"`),t.variant==="fraktur"&&(r=`fr "${r}"`),t.variant==="sans-serif"&&(r=`sf "${r}"`),t.variant==="monospace"&&(r=`tt "${r}"`),t.variantStyle==="bold"&&(r=`bb "${r}"`),t.color?`color({${t.color}})(${r})`:r}function Je(e,t){var r,i;t!=null||(t={}),t.mathstyle=(r=t.mathstyle)!=null?r:"displaystyle";const n=new $({from:g(p({},al()),{renderPlaceholder:()=>new D(160,{maxFontSize:1}),letterShapeStyle:(i=t==null?void 0:t.letterShapeStyle)!=null?i:"tex"}),mathstyle:t.mathstyle}),s=new w({mode:"math",type:"root",body:xt(e,{context:n,parseMode:"math",mathstyle:t.mathstyle})}).render(n);return s?(ws(ya(s,n)),ks(s,{classes:"ML__latex"}).toMarkup()):""}function Fg(e){return rd(e,{context:al()})}function V1(e,t={}){return te(xt(e,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),t)}function H1(e){const t=xt(e,{parseMode:"math",mathstyle:"displaystyle"});return Kn(t)}var vo;function j1(e){var t,r;if(!vo){const i=(t=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:t.ComputeEngine;i?vo=new i:console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}return(r=vo==null?void 0:vo.box(e).latex)!=null?r:""}function Pg(e,t="math"){return Pe(new w({type:"root",body:xt(e,{parseMode:t})}))}function zg(e){return Bs(e,{format:"ascii-math"})[1]}function Hl(e){if(typeof e=="string"){const t=W1(e);if(!t)throw new Error(`Invalid color: ${e}`);return t}return"C"in e?Z1(e):"a"in e?dh(e):e}function Nn(e){return e<0?0:e>255?255:Math.round(e)}function W1(e){if(!e||e[0]!=="#")return;e=e.slice(1);let t;return e.length<=4?(t={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},e.length===4&&(t.a=parseInt(e[3]+e[3],16)/255)):(t={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},e.length===8&&(t.a=parseInt(e[6]+e[7],16)/255)),t&&typeof t.a=="undefined"&&(t.a=1),t}function jl(e){const[t,r,i]=[e.L,e.C,e.H],n=i*Math.PI/180,a={L:t,a:r*Math.cos(n),b:r*Math.sin(n)};return e.alpha!==void 0&&(a.alpha=e.alpha),a}function U1(e){const[t,r,i]=[e.L,e.a,e.b],n=Math.sqrt(r*r+i*i),s=Math.atan2(i,r)*180/Math.PI,o={L:t,C:n,H:s};return e.alpha!==void 0&&(o.alpha=e.alpha),o}function Wl(e){const[t,r,i]=[e.L,e.a,e.b],n=Math.pow(.9999999984505198*t+.39633779217376786*r+.2158037580607588*i,3),a=Math.pow(1.00000000888176*t-.10556134232365635*r-.0638541747717059*i,3),s=Math.pow(t*1.000000054672411-.0894841820949657*r-1.2914855378640917*i,3),o=4.076741661347994*n-3.307711590408193*a+.230969928729428*s,l=-1.2684380040921763*n+2.6097574006633715*a-.3413193963102197*s,c=-.004196086541837188*n-.7034186144594493*a+1.7076147009309444*s,u=d=>{const h=Math.abs(d);return h<=.0031308?d*12.92:(Math.sign(d)||1)*(1.055*Math.pow(h,1/2.4)-.055)};return[u(o),u(l),u(c)]}function Ul(e){const[t,r,i]=e;return t>=0&&t<=1&&r>=0&&r<=1&&i>=0&&i<=1}function Zl(e,t){let[r,i,n]=e;return r=Nn(r*255),i=Nn(i*255),n=Nn(n*255),t!==void 0?{r,g:i,b:n,alpha:t}:{r,g:i,b:n}}function dh(e){let[t,r,i]=Wl(e);if(Ul([t,r,i]))return Zl([t,r,i],e.alpha);const n=U1(e);if(n.C=0,[t,r,i]=Wl(jl(n)),!Ul([t,r,i]))return Zl([t,r,i],e.alpha);let a=0,s=e.L,o=(a+s)/2;n.C=o;const l=.36/Math.pow(2,12);for(;s-a>l;)o=(a+s)/2,n.C=o,[t,r,i]=Wl(jl(n)),Ul([t,r,i])?a=o:s=o;return Zl([t,r,i],e.alpha)}function Z1(e){return dh(jl(e))}function hh(e,t){const r=Hl(e),i=Hl(t),n=.56,a=.57,s=.62,o=.65,l=.022,c=1.414,u=.1,d=5e-4,h=1.14,f=.027,m=1.14,y=.027;function A(O){return O>=l?O:O+jr(l-O,c)}function v(O){return(O<0?-1:1)*Math.pow(Math.abs(O),2.4)}const S=A(v(i.r/255)*.2126729+v(i.g/255)*.7151522+v(i.b/255)*.072175),L=A(v(r.r/255)*.2126729+v(r.g/255)*.7151522+v(r.b/255)*.072175);let C,z,I;return Math.abs(L-S)<d?z=0:L>S?(C=jr(L,n)-jr(S,a),z=C*h):(C=jr(L,o)-jr(S,s),z=C*m),Math.abs(z)<u?I=0:z>0?I=z-y:I=z+f,I*100}function fh(e,t,r){r!=null||(r="#fff"),t!=null||(t="#000");const i=hh(e,r),n=hh(e,t);return Math.abs(i)>Math.abs(n)?r:t}function J1(e){const t=Hl(e);let r=((1<<24)+(Nn(t.r)<<16)+(Nn(t.g)<<8)+Nn(t.b)).toString(16).slice(1);return t.alpha!==void 0&&t.alpha<1&&(r+=("00"+Math.round(t.alpha*255).toString(16)).slice(-2)),r[0]===r[1]&&r[2]===r[3]&&r[4]===r[5]&&r[6]===r[7]&&(r=r[0]+r[2]+r[4]+(t.alpha!==void 0&&t.alpha<1?r[6]:"")),"#"+r}function ve(e){const t=ph(e);let r="";for(const i of t){if(typeof i.value!="string")return"";r+=i.value}return r}function ph(e){const r=e.model.selection.ranges;return r.length!==1?[]:e.model.getAtoms(r[0])}function X1(e,t){const r=ph(e);if(r.length!==1)return!1;const i=hl[t];return i?!!i.test(r[0].value):!1}function $1(e,t){return ve(e).length>0}function G1(e){return[Jl(e,"double-struck","mathbb","tooltip.blackboard"),Jl(e,"fraktur","mathfrak","tooltip.fraktur"),Jl(e,"calligraphic","mathcal","tooltip.caligraphic"),Xl(e,"up","mathrm","tooltip.roman-upright"),Xl(e,"bold","mathbf","tooltip.bold"),Xl(e,"italic","mathit","tooltip.italic")]}function Y1(e){return[{label:()=>Je(`\\vec{${ve(e)}}`),visible:()=>ve(e).length===1,onMenuSelect:()=>e.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>Je(`\\overrightarrow{${ve(e)}}`),visible:()=>ve(e).length>0,onMenuSelect:()=>e.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>Je(`\\overleftarrow{${ve(e)}}`),visible:()=>ve(e).length>0,onMenuSelect:()=>e.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>Je(`\\dot{${ve(e)}}`),visible:()=>ve(e).length===1,onMenuSelect:()=>e.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>Je(`\\ddot{${ve(e)}}`),visible:()=>ve(e).length===1,onMenuSelect:()=>e.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>Je(`\\bar{${ve(e)}}`),visible:()=>ve(e).length===1,onMenuSelect:()=>e.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>Je(`\\overline{${ve(e)}}`),visible:()=>ve(e).length>0,onMenuSelect:()=>e.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>Je(`\\overgroup{${ve(e)}}`),visible:()=>ve(e).length>0,onMenuSelect:()=>e.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>Je(`\\overbrace{${ve(e)}}`),visible:()=>ve(e).length>0,onMenuSelect:()=>e.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>Je(`\\underline{${ve(e)}}`),visible:()=>ve(e).length>0,onMenuSelect:()=>e.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>Je(`\\undergroup{${ve(e)}}`),visible:()=>ve(e).length>0,onMenuSelect:()=>e.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>Je(`\\underbrace{${ve(e)}}`),visible:()=>ve(e).length>0,onMenuSelect:()=>e.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function Q1(e){return[{label:()=>Je(`\\boxed{${e.getValue(e.model.selection)}}}`),onMenuSelect:()=>e.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>Je(`\\bbox[5px, border: 2px solid red]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>Je(`\\bbox[5px, border: 2px dashed black]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function eg(e){const t=[];for(const r of Object.keys(pe))t.push({class:(J1(fh(pe[r]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${pe[r]} "></span>`,ariaLabel:()=>{var i;return(i=R(r))!=null?i:r},checked:()=>{var i;return{some:"mixed",all:!0}[(i=e.queryStyle({backgroundColor:r}))!=null?i:!1]},onMenuSelect:()=>{e.applyStyle({backgroundColor:r},{operation:"toggle"}),e.adoptStyle="none"}});return t}function tg(e){const t=[];for(const r of Object.keys(qe))t.push({class:(fh(qe[r])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${qe[r]} "></span>`,ariaLabel:()=>{var i;return(i=R(r))!=null?i:r},checked:()=>{var i;return{some:"mixed",all:!0}[(i=e.queryStyle({color:r}))!=null?i:!1]},onMenuSelect:()=>{e.applyStyle({color:r},{operation:"toggle"}),e.adoptStyle="none"}});return t}var rg=class extends th{constructor(e,t,r,i){super(e,t),this.row=r,this.col=i}set active(e){const t=this.parentMenu.children;if(e)for(const r of t)r.element.classList.toggle("active",r.row<=this.row&&r.col<=this.col);else for(const r of t)r.element.classList.remove("active")}};function ig(e){const t=[];for(let r=1;r<=5;r++)for(let i=1;i<=5;i++)t.push({onCreate:(n,a)=>new rg(n,a,r,i),label:"\u2610",tooltip:()=>R("tooltip.row-by-col",r,i),data:{row:r,col:i},onMenuSelect:()=>{e.insert(`\\begin{pmatrix}${Array(r).fill(Array(i).fill("#?").join(" & ")).join("\\\\")}\\end{pmatrix}`,{selectionMode:"item"})}});return t}function ng(e){return[{label:()=>R("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>e.executeCommand("addRowBefore"),visible:()=>on(e)},{label:()=>R("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>e.executeCommand("addRowAfter"),visible:()=>on(e)},{label:()=>R("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>e.executeCommand("addColumnBefore"),visible:()=>on(e),enabled:()=>{const t=e.model.parentEnvironment;if(!t)return!1;const[r,i]=sg(e);return r<t.maxColumns}},{label:()=>R("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>e.executeCommand("addColumnAfter"),visible:()=>on(e)},{type:"divider"},{label:()=>R("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>e.executeCommand("removeRow"),visible:()=>on(e)},{label:()=>R("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>e.executeCommand("removeColumn"),visible:()=>on(e)},{type:"divider"},{label:()=>R("menu.borders"),visible:()=>(ag(e)||on(e))&&e.isSelectionEditable,submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>Ka(e,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>Ka(e,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>Ka(e,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>Ka(e,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>Ka(e,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>R("menu.insert matrix"),id:"insert-matrix",visible:()=>e.isSelectionEditable,submenu:ig(e),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>R("menu.mode"),id:"mode",visible:()=>e.isSelectionEditable&&e.model.selectionIsCollapsed,submenu:[{label:()=>R("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{Cn(e,"accept-all"),e.executeCommand(["switchMode","math"])},checked:()=>e.model.mode==="math"},{label:()=>R("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{Cn(e,"accept-all"),e.executeCommand(["switchMode","text"])},checked:()=>e.model.mode==="text"},{label:()=>R("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>e.executeCommand(["switchMode","latex"]),checked:()=>e.model.mode==="latex"}]},{type:"divider"},{label:()=>R("menu.font-style"),id:"variant",visible:()=>e.isSelectionEditable,submenu:G1(e),submenuClass:"variant-submenu"},{label:()=>R("menu.color"),id:"color",visible:()=>e.isSelectionEditable,submenu:tg(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>R("menu.background-color"),id:"background-color",visible:()=>e.isSelectionEditable,submenu:eg(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>R("menu.accent"),id:"accent",visible:()=>e.isSelectionEditable,submenu:Y1(e),submenuClass:"variant-submenu"},{label:()=>R("menu.decoration"),id:"decoration",visible:()=>e.isSelectionEditable&&ve(e).length>0,submenu:Q1(e),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>R("menu.evaluate"),id:"ce-evaluate",visible:()=>e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{const t=og(e);if(!t){e.model.announce("plonk");return}e.model.selectionIsCollapsed?(e.model.position=e.model.lastOffset,e.insert(`=${t}`,{insertionMode:"insertAfter",selectionMode:"item"})):e.insert(t,{insertionMode:"replaceSelection",selectionMode:"item"})}},{label:()=>R("menu.simplify"),id:"ce-simplify",visible:()=>e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{var t,r;if(e.model.selectionIsCollapsed){const i=(t=e.expression)==null?void 0:t.simplify();if(e.model.position=e.model.lastOffset,!i){e.model.announce("plonk");return}e.insert(`=${i.latex}`,{insertionMode:"insertAfter",selectionMode:"item"})}else{const i=(r=window.MathfieldElement.computeEngine)==null?void 0:r.parse(e.getValue(e.model.selection)).simplify();if(!i){e.model.announce("plonk");return}e.insert(i.latex,{insertionMode:"replaceSelection",selectionMode:"item"})}}},{label:()=>{var t;if(window.MathfieldElement.computeEngine===null)return"";const r=(t=e.expression)==null?void 0:t.unknowns[0];return r?R("menu.solve-for",Je(r)):R("menu.solve")},id:"ce-solve",visible:()=>{var t;return e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null&&((t=e.expression)==null?void 0:t.unknowns.length)===1&&e.expression.unknowns[0]!=="Nothing"},onMenuSelect:()=>{var t;const r=e.expression,i=r==null?void 0:r.unknowns[0],n=(t=r.solve(i))==null?void 0:t.map(a=>{var s;return(s=a.simplify().latex)!=null?s:""});if(!n){e.model.announce("plonk");return}e.insert(`${i}=${n.length===1?n[0]:"\\left\\lbrace"+(n==null?void 0:n.join(", "))+"\\right\\rbrace"}`,{insertionMode:"replaceAll",selectionMode:"item"})}},{type:"divider"},{label:()=>R("menu.cut"),onMenuSelect:()=>e.executeCommand("cutToClipboard"),visible:()=>!e.options.readOnly&&e.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>R("menu.copy"),id:"copy",submenu:[{label:()=>R("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>be.copyToClipboard(e,"latex"),keyboardShortcut:"meta+C"},{label:()=>R("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>be.copyToClipboard(e,"ascii-math")},{label:()=>R("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>be.copyToClipboard(e,"math-ml")}]},{label:()=>R("menu.paste"),id:"paste",onMenuSelect:()=>e.executeCommand("pasteFromClipboard"),visible:()=>e.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>R("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>e.executeCommand("selectAll")}]}function on(e){var t;return!!((t=e.model.parentEnvironment)!=null&&t.array)}function ag(e){return e.model.at(e.model.position).type==="array"}function sg(e){var t;const r=(t=e.model.parentEnvironment)==null?void 0:t.array;return r?[r.length,r.reduce((i,n)=>Math.max(i,n.length),0)]:[0,0]}function Ka(e,t){js(e),e.flushInlineShortcutBuffer(),Fd(e.model,t),Be(e)}function og(e){var t,r;let i;if(e.model.selectionIsCollapsed?i=(t=window.MathfieldElement.computeEngine)==null?void 0:t.parse(e.getValue(),{canonical:!1}):i=(r=window.MathfieldElement.computeEngine)==null?void 0:r.parse(e.getValue(e.model.selection),{canonical:!1}),!i)return"";let n=i.evaluate();return n.isSame(i)&&(n=i.N()),n.latex}function Jl(e,t,r,i){return{label:()=>Je(`\\${r}{${ve(e)}}`),tooltip:()=>{var n;return(n=R(i))!=null?n:i},visible:()=>X1(e,t),checked:()=>{var n;return{some:"mixed",all:!0}[(n=e.queryStyle({variant:t}))!=null?n:!1]},onMenuSelect:()=>{e.applyStyle({variant:t},{operation:"toggle"}),e.adoptStyle="none"}}}function Xl(e,t,r,i){return{label:()=>Je(`\\${r}{${ve(e)}}`),tooltip:()=>{var n;return(n=R(i))!=null?n:i},visible:()=>$1(e,t),checked:()=>{var n;return{some:"mixed",all:!0}[(n=e.queryStyle({variantStyle:t}))!=null?n:!1]},onMenuSelect:()=>{e.applyStyle({variantStyle:t},{operation:"toggle"}),e.adoptStyle="none"}}}function On(e,t){return e+Kn(t)}It({speak:(e,t,r)=>lg(e,t,r)},{target:"mathfield"});function lg(e,t,r){var i,n;r=r!=null?r:{withHighlighting:!1};const{model:a}=e;function s(u){let d=null;switch(u){case"all":d=a.root;break;case"selection":d=a.getAtoms(a.selection);break;case"left":{d=a.getAtoms(a.offsetOf(a.at(a.position).leftSibling),a.position);break}case"right":{d=a.getAtoms(a.position,a.offsetOf(a.at(a.position).rightSibling));break}case"group":d=a.getAtoms(a.getSiblingsRange(a.position));break;case"parent":{const{parent:h}=a.at(a.position);h!=null&&h.parent?d=h:d=a.root;break}default:d=a.root}return d}function o(u){let d="";switch(u){case"all":console.log("Internal failure: speak all failed");break;case"selection":d="no selection";break;case"left":d="at start";break;case"right":d="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":d="no parent";break;default:console.log('unknown speak_ param value: "'+u+'"');break}return d}const l=s(t);if(l===null)return(n=(i=window.MathfieldElement).speakHook)==null||n.call(i,o(t)),!1;(r.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const c=Kn(l);return Me()&&r.withHighlighting?(Ci().readAloudMathfield=e,Gi(e,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(e.field,c)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(c),!1}function cg(e){var t,r;if(!Me()){console.log("Speak:",e);return}if(!window.MathfieldElement.speechEngine||window.MathfieldElement.speechEngine==="local"){const i=new SpeechSynthesisUtterance(e);window.speechSynthesis.speak(i)}else if(window.MathfieldElement.speechEngine==="amazon")if(!("AWS"in window))console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");else{const i=new window.AWS.Polly({apiVersion:"2016-06-10"}),n={OutputFormat:"mp3",VoiceId:(t=window.MathfieldElement.speechEngineVoice)!=null?t:"Joanna",Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes((r=window.MathfieldElement.speechEngineVoice)!=null?r:"Joanna")?"neural":"standard",Text:e,TextType:"ssml"};i.synthesizeSpeech(n,(a,s)=>{if(a)console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${a}`);else if(s!=null&&s.AudioStream){const o=new Uint8Array(s.AudioStream),l=new Blob([o.buffer],{type:"audio/mpeg"}),c=URL.createObjectURL(l);new Audio(c).play().catch(d=>console.log(d))}else console.log("polly.synthesizeSpeech():",s)})}else window.MathfieldElement.speechEngine==="google"&&console.error("MathLive 0.98.5: The Google speech engine is not supported yet. Please come again.")}function mh(e){var t;let r;if(e.parent.type==="prompt")e.parentBranch==="body"&&(r="prompt");else if(e.parentBranch==="body")r=e.type&&(t={enclose:"cross out",leftright:"delimiter",surd:"square root",root:"math field",mop:"operator",first:"first"}[e.type])!=null?t:"parent";else if(e.parent.type==="genfrac"){if(e.parentBranch==="above")return"numerator";if(e.parentBranch==="below")return"denominator"}else e.parent.type==="surd"?e.parentBranch==="above"&&(r="index"):e.parentBranch==="superscript"?r="superscript":e.parentBranch==="subscript"&&(r="subscript");return r||console.log("unknown relationship"),r!=null?r:"parent"}function ug(e,t,r,i){let n="";if(t==="plonk")window.MathfieldElement.playSound("plonk"),e.flushInlineShortcutBuffer();else if(t==="delete")n=On("deleted: ",i);else if(t==="focus"||t.includes("move"))n=dg(e.model,r)+(e.model.selectionIsCollapsed?"":"selected: ")+hg(e.model);else if(t==="replacement")n=On("",e.model.at(e.model.position));else if(t==="line"){const a=On("",e.model.root);e.keyboardDelegate.setAriaLabel(a)}else n=i?On(t+" ",i):t;if(n){const a=e.ariaLiveText.textContent.includes("\xA0")?" \u202F ":" \xA0 ";e.ariaLiveText.textContent=n+a}}function dg(e,t){if(Number.isNaN(t))return"";const r=e.at(t);if(!r||r.treeDepth<=e.at(e.position).treeDepth)return"";let i="",n=r.parent;const a=e.at(e.position).parent;for(;n!==e.root&&n!==a;)i+=`out of ${mh(n)};`,n=n.parent;return i}function hg(e){if(!e.selectionIsCollapsed)return On("",e.getAtoms(e.selection));let t="";const r=e.at(e.position),i=mh(r);return r.isFirstSibling&&(t=(i?"start of "+i:"unknown")+": "),r.isLastSibling?r.isFirstSibling||(t+=i?"end of "+i:"unknown"):t+=On("",r),t}var fg=class{constructor(e,t,r){this.mathfield=e,this.mode=t,this.silenceNotifications=!1,this._selection={ranges:[[0,0]],direction:"none"},this._anchor=0,this._position=0,this.root=r}dispose(){this.mathfield=void 0}getState(){const e={ranges:[...this._selection.ranges]};return this.selection.direction&&this.selection.direction!=="none"&&(e.direction=this.selection.direction),{content:this.root.toJson(),selection:e,mode:this.mode}}setState(e,t){var r;const i=this.silenceNotifications;this.silenceNotifications=(r=t==null?void 0:t.silenceNotifications)!=null?r:!0;let n={};if((t==null?void 0:t.type)==="undo"&&(n={inputType:"historyUndo"}),(t==null?void 0:t.type)==="redo"&&(n={inputType:"historyRedo"}),this.contentWillChange(n)){const a=this.silenceNotifications;this.silenceNotifications=!0,this.mode=e.mode,this.root=wi(e.content),this.selection=e.selection,this.silenceNotifications=a,this.contentDidChange(n)}this.silenceNotifications=i}get atoms(){return this.root.children}get selection(){return this._selection}set selection(e){this.setSelection(e)}setSelection(e,t){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{var r,i,n;const a=this.normalizeSelection(e,t);if(a===void 0)throw new TypeError("Invalid selection");if(a.ranges.length===1&&a.ranges[0][0]===a.ranges[0][1]){const u=a.ranges[0][0];if(!this.mathfield.dirty&&!((r=this.at(u))!=null&&r.parentPrompt)&&this.mathfield.hasEditablePrompts){if((i=this.at(u-1))!=null&&i.parentPrompt){this._anchor=this.normalizeOffset(u-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((n=this.at(u+1))!=null&&n.parentPrompt){this._anchor=this.normalizeOffset(u+1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}this._anchor=0,this._position=0,this._selection={ranges:[[0,0]]};return}this._anchor=u,this._position=u,this._selection=a;return}const s=pt(a);a.direction==="backward"?[this._position,this._anchor]=s:[this._anchor,this._position]=s;const o=this.at(s[0]+1),l=this.at(s[1]),c=w.commonAncestor(o,l);(c==null?void 0:c.type)==="array"&&o.parent===c&&l.parent===c?this._selection={ranges:[s],direction:a.direction}:this._selection={ranges:[s],direction:a.direction},console.assert(this._position>=0&&this._position<=this.lastOffset)})}setPositionHandlingPlaceholder(e){var t;const r=this.at(e);(r==null?void 0:r.type)==="placeholder"?this.setSelection(e-1,e):((t=r==null?void 0:r.rightSibling)==null?void 0:t.type)==="placeholder"?this.setSelection(e,e+1):this.position=e,r instanceof tt&&r.isSuggestion&&(r.isSuggestion=!1),this.mathfield.stopCoalescingUndo()}get position(){return this._position}set position(e){this.setSelection(e,e)}get anchor(){return this._anchor}get selectionIsCollapsed(){return this._anchor===this._position}get selectionIsPlaceholder(){return Math.abs(this._anchor-this._position)===1?this.at(Math.max(this._anchor,this._position)).type==="placeholder":!1}collapseSelection(e="forward"){return this._anchor===this._position?!1:(e==="backward"?this.position=Math.min(this._anchor,this._position):this.position=Math.max(this._anchor,this._position),!0)}get lastOffset(){return this.atoms.length-1}at(e){return this.atoms[e]}offsetOf(e){return this.atoms.indexOf(e)}getSiblingsRange(e){const t=this.at(e),{parent:r}=t;if(!r)return[0,this.lastOffset];const i=t.parent.branch(t.parentBranch);return[this.offsetOf(i[0]),this.offsetOf(i[i.length-1])]}getBranchRange(e,t){const r=this.at(e).branch(t);return[this.offsetOf(r[0]),this.offsetOf(r[r.length-1])]}getAtoms(e,t,r){let i=r!=null?r:{};if(Ls(e)){if(i=t!=null?t:{},e.ranges.length>1)return e.ranges.reduce((c,u)=>[...c,...this.getAtoms(u,i)],[]);e=e.ranges[0]}let n,a;if(vi(e)){if(n=e,!vi(t))return[];a=t}else[n,a]=e,i=t!=null?t:{};if(!Number.isFinite(n))return[];i.includeChildren===void 0&&(i.includeChildren=!1),n<0&&(n=this.lastOffset-n+1),a<0&&(a=this.lastOffset-a+1);const s=Math.min(n,a)+1,o=Math.max(n,a);if(!i.includeChildren&&s===1&&o===this.lastOffset)return[this.root];let l=[];for(let c=s;c<=o;c++){const u=this.atoms[c];gh(this,u,s,o)&&l.push(u)}return i.includeChildren||(l=l.filter(c=>{let u=!1,{parent:d}=c;for(;d&&!u;)u=gh(this,d,s,o),d=d.parent;return!u})),l}getAllAtoms(e=0){const t=[],r=this.lastOffset;for(let i=e;i<=r;i++)t.push(this.atoms[i]);for(let i=0;i<e;i++)t.push(this.atoms[i]);return t}findAtom(e,t=0,r="forward"){let i;const n=this.lastOffset;if(r==="forward"){for(let a=t;a<=n;a++)if(i=this.atoms[a],e(i))return i;for(let a=0;a<t;a++)if(i=this.atoms[a],e(i))return i;return}for(let a=t;a>=0;a--)if(i=this.atoms[a],e(i))return i;for(let a=n;a>t;a--)if(i=this.atoms[a],e(i))return i}extractAtoms(e){let t=this.getAtoms(e);if(t.length===1&&!t[0].parent)if(t[0].type==="root")t=[...t[0].body],t.shift();else return t=this.root.cells.flat(),this.root=new w({type:"root",body:[]}),t;for(const r of t)r.parent.removeChild(r);return t}deleteAtoms(e){this.extractAtoms(e),this.position=e[0]}atomToString(e,t){const r=t!=null?t:"latex";if(r.startsWith("latex"))return w.serialize([e],{expandMacro:r==="latex-expanded",skipStyles:r==="latex-unstyled",skipPlaceholders:r==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode});if(r==="math-ml")return te(e);if(r==="spoken")return Kn(e);if(r==="spoken-text"){const i=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const n=Kn(e);return window.MathfieldElement.textToSpeechMarkup=i,n}if(r==="spoken-ssml"||r==="spoken-ssml-with-highlighting"){const i=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="ssml";const n=Kn(e);return window.MathfieldElement.textToSpeechMarkup=i,n}return r==="ascii-math"?Pe(e):(console.error(`MathLive 0.98.5: Unexpected format "${r}`),"")}getValue(e,t,r){if(e===void 0)return this.atomToString(this.root,"latex");if(typeof e=="string"&&e!=="math-json")return this.atomToString(this.root,e);let i,n;if(vi(e)&&vi(t)?(i=[this.normalizeRange([e,t])],n=r):As(e)?(i=[this.normalizeRange(e)],n=t):Ls(e)?(i=e.ranges,n=t):(i=[this.normalizeRange([0,-1])],n=e),n!=null||(n="latex"),n==="math-json"){if(!window.MathfieldElement.computeEngine)return window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`),'["Error", "compute-engine-not-available"]';const a=this.getValue({ranges:i},"latex-unstyled");try{const s=window.MathfieldElement.computeEngine.parse(a);return JSON.stringify(s.json)}catch(s){return JSON.stringify(["Error",`'${s.toString()}'`])}}if(n.startsWith("latex")){const a={expandMacro:n==="latex-expanded",skipStyles:n==="latex-unstyled",skipPlaceholders:n==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode};return X(i.map(s=>w.serialize(this.getAtoms(s),a)))}return i.map(a=>this.getAtoms(a).map(s=>this.atomToString(s,n)).join("")).join("")}extendSelectionTo(e,t){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{const r=this.normalizeRange([e,t]);let[i,n]=r,{parent:a}=this.at(n);if(a&&(a.type==="genfrac"||a.type==="subsup"))for(;a!==this.root&&$l(this,a,[i,n]);)n=this.offsetOf(a),a=a.parent;for(a=this.at(i).parent;a!==this.root&&$l(this,a,[i,n]);)i=this.offsetOf(a.leftSibling),a=a.parent;if(a=this.at(n).parent,(a==null?void 0:a.type)==="genfrac")for(;a!==this.root&&$l(this,a,[i,n]);)n=this.offsetOf(a),console.assert(n>=0),a=a.parent;this._position=this.normalizeOffset(t),this._selection={ranges:[[i,n]],direction:"none"}})}announce(e,t,r=[]){var i,n;((n=(i=this.mathfield.host)==null?void 0:i.dispatchEvent(new CustomEvent("announce",{detail:{command:e,previousPosition:t,atoms:r},cancelable:!0,bubbles:!0,composed:!0})))!=null?n:!0)&&ug(this.mathfield,e,t,r)}deferNotifications(e,t){const r=this._selection,i=this._anchor,n=this._position,a=this.silenceNotifications;this.silenceNotifications=!0;const s=this.root.changeCounter;t();const o=this.root.changeCounter!==s,l=i!==this._anchor||n!==this._position||Ef(this._selection,r)==="different";return this.silenceNotifications=a,e.content&&o&&this.contentDidChange({inputType:e.type}),e.selection&&l&&this.selectionDidChange(),o||l}normalizeOffset(e){return e>0?e=Math.min(e,this.lastOffset):e<0&&(e=this.lastOffset+e+1),e}normalizeRange(e){let[t,r]=e;return t=this.normalizeOffset(t),r=this.normalizeOffset(r),t<r?[t,r]:[r,t]}normalizeSelection(e,t){var r;let i;if(vi(e)){const n=this.normalizeOffset(e);if(vi(t)){const a=this.normalizeOffset(t);i=n<=a?{ranges:[[n,a]],direction:"none"}:{ranges:[[a,n]],direction:"backward"}}else i={ranges:[[n,n]],direction:"none"}}else if(As(e)){const n=this.normalizeOffset(e[0]),a=this.normalizeOffset(e[1]);i=n<=a?{ranges:[[n,a]],direction:"none"}:{ranges:[[a,n]],direction:"backward"}}else Ls(e)&&(i={ranges:e.ranges.map(n=>this.normalizeRange(n)),direction:(r=e.direction)!=null?r:"none"});return console.assert(i!==void 0),i}get parentEnvironment(){let e=this.at(this.position).parent;if(e){for(;e.parent&&e.type!=="array";)e=e.parent;if(e.type==="array")return e}}get cell(){var e;let t=this.at(this.position);if(t){for(;t&&((e=t.parent)==null?void 0:e.type)!=="array";)t=t.parent;if(!(!(t!=null&&t.parent)||t.parent.type!=="array"))return t.parentBranch}}contentWillChange(e={}){if(this.silenceNotifications||!this.mathfield)return!0;const t=this.silenceNotifications;this.silenceNotifications=!0;const r=this.mathfield.onContentWillChange(e);return this.silenceNotifications=t,r}contentDidChange(e){var t;if(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Kr(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;const r=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",g(p({},e),{data:e.data?e.data:(t=e.inputType)!=null?t:"",bubbles:!0,composed:!0}))),this.silenceNotifications=r}selectionDidChange(){if(!this.mathfield||(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Kr(this.mathfield)),this.silenceNotifications))return;const e=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.onSelectionDidChange(),this.silenceNotifications=e}};function gh(e,t,r,i){const n=e.offsetOf(t);if(n<r||n>i)return!1;if(!t.hasChildren)return!0;const a=e.offsetOf(t.firstChild);if(a>=r&&a<=i){const s=e.offsetOf(t.lastChild);if(s>=r&&s<=i)return!0}return!1}function $l(e,t,r){if(!(t!=null&&t.hasChildren))return!1;const[i,n]=r,a=e.offsetOf(t.firstChild),s=e.offsetOf(t.lastChild);return a>=i&&a<=n&&s>=a&&s<=n}function Na(e,t,r,i){var n,a,s,o,l,c;const u=r.parent;if(u&&r instanceof Le){const d=!i&&t==="forward"||i==="body"&&t==="backward";let h=d?e.offsetOf(r.firstChild):e.offsetOf(r.lastChild);return d?r.rightDelim!=="?"&&r.rightDelim!=="."?(r.leftDelim=".",r.isDirty=!0):(u.addChildrenAfter(r.removeBranch("body"),r),u.removeChild(r),h--):r.leftDelim!=="?"&&r.leftDelim!=="."?(r.rightDelim=".",r.isDirty=!0):(u.addChildrenAfter(r.removeBranch("body"),r),u.removeChild(r),h--),e.position=h,!0}if(u&&r.type==="surd"){if(t==="forward"&&!i||t==="backward"&&i==="body"){const d=r.leftSibling;r.hasChildren&&u.addChildrenAfter(r.removeBranch("body"),r),u.removeChild(r),e.position=e.offsetOf(d)}else t==="forward"&&i==="body"?e.position=e.offsetOf(r):!i&&t==="backward"?r.hasChildren?e.position=e.offsetOf(r.lastChild):(e.position=Math.max(0,e.offsetOf(r)-1),u.removeChild(r)):i==="above"&&(r.hasEmptyBranch("above")&&r.removeBranch("above"),t==="backward"?e.position=e.offsetOf(r.leftSibling):e.position=e.offsetOf(r.body[0]));return!0}if(u&&(r.type==="box"||r.type==="enclose")){const d=i&&t==="backward"||!i&&t==="forward"?r.leftSibling:r.lastChild;return u.addChildrenAfter(r.removeBranch("body"),r),u.removeChild(r),e.position=e.offsetOf(d),!0}if(r.type==="genfrac"||r.type==="overunder"){if(!i)return r.type==="overunder"&&r.hasEmptyBranch("body")||r.type==="genfrac"&&r.hasEmptyBranch("below")&&r.hasEmptyBranch("above")?!1:(e.position=e.offsetOf(t==="forward"?r.firstChild:r.lastChild),!0);const d=Oa.fractionNavigationOrder==="numerator-denominator"?"above":"below",h=d==="above"?"below":"above";if(u&&(t==="forward"&&i===d||t==="backward"&&i===h)){const f=r.removeBranch(d),m=r.removeBranch(h);return u.addChildrenAfter([...f,...m],r),u.removeChild(r),e.position=e.offsetOf(f.length>0?f[f.length-1]:m[0]),!0}return t==="backward"?e.position=e.offsetOf(r.leftSibling):e.position=e.offsetOf(r),!0}if(r.isExtensibleSymbol||r.type==="subsup"){if(!i&&t==="forward")return!1;if(!i){if(r.subscript||r.superscript){const d=t==="forward"?(s=(n=r.superscript)==null?void 0:n[0])!=null?s:(a=r.subscript)==null?void 0:a[0]:(c=(o=r.subscript)==null?void 0:o[0].lastSibling)!=null?c:(l=r.superscript)==null?void 0:l[0].lastSibling;return d&&(e.position=e.offsetOf(d)),!0}return!1}if(!r.hasChildren&&r.type==="subsup"){const d=t==="forward"?e.offsetOf(r):Math.max(0,e.offsetOf(r)-1);return r.parent.removeChild(r),e.position=d,!0}if(i==="superscript")if(t==="backward"){const d=e.offsetOf(r.firstChild)-1;console.assert(d>=0),e.position=d}else r.subscript?e.position=e.offsetOf(r.subscript[0]):e.position=e.offsetOf(r);else i==="subscript"&&(t==="backward"&&r.superscript?e.position=e.offsetOf(r.superscript[0].lastSibling):t==="backward"?e.position=e.offsetOf(r.firstChild)-1:e.position=e.offsetOf(r));if(i&&r.hasEmptyBranch(i)&&(r.removeBranch(i),r.type==="subsup"&&!r.subscript&&!r.superscript)){const d=t==="forward"?e.offsetOf(r):Math.max(0,e.offsetOf(r)-1);r.parent.removeChild(r),e.position=d}return!0}if((u==null?void 0:u.type)==="genfrac"&&!i&&r.type!=="first"){let d=e.offsetOf(r.leftSibling);return u.removeChild(r),u.hasEmptyBranch("above")&&u.hasEmptyBranch("below")?(d=e.offsetOf(u.leftSibling),u.parent.removeChild(u),e.announce("delete",void 0,[u]),e.position=d,!0):(e.announce("delete",void 0,[r]),e.position=d,!0)}if(t==="backward"&&((u==null?void 0:u.command)==="\\ln"||(u==null?void 0:u.command)==="\\log")&&r.parentBranch!=="body"){const d=e.offsetOf(u.leftSibling);return u.parent.removeChild(u),e.announce("delete",void 0,[u]),e.position=d,!0}return!1}function pg(e){return!e.mathfield.isSelectionEditable||!e.contentWillChange({inputType:"deleteContentBackward"})?!1:e.selectionIsCollapsed?e.deferNotifications({content:!0,selection:!0,type:"deleteContentBackward"},()=>{let t=e.at(e.position);if(!(t&&Na(e,"backward",t))){if(t!=null&&t.isFirstSibling){if(Na(e,"backward",t.parent,t.parentBranch))return;t=null}if(!t){e.announce("plonk");return}e.position=e.offsetOf(t.leftSibling),t.parent.removeChild(t),e.announce("delete",void 0,[t])}}):Or(e,pt(e.selection),"deleteContentBackward")}function mg(e){return!e.mathfield.isSelectionEditable||!e.contentWillChange({inputType:"deleteContentForward"})?!1:e.selectionIsCollapsed?e.deferNotifications({content:!0,selection:!0,type:"deleteContentForward"},()=>{var t,r;let i=e.at(e.position).rightSibling;if(i&&Na(e,"forward",i))return;if(i){if(e.at(e.position).isLastSibling&&Na(e,"forward",i.parent,i.parentBranch))return}else{if(i=e.at(e.position),i.isLastSibling&&Na(e,"forward",i.parent,i.parentBranch))return;i=void 0}if(e.position===e.lastOffset||!i){e.announce("plonk");return}i.parent.removeChild(i);let n=(t=e.at(e.position))==null?void 0:t.rightSibling;for(;(n==null?void 0:n.type)==="subsup";)n.parent.removeChild(n),n=(r=e.at(e.position))==null?void 0:r.rightSibling;e.announce("delete",void 0,[i])}):Or(e,pt(e.selection),"deleteContentForward")}function Or(e,t,r){const i=e.getAtoms(t);if(i.length>0&&i[0].parent){let n=i[0].parent.firstChild;n.type==="first"&&(n=n.rightSibling);const a=i[i.length-1].parent.lastChild;let s=i[0];s.type==="first"&&(s=s.rightSibling);const o=i[i.length-1];if(s===n&&o===a){const l=i[0].parent;l.parent&&l.type!=="prompt"&&(t=[e.offsetOf(l.leftSibling),e.offsetOf(l)])}if(i.length===1&&i[0].type==="placeholder"&&i[0].parent.type==="genfrac"){const l=i[0].parent,c=i[0].parentBranch==="below"?"above":"below",u=e.offsetOf(l.leftSibling);return e.deferNotifications({content:!0,selection:!0,type:r},()=>{var d,h;const f=l.removeBranch(c);if(f.length===1&&f[0].type==="placeholder")(h=l.parent)==null||h.removeChild(l),e.position=Math.max(0,u);else{const m=l.parent.addChildrenAfter(f,l);(d=l.parent)==null||d.removeChild(l),e.position=e.offsetOf(m)}})}}return e.deferNotifications({content:!0,selection:!0,type:r},()=>e.deleteAtoms(t))}It({deleteAll:e=>e.contentWillChange({inputType:"deleteContent"})&&Or(e,[0,-1],"deleteContent"),deleteForward:e=>mg(e),deleteBackward:e=>pg(e),deleteNextWord:e=>e.contentWillChange({inputType:"deleteWordForward"})&&Or(e,[e.anchor,Sl(e,e.position,"forward")],"deleteWordForward"),deletePreviousWord:e=>e.contentWillChange({inputType:"deleteWordBackward"})&&Or(e,[e.anchor,Sl(e,e.position,"backward")],"deleteWordBackward"),deleteToGroupStart:e=>e.contentWillChange({inputType:"deleteSoftLineBackward"})&&Or(e,[e.anchor,e.offsetOf(e.at(e.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:e=>e.contentWillChange({inputType:"deleteSoftLineForward"})&&Or(e,[e.anchor,e.offsetOf(e.at(e.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:e=>e.contentWillChange({inputType:"deleteHardLineBackward"})&&Or(e,[e.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:e=>e.contentWillChange({inputType:"deleteHardLineForward"})&&Or(e,[e.anchor,-1],"deleteHardLineForward")},{target:"model",audioFeedback:"delete",canUndo:!0,changeContent:!0,changeSelection:!0});var gg=`<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;" viewBox="0 0 576 512" role="img" aria-label="${R("tooltip.toggle virtual keyboard")}"><path d="M528 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h480c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm16 336c0 8.823-7.177 16-16 16H48c-8.823 0-16-7.177-16-16V112c0-8.823 7.177-16 16-16h480c8.823 0 16 7.177 16 16v288zM168 268v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-336 80v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm384 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zM120 188v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-96 152v-8c0-6.627-5.373-12-12-12H180c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12h216c6.627 0 12-5.373 12-12z"/></svg>`,bg=`<svg xmlns="http://www.w3.org/2000/svg" style="height: 18px;" viewBox="0 0 448 512" role="img" aria-label="${R("tooltip.menu")}"><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>`,vg=class{constructor(e,t){this.focusBlurInProgress=!1;var r,i,n;this.options=p(g(p({},to()),{macros:Vt(),registers:F0()}),eo(t)),this.eventController=new AbortController;const a=this.eventController.signal;t.eventSink&&(this.host=t.eventSink),this.element=e,e.mathfield=this,this.blurred=!0,this.keystrokeCaptionVisible=!1,this.suggestionIndex=0,this.inlineShortcutBuffer=[],this.inlineShortcutBufferFlushTimer=0,this.defaultStyle={},this.adoptStyle="left",this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline"),this.dirty=!1;let s=(i=(r=t.value)!=null?r:this.element.textContent)!=null?i:"";s=s.trim();const o=Bd(this.options),l=new w({type:"root",mode:o,body:xt(s,{context:this.context})});this.model=new fg(this,o,l),this.undoManager=new Hm(this.model);const c=[];if(c.push("<span contenteditable=true aria-multiline=false part=keyboard-sink class=ML__keyboard-sink autocapitalize=off autocomplete=off autocorrect=off spellcheck=false inputmode=none tabindex=0></span>"),c.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),c.push("<span part=content class=ML__content>"),c.push(wd(this)),c.push("</span>"),window.mathVirtualKeyboard&&(c.push(`<div part=virtual-keyboard-toggle class=ML__virtual-keyboard-toggle role=button ${this.hasEditableContent?"":'style="display:none;"'} data-l10n-tooltip="tooltip.toggle virtual keyboard">`),c.push(gg),c.push("</div>")),c.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),c.push(bg),c.push("</div>"),c.push("</span>"),c.push("<span class=ML__sr-only>"),c.push("<span role=status aria-live=assertive aria-atomic=true></span>"),c.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(c.join("")),!this.element.children){console.error("%cMathLive 0.98.5: Something went wrong and the mathfield could not be created.%c\nIf you are using Vue, this may be because you are using the runtime-only build of Vue. Make sure to include `runtimeCompiler: true` in your Vue configuration. There may a warning from Vue in the log above.","color:red;font-family:system-ui;font-size:1.2rem;font-weight:bold","color:inherit;font-family:system-ui;font-size:inherit;font-weight:inherit");return}this._l10Subscription=N.subscribe(()=>N.update(this.element)),N.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",d=>d.stopImmediatePropagation(),{capture:!1,signal:a}),this.field.addEventListener("wheel",this,{passive:!1,signal:a}),"PointerEvent"in window?this.field.addEventListener("pointerdown",this,{signal:a}):this.field.addEventListener("mousedown",this,{signal:a}),(n=this.element.querySelector("[part=virtual-keyboard-toggle]"))==null||n.addEventListener("click",()=>{window.mathVirtualKeyboard.visible?window.mathVirtualKeyboard.hide():(window.mathVirtualKeyboard.show({animate:!0}),window.mathVirtualKeyboard.update(Kr(this)))},{signal:a}),this._menu=new A1(ng(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:a});const u=this.element.querySelector("[part=menu-toggle]");u==null||u.addEventListener("pointerdown",d=>{if(d.currentTarget!==u||this._menu.state!=="closed")return;this.element.classList.add("tracking");const h=u.getBoundingClientRect();this._menu.modifiers=$i(d),this._menu.show({target:u,location:{x:h.left,y:h.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),d.preventDefault(),d.stopPropagation()},{signal:a}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||this.userSelect==="none")&&(u.style.display="none"),this.ariaLiveText=this.element.querySelector("[role=status]"),this.keyboardDelegate=Jp(this.element.querySelector(".ML__keyboard-sink"),this.element,this),window.addEventListener("resize",this,{signal:a}),document.addEventListener("scroll",this,{signal:a}),this.resizeObserver=new ResizeObserver(()=>Be(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:a}),wa&&!N.locale.startsWith(wa.locale)&&jp(N.locale),Xt!=="ready"&&document.fonts.ready.then(()=>Xs(this)),e.querySelector("[part=container]").style.removeProperty("visibility"),this.undoManager.startRecording(),this.undoManager.snapshot("set-value")}get defaultStyle(){return this._defaultStyle}set defaultStyle(e){this._defaultStyle=e}get effectiveStyle(){if(this.adoptStyle==="none")return this.defaultStyle;const e=this.model.at(this.model.position),t=this.adoptStyle==="right"?e.rightSibling:e;if(!t)return this.defaultStyle;if(t.type==="group"){const r=t.branch("body");return!r||r.length<2?{}:this.adoptStyle==="right"?r[1].computedStyle:r[r.length-1].computedStyle}return t.computedStyle}connectToVirtualKeyboard(){this.connectedToVirtualKeyboard||(this.connectedToVirtualKeyboard=!0,window.addEventListener("message",this,{signal:this.eventController.signal}),window.mathVirtualKeyboard.connect(),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Kr(this)),po(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,Kl())}showMenu(e){var t,r;const i=(r=(t=e==null?void 0:e.location)!=null?t:ha(this.field))!=null?r:void 0,n=e==null?void 0:e.modifiers,a=this.element.querySelector("[part=container]");return this._menu.show({target:a,location:i,modifiers:n})}get colorMap(){return e=>{var t,r,i;return(i=(r=(t=this.options).colorMap)==null?void 0:r.call(t,e))!=null?i:Rt(e)}}get backgroundColorMap(){return e=>{var t,r,i,n,a,s;return(s=(a=(r=(t=this.options).backgroundColorMap)==null?void 0:r.call(t,e))!=null?a:(n=(i=this.options).colorMap)==null?void 0:n.call(i,e))!=null?s:ye(e)}}get smartFence(){var e;return(e=this.options.smartFence)!=null?e:!1}get readOnly(){var e;return(e=this.options.readOnly)!=null?e:!1}get disabled(){var e,t;return(t=(e=this.host)==null?void 0:e.disabled)!=null?t:!1}get contentEditable(){return this.host?this.host.getAttribute("contenteditable")!=="false":!1}get userSelect(){if(!this.host)return"";const e=getComputedStyle(this.host);return e.getPropertyValue("user-select")||e.getPropertyValue("-webkit-user-select")}get hasEditableContent(){return this.disabled||!this.contentEditable?!1:!this.readOnly||this.hasEditablePrompts}get hasEditablePrompts(){return this.readOnly&&!this.disabled&&this.contentEditable&&this.model.findAtom(e=>e.type==="prompt"&&!e.locked)!==void 0}get isSelectionEditable(){if(this.disabled||!this.contentEditable)return!1;if(!this.readOnly)return!0;const e=this.model.at(this.model.anchor),t=this.model.at(this.model.position),r=w.commonAncestor(e,t);return!!((r==null?void 0:r.type)==="prompt"||r!=null&&r.parentPrompt)}get letterShapeStyle(){var e;return(e=this.options.letterShapeStyle)!=null?e:"tex"}get minFontScale(){return this.options.minFontScale}get selectionStyle(){if(this.model.selectionIsCollapsed)return this.effectiveStyle;const e=this.model.getAtoms(this.model.selection);if(e.length===0)return{};const t=p({},e[0].style);for(const r of e)for(const[i,n]of Object.entries(r.style))t[i]!==n&&delete t[i];return t}queryStyle(e){const t=Dl(this,e);"verbatimColor"in t&&delete t.verbatimColor,"verbatimBackgroundColor"in t&&delete t.verbatimBackgroundColor;const r=Object.keys(t).length;if(r===0)return"all";if(r>1){for(const l of Object.keys(t)){const c=this.queryStyle({[l]:t[l]});if(c==="none")return"none";if(c==="some")return"some"}return"all"}const i=Object.keys(t)[0],n=t[i];if(this.model.selectionIsCollapsed)return this.effectiveStyle[i]===n?"all":"none";const a=this.model.getAtoms(this.model.selection,{includeChildren:!0});let s=a.length;if(s===0)return"none";let o=0;for(const l of a){if(l.type==="first"){s-=1;continue}l.style[i]===n&&(o+=1)}return o===0?"none":o===s?"all":"some"}get keybindings(){var e,t;if(this._keybindings)return this._keybindings;const[r,i]=Qp(this.options.keybindings,(e=ka())!=null?e:Wp());return((t=ka())==null?void 0:t.score)>0&&(this._keybindings=r,i.length>0&&console.error("MathLive 0.98.5: Invalid keybindings for current keyboard layout",i)),r}get menu(){return this._menu}setOptions(e){var t;this.options=p(p({},this.options),eo(e)),this._keybindings=void 0,this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline");let r=this.options.defaultMode;r==="inline-math"&&(r="math"),((t=this.model.root.firstChild)==null?void 0:t.mode)!==r&&(this.model.root.firstChild.mode=r),this.options.readOnly&&this.hasFocus()&&window.mathVirtualKeyboard.visible&&this.executeCommand("hideVirtualKeyboard");const i=w.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in e||this.model.getValue()!==i)&&be.insert(this.model,i,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",silenceNotifications:!0,mode:"math"}),("value"in e||"macros"in e||"registers"in e||"colorMap"in e||"backgroundColorMap"in e||"letterShapeStyle"in e||"minFontScale"in e||"readOnly"in e||"placeholderSymbol"in e)&&Be(this)}getOptions(e){return Qi(this.options,e)}getOption(e){return Qi(this.options,e)}handleEvent(e){return Ei(this,null,function*(){var t;if(ji(this)){if(_l(e)){if(!cl(e.origin,(t=this.options.originValidator)!=null?t:"none"))throw new DOMException(`Message from unknown origin (${e.origin}) cannot be handled`,"SecurityError");const{action:r}=e.data;if(r==="execute-command"){const i=e.data.command;if(An(i)==="virtual-keyboard")return;this.executeCommand(i)}else r==="update-state"||(r==="focus"?this.focus({preventScroll:!0}):r==="blur"&&this.blur());return}switch(e.type){case"focus":this.onFocus();break;case"blur":this.onBlur();break;case"mousedown":this.userSelect!=="none"&&Wd(this,e);break;case"pointerdown":this.userSelect!=="none"&&(Wd(this,e),e.shiftKey===!1&&(yield ah(e,this.element.querySelector("[part=container]"),this._menu))&&co.stop());break;case"contextmenu":this.userSelect!=="none"&&e.shiftKey===!1&&(yield ah(e,this.element.querySelector("[part=container]"),this._menu))&&co.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&po(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>ji(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>ji(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(e);break;default:console.warn("Unexpected event type",e.type)}}})}dispose(){if(!ji(this))return;N.unsubscribe(this._l10Subscription),this.keyboardDelegate.dispose(),this.keyboardDelegate=void 0,this.eventController.abort(),this.eventController=void 0,this.resizeObserver.disconnect(),window.mathVirtualKeyboard.removeEventListener("virtual-keyboard-toggle",this),this.disconnectFromVirtualKeyboard(),this.model.dispose();const e=this.element;delete e.mathfield,this.element=void 0,this.host=void 0,this.field=void 0,this.ariaLiveText=void 0,e1(),am(),_1()}flushInlineShortcutBuffer(e){if(e!=null||(e={defer:!1}),!e.defer){this.inlineShortcutBuffer=[],clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=0;return}this.options.inlineShortcutTimeout>0&&(clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=setTimeout(()=>this.flushInlineShortcutBuffer(),this.options.inlineShortcutTimeout))}executeCommand(e){return An(e)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(e),requestAnimationFrame(()=>window.mathVirtualKeyboard.update(Kr(this))),!1):hm(this,e)}get errors(){return rd(this.model.getValue(),{context:this.context})}getValue(e,t,r){return this.model.getValue(e,t,r)}setValue(e,t){var r;t=t!=null?t:{mode:"math"},t.insertionMode===void 0&&(t.insertionMode="replaceAll"),(t.format===void 0||t.format==="auto")&&(t.format="latex"),(t.mode===void 0||t.mode==="auto")&&(t.mode=(r=Lf(this.model,this.model.position))!=null?r:"math");const i=this.undoManager.canUndo();be.insert(this.model,e,t)&&(Be(this),i||this.undoManager.reset(),this.undoManager.snapshot("set-value"))}get expression(){const e=window.MathfieldElement.computeEngine;return e?e.box(e.parse(this.model.getValue("latex-unstyled"))):(console.error("MathLive 0.98.5: no compute engine available. Make sure the Compute Engine library is loaded."),null)}scrollIntoView(){var e;if(!this.element)return;if(this.host){if(this.options.onScrollIntoView)this.options.onScrollIntoView(this);else if(this.host.scrollIntoView({block:"nearest",inline:"nearest"}),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.container===window.document.body){const i=window.mathVirtualKeyboard.boundingRect,n=this.host.getBoundingClientRect();n.bottom>i.top&&((e=window.document.scrollingElement)==null||e.scrollBy(0,n.bottom-i.top+8))}}this.dirty&&Gi(this,{interactive:!0});const t=this.field.getBoundingClientRect();let r=null;if(this.model.selectionIsCollapsed)r=ha(this.field);else{const i=R0(this);if(i.length>0){let n=-1/0,a=-1/0;for(const s of i)s.right>n&&(n=s.right),s.top<a&&(a=s.top);r={x:n+t.left-this.field.scrollLeft,y:a+t.top-this.field.scrollTop,height:0}}}if(this.host&&r){const i=this.host.getBoundingClientRect(),n=r.y;let a=this.host.scrollTop;n<i.top?a=n-i.top+this.host.scrollTop:n>i.bottom&&(a=n-i.bottom+this.host.scrollTop+r.height),this.host.scroll({top:a,left:0})}if(r){const i=r.x-window.scrollX;let n=this.field.scrollLeft;i<t.left?n=i-t.left+this.field.scrollLeft-20:i>t.right&&(n=i-t.right+this.field.scrollLeft+20),this.field.scroll({top:this.field.scrollTop,left:n})}}insert(e,t){return typeof e!="string"||e.length===0&&((t==null?void 0:t.insertionMode)==="insertBefore"||(t==null?void 0:t.insertionMode)==="insertAfter")||e.length===0&&this.model.selectionIsCollapsed?!1:(this.flushInlineShortcutBuffer(),t=t!=null?t:{mode:"math"},t.focus&&this.focus(),t.feedback&&(window.MathfieldElement.keypressVibration&&G()&&navigator.vibrate(kd),window.MathfieldElement.playSound("keypress")),e==="\\\\"?Dd(this.model):e==="&"?Td(this.model):this.model.selectionIsCollapsed?be.insert(this.model,e,p({style:this.model.at(this.model.position).computedStyle},t)):be.insert(this.model,e,t),this.snapshot(`insert-${this.model.at(this.model.position).type}`),Be(this),t.scrollIntoView&&this.scrollIntoView(),!0)}switchMode(e,t="",r=""){var i;if(this.model.mode===e||!this.hasEditableContent||!this.contentEditable||this.disabled)return;const n=this.model.mode;if(this.model.mode=e,!((i=this.host)!=null&&i.dispatchEvent(new Event("mode-change",{bubbles:!0,composed:!0,cancelable:!0})))){this.model.mode=n;return}const a=this.model.mode,{model:s}=this;s.deferNotifications({content:!!r||!!t,selection:!0,type:"insertText"},()=>{let o=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),t&&e!=="latex"){const l=xt(t,{context:this.context,parseMode:e});s.collapseSelection("forward");const c=s.at(s.position);s.position=s.offsetOf(c.parent.addChildrenAfter(l,c)),o=!0}if(this.model.mode=e,e==="latex"){let l=s.selectionIsCollapsed;Cn(this,"accept");let c,u=s.at(s.position);if(l)c="\\";else{const h=pt(s.selection);c=this.model.getValue(h,"latex");const f=this.model.extractAtoms(h);f.length===1&&f[0].type==="placeholder"&&(c=t,l=!0),u=s.at(h[0])}const d=new ga(c);u.parent.addChildAfter(d,u),l?s.position=s.offsetOf(d.lastChild):s.setSelection(s.offsetOf(d.firstChild),s.offsetOf(d.lastChild))}else Ma(s).forEach(l=>{l.isError=!1});if(r){const l=xt(r,{context:this.context,parseMode:a});s.collapseSelection("forward");const c=s.at(s.position);s.position=s.offsetOf(c.parent.addChildrenAfter(l,c)),o=!0}return Be(this),this.undoManager.snapshot(e==="latex"?"insert-latex":"insert"),o}),this.model.mode=e,window.mathVirtualKeyboard.update(Kr(this))}hasFocus(){return!this.blurred}focus(e){var t;this.hasFocus()||(this.keyboardDelegate.focus(),this.connectToVirtualKeyboard(),this.onFocus(),this.model.announce("line")),(t=e==null?void 0:e.preventScroll)!=null&&t||this.scrollIntoView()}blur(){this.disconnectFromVirtualKeyboard(),this.hasFocus()&&this.keyboardDelegate.blur()}select(){this.model.selection={ranges:[[0,this.model.lastOffset]]},this.focus()}applyStyle(e,t={}){var r,i;const n={operation:"set",silenceNotifications:!1};As(t)?n.range=t:(t.operation==="toggle"&&(n.operation="toggle"),n.range=t.range,n.silenceNotifications=(r=t.silenceNotifications)!=null?r:!1);const a=Dl(this,e),s=(i=n.operation)!=null?i:"set";if(n.range===void 0&&this.model.selectionIsCollapsed){if(s==="set"){this.defaultStyle=p(p({},this.defaultStyle),a);return}const o=p({},this.defaultStyle);for(const l of Object.keys(a))o[l]===a[l]?(l==="color"&&delete o.verbatimColor,l==="backgroundColor"&&delete o.verbatimBackgroundColor,delete o[l]):o[l]=a[l];this.defaultStyle=o;return}this.model.deferNotifications({content:!n.silenceNotifications,type:"insertText"},()=>{if(n.range===void 0)for(const o of this.model.selection.ranges)kl(this.model,o,a,{operation:s});else kl(this.model,n.range,a,{operation:s})}),Be(this)}toggleContextMenu(){var e;return this._menu.visible?this._menu.state==="open"?(this._menu.hide(),!0):(this._menu.show({target:this.element.querySelector("[part=container]"),location:(e=this.getCaretPoint())!=null?e:void 0,onDismiss:()=>{var t;return(t=this.element)==null?void 0:t.focus()}}),!0):!1}getCaretPoint(){const e=ha(this.field);return e?{x:e.x,y:e.y}:null}setCaretPoint(e,t){const r=Ta(this,e,t,{bias:0});if(r<0)return!1;const i=this.model.position;return this.model.position=r,this.model.announce("move",i),Be(this),!0}getPrompt(e){const t=this.model.findAtom(r=>r.type==="prompt"&&r.placeholderId===e);return console.assert(t!==void 0,"MathLive 0.98.5: no prompts with matching ID found"),t}getPromptValue(e,t){const r=this.getPrompt(e);if(!r)return"";const i=this.model.offsetOf(r.firstChild),n=this.model.offsetOf(r.lastChild);return this.model.getValue(i,n,t)}getPrompts(e){return this.model.getAllAtoms().filter(t=>t.type!=="prompt"?!1:e?!(e.id&&t.placeholderId!==e.id||e.locked&&t.locked!==e.locked||e.correctness==="undefined"&&t.correctness||e.correctness&&t.correctness!==e.correctness):!0).map(t=>t.placeholderId)}setPromptValue(e,t,r){if(t!==void 0){const i=this.getPrompt(e);if(!i){console.error(`MathLive 0.98.5: unknown prompt ${e}`);return}const n=this.model.getBranchRange(this.model.offsetOf(i),"body");this.model.setSelection(n),this.insert(t,g(p({},r),{insertionMode:"replaceSelection"}))}r!=null&&r.silenceNotifications&&(this.valueOnFocus=this.getValue()),Be(this)}setPromptState(e,t,r){const i=this.getPrompt(e);if(!i){console.error(`MathLive 0.98.5: unknown prompt ${e}`);return}t==="undefined"?i.correctness=void 0:typeof t=="string"&&(i.correctness=t),typeof r=="boolean"&&(i.locked=r,i.captureSelection=r),Be(this)}getPromptState(e){const t=this.getPrompt(e);return t?[t.correctness,t.locked]:(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[void 0,!0])}getPromptRange(e){const t=this.getPrompt(e);return t?this.model.getBranchRange(this.model.offsetOf(t),"body"):(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[0,0])}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(e){var t;this.undoManager.snapshot(e)&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Kr(this)),(t=this.host)==null||t.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"snapshot"}})))}stopCoalescingUndo(){this.undoManager.stopCoalescing(this.model.selection)}stopRecording(){this.undoManager.stopRecording()}startRecording(){this.undoManager.startRecording()}undo(){var e;this.undoManager.undo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Kr(this)),(e=this.host)==null||e.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}redo(){var e;this.undoManager.redo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Kr(this)),(e=this.host)==null||e.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}resetUndo(){var e;(e=this.undoManager)==null||e.reset()}onSelectionDidChange(){var e,t;const r=this.model;this.keyboardDelegate.setValue(r.getValue(this.model.selection,"latex-expanded"));{const i=r.at(r.position),n=(e=i.mode)!=null?e:Bd(this.options);this.model.mode!==n&&(this.model.mode==="latex"?(Cn(this,"accept",{mode:n}),r.position=r.offsetOf(i)):this.switchMode(n))}(t=this.host)==null||t.dispatchEvent(new Event("selection-change",{bubbles:!0,composed:!0})),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Kr(this)),po(this)}onContentWillChange(e){var t,r,i;return(i=(r=this.host)==null?void 0:r.dispatchEvent(new InputEvent("beforeinput",g(p({},e),{data:e.data?e.data:(t=e.inputType)!=null?t:"",cancelable:!0,bubbles:!0,composed:!0}))))!=null?i:!0}onFocus(){this.focusBlurInProgress||!this.blurred||(this.focusBlurInProgress=!0,this.blurred=!1,this.keyboardDelegate.focus(),this.stopCoalescingUndo(),Gi(this,{interactive:!0}),this.valueOnFocus=this.model.getValue(),this.hasEditablePrompts&&!this.model.at(this.model.anchor).parentPrompt&&this.executeCommand("moveToNextPlaceholder"),this.focusBlurInProgress=!1)}onBlur(){var e,t,r;if(this.focusBlurInProgress||this.blurred)return;this.focusBlurInProgress=!0,this.stopCoalescingUndo(),this.blurred=!0,this.ariaLiveText.textContent="",En(this),this.model.getValue()!==this.valueOnFocus&&((e=this.host)==null||e.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.disconnectFromVirtualKeyboard(),(t=this.host)==null||t.dispatchEvent(new Event("blur",{bubbles:!1,composed:!0})),(r=this.host)==null||r.dispatchEvent(new UIEvent("focusout",{bubbles:!0,composed:!0})),Be(this),this.focusBlurInProgress=!1,Kl();const i=new AbortController,n=i.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{ji(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:n})},{once:!0,signal:n}),setTimeout(()=>i.abort(),100)}onInput(e){Al(this,e)}onKeystroke(e){return Vd(this,e)}onCompositionStart(e){this.model.deleteAtoms(pt(this.model.selection));const t=ha(this.field);t&&requestAnimationFrame(()=>{Gi(this),this.keyboardDelegate.moveTo(t.x,t.y-t.height)})}onCompositionUpdate(e){Pm(this.model,e),Be(this)}onCompositionEnd(e){zm(this.model),Al(this,e,{simulateKeystroke:!0})}onCut(e){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),be.onCopy(this,e),Or(this.model,pt(this.model.selection),"deleteByCut"),this.snapshot("cut"),Be(this))}onCopy(e){be.onCopy(this,e)}onPaste(e){let t=this.isSelectionEditable;return t&&(t=be.onPaste(this.model.at(this.model.position).mode,this,e.clipboardData)),t||this.model.announce("plonk"),e.preventDefault(),e.stopPropagation(),t}onGeometryChange(){this._menu.hide(),Us(this),po(this)}onWheel(e){const t=5*e.deltaX;if(!Number.isFinite(t)||t===0)return;const r=this.field;t<0&&r.scrollLeft===0||t>0&&r.offsetWidth+r.scrollLeft>=r.scrollWidth||(r.scrollBy({top:0,left:t}),e.preventDefault(),e.stopPropagation())}getHTMLElement(e){let t=e;for(;!t.id&&t.hasChildren;)t=e.children[0];return this.field.querySelector(`[data-atom-id="${t.id}"]`)}get context(){var e,t;return{registers:(e=this.options.registers)!=null?e:{},smartFence:this.smartFence,letterShapeStyle:this.letterShapeStyle,minFontScale:this.minFontScale,placeholderSymbol:(t=this.options.placeholderSymbol)!=null?t:"\u25A2",colorMap:r=>this.colorMap(r),backgroundColorMap:r=>this.backgroundColorMap(r),getMacro:r=>fr(r,this.options.macros),atomIdsSettings:{seed:"random",groupNumbers:!1}}}};function bh(e){if(e&&(e.classList.remove("ML__highlight"),e.children))for(const t of e.children)bh(t)}function Gl(e,t){var r;e&&(!t||((r=e.dataset)==null?void 0:r.atomId)===t?(e.classList.add("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(i=>{i instanceof HTMLElement&&Gl(i)})):(e.classList.remove("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(i=>{i instanceof HTMLElement&&Gl(i,t)})))}function yg(e,t){var r;if(!Me())return;if(window.MathfieldElement.speechEngine!=="amazon"){console.error("MathLive 0.98.5: Use Amazon TTS Engine for synchronized highlighting"),typeof window.MathfieldElement.speakHook=="function"&&window.MathfieldElement.speakHook(t);return}if(!window.AWS){console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");return}const i=new window.AWS.Polly({apiVersion:"2016-06-10"}),n={OutputFormat:"json",VoiceId:(r=window.MathfieldElement.speechEngineVoice)!=null?r:"Joanna",Engine:"standard",Text:t,TextType:"ssml",SpeechMarkTypes:["ssml"]};Ci().readAloudElement=e,i.synthesizeSpeech(n,(a,s)=>{if(a){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${a}`);return}if(!(s!=null&&s.AudioStream)){console.log("polly.synthesizeSpeech():",s);return}const o=new TextDecoder("utf-8").decode(new Uint8Array(s.AudioStream));Ci().readAloudMarks=o.split(`
`).map(l=>l?JSON.parse(l):{}),Ci().readAloudTokens=[];for(const l of Ci().readAloudMarks)l.value&&Ci().readAloudTokens.push(l.value);Ci().readAloudCurrentMark="",n.OutputFormat="mp3",n.SpeechMarkTypes=[],i.synthesizeSpeech(n,(l,c)=>{if(l){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${t}") error:${l}`);return}if(!(c!=null&&c.AudioStream))return;const u=new Uint8Array(c.AudioStream),d=new Blob([u.buffer],{type:"audio/mpeg"}),h=URL.createObjectURL(d),f=Ci();f.readAloudAudio?f.readAloudAudio.pause():(f.readAloudAudio=new Audio,f.readAloudAudio.addEventListener("ended",()=>{const m=f.readAloudMathfield;f.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),m?(Gi(m),f.readAloudElement=null,f.readAloudMathfield=null,f.readAloudTokens=[],f.readAloudMarks=[],f.readAloudCurrentMark=""):bh(f.readAloudElement)}),f.readAloudAudio.addEventListener("timeupdate",()=>{let m="";const y=f.readAloudAudio.currentTime*1e3+100;for(const A of f.readAloudMarks)A.time<y&&(m=A.value);f.readAloudCurrentMark!==m&&(f.readAloudCurrentToken=m,m&&m===f.readAloudFinalToken?f.readAloudAudio.pause():(f.readAloudCurrentMark=m,Gl(f.readAloudElement,f.readAloudCurrentMark)))})),f.readAloudAudio.src=h,f.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),f.readAloudAudio.play()})})}Me()||console.error('MathLive 0.98.5: this version of the MathLive library is for use in the browser. A subset of the API is available on the server side in the "mathlive-ssr" library. If using server side rendering (with React for example) you may want to do a dynamic import of the MathLive library inside a `useEffect()` call.');var Y=new WeakMap,xg=.5,Si={letterShapeStyle:"mf.letterShapeStyle = ...",horizontalSpacingScale:'Removed. Use `"thinmuskip"`, `"medmuskip"`, and `"thickmuskip"` registers ',macros:"mf.macros = ...",registers:"mf.registers = ...",backgroundColorMap:"mf.backgroundColorMap = ...",colorMap:"mf.colorMap = ...",enablePopover:"mf.popoverPolicy = ...",mathModeSpace:"mf.mathModeSpace = ...",placeholderSymbol:"mf.placeholderSymbol = ...",readOnly:"mf.readOnly = ...",removeExtraneousParentheses:"mf.removeExtraneousParentheses = ...",scriptDepth:"mf.scriptDepth = ...",smartFence:"mf.smartFence = ...",smartMode:"mf.smartMode = ...",smartSuperscript:"mf.smartSuperscript = ...",inlineShortcutTimeout:"mf.inlineShortcutTimeout = ...",inlineShortcuts:"mf.inlineShortcuts = ...",keybindings:"mf.keybindings = ...",virtualKeyboardMode:"mf.mathVirtualKeyboardPolicy = ...",customVirtualKeyboardLayers:"mathVirtualKeyboard.layers = ...",customVirtualKeyboards:"mathVirtualKeyboard.layouts = ...",keypressSound:"mathVirtualKeyboard.keypressSound = ...",keypressVibration:"mathVirtualKeyboard.keypressVibration = ...",plonkSound:"mathVirtualKeyboard.plonkSound = ...",virtualKeyboardContainer:"mathVirtualKeyboard.container = ...",virtualKeyboardLayout:"mathVirtualKeyboard.alphabeticLayout = ...",virtualKeyboardTheme:"No longer supported",virtualKeyboardToggleGlyph:"No longer supported",virtualKeyboardToolbar:"mathVirtualKeyboard.editToolbar = ...",virtualKeyboards:"Use `mathVirtualKeyboard.layouts`",speechEngine:"`MathfieldElement.speechEngine`",speechEngineRate:"`MathfieldElement.speechEngineRate`",speechEngineVoice:"`MathfieldElement.speechEngineVoice`",textToSpeechMarkup:"`MathfieldElement.textToSpeechMarkup`",textToSpeechRules:"`MathfieldElement.textToSpeechRules`",textToSpeechRulesOptions:"`MathfieldElement.textToSpeechRulesOptions`",readAloudHook:"`MathfieldElement.readAloudHook`",speakHook:"`MathfieldElement.speakHook`",computeEngine:"`MathfieldElement.computeEngine`",fontsDirectory:"`MathfieldElement.fontsDirectory`",soundsDirectory:"`MathfieldElement.soundsDirectory`",createHTML:"`MathfieldElement.createHTML`",onExport:"`MathfieldElement.onExport`",onInlineShortcut:"`MathfieldElement.onInlineShortcut`",onScrollIntoView:"`MathfieldElement.onScrollIntoView`",locale:"MathfieldElement.locale = ...",strings:"MathfieldElement.strings = ...",decimalSeparator:"MathfieldElement.decimalSeparator = ...",fractionNavigationOrder:"MathfieldElement.fractionNavigationOrder = ..."},rt=class ln extends HTMLElement{static get formAssociated(){return In()}static get optionsAttributes(){return{"default-mode":"string","letter-shape-style":"string","min-font-scale":"number","popover-policy":"string","math-mode-space":"string","read-only":"boolean","remove-extraneous-parentheses":"on/off","smart-fence":"on/off","smart-mode":"on/off","smart-superscript":"on/off","inline-shortcut-timeout":"string","script-depth":"string",placeholder:"string","virtual-keyboard-target-origin":"string","math-virtual-keyboard-policy":"string"}}static get observedAttributes(){return[...Object.keys(this.optionsAttributes),"contenteditable","disabled","readonly","read-only"]}static get fontsDirectory(){return this._fontsDirectory}static set fontsDirectory(t){t!==this._fontsDirectory&&(this._fontsDirectory=t,lm())}get fontsDirectory(){throw new Error("Use MathfieldElement.fontsDirectory instead")}set fontsDirectory(t){throw new Error("Use MathfieldElement.fontsDirectory instead")}static get soundsDirectory(){return this._soundsDirectory}static set soundsDirectory(t){this._soundsDirectory=t,this.audioBuffers={}}get soundsDirectory(){throw new Error("Use MathfieldElement.soundsDirectory instead")}set soundsDirectory(t){throw new Error("Use MathfieldElement.soundsDirectory instead")}static get keypressSound(){return this._keypressSound}static set keypressSound(t){var r,i,n;this.audioBuffers={},t===null?this._keypressSound={spacebar:null,return:null,delete:null,default:null}:typeof t=="string"?this._keypressSound={spacebar:t,return:t,delete:t,default:t}:typeof t=="object"&&"default"in t&&(this._keypressSound={spacebar:(r=t.spacebar)!=null?r:t.default,return:(i=t.return)!=null?i:t.default,delete:(n=t.delete)!=null?n:t.default,default:t.default})}static get plonkSound(){return this._plonkSound}static set plonkSound(t){this.audioBuffers={},this._plonkSound=t}static get audioContext(){return this._audioContext||(this._audioContext=new AudioContext),this._audioContext}static get speechEngine(){return this._speechEngine}static set speechEngine(t){this._speechEngine=t}static get speechEngineRate(){return this._speechEngineRate}static set speechEngineRate(t){this._speechEngineRate=t}static get speechEngineVoice(){return this._speechEngineVoice}static set speechEngineVoice(t){this._speechEngineVoice=t}static get textToSpeechMarkup(){return this._textToSpeechMarkup}static set textToSpeechMarkup(t){this._textToSpeechMarkup=t}static get textToSpeechRules(){return this._textToSpeechRules}static set textToSpeechRules(t){this._textToSpeechRules=t}static get textToSpeechRulesOptions(){return this._textToSpeechRulesOptions}static set textToSpeechRulesOptions(t){this._textToSpeechRulesOptions=t}static get locale(){return N.locale}static set locale(t){t==="auto"&&(t=navigator.language.slice(0,5)),N.locale=t}get locale(){throw new Error("Use MathfieldElement.locale instead")}set locale(t){throw new Error("Use MathfieldElement.locale instead")}static get strings(){return N.strings}static set strings(t){N.merge(t)}get strings(){throw new Error("Use MathfieldElement.strings instead")}set strings(t){throw new Error("Use MathfieldElement.strings instead")}static get decimalSeparator(){return this._decimalSeparator}static set decimalSeparator(t){this._decimalSeparator=t,this._computeEngine&&(this._computeEngine.latexOptions.decimalMarker=this.decimalSeparator===","?"{,}":".")}get decimalSeparator(){throw new Error("Use MathfieldElement.decimalSeparator instead")}set decimalSeparator(t){throw new Error("Use MathfieldElement.decimalSeparator instead")}static get computeEngine(){var t,r;if(this._computeEngine===void 0){const i=(t=window[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:t.ComputeEngine;if(!i)return null;this._computeEngine=new i,this._computeEngine&&this.decimalSeparator===","&&(this._computeEngine.latexOptions.decimalMarker="{,}")}return(r=this._computeEngine)!=null?r:null}static set computeEngine(t){this._computeEngine=t}get computeEngine(){throw new Error("Use MathfieldElement.computeEngine instead")}set computeEngine(t){throw new Error("Use MathfieldElement.computeEngine instead")}static get isFunction(){return typeof this._isFunction!="function"?()=>!1:this._isFunction}static set isFunction(t){this._isFunction=t}static loadSound(t){return Ei(this,null,function*(){delete this.audioBuffers[t];let r="";switch(t){case"keypress":r=this._keypressSound.default;break;case"return":r=this._keypressSound.return;break;case"spacebar":r=this._keypressSound.spacebar;break;case"delete":r=this._keypressSound.delete;break;case"plonk":r=this.plonkSound;break}if(typeof r!="string")return;r=r.trim();const i=this.soundsDirectory;if(!(i==null||i==="null"||r==="none"||r==="null"))try{const a=yield(yield fetch(yield _d(`${i}/${r}`))).arrayBuffer(),s=yield this.audioContext.decodeAudioData(a);this.audioBuffers[t]=s}catch(n){}})}static playSound(t){return Ei(this,null,function*(){if((this.audioContext.state==="suspended"||this.audioContext.state==="interrupted")&&(yield this.audioContext.resume()),this.audioBuffers[t]||(yield this.loadSound(t)),!this.audioBuffers[t])return;const r=this.audioContext.createBufferSource();r.buffer=this.audioBuffers[t];const i=this.audioContext.createGain();i.gain.value=xg,r.connect(i).connect(this.audioContext.destination),r.start()})}constructor(t){if(super(),t){const r=[];for(const i of Object.keys(t))if(Si[i])if(Si[i].startsWith("mf."))if(Si[i].startsWith(`mf.${i}`))r.push(`Option \`${i}\` cannot be used as a constructor option. Use ${Si[i]}`);else{const n=Si[i].match(/([a-zA-Z]+) =/);r.push(`Option \`${i}\` has been renamed \`${n[1]}\``)}else r.push(`Option \`${i}\` cannot be used as a constructor option. Use ${Si[i]}`);if(r.length>0){console.group("%cMathLive 0.98.5: %cInvalid Options","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn("Some of the options passed to `new MathfieldElement(...)` are invalid. \n See https://cortexjs.io/mathlive/changelog/ for details.");for(const i of r)console.warn(i);console.groupEnd()}}if(In()&&(this._internals=this.attachInternals(),this._internals.role="math",this._internals.ariaLabel="math input field",this._internals.ariaMultiLine="false"),this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot&&"adoptedStyleSheets"in this.shadowRoot){this.shadowRoot.adoptedStyleSheets=[_n("core"),_n("mathfield"),_n("mathfield-element"),_n("ui"),_n("menu")],this.shadowRoot.appendChild(document.createElement("span"));const r=document.createElement("slot");r.style.display="none",this.shadowRoot.appendChild(r)}else this.shadowRoot.innerHTML="<style>"+Wi("core")+Wi("mathfield")+Wi("mathfield-element")+Wi("ui")+Wi("menu")+'</style><span></span><slot style="display:none"></slot>';t&&this._setOptions(t),this.shadowRoot.addEventListener("slotchange",()=>{var r;const i=this.shadowRoot.querySelector("slot:not([name])");this.value=(r=i==null?void 0:i.assignedNodes().map(n=>n.nodeType===3?n.textContent:"").join("").trim())!=null?r:""})}showMenu(t){var r,i;return(i=(r=this._mathfield)==null?void 0:r.showMenu(t))!=null?i:!1}get mathVirtualKeyboard(){throw new Error("The `mathVirtualKeyboard` property is not available on the MathfieldElement. Use `window.mathVirtualKeyboard` instead.")}onPointerDown(){window.addEventListener("pointerup",t=>{var r;t.target===this&&!((r=this._mathfield)!=null&&r.disabled)&&this.dispatchEvent(new MouseEvent("click",{altKey:t.altKey,button:t.button,buttons:t.buttons,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,metaKey:t.metaKey,movementX:t.movementX,movementY:t.movementY,relatedTarget:t.relatedTarget,screenX:t.screenX,screenY:t.screenY,shiftKey:t.shiftKey}))},{once:!0})}getPromptValue(t,r){var i,n;return(n=(i=this._mathfield)==null?void 0:i.getPromptValue(t,r))!=null?n:""}setPromptValue(t,r,i){var n;(n=this._mathfield)==null||n.setPromptValue(t,r,i)}getPromptRange(t){var r,i;return(i=(r=this._mathfield)==null?void 0:r.getPromptRange(t))!=null?i:null}getPrompts(t){var r,i;return(i=(r=this._mathfield)==null?void 0:r.getPrompts(t))!=null?i:[]}get form(){var t;return(t=this._internals)==null?void 0:t.form}get name(){var t;return(t=this.getAttribute("name"))!=null?t:""}get type(){return this.localName}get mode(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.model.mode)!=null?r:this.defaultMode==="text"?"text":"math"}set mode(t){var r;(r=this._mathfield)==null||r.switchMode(t)}get expression(){if(this._mathfield)return window[Symbol.for("io.cortexjs.compute-engine")]?this._mathfield.expression:(console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`),null)}set expression(t){var r,i;if(!this._mathfield)return;const n=(i=(r=ln.computeEngine)==null?void 0:r.box(t).latex)!=null?i:null;n!==null&&this._mathfield.setValue(n),window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}get errors(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.errors)!=null?r:[]}_getOptions(t){return this._mathfield?Qi(this._mathfield.options,t):Y.has(this)?p({},Qi(p(p({},to()),eo(Y.get(this).options)),t)):null}getOptions(t){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOptions()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._mathfield?Qi(this._mathfield.options,t):Y.has(this)?Qi(p(p({},to()),eo(Y.get(this).options)),t):null}reflectAttributes(){const t=to(),r=this._getOptions();Object.keys(ln.optionsAttributes).forEach(i=>{const n=ii(i);ln.optionsAttributes[i]==="on/off"?t[n]!==r[n]?this.setAttribute(i,r[n]?"on":"off"):this.removeAttribute(i):t[n]!==r[n]&&(ln.optionsAttributes[i]==="boolean"?r[n]?this.setAttribute(i,""):this.removeAttribute(i):(typeof r[n]=="string"||typeof r[n]=="number")&&this.setAttribute(i,r[n].toString()))})}getOption(t){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOption()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._getOptions([t])[t]}_getOption(t){return this._getOptions([t])[t]}_setOptions(t){if(this._mathfield)this._mathfield.setOptions(t);else if(Y.has(this)){const r=p(p({},Y.get(this).options),t);Y.set(this,g(p({},Y.get(this)),{selection:{ranges:r.readOnly?[[0,0]]:[[0,-1]]},options:r}))}else Y.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:t,menuItems:void 0});this.reflectAttributes()}setOptions(t){console.group("%cMathLive 0.98.5: %cDeprecated Usage","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn(" `mf.setOptions()` is deprecated. Set the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.");for(const r of Object.keys(t))Si[r]&&console.warn(`\`mf.setOptions({${r}:...})\` -> ${Si[r]}`);console.groupEnd(),this._setOptions(t)}executeCommand(t){var r,i;return(i=(r=this._mathfield)==null?void 0:r.executeCommand(t))!=null?i:!1}getValue(t,r,i){var n,a;if(this._mathfield)return this._mathfield.model.getValue(t,r,i);if(Y.has(this)){let s,o,l;if(Ls(t)?([s,o]=t.ranges[0],l=r):As(t)?([s,o]=t,l=r):vi(t)&&vi(r)?(s=t,o=r,l=i):(s=0,o=-1,l=t),(l===void 0||l==="latex")&&s===0&&o===-1)return(a=(n=Y.get(this).value)!=null?n:this.textContent)!=null?a:""}return""}setValue(t,r){if(this._mathfield&&t!==void 0){r!=null||(r={silenceNotifications:!0,mode:"math"}),this._mathfield.setValue(t,r);return}if(Y.has(this)){const n=Y.get(this).options;Y.set(this,{value:t,selection:{ranges:[[-1,-1]],direction:"forward"},options:n,menuItems:void 0});return}const i=Ia(this);Y.set(this,{value:t,selection:{ranges:[[-1,-1]],direction:"forward"},options:i,menuItems:void 0})}hasFocus(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.hasFocus())!=null?r:!1}focus(){var t;(t=this._mathfield)==null||t.focus()}blur(){var t;(t=this._mathfield)==null||t.blur()}select(){var t;(t=this._mathfield)==null||t.select()}insert(t,r){var i,n;return(n=(i=this._mathfield)==null?void 0:i.insert(t,r))!=null?n:!1}applyStyle(t,r){var i;return(i=this._mathfield)==null?void 0:i.applyStyle(t,r)}queryStyle(t){var r,i;return(i=(r=this._mathfield)==null?void 0:r.queryStyle(t))!=null?i:"none"}get caretPoint(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.getCaretPoint())!=null?r:null}set caretPoint(t){var r;t&&((r=this._mathfield)==null||r.setCaretPoint(t.x,t.y))}setCaretPoint(t,r){var i,n;return(n=(i=this._mathfield)==null?void 0:i.setCaretPoint(t,r))!=null?n:!1}offsetFromPoint(t,r,i){return this._mathfield?Ta(this._mathfield,t,r,i):-1}hitboxFromOffset(t){if(!this._mathfield)return null;const r=this._mathfield.model.at(t);if(!r)return null;const i=fa(this._mathfield,r);return i?new DOMRect(i.left,i.top,i.right-i.left,i.bottom-i.top):null}resetUndo(){var t;(t=this._mathfield)==null||t.resetUndo()}canUndo(){return this._mathfield?this._mathfield.canUndo():!1}canRedo(){return this._mathfield?this._mathfield.canRedo():!1}handleEvent(t){var r,i,n,a;Fr.state==="closed"&&((i=(r=this._mathfield)==null?void 0:r.menu)==null?void 0:i.state)==="closed"&&(t.type==="pointerdown"&&this.onPointerDown(),t.type==="focus"&&((n=this._mathfield)==null||n.focus()),t.type==="blur"&&((a=this._mathfield)==null||a.blur()))}connectedCallback(){var t,r,i,n;const a=window.getComputedStyle(this),s=this.shadowRoot,o=a.userSelect!=="none";if(o)s.host.addEventListener("pointerdown",this,!0);else{const u=s.querySelector("span");u.style.pointerEvents="none"}s.host.addEventListener("focus",this,!0),s.host.addEventListener("blur",this,!0),In()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),o&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const l=s.querySelector("slot:not([name])");if(l)try{this._style=l.assignedElements().filter(u=>u.tagName.toLowerCase()==="style").map(u=>u.textContent).join("")}catch(u){console.error(u)}if(this._style){const u=document.createElement("style");u.textContent=this._style,s.appendChild(u)}let c="";if(this.hasAttribute("value")?c=this.getAttribute("value"):c=(t=l==null?void 0:l.assignedNodes().map(u=>u.nodeType===3?u.textContent:"").join("").trim())!=null?t:"",this._mathfield=new vg(s.querySelector(":host > span"),g(p({},(i=(r=Y.get(this))==null?void 0:r.options)!=null?i:Ia(this)),{eventSink:this,value:c})),!Y.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const u of Object.keys(ln.optionsAttributes))this.upgradeProperty(ii(u))}if(!((n=this._mathfield)!=null&&n.model)){this._mathfield=null;return}if(Y.has(this)){const u=this._mathfield,d=Y.get(this),h=d.menuItems;u.model.deferNotifications({content:!1,selection:!1},()=>{const f=d.value;f!==void 0&&u.setValue(f),u.model.selection=d.selection,Y.delete(this)}),h&&(this.menuItems=h)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),Js()}disconnectedCallback(){var t,r;if(this.shadowRoot.host.removeEventListener("pointerdown",this,!0),!this._mathfield)return;window.queueMicrotask(()=>this.dispatchEvent(new Event("unmount",{cancelable:!1,bubbles:!0,composed:!0})));const i=Qi(this._mathfield.options,Object.keys(ln.optionsAttributes).map(n=>ii(n)));Y.set(this,{value:this._mathfield.getValue(),selection:this._mathfield.model.selection,menuItems:(r=(t=this._mathfield.menu)==null?void 0:t.menuItems)!=null?r:void 0,options:i}),this._mathfield.dispose(),this._mathfield=null}upgradeProperty(t){if(this.hasOwnProperty(t)){const r=this[t];delete this[t],(t==="readonly"||t==="read-only")&&(t="readOnly"),this[t]=r}}attributeChangedCallback(t,r,i){if(r===i)return;const n=i!==null;switch(t){case"contenteditable":Be(this._mathfield);break;case"disabled":this.disabled=n;break;case"read-only":case"readonly":this.readOnly=n;break;default:}}get readonly(){return this.hasAttribute("readonly")||this.hasAttribute("read-only")}set readonly(t){const r=!!t;r?(this.setAttribute("readonly",""),In()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(In()?this._internals.ariaReadOnly="false":this.removeAttribute("aria-readonly"),this.removeAttribute("readonly"),this.removeAttribute("read-only")),this._setOptions({readOnly:r})}get disabled(){return this.hasAttribute("disabled")}set disabled(t){var r;const i=!!t;i?this.setAttribute("disabled",""):this.removeAttribute("disabled"),In()?this._internals.ariaDisabled=i?"true":"false":this.setAttribute("aria-disabled",i?"true":"false"),i&&((r=this._mathfield)!=null&&r.hasFocus)&&window.mathVirtualKeyboard.visible&&this._mathfield.executeCommand("hideVirtualKeyboard")}get value(){return this.getValue()}set value(t){this.setValue(t)}get defaultMode(){return this._getOption("defaultMode")}set defaultMode(t){this._setOptions({defaultMode:t})}get macros(){return this._getOption("macros")}set macros(t){this._setOptions({macros:t})}get registers(){const t=this;return new Proxy({},{get:(r,i)=>{if(typeof i=="string")return t._getOption("registers")[i]},set(r,i,n){return typeof i!="string"?!1:(t._setOptions({registers:g(p({},t._getOption("registers")),{[i]:n})}),!0)}})}set registers(t){this._setOptions({registers:t})}get colorMap(){return this._getOption("colorMap")}set colorMap(t){this._setOptions({colorMap:t})}get backgroundColorMap(){return this._getOption("backgroundColorMap")}set backgroundColorMap(t){this._setOptions({backgroundColorMap:t})}get letterShapeStyle(){return this._getOption("letterShapeStyle")}set letterShapeStyle(t){this._setOptions({letterShapeStyle:t})}get minFontScale(){return this._getOption("minFontScale")}set minFontScale(t){this._setOptions({minFontScale:t})}get smartMode(){return this._getOption("smartMode")}set smartMode(t){this._setOptions({smartMode:t})}get smartFence(){return this._getOption("smartFence")}set smartFence(t){this._setOptions({smartFence:t})}get smartSuperscript(){return this._getOption("smartSuperscript")}set smartSuperscript(t){this._setOptions({smartSuperscript:t})}get scriptDepth(){return this._getOption("scriptDepth")}set scriptDepth(t){this._setOptions({scriptDepth:t})}get removeExtraneousParentheses(){return this._getOption("removeExtraneousParentheses")}set removeExtraneousParentheses(t){this._setOptions({removeExtraneousParentheses:t})}get mathModeSpace(){return this._getOption("mathModeSpace")}set mathModeSpace(t){this._setOptions({mathModeSpace:t})}get placeholderSymbol(){return this._getOption("placeholderSymbol")}set placeholderSymbol(t){this._setOptions({placeholderSymbol:t})}get popoverPolicy(){return this._getOption("popoverPolicy")}set popoverPolicy(t){this._setOptions({popoverPolicy:t})}get environmentPopoverPolicy(){return this._getOption("environmentPopoverPolicy")}set environmentPopoverPolicy(t){this._setOptions({environmentPopoverPolicy:t})}get menuItems(){var t,r,i;return this._mathfield?(t=this._mathfield.menu._menuItems.map(n=>n.menuItem))!=null?t:[]:(i=(r=Y.get(this))==null?void 0:r.menuItems)!=null?i:[]}set menuItems(t){var r;if(this._mathfield){const i=(r=this._mathfield.element)==null?void 0:r.querySelector("[part=menu-toggle]");i&&(i.style.display=t.length===0?"none":""),this._mathfield.menu.menuItems=t}Y.has(this)?Y.set(this,g(p({},Y.get(this)),{menuItems:t})):Y.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:Ia(this),menuItems:t})}get mathVirtualKeyboardPolicy(){return this._getOption("mathVirtualKeyboardPolicy")}set mathVirtualKeyboardPolicy(t){this._setOptions({mathVirtualKeyboardPolicy:t})}get inlineShortcuts(){return this._getOption("inlineShortcuts")}set inlineShortcuts(t){this._setOptions({inlineShortcuts:t})}get inlineShortcutTimeout(){return this._getOption("inlineShortcutTimeout")}set inlineShortcutTimeout(t){this._setOptions({inlineShortcutTimeout:t})}get keybindings(){return this._getOption("keybindings")}set keybindings(t){this._setOptions({keybindings:t})}get onInlineShortcut(){return this._getOption("onInlineShortcut")}set onInlineShortcut(t){this._setOptions({onInlineShortcut:t})}get onScrollIntoView(){return this._getOption("onScrollIntoView")}set onScrollIntoView(t){this._setOptions({onScrollIntoView:t})}get onExport(){return this._getOption("onExport")}set onExport(t){this._setOptions({onExport:t})}get readOnly(){return this._getOption("readOnly")}set readOnly(t){this._setOptions({readOnly:t})}get isSelectionEditable(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.isSelectionEditable)!=null?r:!1}setPromptState(t,r,i){var n;(n=this._mathfield)==null||n.setPromptState(t,r,i)}getPromptState(t){var r,i;return(i=(r=this._mathfield)==null?void 0:r.getPromptState(t))!=null?i:[void 0,!0]}get virtualKeyboardTargetOrigin(){return this._getOption("virtualKeyboardTargetOrigin")}set virtualKeyboardTargetOrigin(t){this._setOptions({virtualKeyboardTargetOrigin:t})}get selection(){return this._mathfield?this._mathfield.model.selection:Y.has(this)?Y.get(this).selection:{ranges:[[0,0]],direction:"forward"}}set selection(t){if(typeof t=="number"&&(t={ranges:[[t,t]]}),this._mathfield){this._mathfield.model.selection=t,Be(this._mathfield);return}if(Y.has(this)){Y.set(this,g(p({},Y.get(this)),{selection:t}));return}Y.set(this,{value:void 0,selection:t,options:Ia(this),menuItems:void 0})}get selectionIsCollapsed(){const t=this.selection;return t.ranges.length===1&&t.ranges[0][0]===t.ranges[0][1]}get position(){return this._mathfield?this._mathfield.model.position:Y.has(this)?Y.get(this).selection.ranges[0][0]:0}set position(t){if(this._mathfield&&(this._mathfield.model.position=t,Be(this._mathfield)),Y.has(this)){Y.set(this,g(p({},Y.get(this)),{selection:{ranges:[[t,t]]}}));return}Y.set(this,{value:void 0,selection:{ranges:[[t,t]]},options:Ia(this),menuItems:void 0})}getOffsetDepth(t){var r,i;return this._mathfield?((i=(r=this._mathfield.model.at(t))==null?void 0:r.treeDepth)!=null?i:2)-2:0}get lastOffset(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.model.lastOffset)!=null?r:-1}};rt.version="0.98.5",rt._fontsDirectory="./fonts",rt._soundsDirectory="./sounds",rt.keypressVibration=!0,rt._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},rt._plonkSound="plonk.wav",rt.audioBuffers={},rt.createHTML=e=>e,rt._speechEngineRate="100%",rt._speechEngineVoice="Joanna",rt._textToSpeechMarkup="",rt._textToSpeechRules="mathlive",rt._textToSpeechRulesOptions={},rt.speakHook=cg,rt.readAloudHook=yg,rt._decimalSeparator=".",rt.fractionNavigationOrder="numerator-denominator",rt._isFunction=e=>{var t,r;const i=window.MathfieldElement.computeEngine;return(r=(t=i==null?void 0:i.parse(e).domain)==null?void 0:t.isFunction)!=null?r:!1};var Oa=rt;function ii(e){return e.replace(/[^a-zA-Z\d]+(.)/g,(t,r)=>r.toUpperCase())}function Ia(e){const t={readOnly:!1},r=Oa.optionsAttributes;return Object.keys(r).forEach(i=>{if(e.hasAttribute(i)){const n=e.getAttribute(i);i==="placeholder"?t.contentPlaceholder=n!=null?n:"":r[i]==="boolean"?t[ii(i)]=!0:r[i]==="on/off"?n==="on"?t[ii(i)]=!0:n==="off"?t[ii(i)]=!1:t[ii(i)]=void 0:r[i]==="number"?t[ii(i)]=Number.parseFloat(n!=null?n:"0"):t[ii(i)]=n}}),t}function In(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var vh=Oa,yh,xh,_h,wh;if(Me()&&!((yh=window.customElements)!=null&&yh.get("math-field"))){(_h=window[xh=Symbol.for("io.cortexjs.mathlive")])!=null||(window[xh]={});const e=window[Symbol.for("io.cortexjs.mathlive")];e.version="0.98.5",window.MathfieldElement=Oa,(wh=window.customElements)==null||wh.define("math-field",Oa)}function _g(e,t,r){let i=r,n=0;const a=e.length;for(;i<t.length;){const s=t[i];if(n<=0&&t.slice(i,i+a)===e)return i;s==="\\"?i++:s==="{"?n++:s==="}"&&n--,i++}return-1}function yo(e,t,r,i,n="latex"){const a=[];for(const s of e)if(s.type==="text"){const o=s.data;let l=!0,c=0,u;u=o.indexOf(t),u!==-1&&(c=u,c>0&&a.push({type:"text",data:o.slice(0,c)}),l=!1);let d=!1;for(;!d;){if(l){if(u=o.indexOf(t,c),u===-1){d=!0;break}c!==u&&a.push({type:"text",data:o.slice(c,u)}),c=u}else{if(u=_g(r,o,c+t.length),u===-1){d=!0;break}let h=o.slice(c+t.length,u);n==="ascii-math"&&([,h]=Bs(h,{format:"ascii-math"})),a.push({type:"math",data:h,rawData:o.slice(c,u+r.length),mathstyle:i}),c=u+r.length}l=!l}c<o.length&&a.push({type:"text",data:o.slice(c)})}else a.push(s);return a}function kh(e,t,r){let i=[{type:"text",data:e}];return t!=null&&t.inline&&t.inline.forEach(([n,a])=>{i=yo(i,n,a,"textstyle")}),t!=null&&t.display&&t.display.forEach(([n,a])=>{i=yo(i,n,a,"displaystyle")}),r!=null&&r.inline&&r.inline.forEach(([n,a])=>{i=yo(i,n,a,"textstyle","ascii-math")}),r!=null&&r.display&&r.display.forEach(([n,a])=>{i=yo(i,n,a,"displaystyle","ascii-math")}),i}function wg(e,t){const r=document.createElement("span");r.setAttribute("translate","no");try{const i="<math xmlns='http://www.w3.org/1998/Math/MathML'>"+t.renderToMathML(e)+"</math>";r.innerHTML=window.MathfieldElement.createHTML(i)}catch(i){console.error(`MathLive 0.98.5: Could not convert "${e}"' to MathML with ${i}`),r.textContent=e}return r.className="ML__sr-only",r}function kg(e,t,r,i){try{const n=t.renderToMarkup(e,{mathstyle:r,format:"html"}),a=document.createElement("span");return a.dataset.latex=e,a.style.display=r==="displaystyle"?"flex":"inline-flex",a.setAttribute("aria-hidden","true"),a.setAttribute("translate","no"),a.innerHTML=window.MathfieldElement.createHTML(n),a}catch(n){if(console.error("Could not parse'"+e+"' with ",n),i)return document.createTextNode(e)}return null}function Rn(e,t,r,i){var n;const a=kg(e,r,t||"textstyle",i),s=(n=r.renderAccessibleContent)!=null?n:"";if(a&&/\b(mathml|speakable-text)\b/i.test(s)){const o=document.createElement("span");if(/\bmathml\b/i.test(s)&&r.renderToMathML&&o.append(wg(e,r)),/\bspeakable-text\b/i.test(s)&&r.renderToSpeakableText){const l=document.createElement("span");l.setAttribute("translate","no");const c=r.renderToSpeakableText(e);l.innerHTML=window.MathfieldElement.createHTML(c),l.className="ML__sr-only",o.append(l)}return o.append(a),o}return a}function Mg(e,t){var r,i,n;let a=null;if((r=t.TeX)!=null&&r.processEnvironments&&/^\s*\\begin/.test(e)){a=document.createDocumentFragment();const s=Rn(e,"",t,!0);s&&a.appendChild(s)}else{if(!e.trim())return null;const s=kh(e,(i=t.TeX)==null?void 0:i.delimiters,(n=t.asciiMath)==null?void 0:n.delimiters);if(s.length===1&&s[0].type==="text")return null;a=document.createDocumentFragment();for(const o of s)if(o.type==="text")a.appendChild(document.createTextNode(o.data));else{const l=Rn(o.data,o.mathstyle==="textstyle"?"textstyle":"displaystyle",t,!0);l&&a.appendChild(l)}}return a}function Mh(e,t){var r,i,n,a,s,o,l,c,u,d,h,f,m,y,A,v;if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){const S=(r=e.childNodes[0].textContent)!=null?r:"";if((i=t.TeX)!=null&&i.processEnvironments&&/^\s*\\begin/.test(S)){e.textContent="";const C=Rn(S,"",t,!0);C&&e.append(C);return}const L=kh(S,(n=t.TeX)==null?void 0:n.delimiters,(a=t.asciiMath)==null?void 0:a.delimiters);if(L.length===1&&L[0].type==="math"){e.textContent="";const C=Rn(L[0].data,L[0].mathstyle==="textstyle"?"textstyle":"displaystyle",t,!0);C&&e.append(C);return}if(L.length===1&&L[0].type==="text")return}for(let S=e.childNodes.length-1;S>=0;S--){const L=e.childNodes[S];if(L.nodeType===3){const C=Mg((s=L.textContent)!=null?s:"",t);C&&(S+=C.childNodes.length-1,L.replaceWith(C))}else if(L.nodeType===1){const C=L,z=L.nodeName.toLowerCase();if(z==="script"){const I=L;let O;if((o=t.processScriptTypePattern)!=null&&o.test(I.type))O=(l=I.textContent)!=null?l:"";else if((c=t.processMathJSONScriptTypePattern)!=null&&c.test(I.type))try{O=(d=t.serializeToLatex)==null?void 0:d.call(t,JSON.parse((u=I.textContent)!=null?u:""))}catch(U){console.error(U)}if(O){let U="textstyle";for(const T of I.type.split(";")){const[$t,Ir]=T.toLowerCase().split("=");$t.trim()==="mode"&&(U=Ir.trim()==="display"?"displaystyle":"textstyle")}const oe=Rn(O,U,t,!0);oe&&I.parentNode.replaceChild(oe,I)}}else if(((f=(h=t.processClassPattern)==null?void 0:h.test(C.className))!=null?f:!1)||!((y=(m=t.skipTags)==null?void 0:m.includes(z))!=null&&y||(v=(A=t.ignoreClassPattern)==null?void 0:A.test(C.className))!=null&&v))if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){const O=e.textContent;e.textContent="";const U=Rn(O!=null?O:"","displaystyle",t,!0);U&&e.append(U)}else Mh(C,t)}}}var Sg={skipTags:["math-field","noscript","style","textarea","pre","code","annotation","annotation-xml"],processScriptType:"math/tex",processMathJSONScriptType:"math/json",ignoreClass:"tex2jax_ignore",processClass:"tex2jax_process",renderAccessibleContent:"mathml",asciiMath:{delimiters:{inline:[["`","`"]]}},TeX:{processEnvironments:!0,delimiters:{inline:[["\\(","\\)"]],display:[["$$","$$"],["\\[","\\]"]]}}};function Cg(e,t){var r,i,n,a;try{const s=p(p({},Sg),t);s.ignoreClassPattern=new RegExp((r=s.ignoreClass)!=null?r:""),s.processClassPattern=new RegExp((i=s.processClass)!=null?i:""),s.processScriptTypePattern=new RegExp((n=s.processScriptType)!=null?n:""),s.processMathJSONScriptTypePattern=new RegExp((a=s.processMathJSONScriptType)!=null?a:""),Js(),ei("core"),Mh(e,s)}catch(s){s instanceof Error?console.error("renderMathInElement(): "+s.message):console.error("renderMathInElement(): Could not render math for element",e)}}function Eg(e,t){const r=ki.singleton;return r?(r.show(),Ea(),r.currentLayer=t,r.render(),r.focus(),!0):!1}function Ag(){const e=window.mathVirtualKeyboard;return e.visible?e.hide({animate:!0}):e.show({animate:!0}),!1}It({switchKeyboardLayer:Eg,toggleVirtualKeyboard:Ag,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function Ci(){var e,t;return(t=globalThis[e=Symbol.for("io.cortexjs.mathlive")])!=null||(globalThis[e]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}function Kg(){return console.warn("%cMathLive 0.98.5: %cmakeSharedVirtualKeyboard() is deprecated. \n Use `window.mathVirtualKeyboard` to access the virtual keyboard instance.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),window.mathVirtualKeyboard}function Ng(e){Bg(document.body,e)}function Lg(e){if(typeof e=="string"){const t=document.getElementById(e);if(t===null)throw new Error(`The element with ID "${e}" could not be found.`);return t}return typeof e=="string"?null:e}function Bg(e,t){var r,i,n,a;const s=Lg(e);if(!s)return;const o=t!=null?t:{};(r=o.renderToMarkup)!=null||(o.renderToMarkup=Je),(i=o.renderToMathML)!=null||(o.renderToMathML=V1),(n=o.renderToSpeakableText)!=null||(o.renderToSpeakableText=H1),(a=o.serializeToLatex)!=null||(o.serializeToLatex=j1),Cg(s,o)}var Og={mathlive:"0.98.5"}}}]);
}());