discourse_math_bundle 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/discourse_math_bundle/version.rb +7 -0
- data/lib/discourse_math_bundle.rb +55 -0
- data/vendor/assets/katex/contrib/copy-tex.min.js +1 -0
- data/vendor/assets/katex/contrib/mhchem.min.js +1 -0
- data/vendor/assets/katex/fonts/KaTeX_AMS-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Main-Bold.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Main-Italic.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Main-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Math-Italic.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Script-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Size1-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Size2-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Size3-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Size4-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- data/vendor/assets/katex/katex.min.css +1 -0
- data/vendor/assets/katex/katex.min.js +1 -0
- data/vendor/assets/mathjax/a11y/assistive-mml.js +1 -0
- data/vendor/assets/mathjax/a11y/complexity.js +1 -0
- data/vendor/assets/mathjax/a11y/explorer.js +1 -0
- data/vendor/assets/mathjax/a11y/semantic-enrich.js +1 -0
- data/vendor/assets/mathjax/a11y/speech.js +1 -0
- data/vendor/assets/mathjax/a11y/sre.js +1 -0
- data/vendor/assets/mathjax/adaptors/jsdom.js +1 -0
- data/vendor/assets/mathjax/adaptors/linkedom.js +1 -0
- data/vendor/assets/mathjax/adaptors/liteDOM.js +1 -0
- data/vendor/assets/mathjax/core.js +1 -0
- data/vendor/assets/mathjax/input/asciimath.js +1 -0
- data/vendor/assets/mathjax/input/mml/entities.js +1 -0
- data/vendor/assets/mathjax/input/mml/extensions/mml3.js +1 -0
- data/vendor/assets/mathjax/input/mml/extensions/mml3.sef.json +1 -0
- data/vendor/assets/mathjax/input/mml.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/action.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/ams.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/amscd.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/autoload.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/bbm.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/bboldx.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/bbox.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/begingroup.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/boldsymbol.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/braket.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/bussproofs.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/cancel.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/cases.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/centernot.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/color.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/colortbl.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/colorv2.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/configmacros.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/dsfont.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/empheq.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/enclose.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/extpfeil.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/gensymb.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/html.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/mathtools.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/mhchem.js +34 -0
- data/vendor/assets/mathjax/input/tex/extensions/newcommand.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/noerrors.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/noundefined.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/physics.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/require.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/setoptions.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/tagformat.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/texhtml.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/textcomp.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/textmacros.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/unicode.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/units.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/upgreek.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/verb.js +1 -0
- data/vendor/assets/mathjax/input/tex-base.js +1 -0
- data/vendor/assets/mathjax/input/tex.js +1 -0
- data/vendor/assets/mathjax/loader.js +1 -0
- data/vendor/assets/mathjax/mml-chtml-nofont.js +1 -0
- data/vendor/assets/mathjax/mml-chtml.js +1 -0
- data/vendor/assets/mathjax/mml-svg-nofont.js +1 -0
- data/vendor/assets/mathjax/mml-svg.js +1 -0
- data/vendor/assets/mathjax/output/chtml.js +1 -0
- data/vendor/assets/mathjax/output/svg.js +1 -0
- data/vendor/assets/mathjax/sre/mathmaps/af.json +146 -0
- data/vendor/assets/mathjax/sre/mathmaps/base.json +137 -0
- data/vendor/assets/mathjax/sre/mathmaps/ca.json +140 -0
- data/vendor/assets/mathjax/sre/mathmaps/da.json +140 -0
- data/vendor/assets/mathjax/sre/mathmaps/de.json +146 -0
- data/vendor/assets/mathjax/sre/mathmaps/en.json +158 -0
- data/vendor/assets/mathjax/sre/mathmaps/es.json +140 -0
- data/vendor/assets/mathjax/sre/mathmaps/euro.json +32 -0
- data/vendor/assets/mathjax/sre/mathmaps/fr.json +146 -0
- data/vendor/assets/mathjax/sre/mathmaps/hi.json +146 -0
- data/vendor/assets/mathjax/sre/mathmaps/it.json +146 -0
- data/vendor/assets/mathjax/sre/mathmaps/ko.json +146 -0
- data/vendor/assets/mathjax/sre/mathmaps/nb.json +146 -0
- data/vendor/assets/mathjax/sre/mathmaps/nemeth.json +125 -0
- data/vendor/assets/mathjax/sre/mathmaps/nn.json +146 -0
- data/vendor/assets/mathjax/sre/mathmaps/sv.json +146 -0
- data/vendor/assets/mathjax/sre/require.d.mts +1 -0
- data/vendor/assets/mathjax/sre/require.mjs +2 -0
- data/vendor/assets/mathjax/sre/speech-worker.js +1 -0
- data/vendor/assets/mathjax/startup.js +1 -0
- data/vendor/assets/mathjax/tex-chtml-nofont.js +1 -0
- data/vendor/assets/mathjax/tex-chtml.js +1 -0
- data/vendor/assets/mathjax/tex-mml-chtml-nofont.js +1 -0
- data/vendor/assets/mathjax/tex-mml-chtml.js +1 -0
- data/vendor/assets/mathjax/tex-mml-svg-nofont.js +1 -0
- data/vendor/assets/mathjax/tex-mml-svg.js +1 -0
- data/vendor/assets/mathjax/tex-svg-nofont.js +1 -0
- data/vendor/assets/mathjax/tex-svg.js +1 -0
- data/vendor/assets/mathjax/ui/lazy.js +1 -0
- data/vendor/assets/mathjax/ui/menu.js +1 -0
- data/vendor/assets/mathjax/ui/safe.js +1 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ab.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-abi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ai.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ar.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-arl.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-b-a.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-b.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-bi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-br.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-brd.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-brk.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-c.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ch.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-chb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-chbi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-chi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cy.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cybi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyss.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyssb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyssbi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyssi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ds.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-dv.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-em.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-f.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-fb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-gk.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkbi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-gki.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkss.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkssb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkssbi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkssi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-he.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-heb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-hebi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-hei.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-i.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-lb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-li.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-lib.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-lo.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-lr.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-lt.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-m.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-mar.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-mi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ml.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-mm.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-msh.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-mx.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-n.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ob.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-os.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ph.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-phb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-phbi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-phi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-phss.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-phssb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-phssbi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-phssi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-pu.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-pub.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-pubi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-pui.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-rb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-s.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-s3.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-s4.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-s5.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-s6.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-s7.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-sb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-sh.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-shb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-shbi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-shi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-so.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ss.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssbi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssbix.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssbx.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssix.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-sslb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssli.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-sslib.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-sslr.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssx.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-sy.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-syb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-sybi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-syi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-u-a.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-u.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-v.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-vx.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-zero.woff2 +0 -0
- metadata +304 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var __webpack_modules__={159:(t,e,s)=>{"use strict";var i=s(870).freeze;e.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),e.HTML_ENTITIES=i({Aacute:"\xc1",aacute:"\xe1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223e",acd:"\u223f",acE:"\u223e\u0333",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",Acy:"\u0410",acy:"\u0430",AElig:"\xc6",aelig:"\xe6",af:"\u2061",Afr:"\u{1d504}",afr:"\u{1d51e}",Agrave:"\xc0",agrave:"\xe0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03b1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2a3f",AMP:"&",amp:"&",And:"\u2a53",and:"\u2227",andand:"\u2a55",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",ange:"\u29a4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angst:"\xc5",angzarr:"\u237c",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1d538}",aopf:"\u{1d552}",ap:"\u2248",apacir:"\u2a6f",apE:"\u2a70",ape:"\u224a",apid:"\u224b",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224a",Aring:"\xc5",aring:"\xe5",Ascr:"\u{1d49c}",ascr:"\u{1d4b6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224d",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",awconint:"\u2233",awint:"\u2a11",backcong:"\u224c",backepsilon:"\u03f6",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",Backslash:"\u2216",Barv:"\u2ae7",barvee:"\u22bd",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23b5",bbrktbrk:"\u23b6",bcong:"\u224c",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201e",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29b0",bepsi:"\u03f6",bernou:"\u212c",Bernoullis:"\u212c",Beta:"\u0392",beta:"\u03b2",beth:"\u2136",between:"\u226c",Bfr:"\u{1d505}",bfr:"\u{1d51f}",bigcap:"\u22c2",bigcirc:"\u25ef",bigcup:"\u22c3",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",bigvee:"\u22c1",bigwedge:"\u22c0",bkarow:"\u290d",blacklozenge:"\u29eb",blacksquare:"\u25aa",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20e5",bnequiv:"\u2261\u20e5",bNot:"\u2aed",bnot:"\u2310",Bopf:"\u{1d539}",bopf:"\u{1d553}",bot:"\u22a5",bottom:"\u22a5",bowtie:"\u22c8",boxbox:"\u29c9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250c",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252c",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxUL:"\u255d",boxUl:"\u255c",boxuL:"\u255b",boxul:"\u2518",boxUR:"\u255a",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256c",boxVh:"\u256b",boxvH:"\u256a",boxvh:"\u253c",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255f",boxvR:"\u255e",boxvr:"\u251c",bprime:"\u2035",Breve:"\u02d8",breve:"\u02d8",brvbar:"\xa6",Bscr:"\u212c",bscr:"\u{1d4b7}",bsemi:"\u204f",bsim:"\u223d",bsime:"\u22cd",bsol:"\\",bsolb:"\u29c5",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bump:"\u224e",bumpE:"\u2aae",bumpe:"\u224f",Bumpeq:"\u224e",bumpeq:"\u224f",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22d2",cap:"\u2229",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",capcup:"\u2a47",capdot:"\u2a40",CapitalDifferentialD:"\u2145",caps:"\u2229\ufe00",caret:"\u2041",caron:"\u02c7",Cayleys:"\u212d",ccaps:"\u2a4d",Ccaron:"\u010c",ccaron:"\u010d",Ccedil:"\xc7",ccedil:"\xe7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2a4c",ccupssm:"\u2a50",Cdot:"\u010a",cdot:"\u010b",cedil:"\xb8",Cedilla:"\xb8",cemptyv:"\u29b2",cent:"\xa2",CenterDot:"\xb7",centerdot:"\xb7",Cfr:"\u212d",cfr:"\u{1d520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03a7",chi:"\u03c7",cir:"\u25cb",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",CircleDot:"\u2299",circledR:"\xae",circledS:"\u24c8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29c3",cire:"\u2257",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201d",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2a74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2a6d",Congruent:"\u2261",Conint:"\u222f",conint:"\u222e",ContourIntegral:"\u222e",Copf:"\u2102",copf:"\u{1d554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xa9",copy:"\xa9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21b5",Cross:"\u2a2f",cross:"\u2717",Cscr:"\u{1d49e}",cscr:"\u{1d4b8}",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cularrp:"\u293d",Cup:"\u22d3",cup:"\u222a",cupbrcap:"\u2a48",CupCap:"\u224d",cupcap:"\u2a46",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curarrm:"\u293c",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",curlyvee:"\u22ce",curlywedge:"\u22cf",curren:"\xa4",curvearrowleft:"\u21b6",curvearrowright:"\u21b7",cuvee:"\u22ce",cuwed:"\u22cf",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232d",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21a1",dArr:"\u21d3",darr:"\u2193",dash:"\u2010",Dashv:"\u2ae4",dashv:"\u22a3",dbkarow:"\u290f",dblac:"\u02dd",Dcaron:"\u010e",dcaron:"\u010f",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21ca",DDotrahd:"\u2911",ddotseq:"\u2a77",deg:"\xb0",Del:"\u2207",Delta:"\u0394",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",Dfr:"\u{1d507}",dfr:"\u{1d521}",dHar:"\u2965",dharl:"\u21c3",dharr:"\u21c2",DiacriticalAcute:"\xb4",DiacriticalDot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",DiacriticalGrave:"`",DiacriticalTilde:"\u02dc",diam:"\u22c4",Diamond:"\u22c4",diamond:"\u22c4",diamondsuit:"\u2666",diams:"\u2666",die:"\xa8",DifferentialD:"\u2146",digamma:"\u03dd",disin:"\u22f2",div:"\xf7",divide:"\xf7",divideontimes:"\u22c7",divonx:"\u22c7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231e",dlcrop:"\u230d",dollar:"$",Dopf:"\u{1d53b}",dopf:"\u{1d555}",Dot:"\xa8",dot:"\u02d9",DotDot:"\u20dc",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22a1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222f",DoubleDot:"\xa8",DoubleDownArrow:"\u21d3",DoubleLeftArrow:"\u21d0",DoubleLeftRightArrow:"\u21d4",DoubleLeftTee:"\u2ae4",DoubleLongLeftArrow:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",DoubleLongRightArrow:"\u27f9",DoubleRightArrow:"\u21d2",DoubleRightTee:"\u22a8",DoubleUpArrow:"\u21d1",DoubleUpDownArrow:"\u21d5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21d3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21f5",DownBreve:"\u0311",downdownarrows:"\u21ca",downharpoonleft:"\u21c3",downharpoonright:"\u21c2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVector:"\u21bd",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295f",DownRightVector:"\u21c1",DownRightVectorBar:"\u2957",DownTee:"\u22a4",DownTeeArrow:"\u21a7",drbkarow:"\u2910",drcorn:"\u231f",drcrop:"\u230c",Dscr:"\u{1d49f}",dscr:"\u{1d4b9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29f6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf",dtrif:"\u25be",duarr:"\u21f5",duhar:"\u296f",dwangle:"\u29a6",DZcy:"\u040f",dzcy:"\u045f",dzigrarr:"\u27ff",Eacute:"\xc9",eacute:"\xe9",easter:"\u2a6e",Ecaron:"\u011a",ecaron:"\u011b",ecir:"\u2256",Ecirc:"\xca",ecirc:"\xea",ecolon:"\u2255",Ecy:"\u042d",ecy:"\u044d",eDDot:"\u2a77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1d508}",efr:"\u{1d522}",eg:"\u2a9a",Egrave:"\xc8",egrave:"\xe8",egs:"\u2a96",egsdot:"\u2a98",el:"\u2a99",Element:"\u2208",elinters:"\u23e7",ell:"\u2113",els:"\u2a95",elsdot:"\u2a97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25fb",emptyv:"\u2205",EmptyVerySmallSquare:"\u25ab",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014a",eng:"\u014b",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1d53c}",eopf:"\u{1d556}",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",Epsilon:"\u0395",epsilon:"\u03b5",epsiv:"\u03f5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2a96",eqslantless:"\u2a95",Equal:"\u2a75",equals:"=",EqualTilde:"\u2242",equest:"\u225f",Equilibrium:"\u21cc",equiv:"\u2261",equivDD:"\u2a78",eqvparsl:"\u29e5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212f",esdot:"\u2250",Esim:"\u2a73",esim:"\u2242",Eta:"\u0397",eta:"\u03b7",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",euro:"\u20ac",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",Ffr:"\u{1d509}",ffr:"\u{1d523}",filig:"\ufb01",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",Fopf:"\u{1d53d}",fopf:"\u{1d557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22d4",forkv:"\u2ad9",Fouriertrf:"\u2131",fpartint:"\u2a0d",frac12:"\xbd",frac13:"\u2153",frac14:"\xbc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156",frac34:"\xbe",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1d4bb}",gacute:"\u01f5",Gamma:"\u0393",gamma:"\u03b3",Gammad:"\u03dc",gammad:"\u03dd",gap:"\u2a86",Gbreve:"\u011e",gbreve:"\u011f",Gcedil:"\u0122",Gcirc:"\u011c",gcirc:"\u011d",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2a8c",gel:"\u22db",geq:"\u2265",geqq:"\u2267",geqslant:"\u2a7e",ges:"\u2a7e",gescc:"\u2aa9",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",Gfr:"\u{1d50a}",gfr:"\u{1d524}",Gg:"\u22d9",gg:"\u226b",ggg:"\u22d9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2aa5",glE:"\u2a92",glj:"\u2aa4",gnap:"\u2a8a",gnapprox:"\u2a8a",gnE:"\u2269",gne:"\u2a88",gneq:"\u2a88",gneqq:"\u2269",gnsim:"\u22e7",Gopf:"\u{1d53e}",gopf:"\u{1d558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterGreater:"\u2aa2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Gscr:"\u{1d4a2}",gscr:"\u210a",gsim:"\u2273",gsime:"\u2a8e",gsiml:"\u2a90",Gt:"\u226b",GT:">",gt:">",gtcc:"\u2aa7",gtcir:"\u2a7a",gtdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrapprox:"\u2a86",gtrarr:"\u2978",gtrdot:"\u22d7",gtreqless:"\u22db",gtreqqless:"\u2a8c",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",Hacek:"\u02c7",hairsp:"\u200a",half:"\xbd",hamilt:"\u210b",HARDcy:"\u042a",hardcy:"\u044a",hArr:"\u21d4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21ad",Hat:"^",hbar:"\u210f",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22b9",Hfr:"\u210c",hfr:"\u{1d525}",HilbertSpace:"\u210b",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",Hopf:"\u210d",hopf:"\u{1d559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210b",hscr:"\u{1d4bd}",hslash:"\u210f",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224e",HumpEqual:"\u224f",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xcd",iacute:"\xed",ic:"\u2063",Icirc:"\xce",icirc:"\xee",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xa1",iff:"\u21d4",Ifr:"\u2111",ifr:"\u{1d526}",Igrave:"\xcc",igrave:"\xec",ii:"\u2148",iiiint:"\u2a0c",iiint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012a",imacr:"\u012b",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22b7",imped:"\u01b5",Implies:"\u21d2",in:"\u2208",incare:"\u2105",infin:"\u221e",infintie:"\u29dd",inodot:"\u0131",Int:"\u222c",int:"\u222b",intcal:"\u22ba",integers:"\u2124",Integral:"\u222b",intercal:"\u22ba",Intersection:"\u22c2",intlarhk:"\u2a17",intprod:"\u2a3c",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012e",iogon:"\u012f",Iopf:"\u{1d540}",iopf:"\u{1d55a}",Iota:"\u0399",iota:"\u03b9",iprod:"\u2a3c",iquest:"\xbf",Iscr:"\u2110",iscr:"\u{1d4be}",isin:"\u2208",isindot:"\u22f5",isinE:"\u22f9",isins:"\u22f4",isinsv:"\u22f3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xcf",iuml:"\xef",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1d50d}",jfr:"\u{1d527}",jmath:"\u0237",Jopf:"\u{1d541}",jopf:"\u{1d55b}",Jscr:"\u{1d4a5}",jscr:"\u{1d4bf}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039a",kappa:"\u03ba",kappav:"\u03f0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041a",kcy:"\u043a",Kfr:"\u{1d50e}",kfr:"\u{1d528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040c",kjcy:"\u045c",Kopf:"\u{1d542}",kopf:"\u{1d55c}",Kscr:"\u{1d4a6}",kscr:"\u{1d4c0}",lAarr:"\u21da",Lacute:"\u0139",lacute:"\u013a",laemptyv:"\u29b4",lagran:"\u2112",Lambda:"\u039b",lambda:"\u03bb",Lang:"\u27ea",lang:"\u27e8",langd:"\u2991",langle:"\u27e8",lap:"\u2a85",Laplacetrf:"\u2112",laquo:"\xab",Larr:"\u219e",lArr:"\u21d0",larr:"\u2190",larrb:"\u21e4",larrbfs:"\u291f",larrfs:"\u291d",larrhk:"\u21a9",larrlp:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",lat:"\u2aab",lAtail:"\u291b",latail:"\u2919",late:"\u2aad",lates:"\u2aad\ufe00",lBarr:"\u290e",lbarr:"\u290c",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",Lcaron:"\u013d",lcaron:"\u013e",Lcedil:"\u013b",lcedil:"\u013c",lceil:"\u2308",lcub:"{",Lcy:"\u041b",lcy:"\u043b",ldca:"\u2936",ldquo:"\u201c",ldquor:"\u201e",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27e8",LeftArrow:"\u2190",Leftarrow:"\u21d0",leftarrow:"\u2190",LeftArrowBar:"\u21e4",LeftArrowRightArrow:"\u21c6",leftarrowtail:"\u21a2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21c3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230a",leftharpoondown:"\u21bd",leftharpoonup:"\u21bc",leftleftarrows:"\u21c7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21d4",leftrightarrow:"\u2194",leftrightarrows:"\u21c6",leftrightharpoons:"\u21cb",leftrightsquigarrow:"\u21ad",LeftRightVector:"\u294e",LeftTee:"\u22a3",LeftTeeArrow:"\u21a4",LeftTeeVector:"\u295a",leftthreetimes:"\u22cb",LeftTriangle:"\u22b2",LeftTriangleBar:"\u29cf",LeftTriangleEqual:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21bf",LeftUpVectorBar:"\u2958",LeftVector:"\u21bc",LeftVectorBar:"\u2952",lEg:"\u2a8b",leg:"\u22da",leq:"\u2264",leqq:"\u2266",leqslant:"\u2a7d",les:"\u2a7d",lescc:"\u2aa8",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessapprox:"\u2a85",lessdot:"\u22d6",lesseqgtr:"\u22da",lesseqqgtr:"\u2a8b",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2aa1",lesssim:"\u2272",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",lfisht:"\u297c",lfloor:"\u230a",Lfr:"\u{1d50f}",lfr:"\u{1d529}",lg:"\u2276",lgE:"\u2a91",lHar:"\u2962",lhard:"\u21bd",lharu:"\u21bc",lharul:"\u296a",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22d8",ll:"\u226a",llarr:"\u21c7",llcorner:"\u231e",Lleftarrow:"\u21da",llhard:"\u296b",lltri:"\u25fa",Lmidot:"\u013f",lmidot:"\u0140",lmoust:"\u23b0",lmoustache:"\u23b0",lnap:"\u2a89",lnapprox:"\u2a89",lnE:"\u2268",lne:"\u2a87",lneq:"\u2a87",lneqq:"\u2268",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",lobrk:"\u27e6",LongLeftArrow:"\u27f5",Longleftarrow:"\u27f8",longleftarrow:"\u27f5",LongLeftRightArrow:"\u27f7",Longleftrightarrow:"\u27fa",longleftrightarrow:"\u27f7",longmapsto:"\u27fc",LongRightArrow:"\u27f6",Longrightarrow:"\u27f9",longrightarrow:"\u27f6",looparrowleft:"\u21ab",looparrowright:"\u21ac",lopar:"\u2985",Lopf:"\u{1d543}",lopf:"\u{1d55d}",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25ca",lozenge:"\u25ca",lozf:"\u29eb",lpar:"(",lparlt:"\u2993",lrarr:"\u21c6",lrcorner:"\u231f",lrhar:"\u21cb",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1d4c1}",Lsh:"\u21b0",lsh:"\u21b0",lsim:"\u2272",lsime:"\u2a8d",lsimg:"\u2a8f",lsqb:"[",lsquo:"\u2018",lsquor:"\u201a",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226a",LT:"<",lt:"<",ltcc:"\u2aa6",ltcir:"\u2a79",ltdot:"\u22d6",lthree:"\u22cb",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltri:"\u25c3",ltrie:"\u22b4",ltrif:"\u25c2",ltrPar:"\u2996",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",macr:"\xaf",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21a6",mapsto:"\u21a6",mapstodown:"\u21a7",mapstoleft:"\u21a4",mapstoup:"\u21a5",marker:"\u25ae",mcomma:"\u2a29",Mcy:"\u041c",mcy:"\u043c",mdash:"\u2014",mDDot:"\u223a",measuredangle:"\u2221",MediumSpace:"\u205f",Mellintrf:"\u2133",Mfr:"\u{1d510}",mfr:"\u{1d52a}",mho:"\u2127",micro:"\xb5",mid:"\u2223",midast:"*",midcir:"\u2af0",middot:"\xb7",minus:"\u2212",minusb:"\u229f",minusd:"\u2238",minusdu:"\u2a2a",MinusPlus:"\u2213",mlcp:"\u2adb",mldr:"\u2026",mnplus:"\u2213",models:"\u22a7",Mopf:"\u{1d544}",mopf:"\u{1d55e}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1d4c2}",mstpos:"\u223e",Mu:"\u039c",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20d2",nap:"\u2249",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266e",natural:"\u266e",naturals:"\u2115",nbsp:"\xa0",nbump:"\u224e\u0338",nbumpe:"\u224f\u0338",ncap:"\u2a43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2a6d\u0338",ncup:"\u2a42",Ncy:"\u041d",ncy:"\u043d",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21d7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NewLine:"\n",nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1d511}",nfr:"\u{1d52b}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",nGg:"\u22d9\u0338",ngsim:"\u2275",nGt:"\u226b\u20d2",ngt:"\u226f",ngtr:"\u226f",nGtv:"\u226b\u0338",nhArr:"\u21ce",nharr:"\u21ae",nhpar:"\u2af2",ni:"\u220b",nis:"\u22fc",nisd:"\u22fa",niv:"\u220b",NJcy:"\u040a",njcy:"\u045a",nlArr:"\u21cd",nlarr:"\u219a",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21cd",nleftarrow:"\u219a",nLeftrightarrow:"\u21ce",nleftrightarrow:"\u21ae",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2a7d\u0338",nles:"\u2a7d\u0338",nless:"\u226e",nLl:"\u22d8\u0338",nlsim:"\u2274",nLt:"\u226a\u20d2",nlt:"\u226e",nltri:"\u22ea",nltrie:"\u22ec",nLtv:"\u226a\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xa0",Nopf:"\u2115",nopf:"\u{1d55f}",Not:"\u2aec",not:"\xac",NotCongruent:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226b\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",notin:"\u2209",notindot:"\u22f5\u0338",notinE:"\u22f9\u0338",notinva:"\u2209",notinvb:"\u22f7",notinvc:"\u22f6",NotLeftTriangle:"\u22ea",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",notni:"\u220c",notniva:"\u220c",notnivb:"\u22fe",notnivc:"\u22fd",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",NotReverseElement:"\u220c",NotRightTriangle:"\u22eb",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangleEqual:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",NotSubset:"\u2282\u20d2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",npr:"\u2280",nprcue:"\u22e0",npre:"\u2aaf\u0338",nprec:"\u2280",npreceq:"\u2aaf\u0338",nrArr:"\u21cf",nrarr:"\u219b",nrarrc:"\u2933\u0338",nrarrw:"\u219d\u0338",nRightarrow:"\u21cf",nrightarrow:"\u219b",nrtri:"\u22eb",nrtrie:"\u22ed",nsc:"\u2281",nsccue:"\u22e1",nsce:"\u2ab0\u0338",Nscr:"\u{1d4a9}",nscr:"\u{1d4c3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22e2",nsqsupe:"\u22e3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsube:"\u2288",nsubset:"\u2282\u20d2",nsubseteq:"\u2288",nsubseteqq:"\u2ac5\u0338",nsucc:"\u2281",nsucceq:"\u2ab0\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20d2",nsupseteq:"\u2289",nsupseteqq:"\u2ac6\u0338",ntgl:"\u2279",Ntilde:"\xd1",ntilde:"\xf1",ntlg:"\u2278",ntriangleleft:"\u22ea",ntrianglelefteq:"\u22ec",ntriangleright:"\u22eb",ntrianglerighteq:"\u22ed",Nu:"\u039d",nu:"\u03bd",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224d\u20d2",nVDash:"\u22af",nVdash:"\u22ae",nvDash:"\u22ad",nvdash:"\u22ac",nvge:"\u2265\u20d2",nvgt:">\u20d2",nvHarr:"\u2904",nvinfin:"\u29de",nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"<\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwarhk:"\u2923",nwArr:"\u21d6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xd3",oacute:"\xf3",oast:"\u229b",ocir:"\u229a",Ocirc:"\xd4",ocirc:"\xf4",Ocy:"\u041e",ocy:"\u043e",odash:"\u229d",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2a38",odot:"\u2299",odsold:"\u29bc",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29bf",Ofr:"\u{1d512}",ofr:"\u{1d52c}",ogon:"\u02db",Ograve:"\xd2",ograve:"\xf2",ogt:"\u29c1",ohbar:"\u29b5",ohm:"\u03a9",oint:"\u222e",olarr:"\u21ba",olcir:"\u29be",olcross:"\u29bb",oline:"\u203e",olt:"\u29c0",Omacr:"\u014c",omacr:"\u014d",Omega:"\u03a9",omega:"\u03c9",Omicron:"\u039f",omicron:"\u03bf",omid:"\u29b6",ominus:"\u2296",Oopf:"\u{1d546}",oopf:"\u{1d560}",opar:"\u29b7",OpenCurlyDoubleQuote:"\u201c",OpenCurlyQuote:"\u2018",operp:"\u29b9",oplus:"\u2295",Or:"\u2a54",or:"\u2228",orarr:"\u21bb",ord:"\u2a5d",order:"\u2134",orderof:"\u2134",ordf:"\xaa",ordm:"\xba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oS:"\u24c8",Oscr:"\u{1d4aa}",oscr:"\u2134",Oslash:"\xd8",oslash:"\xf8",osol:"\u2298",Otilde:"\xd5",otilde:"\xf5",Otimes:"\u2a37",otimes:"\u2297",otimesas:"\u2a36",Ouml:"\xd6",ouml:"\xf6",ovbar:"\u233d",OverBar:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",OverParenthesis:"\u23dc",par:"\u2225",para:"\xb6",parallel:"\u2225",parsim:"\u2af3",parsl:"\u2afd",part:"\u2202",PartialD:"\u2202",Pcy:"\u041f",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",perp:"\u22a5",pertenk:"\u2031",Pfr:"\u{1d513}",pfr:"\u{1d52d}",Phi:"\u03a6",phi:"\u03c6",phiv:"\u03d5",phmmat:"\u2133",phone:"\u260e",Pi:"\u03a0",pi:"\u03c0",pitchfork:"\u22d4",piv:"\u03d6",planck:"\u210f",planckh:"\u210e",plankv:"\u210f",plus:"+",plusacir:"\u2a23",plusb:"\u229e",pluscir:"\u2a22",plusdo:"\u2214",plusdu:"\u2a25",pluse:"\u2a72",PlusMinus:"\xb1",plusmn:"\xb1",plussim:"\u2a26",plustwo:"\u2a27",pm:"\xb1",Poincareplane:"\u210c",pointint:"\u2a15",Popf:"\u2119",popf:"\u{1d561}",pound:"\xa3",Pr:"\u2abb",pr:"\u227a",prap:"\u2ab7",prcue:"\u227c",prE:"\u2ab3",pre:"\u2aaf",prec:"\u227a",precapprox:"\u2ab7",preccurlyeq:"\u227c",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",preceq:"\u2aaf",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",precsim:"\u227e",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2ab9",prnE:"\u2ab5",prnsim:"\u22e8",prod:"\u220f",Product:"\u220f",profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prop:"\u221d",Proportion:"\u2237",Proportional:"\u221d",propto:"\u221d",prsim:"\u227e",prurel:"\u22b0",Pscr:"\u{1d4ab}",pscr:"\u{1d4c5}",Psi:"\u03a8",psi:"\u03c8",puncsp:"\u2008",Qfr:"\u{1d514}",qfr:"\u{1d52e}",qint:"\u2a0c",Qopf:"\u211a",qopf:"\u{1d562}",qprime:"\u2057",Qscr:"\u{1d4ac}",qscr:"\u{1d4c6}",quaternions:"\u210d",quatint:"\u2a16",quest:"?",questeq:"\u225f",QUOT:'"',quot:'"',rAarr:"\u21db",race:"\u223d\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221a",raemptyv:"\u29b3",Rang:"\u27eb",rang:"\u27e9",rangd:"\u2992",range:"\u29a5",rangle:"\u27e9",raquo:"\xbb",Rarr:"\u21a0",rArr:"\u21d2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21e5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291e",rarrhk:"\u21aa",rarrlp:"\u21ac",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21a3",rarrw:"\u219d",rAtail:"\u291c",ratail:"\u291a",ratio:"\u2236",rationals:"\u211a",RBarr:"\u2910",rBarr:"\u290f",rbarr:"\u290d",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201d",rdquor:"\u201d",rdsh:"\u21b3",Re:"\u211c",real:"\u211c",realine:"\u211b",realpart:"\u211c",reals:"\u211d",rect:"\u25ad",REG:"\xae",reg:"\xae",ReverseElement:"\u220b",ReverseEquilibrium:"\u21cb",ReverseUpEquilibrium:"\u296f",rfisht:"\u297d",rfloor:"\u230b",Rfr:"\u211c",rfr:"\u{1d52f}",rHar:"\u2964",rhard:"\u21c1",rharu:"\u21c0",rharul:"\u296c",Rho:"\u03a1",rho:"\u03c1",rhov:"\u03f1",RightAngleBracket:"\u27e9",RightArrow:"\u2192",Rightarrow:"\u21d2",rightarrow:"\u2192",RightArrowBar:"\u21e5",RightArrowLeftArrow:"\u21c4",rightarrowtail:"\u21a3",RightCeiling:"\u2309",RightDoubleBracket:"\u27e7",RightDownTeeVector:"\u295d",RightDownVector:"\u21c2",RightDownVectorBar:"\u2955",RightFloor:"\u230b",rightharpoondown:"\u21c1",rightharpoonup:"\u21c0",rightleftarrows:"\u21c4",rightleftharpoons:"\u21cc",rightrightarrows:"\u21c9",rightsquigarrow:"\u219d",RightTee:"\u22a2",RightTeeArrow:"\u21a6",RightTeeVector:"\u295b",rightthreetimes:"\u22cc",RightTriangle:"\u22b3",RightTriangleBar:"\u29d0",RightTriangleEqual:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVector:"\u21be",RightUpVectorBar:"\u2954",RightVector:"\u21c0",RightVectorBar:"\u2953",ring:"\u02da",risingdotseq:"\u2253",rlarr:"\u21c4",rlhar:"\u21cc",rlm:"\u200f",rmoust:"\u23b1",rmoustache:"\u23b1",rnmid:"\u2aee",roang:"\u27ed",roarr:"\u21fe",robrk:"\u27e7",ropar:"\u2986",Ropf:"\u211d",ropf:"\u{1d563}",roplus:"\u2a2e",rotimes:"\u2a35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rrarr:"\u21c9",Rrightarrow:"\u21db",rsaquo:"\u203a",Rscr:"\u211b",rscr:"\u{1d4c7}",Rsh:"\u21b1",rsh:"\u21b1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22cc",rtimes:"\u22ca",rtri:"\u25b9",rtrie:"\u22b5",rtrif:"\u25b8",rtriltri:"\u29ce",RuleDelayed:"\u29f4",ruluhar:"\u2968",rx:"\u211e",Sacute:"\u015a",sacute:"\u015b",sbquo:"\u201a",Sc:"\u2abc",sc:"\u227b",scap:"\u2ab8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227d",scE:"\u2ab4",sce:"\u2ab0",Scedil:"\u015e",scedil:"\u015f",Scirc:"\u015c",scirc:"\u015d",scnap:"\u2aba",scnE:"\u2ab6",scnsim:"\u22e9",scpolint:"\u2a13",scsim:"\u227f",Scy:"\u0421",scy:"\u0441",sdot:"\u22c5",sdotb:"\u22a1",sdote:"\u2a66",searhk:"\u2925",seArr:"\u21d8",searr:"\u2198",searrow:"\u2198",sect:"\xa7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1d516}",sfr:"\u{1d530}",sfrown:"\u2322",sharp:"\u266f",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xad",Sigma:"\u03a3",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",sim:"\u223c",simdot:"\u2a6a",sime:"\u2243",simeq:"\u2243",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2a33",smeparsl:"\u29e4",smid:"\u2223",smile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",SOFTcy:"\u042c",softcy:"\u044c",sol:"/",solb:"\u29c4",solbar:"\u233f",Sopf:"\u{1d54a}",sopf:"\u{1d564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\ufe00",sqcup:"\u2294",sqcups:"\u2294\ufe00",Sqrt:"\u221a",sqsub:"\u228f",sqsube:"\u2291",sqsubset:"\u228f",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25a1",Square:"\u25a1",square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25aa",squf:"\u25aa",srarr:"\u2192",Sscr:"\u{1d4ae}",sscr:"\u{1d4c8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22c6",Star:"\u22c6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03f5",straightphi:"\u03d5",strns:"\xaf",Sub:"\u22d0",sub:"\u2282",subdot:"\u2abd",subE:"\u2ac5",sube:"\u2286",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subne:"\u228a",subplus:"\u2abf",subrarr:"\u2979",Subset:"\u22d0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2ac5",SubsetEqual:"\u2286",subsetneq:"\u228a",subsetneqq:"\u2acb",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",succ:"\u227b",succapprox:"\u2ab8",succcurlyeq:"\u227d",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",succeq:"\u2ab0",succnapprox:"\u2aba",succneqq:"\u2ab6",succnsim:"\u22e9",succsim:"\u227f",SuchThat:"\u220b",Sum:"\u2211",sum:"\u2211",sung:"\u266a",Sup:"\u22d1",sup:"\u2283",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",supdot:"\u2abe",supdsub:"\u2ad8",supE:"\u2ac6",supe:"\u2287",supedot:"\u2ac4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27c9",suphsub:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supne:"\u228b",supplus:"\u2ac0",Supset:"\u22d1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2ac6",supsetneq:"\u228b",supsetneqq:"\u2acc",supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swarhk:"\u2926",swArr:"\u21d9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292a",szlig:"\xdf",Tab:"\t",target:"\u2316",Tau:"\u03a4",tau:"\u03c4",tbrk:"\u23b4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20db",telrec:"\u2315",Tfr:"\u{1d517}",tfr:"\u{1d531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",thickapprox:"\u2248",thicksim:"\u223c",ThickSpace:"\u205f\u200a",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223c",THORN:"\xde",thorn:"\xfe",Tilde:"\u223c",tilde:"\u02dc",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xd7",timesb:"\u22a0",timesbar:"\u2a31",timesd:"\u2a30",tint:"\u222d",toea:"\u2928",top:"\u22a4",topbot:"\u2336",topcir:"\u2af1",Topf:"\u{1d54b}",topf:"\u{1d565}",topfork:"\u2ada",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25b5",triangledown:"\u25bf",triangleleft:"\u25c3",trianglelefteq:"\u22b4",triangleq:"\u225c",triangleright:"\u25b9",trianglerighteq:"\u22b5",tridot:"\u25ec",trie:"\u225c",triminus:"\u2a3a",TripleDot:"\u20db",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",Tscr:"\u{1d4af}",tscr:"\u{1d4c9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040b",tshcy:"\u045b",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226c",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",Uacute:"\xda",uacute:"\xfa",Uarr:"\u219f",uArr:"\u21d1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040e",ubrcy:"\u045e",Ubreve:"\u016c",ubreve:"\u016d",Ucirc:"\xdb",ucirc:"\xfb",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21c5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296e",ufisht:"\u297e",Ufr:"\u{1d518}",ufr:"\u{1d532}",Ugrave:"\xd9",ugrave:"\xf9",uHar:"\u2963",uharl:"\u21bf",uharr:"\u21be",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",Umacr:"\u016a",umacr:"\u016b",uml:"\xa8",UnderBar:"_",UnderBrace:"\u23df",UnderBracket:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",UnionPlus:"\u228e",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1d54c}",uopf:"\u{1d566}",UpArrow:"\u2191",Uparrow:"\u21d1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21c5",UpDownArrow:"\u2195",Updownarrow:"\u21d5",updownarrow:"\u2195",UpEquilibrium:"\u296e",upharpoonleft:"\u21bf",upharpoonright:"\u21be",uplus:"\u228e",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03d2",upsi:"\u03c5",upsih:"\u03d2",Upsilon:"\u03a5",upsilon:"\u03c5",UpTee:"\u22a5",UpTeeArrow:"\u21a5",upuparrows:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",Uring:"\u016e",uring:"\u016f",urtri:"\u25f9",Uscr:"\u{1d4b0}",uscr:"\u{1d4ca}",utdot:"\u22f0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25b5",utrif:"\u25b4",uuarr:"\u21c8",Uuml:"\xdc",uuml:"\xfc",uwangle:"\u29a7",vangrt:"\u299c",varepsilon:"\u03f5",varkappa:"\u03f0",varnothing:"\u2205",varphi:"\u03d5",varpi:"\u03d6",varpropto:"\u221d",vArr:"\u21d5",varr:"\u2195",varrho:"\u03f1",varsigma:"\u03c2",varsubsetneq:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vartheta:"\u03d1",vartriangleleft:"\u22b2",vartriangleright:"\u22b3",Vbar:"\u2aeb",vBar:"\u2ae8",vBarv:"\u2ae9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22ab",Vdash:"\u22a9",vDash:"\u22a8",vdash:"\u22a2",Vdashl:"\u2ae6",Vee:"\u22c1",vee:"\u2228",veebar:"\u22bb",veeeq:"\u225a",vellip:"\u22ee",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200a",Vfr:"\u{1d519}",vfr:"\u{1d533}",vltri:"\u22b2",vnsub:"\u2282\u20d2",vnsup:"\u2283\u20d2",Vopf:"\u{1d54d}",vopf:"\u{1d567}",vprop:"\u221d",vrtri:"\u22b3",Vscr:"\u{1d4b1}",vscr:"\u{1d4cb}",vsubnE:"\u2acb\ufe00",vsubne:"\u228a\ufe00",vsupnE:"\u2acc\ufe00",vsupne:"\u228b\ufe00",Vvdash:"\u22aa",vzigzag:"\u299a",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2a5f",Wedge:"\u22c0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1d51a}",wfr:"\u{1d534}",Wopf:"\u{1d54e}",wopf:"\u{1d568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1d4b2}",wscr:"\u{1d4cc}",xcap:"\u22c2",xcirc:"\u25ef",xcup:"\u22c3",xdtri:"\u25bd",Xfr:"\u{1d51b}",xfr:"\u{1d535}",xhArr:"\u27fa",xharr:"\u27f7",Xi:"\u039e",xi:"\u03be",xlArr:"\u27f8",xlarr:"\u27f5",xmap:"\u27fc",xnis:"\u22fb",xodot:"\u2a00",Xopf:"\u{1d54f}",xopf:"\u{1d569}",xoplus:"\u2a01",xotime:"\u2a02",xrArr:"\u27f9",xrarr:"\u27f6",Xscr:"\u{1d4b3}",xscr:"\u{1d4cd}",xsqcup:"\u2a06",xuplus:"\u2a04",xutri:"\u25b3",xvee:"\u22c1",xwedge:"\u22c0",Yacute:"\xdd",yacute:"\xfd",YAcy:"\u042f",yacy:"\u044f",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042b",ycy:"\u044b",yen:"\xa5",Yfr:"\u{1d51c}",yfr:"\u{1d536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1d550}",yopf:"\u{1d56a}",Yscr:"\u{1d4b4}",yscr:"\u{1d4ce}",YUcy:"\u042e",yucy:"\u044e",Yuml:"\u0178",yuml:"\xff",Zacute:"\u0179",zacute:"\u017a",Zcaron:"\u017d",zcaron:"\u017e",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017b",zdot:"\u017c",zeetrf:"\u2128",ZeroWidthSpace:"\u200b",Zeta:"\u0396",zeta:"\u03b6",Zfr:"\u2128",zfr:"\u{1d537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21dd",Zopf:"\u2124",zopf:"\u{1d56b}",Zscr:"\u{1d4b5}",zscr:"\u{1d4cf}",zwj:"\u200d",zwnj:"\u200c"}),e.entityMap=e.HTML_ENTITIES},546:(t,e,s)=>{"use strict";var i=s(870);e.assign=i.assign,e.hasDefaultHTMLNamespace=i.hasDefaultHTMLNamespace,e.isHTMLMimeType=i.isHTMLMimeType,e.isValidMimeType=i.isValidMimeType,e.MIME_TYPE=i.MIME_TYPE,e.NAMESPACE=i.NAMESPACE;var r=s(767);e.DOMException=r.DOMException,e.DOMExceptionName=r.DOMExceptionName,e.ExceptionCode=r.ExceptionCode,e.ParseError=r.ParseError;var n=s(786);e.Attr=n.Attr,e.CDATASection=n.CDATASection,e.CharacterData=n.CharacterData,e.Comment=n.Comment,e.Document=n.Document,e.DocumentFragment=n.DocumentFragment,e.DocumentType=n.DocumentType,e.DOMImplementation=n.DOMImplementation,e.Element=n.Element,e.Entity=n.Entity,e.EntityReference=n.EntityReference,e.LiveNodeList=n.LiveNodeList,e.NamedNodeMap=n.NamedNodeMap,e.Node=n.Node,e.NodeList=n.NodeList,e.Notation=n.Notation,e.ProcessingInstruction=n.ProcessingInstruction,e.Text=n.Text,e.XMLSerializer=n.XMLSerializer;var o=s(576);e.DOMParser=o.DOMParser,e.normalizeLineEndings=o.normalizeLineEndings,e.onErrorStopParsing=o.onErrorStopParsing,e.onWarningStopParsing=o.onWarningStopParsing},556:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{f:()=>SystemExternal});var _variables_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(904),_lib_external_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(750);const windowSupported=!("undefined"==typeof window),documentSupported=windowSupported&&!(void 0===window.document),webworker=!("undefined"==typeof DedicatedWorkerGlobalScope),nodeRequire=()=>{try{return eval("require")}catch(t){return t=>null}},SystemExternal={extRequire:t=>"undefined"!=typeof process&&"undefined"!=typeof require?nodeRequire()(t):null,windowSupported,documentSupported,webworker,xmldom:_lib_external_js__WEBPACK_IMPORTED_MODULE_1__.Gb,document:_lib_external_js__WEBPACK_IMPORTED_MODULE_1__.Al,fs:documentSupported||webworker?null:nodeRequire()("fs"),url:_variables_js__WEBPACK_IMPORTED_MODULE_0__.u.url,jsonPath:function(){if(documentSupported||webworker)return _variables_js__WEBPACK_IMPORTED_MODULE_0__.u.url;if(process.env.SRE_JSON_PATH||__webpack_require__.g.SRE_JSON_PATH)return process.env.SRE_JSON_PATH||__webpack_require__.g.SRE_JSON_PATH;try{return nodeRequire().resolve("speech-rule-engine").replace(/sre\.js$/,"")+"mathmaps"}catch(t){}try{return nodeRequire().resolve(".").replace(/sre\.js$/,"")+"mathmaps"}catch(t){}return"undefined"!=typeof __dirname?__dirname+(__dirname.match(/lib?$/)?"/mathmaps":"/lib/mathmaps"):process.cwd()+"/lib/mathmaps"}(),xpath:_lib_external_js__WEBPACK_IMPORTED_MODULE_1__.Oe}},576:(t,e,s)=>{"use strict";var i=s(870),r=s(786),n=s(767),o=s(159),a=s(802),l=r.DOMImplementation,c=i.hasDefaultHTMLNamespace,h=i.isHTMLMimeType,d=i.isValidMimeType,u=i.MIME_TYPE,p=i.NAMESPACE,m=n.ParseError,g=a.XMLReader;function f(t){return t.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028\u2029]/g,"\n")}function b(t){if(void 0===(t=t||{}).locator&&(t.locator=!0),this.assign=t.assign||i.assign,this.domHandler=t.domHandler||E,this.onError=t.onError||t.errorHandler,t.errorHandler&&"function"!=typeof t.errorHandler)throw new TypeError("errorHandler object is no longer supported, switch to onError!");t.errorHandler&&t.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=t.normalizeLineEndings||f,this.locator=!!t.locator,this.xmlns=this.assign(Object.create(null),t.xmlns)}function E(t){var e=t||{};this.mimeType=e.mimeType||u.XML_APPLICATION,this.defaultNamespace=e.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=e.onError}function x(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function y(t,e,s){return"string"==typeof t?t.substr(e,s):t.length>=e+s||e?new java.lang.String(t,e,s)+"":t}function N(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}b.prototype.parseFromString=function(t,e){if(!d(e))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+e+'" is not valid.');var s=this.assign(Object.create(null),this.xmlns),r=o.XML_ENTITIES,n=s[""]||null;c(e)?(r=o.HTML_ENTITIES,n=p.HTML):e===u.XML_SVG_IMAGE&&(n=p.SVG),s[""]=n,s.xml=s.xml||p.XML;var a=new this.domHandler({mimeType:e,defaultNamespace:n,onError:this.onError}),l=this.locator?{}:void 0;this.locator&&a.setDocumentLocator(l);var h=new g;return h.errorHandler=a,h.domBuilder=a,!i.isHTMLMimeType(e)&&"string"!=typeof t&&h.errorHandler.fatalError("source is not a string"),h.parse(this.normalizeLineEndings(String(t)),s,r),a.doc.documentElement||h.errorHandler.fatalError("missing root element"),a.doc},E.prototype={startDocument:function(){var t=new l;this.doc=h(this.mimeType)?t.createHTMLDocument(!1):t.createDocument(this.defaultNamespace,"")},startElement:function(t,e,s,i){var r=this.doc,n=r.createElementNS(t,s||e),o=i.length;N(this,n),this.currentElement=n,this.locator&&x(this.locator,n);for(var a=0;a<o;a++){t=i.getURI(a);var l=i.getValue(a),c=(s=i.getQName(a),r.createAttributeNS(t,s));this.locator&&x(i.getLocator(a),c),c.value=c.nodeValue=l,n.setAttributeNode(c)}},endElement:function(t,e,s){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var s=this.doc.createProcessingInstruction(t,e);this.locator&&x(this.locator,s),N(this,s)},ignorableWhitespace:function(t,e,s){},characters:function(t,e,s){if(t=y.apply(this,arguments)){if(this.cdata)var i=this.doc.createCDATASection(t);else i=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(t)&&this.doc.appendChild(i),this.locator&&x(this.locator,i)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){t&&(t.lineNumber=0),this.locator=t},comment:function(t,e,s){t=y.apply(this,arguments);var i=this.doc.createComment(t);this.locator&&x(this.locator,i),N(this,i)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,s,i){var r=this.doc.implementation;if(r&&r.createDocumentType){var n=r.createDocumentType(t,e,s,i);this.locator&&x(this.locator,n),N(this,n),this.doc.doctype=n}},reportError:function(t,e){if("function"==typeof this.onError)try{this.onError(t,e,this)}catch(s){throw new m("Reporting "+t+' "'+e+'" caused '+s,this.locator)}else console.error("[xmldom "+t+"]\t"+e,function(t){if(t)return"\n@#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}(this.locator))},warning:function(t){this.reportError("warning",t)},error:function(t){this.reportError("error",t)},fatalError:function(t){throw this.reportError("fatalError",t),new m(t,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){E.prototype[t]=function(){return null}})),e.__DOMHandler=E,e.DOMParser=b,e.normalizeLineEndings=f,e.onErrorStopParsing=function(t){if("error"===t)throw"onErrorStopParsing"},e.onWarningStopParsing=function(){throw"onWarningStopParsing"}},731:(t,e)=>{"use strict";function s(t){try{"function"!=typeof t&&(t=RegExp);var e=new t("\u{1d306}","u").exec("\u{1d306}");return!!e&&2===e[0].length}catch(t){}return!1}var i=s();function r(t){if("["!==t.source[0])throw new Error(t+" can not be used with chars");return t.source.slice(1,t.source.lastIndexOf("]"))}function n(t,e){if("["!==t.source[0])throw new Error("/"+t.source+"/ can not be used with chars_without");if(!e||"string"!=typeof e)throw new Error(JSON.stringify(e)+" is not a valid search");if(-1===t.source.indexOf(e))throw new Error('"'+e+'" is not is /'+t.source+"/");if("-"===e&&1!==t.source.indexOf(e))throw new Error('"'+e+'" is not at the first postion of /'+t.source+"/");return new RegExp(t.source.replace(e,""),i?"u":"")}function o(t){var e=this;return new RegExp(Array.prototype.slice.call(arguments).map((function(t){var s="string"==typeof t;if(s&&void 0===e&&"|"===t)throw new Error("use regg instead of reg to wrap expressions with `|`!");return s?t:t.source})).join(""),i?"mu":"m")}function a(t){if(0===arguments.length)throw new Error("no parameters provided");return o.apply(a,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var l=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;i&&(l=o("[",r(l),"\\u{10000}-\\u{10FFFF}","]"));var c=/[\x20\x09\x0D\x0A]/,h=r(c),d=o(c,"+"),u=o(c,"*"),p=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;i&&(p=o("[",r(p),"\\u{10000}-\\u{10FFFF}","]"));var m=o("[",r(p),r(/[-.0-9\xB7]/),r(/[\u0300-\u036F\u203F-\u2040]/),"]"),g=o(p,m,"*"),f=o(m,"+"),b=o("&",g,";"),E=a(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),x=a(b,"|",E),y=o("%",g,";"),N=a(o('"',a(/[^%&"]/,"|",y,"|",x),"*",'"'),"|",o("'",a(/[^%&']/,"|",y,"|",x),"*","'")),A=a('"',a(/[^<&"]/,"|",x),"*",'"',"|","'",a(/[^<&']/,"|",x),"*","'"),v=o(n(p,":"),n(m,":"),"*"),_=o(v,a(":",v),"?"),w=o("^",_,"$"),T=o("(",_,")"),C=a(/"[^"]*"|'[^']*'/),L=o(/^<\?/,"(",g,")",a(d,"(",l,"*?)"),"?",/\?>/),I=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,R=a('"',I,'*"',"|","'",n(I,"'"),"*'"),S="\x3c!--",k=o(S,a(n(l,"-"),"|",o("-",n(l,"-"))),"*","--\x3e"),O="#PCDATA",M=a(o(/\(/,u,O,a(u,/\|/,u,_),"*",u,/\)\*/),"|",o(/\(/,u,O,u,/\)/)),D=a("EMPTY","|","ANY","|",M,"|",o(/\([^>]+\)/,/[?*+]?/)),P=o("<!ELEMENT",d,a(_,"|",y),d,a(D,"|",y),u,">"),B=o("NOTATION",d,/\(/,u,g,a(u,/\|/,u,g),"*",u,/\)/),F=o(/\(/,u,f,a(u,/\|/,u,f),"*",u,/\)/),U=a(B,"|",F),j=a(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",U),q=a(/#REQUIRED|#IMPLIED/,"|",a(a("#FIXED",d),"?",A)),H=o("<!ATTLIST",d,g,a(d,g,d,j,d,q),"*",u,">"),W="about:legacy-compat",V=a('"'+W+'"',"|","'"+W+"'"),G="SYSTEM",X="PUBLIC",z=a(a(G,d,C),"|",a(X,d,R,d,C)),K=o("^",a(a(G,d,"(?<SystemLiteralOnly>",C,")"),"|",a(X,d,"(?<PubidLiteral>",R,")",d,"(?<SystemLiteral>",C,")"))),J=a(d,"NDATA",d,g),$="<!ENTITY",Y=o($,d,g,d,a(N,"|",a(z,J,"?")),u,">"),Q=a(N,"|",z),Z=a(Y,"|",o($,d,"%",d,g,d,Q,u,">")),tt=o(X,d,R),et=o("<!NOTATION",d,g,d,a(z,"|",tt),u,">"),st=o(u,"=",u),it=/1[.]\d+/,rt=o(d,"version",st,a("'",it,"'","|",'"',it,'"')),nt=/[A-Za-z][-A-Za-z0-9._]*/,ot=o(/^<\?xml/,rt,a(d,"encoding",st,a('"',nt,'"',"|","'",nt,"'")),"?",a(d,"standalone",st,a("'",a("yes","|","no"),"'","|",'"',a("yes","|","no"),'"')),"?",u,/\?>/),at=o(l,"*?",/\]\]>/),lt=o(/<!\[CDATA\[/,at);e.chars=r,e.chars_without=n,e.detectUnicodeSupport=s,e.reg=o,e.regg=a,e.ABOUT_LEGACY_COMPAT=W,e.ABOUT_LEGACY_COMPAT_SystemLiteral=V,e.AttlistDecl=H,e.CDATA_START="<![CDATA[",e.CDATA_END="]]>",e.CDSect=lt,e.Char=l,e.Comment=k,e.COMMENT_START=S,e.COMMENT_END="--\x3e",e.DOCTYPE_DECL_START="<!DOCTYPE",e.elementdecl=P,e.EntityDecl=Z,e.EntityValue=N,e.ExternalID=z,e.ExternalID_match=K,e.Name=g,e.NotationDecl=et,e.Reference=x,e.PEReference=y,e.PI=L,e.PUBLIC=X,e.PubidLiteral=R,e.QName=_,e.QName_exact=w,e.QName_group=T,e.S=d,e.SChar_s=h,e.S_OPT=u,e.SYSTEM=G,e.SystemLiteral=C,e.UNICODE_REPLACEMENT_CHARACTER="\ufffd",e.UNICODE_SUPPORT=i,e.XMLDecl=ot},750:(t,e,s)=>{"use strict";var i,r;s.d(e,{Al:()=>l,Gb:()=>a,Oe:()=>d});var n=s(546),o=s(999);const a=i||(i=s.t(n,2)),l=(new a.DOMImplementation).createDocument("",""),c=(null===(r||(r=s.t(o,2)))||void 0===(r||(r=s.t(o,2)))?void 0:o.install)||window.wgxpath.install,h=function(){const t={document:{},XPathResult:{}};return c(t),t.document.XPathResult=t.XPathResult,t.document}(),d={currentDocument:l,evaluate:h.evaluate,result:h.XPathResult,createNSResolver:h.createNSResolver}},767:(t,e,s)=>{"use strict";function i(t,e){t.prototype=Object.create(Error.prototype,{constructor:{value:t},name:{value:t.name,enumerable:!0,writable:e}})}var r=s(870).freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),n=Object.keys(r);function o(t){return"number"==typeof t&&t>=1&&t<=25}function a(t,e){var s;o(t)?(this.name=n[t],this.message=e||""):(this.message=t,this.name="string"==typeof(s=e)&&s.substring(s.length-r.Error.length)===r.Error?e:r.Error),Error.captureStackTrace&&Error.captureStackTrace(this,a)}i(a,!0),Object.defineProperties(a.prototype,{code:{enumerable:!0,get:function(){var t=n.indexOf(this.name);return o(t)?t:0}}});for(var l={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},c=Object.entries(l),h=0;h<c.length;h++){a[c[h][0]]=c[h][1]}function d(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,d)}i(d),e.DOMException=a,e.DOMExceptionName=r,e.ExceptionCode=l,e.ParseError=d},786:(t,e,s)=>{"use strict";var i=s(870),r=i.find,n=i.hasDefaultHTMLNamespace,o=i.hasOwn,a=i.isHTMLMimeType,l=i.isHTMLRawTextElement,c=i.isHTMLVoidElement,h=i.MIME_TYPE,d=i.NAMESPACE,u=Symbol(),p=s(767),m=p.DOMException,g=p.DOMExceptionName,f=s(731);function b(t){if(t!==u)throw new TypeError("Illegal constructor")}function E(t){return""!==t}function x(t,e){return o(t,e)||(t[e]=!0),t}function y(t){if(!t)return[];var e=function(t){return t?t.split(/[\t\n\f\r ]+/).filter(E):[]}(t);return Object.keys(e.reduce(x,{}))}function N(t){if(!f.QName_exact.test(t))throw new m(m.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+t+'"')}function A(t,e){N(e),t=t||null;var s=null,r=e;if(e.indexOf(":")>=0){var n=e.split(":");s=n[0],r=n[1]}if(null!==s&&null===t)throw new m(m.NAMESPACE_ERR,"prefix is non-null and namespace is null");if("xml"===s&&t!==i.NAMESPACE.XML)throw new m(m.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if(("xmlns"===s||"xmlns"===e)&&t!==i.NAMESPACE.XMLNS)throw new m(m.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(t===i.NAMESPACE.XMLNS&&"xmlns"!==s&&"xmlns"!==e)throw new m(m.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[t,s,r]}function v(t,e){for(var s in t)o(t,s)&&(e[s]=t[s])}function _(t,e){var s=t.prototype;if(!(s instanceof e)){function i(){}i.prototype=e.prototype,v(s,i=new i),t.prototype=s=i}s.constructor!=t&&("function"!=typeof t&&console.error("unknown Class:"+t),s.constructor=t)}var w={},T=w.ELEMENT_NODE=1,C=w.ATTRIBUTE_NODE=2,L=w.TEXT_NODE=3,I=w.CDATA_SECTION_NODE=4,R=w.ENTITY_REFERENCE_NODE=5,S=w.ENTITY_NODE=6,k=w.PROCESSING_INSTRUCTION_NODE=7,O=w.COMMENT_NODE=8,M=w.DOCUMENT_NODE=9,D=w.DOCUMENT_TYPE_NODE=10,P=w.DOCUMENT_FRAGMENT_NODE=11,B=w.NOTATION_NODE=12,F=i.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function U(t,e){if(e.length<t.length)return U(e,t);var s=null;for(var i in t){if(t[i]!==e[i])return s;s=t[i]}return s}function j(t){return t.guid||(t.guid=Math.random()),t.guid}function q(){}function H(t,e){this._node=t,this._refresh=e,W(this)}function W(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var s=t._refresh(t._node);if(Rt(t,"length",s.length),!t.$$length||s.length<t.$$length)for(var i=s.length;i in t;i++)o(t,i)&&delete t[i];v(s,t),t._inc=e}}function V(){}function G(t,e){for(var s=0;s<t.length;){if(t[s]===e)return s;s++}}function X(t,e,s,i){if(i?e[G(e,i)]=s:(e[e.length]=s,e.length++),t){s.ownerElement=t;var r=t.ownerDocument;r&&(i&&Z(r,t,i),function(t,e,s){t&&t._inc++;var i=s.namespaceURI;i===d.XMLNS&&(e._nsMap[s.prefix?s.localName:""]=s.value)}(r,t,s))}}function z(t,e,s){var i=G(e,s);if(i>=0){for(var r=e.length-1;i<=r;)e[i]=e[++i];if(e.length=r,t){var n=t.ownerDocument;n&&Z(n,t,s),s.ownerElement=null}}}function K(){}function J(t){b(t)}function $(t){return("<"==t?"<":">"==t&&">")||"&"==t&&"&"||'"'==t&&"""||"&#"+t.charCodeAt()+";"}function Y(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(Y(t,e))return!0}while(t=t.nextSibling)}function Q(t,e){b(t);var s=e||{};this.ownerDocument=this,this.contentType=s.contentType||h.XML_APPLICATION,this.type=a(this.contentType)?"html":"xml"}function Z(t,e,s,i){t&&t._inc++,s.namespaceURI===d.XMLNS&&delete e._nsMap[s.prefix?s.localName:""]}function tt(t,e,s){if(t&&t._inc){t._inc++;var i=e.childNodes;if(s&&!s.nextSibling)i[i.length++]=s;else{for(var r=e.firstChild,n=0;r;)i[n++]=r,r=r.nextSibling;i.length=n,delete i[i.length]}}}function et(t,e){if(t!==e.parentNode)throw new m(m.NOT_FOUND_ERR,"child's parent is not parent");var s=e.previousSibling,i=e.nextSibling;return s?s.nextSibling=i:t.firstChild=i,i?i.previousSibling=s:t.lastChild=s,tt(t.ownerDocument,t),e.parentNode=null,e.previousSibling=null,e.nextSibling=null,e}function st(t){return t&&t.nodeType===J.DOCUMENT_TYPE_NODE}function it(t){return t&&t.nodeType===J.ELEMENT_NODE}function rt(t){return t&&t.nodeType===J.TEXT_NODE}function nt(t,e){var s=t.childNodes||[];if(r(s,it)||st(e))return!1;var i=r(s,st);return!(e&&i&&s.indexOf(i)>s.indexOf(e))}function ot(t,e){var s=t.childNodes||[];if(r(s,(function(t){return it(t)&&t!==e})))return!1;var i=r(s,st);return!(e&&i&&s.indexOf(i)>s.indexOf(e))}function at(t,e,s){if(!function(t){return t&&(t.nodeType===J.DOCUMENT_NODE||t.nodeType===J.DOCUMENT_FRAGMENT_NODE||t.nodeType===J.ELEMENT_NODE)}(t))throw new m(m.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+t.nodeType);if(s&&s.parentNode!==t)throw new m(m.NOT_FOUND_ERR,"child not in parent");if(!function(t){return t&&(t.nodeType===J.CDATA_SECTION_NODE||t.nodeType===J.COMMENT_NODE||t.nodeType===J.DOCUMENT_FRAGMENT_NODE||t.nodeType===J.DOCUMENT_TYPE_NODE||t.nodeType===J.ELEMENT_NODE||t.nodeType===J.PROCESSING_INSTRUCTION_NODE||t.nodeType===J.TEXT_NODE)}(e)||st(e)&&t.nodeType!==J.DOCUMENT_NODE)throw new m(m.HIERARCHY_REQUEST_ERR,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)}function lt(t,e,s){var i=t.childNodes||[],n=e.childNodes||[];if(e.nodeType===J.DOCUMENT_FRAGMENT_NODE){var o=n.filter(it);if(o.length>1||r(n,rt))throw new m(m.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(1===o.length&&!nt(t,s))throw new m(m.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(it(e)&&!nt(t,s))throw new m(m.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(st(e)){if(r(i,st))throw new m(m.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=r(i,it);if(s&&i.indexOf(a)<i.indexOf(s))throw new m(m.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!s&&a)throw new m(m.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function ct(t,e,s){var i=t.childNodes||[],n=e.childNodes||[];if(e.nodeType===J.DOCUMENT_FRAGMENT_NODE){var o=n.filter(it);if(o.length>1||r(n,rt))throw new m(m.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(1===o.length&&!ot(t,s))throw new m(m.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(it(e)&&!ot(t,s))throw new m(m.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(st(e)){function l(t){return st(t)&&t!==s}if(r(i,l))throw new m(m.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=r(i,it);if(s&&i.indexOf(a)<i.indexOf(s))throw new m(m.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function ht(t,e,s,i){at(t,e,s),t.nodeType===J.DOCUMENT_NODE&&(i||lt)(t,e,s);var r=e.parentNode;if(r&&r.removeChild(e),e.nodeType===P){var n=e.firstChild;if(null==n)return e;var o=e.lastChild}else n=o=e;var a=s?s.previousSibling:t.lastChild;n.previousSibling=a,o.nextSibling=s,a?a.nextSibling=n:t.firstChild=n,null==s?t.lastChild=o:s.previousSibling=o;do{n.parentNode=t}while(n!==o&&(n=n.nextSibling));return tt(t.ownerDocument||t,t,e),e.nodeType==P&&(e.firstChild=e.lastChild=null),e}function dt(t){b(t),this._nsMap=Object.create(null)}function ut(t){b(t),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}function pt(t){b(t)}function mt(t){b(t)}function gt(t){b(t)}function ft(t){b(t)}function bt(t){b(t)}function Et(t){b(t)}function xt(t){b(t)}function yt(t){b(t)}function Nt(t){b(t)}function At(t){b(t)}function vt(){}function _t(t){var e=[],s=this.nodeType===M&&this.documentElement||this,i=s.prefix,r=s.namespaceURI;if(r&&null==i&&null==(i=s.lookupPrefix(r)))var n=[{namespace:r,prefix:null}];return Ct(this,e,t,n),e.join("")}function wt(t,e,s){var i=t.prefix||"",r=t.namespaceURI;if(!r)return!1;if("xml"===i&&r===d.XML||r===d.XMLNS)return!1;for(var n=s.length;n--;){var o=s[n];if(o.prefix===i)return o.namespace!==r}return!0}function Tt(t,e,s){t.push(" ",e,'="',s.replace(/[<>&"\t\n\r]/g,$),'"')}function Ct(t,e,s,i){i||(i=[]);var r="html"===(t.nodeType===M?t:t.ownerDocument).type;if(s){if(!(t=s(t)))return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case T:var n=t.attributes,o=n.length,a=t.firstChild,h=t.tagName,u=h;if(!r&&!t.prefix&&t.namespaceURI){for(var p,m=0;m<n.length;m++)if("xmlns"===n.item(m).name){p=n.item(m).value;break}if(!p)for(var g=i.length-1;g>=0;g--){if(""===(b=i[g]).prefix&&b.namespace===t.namespaceURI){p=b.namespace;break}}if(p!==t.namespaceURI)for(g=i.length-1;g>=0;g--){var b;if((b=i[g]).namespace===t.namespaceURI){b.prefix&&(u=b.prefix+":"+h);break}}}e.push("<",u);for(var E=0;E<o;E++){"xmlns"==(x=n.item(E)).prefix?i.push({prefix:x.localName,namespace:x.value}):"xmlns"==x.nodeName&&i.push({prefix:"",namespace:x.value})}for(E=0;E<o;E++){var x,y,N;if(wt(x=n.item(E),0,i))Tt(e,(y=x.prefix||"")?"xmlns:"+y:"xmlns",N=x.namespaceURI),i.push({prefix:y,namespace:N});Ct(x,e,s,i)}if(h===u&&wt(t,0,i))Tt(e,(y=t.prefix||"")?"xmlns:"+y:"xmlns",N=t.namespaceURI),i.push({prefix:y,namespace:N});var A=!a;if(A&&(r||t.namespaceURI===d.HTML)&&(A=c(h)),A)e.push("/>");else{if(e.push(">"),r&&l(h))for(;a;)a.data?e.push(a.data):Ct(a,e,s,i.slice()),a=a.nextSibling;else for(;a;)Ct(a,e,s,i.slice()),a=a.nextSibling;e.push("</",u,">")}return;case M:case P:for(a=t.firstChild;a;)Ct(a,e,s,i.slice()),a=a.nextSibling;return;case C:return Tt(e,t.name,t.value);case L:return e.push(t.data.replace(/[<&>]/g,$));case I:return e.push(f.CDATA_START,t.data,f.CDATA_END);case O:return e.push(f.COMMENT_START,t.data,f.COMMENT_END);case D:var v=t.publicId,_=t.systemId;return e.push(f.DOCTYPE_DECL_START," ",t.name),v?(e.push(" ",f.PUBLIC," ",v),_&&"."!==_&&e.push(" ",_)):_&&"."!==_&&e.push(" ",f.SYSTEM," ",_),t.internalSubset&&e.push(" [",t.internalSubset,"]"),void e.push(">");case k:return e.push("<?",t.target," ",t.data,"?>");case R:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function Lt(t,e,s){var i;switch(e.nodeType){case T:(i=e.cloneNode(!1)).ownerDocument=t;case P:break;case C:s=!0}if(i||(i=e.cloneNode(!1)),i.ownerDocument=t,i.parentNode=null,s)for(var r=e.firstChild;r;)i.appendChild(Lt(t,r,s)),r=r.nextSibling;return i}function It(t,e,s){var i=new e.constructor(u);for(var r in e)if(o(e,r)){var n=e[r];"object"!=typeof n&&n!=i[r]&&(i[r]=n)}switch(e.childNodes&&(i.childNodes=new q),i.ownerDocument=t,i.nodeType){case T:var a=e.attributes,l=i.attributes=new V,c=a.length;l._ownerElement=i;for(var h=0;h<c;h++)i.setAttributeNode(It(t,a.item(h),!0));break;case C:s=!0}if(s)for(var d=e.firstChild;d;)i.appendChild(It(t,d,s)),d=d.nextSibling;return i}function Rt(t,e,s){t[e]=s}q.prototype={length:0,item:function(t){return t>=0&&t<this.length?this[t]:null},toString:function(t){for(var e=[],s=0;s<this.length;s++)Ct(this[s],e,t);return e.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}},q.prototype[Symbol.iterator]=function(){var t=this,e=0;return{next:function(){return e<t.length?{value:t[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}},H.prototype.item=function(t){return W(this),this[t]||null},_(H,q),V.prototype={length:0,item:q.prototype.item,getNamedItem:function(t){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase());for(var e=0;e<this.length;){var s=this[e];if(s.nodeName===t)return s;e++}return null},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!==this._ownerElement)throw new m(m.INUSE_ATTRIBUTE_ERR);var s=this.getNamedItemNS(t.namespaceURI,t.localName);return s===t?t:(X(this._ownerElement,this,t,s),s)},setNamedItemNS:function(t){return this.setNamedItem(t)},removeNamedItem:function(t){var e=this.getNamedItem(t);if(!e)throw new m(m.NOT_FOUND_ERR,t);return z(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var s=this.getNamedItemNS(t,e);if(!s)throw new m(m.NOT_FOUND_ERR,t?t+" : "+e:e);return z(this._ownerElement,this,s),s},getNamedItemNS:function(t,e){t||(t=null);for(var s=0;s<this.length;){var i=this[s];if(i.localName===e&&i.namespaceURI===t)return i;s++}return null}},V.prototype[Symbol.iterator]=function(){var t=this,e=0;return{next:function(){return e<t.length?{value:t[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}},K.prototype={hasFeature:function(t,e){return!0},createDocument:function(t,e,s){var i=h.XML_APPLICATION;t===d.HTML?i=h.XML_XHTML_APPLICATION:t===d.SVG&&(i=h.XML_SVG_IMAGE);var r=new Q(u,{contentType:i});if(r.implementation=this,r.childNodes=new q,r.doctype=s||null,s&&r.appendChild(s),e){var n=r.createElementNS(t,e);r.appendChild(n)}return r},createDocumentType:function(t,e,s,i){N(t);var r=new bt(u);return r.name=t,r.nodeName=t,r.publicId=e||"",r.systemId=s||"",r.internalSubset=i||"",r.childNodes=new q,r},createHTMLDocument:function(t){var e=new Q(u,{contentType:h.HTML});if(e.implementation=this,e.childNodes=new q,!1!==t){e.doctype=this.createDocumentType("html"),e.doctype.ownerDocument=e,e.appendChild(e.doctype);var s=e.createElement("html");e.appendChild(s);var i=e.createElement("head");if(s.appendChild(i),"string"==typeof t){var r=e.createElement("title");r.appendChild(e.createTextNode(t)),i.appendChild(r)}s.appendChild(e.createElement("body"))}return e}},J.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var t=this.getRootNode();return t&&t.nodeType===t.DOCUMENT_NODE},contains:function(t){if(!t)return!1;var e=t;do{if(this===e)return!0;e=t.parentNode}while(e);return!1},getRootNode:function(t){var e=this;do{if(!e.parentNode)return e;e=e.parentNode}while(e)},isEqualNode:function(t){if(!t)return!1;if(this.nodeType!==t.nodeType)return!1;switch(this.nodeType){case this.DOCUMENT_TYPE_NODE:if(this.name!==t.name)return!1;if(this.publicId!==t.publicId)return!1;if(this.systemId!==t.systemId)return!1;break;case this.ELEMENT_NODE:if(this.namespaceURI!==t.namespaceURI)return!1;if(this.prefix!==t.prefix)return!1;if(this.localName!==t.localName)return!1;if(this.attributes.length!==t.attributes.length)return!1;for(var e=0;e<this.attributes.length;e++){var s=this.attributes.item(e);if(!s.isEqualNode(t.getAttributeNodeNS(s.namespaceURI,s.localName)))return!1}break;case this.ATTRIBUTE_NODE:if(this.namespaceURI!==t.namespaceURI)return!1;if(this.localName!==t.localName)return!1;if(this.value!==t.value)return!1;break;case this.PROCESSING_INSTRUCTION_NODE:if(this.target!==t.target||this.data!==t.data)return!1;break;case this.TEXT_NODE:case this.COMMENT_NODE:if(this.data!==t.data)return!1}if(this.childNodes.length!==t.childNodes.length)return!1;for(e=0;e<this.childNodes.length;e++)if(!this.childNodes[e].isEqualNode(t.childNodes[e]))return!1;return!0},isSameNode:function(t){return this===t},insertBefore:function(t,e){return ht(this,t,e)},replaceChild:function(t,e){ht(this,t,e,ct),e&&this.removeChild(e)},removeChild:function(t){return et(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return It(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==L&&t.nodeType==L?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},lookupPrefix:function(t){for(var e=this;e;){var s=e._nsMap;if(s)for(var i in s)if(o(s,i)&&s[i]===t)return i;e=e.nodeType==C?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var s=e._nsMap;if(s&&o(s,t))return s[t];e=e.nodeType==C?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)},compareDocumentPosition:function(t){if(this===t)return 0;var e=t,s=this,i=null,r=null;if(e instanceof ut&&(e=(i=e).ownerElement),s instanceof ut&&(s=(r=s).ownerElement,i&&e&&s===e))for(var n,o=0;n=s.attributes[o];o++){if(n===i)return F.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+F.DOCUMENT_POSITION_PRECEDING;if(n===r)return F.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+F.DOCUMENT_POSITION_FOLLOWING}if(!e||!s||s.ownerDocument!==e.ownerDocument)return F.DOCUMENT_POSITION_DISCONNECTED+F.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(j(s.ownerDocument)>j(e.ownerDocument)?F.DOCUMENT_POSITION_FOLLOWING:F.DOCUMENT_POSITION_PRECEDING);if(r&&e===s)return F.DOCUMENT_POSITION_CONTAINS+F.DOCUMENT_POSITION_PRECEDING;if(i&&e===s)return F.DOCUMENT_POSITION_CONTAINED_BY+F.DOCUMENT_POSITION_FOLLOWING;for(var a=[],l=e.parentNode;l;){if(!r&&l===s)return F.DOCUMENT_POSITION_CONTAINED_BY+F.DOCUMENT_POSITION_FOLLOWING;a.push(l),l=l.parentNode}a.reverse();for(var c=[],h=s.parentNode;h;){if(!i&&h===e)return F.DOCUMENT_POSITION_CONTAINS+F.DOCUMENT_POSITION_PRECEDING;c.push(h),h=h.parentNode}c.reverse();var d=U(a,c);for(var u in d.childNodes){var p=d.childNodes[u];if(p===s)return F.DOCUMENT_POSITION_FOLLOWING;if(p===e)return F.DOCUMENT_POSITION_PRECEDING;if(c.indexOf(p)>=0)return F.DOCUMENT_POSITION_FOLLOWING;if(a.indexOf(p)>=0)return F.DOCUMENT_POSITION_PRECEDING}return 0}},v(w,J),v(w,J.prototype),v(F,J),v(F,J.prototype),Q.prototype={implementation:null,nodeName:"#document",nodeType:M,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType===P){for(var s=t.firstChild;s;){var i=s.nextSibling;this.insertBefore(s,e),s=i}return t}return ht(this,t,e),t.ownerDocument=this,null===this.documentElement&&t.nodeType===T&&(this.documentElement=t),t},removeChild:function(t){var e=et(this,t);return e===this.documentElement&&(this.documentElement=null),e},replaceChild:function(t,e){ht(this,t,e,ct),t.ownerDocument=this,e&&this.removeChild(e),it(t)&&(this.documentElement=t)},importNode:function(t,e){return Lt(this,t,e)},getElementById:function(t){var e=null;return Y(this.documentElement,(function(s){if(s.nodeType==T&&s.getAttribute("id")==t)return e=s,!0})),e},createElement:function(t){var e=new dt(u);return e.ownerDocument=this,"html"===this.type&&(t=t.toLowerCase()),n(this.contentType)&&(e.namespaceURI=d.HTML),e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new q,(e.attributes=new V)._ownerElement=e,e},createDocumentFragment:function(){var t=new Nt(u);return t.ownerDocument=this,t.childNodes=new q,t},createTextNode:function(t){var e=new mt(u);return e.ownerDocument=this,e.childNodes=new q,e.appendData(t),e},createComment:function(t){var e=new gt(u);return e.ownerDocument=this,e.childNodes=new q,e.appendData(t),e},createCDATASection:function(t){var e=new ft(u);return e.ownerDocument=this,e.childNodes=new q,e.appendData(t),e},createProcessingInstruction:function(t,e){var s=new At(u);return s.ownerDocument=this,s.childNodes=new q,s.nodeName=s.target=t,s.nodeValue=s.data=e,s},createAttribute:function(t){if(!f.QName_exact.test(t))throw new m(m.INVALID_CHARACTER_ERR,'invalid character in name "'+t+'"');return"html"===this.type&&(t=t.toLowerCase()),this._createAttribute(t)},_createAttribute:function(t){var e=new ut(u);return e.ownerDocument=this,e.childNodes=new q,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){if(!f.Name.test(t))throw new m(m.INVALID_CHARACTER_ERR,'not a valid xml name "'+t+'"');if("html"===this.type)throw new m("document is an html document",g.NotSupportedError);var e=new yt(u);return e.ownerDocument=this,e.childNodes=new q,e.nodeName=t,e},createElementNS:function(t,e){var s=A(t,e),i=new dt(u),r=i.attributes=new V;return i.childNodes=new q,i.ownerDocument=this,i.nodeName=e,i.tagName=e,i.namespaceURI=s[0],i.prefix=s[1],i.localName=s[2],r._ownerElement=i,i},createAttributeNS:function(t,e){var s=A(t,e),i=new ut(u);return i.ownerDocument=this,i.childNodes=new q,i.nodeName=e,i.name=e,i.specified=!0,i.namespaceURI=s[0],i.prefix=s[1],i.localName=s[2],i}},_(Q,J),dt.prototype={nodeType:T,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return"html"===this.ownerDocument.type&&this.namespaceURI===d.HTML},hasAttributes:function(){return!(!this.attributes||!this.attributes.length)},hasAttribute:function(t){return!!this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e?e.value:null},getAttributeNode:function(t){return this._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase()),this.attributes.getNamedItem(t)},setAttribute:function(t,e){this._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase());var s=this.getAttributeNode(t);s?s.value=s.nodeValue=""+e:((s=this.ownerDocument._createAttribute(t)).value=s.nodeValue=""+e,this.setAttributeNode(s))},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var s=this.getAttributeNodeNS(t,e);s&&this.removeAttributeNode(s)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var s=this.getAttributeNodeNS(t,e);return s?s.value:null},setAttributeNS:function(t,e,s){var i=A(t,e)[2],r=this.getAttributeNodeNS(t,i);r?r.value=r.nodeValue=""+s:((r=this.ownerDocument.createAttributeNS(t,e)).value=r.nodeValue=""+s,this.setAttributeNode(r))},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByClassName:function(t){var e=y(t);return new H(this,(function(s){var i=[];return e.length>0&&Y(s,(function(r){if(r!==s&&r.nodeType===T){var n=r.getAttribute("class");if(n){var o=t===n;if(!o){var a=y(n);o=e.every((l=a,function(t){return l&&-1!==l.indexOf(t)}))}o&&i.push(r)}}var l})),i}))},getElementsByTagName:function(t){var e="html"===(this.nodeType===M?this:this.ownerDocument).type,s=t.toLowerCase();return new H(this,(function(i){var r=[];return Y(i,(function(n){n!==i&&n.nodeType===T&&(("*"===t||n.getQualifiedName()===(e&&n.namespaceURI===d.HTML?s:t))&&r.push(n))})),r}))},getElementsByTagNameNS:function(t,e){return new H(this,(function(s){var i=[];return Y(s,(function(r){r===s||r.nodeType!==T||"*"!==t&&r.namespaceURI!==t||"*"!==e&&r.localName!=e||i.push(r)})),i}))}},Q.prototype.getElementsByClassName=dt.prototype.getElementsByClassName,Q.prototype.getElementsByTagName=dt.prototype.getElementsByTagName,Q.prototype.getElementsByTagNameNS=dt.prototype.getElementsByTagNameNS,_(dt,J),ut.prototype.nodeType=C,_(ut,J),pt.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,s){s=this.data.substring(0,t)+s+this.data.substring(t+e),this.nodeValue=this.data=s,this.length=s.length}},_(pt,J),mt.prototype={nodeName:"#text",nodeType:L,splitText:function(t){var e=this.data,s=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var i=this.ownerDocument.createTextNode(s);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},_(mt,pt),gt.prototype={nodeName:"#comment",nodeType:O},_(gt,pt),ft.prototype={nodeName:"#cdata-section",nodeType:I},_(ft,mt),bt.prototype.nodeType=D,_(bt,J),Et.prototype.nodeType=B,_(Et,J),xt.prototype.nodeType=S,_(xt,J),yt.prototype.nodeType=R,_(yt,J),Nt.prototype.nodeName="#document-fragment",Nt.prototype.nodeType=P,_(Nt,J),At.prototype.nodeType=k,_(At,pt),vt.prototype.serializeToString=function(t,e){return _t.call(t,e)},J.prototype.toString=_t;try{if(Object.defineProperty){function St(t){switch(t.nodeType){case T:case P:var e=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&e.push(St(t)),t=t.nextSibling;return e.join("");default:return t.nodeValue}}Object.defineProperty(H.prototype,"length",{get:function(){return W(this),this.$$length}}),Object.defineProperty(J.prototype,"textContent",{get:function(){return St(this)},set:function(t){switch(this.nodeType){case T:case P:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),Rt=function(t,e,s){t["$$"+e]=s}}}catch(kt){}e._updateLiveList=W,e.Attr=ut,e.CDATASection=ft,e.CharacterData=pt,e.Comment=gt,e.Document=Q,e.DocumentFragment=Nt,e.DocumentType=bt,e.DOMImplementation=K,e.Element=dt,e.Entity=xt,e.EntityReference=yt,e.LiveNodeList=H,e.NamedNodeMap=V,e.Node=J,e.NodeList=q,e.Notation=Et,e.Text=mt,e.ProcessingInstruction=At,e.XMLSerializer=vt},802:(t,e,s)=>{"use strict";var i=s(870),r=s(731),n=s(767),o=i.isHTMLEscapableRawTextElement,a=i.isHTMLMimeType,l=i.isHTMLRawTextElement,c=i.hasOwn,h=i.NAMESPACE,d=n.ParseError,u=n.DOMException;function p(){}p.prototype={parse:function(t,e,s){var n=this.domBuilder;n.startDocument(),x(e,e=Object.create(null)),function(t,e,s,n,o){var l=a(n.mimeType);t.indexOf(r.UNICODE_REPLACEMENT_CHARACTER)>=0&&o.warning("Unicode replacement character detected, source encoding issues?");function h(t){if(t>65535){var e=55296+((t-=65536)>>10),s=56320+(1023&t);return String.fromCharCode(e,s)}return String.fromCharCode(t)}function p(t){var e=";"===t[t.length-1]?t:t+";";if(!l&&e!==t)return o.error("EntityRef: expecting ;"),t;var i=r.Reference.exec(e);if(!i||i[0].length!==e.length)return o.error("entity not matching Reference production: "+t),t;var n=e.slice(1,-1);return c(s,n)?s[n]:"#"===n.charAt(0)?h(parseInt(n.substring(1).replace("x","0x"))):(o.error("entity not found:"+t),t)}function x(e){if(e>R){var s=t.substring(R,e).replace(m,p);T&&C(R),n.characters(s,0,e-R),R=e}}var y=0,_=0,w=/\r\n?|\n|$/g,T=n.locator;function C(e,s){for(;e>=_&&(s=w.exec(t));)y=_,_=s.index+s[0].length,T.lineNumber++;T.columnNumber=e-y+1}var L=[{currentNSMap:e}],I=[],R=0;for(;;){try{var S=t.indexOf("<",R);if(S<0){if(!l&&I.length>0)return o.fatalError("unclosed xml tag(s): "+I.join(", "));if(!t.substring(R).match(/^\s*$/)){var k=n.doc,O=k.createTextNode(t.substring(R));if(k.documentElement)return o.error("Extra content at the end of the document");k.appendChild(O),n.currentElement=O}return}if(S>R){var M=t.substring(R,S);l||0!==I.length||(M=M.replace(new RegExp(r.S_OPT.source,"g"),""))&&o.error("Unexpected content outside root element: '"+M+"'"),x(S)}switch(t.charAt(S+1)){case"/":var D=t.indexOf(">",S+2),P=t.substring(S+2,D>0?D:void 0);if(!P)return o.fatalError("end tag name missing");var B=D>0&&r.reg("^",r.QName_group,r.S_OPT,"$").exec(P);if(!B)return o.fatalError('end tag name contains invalid characters: "'+P+'"');if(!n.currentElement&&!n.doc.documentElement)return;var F=I[I.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if(F!==B[1]){var U=B[1].toLowerCase();if(!l||F.toLowerCase()!==U)return o.fatalError('Opening and ending tag mismatch: "'+F+'" != "'+P+'"')}var j=L.pop();I.pop();var q=j.localNSMap;if(n.endElement(j.uri,j.localName,F),q)for(var H in q)c(q,H)&&n.endPrefixMapping(H);D++;break;case"?":T&&C(S),D=A(t,S,n,o);break;case"!":T&&C(S),D=N(t,S,n,o,l);break;default:T&&C(S);var W=new v,V=L[L.length-1].currentNSMap,G=(D=f(t,S,W,V,p,o,l),W.length);if(W.closed||(l&&i.isHTMLVoidElement(W.tagName)?W.closed=!0:I.push(W.tagName)),T&&G){for(var X=g(T,{}),z=0;z<G;z++){var K=W[z];C(K.offset),K.locator=g(T,{})}n.locator=X,b(W,n,V)&&L.push(W),n.locator=T}else b(W,n,V)&&L.push(W);l&&!W.closed?D=E(t,D,W.tagName,p,n):D++}}catch(t){if(t instanceof d)throw t;if(t instanceof u)throw new d(t.name+": "+t.message,n.locator,t);o.error("element parse error: "+t),D=-1}D>R?R=D:x(Math.max(S,R)+1)}}(t,e,s,n,this.errorHandler),n.endDocument()}};var m=/&#?\w+;?/g;function g(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function f(t,e,s,i,r,n,o){function a(t,e,i){return c(s.attributeNames,t)?n.fatalError("Attribute "+t+" redefined"):!o&&e.indexOf("<")>=0?n.fatalError("Unescaped '<' not allowed in attributes values"):void s.addValue(t,e.replace(/[\t\n\r]/g," ").replace(m,r),i)}for(var l,h=++e,d=0;;){var u=t.charAt(h);switch(u){case"=":if(1===d)l=t.slice(e,h),d=3;else{if(2!==d)throw new Error("attribute equal must after attrName");d=3}break;case"'":case'"':if(3===d||1===d){if(1===d&&(n.warning('attribute value must after "="'),l=t.slice(e,h)),e=h+1,!((h=t.indexOf(u,e))>0))throw new Error("attribute value no end '"+u+"' match");a(l,p=t.slice(e,h),e-1),d=5}else{if(4!=d)throw new Error('attribute value must after "="');a(l,p=t.slice(e,h),e),n.warning('attribute "'+l+'" missed start quot('+u+")!!"),e=h+1,d=5}break;case"/":switch(d){case 0:s.setTagName(t.slice(e,h));case 5:case 6:case 7:d=7,s.closed=!0;case 4:case 1:break;case 2:s.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return n.error("unexpected end of input"),0==d&&s.setTagName(t.slice(e,h)),h;case">":switch(d){case 0:s.setTagName(t.slice(e,h));case 5:case 6:case 7:break;case 4:case 1:"/"===(p=t.slice(e,h)).slice(-1)&&(s.closed=!0,p=p.slice(0,-1));case 2:2===d&&(p=l),4==d?(n.warning('attribute "'+p+'" missed quot(")!'),a(l,p,e)):(o||n.warning('attribute "'+p+'" missed value!! "'+p+'" instead!!'),a(p,p,e));break;case 3:if(!o)return n.fatalError("AttValue: ' or \" expected")}return h;case"\x80":u=" ";default:if(u<=" ")switch(d){case 0:s.setTagName(t.slice(e,h)),d=6;break;case 1:l=t.slice(e,h),d=2;break;case 4:var p=t.slice(e,h);n.warning('attribute "'+p+'" missed quot(")!!'),a(l,p,e);case 5:d=6}else switch(d){case 2:o||n.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),a(l,l,e),e=h,d=1;break;case 5:n.warning('attribute space is required"'+l+'"!!');case 6:d=1,e=h;break;case 3:d=4,e=h;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}h++}}function b(t,e,s){for(var i=t.tagName,r=null,n=t.length;n--;){var o=t[n],a=o.qName,l=o.value;if((m=a.indexOf(":"))>0)var d=o.prefix=a.slice(0,m),u=a.slice(m+1),p="xmlns"===d&&u;else u=a,d=null,p="xmlns"===a&&"";o.localName=u,!1!==p&&(null==r&&(r=Object.create(null),x(s,s=Object.create(null))),s[p]=r[p]=l,o.uri=h.XMLNS,e.startPrefixMapping(p,l))}for(n=t.length;n--;)(o=t[n]).prefix&&("xml"===o.prefix&&(o.uri=h.XML),"xmlns"!==o.prefix&&(o.uri=s[o.prefix]));var m;(m=i.indexOf(":"))>0?(d=t.prefix=i.slice(0,m),u=t.localName=i.slice(m+1)):(d=null,u=t.localName=i);var g=t.uri=s[d||""];if(e.startElement(g,u,i,t),!t.closed)return t.currentNSMap=s,t.localNSMap=r,!0;if(e.endElement(g,u,i),r)for(d in r)c(r,d)&&e.endPrefixMapping(d)}function E(t,e,s,i,r){var n=o(s);if(n||l(s)){var a=t.indexOf("</"+s+">",e),c=t.substring(e+1,a);return n&&(c=c.replace(m,i)),r.characters(c,0,c.length),a}return e+1}function x(t,e){for(var s in t)c(t,s)&&(e[s]=t[s])}function y(t,e){var s=e;function i(e){return e=e||0,t.charAt(s+e)}function n(t){s+=t=t||1}function o(){return t.substring(s)}return{char:i,getIndex:function(){return s},getMatch:function(t){var e=r.reg("^",t).exec(o());return e?(n(e[0].length),e[0]):null},getSource:function(){return t},skip:n,skipBlanks:function(){for(var e=0;s<t.length;){var r=i();if(" "!==r&&"\n"!==r&&"\t"!==r&&"\r"!==r)return e;e++,n()}return-1},substringFromIndex:o,substringStartsWith:function(e){return t.substring(s,s+e.length)===e},substringStartsWithCaseInsensitive:function(e){return t.substring(s,s+e.length).toUpperCase()===e.toUpperCase()}}}function N(t,e,s,i,n){var o=y(t,e);switch(n?o.char(2).toUpperCase():o.char(2)){case"-":var a=o.getMatch(r.Comment);return a?(s.comment(a,r.COMMENT_START.length,a.length-r.COMMENT_START.length-r.COMMENT_END.length),o.getIndex()):i.fatalError("comment is not well-formed at position "+o.getIndex());case"[":var l=o.getMatch(r.CDSect);return l?n||s.currentElement?(s.startCDATA(),s.characters(l,r.CDATA_START.length,l.length-r.CDATA_START.length-r.CDATA_END.length),s.endCDATA(),o.getIndex()):i.fatalError("CDATA outside of element"):i.fatalError("Invalid CDATA starting at position "+e);case"D":if(s.doc&&s.doc.documentElement)return i.fatalError("Doctype not allowed inside or after documentElement at position "+o.getIndex());if(n?!o.substringStartsWithCaseInsensitive(r.DOCTYPE_DECL_START):!o.substringStartsWith(r.DOCTYPE_DECL_START))return i.fatalError("Expected "+r.DOCTYPE_DECL_START+" at position "+o.getIndex());if(o.skip(r.DOCTYPE_DECL_START.length),o.skipBlanks()<1)return i.fatalError("Expected whitespace after "+r.DOCTYPE_DECL_START+" at position "+o.getIndex());var c={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(c.name=o.getMatch(r.Name),!c.name)return i.fatalError("doctype name missing or contains unexpected characters at position "+o.getIndex());if(n&&"html"!==c.name.toLowerCase()&&i.warning("Unexpected DOCTYPE in HTML document at position "+o.getIndex()),o.skipBlanks(),o.substringStartsWith(r.PUBLIC)||o.substringStartsWith(r.SYSTEM)){var h=r.ExternalID_match.exec(o.substringFromIndex());if(!h)return i.fatalError("doctype external id is not well-formed at position "+o.getIndex());void 0!==h.groups.SystemLiteralOnly?c.systemId=h.groups.SystemLiteralOnly:(c.systemId=h.groups.SystemLiteral,c.publicId=h.groups.PubidLiteral),o.skip(h[0].length)}else if(n&&o.substringStartsWithCaseInsensitive(r.SYSTEM)){if(o.skip(r.SYSTEM.length),o.skipBlanks()<1)return i.fatalError("Expected whitespace after "+r.SYSTEM+" at position "+o.getIndex());if(c.systemId=o.getMatch(r.ABOUT_LEGACY_COMPAT_SystemLiteral),!c.systemId)return i.fatalError("Expected "+r.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+r.SYSTEM+" at position "+o.getIndex())}return n&&c.systemId&&!r.ABOUT_LEGACY_COMPAT_SystemLiteral.test(c.systemId)&&i.warning("Unexpected doctype.systemId in HTML document at position "+o.getIndex()),n||(o.skipBlanks(),c.internalSubset=function(t,e){function s(t,e){var s=r.PI.exec(t.substringFromIndex());return s?"xml"===s[1].toLowerCase()?e.fatalError("xml declaration is only allowed at the start of the document, but found at position "+t.getIndex()):(t.skip(s[0].length),s[0]):e.fatalError("processing instruction is not well-formed at position "+t.getIndex())}var i=t.getSource();if("["===t.char()){t.skip(1);for(var n=t.getIndex();t.getIndex()<i.length;){if(t.skipBlanks(),"]"===t.char()){var o=i.substring(n,t.getIndex());return t.skip(1),o}var a=null;if("<"===t.char()&&"!"===t.char(1))switch(t.char(2)){case"E":"L"===t.char(3)?a=t.getMatch(r.elementdecl):"N"===t.char(3)&&(a=t.getMatch(r.EntityDecl));break;case"A":a=t.getMatch(r.AttlistDecl);break;case"N":a=t.getMatch(r.NotationDecl);break;case"-":a=t.getMatch(r.Comment)}else if("<"===t.char()&&"?"===t.char(1))a=s(t,e);else{if("%"!==t.char())return e.fatalError("Error detected in Markup declaration");a=t.getMatch(r.PEReference)}if(!a)return e.fatalError("Error in internal subset at position "+t.getIndex())}return e.fatalError("doctype internal subset is not well-formed, missing ]")}}(o,i)),o.skipBlanks(),">"!==o.char()?i.fatalError("doctype not terminated with > at position "+o.getIndex()):(o.skip(1),s.startDTD(c.name,c.publicId,c.systemId,c.internalSubset),s.endDTD(),o.getIndex());default:return i.fatalError('Not well-formed XML starting with "<!" at position '+e)}}function A(t,e,s,i){var n=t.substring(e).match(r.PI);if(!n)return i.fatalError("Invalid processing instruction starting at position "+e);if("xml"===n[1].toLowerCase()){if(e>0)return i.fatalError("processing instruction at position "+e+" is an xml declaration which is only at the start of the document");if(!r.XMLDecl.test(t.substring(e)))return i.fatalError("xml declaration is not well-formed")}return s.processingInstruction(n[1],n[2]),e+n[0].length}function v(){this.attributeNames=Object.create(null)}v.prototype={setTagName:function(t){if(!r.QName_exact.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,s){if(!r.QName_exact.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:s}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},e.XMLReader=p,e.parseUtils=y,e.parseDoctypeCommentOrCData=N},870:(t,e)=>{"use strict";function s(t,e){return void 0===e&&(e=Object),e&&"function"==typeof e.getOwnPropertyDescriptors&&(t=e.create(null,e.getOwnPropertyDescriptors(t))),e&&"function"==typeof e.freeze?e.freeze(t):t}function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var r=s({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});var n=s({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});var o=s({script:!1,style:!1,textarea:!0,title:!0});function a(t){return t===l.HTML}var l=s({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),c=Object.keys(l).map((function(t){return l[t]}));var h=s({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});e.assign=function(t,e){if(null===t||"object"!=typeof t)throw new TypeError("target is not an object");for(var s in e)i(e,s)&&(t[s]=e[s]);return t},e.find=function(t,e,s){if(void 0===s&&(s=Array.prototype),t&&"function"==typeof s.find)return s.find.call(t,e);for(var r=0;r<t.length;r++)if(i(t,r)){var n=t[r];if(e.call(void 0,n,r,t))return n}},e.freeze=s,e.HTML_BOOLEAN_ATTRIBUTES=r,e.HTML_RAW_TEXT_ELEMENTS=o,e.HTML_VOID_ELEMENTS=n,e.hasDefaultHTMLNamespace=function(t){return a(t)||t===l.XML_XHTML_APPLICATION},e.hasOwn=i,e.isHTMLBooleanAttribute=function(t){return i(r,t.toLowerCase())},e.isHTMLRawTextElement=function(t){var e=t.toLowerCase();return i(o,e)&&!o[e]},e.isHTMLEscapableRawTextElement=function(t){var e=t.toLowerCase();return i(o,e)&&o[e]},e.isHTMLMimeType=a,e.isHTMLVoidElement=function(t){return i(n,t.toLowerCase())},e.isValidMimeType=function(t){return c.indexOf(t)>-1},e.MIME_TYPE=l,e.NAMESPACE=h},904:(t,e,s)=>{"use strict";s.d(e,{u:()=>i});class i{static ensureLocale(t,e){return i.LOCALES.get(t)?t:(console.error(`Locale ${t} does not exist! Using ${i.LOCALES.get(e)} instead.`),e)}}i.VERSION="5.0.0-beta.3",i.LOCALES=new Map([["af","Afrikaans"],["ca","Catalan"],["da","Danish"],["de","German"],["en","English"],["es","Spanish"],["euro","Euro"],["fr","French"],["hi","Hindi"],["it","Italian"],["ko","Korean"],["nb","Bokm\xe5l"],["nn","Nynorsk"],["sv","Swedish"],["nemeth","Nemeth"]]),i.mathjaxVersion="4.0.0",i.url="https://cdn.jsdelivr.net/npm/speech-rule-engine@"+i.VERSION+"/lib/mathmaps"},999:(t,e,s)=>{(function(){"use strict";var e=this;function s(t){return"string"==typeof t}function i(t,e,s){return t.call.apply(t.bind,arguments)}function r(t,e,s){if(!t)throw Error();if(2<arguments.length){var i=Array.prototype.slice.call(arguments,2);return function(){var s=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(s,i),t.apply(e,s)}}return function(){return t.apply(e,arguments)}}function n(t,e,s){return(n=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?i:r).apply(null,arguments)}function o(t){var e=ot;function s(){}s.prototype=e.prototype,t.G=e.prototype,t.prototype=new s,t.prototype.constructor=t,t.F=function(t,s,i){for(var r=Array(arguments.length-2),n=2;n<arguments.length;n++)r[n-2]=arguments[n];return e.prototype[s].apply(t,r)}}var a=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};function l(t,e){return-1!=t.indexOf(e)}function c(t,e){return t<e?-1:t>e?1:0}var h,d=Array.prototype.indexOf?function(t,e,s){return Array.prototype.indexOf.call(t,e,s)}:function(t,e,i){if(i=null==i?0:0>i?Math.max(0,t.length+i):i,s(t))return s(e)&&1==e.length?t.indexOf(e,i):-1;for(;i<t.length;i++)if(i in t&&t[i]===e)return i;return-1},u=Array.prototype.forEach?function(t,e,s){Array.prototype.forEach.call(t,e,s)}:function(t,e,i){for(var r=t.length,n=s(t)?t.split(""):t,o=0;o<r;o++)o in n&&e.call(i,n[o],o,t)},p=Array.prototype.filter?function(t,e,s){return Array.prototype.filter.call(t,e,s)}:function(t,e,i){for(var r=t.length,n=[],o=0,a=s(t)?t.split(""):t,l=0;l<r;l++)if(l in a){var c=a[l];e.call(i,c,l,t)&&(n[o++]=c)}return n},m=Array.prototype.reduce?function(t,e,s,i){return i&&(e=n(e,i)),Array.prototype.reduce.call(t,e,s)}:function(t,e,s,i){var r=s;return u(t,(function(s,n){r=e.call(i,r,s,n,t)})),r},g=Array.prototype.some?function(t,e,s){return Array.prototype.some.call(t,e,s)}:function(t,e,i){for(var r=t.length,n=s(t)?t.split(""):t,o=0;o<r;o++)if(o in n&&e.call(i,n[o],o,t))return!0;return!1};t:{var f=e.navigator;if(f){var b=f.userAgent;if(b){h=b;break t}}h=""}var E,x,y=l(h,"Opera")||l(h,"OPR"),N=l(h,"Trident")||l(h,"MSIE"),A=l(h,"Edge"),v=l(h,"Gecko")&&!(l(h.toLowerCase(),"webkit")&&!l(h,"Edge"))&&!(l(h,"Trident")||l(h,"MSIE"))&&!l(h,"Edge"),_=l(h.toLowerCase(),"webkit")&&!l(h,"Edge");function w(){var t=e.document;return t?t.documentMode:void 0}t:{var T="",C=(x=h,v?/rv\:([^\);]+)(\)|;)/.exec(x):A?/Edge\/([\d\.]+)/.exec(x):N?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(x):_?/WebKit\/(\S+)/.exec(x):y?/(?:Version)[ \/]?(\S+)/.exec(x):void 0);if(C&&(T=C?C[1]:""),N){var L=w();if(null!=L&&L>parseFloat(T)){E=String(L);break t}}E=T}var I={};function R(t){if(!I[t]){for(var e=0,s=a(String(E)).split("."),i=a(String(t)).split("."),r=Math.max(s.length,i.length),n=0;0==e&&n<r;n++){var o=s[n]||"",l=i[n]||"",h=/(\d*)(\D*)/g,d=/(\d*)(\D*)/g;do{var u=h.exec(o)||["","",""],p=d.exec(l)||["","",""];if(0==u[0].length&&0==p[0].length)break;e=c(0==u[1].length?0:parseInt(u[1],10),0==p[1].length?0:parseInt(p[1],10))||c(0==u[2].length,0==p[2].length)||c(u[2],p[2])}while(0==e)}I[t]=0<=e}}var S=e.document,k=S&&N?w()||("CSS1Compat"==S.compatMode?parseInt(E,10):5):void 0,O=N&&!(9<=Number(k)),M=N&&!(8<=Number(k));function D(t,e,s,i){this.a=t,this.nodeName=s,this.nodeValue=i,this.nodeType=2,this.parentNode=this.ownerElement=e}function P(t,e){var s=M&&"href"==e.nodeName?t.getAttribute(e.nodeName,2):e.nodeValue;return new D(e,t,e.nodeName,s)}function B(t){var e=null;if(1==(s=t.nodeType)&&(e=null==(e=null==(e=t.textContent)||null==e?t.innerText:e)||null==e?"":e),"string"!=typeof e)if(O&&"title"==t.nodeName.toLowerCase()&&1==s)e=t.text;else if(9==s||1==s){t=9==s?t.documentElement:t.firstChild;var s=0,i=[];for(e="";t;){do{1!=t.nodeType&&(e+=t.nodeValue),O&&"title"==t.nodeName.toLowerCase()&&(e+=t.text),i[s++]=t}while(t=t.firstChild);for(;s&&!(t=i[--s].nextSibling););}}else e=t.nodeValue;return""+e}function F(t,e,s){if(null===e)return!0;try{if(!t.getAttribute)return!1}catch(t){return!1}return M&&"class"==e&&(e="className"),null==s?!!t.getAttribute(e):t.getAttribute(e,2)==s}function U(t,e,i,r,n){return(O?j:q).call(null,t,e,s(i)?i:null,s(r)?r:null,n||new $)}function j(t,e,s,i,r){if(t instanceof Mt||8==t.b||s&&null===t.b){var n=e.all;if(!n)return r;if("*"!=(t=G(t))&&!(n=e.getElementsByTagName(t)))return r;if(s){for(var o=[],a=0;e=n[a++];)F(e,s,i)&&o.push(e);n=o}for(a=0;e=n[a++];)"*"==t&&"!"==e.tagName||tt(r,e);return r}return V(t,e,s,i,r),r}function q(t,e,s,i,r){return e.getElementsByName&&i&&"name"==s&&!N?(e=e.getElementsByName(i),u(e,(function(e){t.a(e)&&tt(r,e)}))):e.getElementsByClassName&&i&&"class"==s?(e=e.getElementsByClassName(i),u(e,(function(e){e.className==i&&t.a(e)&&tt(r,e)}))):t instanceof wt?V(t,e,s,i,r):e.getElementsByTagName&&(e=e.getElementsByTagName(t.f()),u(e,(function(t){F(t,s,i)&&tt(r,t)}))),r}function H(t,e,s,i,r){var n;if((t instanceof Mt||8==t.b||s&&null===t.b)&&(n=e.childNodes)){var o=G(t);return"*"==o||(n=p(n,(function(t){return t.tagName&&t.tagName.toLowerCase()==o})),n)?(s&&(n=p(n,(function(t){return F(t,s,i)}))),u(n,(function(t){"*"==o&&("!"==t.tagName||"*"==o&&1!=t.nodeType)||tt(r,t)})),r):r}return W(t,e,s,i,r)}function W(t,e,s,i,r){for(e=e.firstChild;e;e=e.nextSibling)F(e,s,i)&&t.a(e)&&tt(r,e);return r}function V(t,e,s,i,r){for(e=e.firstChild;e;e=e.nextSibling)F(e,s,i)&&t.a(e)&&tt(r,e),V(t,e,s,i,r)}function G(t){if(t instanceof wt){if(8==t.b)return"!";if(null===t.b)return"*"}return t.f()}function X(t,e){if(!t||!e)return!1;if(t.contains&&1==e.nodeType)return t==e||t.contains(e);if(void 0!==t.compareDocumentPosition)return t==e||!!(16&t.compareDocumentPosition(e));for(;e&&t!=e;)e=e.parentNode;return e==t}function z(t,s){if(t==s)return 0;if(t.compareDocumentPosition)return 2&t.compareDocumentPosition(s)?1:-1;if(N&&!(9<=Number(k))){if(9==t.nodeType)return-1;if(9==s.nodeType)return 1}if("sourceIndex"in t||t.parentNode&&"sourceIndex"in t.parentNode){var i=1==t.nodeType,r=1==s.nodeType;if(i&&r)return t.sourceIndex-s.sourceIndex;var n=t.parentNode,o=s.parentNode;return n==o?J(t,s):!i&&X(n,s)?-1*K(t,s):!r&&X(o,t)?K(s,t):(i?t.sourceIndex:n.sourceIndex)-(r?s.sourceIndex:o.sourceIndex)}return(i=(r=9==t.nodeType?t:t.ownerDocument||t.document).createRange()).selectNode(t),i.collapse(!0),(r=r.createRange()).selectNode(s),r.collapse(!0),i.compareBoundaryPoints(e.Range.START_TO_END,r)}function K(t,e){var s=t.parentNode;if(s==e)return-1;for(var i=e;i.parentNode!=s;)i=i.parentNode;return J(i,t)}function J(t,e){for(var s=e;s=s.previousSibling;)if(s==t)return-1;return 1}function $(){this.b=this.a=null,this.l=0}function Y(t){this.node=t,this.a=this.b=null}function Q(t,e){if(!t.a)return e;if(!e.a)return t;for(var s=t.a,i=e.a,r=null,n=null,o=0;s&&i;){n=s.node;var a=i.node;n==a||n instanceof D&&a instanceof D&&n.a==a.a?(n=s,s=s.a,i=i.a):0<z(s.node,i.node)?(n=i,i=i.a):(n=s,s=s.a),(n.b=r)?r.a=n:t.a=n,r=n,o++}for(n=s||i;n;)n.b=r,r=r.a=n,o++,n=n.a;return t.b=r,t.l=o,t}function Z(t,e){var s=new Y(e);s.a=t.a,t.b?t.a.b=s:t.a=t.b=s,t.a=s,t.l++}function tt(t,e){var s=new Y(e);s.b=t.b,t.a?t.b.a=s:t.a=t.b=s,t.b=s,t.l++}function et(t){return(t=t.a)?t.node:null}function st(t){return(t=et(t))?B(t):""}function it(t,e){return new rt(t,!!e)}function rt(t,e){this.f=t,this.b=(this.c=e)?t.b:t.a,this.a=null}function nt(t){var e=t.b;if(null==e)return null;var s=t.a=e;return t.b=t.c?e.b:e.a,s.node}function ot(t){this.i=t,this.b=this.g=!1,this.f=null}function at(t){return"\n "+t.toString().split("\n").join("\n ")}function lt(t,e){t.g=e}function ct(t,e){t.b=e}function ht(t,e){var s=t.a(e);return s instanceof $?+st(s):+s}function dt(t,e){var s=t.a(e);return s instanceof $?st(s):""+s}function ut(t,e){var s=t.a(e);return s instanceof $?!!s.l:!!s}function pt(t,e,s){ot.call(this,t.i),this.c=t,this.h=e,this.o=s,this.g=e.g||s.g,this.b=e.b||s.b,this.c==Et&&(s.b||s.g||4==s.i||0==s.i||!e.f?e.b||e.g||4==e.i||0==e.i||!s.f||(this.f={name:s.f.name,s:e}):this.f={name:e.f.name,s})}function mt(t,e,s,i,r){var n;if(e=e.a(i),s=s.a(i),e instanceof $&&s instanceof $){for(i=nt(e=it(e));i;i=nt(e))for(n=nt(r=it(s));n;n=nt(r))if(t(B(i),B(n)))return!0;return!1}if(e instanceof $||s instanceof $){e instanceof $?(r=e,i=s):(r=s,i=e);for(var o=typeof i,a=nt(n=it(r));a;a=nt(n)){switch(o){case"number":a=+B(a);break;case"boolean":a=!!B(a);break;case"string":a=B(a);break;default:throw Error("Illegal primitive type for comparison.")}if(r==e&&t(a,i)||r==s&&t(i,a))return!0}return!1}return r?"boolean"==typeof e||"boolean"==typeof s?t(!!e,!!s):"number"==typeof e||"number"==typeof s?t(+e,+s):t(e,s):t(+e,+s)}function gt(t,e,s,i){this.a=t,this.w=e,this.i=s,this.m=i}!v&&!N||N&&9<=Number(k)||v&&R("1.9.1"),N&&R("9"),o(pt),pt.prototype.a=function(t){return this.c.m(this.h,this.o,t)},pt.prototype.toString=function(){return"Binary Expression: "+this.c+at(this.h)+at(this.o)},gt.prototype.toString=function(){return this.a};var ft={};function bt(t,e,s,i){if(ft.hasOwnProperty(t))throw Error("Binary operator already created: "+t);return t=new gt(t,e,s,i),ft[t.toString()]=t}bt("div",6,1,(function(t,e,s){return ht(t,s)/ht(e,s)})),bt("mod",6,1,(function(t,e,s){return ht(t,s)%ht(e,s)})),bt("*",6,1,(function(t,e,s){return ht(t,s)*ht(e,s)})),bt("+",5,1,(function(t,e,s){return ht(t,s)+ht(e,s)})),bt("-",5,1,(function(t,e,s){return ht(t,s)-ht(e,s)})),bt("<",4,2,(function(t,e,s){return mt((function(t,e){return t<e}),t,e,s)})),bt(">",4,2,(function(t,e,s){return mt((function(t,e){return t>e}),t,e,s)})),bt("<=",4,2,(function(t,e,s){return mt((function(t,e){return t<=e}),t,e,s)})),bt(">=",4,2,(function(t,e,s){return mt((function(t,e){return t>=e}),t,e,s)}));var Et=bt("=",3,2,(function(t,e,s){return mt((function(t,e){return t==e}),t,e,s,!0)}));function xt(t,e,s){this.a=t,this.b=e||1,this.f=s||1}function yt(t,e){if(e.a.length&&4!=t.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");ot.call(this,t.i),this.c=t,this.h=e,this.g=t.g,this.b=t.b}function Nt(t,e){if(e.length<t.A)throw Error("Function "+t.j+" expects at least"+t.A+" arguments, "+e.length+" given");if(null!==t.v&&e.length>t.v)throw Error("Function "+t.j+" expects at most "+t.v+" arguments, "+e.length+" given");t.B&&u(e,(function(e,s){if(4!=e.i)throw Error("Argument "+s+" to function "+t.j+" is not of type Nodeset: "+e)})),ot.call(this,t.i),this.h=t,this.c=e,lt(this,t.g||g(e,(function(t){return t.g}))),ct(this,t.D&&!e.length||t.C&&!!e.length||g(e,(function(t){return t.b})))}function At(t,e,s,i,r,n,o,a,l){this.j=t,this.i=e,this.g=s,this.D=i,this.C=r,this.m=n,this.A=o,this.v=void 0!==a?a:o,this.B=!!l}bt("!=",3,2,(function(t,e,s){return mt((function(t,e){return t!=e}),t,e,s,!0)})),bt("and",2,2,(function(t,e,s){return ut(t,s)&&ut(e,s)})),bt("or",1,2,(function(t,e,s){return ut(t,s)||ut(e,s)})),o(yt),yt.prototype.a=function(t){return t=this.c.a(t),qt(this.h,t)},yt.prototype.toString=function(){return"Filter:"+at(this.c)+at(this.h)},o(Nt),Nt.prototype.a=function(t){return this.h.m.apply(null,function(t){return Array.prototype.concat.apply(Array.prototype,arguments)}(t,this.c))},Nt.prototype.toString=function(){var t="Function: "+this.h;if(this.c.length){var e=m(this.c,(function(t,e){return t+at(e)}),"Arguments:");t=t+at(e)}return t},At.prototype.toString=function(){return this.j};var vt={};function _t(t,e,s,i,r,n,o,a){if(vt.hasOwnProperty(t))throw Error("Function already created: "+t+".");vt[t]=new At(t,e,s,i,!1,r,n,o,a)}function wt(t,e){switch(this.h=t,this.c=void 0!==e?e:null,this.b=null,t){case"comment":this.b=8;break;case"text":this.b=3;break;case"processing-instruction":this.b=7;break;case"node":break;default:throw Error("Unexpected argument")}}function Tt(t){return"comment"==t||"text"==t||"processing-instruction"==t||"node"==t}function Ct(t){this.b=t,this.a=0}_t("boolean",2,!1,!1,(function(t,e){return ut(e,t)}),1),_t("ceiling",1,!1,!1,(function(t,e){return Math.ceil(ht(e,t))}),1),_t("concat",3,!1,!1,(function(t,e){return m(function(t,e,s){return 2>=arguments.length?Array.prototype.slice.call(t,e):Array.prototype.slice.call(t,e,s)}(arguments,1),(function(e,s){return e+dt(s,t)}),"")}),2,null),_t("contains",2,!1,!1,(function(t,e,s){return l(dt(e,t),dt(s,t))}),2),_t("count",1,!1,!1,(function(t,e){return e.a(t).l}),1,1,!0),_t("false",2,!1,!1,(function(){return!1}),0),_t("floor",1,!1,!1,(function(t,e){return Math.floor(ht(e,t))}),1),_t("id",4,!1,!1,(function(t,e){function i(t){if(O){var e=r.all[t];if(e){if(e.nodeType&&t==e.id)return e;if(e.length)return function(t,e){var i;t:{i=t.length;for(var r=s(t)?t.split(""):t,n=0;n<i;n++)if(n in r&&e.call(void 0,r[n],n,t)){i=n;break t}i=-1}return 0>i?null:s(t)?t.charAt(i):t[i]}(e,(function(e){return t==e.id}))}return null}return r.getElementById(t)}var r=9==(n=t.a).nodeType?n:n.ownerDocument,n=dt(e,t).split(/\s+/),o=[];u(n,(function(t){!(t=i(t))||0<=d(o,t)||o.push(t)})),o.sort(z);var a=new $;return u(o,(function(t){tt(a,t)})),a}),1),_t("lang",2,!1,!1,(function(){return!1}),1),_t("last",1,!0,!1,(function(t){if(1!=arguments.length)throw Error("Function last expects ()");return t.f}),0),_t("local-name",3,!1,!0,(function(t,e){var s=e?et(e.a(t)):t.a;return s?s.localName||s.nodeName.toLowerCase():""}),0,1,!0),_t("name",3,!1,!0,(function(t,e){var s=e?et(e.a(t)):t.a;return s?s.nodeName.toLowerCase():""}),0,1,!0),_t("namespace-uri",3,!0,!1,(function(){return""}),0,1,!0),_t("normalize-space",3,!1,!0,(function(t,e){return(e?dt(e,t):B(t.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")}),0,1),_t("not",2,!1,!1,(function(t,e){return!ut(e,t)}),1),_t("number",1,!1,!0,(function(t,e){return e?ht(e,t):+B(t.a)}),0,1),_t("position",1,!0,!1,(function(t){return t.b}),0),_t("round",1,!1,!1,(function(t,e){return Math.round(ht(e,t))}),1),_t("starts-with",2,!1,!1,(function(t,e,s){return e=dt(e,t),t=dt(s,t),0==e.lastIndexOf(t,0)}),2),_t("string",3,!1,!0,(function(t,e){return e?dt(e,t):B(t.a)}),0,1),_t("string-length",1,!1,!0,(function(t,e){return(e?dt(e,t):B(t.a)).length}),0,1),_t("substring",3,!1,!1,(function(t,e,s,i){if(s=ht(s,t),isNaN(s)||1/0==s||-1/0==s)return"";if(i=i?ht(i,t):1/0,isNaN(i)||-1/0===i)return"";s=Math.round(s)-1;var r=Math.max(s,0);return t=dt(e,t),1/0==i?t.substring(r):t.substring(r,s+Math.round(i))}),2,3),_t("substring-after",3,!1,!1,(function(t,e,s){return e=dt(e,t),t=dt(s,t),-1==(s=e.indexOf(t))?"":e.substring(s+t.length)}),2),_t("substring-before",3,!1,!1,(function(t,e,s){return e=dt(e,t),t=dt(s,t),-1==(t=e.indexOf(t))?"":e.substring(0,t)}),2),_t("sum",1,!1,!1,(function(t,e){for(var s=it(e.a(t)),i=0,r=nt(s);r;r=nt(s))i+=+B(r);return i}),1,1,!0),_t("translate",3,!1,!1,(function(t,e,s,i){e=dt(e,t),s=dt(s,t);var r=dt(i,t);for(t={},i=0;i<s.length;i++){var n=s.charAt(i);n in t||(t[n]=r.charAt(i))}for(s="",i=0;i<e.length;i++)s+=(n=e.charAt(i))in t?t[n]:n;return s}),3),_t("true",2,!1,!1,(function(){return!0}),0),wt.prototype.a=function(t){return null===this.b||this.b==t.nodeType},wt.prototype.f=function(){return this.h},wt.prototype.toString=function(){var t="Kind Test: "+this.h;return null===this.c||(t+=at(this.c)),t};var Lt=/\$?(?:(?![0-9-\.])(?:\*|[\w-\.]+):)?(?![0-9-\.])(?:\*|[\w-\.]+)|\/\/|\.\.|::|\d+(?:\.\d*)?|\.\d+|"[^"]*"|'[^']*'|[!<>]=|\s+|./g,It=/^\s/;function Rt(t,e){return t.b[t.a+(e||0)]}function St(t){return t.b[t.a++]}function kt(t){return t.b.length<=t.a}function Ot(t){ot.call(this,3),this.c=t.substring(1,t.length-1)}function Mt(t,e){var s;this.j=t.toLowerCase(),s="*"==this.j?"*":"http://www.w3.org/1999/xhtml",this.c=e?e.toLowerCase():s}function Dt(t,e){if(ot.call(this,t.i),this.h=t,this.c=e,this.g=t.g,this.b=t.b,1==this.c.length){var s=this.c[0];s.u||s.c!=Xt||"*"!=(s=s.o).f()&&(this.f={name:s.f(),s:null})}}function Pt(){ot.call(this,4)}function Bt(){ot.call(this,4)}function Ft(t){return"/"==t||"//"==t}function Ut(t){ot.call(this,4),this.c=t,lt(this,g(this.c,(function(t){return t.g}))),ct(this,g(this.c,(function(t){return t.b})))}function jt(t,e){this.a=t,this.b=!!e}function qt(t,e,s){for(s=s||0;s<t.a.length;s++)for(var i,r=t.a[s],n=it(e),o=e.l,a=0;i=nt(n);a++){var l=t.b?o-a:a+1;if("number"==typeof(i=r.a(new xt(i,l,o))))l=l==i;else if("string"==typeof i||"boolean"==typeof i)l=!!i;else{if(!(i instanceof $))throw Error("Predicate.evaluate returned an unexpected type.");l=0<i.l}if(!l){if(i=(l=n).f,!(h=l.a))throw Error("Next must be called at least once before remove.");var c=h.b,h=h.a;c?c.a=h:i.a=h,h?h.b=c:i.b=c,i.l--,l.a=null}}return e}function Ht(t,e,s,i){ot.call(this,4),this.c=t,this.o=e,this.h=s||new jt([]),this.u=!!i,e=0<(e=this.h).a.length?e.a[0].f:null,t.b&&e&&(t=e.name,t=O?t.toLowerCase():t,this.f={name:t,s:e.s});t:{for(t=this.h,e=0;e<t.a.length;e++)if((s=t.a[e]).g||1==s.i||0==s.i){t=!0;break t}t=!1}this.g=t}function Wt(t,e,s,i){this.j=t,this.f=e,this.a=s,this.b=i}o(Ot),Ot.prototype.a=function(){return this.c},Ot.prototype.toString=function(){return"Literal: "+this.c},Mt.prototype.a=function(t){var e=t.nodeType;return(1==e||2==e)&&(e=void 0!==t.localName?t.localName:t.nodeName,("*"==this.j||this.j==e.toLowerCase())&&("*"==this.c||this.c==(t.namespaceURI?t.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")))},Mt.prototype.f=function(){return this.j},Mt.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.j},o(Dt),o(Pt),Pt.prototype.a=function(t){var e=new $;return 9==(t=t.a).nodeType?tt(e,t):tt(e,t.ownerDocument),e},Pt.prototype.toString=function(){return"Root Helper Expression"},o(Bt),Bt.prototype.a=function(t){var e=new $;return tt(e,t.a),e},Bt.prototype.toString=function(){return"Context Helper Expression"},Dt.prototype.a=function(t){var e=this.h.a(t);if(!(e instanceof $))throw Error("Filter expression must evaluate to nodeset.");for(var s=0,i=(t=this.c).length;s<i&&e.l;s++){var r,n=t[s],o=it(e,n.c.a);if(n.g||n.c!=Jt)if(n.g||n.c!=Yt)for(r=nt(o),e=n.a(new xt(r));null!=(r=nt(o));)e=Q(e,r=n.a(new xt(r)));else r=nt(o),e=n.a(new xt(r));else{for(r=nt(o);(e=nt(o))&&(!r.contains||r.contains(e))&&8&e.compareDocumentPosition(r);r=e);e=n.a(new xt(r))}}return e},Dt.prototype.toString=function(){var t;if(t="Path Expression:"+at(this.h),this.c.length){var e=m(this.c,(function(t,e){return t+at(e)}),"Steps:");t+=at(e)}return t},o(Ut),Ut.prototype.a=function(t){var e=new $;return u(this.c,(function(s){if(!((s=s.a(t))instanceof $))throw Error("Path expression must evaluate to NodeSet.");e=Q(e,s)})),e},Ut.prototype.toString=function(){return m(this.c,(function(t,e){return t+at(e)}),"Union Expression:")},jt.prototype.toString=function(){return m(this.a,(function(t,e){return t+at(e)}),"Predicates:")},o(Ht),Ht.prototype.a=function(t){var e=t.a,s=null,i=null,r=null,n=0;if((s=this.f)&&(i=s.name,r=s.s?dt(s.s,t):null,n=1),this.u)if(this.g||this.c!=zt)if(e=nt(t=it(new Ht(Kt,new wt("node")).a(t))))for(s=this.m(e,i,r,n);null!=(e=nt(t));)s=Q(s,this.m(e,i,r,n));else s=new $;else s=U(this.o,e,i,r),s=qt(this.h,s,n);else s=this.m(t.a,i,r,n);return s},Ht.prototype.m=function(t,e,s,i){return t=this.c.f(this.o,t,e,s),qt(this.h,t,i)},Ht.prototype.toString=function(){var t;if(t="Step:"+at("Operator: "+(this.u?"//":"/")),this.c.j&&(t+=at("Axis: "+this.c)),t+=at(this.o),this.h.a.length){var e=m(this.h.a,(function(t,e){return t+at(e)}),"Predicates:");t+=at(e)}return t},Wt.prototype.toString=function(){return this.j};var Vt={};function Gt(t,e,s,i){if(Vt.hasOwnProperty(t))throw Error("Axis already created: "+t);return e=new Wt(t,e,s,!!i),Vt[t]=e}Gt("ancestor",(function(t,e){for(var s=new $,i=e;i=i.parentNode;)t.a(i)&&Z(s,i);return s}),!0),Gt("ancestor-or-self",(function(t,e){var s=new $,i=e;do{t.a(i)&&Z(s,i)}while(i=i.parentNode);return s}),!0);var Xt=Gt("attribute",(function(t,e){var s=new $;if("style"==(n=t.f())&&O&&e.style)return tt(s,new D(e.style,e,"style",e.style.cssText)),s;var i=e.attributes;if(i)if(t instanceof wt&&null===t.b||"*"==n)for(var r,n=0;r=i[n];n++)O?r.nodeValue&&tt(s,P(e,r)):tt(s,r);else(r=i.getNamedItem(n))&&(O?r.nodeValue&&tt(s,P(e,r)):tt(s,r));return s}),!1),zt=Gt("child",(function(t,e,i,r,n){return(O?H:W).call(null,t,e,s(i)?i:null,s(r)?r:null,n||new $)}),!1,!0);Gt("descendant",U,!1,!0);var Kt=Gt("descendant-or-self",(function(t,e,s,i){var r=new $;return F(e,s,i)&&t.a(e)&&tt(r,e),U(t,e,s,i,r)}),!1,!0),Jt=Gt("following",(function(t,e,s,i){var r=new $;do{for(var n=e;n=n.nextSibling;)F(n,s,i)&&t.a(n)&&tt(r,n),r=U(t,n,s,i,r)}while(e=e.parentNode);return r}),!1,!0);Gt("following-sibling",(function(t,e){for(var s=new $,i=e;i=i.nextSibling;)t.a(i)&&tt(s,i);return s}),!1),Gt("namespace",(function(){return new $}),!1);var $t=Gt("parent",(function(t,e){var s=new $;if(9==e.nodeType)return s;if(2==e.nodeType)return tt(s,e.ownerElement),s;var i=e.parentNode;return t.a(i)&&tt(s,i),s}),!1),Yt=Gt("preceding",(function(t,e,s,i){var r=new $,n=[];do{n.unshift(e)}while(e=e.parentNode);for(var o=1,a=n.length;o<a;o++){var l=[];for(e=n[o];e=e.previousSibling;)l.unshift(e);for(var c=0,h=l.length;c<h;c++)F(e=l[c],s,i)&&t.a(e)&&tt(r,e),r=U(t,e,s,i,r)}return r}),!0,!0);Gt("preceding-sibling",(function(t,e){for(var s=new $,i=e;i=i.previousSibling;)t.a(i)&&Z(s,i);return s}),!0);var Qt=Gt("self",(function(t,e){var s=new $;return t.a(e)&&tt(s,e),s}),!1);function Zt(t){ot.call(this,1),this.c=t,this.g=t.g,this.b=t.b}function te(t){ot.call(this,1),this.c=t}function ee(t,e){this.a=t,this.b=e}function se(t){for(var e,s=[];;){ie(t,"Missing right hand side of binary expression."),e=he(t);var i=St(t.a);if(!i)break;var r=(i=ft[i]||null)&&i.w;if(!r){t.a.a--;break}for(;s.length&&r<=s[s.length-1].w;)e=new pt(s.pop(),s.pop(),e);s.push(e,i)}for(;s.length;)e=new pt(s.pop(),s.pop(),e);return e}function ie(t,e){if(kt(t.a))throw Error(e)}function re(t,e){var s=St(t.a);if(s!=e)throw Error("Bad token, expected: "+e+" got: "+s)}function ne(t){if(")"!=(t=St(t.a)))throw Error("Bad token: "+t)}function oe(t){if(2>(t=St(t.a)).length)throw Error("Unclosed literal string");return new Ot(t)}function ae(t){var e,s,i=[];if(Ft(Rt(t.a))){if(e=St(t.a),s=Rt(t.a),"/"==e&&(kt(t.a)||"."!=s&&".."!=s&&"@"!=s&&"*"!=s&&!/(?![0-9])[\w]/.test(s)))return new Pt;s=new Pt,ie(t,"Missing next location step."),e=le(t,e),i.push(e)}else{t:{switch(s=(e=Rt(t.a)).charAt(0)){case"$":throw Error("Variable reference not allowed in HTML XPath");case"(":St(t.a),e=se(t),ie(t,'unclosed "("'),re(t,")");break;case'"':case"'":e=oe(t);break;default:if(isNaN(+e)){if(Tt(e)||!/(?![0-9])[\w]/.test(s)||"("!=Rt(t.a,1)){e=null;break t}for(e=St(t.a),e=vt[e]||null,St(t.a),s=[];")"!=Rt(t.a)&&(ie(t,"Missing function argument list."),s.push(se(t)),","==Rt(t.a));)St(t.a);ie(t,"Unclosed function argument list."),ne(t),e=new Nt(e,s)}else e=new te(+St(t.a))}"["==Rt(t.a)&&(e=new yt(e,s=new jt(ce(t))))}if(e){if(!Ft(Rt(t.a)))return e;s=e}else e=le(t,"/"),s=new Bt,i.push(e)}for(;Ft(Rt(t.a));)e=St(t.a),ie(t,"Missing next location step."),e=le(t,e),i.push(e);return new Dt(s,i)}function le(t,e){var s,i,r,n;if("/"!=e&&"//"!=e)throw Error('Step op should be "/" or "//"');if("."==Rt(t.a))return i=new Ht(Qt,new wt("node")),St(t.a),i;if(".."==Rt(t.a))return i=new Ht($t,new wt("node")),St(t.a),i;if("@"==Rt(t.a))n=Xt,St(t.a),ie(t,"Missing attribute name");else if("::"==Rt(t.a,1)){if(!/(?![0-9])[\w]/.test(Rt(t.a).charAt(0)))throw Error("Bad token: "+St(t.a));if(s=St(t.a),!(n=Vt[s]||null))throw Error("No axis with name: "+s);St(t.a),ie(t,"Missing node name")}else n=zt;if(s=Rt(t.a),!/(?![0-9])[\w\*]/.test(s.charAt(0)))throw Error("Bad token: "+St(t.a));if("("==Rt(t.a,1)){if(!Tt(s))throw Error("Invalid node type: "+s);if(!Tt(s=St(t.a)))throw Error("Invalid type name: "+s);re(t,"("),ie(t,"Bad nodetype");var o=null;'"'!=(r=Rt(t.a).charAt(0))&&"'"!=r||(o=oe(t)),ie(t,"Bad nodetype"),ne(t),s=new wt(s,o)}else if(-1==(r=(s=St(t.a)).indexOf(":")))s=new Mt(s);else{var a;if("*"==(o=s.substring(0,r)))a="*";else if(!(a=t.b(o)))throw Error("Namespace prefix not declared: "+o);s=new Mt(s=s.substr(r+1),a)}return r=new jt(ce(t),n.a),i||new Ht(n,s,r,"//"==e)}function ce(t){for(var e=[];"["==Rt(t.a);){St(t.a),ie(t,"Missing predicate expression.");var s=se(t);e.push(s),ie(t,"Unclosed predicate expression."),re(t,"]")}return e}function he(t){if("-"==Rt(t.a))return St(t.a),new Zt(he(t));var e=ae(t);if("|"!=Rt(t.a))t=e;else{for(e=[e];"|"==St(t.a);)ie(t,"Missing next union location path."),e.push(ae(t));t.a.a--,t=new Ut(e)}return t}function de(t){switch(t.nodeType){case 1:return function(t,e){var s=Array.prototype.slice.call(arguments,1);return function(){var e=s.slice();return e.push.apply(e,arguments),t.apply(this,e)}}(pe,t);case 9:return de(t.documentElement);case 11:case 10:case 6:case 12:return ue;default:return t.parentNode?de(t.parentNode):ue}}function ue(){return null}function pe(t,e){if(t.prefix==e)return t.namespaceURI||"http://www.w3.org/1999/xhtml";var s=t.getAttributeNode("xmlns:"+e);return s&&s.specified?s.value||null:t.parentNode&&9!=t.parentNode.nodeType?pe(t.parentNode,e):null}function me(t,e){if(!t.length)throw Error("Empty XPath expression.");var s=function(t){t=t.match(Lt);for(var e=0;e<t.length;e++)It.test(t[e])&&t.splice(e,1);return new Ct(t)}(t);if(kt(s))throw Error("Invalid XPath expression.");e?"function"==function(t){var e=typeof t;if("object"==e){if(!t)return"null";if(t instanceof Array)return"array";if(t instanceof Object)return e;var s=Object.prototype.toString.call(t);if("[object Window]"==s)return"object";if("[object Array]"==s||"number"==typeof t.length&&void 0!==t.splice&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==s||void 0!==t.call&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&void 0===t.call)return"object";return e}(e)||(e=n(e.lookupNamespaceURI,e)):e=function(){return null};var i=se(new ee(s,e));if(!kt(s))throw Error("Bad token: "+St(s));this.evaluate=function(t,e){return new ge(i.a(new xt(t)),e)}}function ge(t,e){if(0==e)if(t instanceof $)e=4;else if("string"==typeof t)e=2;else if("number"==typeof t)e=1;else{if("boolean"!=typeof t)throw Error("Unexpected evaluation result.");e=3}if(2!=e&&1!=e&&3!=e&&!(t instanceof $))throw Error("value could not be converted to the specified type");var s;switch(this.resultType=e,e){case 2:this.stringValue=t instanceof $?st(t):""+t;break;case 1:this.numberValue=t instanceof $?+st(t):+t;break;case 3:this.booleanValue=t instanceof $?0<t.l:!!t;break;case 4:case 5:case 6:case 7:var i=it(t);s=[];for(var r=nt(i);r;r=nt(i))s.push(r instanceof D?r.a:r);this.snapshotLength=t.l,this.invalidIteratorState=!1;break;case 8:case 9:i=et(t),this.singleNodeValue=i instanceof D?i.a:i;break;default:throw Error("Unknown XPathResult type.")}var n=0;this.iterateNext=function(){if(4!=e&&5!=e)throw Error("iterateNext called with wrong result type");return n>=s.length?null:s[n++]},this.snapshotItem=function(t){if(6!=e&&7!=e)throw Error("snapshotItem called with wrong result type");return t>=s.length||0>t?null:s[t]}}function fe(t){this.lookupNamespaceURI=de(t)}function be(t,s){var i=t||e,r=i.Document&&i.Document.prototype||i.document;r.evaluate&&!s||(i.XPathResult=ge,r.evaluate=function(t,e,s,i){return new me(t,s).evaluate(e,i)},r.createExpression=function(t,e){return new me(t,e)},r.createNSResolver=function(t){return new fe(t)})}o(Zt),Zt.prototype.a=function(t){return-ht(this.c,t)},Zt.prototype.toString=function(){return"Unary Expression: -"+at(this.c)},o(te),te.prototype.a=function(){return this.c},te.prototype.toString=function(){return"Number: "+this.c},ge.ANY_TYPE=0,ge.NUMBER_TYPE=1,ge.STRING_TYPE=2,ge.BOOLEAN_TYPE=3,ge.UNORDERED_NODE_ITERATOR_TYPE=4,ge.ORDERED_NODE_ITERATOR_TYPE=5,ge.UNORDERED_NODE_SNAPSHOT_TYPE=6,ge.ORDERED_NODE_SNAPSHOT_TYPE=7,ge.ANY_UNORDERED_NODE_TYPE=8,ge.FIRST_ORDERED_NODE_TYPE=9;var Ee,xe=["wgxpath","install"],ye=e;xe[0]in ye||!ye.execScript||ye.execScript("var "+xe[0]);for(;xe.length&&(Ee=xe.shift());)xe.length||void 0===be?ye=ye[Ee]?ye[Ee]:ye[Ee]={}:ye[Ee]=be;t.exports.install=be,t.exports.XPathResultType={ANY_TYPE:0,NUMBER_TYPE:1,STRING_TYPE:2,BOOLEAN_TYPE:3,UNORDERED_NODE_ITERATOR_TYPE:4,ORDERED_NODE_ITERATOR_TYPE:5,UNORDERED_NODE_SNAPSHOT_TYPE:6,ORDERED_NODE_SNAPSHOT_TYPE:7,ANY_UNORDERED_NODE_TYPE:8,FIRST_ORDERED_NODE_TYPE:9}}).call(s.g)}},__webpack_module_cache__={},leafPrototypes,getProto;function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var s=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](s,s.exports,__webpack_require__),s.exports}getProto=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,__webpack_require__.t=function(t,e){if(1&e&&(t=this(t)),8&e)return t;if("object"==typeof t&&t){if(4&e&&t.__esModule)return t;if(16&e&&"function"==typeof t.then)return t}var s=Object.create(null);__webpack_require__.r(s);var i={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var r=2&e&&t;("object"==typeof r||"function"==typeof r)&&!~leafPrototypes.indexOf(r);r=getProto(r))Object.getOwnPropertyNames(r).forEach((e=>i[e]=()=>t[e]));return i.default=()=>t,__webpack_require__.d(s,i),s},__webpack_require__.d=(t,e)=>{for(var s in e)__webpack_require__.o(e,s)&&!__webpack_require__.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";var t={};__webpack_require__.r(t),__webpack_require__.d(t,{GLOBAL:()=>ai,MathJax:()=>ui,combineConfig:()=>ci,combineDefaults:()=>hi,combineWithMathJax:()=>di,isObject:()=>li});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{context:()=>mi,hasWindow:()=>pi});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{Package:()=>fi,PackageError:()=>gi});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{PrioritizedList:()=>bi});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{FunctionList:()=>Ei});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{CONFIG:()=>wi,Loader:()=>vi,MathJax:()=>_i,PathFilters:()=>Ni});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{APPEND:()=>Li,Expandable:()=>Si,OPTIONS:()=>Ri,REMOVE:()=>Ii,copy:()=>Di,defaultOptions:()=>Bi,expandable:()=>ki,insert:()=>Pi,isObject:()=>Ci,keys:()=>Mi,lookup:()=>Hi,makeArray:()=>Oi,selectOptions:()=>Ui,selectOptionsFromKeys:()=>ji,separateOptions:()=>qi,userOptions:()=>Fi});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{CONFIG:()=>Xi,MathJax:()=>Gi,Startup:()=>Vi});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{AbstractDOMAdaptor:()=>Ki});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{HTMLAdaptor:()=>$i});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{browserAdaptor:()=>Qi});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{AbstractFindMath:()=>Zi});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{AbstractInputJax:()=>tr});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{AbstractOutputJax:()=>er});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{END:()=>sr,LinkedList:()=>rr,ListItem:()=>ir});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{AbstractMathList:()=>nr});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{AbstractMathItem:()=>ar,STATE:()=>lr,newState:()=>cr,protoItem:()=>or});var b={};__webpack_require__.r(b),__webpack_require__.d(b,{AbstractFactory:()=>hr});var E={};__webpack_require__.r(E),__webpack_require__.d(E,{AbstractNodeFactory:()=>dr});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{Attributes:()=>pr,INHERIT:()=>ur});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{AbstractEmptyNode:()=>gr,AbstractNode:()=>mr});var N={};__webpack_require__.r(N),__webpack_require__.d(N,{AbstractMmlBaseNode:()=>wr,AbstractMmlEmptyNode:()=>Tr,AbstractMmlLayoutNode:()=>_r,AbstractMmlNode:()=>Ar,AbstractMmlTokenNode:()=>vr,MATHVARIANTS:()=>yr,TEXCLASS:()=>fr,TEXCLASSNAMES:()=>br,TextNode:()=>Cr,XMLNode:()=>Lr,indentAttributes:()=>Nr});var A={};__webpack_require__.r(A),__webpack_require__.d(A,{MmlMath:()=>Ir});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{MmlMi:()=>Rr});var _={};__webpack_require__.r(_),__webpack_require__.d(_,{MmlMn:()=>Sr});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{MMLSPACING:()=>Pr,MO:()=>Or,OPDEF:()=>kr,OPTABLE:()=>Br,RANGES:()=>Mr,getRange:()=>Dr});var T={};__webpack_require__.r(T),__webpack_require__.d(T,{isPercent:()=>Hr,quotePattern:()=>Ur,replaceUnicode:()=>Vr,sortLength:()=>Fr,split:()=>Wr,toEntity:()=>Gr,unicodeChars:()=>jr,unicodeString:()=>qr});var C={};__webpack_require__.r(C),__webpack_require__.d(C,{MmlMo:()=>Xr});var L={};__webpack_require__.r(L),__webpack_require__.d(L,{MmlMtext:()=>zr});var I={};__webpack_require__.r(I),__webpack_require__.d(I,{MmlMspace:()=>Kr});var R={};__webpack_require__.r(R),__webpack_require__.d(R,{MmlMs:()=>Jr});var S={};__webpack_require__.r(S),__webpack_require__.d(S,{MmlInferredMrow:()=>Yr,MmlMrow:()=>$r});var k={};__webpack_require__.r(k),__webpack_require__.d(k,{MmlMfrac:()=>Qr});var O={};__webpack_require__.r(O),__webpack_require__.d(O,{MmlMsqrt:()=>Zr});var M={};__webpack_require__.r(M),__webpack_require__.d(M,{MmlMroot:()=>tn});var D={};__webpack_require__.r(D),__webpack_require__.d(D,{MmlMstyle:()=>en});var P={};__webpack_require__.r(P),__webpack_require__.d(P,{MmlMerror:()=>sn});var B={};__webpack_require__.r(B),__webpack_require__.d(B,{MmlMpadded:()=>rn});var F={};__webpack_require__.r(F),__webpack_require__.d(F,{MmlMphantom:()=>nn});var U={};__webpack_require__.r(U),__webpack_require__.d(U,{MmlMfenced:()=>on});var j={};__webpack_require__.r(j),__webpack_require__.d(j,{MmlMenclose:()=>an});var q={};__webpack_require__.r(q),__webpack_require__.d(q,{MmlMaction:()=>ln});var H={};__webpack_require__.r(H),__webpack_require__.d(H,{MmlMsub:()=>hn,MmlMsubsup:()=>cn,MmlMsup:()=>dn});var W={};__webpack_require__.r(W),__webpack_require__.d(W,{MmlMover:()=>mn,MmlMunder:()=>pn,MmlMunderover:()=>un});var V={};__webpack_require__.r(V),__webpack_require__.d(V,{MmlMmultiscripts:()=>gn,MmlMprescripts:()=>fn,MmlNone:()=>bn});var G={};__webpack_require__.r(G),__webpack_require__.d(G,{MmlMtable:()=>En});var X={};__webpack_require__.r(X),__webpack_require__.d(X,{MmlMlabeledtr:()=>yn,MmlMtr:()=>xn});var z={};__webpack_require__.r(z),__webpack_require__.d(z,{MmlMtd:()=>Nn});var K={};__webpack_require__.r(K),__webpack_require__.d(K,{MmlMaligngroup:()=>An});var J={};__webpack_require__.r(J),__webpack_require__.d(J,{MmlMalignmark:()=>vn});var $={};__webpack_require__.r($),__webpack_require__.d($,{MmlMglyph:()=>_n});var Y={};__webpack_require__.r(Y),__webpack_require__.d(Y,{MmlAnnotation:()=>Cn,MmlAnnotationXML:()=>Tn,MmlSemantics:()=>wn});var Q={};__webpack_require__.r(Q),__webpack_require__.d(Q,{TeXAtom:()=>Ln});var Z={};__webpack_require__.r(Z),__webpack_require__.d(Z,{MathChoice:()=>In});var tt={};__webpack_require__.r(tt),__webpack_require__.d(tt,{HtmlNode:()=>Rn});var et={};__webpack_require__.r(et),__webpack_require__.d(et,{MML:()=>Sn});var st={};__webpack_require__.r(st),__webpack_require__.d(st,{MmlFactory:()=>kn});var it={};__webpack_require__.r(it),__webpack_require__.d(it,{BitField:()=>On,BitFieldClass:()=>Mn});var rt={};__webpack_require__.r(rt),__webpack_require__.d(rt,{handleRetriesFor:()=>Dn,retryAfter:()=>Pn});var nt={};__webpack_require__.r(nt),__webpack_require__.d(nt,{AbstractMathDocument:()=>Vn,RenderList:()=>Fn,resetAllOptions:()=>jn,resetOptions:()=>Un});var ot={};__webpack_require__.r(ot),__webpack_require__.d(ot,{AbstractHandler:()=>Xn});var at={};__webpack_require__.r(at),__webpack_require__.d(at,{HandlerList:()=>zn});var lt={};__webpack_require__.r(lt),__webpack_require__.d(lt,{AbstractVisitor:()=>Kn});var ct={};__webpack_require__.r(ct),__webpack_require__.d(ct,{DATAMJX:()=>Jn,MmlVisitor:()=>$n});var ht={};__webpack_require__.r(ht),__webpack_require__.d(ht,{MathMLVisitor:()=>Yn});var dt={};__webpack_require__.r(dt),__webpack_require__.d(dt,{SerializedMmlVisitor:()=>Qn});var ut={};__webpack_require__.r(ut),__webpack_require__.d(ut,{AbstractWrapper:()=>Zn});var pt={};__webpack_require__.r(pt),__webpack_require__.d(pt,{AbstractWrapperFactory:()=>to});var mt={};__webpack_require__.r(mt),__webpack_require__.d(mt,{mathjax:()=>eo});var gt={};__webpack_require__.r(gt),__webpack_require__.d(gt,{HTMLMathItem:()=>so});var ft={};__webpack_require__.r(ft),__webpack_require__.d(ft,{HTMLMathList:()=>io});var bt={};__webpack_require__.r(bt),__webpack_require__.d(bt,{HTMLDomStrings:()=>ro});var Et={};__webpack_require__.r(Et),__webpack_require__.d(Et,{HTMLDocument:()=>no});var xt={};__webpack_require__.r(xt),__webpack_require__.d(xt,{HTMLHandler:()=>oo});var yt={};__webpack_require__.r(yt),__webpack_require__.d(yt,{RegisterHTMLHandler:()=>ao});var Nt={};__webpack_require__.r(Nt),__webpack_require__.d(Nt,{StyleJsonSheet:()=>lo});var At={};__webpack_require__.r(At),__webpack_require__.d(At,{DraggableDialog:()=>uo,isDialog:()=>ho});var vt={};__webpack_require__.r(vt),__webpack_require__.d(vt,{InfoDialog:()=>po});var _t={};__webpack_require__.r(_t),__webpack_require__.d(_t,{asyncLoad:()=>mo});var wt={};__webpack_require__.r(wt),__webpack_require__.d(wt,{BIGDIMEN:()=>go,MATHSPACE:()=>Eo,RELUNITS:()=>bo,UNITS:()=>fo,em:()=>No,length2em:()=>xo,percent:()=>yo,px:()=>Ao});var Tt={};__webpack_require__.r(Tt),__webpack_require__.d(Tt,{BBox:()=>vo});var Ct={};__webpack_require__.r(Ct),__webpack_require__.d(Ct,{add:()=>Co,entities:()=>wo,numeric:()=>So,options:()=>_o,remove:()=>Lo,translate:()=>Io});var Lt={};__webpack_require__.r(Lt),__webpack_require__.d(Lt,{Styles:()=>Wo,TRBL:()=>ko,WSC:()=>Oo});var It={};__webpack_require__.r(It),__webpack_require__.d(It,{max:()=>Go,sum:()=>Vo});var Rt={};__webpack_require__.r(Rt),__webpack_require__.d(Rt,{FindTeX:()=>Xo});var St={};__webpack_require__.r(St),__webpack_require__.d(St,{default:()=>Ko});var kt={};__webpack_require__.r(kt),__webpack_require__.d(kt,{TexConstant:()=>Jo});var Ot={};__webpack_require__.r(Ot),__webpack_require__.d(Ot,{default:()=>ea});var Mt={};__webpack_require__.r(Mt),__webpack_require__.d(Mt,{ConfigurationType:()=>sa,HandlerType:()=>ia});var Dt={};__webpack_require__.r(Dt),__webpack_require__.d(Dt,{UnitUtil:()=>na});var Pt={};__webpack_require__.r(Pt),__webpack_require__.d(Pt,{default:()=>oa});var Bt={};__webpack_require__.r(Bt),__webpack_require__.d(Bt,{default:()=>la});var Ft={};__webpack_require__.r(Ft),__webpack_require__.d(Ft,{BaseItem:()=>ha,MmlStack:()=>ca});var Ut={};__webpack_require__.r(Ut),__webpack_require__.d(Ut,{default:()=>da});var jt={};__webpack_require__.r(jt),__webpack_require__.d(jt,{default:()=>ma});var qt={};__webpack_require__.r(qt),__webpack_require__.d(qt,{NodeFactory:()=>ga});var Ht={};__webpack_require__.r(Ht),__webpack_require__.d(Ht,{KeyValueDef:()=>fa,KeyValueTypes:()=>ba,ParseUtil:()=>ya});var Wt={};__webpack_require__.r(Wt),__webpack_require__.d(Wt,{ColumnParser:()=>Na});var Vt={};__webpack_require__.r(Vt),__webpack_require__.d(Vt,{default:()=>_a});var Gt={};__webpack_require__.r(Gt),__webpack_require__.d(Gt,{AbstractTags:()=>Ca,AllTags:()=>Ia,Label:()=>wa,NoTags:()=>La,TagInfo:()=>Ta,TagsFactory:()=>ka});var Xt={};__webpack_require__.r(Xt),__webpack_require__.d(Xt,{Macro:()=>Ma,Token:()=>Oa});var zt={};__webpack_require__.r(zt),__webpack_require__.d(zt,{AbstractParseMap:()=>Fa,AbstractTokenMap:()=>Pa,CharacterMap:()=>Ua,CommandMap:()=>Ha,DelimiterMap:()=>ja,EnvironmentMap:()=>Wa,MacroMap:()=>qa,RegExpMap:()=>Ba,parseResult:()=>Da});var Kt={};__webpack_require__.r(Kt),__webpack_require__.d(Kt,{MapHandler:()=>Ga,SubHandler:()=>Xa,SubHandlers:()=>za});var Jt={};__webpack_require__.r(Jt),__webpack_require__.d(Jt,{Configuration:()=>Ka,ConfigurationHandler:()=>$a,ParserConfiguration:()=>Ya});var $t={};__webpack_require__.r($t),__webpack_require__.d($t,{ArrayItem:()=>yl,BeginItem:()=>hl,BreakItem:()=>cl,CellItem:()=>ml,CloseItem:()=>el,DotsItem:()=>xl,EndItem:()=>dl,EqnArrayItem:()=>Nl,EquationItem:()=>vl,FnItem:()=>fl,LeftItem:()=>ol,Middle:()=>al,MmlItem:()=>gl,MstyleItem:()=>Al,NonscriptItem:()=>El,NotItem:()=>bl,NullItem:()=>sl,OpenItem:()=>tl,OverItem:()=>nl,PositionItem:()=>pl,PrimeItem:()=>il,RightItem:()=>ll,StartItem:()=>Qa,StopItem:()=>Za,StyleItem:()=>ul,SubsupItem:()=>rl});var Yt={};__webpack_require__.r(Yt),__webpack_require__.d(Yt,{default:()=>Il,splitAlignArray:()=>Tl});var Qt={};__webpack_require__.r(Qt),__webpack_require__.d(Qt,{default:()=>kl});var Zt={};__webpack_require__.r(Zt),__webpack_require__.d(Zt,{BaseConfiguration:()=>Fl,BaseTags:()=>Bl,Other:()=>Pl});var te={};__webpack_require__.r(te),__webpack_require__.d(te,{TeX:()=>Ul});var ee={};__webpack_require__.r(ee),__webpack_require__.d(ee,{FlalignItem:()=>ql,MultlineItem:()=>jl});var se={};__webpack_require__.r(se),__webpack_require__.d(se,{NewcommandPriority:()=>Wl,NewcommandTables:()=>Hl,NewcommandUtil:()=>Vl});var ie={};__webpack_require__.r(ie),__webpack_require__.d(ie,{AmsMethods:()=>zl});var re={};__webpack_require__.r(re),__webpack_require__.d(re,{BeginEnvItem:()=>Kl});var ne={};__webpack_require__.r(ne),__webpack_require__.d(ne,{default:()=>$l});var oe={};__webpack_require__.r(oe),__webpack_require__.d(oe,{NewcommandConfig:()=>Yl,NewcommandConfiguration:()=>Ql});var ae={};__webpack_require__.r(ae),__webpack_require__.d(ae,{AmsConfiguration:()=>tc,AmsTags:()=>Zl});var le={};__webpack_require__.r(le),__webpack_require__.d(le,{RequireConfiguration:()=>ac,RequireLoad:()=>rc,RequireMethods:()=>nc,options:()=>oc});var ce={};__webpack_require__.r(ce),__webpack_require__.d(ce,{AutoloadConfiguration:()=>dc});var he={};__webpack_require__.r(he),__webpack_require__.d(he,{ConfigMacrosConfiguration:()=>fc});var de={};__webpack_require__.r(de),__webpack_require__.d(de,{NoUndefinedConfiguration:()=>bc});var ue={};__webpack_require__.r(ue),__webpack_require__.d(ue,{TextParser:()=>Ec});var pe={};__webpack_require__.r(pe),__webpack_require__.d(pe,{TextMacrosMethods:()=>xc});var me={};__webpack_require__.r(me),__webpack_require__.d(me,{TextBaseConfiguration:()=>Nc,TextMacrosConfiguration:()=>vc});var ge={};__webpack_require__.r(ge),__webpack_require__.d(ge,{FindMathML:()=>wc});var fe={};__webpack_require__.r(fe),__webpack_require__.d(fe,{MathMLCompile:()=>Tc});var be={};__webpack_require__.r(be),__webpack_require__.d(be,{MathML:()=>Cc});var Ee={};__webpack_require__.r(Ee),__webpack_require__.d(Ee,{DIRECTION:()=>Lc,H:()=>Rc,V:()=>Ic});var xe={};__webpack_require__.r(xe),__webpack_require__.d(xe,{DIRECTION:()=>Lc,FontData:()=>Mc,NOSTRETCH:()=>kc,mergeOptions:()=>Oc});var ye={};__webpack_require__.r(ye),__webpack_require__.d(ye,{LineBBox:()=>Dc});var Ne={};__webpack_require__.r(Ne),__webpack_require__.d(Ne,{LinebreakVisitor:()=>Fc,Linebreaks:()=>Bc,NOBREAK:()=>Pc});var Ae={};__webpack_require__.r(Ae),__webpack_require__.d(Ae,{CommonOutputJax:()=>jc,FONTPATH:()=>Uc});var ve={};__webpack_require__.r(ve),__webpack_require__.d(ve,{ARROWDX:()=>Hc,ARROWX:()=>qc,ARROWY:()=>Wc,CommonArrow:()=>lh,CommonBorder:()=>rh,CommonBorder2:()=>nh,CommonDiagonalArrow:()=>ah,CommonDiagonalStrike:()=>oh,PADDING:()=>Gc,SOLID:()=>Xc,THICKNESS:()=>Vc,arrowBBox:()=>ih,arrowBBoxHD:()=>Zc,arrowBBoxW:()=>th,arrowDef:()=>eh,arrowHead:()=>Qc,diagonalArrowDef:()=>sh,fullBBox:()=>Jc,fullBorder:()=>Yc,fullPadding:()=>$c,sideIndex:()=>zc,sideNames:()=>Kc});var _e={};__webpack_require__.r(_e),__webpack_require__.d(_e,{CommonWrapper:()=>ph,SPACE:()=>uh});var we={};__webpack_require__.r(we),__webpack_require__.d(we,{CommonWrapperFactory:()=>mh});var Te={};__webpack_require__.r(Te),__webpack_require__.d(Te,{CommonTeXAtomMixin:()=>gh});var Ce={};__webpack_require__.r(Ce),__webpack_require__.d(Ce,{CommonTextNodeMixin:()=>fh});var Le={};__webpack_require__.r(Le),__webpack_require__.d(Le,{CommonXmlNodeMixin:()=>bh});var Ie={};__webpack_require__.r(Ie),__webpack_require__.d(Ie,{CommonMactionMixin:()=>xh,TooltipData:()=>Eh});var Re={};__webpack_require__.r(Re),__webpack_require__.d(Re,{CommonMathMixin:()=>yh});var Se={};__webpack_require__.r(Se),__webpack_require__.d(Se,{CommonMencloseMixin:()=>Nh});var ke={};__webpack_require__.r(ke),__webpack_require__.d(ke,{CommonMfencedMixin:()=>Ah});var Oe={};__webpack_require__.r(Oe),__webpack_require__.d(Oe,{CommonMfracMixin:()=>vh});var Me={};__webpack_require__.r(Me),__webpack_require__.d(Me,{CommonMglyphMixin:()=>_h});var De={};__webpack_require__.r(De),__webpack_require__.d(De,{CommonMiMixin:()=>wh});var Pe={};__webpack_require__.r(Pe),__webpack_require__.d(Pe,{CommonMmultiscriptsMixin:()=>Lh,NextScript:()=>Th,ScriptNames:()=>Ch});var Be={};__webpack_require__.r(Be),__webpack_require__.d(Be,{CommonMnMixin:()=>Ih});var Fe={};__webpack_require__.r(Fe),__webpack_require__.d(Fe,{CommonMoMixin:()=>Rh});var Ue={};__webpack_require__.r(Ue),__webpack_require__.d(Ue,{CommonMpaddedMixin:()=>Sh});var je={};__webpack_require__.r(je),__webpack_require__.d(je,{CommonMrootMixin:()=>kh});var qe={};__webpack_require__.r(qe),__webpack_require__.d(qe,{CommonInferredMrowMixin:()=>Mh,CommonMrowMixin:()=>Oh});var He={};__webpack_require__.r(He),__webpack_require__.d(He,{CommonMsMixin:()=>Dh});var We={};__webpack_require__.r(We),__webpack_require__.d(We,{CommonMspaceMixin:()=>Ph});var Ve={};__webpack_require__.r(Ve),__webpack_require__.d(Ve,{CommonMsqrtMixin:()=>Bh});var Ge={};__webpack_require__.r(Ge),__webpack_require__.d(Ge,{CommonMsubMixin:()=>Fh,CommonMsubsupMixin:()=>jh,CommonMsupMixin:()=>Uh});var Xe={};__webpack_require__.r(Xe),__webpack_require__.d(Xe,{BREAK_BELOW:()=>qh,CommonMtableMixin:()=>Hh});var ze={};__webpack_require__.r(ze),__webpack_require__.d(ze,{CommonMtdMixin:()=>Wh});var Ke={};__webpack_require__.r(Ke),__webpack_require__.d(Ke,{CommonMtextMixin:()=>Vh});var Je={};__webpack_require__.r(Je),__webpack_require__.d(Je,{CommonMlabeledtrMixin:()=>Xh,CommonMtrMixin:()=>Gh});var $e={};__webpack_require__.r($e),__webpack_require__.d($e,{CommonMoverMixin:()=>Kh,CommonMunderMixin:()=>zh,CommonMunderoverMixin:()=>Jh});var Ye={};__webpack_require__.r(Ye),__webpack_require__.d(Ye,{CommonScriptbaseMixin:()=>$h});var Qe={};__webpack_require__.r(Qe),__webpack_require__.d(Qe,{CommonSemanticsMixin:()=>Yh});var Ze={};__webpack_require__.r(Ze),__webpack_require__.d(Ze,{SvgWrapper:()=>Qh});var ts={};__webpack_require__.r(ts),__webpack_require__.d(ts,{ZeroFontDataUrl:()=>Zh});var es={};__webpack_require__.r(es),__webpack_require__.d(es,{SvgMath:()=>td});var ss={};__webpack_require__.r(ss),__webpack_require__.d(ss,{SvgInferredMrow:()=>sd,SvgMrow:()=>ed});var is={};__webpack_require__.r(is),__webpack_require__.d(is,{SvgMi:()=>id});var rs={};__webpack_require__.r(rs),__webpack_require__.d(rs,{AddPaths:()=>nd,DIRECTION:()=>Lc,FontData:()=>Mc,NOSTRETCH:()=>kc,SvgFontData:()=>rd,mergeOptions:()=>Oc});var ns={};__webpack_require__.r(ns),__webpack_require__.d(ns,{SvgMo:()=>ad});var os={};__webpack_require__.r(os),__webpack_require__.d(os,{SvgMn:()=>ld});var as={};__webpack_require__.r(as),__webpack_require__.d(as,{SvgMs:()=>cd});var ls={};__webpack_require__.r(ls),__webpack_require__.d(ls,{SvgMtext:()=>hd});var cs={};__webpack_require__.r(cs),__webpack_require__.d(cs,{SvgMerror:()=>dd});var hs={};__webpack_require__.r(hs),__webpack_require__.d(hs,{SvgMspace:()=>ud});var ds={};__webpack_require__.r(ds),__webpack_require__.d(ds,{SvgMpadded:()=>pd});var us={};__webpack_require__.r(us),__webpack_require__.d(us,{SvgMphantom:()=>md});var ps={};__webpack_require__.r(ps),__webpack_require__.d(ps,{SvgMfrac:()=>gd});var ms={};__webpack_require__.r(ms),__webpack_require__.d(ms,{SvgMsqrt:()=>fd});var gs={};__webpack_require__.r(gs),__webpack_require__.d(gs,{SvgMroot:()=>bd});var fs={};__webpack_require__.r(fs),__webpack_require__.d(fs,{SvgMfenced:()=>Ed});var bs={};__webpack_require__.r(bs),__webpack_require__.d(bs,{SvgScriptbase:()=>xd});var Es={};__webpack_require__.r(Es),__webpack_require__.d(Es,{SvgMsub:()=>yd,SvgMsubsup:()=>Ad,SvgMsup:()=>Nd});var xs={};__webpack_require__.r(xs),__webpack_require__.d(xs,{SvgMover:()=>_d,SvgMunder:()=>vd,SvgMunderover:()=>wd});var ys={};__webpack_require__.r(ys),__webpack_require__.d(ys,{AlignX:()=>Td,SvgMmultiscripts:()=>Cd});var Ns={};__webpack_require__.r(Ns),__webpack_require__.d(Ns,{SvgMtable:()=>Ld});var As={};__webpack_require__.r(As),__webpack_require__.d(As,{SvgMlabeledtr:()=>Rd,SvgMtr:()=>Id});var vs={};__webpack_require__.r(vs),__webpack_require__.d(vs,{SvgMtd:()=>Sd});var _s={};__webpack_require__.r(_s),__webpack_require__.d(_s,{SvgMaction:()=>kd});var ws={};__webpack_require__.r(ws),__webpack_require__.d(ws,{ARROWDX:()=>Hc,ARROWX:()=>qc,ARROWY:()=>Wc,Arrow:()=>qd,Border:()=>Bd,Border2:()=>Fd,CommonArrow:()=>lh,CommonBorder:()=>rh,CommonBorder2:()=>nh,CommonDiagonalArrow:()=>ah,CommonDiagonalStrike:()=>oh,DiagonalArrow:()=>jd,DiagonalStrike:()=>Ud,PADDING:()=>Gc,RenderLine:()=>Pd,SOLID:()=>Xc,THICKNESS:()=>Vc,arrowBBox:()=>ih,arrowBBoxHD:()=>Zc,arrowBBoxW:()=>th,arrowDef:()=>eh,arrowHead:()=>Qc,computeLineData:()=>Od,diagonalArrowDef:()=>sh,fullBBox:()=>Jc,fullBorder:()=>Yc,fullPadding:()=>$c,lineData:()=>Md,lineOffset:()=>Dd,sideIndex:()=>zc,sideNames:()=>Kc});var Ts={};__webpack_require__.r(Ts),__webpack_require__.d(Ts,{SvgMenclose:()=>Hd});var Cs={};__webpack_require__.r(Cs),__webpack_require__.d(Cs,{SvgAnnotation:()=>Vd,SvgAnnotationXML:()=>Gd,SvgSemantics:()=>Wd,SvgXmlNode:()=>Xd});var Ls={};__webpack_require__.r(Ls),__webpack_require__.d(Ls,{SvgMglyph:()=>zd});var Is={};__webpack_require__.r(Is),__webpack_require__.d(Is,{SvgTeXAtom:()=>Kd});var Rs={};__webpack_require__.r(Rs),__webpack_require__.d(Rs,{SvgTextNode:()=>Jd});var Ss={};__webpack_require__.r(Ss),__webpack_require__.d(Ss,{SvgHtmlNode:()=>$d});var ks={};__webpack_require__.r(ks),__webpack_require__.d(ks,{SvgWrappers:()=>Yd});var Os={};__webpack_require__.r(Os),__webpack_require__.d(Os,{SvgWrapperFactory:()=>Qd});var Ms={};__webpack_require__.r(Ms),__webpack_require__.d(Ms,{FontCache:()=>Zd});var Ds={};__webpack_require__.r(Ds),__webpack_require__.d(Ds,{DefaultFont:()=>eu,fontName:()=>tu});var Ps={};__webpack_require__.r(Ps),__webpack_require__.d(Ps,{SVG:()=>ru,SVGNS:()=>su,XLINKNS:()=>iu});var Bs={};__webpack_require__.r(Bs),__webpack_require__.d(Bs,{MJContextMenu:()=>ip});var Fs={};__webpack_require__.r(Fs),__webpack_require__.d(Fs,{addPreference:()=>gb,engineSetup:()=>ub,fromPreference:()=>fb,locales:()=>hb,parseDOM:()=>mb,setupEngine:()=>db,toEnriched:()=>pb,toPreference:()=>bb});var Us={};__webpack_require__.r(Us),__webpack_require__.d(Us,{clearspeakMenu:()=>Tb,localeMenu:()=>Lb});var js={};__webpack_require__.r(js),__webpack_require__.d(js,{copyToClipboard:()=>Rb,isMac:()=>Ib});var qs={};__webpack_require__.r(qs),__webpack_require__.d(qs,{annotation:()=>Mb,copyAnnotations:()=>kb,showAnnotations:()=>Sb});var Hs={};__webpack_require__.r(Hs),__webpack_require__.d(Hs,{RadioCompare:()=>Bb});var Ws={};__webpack_require__.r(Ws),__webpack_require__.d(Ws,{MmlVisitor:()=>Fb});var Vs={};__webpack_require__.r(Vs),__webpack_require__.d(Vs,{Menu:()=>qb});var Gs={};__webpack_require__.r(Gs),__webpack_require__.d(Gs,{MenuHandler:()=>Vb,MenuMathDocumentMixin:()=>Wb,MenuMathItemMixin:()=>Hb});var Xs={};__webpack_require__.r(Xs),__webpack_require__.d(Xs,{EnrichHandler:()=>Kb,EnrichedMathDocumentMixin:()=>zb,EnrichedMathItemMixin:()=>Xb,enrichVisitor:()=>Gb});var zs={};__webpack_require__.r(zs),__webpack_require__.d(zs,{InPlace:()=>nE,SemAttr:()=>oE,buildLabel:()=>sE,buildSpeech:()=>iE,honk:()=>rE,ssmlParsing:()=>$b});var Ks={};__webpack_require__.r(Ks),__webpack_require__.d(Ks,{GeneratorPool:()=>aE});var Js={};__webpack_require__.r(Js),__webpack_require__.d(Js,{WorkerHandler:()=>hE});var $s={};__webpack_require__.r($s),__webpack_require__.d($s,{SpeechHandler:()=>fE,SpeechMathDocumentMixin:()=>gE,SpeechMathItemMixin:()=>mE});var Ys={};__webpack_require__.r(Ys),__webpack_require__.d(Ys,{AbstractRegion:()=>bE,DummyRegion:()=>EE,HoverRegion:()=>vE,LiveRegion:()=>NE,SpeechRegion:()=>AE,StringRegion:()=>xE,ToolTip:()=>yE});var Qs={};__webpack_require__.r(Qs),__webpack_require__.d(Qs,{AbstractExplorer:()=>_E});var Zs={};__webpack_require__.r(Zs),__webpack_require__.d(Zs,{SpeechExplorer:()=>SE,hasModifiers:()=>RE,isContainer:()=>IE});var ti={};__webpack_require__.r(ti),__webpack_require__.d(ti,{AbstractMouseExplorer:()=>OE,ContentHoverer:()=>PE,FlameHoverer:()=>BE,Hoverer:()=>ME,ValueHoverer:()=>DE});var ei={};__webpack_require__.r(ei),__webpack_require__.d(ei,{AbstractTreeExplorer:()=>FE,ContrastPicker:()=>qE,FlameColorer:()=>UE,TreeColorer:()=>jE});var si={};__webpack_require__.r(si),__webpack_require__.d(si,{ATTR:()=>VE,getHighlighter:()=>KE});var ii={};__webpack_require__.r(ii),__webpack_require__.d(ii,{ExplorerPool:()=>QE,RegionPool:()=>$E});var ri={};__webpack_require__.r(ri),__webpack_require__.d(ri,{ExplorerHandler:()=>sx,ExplorerMathDocumentMixin:()=>ex,ExplorerMathItemMixin:()=>tx,setA11yOption:()=>rx,setA11yOptions:()=>ix});const ni="4.1.0",oi={},ai="undefined"!=typeof window?window:void 0!==__webpack_require__.g?__webpack_require__.g:"undefined"!=typeof globalThis?globalThis:oi;function li(t){return"object"==typeof t&&null!==t}function ci(t,e,s=!1){var i;for(const r of Object.keys(e))"__esModule"!==r&&t[r]!==e[r]&&null!==e[r]&&void 0!==e[r]&&(li(t[r])&&li(e[r])?ci(t[r],e[r],s||"_"===r):s&&(null===(i=Object.getOwnPropertyDescriptor(t,r))||void 0===i?void 0:i.get)||(t[r]=e[r]));return t}function hi(t,e,s){t[e]||(t[e]={}),t=t[e];for(const e of Object.keys(s))li(t[e])&&li(s[e])?hi(t,e,s[e]):null==t[e]&&null!=s[e]&&(t[e]=s[e]);return t}function di(t){return ci(ui,t)}void 0!==ai.MathJax&&ai.MathJax.constructor==={}.constructor||(ai.MathJax={}),ai.MathJax.version||(ai.MathJax={version:ni,_:{},config:ai.MathJax});const ui=ai.MathJax;!Object.hasOwn&&ui.config.startup.polyfillHasOwn&&(Object.hasOwn=function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)});const pi="undefined"!=typeof window,mi={window:pi?window:null,document:pi?window.document:null,os:(()=>{if(pi&&window.navigator){const t=window.navigator.appVersion,e=[["Win","Windows"],["Mac","MacOS"],["X11","Unix"],["Linux","Unix"]];for(const[s,i]of e)if(t.includes(s))return i;if(window.navigator.userAgent.includes("Android"))return"Unix"}else if("undefined"!=typeof process)return{linux:"Unix",android:"Unix",aix:"Unix",freebsd:"Unix",netbsd:"Unix",openbsd:"Unix",sunos:"Unix",darwin:"MacOS",win32:"Windows",cygwin:"Windows"}[process.platform]||process.platform;return"unknown"})(),path:t=>t};"Windows"===mi.os&&(mi.path=t=>t.match(/^[/\\]?[a-zA-Z]:[/\\]/)?t.replace(/\\/g,"/").replace(/^\//,""):t);class gi extends Error{constructor(t,e){super(t),this.package=e}}class fi{get canLoad(){return 0===this.dependencyCount&&!this.noLoad&&!this.isLoading&&!this.hasFailed}static loadPromise(t){const e=wi[t]||{},s=e.extraLoads?vi.load(...e.extraLoads):Promise.resolve(),i=e.checkReady||(()=>Promise.resolve());return s.then((()=>i()))}static resolvePath(t,e=!0){const s={name:t,original:t,addExtension:e};return vi.pathFilters.execute(s),s.name}static loadAll(){for(const t of this.packages.values())t.canLoad&&t.load()}constructor(t,e=!1){this.isLoaded=!1,this.result={},this.isLoading=!1,this.hasFailed=!1,this.dependents=[],this.dependencies=[],this.dependencyCount=0,this.provided=[],this.name=t,this.noLoad=e,fi.packages.set(t,this),this.promise=this.makePromise(this.makeDependencies())}makeDependencies(){const t=[],e=fi.packages,s=this.noLoad,i=this.name,r=[];Object.hasOwn(wi.dependencies,i)?r.push(...wi.dependencies[i]):"core"!==i&&r.push("core");for(const i of r){const r=e.get(i)||new fi(i,s);this.dependencies.includes(r)||(r.addDependent(this,s),this.dependencies.push(r),r.isLoaded||(this.dependencyCount++,t.push(r.promise)))}return t}makePromise(t){let e=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const s=wi[this.name]||{};return s.ready&&(e=e.then((t=>s.ready(this.name)))),t.length&&(t.push(e),e=Promise.all(t).then((t=>t.join(", ")))),s.failed&&e.catch((t=>s.failed(new gi(t,this.name)))),e}load(){if(!this.isLoaded&&!this.isLoading&&!this.noLoad){this.isLoading=!0;const t=fi.resolvePath(this.name);wi.require?this.loadCustom(t):this.loadScript(t)}}loadCustom(t){try{const e=wi.require(t);e instanceof Promise?e.then((t=>this.result=t)).then((()=>this.checkLoad())).catch((e=>this.failed("Can't load \""+t+'"\n'+e.message.trim()))):(this.result=e,this.checkLoad())}catch(t){this.failed(t.message)}}loadScript(t){const e=mi.document.createElement("script");e.src=t,e.charset="UTF-8",e.onload=t=>this.checkLoad(),e.onerror=e=>this.failed("Can't load \""+t+'"'),mi.document.head.appendChild(e)}loaded(){this.isLoaded=!0,this.isLoading=!1;for(const t of this.dependents)t.requirementSatisfied();for(const t of this.provided)t.loaded();this.resolve(this.name)}failed(t){this.hasFailed=!0,this.isLoading=!1,this.reject(new gi(t,this.name))}checkLoad(){fi.loadPromise(this.name).then((()=>this.loaded())).catch((t=>this.failed(t)))}requirementSatisfied(){this.dependencyCount&&(this.dependencyCount--,this.canLoad&&this.load())}provides(t=[]){for(const e of t){let t=fi.packages.get(e);t||(wi.dependencies[e]||(wi.dependencies[e]=[]),wi.dependencies[e].push(e),t=new fi(e,!0),t.isLoading=!0),this.provided.push(t)}}addDependent(t,e){this.dependents.push(t),e||this.checkNoLoad()}checkNoLoad(){if(this.noLoad){this.noLoad=!1;for(const t of this.dependencies)t.checkNoLoad()}}}fi.packages=new Map;class bi{constructor(){this.items=[],this.items=[]}[Symbol.iterator](){let t=0;const e=this.items;return{next:()=>({value:e[t++],done:t>e.length})}}add(t,e=bi.DEFAULTPRIORITY){let s=this.items.length;do{s--}while(s>=0&&e<this.items[s].priority);return this.items.splice(s+1,0,{item:t,priority:e}),t}remove(t){let e=this.items.length;do{e--}while(e>=0&&this.items[e].item!==t);return e>=0&&this.items.splice(e,1),this}}bi.DEFAULTPRIORITY=5;class Ei extends bi{constructor(t=null){super(),t&&this.addList(t)}addList(t){for(const e of t)Array.isArray(e)?this.add(e[0],e[1]):this.add(e)}execute(...t){for(const e of this){if(!1===e.item(...t))return!1}return!0}asyncExecute(...t){let e=-1;const s=this.items;return new Promise(((i,r)=>{!function n(){for(;++e<s.length;){const o=s[e].item(...t);if(o instanceof Promise)return void o.then(n).catch((t=>r(t)));if(!1===o)return void i(!1)}i(!0)}()}))}}const xi=ui.config||{};var yi=function(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function a(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};const Ni={source:t=>(Object.hasOwn(wi.source,t.name)&&(t.name=wi.source[t.name]),!0),normalize:t=>{const e=t.name;return e.match(/^(?:[a-z]+:\/)?\/|[a-z]:[/\\]|\[/i)||(t.name="[mathjax]/"+e.replace(/^\.\//,"")),!0},prefix:t=>{let e;for(;(e=t.name.match(/^\[([^\]]*)\]/))&&Object.hasOwn(wi.paths,e[1]);)t.name=wi.paths[e[1]]+t.name.substring(e[0].length);return!0},addExtension:t=>(t.addExtension&&!t.name.match(/\.[^/]+$/)&&(t.name+=".js"),!0)},Ai=ui.version,vi={versions:new Map,nestedLoads:[],ready(...t){0===t.length&&(t=Array.from(fi.packages.keys()));const e=[];for(const s of t){const t=fi.packages.get(s)||new fi(s,!0);e.push(t.promise)}return Promise.all(e)},load(...t){if(0===t.length)return Promise.resolve([]);let e=[];this.nestedLoads.unshift(e);const s=Promise.resolve().then((()=>yi(this,void 0,void 0,(function*(){const s=[];for(const e of t){let t=fi.packages.get(e);t||(t=new fi(e),t.provides(wi.provides[e])),t.checkNoLoad(),s.push(t.promise.then((()=>(wi.versionWarnings&&t.isLoaded&&!vi.versions.has(fi.resolvePath(e))&&console.warn(`No version information available for component ${e}`),t.result))))}fi.loadAll();const i=yield Promise.all(s);for(;e.length;){const t=Promise.all(e);e=this.nestedLoads[this.nestedLoads.indexOf(e)]=[],yield t}return this.nestedLoads.splice(this.nestedLoads.indexOf(e),1),i}))));return this.nestedLoads.slice(1).forEach((t=>t.push(s))),s},preLoaded(...t){for(const e of t){let t=fi.packages.get(e);t||(t=new fi(e,!0),t.provides(wi.provides[e])),t.loaded()}},addPackageData(t,e){let s=wi[t];s||(s=wi[t]={});for(const[t,i]of Object.entries(e))if(Array.isArray(i)){s[t]||(s[t]=[]);const e=new Set([...s[t],...i]);s[t]=[...e]}else s[t]=i},defaultReady(){void 0!==_i.startup&&_i.config.startup.ready()},getRoot(){if(mi.document){const t=mi.document.currentScript||mi.document.getElementById("MathJax-script");if(t&&t instanceof HTMLScriptElement)return t.src.replace(/\/[^/]*$/,"")}return xi?.loader?.paths?.mathjax||xi?.__dirname||"/"},checkVersion(t,e,s){return this.saveVersion(t),!(!wi.versionWarnings||e===Ai)&&(console.warn(`Component ${t} uses ${e} of MathJax; version in use is ${Ai}`),!0)},saveVersion(t){vi.versions.set(fi.resolvePath(t),Ai)},pathFilters:new Ei};vi.pathFilters.add(Ni.source,0),vi.pathFilters.add(Ni.normalize,10),vi.pathFilters.add(Ni.prefix,20),vi.pathFilters.add(Ni.addExtension,30);const _i=ui;if(void 0===_i.loader){hi(_i.config,"loader",{paths:{mathjax:vi.getRoot(),fonts:mi.window?"https://cdn.jsdelivr.net/npm/@mathjax":"@mathjax"},source:{},dependencies:{},provides:{},load:[],ready:vi.defaultReady.bind(vi),failed:t=>console.log(`MathJax(${t.package||"?"}): ${t.message}`),require:null,pathFilters:[],versionWarnings:!0}),di({loader:vi});for(const t of _i.config.loader.pathFilters)Array.isArray(t)?vi.pathFilters.add(t[0],t[1]):vi.pathFilters.add(t)}const wi=_i.config.loader,Ti={}.constructor;function Ci(t){return"object"==typeof t&&null!==t&&(t.constructor===Ti||t.constructor===Si)}const Li="[+]",Ii="[-]",Ri={invalidOption:"warn",optionError:(t,e)=>{if("fatal"===Ri.invalidOption)throw new Error(t);console.warn("MathJax: "+t)}};class Si{}function ki(t){return Object.assign(Object.create(Si.prototype),t)}function Oi(t){return Array.isArray(t)?t:[t]}function Mi(t){return t?Object.keys(t).concat(Object.getOwnPropertySymbols(t)):[]}function Di(t){const e={};for(const s of Mi(t)){const i=Object.getOwnPropertyDescriptor(t,s),r=i.value;Array.isArray(r)?i.value=Pi([],r,!1):Ci(r)&&(i.value=Di(r)),i.enumerable&&(e[s]=i)}return Object.defineProperties(t.constructor===Si?ki({}):{},e)}function Pi(t,e,s=!0){for(let i of Mi(e)){if(s&&void 0===t[i]&&t.constructor!==Si){"symbol"==typeof i&&(i=i.toString()),Ri.optionError(`Invalid option "${i}" (no default value).`,i);continue}const r=e[i];let n=t[i];if(!Ci(r)||null===n||"object"!=typeof n&&"function"!=typeof n)Array.isArray(r)?(t[i]=[],Pi(t[i],r,!1)):Ci(r)?t[i]=Di(r):t[i]=r;else{const e=Mi(r);Array.isArray(n)&&(1===e.length&&(e[0]===Li||e[0]===Ii)&&Array.isArray(r[e[0]])||2===e.length&&e.sort().join(",")===Li+","+Ii&&Array.isArray(r[Li])&&Array.isArray(r[Ii]))?(r[Ii]&&(n=t[i]=n.filter((t=>r[Ii].indexOf(t)<0))),r[Li]&&(t[i]=[...n,...r[Li]])):Pi(n,r,s)}}return t}function Bi(t,...e){return e.forEach((e=>Pi(t,e,!1))),t}function Fi(t,...e){return e.forEach((e=>Pi(t,e,!0))),t}function Ui(t,...e){const s={};for(const i of e)Object.hasOwn(t,i)&&(s[i]=t[i]);return s}function ji(t,e){return Ui(t,...Object.keys(e))}function qi(t,...e){const s=[];for(const i of e){const e={},r={};for(const s of Object.keys(t||{}))(void 0===i[s]?r:e)[s]=t[s];s.push(e),t=r}return s.unshift(t),s}function Hi(t,e,s=null){return Object.hasOwn(e,t)?e[t]:s}var Wi=function(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function a(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};class Vi{static toMML(t){return Vi.visitor.visitTree(t,this.document)}static registerConstructor(t,e){Vi.constructors[t]=e}static useHandler(t,e=!1){Xi.handler&&!e||(Xi.handler=t)}static useAdaptor(t,e=!1){Xi.adaptor&&!e||(Xi.adaptor=t)}static useInput(t,e=!1){zi&&!e||Xi.input.push(t)}static useOutput(t,e=!1){Xi.output&&!e||(Xi.output=t)}static extendHandler(t,e=10){Vi.extensions.add(t,e)}static defaultReady(){Vi.getComponents(),Vi.makeMethods(),Vi.pagePromise.then((()=>Xi.pageReady())).then((()=>Vi.promiseResolve())).catch((t=>Vi.promiseReject(t)))}static defaultPageReady(){return(Xi.loadAllFontFiles&&Vi.output.font?Vi.output.font.loadDynamicFiles():Promise.resolve()).then((()=>{var t;return null===(t=Vi.document.menu)||void 0===t?void 0:t.loadingPromise})).then(Xi.typeset&&Gi.typesetPromise?()=>Vi.typesetPromise(Xi.elements):Promise.resolve()).then((()=>Vi.promiseResolve()))}static typesetPromise(t){return this.hasTypeset=!0,Vi.document.whenReady((()=>Wi(this,void 0,void 0,(function*(){Vi.document.options.elements=t,Vi.document.reset(),yield Vi.document.renderPromise()}))))}static getComponents(){Vi.visitor=new Gi._.core.MmlTree.SerializedMmlVisitor.SerializedMmlVisitor,Vi.mathjax=Gi._.mathjax.mathjax,Vi.input=Vi.getInputJax(),Vi.output=Vi.getOutputJax(),Vi.adaptor=Vi.getAdaptor(),Vi.handler&&Vi.mathjax.handlers.unregister(Vi.handler),Vi.handler=Vi.getHandler(),Vi.handler&&(Vi.mathjax.handlers.register(Vi.handler),Vi.document=Vi.getDocument())}static makeMethods(){Vi.input&&Vi.output&&Vi.makeTypesetMethods();const t=Vi.output?Vi.output.name.toLowerCase():"";for(const e of Vi.input){const s=e.name.toLowerCase();Vi.makeMmlMethods(s,e),Vi.makeResetMethod(s,e),Vi.output&&Vi.makeOutputMethods(s,t,e)}Gi.done=()=>Vi.document.done(),Gi.whenReady=t=>Vi.document.whenReady(t)}static makeTypesetMethods(){Gi.typeset=(t=null)=>{this.hasTypeset=!0,Vi.document.options.elements=t,Vi.document.reset(),Vi.document.render()},Gi.typesetPromise=(t=null)=>Vi.typesetPromise(t),Gi.typesetClear=(t=null)=>{t?Vi.document.clearMathItemsWithin(t):Vi.document.clear()}}static makeOutputMethods(t,e,s){const i=t+"2"+e;Gi[i]=(t,e={})=>(e=Object.assign(Object.assign({},e),{format:s.name}),Vi.document.convert(t,e)),Gi[i+"Promise"]=(t,e={})=>(e=Object.assign(Object.assign({},e),{format:s.name}),Vi.document.convertPromise(t,e)),Gi[e+"Stylesheet"]=()=>Vi.output.styleSheet(Vi.document),"getMetricsFor"in Vi.output&&(Gi.getMetricsFor=(t,e)=>Vi.output.getMetricsFor(t,e))}static makeMmlMethods(t,e){const s=Gi._.core.MathItem.STATE;Gi[t+"2mml"]=(t,i={})=>(i=Object.assign(Object.assign({},i),{end:s.CONVERT,format:e.name}),Vi.toMML(Vi.document.convert(t,i))),Gi[t+"2mmlPromise"]=(t,...i)=>Wi(this,[t,...i],void 0,(function*(t,i={}){i=Object.assign(Object.assign({},i),{end:s.CONVERT,format:e.name});const r=yield Vi.document.convertPromise(t,i);return Vi.toMML(r)}))}static makeResetMethod(t,e){Gi[t+"Reset"]=(...t)=>e.reset(...t)}static getInputJax(){const t=[];for(const e of Xi.input){const s=Vi.constructors[e];if(!s)throw Error('Input Jax "'+e+'" is not defined (has it been loaded?)');t[e]=new s(Gi.config[e]),t.push(t[e])}return t}static getOutputJax(){const t=Xi.output;if(!t)return null;const e=Vi.constructors[t];if(!e)throw Error('Output Jax "'+t+'" is not defined (has it been loaded?)');return new e(Gi.config[t])}static getAdaptor(){const t=Xi.adaptor;if(!t||"none"===t)return null;const e=Vi.constructors[t];if(!e)throw Error('DOMAdaptor "'+t+'" is not defined (has it been loaded?)');return e(Gi.config[t])}static getHandler(){const t=Xi.handler;if(!t||"none"===t||!Vi.adaptor)return null;const e=Vi.constructors[t];if(!e)throw Error('Handler "'+t+'" is not defined (has it been loaded?)');let s=new e(Vi.adaptor,5);for(const t of Vi.extensions)s=t.item(s);return s}static getDocument(t=null){return Vi.mathjax.document(t||Xi.document,Object.assign(Object.assign({},Gi.config.options),{InputJax:Vi.input,OutputJax:Vi.output}))}}Vi.extensions=new bi,Vi.constructors={},Vi.input=[],Vi.output=null,Vi.handler=null,Vi.adaptor=null,Vi.elements=null,Vi.document=null,Vi.promise=new Promise(((t,e)=>{Vi.promiseResolve=t,Vi.promiseReject=e})),Vi.pagePromise=new Promise(((t,e)=>{const s=ai.document;if(s&&s.readyState&&"complete"!==s.readyState&&"interactive"!==s.readyState){const e=()=>t();s.defaultView.addEventListener("load",e,!0),s.defaultView.addEventListener("DOMContentLoaded",e,!0)}else t()})),Vi.hasTypeset=!1,Vi.defaultOptionError=Ri.optionError;const Gi=ui;void 0===Gi._.startup&&(hi(Gi.config,"startup",{input:[],output:"",handler:null,adaptor:null,document:mi.document||"",elements:null,typeset:!0,ready:Vi.defaultReady.bind(Vi),pageReady:Vi.defaultPageReady.bind(Vi),polyfillHasOwn:!0}),di({startup:Vi,options:{}}),Gi.config.startup.invalidOption&&(Ri.invalidOption=Gi.config.startup.invalidOption),Gi.config.startup.optionError&&(Ri.optionError=Gi.config.startup.optionError));const Xi=Gi.config.startup,zi=0!==Xi.input.length;MathJax.loader&&MathJax.loader.checkVersion("startup",ni,"startup"),di({_:{components:{loader:n,package:s,startup:a}}});vi.preLoaded("loader","startup"),hi(MathJax.config.loader,"dependencies",{"a11y/semantic-enrich":["input/mml","a11y/sre"],"a11y/speech":["a11y/semantic-enrich"],"a11y/complexity":["a11y/semantic-enrich"],"a11y/explorer":["a11y/speech"],"[mml]/mml3":["input/mml"],"[tex]/action":["input/tex-base"],"[tex]/ams":["input/tex-base","[tex]/newcommand"],"[tex]/amscd":["input/tex-base"],"[tex]/autoload":["input/tex-base","[tex]/require"],"[tex]/bbm":["input/tex-base"],"[tex]/bboldx":["input/tex-base","[tex]/textmacros"],"[tex]/bbox":["input/tex-base"],"[tex]/begingroup":["input/tex-base","[tex]/newcommand"],"[tex]/boldsymbol":["input/tex-base"],"[tex]/braket":["input/tex-base"],"[tex]/bussproofs":["input/tex-base"],"[tex]/cancel":["input/tex-base","[tex]/enclose"],"[tex]/cases":["[tex]/empheq"],"[tex]/centernot":["input/tex-base"],"[tex]/color":["input/tex-base"],"[tex]/colortbl":["input/tex-base","[tex]/color"],"[tex]/colorv2":["input/tex-base"],"[tex]/configmacros":["input/tex-base","[tex]/newcommand"],"[tex]/dsfont":["input/tex-base"],"[tex]/empheq":["input/tex-base","[tex]/ams"],"[tex]/enclose":["input/tex-base"],"[tex]/extpfeil":["input/tex-base","[tex]/newcommand","[tex]/ams"],"[tex]/gensymb":["input/tex-base"],"[tex]/html":["input/tex-base"],"[tex]/mathtools":["input/tex-base","[tex]/newcommand","[tex]/ams","[tex]/boldsymbol"],"[tex]/mhchem":["input/tex-base","[tex]/ams"],"[tex]/newcommand":["input/tex-base"],"[tex]/noerrors":["input/tex-base"],"[tex]/noundefined":["input/tex-base"],"[tex]/physics":["input/tex-base"],"[tex]/require":["input/tex-base"],"[tex]/setoptions":["input/tex-base"],"[tex]/tagformat":["input/tex-base"],"[tex]/texhtml":["input/tex-base"],"[tex]/textcomp":["input/tex-base","[tex]/textmacros"],"[tex]/textmacros":["input/tex-base"],"[tex]/unicode":["input/tex-base"],"[tex]/units":["input/tex-base"],"[tex]/upgreek":["input/tex-base"],"[tex]/verb":["input/tex-base"],"ui/menu":["a11y/sre"]}),hi(MathJax.config.loader,"paths",{tex:"[mathjax]/input/tex/extensions",mml:"[mathjax]/input/mml/extensions",sre:"[mathjax]/sre",mathmaps:"[sre]/mathmaps"}),hi(MathJax.config.loader,"provides",{startup:["loader"],"input/tex":["input/tex-base","[tex]/ams","[tex]/newcommand","[tex]/textmacros","[tex]/noundefined","[tex]/require","[tex]/autoload","[tex]/configmacros"]}),hi(MathJax.config.loader,"source",{"[tex]/amsCd":"[tex]/amscd","[tex]/colorV2":"[tex]/colorv2","[tex]/configMacros":"[tex]/configmacros","[tex]/tagFormat":"[tex]/tagformat"});class Ki{constructor(t=null){this.canMeasureNodes=!0,this.document=t}node(t,e={},s=[],i){const r=this.create(t,i);this.setAttributes(r,e);for(const t of s)this.append(r,t);return r}setProperty(t,e,s){t[e]=s}getProperty(t,e){return t[e]}setAttributes(t,e){if(e.style&&"string"!=typeof e.style)for(const s of Object.keys(e.style))this.setStyle(t,s.replace(/-([a-z])/g,((t,e)=>e.toUpperCase())),e.style[s]);if(e.properties)for(const s of Object.keys(e.properties))t[s]=e.properties[s];for(const s of Object.keys(e))"style"===s&&"string"!=typeof e.style||"properties"===s||this.setAttribute(t,s,e[s])}replace(t,e){return this.insert(t,e),this.remove(e),e}childNode(t,e){return this.childNodes(t)[e]}allClasses(t){const e=this.getAttribute(t,"class");return e?e.replace(/ +/g," ").replace(/^ /,"").replace(/ $/,"").split(/ /):[]}cssText(t){return"style"===this.kind(t)?this.textContent(t):""}}var Ji=function(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function a(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};class $i extends Ki{constructor(t){super(t.document),this.canMeasureNodes=!0,this.window=t,this.parser=new t.DOMParser}parse(t,e="text/html"){return this.parser.parseFromString(t,e)}create(t,e){return e?this.document.createElementNS(e,t):this.document.createElement(t)}text(t){return this.document.createTextNode(t)}head(t=this.document){return t.head||t}body(t=this.document){return t.body||t}root(t=this.document){return t.documentElement||t}doctype(t=this.document){return t.doctype?`<!DOCTYPE ${t.doctype.name}>`:""}tags(t,e,s=null){const i=s?t.getElementsByTagNameNS(s,e):t.getElementsByTagName(e);return Array.from(i)}getElements(t,e){let s=[];for(const e of t)"string"==typeof e?s=s.concat(Array.from(this.document.querySelectorAll(e))):Array.isArray(e)||e instanceof this.window.NodeList||e instanceof this.window.HTMLCollection?s=s.concat(Array.from(e)):s.push(e);return s}getElement(t,e=this.document){return e.querySelector(t)}contains(t,e){return t.contains(e)}parent(t){return t.parentNode}append(t,e){return t.appendChild(e)}insert(t,e){return this.parent(e).insertBefore(t,e)}remove(t){return this.parent(t).removeChild(t)}replace(t,e){return this.parent(e).replaceChild(t,e)}clone(t,e=!0){return t.cloneNode(e)}split(t,e){return t.splitText(e)}next(t){return t.nextSibling}previous(t){return t.previousSibling}firstChild(t){return t.firstChild}lastChild(t){return t.lastChild}childNodes(t){return Array.from(t.childNodes)}childNode(t,e){return t.childNodes[e]}kind(t){const e=t.nodeType;return 1===e||3===e||8===e?t.nodeName.toLowerCase():""}value(t){return t.nodeValue||""}textContent(t){return t.textContent}innerHTML(t){return t.innerHTML}outerHTML(t){return t.outerHTML}serializeXML(t){return(new this.window.XMLSerializer).serializeToString(t)}setAttribute(t,e,s,i=null){return i?(e=i.replace(/.*\//,"")+":"+e.replace(/^.*:/,""),t.setAttributeNS(i,e,s)):("style"===e&&(s=s.replace(/\n/g," ")),t.setAttribute(e,s))}getAttribute(t,e){return t.getAttribute(e)}removeAttribute(t,e){return t.removeAttribute(e)}hasAttribute(t,e){return t.hasAttribute(e)}allAttributes(t){return Array.from(t.attributes).map((t=>({name:t.name,value:t.value})))}addClass(t,e){t.classList?t.classList.add(e):t.className=(t.className+" "+e).trim()}removeClass(t,e){t.classList?t.classList.remove(e):t.className=t.className.split(/ /).filter((t=>t!==e)).join(" ")}hasClass(t,e){return t.classList?t.classList.contains(e):t.className.split(/ /).includes(e)}setStyle(t,e,s){t.style[e]=String(s).replace(/\n/g," ")}getStyle(t,e){return t.style[e]}allStyles(t){return t.style.cssText}insertRules(t,e){for(const s of e)try{t.sheet.insertRule(s,t.sheet.cssRules.length)}catch(t){console.warn(`MathJax: can't insert css rule '${s}': ${t.message}`)}}cssText(t){return"style"!==this.kind(t)?"":Array.from(t.sheet.cssRules).map((t=>t.cssText)).join("\n")}fontSize(t){const e=this.window.getComputedStyle(t);return parseFloat(e.fontSize||String(this.constructor.DEFAULT_FONT_SIZE))}fontFamily(t){return this.window.getComputedStyle(t).fontFamily||""}nodeSize(t,e=1,s=!1){if(s&&t.getBBox){const{width:s,height:i}=t.getBBox();return[s/e,i/e]}return[t.offsetWidth/e,t.offsetHeight/e]}nodeBBox(t){const{left:e,right:s,top:i,bottom:r}=t.getBoundingClientRect();return{left:e,right:s,top:i,bottom:r}}createWorker(t,e){return Ji(this,void 0,void 0,(function*(){const{path:s,maps:i,worker:r}=e,n=`${s}/${r}`,o=`\n self.maps = '${Yi(i)}';\n importScripts('${Yi(n)}');\n `,a=URL.createObjectURL(new Blob([o],{type:"text/javascript"})),l=new Worker(a);return l.onmessage=t,URL.revokeObjectURL(a),l}))}}function Yi(t){return[...t].map((t=>("\\"===t||"'"===t?t="\\"+t:(t<" "||t>"~")&&(t=`\\u{${t.codePointAt(0).toString(16)}}`),t))).join("")}function Qi(){return new $i(window)}$i.DEFAULT_FONT_SIZE=16;class Zi{constructor(t){const e=this.constructor;this.options=Fi(Bi({},e.OPTIONS),t)}}Zi.OPTIONS={};class tr{constructor(t={}){this.adaptor=null,this.mmlFactory=null;const e=this.constructor;this.options=Fi(Bi({},e.OPTIONS),t),this.preFilters=new Ei(this.options.preFilters),this.postFilters=new Ei(this.options.postFilters)}get name(){return this.constructor.NAME}setAdaptor(t){this.adaptor=t}setMmlFactory(t){this.mmlFactory=t}initialize(){}reset(...t){}get processStrings(){return!0}findMath(t,e){return[]}executeFilters(t,e,s,i){const r={math:e,document:s,data:i};return t.execute(r),r.data}}tr.NAME="generic",tr.OPTIONS={preFilters:[],postFilters:[]};class er{constructor(t={}){this.adaptor=null;const e=this.constructor;this.options=Fi(Bi({},e.OPTIONS),t),this.preFilters=new Ei(this.options.preFilters),this.postFilters=new Ei(this.options.postFilters)}get name(){return this.constructor.NAME}setAdaptor(t){this.adaptor=t}initialize(){}reset(...t){}getMetrics(t){}styleSheet(t){return null}pageElements(t){return null}executeFilters(t,e,s,i){const r={math:e,document:s,data:i};return t.execute(r),r.data}}er.NAME="generic",er.OPTIONS={preFilters:[],postFilters:[]};const sr=Symbol();class ir{constructor(t=null){this.next=null,this.prev=null,this.data=t}}class rr{constructor(...t){this.list=new ir(sr),this.list.next=this.list.prev=this.list,this.push(...t)}isBefore(t,e){return t<e}push(...t){for(const e of t){const t=new ir(e);t.next=this.list,t.prev=this.list.prev,this.list.prev=t,t.prev.next=t}return this}pop(){const t=this.list.prev;return t.data===sr?null:(this.list.prev=t.prev,t.prev.next=this.list,t.next=t.prev=null,t.data)}unshift(...t){for(const e of t.slice(0).reverse()){const t=new ir(e);t.next=this.list.next,t.prev=this.list,this.list.next=t,t.next.prev=t}return this}shift(){const t=this.list.next;return t.data===sr?null:(this.list.next=t.next,t.next.prev=this.list,t.next=t.prev=null,t.data)}remove(...t){const e=new Map;for(const s of t)e.set(s,!0);let s=this.list.next;for(;s.data!==sr;){const t=s.next;e.has(s.data)&&(s.prev.next=s.next,s.next.prev=s.prev,s.next=s.prev=null),s=t}return this}clear(){return this.list.next.prev=this.list.prev.next=null,this.list.next=this.list.prev=this.list,this}*[Symbol.iterator](){let t=this.list.next;for(;t.data!==sr;)yield t.data,t=t.next}*reversed(){let t=this.list.prev;for(;t.data!==sr;)yield t.data,t=t.prev}insert(t,e=null){null===e&&(e=this.isBefore.bind(this));const s=new ir(t);let i=this.list.next;for(;i.data!==sr&&e(i.data,s.data);)i=i.next;return s.prev=i.prev,s.next=i,i.prev.next=i.prev=s,this}sort(t=null){null===t&&(t=this.isBefore.bind(this));const e=[];for(const t of this)e.push(new rr(t));for(this.list.next=this.list.prev=this.list;e.length>1;){const s=e.shift(),i=e.shift();s.merge(i,t),e.push(s)}return e.length&&(this.list=e[0].list),this}merge(t,e=null){null===e&&(e=this.isBefore.bind(this));let s=this.list.next,i=t.list.next;for(;s.data!==sr&&i.data!==sr;)e(i.data,s.data)?([i.prev.next,s.prev.next]=[s,i],[i.prev,s.prev]=[s.prev,i.prev],[this.list.prev.next,t.list.prev.next]=[t.list,this.list],[this.list.prev,t.list.prev]=[t.list.prev,this.list.prev],[s,i]=[i.next,s]):s=s.next;return i.data!==sr&&(this.list.prev.next=t.list.next,t.list.next.prev=this.list.prev,t.list.prev.next=this.list,this.list.prev=t.list.prev,t.list.next=t.list.prev=t.list),this}}class nr extends rr{isBefore(t,e){return t.start.i<e.start.i||t.start.i===e.start.i&&t.start.n<e.start.n}}function or(t,e,s,i,r,n,o=null){return{open:t,math:e,close:s,n:i,start:{n:r},end:{n},display:o}}class ar{get isEscaped(){return null===this.display}constructor(t,e,s=!0,i={i:0,n:0,delim:""},r={i:0,n:0,delim:""}){this.root=null,this.typesetRoot=null,this.metrics={},this.inputData={},this.outputData={},this._state=lr.UNPROCESSED,this.math=t,this.inputJax=e,this.display=s,this.start=i,this.end=r,this.root=null,this.typesetRoot=null,this.metrics={},this.inputData={},this.outputData={}}render(t){t.renderActions.renderMath(this,t)}rerender(t,e=lr.RERENDER){this.state()>=e&&this.state(e-1),t.renderActions.renderMath(this,t,e)}convert(t,e=lr.LAST){t.renderActions.renderConvert(this,t,e)}compile(t){this.state()<lr.COMPILED&&(this.root=this.inputJax.compile(this,t),this.state(lr.COMPILED))}typeset(t){this.state()<lr.TYPESET&&(this.typesetRoot=t.outputJax[this.isEscaped?"escaped":"typeset"](this,t),this.state(lr.TYPESET))}updateDocument(t){}removeFromDocument(t=!1){this.clear()}setMetrics(t,e,s,i){this.metrics={em:t,ex:e,containerWidth:s,scale:i}}state(t=null,e=!1){return null!=t&&(t<lr.INSERTED&&this._state>=lr.INSERTED&&this.removeFromDocument(e),t<lr.TYPESET&&this._state>=lr.TYPESET&&(this.outputData={}),t<lr.COMPILED&&this._state>=lr.COMPILED&&(this.inputData={}),this._state=t),this._state}reset(t=!1){this.state(lr.UNPROCESSED,t)}clear(){}}const lr={UNPROCESSED:0,FINDMATH:10,COMPILED:20,CONVERT:100,METRICS:110,RERENDER:125,TYPESET:150,INSERTED:200,LAST:1e4};function cr(t,e){if(t in lr)throw Error("State "+t+" already exists");lr[t]=e}class hr{constructor(t=null){this.defaultKind="unknown",this.nodeMap=new Map,this.node={},null===t&&(t=this.constructor.defaultNodes);for(const e of Object.keys(t))this.setNodeClass(e,t[e])}create(t,...e){return(this.node[t]||this.node[this.defaultKind])(...e)}setNodeClass(t,e){this.nodeMap.set(t,e);const s=this.nodeMap.get(t);this.node[t]=(...t)=>new s(this,...t)}getNodeClass(t){return this.nodeMap.get(t)}deleteNodeClass(t){this.nodeMap.delete(t),delete this.node[t]}nodeIsKind(t,e){return t instanceof this.getNodeClass(e)}getKinds(){return Array.from(this.nodeMap.keys())}}hr.defaultNodes={};class dr extends hr{create(t,e={},s=[]){return this.node[t](e,s)}}const ur="_inherit_";class pr{constructor(t,e){this.global=e,this.defaults=Object.create(e),this.inherited=Object.create(this.defaults),this.attributes=Object.create(this.inherited),Object.assign(this.defaults,t)}set(t,e){this.attributes[t]=e}setList(t){Object.assign(this.attributes,t)}unset(t){delete this.attributes[t]}get(t){let e=this.attributes[t];return e===ur&&(e=this.global[t]),e}getExplicit(t){return this.hasExplicit(t)?this.attributes[t]:void 0}hasExplicit(t){return Object.hasOwn(this.attributes,t)}hasOneOf(t){for(const e of t)if(this.hasExplicit(e))return!0;return!1}getList(...t){const e={};for(const s of t)e[s]=this.get(s);return e}setInherited(t,e){this.inherited[t]=e}getInherited(t){return this.inherited[t]}getDefault(t){return this.defaults[t]}isSet(t){return Object.hasOwn(this.attributes,t)||Object.hasOwn(this.inherited,t)}hasDefault(t){return t in this.defaults}getExplicitNames(){return Object.keys(this.attributes)}getInheritedNames(){return Object.keys(this.inherited)}getDefaultNames(){return Object.keys(this.defaults)}getGlobalNames(){return Object.keys(this.global)}getAllAttributes(){return this.attributes}getAllInherited(){return this.inherited}getAllDefaults(){return this.defaults}getAllGlobals(){return this.global}}class mr{constructor(t,e={},s=[]){this.factory=t,this.parent=null,this.properties={},this.childNodes=[];for(const t of Object.keys(e))this.setProperty(t,e[t]);s.length&&this.setChildren(s)}get kind(){return"unknown"}setProperty(t,e){this.properties[t]=e}getProperty(t){return this.properties[t]}getPropertyNames(){return Object.keys(this.properties)}getAllProperties(){return this.properties}removeProperty(...t){for(const e of t)delete this.properties[e]}isKind(t){return this.factory.nodeIsKind(this,t)}setChildren(t){this.childNodes=[];for(const e of t)this.appendChild(e)}appendChild(t){return this.childNodes.push(t),t.parent=this,t}replaceChild(t,e){const s=this.childIndex(e);return null!==s&&(this.childNodes[s]=t,t.parent=this,e.parent===this&&(e.parent=null)),t}removeChild(t){const e=this.childIndex(t);return null!==e&&(this.childNodes.splice(e,1),t.parent=null),t}childIndex(t){const e=this.childNodes.indexOf(t);return-1===e?null:e}copy(){const t=this.factory.create(this.kind);t.properties=Object.assign({},this.properties);for(const e of this.childNodes||[])e&&t.appendChild(e.copy());return t}findNodes(t){const e=[];return this.walkTree((s=>{s.isKind(t)&&e.push(s)})),e}walkTree(t,e){t(this,e);for(const s of this.childNodes)s&&s.walkTree(t,e);return e}toString(){return this.kind+"("+this.childNodes.join(",")+")"}}class gr extends mr{setChildren(t){}appendChild(t){return t}replaceChild(t,e){return e}childIndex(t){return null}walkTree(t,e){return t(this,e),e}toString(){return this.kind}}const fr={ORD:0,OP:1,BIN:2,REL:3,OPEN:4,CLOSE:5,PUNCT:6,INNER:7,NONE:-1},br=["ORD","OP","BIN","REL","OPEN","CLOSE","PUNCT","INNER"],Er=["","thinmathspace","mediummathspace","thickmathspace"],xr=[[0,-1,2,3,0,0,0,1],[-1,-1,0,3,0,0,0,1],[2,2,0,0,2,0,0,2],[3,3,0,0,3,0,0,3],[0,0,0,0,0,0,0,0],[0,-1,2,3,0,0,0,1],[1,1,0,1,1,1,1,1],[1,-1,2,3,1,0,1,1]],yr=new Set(["normal","bold","italic","bold-italic","double-struck","fraktur","bold-fraktur","script","bold-script","sans-serif","bold-sans-serif","sans-serif-italic","sans-serif-bold-italic","monospace","inital","tailed","looped","stretched"]),Nr=["indentalign","indentalignfirst","indentshift","indentshiftfirst"];class Ar extends mr{constructor(t,e={},s=[]){super(t),this.prevClass=null,this.prevLevel=null,this.texclass=null,this.arity<0&&(this.childNodes=[t.create("inferredMrow")],this.childNodes[0].parent=this),this.setChildren(s),this.attributes=new pr(t.getNodeClass(this.kind).defaults,t.getNodeClass("math").defaults),this.attributes.setList(e)}copy(t=!1){const e=this.factory.create(this.kind);if(e.properties=Object.assign({},this.properties),this.attributes){const s=this.attributes.getAllAttributes();for(const i of Object.keys(s))("id"!==i||t)&&e.attributes.set(i,s[i])}if(this.childNodes&&this.childNodes.length){let t=this.childNodes;1===t.length&&t[0].isInferred&&(t=t[0].childNodes);for(const s of t)s?e.appendChild(s.copy()):e.childNodes.push(null)}return e}get texClass(){return this.texclass}set texClass(t){this.texclass=t}get isToken(){return!1}get isEmbellished(){return!1}get isSpacelike(){return!1}get linebreakContainer(){return!1}get linebreakAlign(){return"data-align"}get arity(){return 1/0}get isInferred(){return!1}get Parent(){let t=this.parent;for(;t&&t.notParent;)t=t.Parent;return t}get notParent(){return!1}setChildren(t){return this.arity<0?this.childNodes[0].setChildren(t):super.setChildren(t)}appendChild(t){if(this.arity<0)return this.childNodes[0].appendChild(t),t;if(t.isInferred){if(this.arity===1/0)return t.childNodes.forEach((t=>super.appendChild(t))),t;const e=t;(t=this.factory.create("mrow")).setChildren(e.childNodes),t.attributes=e.attributes;for(const s of e.getPropertyNames())t.setProperty(s,e.getProperty(s))}return super.appendChild(t)}replaceChild(t,e){return this.arity<0?(this.childNodes[0].replaceChild(t,e),t):super.replaceChild(t,e)}core(){return this}coreMO(){return this}coreIndex(){return 0}childPosition(){let t=null,e=this.parent;for(;e&&e.notParent;)t=e,e=e.parent;if(t=t||this,e){let s=0;for(const i of e.childNodes){if(i===t)return s;s++}}return null}setTeXclass(t){return this.getPrevClass(t),null!=this.texClass?this:t}updateTeXclass(t){t&&(this.prevClass=t.prevClass,this.prevLevel=t.prevLevel,t.prevClass=t.prevLevel=null,this.texClass=t.texClass)}getPrevClass(t){t&&(this.prevClass=t.texClass,this.prevLevel=t.attributes.get("scriptlevel"))}texSpacing(){const t=null!=this.prevClass?this.prevClass:fr.NONE,e=this.texClass||fr.ORD;if(t===fr.NONE||e===fr.NONE)return"";const s=xr[t][e];return(this.prevLevel>0||this.attributes.get("scriptlevel")>0)&&s>=0?"":Er[Math.abs(s)]}hasSpacingAttributes(){return this.isEmbellished&&this.coreMO().hasSpacingAttributes()}setInheritedAttributes(t={},e=!1,s=0,i=!1){var r,n,o;const a=this.attributes.getAllDefaults();for(const e of Object.keys(t)){if(Object.hasOwn(a,e)||Object.hasOwn(Ar.alwaysInherit,e)){const[s,i]=t[e];(null===(n=null===(r=Ar.noInherit[s])||void 0===r?void 0:r[this.kind])||void 0===n?void 0:n[e])||this.attributes.setInherited(e,i)}(null===(o=Ar.stopInherit[this.kind])||void 0===o?void 0:o[e])&&delete(t=Object.assign({},t))[e]}void 0===this.attributes.getExplicit("displaystyle")&&this.attributes.setInherited("displaystyle",e);void 0===this.attributes.getExplicit("scriptlevel")&&this.attributes.setInherited("scriptlevel",s),i&&this.setProperty("texprimestyle",i);const l=this.arity;if(l>=0&&l!==1/0&&(1===l&&0===this.childNodes.length||1!==l&&this.childNodes.length!==l))if(l<this.childNodes.length)this.childNodes=this.childNodes.slice(0,l);else for(;this.childNodes.length<l;)this.appendChild(this.factory.create("mrow"));if(this.linebreakContainer&&!this.isEmbellished){const e=this.linebreakAlign;if(e){const s=this.attributes.get(e)||"left";t=this.addInheritedAttributes(t,{indentalign:s,indentshift:"0",indentalignfirst:s,indentshiftfirst:"0",indentalignlast:"indentalign",indentshiftlast:"indentshift"})}}this.setChildInheritedAttributes(t,e,s,i)}setChildInheritedAttributes(t,e,s,i){for(const r of this.childNodes)r.setInheritedAttributes(t,e,s,i)}addInheritedAttributes(t,e){const s=Object.assign({},t);for(const t of Object.keys(e))"displaystyle"!==t&&"scriptlevel"!==t&&"style"!==t&&(s[t]=[this.kind,e[t]]);return s}inheritAttributesFrom(t){const e=t.attributes,s=e.get("displaystyle"),i=e.get("scriptlevel"),r=e.isSet("mathsize")?{mathsize:["math",e.get("mathsize")]}:{},n=t.getProperty("texprimestyle")||!1;this.setInheritedAttributes(r,s,i,n)}verifyTree(t=null){if(null===t)return;this.verifyAttributes(t);const e=this.arity;t.checkArity&&e>=0&&e!==1/0&&(1===e&&0===this.childNodes.length||1!==e&&this.childNodes.length!==e)&&this.mError('Wrong number of children for "'+this.kind+'" node',t,!0),this.verifyChildren(t)}verifyAttributes(t){if(t.checkAttributes){const e=this.attributes,s=[];for(const t of e.getExplicitNames())"data-"===t.substring(0,5)||void 0!==e.getDefault(t)||t.match(/^(?:class|style|id|(?:xlink:)?href)$/)||s.push(t);s.length&&this.mError("Unknown attributes for "+this.kind+" node: "+s.join(", "),t)}if(t.checkMathvariants){const e=this.attributes.getExplicit("mathvariant");!e||yr.has(e)||this.getProperty("ignore-variant")||this.mError(`Invalid mathvariant: ${e}`,t,!0)}}verifyChildren(t){for(const e of this.childNodes)e.verifyTree(t)}mError(t,e,s=!1){if(this.parent&&this.parent.isKind("merror"))return null;const i=this.factory.create("merror");if(i.attributes.set("data-mjx-message",t),e.fullErrors||s){const s=this.factory.create("mtext"),r=this.factory.create("text");r.setText(e.fullErrors?t:this.kind),s.appendChild(r),i.appendChild(s),this.parent.replaceChild(i,this),e.fullErrors||i.attributes.set("title",t)}else this.parent.replaceChild(i,this),i.appendChild(this);return i}}Ar.defaults={mathbackground:ur,mathcolor:ur,mathsize:ur,dir:ur},Ar.noInherit={mstyle:{mpadded:{width:!0,height:!0,depth:!0,lspace:!0,voffset:!0},mtable:{width:!0,height:!0,depth:!0,align:!0}},maligngroup:{mrow:{groupalign:!0},mtable:{groupalign:!0}},mtr:{msqrt:{"data-vertical-align":!0},mroot:{"data-vertical-align":!0}},mlabeledtr:{msqrt:{"data-vertical-align":!0},mroot:{"data-vertical-align":!0}}},Ar.stopInherit={mtd:{columnalign:!0,rowalign:!0,groupalign:!0}},Ar.alwaysInherit={scriptminsize:!0,scriptsizemultiplier:!0,infixlinebreakstyle:!0},Ar.verifyDefaults={checkArity:!0,checkAttributes:!1,checkMathvariants:!0,fullErrors:!1,fixMmultiscripts:!0,fixMtables:!0};class vr extends Ar{get isToken(){return!0}getText(){let t="";for(const e of this.childNodes)e instanceof Cr?t+=e.getText():"textContent"in e&&(t+=e.textContent());return t}setChildInheritedAttributes(t,e,s,i){for(const r of this.childNodes)r instanceof Ar&&r.setInheritedAttributes(t,e,s,i)}walkTree(t,e){t(this,e);for(const s of this.childNodes)s instanceof Ar&&s.walkTree(t,e);return e}}vr.defaults=Object.assign(Object.assign({},Ar.defaults),{mathvariant:"normal",mathsize:ur});class _r extends Ar{get isSpacelike(){return this.childNodes[0].isSpacelike}get isEmbellished(){return this.childNodes[0].isEmbellished}get arity(){return-1}core(){return this.childNodes[0]}coreMO(){return this.childNodes[0].coreMO()}setTeXclass(t){return t=this.childNodes[0].setTeXclass(t),this.updateTeXclass(this.childNodes[0]),t}}_r.defaults=Ar.defaults;class wr extends Ar{get isEmbellished(){return this.childNodes[0].isEmbellished}core(){return this.childNodes[0]}coreMO(){return this.childNodes[0].coreMO()}setTeXclass(t){this.getPrevClass(t),this.texClass=fr.ORD;const e=this.childNodes[0];let s=null;e&&(this.isEmbellished||e.isKind("mi")?(s=e.setTeXclass(t),this.updateTeXclass(this.core())):e.isKind("TeXAtom")?this.texClass=e.texClass:e.setTeXclass(null));for(const t of this.childNodes.slice(1))t&&t.setTeXclass(null);return s||this}}wr.defaults=Ar.defaults;class Tr extends gr{get isToken(){return!1}get isEmbellished(){return!1}get isSpacelike(){return!1}get linebreakContainer(){return!1}get linebreakAlign(){return""}get arity(){return 0}get isInferred(){return!1}get notParent(){return!1}get Parent(){return this.parent}get texClass(){return fr.NONE}get prevClass(){return fr.NONE}get prevLevel(){return 0}hasSpacingAttributes(){return!1}get attributes(){return null}core(){return this}coreMO(){return this}coreIndex(){return 0}childPosition(){return 0}setTeXclass(t){return t}texSpacing(){return""}setInheritedAttributes(t,e,s,i){}inheritAttributesFrom(t){}verifyTree(t){}mError(t,e,s=!1){return null}}class Cr extends Tr{constructor(){super(...arguments),this.text=""}get kind(){return"text"}getText(){return this.text}setText(t){return this.text=t,this}copy(){return this.factory.create(this.kind).setText(this.getText())}toString(){return this.text}}class Lr extends Tr{constructor(){super(...arguments),this.xml=null,this.adaptor=null}get kind(){return"XML"}getXML(){return this.xml}setXML(t,e=null){return this.xml=t,this.adaptor=e,this}getSerializedXML(){return this.adaptor.serializeXML(this.xml)}copy(){return this.factory.create(this.kind).setXML(this.adaptor.clone(this.xml))}toString(){return"XML data"}}class Ir extends _r{get kind(){return"math"}get linebreakContainer(){return!0}get linebreakAlign(){return""}setChildInheritedAttributes(t,e,s,i){"display"===this.attributes.get("mode")&&this.attributes.setInherited("display","block"),t=this.addInheritedAttributes(t,this.attributes.getAllAttributes()),e=!!this.attributes.get("displaystyle")||!this.attributes.get("displaystyle")&&"block"===this.attributes.get("display"),this.attributes.setInherited("displaystyle",e),s=this.attributes.get("scriptlevel")||this.constructor.defaults.scriptlevel,super.setChildInheritedAttributes(t,e,s,i)}verifyTree(t=null){super.verifyTree(t),this.parent&&this.mError("Improper nesting of math tags",t,!0)}}Ir.defaults=Object.assign(Object.assign({},_r.defaults),{mathvariant:"normal",mathsize:"normal",mathcolor:"",mathbackground:"transparent",dir:"ltr",scriptlevel:0,displaystyle:!1,display:"inline",maxwidth:"",overflow:"linebreak",altimg:"","altimg-width":"","altimg-height":"","altimg-valign":"",alttext:"",cdgroup:"",scriptsizemultiplier:1/Math.sqrt(2),scriptminsize:".4em",infixlinebreakstyle:"before",lineleading:"100%",linebreakmultchar:"\u2062",indentshift:"auto",indentalign:"auto",indenttarget:"",indentalignfirst:"indentalign",indentshiftfirst:"indentshift",indentalignlast:"indentalign",indentshiftlast:"indentshift"});class Rr extends vr{constructor(){super(...arguments),this.texclass=fr.ORD}get kind(){return"mi"}setInheritedAttributes(t={},e=!1,s=0,i=!1){super.setInheritedAttributes(t,e,s,i);this.getText().match(Rr.singleCharacter)&&!t.mathvariant&&this.attributes.setInherited("mathvariant","italic")}setTeXclass(t){this.getPrevClass(t);const e=this.getText();return e.length>1&&e.match(Rr.operatorName)&&"normal"===this.attributes.get("mathvariant")&&void 0===this.getProperty("autoOP")&&void 0===this.getProperty("texClass")&&(this.texClass=fr.OP,this.setProperty("autoOP",!0)),this}}Rr.defaults=Object.assign({},vr.defaults),Rr.operatorName=/^[a-z][a-z0-9]*$/i,Rr.singleCharacter=/^[\uD800-\uDBFF]?.[\u0300-\u036F\u1AB0-\u1ABE\u1DC0-\u1DFF\u20D0-\u20EF]*$/;class Sr extends vr{constructor(){super(...arguments),this.texclass=fr.ORD}get kind(){return"mn"}}function kr(t,e,s=fr.BIN,i=null){return[t,e,s,i]}Sr.defaults=Object.assign({},vr.defaults);const Or={REL:kr(5,5,fr.REL),WIDEREL:kr(5,5,fr.REL,{accent:!0,stretchy:!0}),BIN4:kr(4,4,fr.BIN),RELSTRETCH:kr(5,5,fr.REL,{stretchy:!0}),ORD:kr(0,0,fr.ORD),BIN3:kr(3,3,fr.BIN),OPEN:kr(0,0,fr.OPEN,{fence:!0,stretchy:!0,symmetric:!0}),CLOSE:kr(0,0,fr.CLOSE,{fence:!0,stretchy:!0,symmetric:!0}),INTEGRAL:kr(3,3,fr.OP,{largeop:!0,symmetric:!0}),ACCENT:kr(0,0,fr.ORD,{accent:!0}),WIDEACCENT:kr(0,0,fr.ORD,{accent:!0,stretchy:!0}),OP:kr(3,3,fr.OP,{largeop:!0,movablelimits:!0,symmetric:!0}),RELACCENT:kr(5,5,fr.REL,{accent:!0}),BIN0:kr(0,0,fr.BIN),BIN5:kr(5,5,fr.BIN),FENCE:kr(0,0,fr.ORD,{fence:!0,stretchy:!0,symmetric:!0}),INNER:kr(1,1,fr.INNER),ORD30:kr(3,0,fr.ORD),NONE:kr(0,0,fr.NONE),ORDSTRETCH0:kr(0,0,fr.ORD,{stretchy:!0}),BINSTRETCH0:kr(0,0,fr.BIN,{stretchy:!0}),RELSTRETCH0:kr(0,0,fr.REL,{stretchy:!0}),CLOSE0:kr(0,0,fr.CLOSE,{fence:!0}),ORD3:kr(3,3,fr.ORD),PUNCT03:kr(0,3,fr.PUNCT,{linebreakstyle:"after"}),OPEN0:kr(0,0,fr.OPEN,{fence:!0}),STRETCH4:kr(4,4,fr.BIN,{stretchy:!0})},Mr=[[32,127,fr.REL,"mo"],[160,191,fr.ORD,"mo"],[192,591,fr.ORD,"mi"],[688,879,fr.ORD,"mo"],[880,6688,fr.ORD,"mi"],[6832,6911,fr.ORD,"mo"],[6912,7615,fr.ORD,"mi"],[7616,7679,fr.ORD,"mo"],[7680,8191,fr.ORD,"mi"],[8192,8303,fr.ORD,"mo"],[8304,8351,fr.ORD,"mo"],[8448,8527,fr.ORD,"mi"],[8528,8591,fr.ORD,"mn"],[8592,8703,fr.REL,"mo"],[8704,8959,fr.BIN,"mo"],[8960,9215,fr.ORD,"mo"],[9312,9471,fr.ORD,"mn"],[9472,10223,fr.ORD,"mo"],[10224,10239,fr.REL,"mo"],[10240,10495,fr.ORD,"mtext"],[10496,10623,fr.REL,"mo"],[10624,10751,fr.ORD,"mo"],[10752,11007,fr.BIN,"mo"],[11008,11055,fr.ORD,"mo"],[11056,11087,fr.REL,"mo"],[11088,11263,fr.ORD,"mo"],[11264,11744,fr.ORD,"mi"],[11776,11903,fr.ORD,"mo"],[11904,12255,fr.ORD,"mi","normal"],[12272,12351,fr.ORD,"mo"],[12352,42143,fr.ORD,"mi","normal"],[42192,43055,fr.ORD,"mi"],[43056,43071,fr.ORD,"mn"],[43072,55295,fr.ORD,"mi"],[63744,64255,fr.ORD,"mi","normal"],[64256,65023,fr.ORD,"mi"],[65024,65135,fr.ORD,"mo"],[65136,65791,fr.ORD,"mi"],[65792,65935,fr.ORD,"mn"],[65936,74751,fr.ORD,"mi","normal"],[74752,74879,fr.ORD,"mn"],[74880,113823,fr.ORD,"mi","normal"],[113824,119391,fr.ORD,"mo"],[119648,119679,fr.ORD,"mn"],[119808,120781,fr.ORD,"mi"],[120782,120831,fr.ORD,"mn"],[122624,129023,fr.ORD,"mo"],[129024,129279,fr.REL,"mo"],[129280,129535,fr.ORD,"mo"],[131072,195103,fr.ORD,"mi","normal"]];function Dr(t){const e=Br.infix[t]||Br.prefix[t]||Br.postfix[t];if(e)return[0,0,e[2],"mo"];const s=t.codePointAt(0);for(const t of Mr)if(s<=t[1]){if(s>=t[0])return t;break}return[0,0,fr.REL,"mo"]}const Pr=[[0,0],[1,2],[3,3],[4,4],[0,0],[0,0],[0,3],[1,1]],Br={prefix:{"!":Or.ORD,"(":Or.OPEN,"+":Or.BIN0,"-":Or.BIN0,"[":Or.OPEN,"{":Or.OPEN,"|":Or.OPEN,"||":Or.BIN0,"\xac":Or.ORD,"\xb1":Or.BIN0,"\u2016":Or.FENCE,"\u2018":Or.OPEN0,"\u201c":Or.OPEN0,\u2145:Or.ORD30,\u2146:Or.ORD30,"\u2200":Or.ORD,"\u2201":Or.ORD,"\u2202":Or.ORD30,"\u2203":Or.ORD,"\u2204":Or.ORD,"\u2207":Or.ORD,"\u220f":Or.OP,"\u2210":Or.OP,"\u2211":Or.OP,"\u2212":Or.BIN0,"\u2213":Or.BIN0,"\u221a":[3,0,fr.ORD,{stretchy:!0}],"\u221b":Or.ORD30,"\u221c":Or.ORD30,"\u221f":Or.ORD,"\u2220":Or.ORD,"\u2221":Or.ORD,"\u2222":Or.ORD,"\u222b":Or.INTEGRAL,"\u222c":Or.INTEGRAL,"\u222d":Or.INTEGRAL,"\u222e":Or.INTEGRAL,"\u222f":Or.INTEGRAL,"\u2230":Or.INTEGRAL,"\u2231":Or.INTEGRAL,"\u2232":Or.INTEGRAL,"\u2233":Or.INTEGRAL,"\u2234":Or.REL,"\u2235":Or.REL,"\u223c":[0,0,fr.REL,{}],"\u22be":Or.ORD,"\u22bf":Or.ORD,"\u22c0":Or.OP,"\u22c1":Or.OP,"\u22c2":Or.OP,"\u22c3":Or.OP,"\u2308":Or.OPEN,"\u230a":Or.OPEN,"\u2310":Or.ORD,"\u2319":Or.ORD,"\u2772":Or.OPEN,"\u2795":Or.ORD,"\u2796":Or.ORD,"\u27c0":Or.ORD,"\u27e6":Or.OPEN,"\u27e8":Or.OPEN,"\u27ea":Or.OPEN,"\u27ec":Or.OPEN,"\u27ee":Or.OPEN,"\u2980":Or.FENCE,"\u2983":Or.OPEN,"\u2985":Or.OPEN,"\u2987":Or.OPEN,"\u2989":Or.OPEN,"\u298b":Or.OPEN,"\u298d":Or.OPEN,"\u298f":Or.OPEN,"\u2991":Or.OPEN,"\u2993":Or.OPEN,"\u2995":Or.OPEN,"\u2997":Or.OPEN,"\u2999":Or.FENCE,"\u299b":Or.ORD,"\u299c":Or.ORD,"\u299d":Or.ORD,"\u299e":Or.ORD,"\u299f":Or.ORD,"\u29a0":Or.ORD,"\u29a1":Or.ORD,"\u29a2":Or.ORD,"\u29a3":Or.ORD,"\u29a4":Or.ORD,"\u29a5":Or.ORD,"\u29a6":Or.ORD,"\u29a7":Or.ORD,"\u29a8":Or.ORD,"\u29a9":Or.ORD,"\u29aa":Or.ORD,"\u29ab":Or.ORD,"\u29ac":Or.ORD,"\u29ad":Or.ORD,"\u29ae":Or.ORD,"\u29af":Or.ORD,"\u29d8":Or.OPEN,"\u29da":Or.OPEN,"\u29fc":Or.OPEN,"\u2a00":Or.OP,"\u2a01":Or.OP,"\u2a02":Or.OP,"\u2a03":Or.OP,"\u2a04":Or.OP,"\u2a05":Or.OP,"\u2a06":Or.OP,"\u2a07":Or.OP,"\u2a08":Or.OP,"\u2a09":Or.OP,"\u2a0a":Or.OP,"\u2a0b":Or.INTEGRAL,"\u2a0c":Or.INTEGRAL,"\u2a0d":Or.INTEGRAL,"\u2a0e":Or.INTEGRAL,"\u2a0f":Or.INTEGRAL,"\u2a10":Or.INTEGRAL,"\u2a11":Or.INTEGRAL,"\u2a12":Or.INTEGRAL,"\u2a13":Or.INTEGRAL,"\u2a14":Or.INTEGRAL,"\u2a15":Or.INTEGRAL,"\u2a16":Or.INTEGRAL,"\u2a17":Or.INTEGRAL,"\u2a18":Or.INTEGRAL,"\u2a19":Or.INTEGRAL,"\u2a1a":Or.INTEGRAL,"\u2a1b":Or.INTEGRAL,"\u2a1c":Or.INTEGRAL,"\u2a1d":Or.OP,"\u2a1e":Or.OP,"\u2aec":Or.ORD,"\u2aed":Or.ORD,"\u2afc":Or.OP,"\u2aff":Or.OP,"\u3008":Or.OPEN},postfix:{"!!":Or.BIN0,"!":Or.CLOSE0,'"':Or.ORD,"%":Or.ORD,"&":Or.ORD,"'":Or.ACCENT,")":Or.CLOSE,"++":Or.BIN0,"--":Or.BIN0,"]":Or.CLOSE,"^":Or.WIDEACCENT,_:Or.WIDEACCENT,"`":Or.ACCENT,"|":Or.CLOSE,"||":Or.BIN0,"}":Or.CLOSE,"~":Or.WIDEACCENT,"\xa8":Or.ACCENT,"\xaf":Or.WIDEACCENT,"\xb0":Or.ACCENT,"\xb2":Or.ORD,"\xb3":Or.ORD,"\xb4":Or.ACCENT,"\xb8":Or.ACCENT,"\xb9":Or.ORD,\u02c6:Or.WIDEACCENT,\u02c7:Or.WIDEACCENT,\u02c9:Or.WIDEACCENT,\u02ca:Or.ACCENT,\u02cb:Or.ACCENT,\u02cd:Or.WIDEACCENT,"\u02d8":Or.ACCENT,"\u02d9":Or.ACCENT,"\u02da":Or.ACCENT,"\u02dc":Or.WIDEACCENT,"\u02dd":Or.ACCENT,"\u02f7":Or.WIDEACCENT,"\u0302":Or.WIDEACCENT,"\u0311":Or.ACCENT,"\u2016":Or.FENCE,"\u2019":Or.CLOSE0,"\u201a":Or.ORD,"\u201b":Or.ORD,"\u201d":Or.CLOSE0,"\u201e":Or.ORD,"\u201f":Or.ORD,"\u2032":Or.ORD,"\u2033":Or.ORD,"\u2034":Or.ORD,"\u2035":Or.ORD,"\u2036":Or.ORD,"\u2037":Or.ORD,"\u203e":Or.WIDEACCENT,"\u2057":Or.ORD,"\u20db":Or.ACCENT,"\u20dc":Or.ACCENT,"\u2309":Or.CLOSE,"\u230b":Or.CLOSE,"\u2322":Or.RELSTRETCH0,"\u2323":Or.RELSTRETCH0,"\u23b4":Or.WIDEACCENT,"\u23b5":Or.WIDEACCENT,"\u23cd":Or.ORD,"\u23dc":Or.WIDEACCENT,"\u23dd":Or.WIDEACCENT,"\u23de":Or.WIDEACCENT,"\u23df":Or.WIDEACCENT,"\u23e0":Or.WIDEACCENT,"\u23e1":Or.WIDEACCENT,"\u2773":Or.CLOSE,"\u27e7":Or.CLOSE,"\u27e9":Or.CLOSE,"\u27eb":Or.CLOSE,"\u27ed":Or.CLOSE,"\u27ef":Or.CLOSE,"\u2980":Or.FENCE,"\u2984":Or.CLOSE,"\u2986":Or.CLOSE,"\u2988":Or.CLOSE,"\u298a":Or.CLOSE,"\u298c":Or.CLOSE,"\u298e":Or.CLOSE,"\u2990":Or.CLOSE,"\u2992":Or.CLOSE,"\u2994":Or.CLOSE,"\u2996":Or.CLOSE,"\u2998":Or.CLOSE,"\u2999":Or.FENCE,"\u29d9":Or.CLOSE,"\u29db":Or.CLOSE,"\u29fd":Or.CLOSE,"\u3009":Or.CLOSE,"\u{1eef0}":Or.BINSTRETCH0,"\u{1eef1}":Or.BINSTRETCH0},infix:{"!":Or.ORD,"!=":Or.BIN5,"#":Or.ORD,$:Or.ORD,"%":Or.ORD3,"&&":Or.BIN4,"**":Or.BIN3,"*":Or.BIN3,"*=":Or.BIN5,"+":Or.BIN4,"+=":Or.BIN5,",":Or.PUNCT03,"":Or.ORD,"-":Or.BIN4,"-=":Or.BIN5,"->":Or.BIN5,".":Or.ORD3,"..":Or.BIN3,"...":Or.INNER,"/":[4,4,fr.ORD,{}],"//":Or.BIN5,"/=":Or.BIN5,":":[0,3,fr.REL,{}],":=":Or.BIN5,";":Or.PUNCT03,"<":Or.REL,"<=":Or.REL,"<>":[3,3,fr.REL,{}],"=":Or.REL,"==":Or.REL,">":Or.REL,">=":Or.REL,"?":[3,3,fr.CLOSE,{fence:!0}],"@":Or.ORD3,"\\":Or.ORD,"^":[3,3,fr.ORD,{accent:!0,stretchy:!0}],_:Or.WIDEACCENT,"|":[5,5,fr.ORD,{}],"||":Or.BIN5,"\xb1":Or.BIN4,"\xb7":Or.BIN3,"\xd7":Or.BIN3,"\xf7":Or.BIN4,\u02b9:Or.ORD,"\u0300":Or.ACCENT,"\u0301":Or.ACCENT,"\u0303":Or.WIDEACCENT,"\u0304":Or.ACCENT,"\u0306":Or.ACCENT,"\u0307":Or.ACCENT,"\u0308":Or.ACCENT,"\u030c":Or.ACCENT,"\u0332":Or.WIDEACCENT,"\u0338":Or.REL,"\u03f6":Or.REL,"\u2015":Or.ORDSTRETCH0,"\u2017":Or.ORDSTRETCH0,"\u2020":Or.BIN3,"\u2021":Or.BIN3,"\u2022":Or.BIN3,"\u2026":Or.INNER,"\u2043":Or.BIN3,"\u2044":Or.STRETCH4,"\u2061":Or.NONE,"\u2062":Or.NONE,"\u2063":[0,0,fr.NONE,{linebreakstyle:"after"}],"\u2064":Or.NONE,"\u20d7":Or.ACCENT,\u2111:Or.ORD,\u2113:Or.ORD,\u2118:Or.ORD,\u211c:Or.ORD,"\u2190":Or.WIDEREL,"\u2191":Or.RELSTRETCH,"\u2192":Or.WIDEREL,"\u2193":Or.RELSTRETCH,"\u2194":Or.WIDEREL,"\u2195":Or.RELSTRETCH,"\u2196":Or.REL,"\u2197":Or.REL,"\u2198":Or.REL,"\u2199":Or.REL,"\u219a":Or.WIDEREL,"\u219b":Or.WIDEREL,"\u219c":Or.WIDEREL,"\u219d":Or.WIDEREL,"\u219e":Or.WIDEREL,"\u219f":Or.RELSTRETCH,"\u21a0":Or.WIDEREL,"\u21a1":Or.RELSTRETCH,"\u21a2":Or.WIDEREL,"\u21a3":Or.WIDEREL,"\u21a4":Or.WIDEREL,"\u21a5":Or.RELSTRETCH,"\u21a6":Or.WIDEREL,"\u21a7":Or.RELSTRETCH,"\u21a8":Or.RELSTRETCH,"\u21a9":Or.WIDEREL,"\u21aa":Or.WIDEREL,"\u21ab":Or.WIDEREL,"\u21ac":Or.WIDEREL,"\u21ad":Or.WIDEREL,"\u21ae":Or.WIDEREL,"\u21af":Or.REL,"\u21b0":Or.RELSTRETCH,"\u21b1":Or.RELSTRETCH,"\u21b2":Or.RELSTRETCH,"\u21b3":Or.RELSTRETCH,"\u21b4":Or.RELSTRETCH,"\u21b5":Or.RELSTRETCH,"\u21b6":Or.REL,"\u21b7":Or.REL,"\u21b8":Or.REL,"\u21b9":Or.WIDEREL,"\u21ba":Or.REL,"\u21bb":Or.REL,"\u21bc":Or.WIDEREL,"\u21bd":Or.WIDEREL,"\u21be":Or.RELSTRETCH,"\u21bf":Or.RELSTRETCH,"\u21c0":Or.WIDEREL,"\u21c1":Or.WIDEREL,"\u21c2":Or.RELSTRETCH,"\u21c3":Or.RELSTRETCH,"\u21c4":Or.WIDEREL,"\u21c5":Or.RELSTRETCH,"\u21c6":Or.WIDEREL,"\u21c7":Or.WIDEREL,"\u21c8":Or.RELSTRETCH,"\u21c9":Or.WIDEREL,"\u21ca":Or.RELSTRETCH,"\u21cb":Or.WIDEREL,"\u21cc":Or.WIDEREL,"\u21cd":Or.WIDEREL,"\u21ce":Or.WIDEREL,"\u21cf":Or.WIDEREL,"\u21d0":Or.WIDEREL,"\u21d1":Or.RELSTRETCH,"\u21d2":Or.WIDEREL,"\u21d3":Or.RELSTRETCH,"\u21d4":Or.WIDEREL,"\u21d5":Or.RELSTRETCH,"\u21d6":Or.REL,"\u21d7":Or.REL,"\u21d8":Or.REL,"\u21d9":Or.REL,"\u21da":Or.WIDEREL,"\u21db":Or.WIDEREL,"\u21dc":Or.WIDEREL,"\u21dd":Or.WIDEREL,"\u21de":Or.RELSTRETCH,"\u21df":Or.RELSTRETCH,"\u21e0":Or.WIDEREL,"\u21e1":Or.RELSTRETCH,"\u21e2":Or.WIDEREL,"\u21e3":Or.RELSTRETCH,"\u21e4":Or.WIDEREL,"\u21e5":Or.WIDEREL,"\u21e6":Or.WIDEREL,"\u21e7":Or.RELSTRETCH,"\u21e8":Or.WIDEREL,"\u21e9":Or.RELSTRETCH,"\u21ea":Or.RELSTRETCH,"\u21eb":Or.RELSTRETCH,"\u21ec":Or.RELSTRETCH,"\u21ed":Or.RELSTRETCH,"\u21ee":Or.RELSTRETCH,"\u21ef":Or.RELSTRETCH,"\u21f0":Or.WIDEREL,"\u21f1":Or.REL,"\u21f2":Or.REL,"\u21f3":Or.RELSTRETCH,"\u21f4":Or.WIDEREL,"\u21f5":Or.RELSTRETCH,"\u21f6":Or.WIDEREL,"\u21f7":Or.WIDEREL,"\u21f8":Or.WIDEREL,"\u21f9":Or.WIDEREL,"\u21fa":Or.WIDEREL,"\u21fb":Or.WIDEREL,"\u21fc":Or.WIDEREL,"\u21fd":Or.WIDEREL,"\u21fe":Or.WIDEREL,"\u21ff":Or.WIDEREL,"\u2205":Or.ORD,"\u2206":Or.ORD,"\u2208":Or.REL,"\u2209":Or.REL,"\u220a":Or.REL,"\u220b":Or.REL,"\u220c":Or.REL,"\u220d":Or.REL,"\u2212":Or.BIN4,"\u2213":Or.BIN4,"\u2214":Or.BIN4,"\u2215":Or.STRETCH4,"\u2216":Or.BIN4,"\u2217":Or.BIN3,"\u2218":Or.BIN3,"\u2219":Or.BIN3,"\u221d":Or.REL,"\u221e":Or.ORD,"\u2223":Or.REL,"\u2224":Or.REL,"\u2225":Or.REL,"\u2226":Or.REL,"\u2227":Or.BIN4,"\u2228":Or.BIN4,"\u2229":Or.BIN4,"\u222a":Or.BIN4,"\u2236":Or.BIN4,"\u2237":Or.REL,"\u2238":Or.BIN4,"\u2239":Or.REL,"\u223a":Or.REL,"\u223b":Or.REL,"\u223c":Or.REL,"\u223d":Or.REL,"\u223e":Or.REL,"\u2240":Or.BIN3,"\u2241":Or.REL,"\u2242":Or.REL,"\u2242\u0338":Or.REL,"\u2243":Or.REL,"\u2244":Or.REL,"\u2245":Or.REL,"\u2246":Or.REL,"\u2247":Or.REL,"\u2248":Or.REL,"\u2249":Or.REL,"\u224a":Or.REL,"\u224b":Or.REL,"\u224c":Or.REL,"\u224d":Or.REL,"\u224e":Or.REL,"\u224f":Or.REL,"\u2250":Or.REL,"\u2251":Or.REL,"\u2252":Or.REL,"\u2253":Or.REL,"\u2254":Or.REL,"\u2255":Or.REL,"\u2256":Or.REL,"\u2257":Or.REL,"\u2258":Or.REL,"\u2259":Or.REL,"\u225a":Or.REL,"\u225b":Or.REL,"\u225c":Or.REL,"\u225d":Or.REL,"\u225e":Or.REL,"\u225f":Or.REL,"\u2260":Or.REL,"\u2261":Or.REL,"\u2262":Or.REL,"\u2263":Or.REL,"\u2264":Or.REL,"\u2265":Or.REL,"\u2266":Or.REL,"\u2266\u0338":Or.REL,"\u2267":Or.REL,"\u2267\u0338":Or.REL,"\u2268":Or.REL,"\u2269":Or.REL,"\u226a":Or.REL,"\u226a\u0338":Or.REL,"\u226b":Or.REL,"\u226b\u0338":Or.REL,"\u226c":Or.REL,"\u226d":Or.REL,"\u226e":Or.REL,"\u226f":Or.REL,"\u2270":Or.REL,"\u2271":Or.REL,"\u2272":Or.REL,"\u2273":Or.REL,"\u2274":Or.REL,"\u2275":Or.REL,"\u2276":Or.REL,"\u2277":Or.REL,"\u2278":Or.REL,"\u2279":Or.REL,"\u227a":Or.REL,"\u227b":Or.REL,"\u227c":Or.REL,"\u227d":Or.REL,"\u227e":Or.REL,"\u227e\u0338":Or.REL,"\u227f":Or.REL,"\u227f\u0338":Or.REL,"\u2280":Or.REL,"\u2281":Or.REL,"\u2282":Or.REL,"\u2283":Or.REL,"\u2284":Or.REL,"\u2285":Or.REL,"\u2286":Or.REL,"\u2287":Or.REL,"\u2288":Or.REL,"\u2289":Or.REL,"\u228a":Or.REL,"\u228b":Or.REL,"\u228c":Or.BIN4,"\u228d":Or.BIN4,"\u228e":Or.BIN4,"\u228f":Or.REL,"\u228f\u0338":Or.REL,"\u2290":Or.REL,"\u2290\u0338":Or.REL,"\u2291":Or.REL,"\u2292":Or.REL,"\u2293":Or.BIN4,"\u2294":Or.BIN4,"\u2295":Or.BIN4,"\u2296":Or.BIN4,"\u2297":Or.BIN3,"\u2298":Or.BIN4,"\u2299":Or.BIN3,"\u229a":Or.BIN3,"\u229b":Or.BIN3,"\u229c":Or.REL,"\u229d":Or.BIN4,"\u229e":Or.BIN4,"\u229f":Or.BIN4,"\u22a0":Or.BIN3,"\u22a1":Or.BIN3,"\u22a2":Or.REL,"\u22a3":Or.REL,"\u22a4":Or.ORD,"\u22a5":Or.ORD,"\u22a6":Or.REL,"\u22a7":Or.REL,"\u22a8":Or.REL,"\u22a9":Or.REL,"\u22aa":Or.REL,"\u22ab":Or.REL,"\u22ac":Or.REL,"\u22ad":Or.REL,"\u22ae":Or.REL,"\u22af":Or.REL,"\u22b0":Or.REL,"\u22b1":Or.REL,"\u22b2":Or.REL,"\u22b3":Or.REL,"\u22b4":Or.REL,"\u22b5":Or.REL,"\u22b6":Or.REL,"\u22b7":Or.REL,"\u22b8":Or.REL,"\u22ba":Or.BIN3,"\u22bb":Or.BIN4,"\u22bc":Or.BIN4,"\u22bd":Or.BIN4,"\u22c4":Or.BIN3,"\u22c5":Or.BIN3,"\u22c6":Or.BIN3,"\u22c7":Or.BIN3,"\u22c8":Or.REL,"\u22c9":Or.BIN3,"\u22ca":Or.BIN3,"\u22cb":Or.BIN3,"\u22cc":Or.BIN3,"\u22cd":Or.REL,"\u22ce":Or.BIN4,"\u22cf":Or.BIN4,"\u22d0":Or.REL,"\u22d1":Or.REL,"\u22d2":Or.BIN4,"\u22d3":Or.BIN4,"\u22d4":Or.REL,"\u22d5":Or.REL,"\u22d6":Or.REL,"\u22d7":Or.REL,"\u22d8":Or.REL,"\u22d9":Or.REL,"\u22da":Or.REL,"\u22db":Or.REL,"\u22dc":Or.REL,"\u22dd":Or.REL,"\u22de":Or.REL,"\u22df":Or.REL,"\u22e0":Or.REL,"\u22e1":Or.REL,"\u22e2":Or.REL,"\u22e3":Or.REL,"\u22e4":Or.REL,"\u22e5":Or.REL,"\u22e6":Or.REL,"\u22e7":Or.REL,"\u22e8":Or.REL,"\u22e9":Or.REL,"\u22ea":Or.REL,"\u22eb":Or.REL,"\u22ec":Or.REL,"\u22ed":Or.REL,"\u22ee":Or.ORD,"\u22ef":Or.INNER,"\u22f0":Or.INNER,"\u22f1":Or.INNER,"\u22f2":Or.REL,"\u22f3":Or.REL,"\u22f4":Or.REL,"\u22f5":Or.REL,"\u22f6":Or.REL,"\u22f7":Or.REL,"\u22f8":Or.REL,"\u22f9":Or.REL,"\u22fa":Or.REL,"\u22fb":Or.REL,"\u22fc":Or.REL,"\u22fd":Or.REL,"\u22fe":Or.REL,"\u22ff":Or.REL,"\u2301":Or.REL,"\u2305":Or.BIN3,"\u2306":Or.BIN3,"\u2329":Or.OPEN,"\u232a":Or.CLOSE,"\u237c":Or.REL,"\u238b":Or.REL,"\u23aa":Or.ORD,"\u23af":Or.ORDSTRETCH0,"\u23b0":Or.OPEN,"\u23b1":Or.CLOSE,"\u2500":Or.ORD,"\u25b3":Or.BIN3,"\u25b5":Or.BIN3,"\u25b9":Or.BIN3,"\u25bd":Or.BIN3,"\u25bf":Or.BIN3,"\u25c3":Or.BIN3,"\u25ef":Or.BIN3,"\u2660":Or.ORD,"\u2661":Or.ORD,"\u2662":Or.ORD,"\u2663":Or.ORD,"\u266d":Or.ORD,"\u266e":Or.ORD,"\u266f":Or.ORD,"\u2758":[5,5,fr.REL,{stretchy:!0,symmetric:!0}],"\u2794":Or.WIDEREL,"\u2795":Or.BIN4,"\u2796":Or.BIN4,"\u2797":Or.BIN4,"\u2798":Or.REL,"\u2799":Or.WIDEREL,"\u279a":Or.REL,"\u279b":Or.WIDEREL,"\u279c":Or.WIDEREL,"\u279d":Or.WIDEREL,"\u279e":Or.WIDEREL,"\u279f":Or.WIDEREL,"\u27a0":Or.WIDEREL,"\u27a1":Or.WIDEREL,"\u27a5":Or.WIDEREL,"\u27a6":Or.WIDEREL,"\u27a7":Or.RELACCENT,"\u27a8":Or.WIDEREL,"\u27a9":Or.WIDEREL,"\u27aa":Or.WIDEREL,"\u27ab":Or.WIDEREL,"\u27ac":Or.WIDEREL,"\u27ad":Or.WIDEREL,"\u27ae":Or.WIDEREL,"\u27af":Or.WIDEREL,"\u27b1":Or.WIDEREL,"\u27b2":Or.RELACCENT,"\u27b3":Or.WIDEREL,"\u27b4":Or.REL,"\u27b5":Or.WIDEREL,"\u27b6":Or.REL,"\u27b7":Or.REL,"\u27b8":Or.WIDEREL,"\u27b9":Or.REL,"\u27ba":Or.WIDEREL,"\u27bb":Or.WIDEREL,"\u27bc":Or.WIDEREL,"\u27bd":Or.WIDEREL,"\u27be":Or.WIDEREL,"\u27c2":Or.REL,"\u27c2\u0338":Or.REL,"\u27cb":Or.BIN3,"\u27cd":Or.BIN3,"\u27f0":Or.RELSTRETCH,"\u27f1":Or.RELSTRETCH,"\u27f2":Or.REL,"\u27f3":Or.REL,"\u27f4":Or.RELSTRETCH,"\u27f5":Or.WIDEREL,"\u27f6":Or.WIDEREL,"\u27f7":Or.WIDEREL,"\u27f8":Or.WIDEREL,"\u27f9":Or.WIDEREL,"\u27fa":Or.WIDEREL,"\u27fb":Or.WIDEREL,"\u27fc":Or.WIDEREL,"\u27fd":Or.WIDEREL,"\u27fe":Or.WIDEREL,"\u27ff":Or.WIDEREL,"\u2900":Or.WIDEREL,"\u2901":Or.WIDEREL,"\u2902":Or.WIDEREL,"\u2903":Or.WIDEREL,"\u2904":Or.WIDEREL,"\u2905":Or.WIDEREL,"\u2906":Or.WIDEREL,"\u2907":Or.WIDEREL,"\u2908":Or.RELSTRETCH,"\u2909":Or.RELSTRETCH,"\u290a":Or.RELSTRETCH,"\u290b":Or.RELSTRETCH,"\u290c":Or.WIDEREL,"\u290d":Or.WIDEREL,"\u290e":Or.WIDEREL,"\u290f":Or.WIDEREL,"\u2910":Or.WIDEREL,"\u2911":Or.WIDEREL,"\u2912":Or.RELSTRETCH,"\u2913":Or.RELSTRETCH,"\u2914":Or.WIDEREL,"\u2915":Or.WIDEREL,"\u2916":Or.WIDEREL,"\u2917":Or.WIDEREL,"\u2918":Or.WIDEREL,"\u2919":Or.WIDEREL,"\u291a":Or.WIDEREL,"\u291b":Or.WIDEREL,"\u291c":Or.WIDEREL,"\u291d":Or.WIDEREL,"\u291e":Or.WIDEREL,"\u291f":Or.WIDEREL,"\u2920":Or.WIDEREL,"\u2921":Or.REL,"\u2922":Or.REL,"\u2923":Or.REL,"\u2924":Or.REL,"\u2925":Or.REL,"\u2926":Or.REL,"\u2927":Or.REL,"\u2928":Or.REL,"\u2929":Or.REL,"\u292a":Or.REL,"\u292b":Or.REL,"\u292c":Or.REL,"\u292d":Or.REL,"\u292e":Or.REL,"\u292f":Or.REL,"\u2930":Or.REL,"\u2931":Or.REL,"\u2932":Or.REL,"\u2933":Or.RELACCENT,"\u2934":Or.RELSTRETCH,"\u2935":Or.RELSTRETCH,"\u2936":Or.RELSTRETCH,"\u2937":Or.RELSTRETCH,"\u2938":Or.REL,"\u2939":Or.REL,"\u293a":Or.RELACCENT,"\u293b":Or.RELACCENT,"\u293c":Or.RELACCENT,"\u293d":Or.RELACCENT,"\u293e":Or.REL,"\u293f":Or.REL,"\u2940":Or.REL,"\u2941":Or.REL,"\u2942":Or.WIDEREL,"\u2943":Or.WIDEREL,"\u2944":Or.WIDEREL,"\u2945":Or.RELSTRETCH,"\u2946":Or.RELSTRETCH,"\u2947":Or.WIDEREL,"\u2948":Or.WIDEREL,"\u2949":Or.RELSTRETCH,"\u294a":Or.WIDEREL,"\u294b":Or.WIDEREL,"\u294c":Or.RELSTRETCH,"\u294d":Or.RELSTRETCH,"\u294e":Or.WIDEREL,"\u294f":Or.RELSTRETCH,"\u2950":Or.WIDEREL,"\u2951":Or.RELSTRETCH,"\u2952":Or.WIDEREL,"\u2953":Or.WIDEREL,"\u2954":Or.RELSTRETCH,"\u2955":Or.RELSTRETCH,"\u2956":Or.WIDEREL,"\u2957":Or.WIDEREL,"\u2958":Or.RELSTRETCH,"\u2959":Or.RELSTRETCH,"\u295a":Or.WIDEREL,"\u295b":Or.WIDEREL,"\u295c":Or.RELSTRETCH,"\u295d":Or.RELSTRETCH,"\u295e":Or.WIDEREL,"\u295f":Or.WIDEREL,"\u2960":Or.RELSTRETCH,"\u2961":Or.RELSTRETCH,"\u2962":Or.WIDEREL,"\u2963":Or.RELSTRETCH,"\u2964":Or.WIDEREL,"\u2965":Or.RELSTRETCH,"\u2966":Or.WIDEREL,"\u2967":Or.WIDEREL,"\u2968":Or.WIDEREL,"\u2969":Or.WIDEREL,"\u296a":Or.WIDEREL,"\u296b":Or.WIDEREL,"\u296c":Or.WIDEREL,"\u296d":Or.WIDEREL,"\u296e":Or.RELSTRETCH,"\u296f":Or.RELSTRETCH,"\u2970":Or.WIDEREL,"\u2971":Or.WIDEREL,"\u2972":Or.WIDEREL,"\u2973":Or.WIDEREL,"\u2974":Or.WIDEREL,"\u2975":Or.WIDEREL,"\u2976":Or.RELACCENT,"\u2977":Or.RELACCENT,"\u2978":Or.RELACCENT,"\u2979":Or.RELACCENT,"\u297a":Or.RELACCENT,"\u297b":Or.RELACCENT,"\u297c":Or.WIDEREL,"\u297d":Or.WIDEREL,"\u297e":Or.RELSTRETCH,"\u297f":Or.RELSTRETCH,"\u2981":Or.REL,"\u2982":Or.REL,"\u29b6":Or.REL,"\u29b7":Or.REL,"\u29b8":Or.BIN4,"\u29b9":Or.REL,"\u29bc":Or.BIN4,"\u29c0":Or.REL,"\u29c1":Or.REL,"\u29c4":Or.BIN4,"\u29c5":Or.BIN4,"\u29c6":Or.BIN3,"\u29c7":Or.BIN3,"\u29c8":Or.BIN3,"\u29ce":Or.REL,"\u29cf":Or.REL,"\u29d0":Or.REL,"\u29d1":Or.REL,"\u29d2":Or.REL,"\u29d3":Or.REL,"\u29d4":Or.BIN3,"\u29d5":Or.BIN3,"\u29d6":Or.BIN3,"\u29d7":Or.BIN3,"\u29df":Or.REL,"\u29e1":Or.REL,"\u29e2":Or.BIN3,"\u29e3":Or.REL,"\u29e4":Or.REL,"\u29e5":Or.REL,"\u29e6":Or.REL,"\u29f4":Or.REL,"\u29f5":Or.BIN4,"\u29f6":Or.BIN4,"\u29f7":Or.BIN4,"\u29f8":Or.BIN4,"\u29f9":Or.BIN4,"\u29fa":Or.BIN4,"\u29fb":Or.BIN4,"\u2a1d":Or.BIN3,"\u2a1e":Or.BIN3,"\u2a1f":Or.BIN4,"\u2a20":Or.BIN4,"\u2a21":Or.BIN4,"\u2a22":Or.BIN4,"\u2a23":Or.BIN4,"\u2a24":Or.BIN4,"\u2a25":Or.BIN4,"\u2a26":Or.BIN4,"\u2a27":Or.BIN4,"\u2a28":Or.BIN4,"\u2a29":Or.BIN4,"\u2a2a":Or.BIN4,"\u2a2b":Or.BIN4,"\u2a2c":Or.BIN4,"\u2a2d":Or.BIN4,"\u2a2e":Or.BIN4,"\u2a2f":Or.BIN3,"\u2a30":Or.BIN3,"\u2a31":Or.BIN3,"\u2a32":Or.BIN3,"\u2a33":Or.BIN3,"\u2a34":Or.BIN3,"\u2a35":Or.BIN3,"\u2a36":Or.BIN3,"\u2a37":Or.BIN3,"\u2a38":Or.BIN4,"\u2a39":Or.BIN4,"\u2a3a":Or.BIN4,"\u2a3b":Or.BIN3,"\u2a3c":Or.BIN3,"\u2a3d":Or.BIN3,"\u2a3e":Or.BIN4,"\u2a3f":Or.BIN3,"\u2a40":Or.BIN4,"\u2a41":Or.BIN4,"\u2a42":Or.BIN4,"\u2a43":Or.BIN4,"\u2a44":Or.BIN4,"\u2a45":Or.BIN4,"\u2a46":Or.BIN4,"\u2a47":Or.BIN4,"\u2a48":Or.BIN4,"\u2a49":Or.BIN4,"\u2a4a":Or.BIN4,"\u2a4b":Or.BIN4,"\u2a4c":Or.BIN4,"\u2a4d":Or.BIN4,"\u2a4e":Or.BIN4,"\u2a4f":Or.BIN4,"\u2a50":Or.BIN3,"\u2a51":Or.BIN4,"\u2a52":Or.BIN4,"\u2a53":Or.BIN4,"\u2a54":Or.BIN4,"\u2a55":Or.BIN4,"\u2a56":Or.BIN4,"\u2a57":Or.BIN4,"\u2a58":Or.BIN4,"\u2a59":Or.BIN4,"\u2a5a":Or.BIN4,"\u2a5b":Or.BIN4,"\u2a5c":Or.BIN4,"\u2a5d":Or.BIN4,"\u2a5e":Or.BIN4,"\u2a5f":Or.BIN4,"\u2a60":Or.BIN4,"\u2a61":Or.BIN4,"\u2a62":Or.BIN4,"\u2a63":Or.BIN4,"\u2a64":Or.BIN3,"\u2a65":Or.BIN3,"\u2a66":Or.REL,"\u2a67":Or.REL,"\u2a68":Or.REL,"\u2a69":Or.REL,"\u2a6a":Or.REL,"\u2a6b":Or.REL,"\u2a6c":Or.REL,"\u2a6d":Or.REL,"\u2a6e":Or.REL,"\u2a6f":Or.REL,"\u2a70":Or.REL,"\u2a71":Or.REL,"\u2a72":Or.REL,"\u2a73":Or.REL,"\u2a74":Or.REL,"\u2a75":Or.REL,"\u2a76":Or.REL,"\u2a77":Or.REL,"\u2a78":Or.REL,"\u2a79":Or.REL,"\u2a7a":Or.REL,"\u2a7b":Or.REL,"\u2a7c":Or.REL,"\u2a7d":Or.REL,"\u2a7d\u0338":Or.REL,"\u2a7e":Or.REL,"\u2a7e\u0338":Or.REL,"\u2a7f":Or.REL,"\u2a80":Or.REL,"\u2a81":Or.REL,"\u2a82":Or.REL,"\u2a83":Or.REL,"\u2a84":Or.REL,"\u2a85":Or.REL,"\u2a86":Or.REL,"\u2a87":Or.REL,"\u2a88":Or.REL,"\u2a89":Or.REL,"\u2a8a":Or.REL,"\u2a8b":Or.REL,"\u2a8c":Or.REL,"\u2a8d":Or.REL,"\u2a8e":Or.REL,"\u2a8f":Or.REL,"\u2a90":Or.REL,"\u2a91":Or.REL,"\u2a92":Or.REL,"\u2a93":Or.REL,"\u2a94":Or.REL,"\u2a95":Or.REL,"\u2a96":Or.REL,"\u2a97":Or.REL,"\u2a98":Or.REL,"\u2a99":Or.REL,"\u2a9a":Or.REL,"\u2a9b":Or.REL,"\u2a9c":Or.REL,"\u2a9d":Or.REL,"\u2a9e":Or.REL,"\u2a9f":Or.REL,"\u2aa0":Or.REL,"\u2aa1":Or.REL,"\u2aa2":Or.REL,"\u2aa3":Or.REL,"\u2aa4":Or.REL,"\u2aa5":Or.REL,"\u2aa6":Or.REL,"\u2aa7":Or.REL,"\u2aa8":Or.REL,"\u2aa9":Or.REL,"\u2aaa":Or.REL,"\u2aab":Or.REL,"\u2aac":Or.REL,"\u2aad":Or.REL,"\u2aae":Or.REL,"\u2aaf":Or.REL,"\u2aaf\u0338":Or.REL,"\u2ab0":Or.REL,"\u2ab0\u0338":Or.REL,"\u2ab1":Or.REL,"\u2ab2":Or.REL,"\u2ab3":Or.REL,"\u2ab4":Or.REL,"\u2ab5":Or.REL,"\u2ab6":Or.REL,"\u2ab7":Or.REL,"\u2ab8":Or.REL,"\u2ab9":Or.REL,"\u2aba":Or.REL,"\u2abb":Or.REL,"\u2abc":Or.REL,"\u2abd":Or.REL,"\u2abe":Or.REL,"\u2abf":Or.REL,"\u2ac0":Or.REL,"\u2ac1":Or.REL,"\u2ac2":Or.REL,"\u2ac3":Or.REL,"\u2ac4":Or.REL,"\u2ac5":Or.REL,"\u2ac6":Or.REL,"\u2ac7":Or.REL,"\u2ac8":Or.REL,"\u2ac9":Or.REL,"\u2aca":Or.REL,"\u2acb":Or.REL,"\u2acc":Or.REL,"\u2acd":Or.REL,"\u2ace":Or.REL,"\u2acf":Or.REL,"\u2ad0":Or.REL,"\u2ad1":Or.REL,"\u2ad2":Or.REL,"\u2ad3":Or.REL,"\u2ad4":Or.REL,"\u2ad5":Or.REL,"\u2ad6":Or.REL,"\u2ad7":Or.REL,"\u2ad8":Or.REL,"\u2ad9":Or.REL,"\u2ada":Or.REL,"\u2adb":Or.BIN4,"\u2add":Or.BIN3,"\u2add\u0338":Or.REL,"\u2ade":Or.REL,"\u2adf":Or.REL,"\u2ae0":Or.REL,"\u2ae1":Or.REL,"\u2ae2":Or.REL,"\u2ae3":Or.REL,"\u2ae4":Or.REL,"\u2ae5":Or.REL,"\u2ae6":Or.REL,"\u2ae7":Or.REL,"\u2ae8":Or.REL,"\u2ae9":Or.REL,"\u2aea":Or.REL,"\u2aeb":Or.REL,"\u2aee":Or.REL,"\u2af2":Or.REL,"\u2af3":Or.REL,"\u2af4":Or.REL,"\u2af5":Or.REL,"\u2af6":Or.BIN4,"\u2af7":Or.REL,"\u2af8":Or.REL,"\u2af9":Or.REL,"\u2afa":Or.REL,"\u2afb":Or.BIN4,"\u2afd":Or.BIN4,"\u2afe":Or.BIN3,"\u2b00":Or.REL,"\u2b01":Or.REL,"\u2b02":Or.REL,"\u2b03":Or.REL,"\u2b04":Or.WIDEREL,"\u2b05":Or.WIDEREL,"\u2b06":Or.RELSTRETCH,"\u2b07":Or.RELSTRETCH,"\u2b08":Or.REL,"\u2b09":Or.REL,"\u2b0a":Or.REL,"\u2b0b":Or.REL,"\u2b0c":Or.WIDEREL,"\u2b0d":Or.RELSTRETCH,"\u2b0e":Or.RELSTRETCH,"\u2b0f":Or.RELSTRETCH,"\u2b10":Or.RELSTRETCH,"\u2b11":Or.RELSTRETCH,"\u2b30":Or.WIDEREL,"\u2b31":Or.WIDEREL,"\u2b32":Or.RELSTRETCH,"\u2b33":Or.WIDEREL,"\u2b34":Or.WIDEREL,"\u2b35":Or.WIDEREL,"\u2b36":Or.WIDEREL,"\u2b37":Or.WIDEREL,"\u2b38":Or.WIDEREL,"\u2b39":Or.WIDEREL,"\u2b3a":Or.WIDEREL,"\u2b3b":Or.WIDEREL,"\u2b3c":Or.WIDEREL,"\u2b3d":Or.WIDEREL,"\u2b3e":Or.WIDEREL,"\u2b3f":Or.RELACCENT,"\u2b40":Or.WIDEREL,"\u2b41":Or.WIDEREL,"\u2b42":Or.WIDEREL,"\u2b43":Or.WIDEREL,"\u2b44":Or.WIDEREL,"\u2b45":Or.WIDEREL,"\u2b46":Or.WIDEREL,"\u2b47":Or.WIDEREL,"\u2b48":Or.WIDEREL,"\u2b49":Or.WIDEREL,"\u2b4a":Or.WIDEREL,"\u2b4b":Or.WIDEREL,"\u2b4c":Or.WIDEREL,"\u2b4d":Or.REL,"\u2b4e":Or.REL,"\u2b4f":Or.REL,"\u2b5a":Or.REL,"\u2b5b":Or.REL,"\u2b5c":Or.REL,"\u2b5d":Or.REL,"\u2b5e":Or.REL,"\u2b5f":Or.REL,"\u2b60":Or.WIDEREL,"\u2b61":Or.RELSTRETCH,"\u2b62":Or.WIDEREL,"\u2b63":Or.RELSTRETCH,"\u2b64":Or.WIDEREL,"\u2b65":Or.RELSTRETCH,"\u2b66":Or.REL,"\u2b67":Or.REL,"\u2b68":Or.REL,"\u2b69":Or.REL,"\u2b6a":Or.WIDEREL,"\u2b6b":Or.RELSTRETCH,"\u2b6c":Or.WIDEREL,"\u2b6d":Or.RELSTRETCH,"\u2b6e":Or.REL,"\u2b6f":Or.REL,"\u2b70":Or.WIDEREL,"\u2b71":Or.RELSTRETCH,"\u2b72":Or.WIDEREL,"\u2b73":Or.RELSTRETCH,"\u2b76":Or.REL,"\u2b77":Or.REL,"\u2b78":Or.REL,"\u2b79":Or.REL,"\u2b7a":Or.WIDEREL,"\u2b7b":Or.RELSTRETCH,"\u2b7c":Or.WIDEREL,"\u2b7d":Or.RELSTRETCH,"\u2b80":Or.WIDEREL,"\u2b81":Or.RELSTRETCH,"\u2b82":Or.WIDEREL,"\u2b83":Or.RELSTRETCH,"\u2b84":Or.WIDEREL,"\u2b85":Or.RELSTRETCH,"\u2b86":Or.WIDEREL,"\u2b87":Or.RELSTRETCH,"\u2b88":Or.RELACCENT,"\u2b89":Or.REL,"\u2b8a":Or.RELACCENT,"\u2b8b":Or.REL,"\u2b8c":Or.REL,"\u2b8d":Or.REL,"\u2b8e":Or.REL,"\u2b8f":Or.REL,"\u2b94":Or.REL,"\u2b95":Or.WIDEREL,"\u2ba0":Or.RELSTRETCH,"\u2ba1":Or.RELSTRETCH,"\u2ba2":Or.RELSTRETCH,"\u2ba3":Or.RELSTRETCH,"\u2ba4":Or.RELSTRETCH,"\u2ba5":Or.RELSTRETCH,"\u2ba6":Or.RELSTRETCH,"\u2ba7":Or.RELSTRETCH,"\u2ba8":Or.WIDEREL,"\u2ba9":Or.WIDEREL,"\u2baa":Or.WIDEREL,"\u2bab":Or.WIDEREL,"\u2bac":Or.RELSTRETCH,"\u2bad":Or.RELSTRETCH,"\u2bae":Or.RELSTRETCH,"\u2baf":Or.RELSTRETCH,"\u2bb0":Or.REL,"\u2bb1":Or.REL,"\u2bb2":Or.REL,"\u2bb3":Or.REL,"\u2bb4":Or.REL,"\u2bb5":Or.REL,"\u2bb6":Or.REL,"\u2bb7":Or.REL,"\u2bb8":Or.RELSTRETCH,"\u2bd1":Or.REL,\u3adc:Or.BIN3,"\ufe37":Or.WIDEACCENT,"\ufe38":Or.WIDEACCENT}};function Fr(t,e){return t.length!==e.length?e.length-t.length:t===e?0:t<e?-1:1}function Ur(t){return t.replace(/([\^$(){}.+*?\-|[\]:\\])/g,"\\$1")}function jr(t){return Array.from(t).map((t=>t.codePointAt(0)))}function qr(t){return String.fromCodePoint(...t)}function Hr(t){return!!t.match(/%\s*$/)}function Wr(t){return t.trim().split(/\s+/)}function Vr(t){return t.replace(/\\U(?:([0-9A-Fa-f]{4})|\{\s*([0-9A-Fa-f]{1,6})\s*\})|\\./g,((t,e,s)=>"\\\\"===t?"\\":String.fromCodePoint(parseInt(e||s,16))))}function Gr(t){return`&#x${t.codePointAt(0).toString(16).toUpperCase()};`}class Xr extends vr{constructor(){super(...arguments),this._texClass=null,this.lspace=5/18,this.rspace=5/18}get texClass(){return null===this._texClass?this.getOperatorDef(this.getText())[2]:this._texClass}set texClass(t){this._texClass=t}get kind(){return"mo"}get isEmbellished(){return!0}coreParent(){let t=null,e=this;const s=this.factory.getNodeClass("math");for(;e&&e.isEmbellished&&e.coreMO()===this&&!(e instanceof s);)t=e,e=e.parent;return t||this}coreText(t){if(!t)return"";if(t.isEmbellished)return t.coreMO().getText();for(;((t.isKind("mrow")||t.isKind("TeXAtom")||t.isKind("mstyle")||t.isKind("mphantom"))&&1===t.childNodes.length||t.isKind("munderover"))&&t.childNodes[0];)t=t.childNodes[0];return t.isToken?t.getText():""}hasSpacingAttributes(){return this.attributes.isSet("lspace")||this.attributes.isSet("rspace")}get isAccent(){let t=!1;const e=this.coreParent().parent;if(e){const s=e.isKind("mover")?e.childNodes[e.over].coreMO()?"accent":"":e.isKind("munder")?e.childNodes[e.under].coreMO()?"accentunder":"":e.isKind("munderover")?this===e.childNodes[e.over].coreMO()?"accent":this===e.childNodes[e.under].coreMO()?"accentunder":"":"";if(s){t=void 0!==e.attributes.getExplicit(s)?t:this.attributes.get("accent")}}return t}setTeXclass(t){const{form:e,fence:s}=this.attributes.getList("form","fence");return void 0===this.getProperty("texClass")&&this.hasSpacingAttributes()?null:(s&&this.texClass===fr.REL&&("prefix"===e&&(this.texClass=fr.OPEN),"postfix"===e&&(this.texClass=fr.CLOSE)),this.adjustTeXclass(t))}adjustTeXclass(t){const e=this.texClass;let s=this.prevClass;if(e===fr.NONE)return t;if(t?(!t.getProperty("autoOP")||e!==fr.BIN&&e!==fr.REL||(s=t.texClass=fr.ORD),s=this.prevClass=t.texClass||fr.ORD,this.prevLevel=this.attributes.getInherited("scriptlevel")):s=this.prevClass=fr.NONE,e!==fr.BIN||s!==fr.NONE&&s!==fr.BIN&&s!==fr.OP&&s!==fr.REL&&s!==fr.OPEN&&s!==fr.PUNCT)if(s!==fr.BIN||e!==fr.REL&&e!==fr.CLOSE&&e!==fr.PUNCT){if(e===fr.BIN){let t=null,e=this.parent;for(;e&&e.parent&&e.isEmbellished&&(1===e.childNodes.length||!e.isKind("mrow")&&e.core()===t);)t=e,e=e.parent;t=t||this,e.childNodes[e.childNodes.length-1]===t&&(this.texClass=fr.ORD)}}else t.texClass=this.prevClass=fr.ORD;else this.texClass=fr.ORD;return this}setInheritedAttributes(t={},e=!1,s=0,i=!1){super.setInheritedAttributes(t,e,s,i);const r=this.getText();this.checkOperatorTable(r),this.checkPseudoScripts(r),this.checkPrimes(r),this.checkMathAccent(r)}getOperatorDef(t){const[e,s,i]=this.handleExplicitForm(this.getForms());this.attributes.setInherited("form",e);const r=this.constructor,n=r.OPTABLE,o=n[e][t]||n[s][t]||n[i][t];if(o)return o;this.setProperty("noDictDef",!0);const a=this.attributes.get("movablelimits");if((!!t.match(r.opPattern)||a)&&void 0===this.getProperty("texClass"))return kr(1,2,fr.OP);const l=Dr(t),[c,h]=r.MMLSPACING[l[2]];return kr(c,h,l[2])}checkOperatorTable(t){const e=this.getOperatorDef(t);void 0===this.getProperty("texClass")&&(this.texClass=e[2]);for(const t of Object.keys(e[3]||{}))this.attributes.setInherited(t,e[3][t]);this.lspace=e[0]/18,this.rspace=e[1]/18}getForms(){let t=null,e=this.parent,s=this.Parent;for(;s&&s.isEmbellished;)t=e,e=s.parent,s=s.Parent;if(t=t||this,e&&e.isKind("mrow")&&1!==e.nonSpaceLength()){if(e.firstNonSpace()===t)return["prefix","infix","postfix"];if(e.lastNonSpace()===t)return["postfix","infix","prefix"]}return["infix","prefix","postfix"]}handleExplicitForm(t){if(this.attributes.isSet("form")){const e=this.attributes.get("form");t=[e].concat(t.filter((t=>t!==e)))}return t}checkPseudoScripts(t){const e=this.constructor.pseudoScripts;if(!t.match(e))return;const s=this.coreParent().Parent,i=!s||!(s.isKind("msubsup")&&!s.isKind("msub"));this.setProperty("pseudoscript",i),i&&(this.attributes.setInherited("lspace",0),this.attributes.setInherited("rspace",0))}checkPrimes(t){const e=this.constructor.primes;if(!t.match(e))return;const s=this.constructor.remapPrimes,i=qr(jr(t).map((t=>s[t])));this.setProperty("primes",i)}checkMathAccent(t){const e=this.Parent;if(void 0!==this.getProperty("mathaccent")||!e||!e.isKind("munderover"))return;const[s,i,r]=e.childNodes;if(s.isEmbellished&&s.coreMO()===this)return;const n=!(!i||!i.isEmbellished||i.coreMO()!==this),o=!(!r||!r.isEmbellished||i.coreMO()!==this);(n||o)&&(this.isMathAccent(t)?this.setProperty("mathaccent",!0):this.isMathAccentWithWidth(t)&&this.setProperty("mathaccent",!1))}isMathAccent(t=this.getText()){const e=this.constructor.mathaccents;return!!t.match(e)}isMathAccentWithWidth(t=this.getText()){const e=this.constructor.mathaccentsWithWidth;return!!t.match(e)}}Xr.defaults=Object.assign(Object.assign({},vr.defaults),{form:"infix",fence:!1,separator:!1,lspace:"thickmathspace",rspace:"thickmathspace",stretchy:!1,symmetric:!1,maxsize:"infinity",minsize:"0em",largeop:!1,movablelimits:!1,accent:!1,linebreak:"auto",lineleading:"100%",linebreakstyle:"before",indentalign:"auto",indentshift:"0",indenttarget:"",indentalignfirst:"indentalign",indentshiftfirst:"indentshift",indentalignlast:"indentalign",indentshiftlast:"indentshift"}),Xr.MMLSPACING=Pr,Xr.OPTABLE=Br,Xr.pseudoScripts=new RegExp(["^[\"'*`","\xaa","\xb0","\xb2-\xb4","\xb9","\xba","\u2018-\u201f","\u2032-\u2037\u2057","\u2070\u2071","\u2074-\u207f","\u2080-\u208e","]+$"].join("")),Xr.primes=new RegExp(["^[\"'","\u2018-\u201f","]+$"].join("")),Xr.opPattern=/^[a-zA-Z]{2,}$/,Xr.remapPrimes={34:8243,39:8242,8216:8245,8217:8242,8218:8242,8219:8245,8220:8246,8221:8243,8222:8243,8223:8246},Xr.mathaccents=new RegExp(["^[","\xb4\u0301\u02ca","`\u0300\u02cb","\xa8\u0308","~\u0303\u02dc","\xaf\u0304\u02c9","\u02d8\u0306","\u02c7\u030c","^\u0302\u02c6","\u20d0\u20d1","\u20d6\u20d7\u20e1","\u02d9\u0307","\u02da\u030a","\u20db","\u20dc","]$"].join("")),Xr.mathaccentsWithWidth=new RegExp(["^[","\u2190\u2192\u2194","\u23dc\u23dd","\u23de\u23df","]$"].join(""));class zr extends vr{constructor(){super(...arguments),this.texclass=fr.ORD}get kind(){return"mtext"}get isSpacelike(){return!!this.getText().match(/^\s*$/)&&!this.attributes.hasOneOf(zr.NONSPACELIKE)}}zr.NONSPACELIKE=["style","mathbackground","background"],zr.defaults=Object.assign({},vr.defaults);class Kr extends vr{constructor(){super(...arguments),this.texclass=fr.NONE}setTeXclass(t){return t}get kind(){return"mspace"}get arity(){return 0}get isSpacelike(){return!this.attributes.hasExplicit("linebreak")&&this.canBreak}get hasNewline(){const t=this.attributes.get("linebreak");return this.canBreak&&("newline"===t||"indentingnewline"===t)}get canBreak(){return!this.attributes.hasOneOf(Kr.NONSPACELIKE)&&"-"!==String(this.attributes.get("width")).trim().charAt(0)}}Kr.NONSPACELIKE=["height","depth","style","mathbackground","background"],Kr.defaults=Object.assign(Object.assign({},vr.defaults),{width:"0em",height:"0ex",depth:"0ex",linebreak:"auto",indentshift:"auto",indentalign:"auto",indenttarget:"",indentalignfirst:"indentalign",indentshiftfirst:"indentshift",indentalignlast:"indentalign",indentshiftlast:"indentshift"});class Jr extends vr{constructor(){super(...arguments),this.texclass=fr.ORD}get kind(){return"ms"}}Jr.defaults=Object.assign(Object.assign({},vr.defaults),{lquote:'"',rquote:'"'});class $r extends Ar{constructor(){super(...arguments),this._core=null}get kind(){return"mrow"}get isSpacelike(){for(const t of this.childNodes)if(!t.isSpacelike)return!1;return!0}get isEmbellished(){let t=!1,e=0;for(const s of this.childNodes){if(s)if(s.isEmbellished){if(t)return!1;t=!0,this._core=e}else if(!s.isSpacelike)return!1;e++}return t}core(){return this.isEmbellished&&null!=this._core?this.childNodes[this._core]:this}coreMO(){return this.isEmbellished&&null!=this._core?this.childNodes[this._core].coreMO():this}nonSpaceLength(){let t=0;for(const e of this.childNodes)e&&!e.isSpacelike&&t++;return t}firstNonSpace(){for(const t of this.childNodes)if(t&&!t.isSpacelike)return t;return null}lastNonSpace(){let t=this.childNodes.length;for(;--t>=0;){const e=this.childNodes[t];if(e&&!e.isSpacelike)return e}return null}setTeXclass(t){if(null!=this.getProperty("open")||null!=this.getProperty("close")){this.getPrevClass(t),t=null;for(const e of this.childNodes)t=e.setTeXclass(t);return null==this.texClass&&(this.texClass=fr.INNER),this}for(const e of this.childNodes)t=e.setTeXclass(t);return this.childNodes[0]&&this.updateTeXclass(this.childNodes[0]),t}}$r.defaults=Object.assign({},Ar.defaults);class Yr extends $r{get kind(){return"inferredMrow"}get isInferred(){return!0}get notParent(){return!0}toString(){return"["+this.childNodes.join(",")+"]"}}Yr.defaults=$r.defaults;class Qr extends wr{get kind(){return"mfrac"}get arity(){return 2}get linebreakContainer(){return!0}get linebreakAlign(){return""}setTeXclass(t){this.getPrevClass(t);for(const t of this.childNodes)t.setTeXclass(null);return this}setChildInheritedAttributes(t,e,s,i){(!e||s>0)&&s++;const r=this.attributes.get("numalign"),n=this.attributes.get("denomalign"),o=this.addInheritedAttributes(Object.assign({},t),{numalign:r,indentshift:"0",indentalignfirst:r,indentshiftfirst:"0",indentalignlast:"indentalign",indentshiftlast:"indentshift"}),a=this.addInheritedAttributes(Object.assign({},t),{denalign:n,indentshift:"0",indentalignfirst:n,indentshiftfirst:"0",indentalignlast:"indentalign",indentshiftlast:"indentshift"});this.childNodes[0].setInheritedAttributes(o,!1,s,i),this.childNodes[1].setInheritedAttributes(a,!1,s,!0)}}Qr.defaults=Object.assign(Object.assign({},wr.defaults),{linethickness:"medium",numalign:"center",denomalign:"center",bevelled:!1});class Zr extends Ar{constructor(){super(...arguments),this.texclass=fr.ORD}get kind(){return"msqrt"}get arity(){return-1}get linebreakContainer(){return!0}setTeXclass(t){return this.getPrevClass(t),this.childNodes[0].setTeXclass(null),this}setChildInheritedAttributes(t,e,s,i){this.childNodes[0].setInheritedAttributes(t,e,s,!0)}}Zr.defaults=Object.assign(Object.assign({},Ar.defaults),{"data-vertical-align":"bottom"});class tn extends Ar{constructor(){super(...arguments),this.texclass=fr.ORD}get kind(){return"mroot"}get arity(){return 2}get linebreakContainer(){return!0}setTeXclass(t){return this.getPrevClass(t),this.childNodes[0].setTeXclass(null),this.childNodes[1].setTeXclass(null),this}setChildInheritedAttributes(t,e,s,i){this.childNodes[0].setInheritedAttributes(t,e,s,!0),this.childNodes[1].setInheritedAttributes(t,!1,s+2,i)}}tn.defaults=Object.assign(Object.assign({},Ar.defaults),{"data-vertical-align":"bottom"});class en extends _r{get kind(){return"mstyle"}get notParent(){return this.childNodes[0]&&1===this.childNodes[0].childNodes.length}setInheritedAttributes(t={},e=!1,s=0,i=!1){this.attributes.setInherited("displaystyle",e),this.attributes.setInherited("scriptlevel",s),super.setInheritedAttributes(t,e,s,i)}setChildInheritedAttributes(t,e,s,i){let r=this.attributes.getExplicit("scriptlevel");null!=r&&(r=r.toString(),r.match(/^\s*[-+]/)?s+=parseInt(r):s=parseInt(r),i=!1);const n=this.attributes.getExplicit("displaystyle");null!=n&&(e=!0===n,i=!1);const o=this.attributes.getExplicit("data-cramped");null!=o&&(i=o),t=this.addInheritedAttributes(t,this.attributes.getAllAttributes()),this.childNodes[0].setInheritedAttributes(t,e,s,i)}}en.defaults=Object.assign(Object.assign({},_r.defaults),{scriptlevel:ur,displaystyle:ur,scriptsizemultiplier:1/Math.sqrt(2),scriptminsize:".4em",mathbackground:ur,mathcolor:ur,dir:ur,infixlinebreakstyle:"before"});class sn extends Ar{constructor(){super(...arguments),this.texclass=fr.ORD}get kind(){return"merror"}get arity(){return-1}get linebreakContainer(){return!0}}sn.defaults=Object.assign({},Ar.defaults);class rn extends _r{get kind(){return"mpadded"}get linebreakContainer(){return!0}setTeXclass(t){return this.getProperty("vbox")?(this.getPrevClass(t),this.texClass=fr.ORD,this.childNodes[0].setTeXclass(null),this):super.setTeXclass(t)}}rn.defaults=Object.assign(Object.assign({},_r.defaults),{width:"",height:"",depth:"",lspace:0,voffset:0});class nn extends _r{constructor(){super(...arguments),this.texclass=fr.ORD}get kind(){return"mphantom"}}nn.defaults=Object.assign({},_r.defaults);class on extends Ar{constructor(){super(...arguments),this.texclass=fr.INNER,this.separators=[],this.open=null,this.close=null}get kind(){return"mfenced"}setTeXclass(t){this.getPrevClass(t),this.open&&(t=this.open.setTeXclass(t)),this.childNodes[0]&&(t=this.childNodes[0].setTeXclass(t));for(let e=1,s=this.childNodes.length;e<s;e++)this.separators[e-1]&&(t=this.separators[e-1].setTeXclass(t)),this.childNodes[e]&&(t=this.childNodes[e].setTeXclass(t));return this.close&&(t=this.close.setTeXclass(t)),this.updateTeXclass(this.open),t}setChildInheritedAttributes(t,e,s,i){this.addFakeNodes();for(const r of[this.open,this.close].concat(this.separators))r&&r.setInheritedAttributes(t,e,s,i);super.setChildInheritedAttributes(t,e,s,i)}addFakeNodes(){let{open:t,close:e,separators:s}=this.attributes.getList("open","close","separators");if(t=t.replace(/[ \t\n\r]/g,""),e=e.replace(/[ \t\n\r]/g,""),s=s.replace(/[ \t\n\r]/g,""),t&&(this.open=this.fakeNode(t,{fence:!0,form:"prefix"},fr.OPEN)),s){for(;s.length<this.childNodes.length-1;)s+=s.charAt(s.length-1);let t=0;for(const e of this.childNodes.slice(1))e&&this.separators.push(this.fakeNode(s.charAt(t++)))}e&&(this.close=this.fakeNode(e,{fence:!0,form:"postfix"},fr.CLOSE))}fakeNode(t,e={},s=null){const i=this.factory.create("text").setText(t),r=this.factory.create("mo",e,[i]);return r.texClass=s,r.parent=this,r}}on.defaults=Object.assign(Object.assign({},Ar.defaults),{open:"(",close:")",separators:","});class an extends Ar{constructor(){super(...arguments),this.texclass=fr.ORD}get kind(){return"menclose"}get arity(){return-1}get linebreakContainer(){return!0}setTeXclass(t){return t=this.childNodes[0].setTeXclass(t),this.updateTeXclass(this.childNodes[0]),t}}an.defaults=Object.assign(Object.assign({},Ar.defaults),{notation:"longdiv"});class ln extends Ar{get kind(){return"maction"}get arity(){return 1}get selected(){const t=this.attributes.get("selection"),e=Math.max(1,Math.min(this.childNodes.length,t))-1;return this.childNodes[e]||this.factory.create("mrow")}get isEmbellished(){return this.selected.isEmbellished}get isSpacelike(){return this.selected.isSpacelike}core(){return this.selected.core()}coreMO(){return this.selected.coreMO()}verifyAttributes(t){super.verifyAttributes(t),"toggle"!==this.attributes.get("actiontype")&&this.attributes.hasExplicit("selection")&&this.attributes.unset("selection")}setTeXclass(t){"tooltip"===this.attributes.get("actiontype")&&this.childNodes[1]&&this.childNodes[1].setTeXclass(null);const e=this.selected;return t=e.setTeXclass(t),this.updateTeXclass(e),t}nextToggleSelection(){let t=Math.max(1,parseInt(this.attributes.get("selection"))+1);t>this.childNodes.length&&(t=1),this.attributes.set("selection",t)}setChildInheritedAttributes(t,e,s,i){var r,n;"tooltip"===this.attributes.get("actiontype").toLowerCase()?(null===(r=this.childNodes[0])||void 0===r||r.setInheritedAttributes(t,e,s,i),null===(n=this.childNodes[1])||void 0===n||n.setInheritedAttributes(t,!1,1,!1)):super.setChildInheritedAttributes(t,e,s,i)}}ln.defaults=Object.assign(Object.assign({},Ar.defaults),{actiontype:"toggle",selection:1});class cn extends wr{get kind(){return"msubsup"}get arity(){return 3}get base(){return 0}get sub(){return 1}get sup(){return 2}setChildInheritedAttributes(t,e,s,i){const r=this.childNodes;r[0].setInheritedAttributes(t,e,s,i),r[1].setInheritedAttributes(t,!1,s+1,i||1===this.sub),r[2]&&r[2].setInheritedAttributes(t,!1,s+1,i||2===this.sub)}}cn.defaults=Object.assign(Object.assign({},wr.defaults),{subscriptshift:"",superscriptshift:""});class hn extends cn{get kind(){return"msub"}get arity(){return 2}}hn.defaults=Object.assign({},cn.defaults);class dn extends cn{get kind(){return"msup"}get arity(){return 2}get sup(){return 1}get sub(){return 2}}dn.defaults=Object.assign({},cn.defaults);class un extends wr{get kind(){return"munderover"}get arity(){return 3}get base(){return 0}get under(){return 1}get over(){return 2}get linebreakContainer(){return!0}setChildInheritedAttributes(t,e,s,i){const r=this.childNodes;r[0].setInheritedAttributes(t,e,s,i||!!r[this.over]);const n=!(e||!r[0].coreMO().attributes.get("movablelimits")),o=this.constructor.ACCENTS;r[1].setInheritedAttributes(t,!1,this.getScriptlevel(o[1],n,s),i||1===this.under),this.setInheritedAccent(1,o[1],e,s,i,n),r[2]&&(r[2].setInheritedAttributes(t,!1,this.getScriptlevel(o[2],n,s),i||2===this.under),this.setInheritedAccent(2,o[2],e,s,i,n))}getScriptlevel(t,e,s){return!e&&this.attributes.get(t)||s++,s}setInheritedAccent(t,e,s,i,r,n){const o=this.childNodes[t];if(!this.attributes.hasExplicit(e)&&o.isEmbellished){const t=o.coreMO().attributes.get("accent");this.attributes.setInherited(e,t),t!==this.attributes.getDefault(e)&&o.setInheritedAttributes({},s,this.getScriptlevel(e,n,i),r)}}}un.defaults=Object.assign(Object.assign({},wr.defaults),{accent:!1,accentunder:!1,align:"center"}),un.ACCENTS=["","accentunder","accent"];class pn extends un{get kind(){return"munder"}get arity(){return 2}}pn.defaults=Object.assign({},un.defaults);class mn extends un{get kind(){return"mover"}get arity(){return 2}get over(){return 1}get under(){return 2}}mn.defaults=Object.assign({},un.defaults),mn.ACCENTS=["","accent","accentunder"];class gn extends cn{get kind(){return"mmultiscripts"}get arity(){return 1}setChildInheritedAttributes(t,e,s,i){this.childNodes[0].setInheritedAttributes(t,e,s,i);let r=!1;for(let e=1,n=0;e<this.childNodes.length;e++){const o=this.childNodes[e];if(o.isKind("mprescripts")){if(!r&&(r=!0,e%2==0)){const t=this.factory.create("none");this.childNodes.splice(e,0,t),t.parent=this,e++}}else{const e=i||n%2==0;o.setInheritedAttributes(t,!1,s+1,e),n++}}this.childNodes.length%2==(r?1:0)&&(this.appendChild(this.factory.create("none")),this.childNodes[this.childNodes.length-1].setInheritedAttributes(t,!1,s+1,i))}verifyChildren(t){let e=!1;const s=t.fixMmultiscripts;for(let i=0;i<this.childNodes.length;i++){const r=this.childNodes[i];r.isKind("mprescripts")&&(e?r.mError(r.kind+" can only appear once in "+this.kind,t,!0):(e=!0,i%2!=0||s||this.mError("There must be an equal number of prescripts of each type",t)))}this.childNodes.length%2!=(e?1:0)||s||this.mError("There must be an equal number of scripts of each type",t),super.verifyChildren(t)}}gn.defaults=Object.assign({},cn.defaults);class fn extends Ar{get kind(){return"mprescripts"}get arity(){return 0}verifyTree(t){super.verifyTree(t),this.parent&&!this.parent.isKind("mmultiscripts")&&this.mError(this.kind+" must be a child of mmultiscripts",t,!0)}}fn.defaults=Object.assign({},Ar.defaults);class bn extends Ar{get kind(){return"none"}get arity(){return 0}verifyTree(t){super.verifyTree(t),this.parent&&!this.parent.isKind("mmultiscripts")&&this.mError(this.kind+" must be a child of mmultiscripts",t,!0)}}bn.defaults=Object.assign({},Ar.defaults);class En extends Ar{constructor(){super(...arguments),this.properties={useHeight:!0},this.texclass=fr.ORD}get kind(){return"mtable"}get linebreakContainer(){return!0}get linebreakAlign(){return""}setInheritedAttributes(t,e,s,i){for(const e of Nr)t[e]&&this.attributes.setInherited(e,t[e][1]),this.attributes.hasExplicit(e)&&this.attributes.unset(e);super.setInheritedAttributes(t,e,s,i)}setChildInheritedAttributes(t,e,s,i){for(const t of this.childNodes)t.isKind("mtr")||this.replaceChild(this.factory.create("mtr"),t).appendChild(t);e=!(!this.attributes.getExplicit("displaystyle")&&!this.attributes.getDefault("displaystyle")),t=this.addInheritedAttributes(t,{columnalign:this.attributes.get("columnalign"),rowalign:"center","data-break-align":this.attributes.get("data-break-align")});const r=this.attributes.getExplicit("data-cramped"),n=Wr(this.attributes.get("rowalign"));for(const i of this.childNodes)t.rowalign[1]=n.shift()||t.rowalign[1],i.setInheritedAttributes(t,e,s,!!r)}verifyChildren(t){let e=null;const s=this.factory;for(let i=0;i<this.childNodes.length;i++){const r=this.childNodes[i];if(r.isKind("mtr"))e=null;else{const n=r.isKind("mtd");if(e?(this.removeChild(r),i--):e=this.replaceChild(s.create("mtr"),r),e.appendChild(n?r:s.create("mtd",{},[r])),!t.fixMtables){r.parent.removeChild(r),r.parent=this,n&&e.appendChild(s.create("mtd"));const i=r.mError("Children of "+this.kind+" must be mtr or mlabeledtr",t,n);e.childNodes[e.childNodes.length-1].appendChild(i)}}}super.verifyChildren(t)}setTeXclass(t){this.getPrevClass(t);for(const t of this.childNodes)t.setTeXclass(null);return this}}En.defaults=Object.assign(Object.assign({},Ar.defaults),{align:"axis",rowalign:"baseline",columnalign:"center",groupalign:"{left}",alignmentscope:!0,columnwidth:"auto",width:"auto",rowspacing:"1ex",columnspacing:".8em",rowlines:"none",columnlines:"none",frame:"none",framespacing:"0.4em 0.5ex",equalrows:!1,equalcolumns:!1,displaystyle:!1,side:"right",minlabelspacing:"0.8em","data-break-align":"top"});class xn extends Ar{get kind(){return"mtr"}get linebreakContainer(){return!0}get linebreakAlign(){return""}setChildInheritedAttributes(t,e,s,i){for(const t of this.childNodes)t.isKind("mtd")||this.replaceChild(this.factory.create("mtd"),t).appendChild(t);const r=Wr(this.attributes.get("columnalign")),n=Wr(this.attributes.get("data-break-align"));1===this.arity&&(r.unshift(this.parent.attributes.get("side")),n.unshift("top")),t=this.addInheritedAttributes(t,{rowalign:this.attributes.get("rowalign"),columnalign:"center","data-break-align":"top"});for(const o of this.childNodes)t.columnalign[1]=r.shift()||t.columnalign[1],t["data-vertical-align"]=[this.kind,n.shift()||t["data-break-align"][1]],o.setInheritedAttributes(t,e,s,i)}verifyChildren(t){if(!this.parent||this.parent.isKind("mtable")){for(const e of this.childNodes)if(!e.isKind("mtd")){this.replaceChild(this.factory.create("mtd"),e).appendChild(e),t.fixMtables||e.mError("Children of "+this.kind+" must be mtd",t)}super.verifyChildren(t)}else this.mError(this.kind+" can only be a child of an mtable",t,!0)}setTeXclass(t){this.getPrevClass(t);for(const t of this.childNodes)t.setTeXclass(null);return this}}xn.defaults=Object.assign(Object.assign({},Ar.defaults),{rowalign:ur,columnalign:ur,groupalign:ur,"data-break-align":"top"});class yn extends xn{get kind(){return"mlabeledtr"}get arity(){return 1}}class Nn extends wr{get kind(){return"mtd"}get arity(){return-1}get linebreakContainer(){return!0}get linebreakAlign(){return"columnalign"}verifyChildren(t){!this.parent||this.parent.isKind("mtr")?super.verifyChildren(t):this.mError(this.kind+" can only be a child of an mtr or mlabeledtr",t,!0)}setTeXclass(t){return this.getPrevClass(t),this.childNodes[0].setTeXclass(null),this}}Nn.defaults=Object.assign(Object.assign({},wr.defaults),{rowspan:1,columnspan:1,rowalign:ur,columnalign:ur,groupalign:ur,"data-vertical-align":"top"});class An extends _r{get kind(){return"maligngroup"}get isSpacelike(){return!0}setChildInheritedAttributes(t,e,s,i){t=this.addInheritedAttributes(t,this.attributes.getAllAttributes()),super.setChildInheritedAttributes(t,e,s,i)}}An.defaults=Object.assign(Object.assign({},_r.defaults),{groupalign:ur});class vn extends Ar{get kind(){return"malignmark"}get arity(){return 0}get isSpacelike(){return!0}}vn.defaults=Object.assign(Object.assign({},Ar.defaults),{edge:"left"});class _n extends vr{constructor(){super(...arguments),this.texclass=fr.ORD}get kind(){return"mglyph"}verifyAttributes(t){const{src:e,fontfamily:s,index:i}=this.attributes.getList("src","fontfamily","index");""!==e||""!==s&&""!==i?super.verifyAttributes(t):this.mError("mglyph must have either src or fontfamily and index attributes",t,!0)}}_n.defaults=Object.assign(Object.assign({},vr.defaults),{alt:"",src:"",index:"",width:"auto",height:"auto",valign:"0em"});class wn extends wr{get kind(){return"semantics"}get arity(){return 1}get notParent(){return!0}}wn.defaults=Object.assign(Object.assign({},wr.defaults),{definitionUrl:null,encoding:null});class Tn extends Ar{get kind(){return"annotation-xml"}setChildInheritedAttributes(){}}Tn.defaults=Object.assign(Object.assign({},Ar.defaults),{definitionUrl:null,encoding:null,cd:"mathmlkeys",name:"",src:null});class Cn extends Tn{constructor(){super(...arguments),this.properties={isChars:!0}}get kind(){return"annotation"}}Cn.defaults=Object.assign({},Tn.defaults);class Ln extends wr{get kind(){return"TeXAtom"}get arity(){return-1}get notParent(){return!0}constructor(t,e,s){super(t,e,s),this.texclass=fr.ORD,this.setProperty("texClass",this.texClass)}setTeXclass(t){return this.childNodes[0].setTeXclass(null),this.adjustTeXclass(t)}adjustTeXclass(t){return t}}Ln.defaults=Object.assign({},wr.defaults),Ln.prototype.adjustTeXclass=Xr.prototype.adjustTeXclass;class In extends wr{get kind(){return"MathChoice"}get arity(){return 4}get notParent(){return!0}setInheritedAttributes(t,e,s,i){const r=e?0:Math.max(0,Math.min(s,2))+1,n=this.childNodes[r]||this.factory.create("mrow");this.parent.replaceChild(n,this),n.setInheritedAttributes(t,e,s,i)}}In.defaults=Object.assign({},wr.defaults);class Rn extends Lr{get kind(){return"html"}getHTML(){return this.getXML()}setHTML(t,e=null){try{e.getAttribute(t,"data-mjx-hdw")}catch(s){t=e.node("span",{},[t])}return this.setXML(t,e)}getSerializedHTML(){return this.adaptor.outerHTML(this.xml)}textContent(){return this.adaptor.textContent(this.xml)}toString(){const t=this.adaptor.kind(this.xml);return`HTML=<${t}>...</${t}>`}verifyTree(t){!this.parent||this.parent.isToken||this.mError("HTML can only be a child of a token element",t,!0)}}const Sn={[Ir.prototype.kind]:Ir,[Rr.prototype.kind]:Rr,[Sr.prototype.kind]:Sr,[Xr.prototype.kind]:Xr,[zr.prototype.kind]:zr,[Kr.prototype.kind]:Kr,[Jr.prototype.kind]:Jr,[$r.prototype.kind]:$r,[Yr.prototype.kind]:Yr,[Qr.prototype.kind]:Qr,[Zr.prototype.kind]:Zr,[tn.prototype.kind]:tn,[en.prototype.kind]:en,[sn.prototype.kind]:sn,[rn.prototype.kind]:rn,[nn.prototype.kind]:nn,[on.prototype.kind]:on,[an.prototype.kind]:an,[ln.prototype.kind]:ln,[hn.prototype.kind]:hn,[dn.prototype.kind]:dn,[cn.prototype.kind]:cn,[pn.prototype.kind]:pn,[mn.prototype.kind]:mn,[un.prototype.kind]:un,[gn.prototype.kind]:gn,[fn.prototype.kind]:fn,[bn.prototype.kind]:bn,[En.prototype.kind]:En,[yn.prototype.kind]:yn,[xn.prototype.kind]:xn,[Nn.prototype.kind]:Nn,[An.prototype.kind]:An,[vn.prototype.kind]:vn,[_n.prototype.kind]:_n,[wn.prototype.kind]:wn,[Cn.prototype.kind]:Cn,[Tn.prototype.kind]:Tn,[Ln.prototype.kind]:Ln,[In.prototype.kind]:In,[Cr.prototype.kind]:Cr,[Lr.prototype.kind]:Lr,[Rn.prototype.kind]:Rn};class kn extends dr{get MML(){return this.node}}kn.defaultNodes=Sn;class On{constructor(){this.bits=0}static allocate(...t){for(const e of t){if(this.has(e))throw new Error("Bit already allocated for "+e);if(this.next===On.MAXBIT)throw new Error("Maximum number of bits already allocated");this.names.set(e,this.next),this.next<<=1}}static has(t){return this.names.has(t)}set(t){this.bits|=this.getBit(t)}clear(t){this.bits&=~this.getBit(t)}isSet(t){return!!(this.bits&this.getBit(t))}reset(){this.bits=0}getBit(t){const e=this.constructor.names.get(t);if(!e)throw new Error("Unknown bit-field name: "+t);return e}}function Mn(...t){const e=class extends On{};return e.allocate(...t),e}function Dn(t){return new Promise((function e(s,i){const r=t=>{var r;t.retry instanceof Promise?t.retry.then((()=>e(s,i))).catch((t=>i(t))):(null===(r=t.restart)||void 0===r?void 0:r.isCallback)?MathJax.Callback.After((()=>e(s,i)),t.restart):i(t)};try{const e=t();e instanceof Promise?e.then((t=>s(t))).catch((t=>r(t))):s(e)}catch(t){r(t)}}))}function Pn(t){const e=new Error("MathJax retry -- an asynchronous action is required; try using one of the promise-based functions and await its resolution.");throw e.retry=t,e}On.MAXBIT=1<<31,On.next=1,On.names=new Map;var Bn=function(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function a(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};class Fn extends bi{static create(t){const e=new this;for(const s of Object.keys(t)){const[i,r]=this.action(s,t[s]);r&&e.add(i,r)}return e}static action(t,e){let s,i,r=!0;const n=e[0];if(1===e.length||"boolean"==typeof e[1])2===e.length&&(r=e[1]),[s,i]=this.methodActions(t);else if("string"==typeof e[1])if("string"==typeof e[2]){4===e.length&&(r=e[3]);const[t,n]=e.slice(1);[s,i]=this.methodActions(t,n)}else 3===e.length&&(r=e[2]),[s,i]=this.methodActions(e[1]);else 4===e.length&&(r=e[3]),[s,i]=e.slice(1);return[{id:t,renderDoc:s,renderMath:i,convert:r},n]}static methodActions(t,e=t){return[e=>(t&&e[t](),!1),(t,s)=>(e&&t[e](s),!1)]}renderDoc(t,e=lr.UNPROCESSED){for(const s of this.items)if(s.priority>=e&&s.item.renderDoc(t))return}renderMath(t,e,s=lr.UNPROCESSED){for(const i of this.items)if(i.priority>=s&&i.item.renderMath(t,e))return}renderConvert(t,e,s=lr.LAST){for(const i of this.items){if(i.priority>s)return;if(i.item.convert&&i.item.renderMath(t,e))return}}findID(t){for(const e of this.items)if(e.item.id===t)return e.item;return null}}const Un={all:!1,processed:!1,inputJax:null,outputJax:null},jn={all:!0,processed:!0,inputJax:[],outputJax:[]};class qn extends tr{compile(t){return null}}class Hn extends er{typeset(t,e=null){return null}escaped(t,e){return null}}class Wn extends nr{}class Vn{constructor(t,e,s){const i=this.constructor;this.document=t,this.options=Fi(Bi({},i.OPTIONS),s),this.math=new(this.options.MathList||Wn),this.renderActions=Fn.create(this.options.renderActions),this._actionPromises=[],this._readyPromise=Promise.resolve(),this.processed=new Vn.ProcessBits,this.outputJax=this.options.OutputJax||new Hn;let r=this.options.InputJax||[new qn];Array.isArray(r)||(r=[r]),this.inputJax=r,this.adaptor=e,this.outputJax.setAdaptor(e),this.inputJax.map((t=>t.setAdaptor(e))),this.mmlFactory=this.options.MmlFactory||new kn,this.inputJax.map((t=>t.setMmlFactory(this.mmlFactory))),this.outputJax.initialize(),this.inputJax.map((t=>t.initialize()))}get kind(){return this.constructor.KIND}addRenderAction(t,...e){const[s,i]=Fn.action(t,e);this.renderActions.add(s,i)}removeRenderAction(t){const e=this.renderActions.findID(t);e&&this.renderActions.remove(e)}render(){return this.clearPromises(),this.renderActions.renderDoc(this),this}renderPromise(){return this.whenReady((()=>Dn((()=>Bn(this,void 0,void 0,(function*(){return this.render(),yield this.actionPromises(),this.clearPromises(),this}))))))}rerender(t=lr.RERENDER){return this.state(t-1),this.render(),this}rerenderPromise(t=lr.RERENDER){return this.whenReady((()=>Dn((()=>Bn(this,void 0,void 0,(function*(){return this.rerender(t),yield this.actionPromises(),this.clearPromises(),this}))))))}convert(t,e={}){let{format:s,display:i,end:r,ex:n,em:o,containerWidth:a,scale:l,family:c}=Fi({format:this.inputJax[0].name,display:!0,end:lr.LAST,em:16,ex:8,containerWidth:null,scale:1,family:""},e);null===a&&(a=80*n);const h=this.inputJax.reduce(((t,e)=>e.name===s?e:t),null),d=new this.options.MathItem(t,h,i);return d.start.node=this.adaptor.body(this.document),d.setMetrics(o,n,a,l),c&&this.outputJax.options.mtextInheritFont&&(d.outputData.mtextFamily=c),c&&this.outputJax.options.merrorInheritFont&&(d.outputData.merrorFamily=c),this.clearPromises(),d.convert(this,r),d.typesetRoot||d.root}convertPromise(t,e={}){return this.whenReady((()=>Dn((()=>Bn(this,void 0,void 0,(function*(){const s=this.convert(t,e);return yield this.actionPromises(),this.clearPromises(),s}))))))}whenReady(t){return this._readyPromise=this._readyPromise.catch((t=>{})).then((()=>{const e=this._readyPromise;this._readyPromise=Promise.resolve();const s=t(),i=this._readyPromise.then((()=>s));return this._readyPromise=e,i}))}actionPromises(){return Promise.all(this._actionPromises)}clearPromises(){this._actionPromises=[]}savePromise(t){this._actionPromises.push(t)}findMath(t=null){return this.processed.set("findMath"),this}compile(){if(!this.processed.isSet("compile")){const t=[];for(const e of this.math)this.compileMath(e),void 0!==e.inputData.recompile&&t.push(e);for(const e of t){const t=e.inputData.recompile;e.state(t.state),e.inputData.recompile=t,this.compileMath(e)}this.processed.set("compile")}return this}compileMath(t){try{t.compile(this)}catch(e){if(e.retry||e.restart)throw e;this.options.compileError(this,t,e),t.inputData.error=e}}compileError(t,e){t.root=this.mmlFactory.create("math",null,[this.mmlFactory.create("merror",{"data-mjx-error":e.message,title:e.message},[this.mmlFactory.create("mtext",null,[this.mmlFactory.create("text").setText("Math input error")])])]),t.display&&t.root.attributes.set("display","block"),t.inputData.error=e.message}typeset(){if(!this.processed.isSet("typeset")){for(const t of this.math)try{t.typeset(this)}catch(e){if(e.retry||e.restart)throw e;this.options.typesetError(this,t,e),t.outputData.error=e}this.processed.set("typeset")}return this}typesetError(t,e){t.typesetRoot=this.adaptor.node("mjx-container",{class:"MathJax mjx-output-error",jax:this.outputJax.name},[this.adaptor.node("span",{"data-mjx-error":e.message,title:e.message,style:{color:"red","background-color":"yellow","line-height":"normal"}},[this.adaptor.text("Math output error")])]),t.display&&this.adaptor.setAttributes(t.typesetRoot,{style:{display:"block",margin:"1em 0","text-align":"center"}}),t.outputData.error=e.message}getMetrics(){return this.processed.isSet("getMetrics")||(this.outputJax.getMetrics(this),this.processed.set("getMetrics")),this}updateDocument(){if(!this.processed.isSet("updateDocument")){for(const t of this.math.reversed())t.updateDocument(this);this.processed.set("updateDocument")}return this}removeFromDocument(t=!1){return this}state(t,e=!1){for(const s of this.math)s.state(t,e);return t<lr.INSERTED&&this.processed.clear("updateDocument"),t<lr.TYPESET&&(this.processed.clear("typeset"),this.processed.clear("getMetrics")),t<lr.COMPILED&&this.processed.clear("compile"),t<lr.FINDMATH&&this.processed.clear("findMath"),this}reset(t={processed:!0}){return(t=Fi(Object.assign({},Un),t)).all&&Object.assign(t,jn),t.processed&&this.processed.reset(),t.inputJax&&this.inputJax.forEach((e=>e.reset(...t.inputJax))),t.outputJax&&this.outputJax.reset(...t.outputJax),this}clear(){return this.reset(),this.math.clear(),this}done(){return Promise.resolve()}concat(t){return this.math.merge(t),this}clearMathItemsWithin(t){const e=this.getMathItemsWithin(t);for(const t of e.slice(0).reverse())t.clear();return this.math.remove(...e),e}getMathItemsWithin(t){Array.isArray(t)||(t=[t]);const e=this.adaptor,s=[],i=e.getElements(t,this.document);t:for(const t of this.math)for(const r of i)if(t.start.node&&e.contains(r,t.start.node)){s.push(t);continue t}return s}}Vn.KIND="MathDocument",Vn.OPTIONS={OutputJax:null,InputJax:null,MmlFactory:null,MathList:Wn,MathItem:class extends ar{},compileError:(t,e,s)=>{t.compileError(e,s)},typesetError:(t,e,s)=>{t.typesetError(e,s)},renderActions:ki({find:[lr.FINDMATH,"findMath","",!1],compile:[lr.COMPILED],metrics:[lr.METRICS,"getMetrics","",!1],typeset:[lr.TYPESET],update:[lr.INSERTED,"updateDocument",!1]})},Vn.ProcessBits=Mn("findMath","compile","getMetrics","typeset","updateDocument");class Gn extends Vn{}class Xn{constructor(t,e=5){this.documentClass=Gn,this.adaptor=t,this.priority=e}get name(){return this.constructor.NAME}handlesDocument(t){return!1}create(t,e){return new this.documentClass(t,this.adaptor,e)}}Xn.NAME="generic";class zn extends bi{register(t){return this.add(t,t.priority)}unregister(t){this.remove(t)}handlesDocument(t){for(const e of this){const s=e.item;if(s.handlesDocument(t))return s}throw new Error("Can't find handler for document")}document(t,e=null){return this.handlesDocument(t).create(t,e)}}class Kn{static methodName(t){return"visit"+(t.charAt(0).toUpperCase()+t.substring(1)).replace(/[^a-z0-9_]/gi,"_")+"Node"}constructor(t){this.nodeHandlers=new Map;for(const e of t.getKinds()){const t=this[Kn.methodName(e)];t&&this.nodeHandlers.set(e,t)}}visitTree(t,...e){return this.visitNode(t,...e)}visitNode(t,...e){return(this.nodeHandlers.get(t.kind)||this.visitDefault).call(this,t,...e)}visitDefault(t,...e){if("childNodes"in t)for(const s of t.childNodes)this.visitNode(s,...e)}setNodeHandler(t,e){this.nodeHandlers.set(t,e)}removeNodeHandler(t){this.nodeHandlers.delete(t)}}const Jn="data-mjx-";class $n extends Kn{constructor(t=null){t||(t=new kn),super(t)}visitTextNode(t,...e){}visitXMLNode(t,...e){}visitHtmlNode(t,...e){}getKind(t){const e=t.kind;return Hi(e,this.constructor.rename,e)}getAttributeList(t){const e=this.constructor,s=Hi(t.kind,e.defaultAttributes,{}),i=Object.assign({},s,this.getDataAttributes(t),t.attributes.getAllAttributes()),r=e.variants;return Object.hasOwn(i,"mathvariant")&&(Object.hasOwn(r,i.mathvariant)?i.mathvariant=r[i.mathvariant]:t.getProperty("ignore-variant")&&delete i.mathvariant),i}getDataAttributes(t){const e={},s=t.attributes.getExplicit("mathvariant"),i=this.constructor.variants;s&&(t.getProperty("ignore-variant")||Object.hasOwn(i,s))&&this.setDataAttribute(e,"variant",s),t.getProperty("variantForm")&&this.setDataAttribute(e,"alternate","1"),t.getProperty("pseudoscript")&&this.setDataAttribute(e,"pseudoscript","true"),!1===t.getProperty("autoOP")&&this.setDataAttribute(e,"auto-op","false");const r=t.getProperty("vbox");r&&this.setDataAttribute(e,"vbox",r);const n=t.getProperty("scriptalign");n&&this.setDataAttribute(e,"script-align",n);const o=t.getProperty("mathaccent");void 0!==o&&(o&&!t.isMathAccent()||!o&&!t.isMathAccentWithWidth())&&this.setDataAttribute(e,"mathaccent",o.toString());const a=t.getProperty("texClass");if(void 0!==a){let s=!0;if(a===fr.OP&&t.isKind("mi")){const e=t.getText();s=!(e.length>1&&e.match(Rr.operatorName))}s&&this.setDataAttribute(e,"texclass",a<0?"NONE":br[a])}return t.getProperty("smallmatrix")&&this.setDataAttribute(e,"smallmatrix","true"),e}setDataAttribute(t,e,s){t[Jn+e]=s}}$n.rename={TeXAtom:"mrow"},$n.variants={"-tex-calligraphic":"script","-tex-bold-calligraphic":"bold-script","-tex-oldstyle":"normal","-tex-bold-oldstyle":"bold","-tex-mathit":"italic"},$n.defaultAttributes={math:{xmlns:"http://www.w3.org/1998/Math/MathML"}};class Yn extends $n{constructor(){super(...arguments),this.document=null}visitTree(t,e){this.document=e;const s=e.createElement("top");return this.visitNode(t,s),this.document=null,s.firstChild}visitTextNode(t,e){e.appendChild(this.document.createTextNode(t.getText()))}visitXMLNode(t,e){e.appendChild(t.getXML().cloneNode(!0))}visitHtmlNode(t,e){e.appendChild(t.getHTML().cloneNode(!0))}visitInferredMrowNode(t,e){for(const s of t.childNodes)this.visitNode(s,e)}visitDefault(t,e){const s=this.document.createElement(this.getKind(t));this.addAttributes(t,s);for(const e of t.childNodes)this.visitNode(e,s);e.appendChild(s)}addAttributes(t,e){const s=this.getAttributeList(t);for(const t of Object.keys(s))e.setAttribute(t,s[t].toString())}}class Qn extends $n{visitTree(t){return this.visitNode(t,"")}visitTextNode(t,e){return this.quoteHTML(t.getText())}visitXMLNode(t,e){return e+t.getSerializedXML()}visitHtmlNode(t,e){return t.getSerializedHTML()}visitInferredMrowNode(t,e){const s=[];for(const i of t.childNodes)s.push(this.visitNode(i,e));return s.join("\n")}visitAnnotationNode(t,e){const s=this.childNodeMml(t,"","");return`${e}<annotation${this.getAttributes(t)}>${s}</annotation>`}visitDefault(t,e){const s=this.getKind(t),[i,r]=t.isToken||0===t.childNodes.length?["",""]:["\n",e],n=this.childNodeMml(t,e+" ",i),o=n.match(/\S/)?i+n+r:"";return`${e}<${s}${this.getAttributes(t)}>${o}</${s}>`}childNodeMml(t,e,s){let i="";for(const r of t.childNodes)i+=this.visitNode(r,e)+s;return i}getAttributes(t){const e=[],s=this.getAttributeList(t);for(const t of Object.keys(s)){const i=String(s[t]);void 0!==i&&e.push(t+'="'+this.quoteHTML(i)+'"')}return e.length?" "+e.join(" "):""}quoteHTML(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/[\uD800-\uDBFF]./g,this.toEntity).replace(/[\u0080-\uD7FF\uE000-\uFFFF]/g,this.toEntity)}toEntity(t){return Gr(t)}}class Zn{get kind(){return this.node.kind}constructor(t,e){this.factory=t,this.node=e}wrap(t){return this.factory.wrap(t)}walkTree(t,e){if(t(this,e),"childNodes"in this)for(const s of this.childNodes)s&&s.walkTree(t,e);return e}}class to extends hr{wrap(t,...e){return this.create(t.kind,t,...e)}}const eo={version:ni,context:mi,handlers:new zn,document:function(t,e){return eo.handlers.document(t,e)},handleRetriesFor:Dn,retryAfter:Pn,asyncLoad:null,asyncIsSynchronous:!1};class so extends ar{get adaptor(){return this.inputJax.adaptor}constructor(t,e,s=!0,i={node:null,n:0,delim:""},r={node:null,n:0,delim:""}){super(t,e,s,i,r)}updateDocument(t){if(this.state()<lr.INSERTED){if(this.inputJax.processStrings){let t=this.start.node;if(t===this.end.node)this.end.n&&this.end.n<this.adaptor.value(this.end.node).length&&this.adaptor.split(this.end.node,this.end.n),this.start.n&&(t=this.adaptor.split(this.start.node,this.start.n)),this.adaptor.parent(t)&&this.adaptor.replace(this.typesetRoot,t);else{for(this.start.n&&(t=this.adaptor.split(t,this.start.n));t!==this.end.node;){const e=this.adaptor.next(t);this.adaptor.remove(t),t=e}this.adaptor.insert(this.typesetRoot,t),this.end.n<this.adaptor.value(t).length&&this.adaptor.split(t,this.end.n),this.adaptor.remove(t)}}else this.adaptor.replace(this.typesetRoot,this.start.node);this.start.node=this.end.node=this.typesetRoot,this.start.n=this.end.n=0,this.state(lr.INSERTED)}}updateStyleSheet(t){t.addStyleSheet()}removeFromDocument(t=!1){if(super.removeFromDocument(t),this.state()>=lr.TYPESET){const e=this.adaptor,s=this.start.node;let i=e.text("");if(t){const t=this.start.delim+this.math+this.end.delim;if(this.inputJax.processStrings)i=e.text(t);else{const s=e.parse(t,"text/html");i=e.firstChild(e.body(s))}}e.parent(s)&&e.replace(i,s),this.start.node=this.end.node=i,this.start.n=this.end.n=0}}}class io extends nr{}class ro{constructor(t=null){const e=this.constructor;this.options=Fi(Bi({},e.OPTIONS),t),this.init(),this.getPatterns()}init(){this.strings=[],this.string="",this.snodes=[],this.nodes=[],this.stack=[]}getPatterns(){const t=Oi(this.options.skipHtmlTags),e=Oi(this.options.ignoreHtmlClass),s=Oi(this.options.processHtmlClass);this.skipHtmlTags=new RegExp("^(?:"+t.join("|")+")$","i"),this.ignoreHtmlClass=new RegExp("(?:^| )(?:"+e.join("|")+")(?: |$)"),this.processHtmlClass=new RegExp("(?:^| )(?:"+s+")(?: |$)")}pushString(){this.string.match(/\S/)&&(this.strings.push(this.string),this.nodes.push(this.snodes)),this.string="",this.snodes=[]}extendString(t,e){this.snodes.push([t,e.length]),this.string+=e}handleText(t,e){return e||this.extendString(t,this.adaptor.value(t)),this.adaptor.next(t)}handleTag(t,e){if(!e){const e=this.options.includeHtmlTags[this.adaptor.kind(t)];e instanceof Function?this.extendString(t,e(t,this.adaptor)):this.extendString(t,e)}return this.adaptor.next(t)}handleContainer(t,e){this.pushString();const s=this.adaptor.getAttribute(t,"class")||"",i=this.adaptor.kind(t)||"",r=this.processHtmlClass.exec(s);let n=t;return!this.adaptor.firstChild(t)||this.adaptor.getAttribute(t,"data-MJX")||!r&&this.skipHtmlTags.exec(i)?n=this.adaptor.next(t):(this.adaptor.next(t)&&this.stack.push([this.adaptor.next(t),e]),n=this.adaptor.firstChild(t),e=(e||this.ignoreHtmlClass.exec(s))&&!r),[n,e]}handleOther(t,e){return this.pushString(),this.adaptor.next(t)}find(t){this.init();const e=this.adaptor.next(t);let s=!1;const i=this.options.includeHtmlTags;for(;t&&t!==e;){const e=this.adaptor.kind(t);"#text"===e?t=this.handleText(t,s):Object.hasOwn(i,e)?t=this.handleTag(t,s):e?[t,s]=this.handleContainer(t,s):t=this.handleOther(t,s),!t&&this.stack.length&&(this.pushString(),[t,s]=this.stack.pop())}this.pushString();const r=[this.strings,this.nodes];return this.init(),r}}ro.OPTIONS={skipHtmlTags:["script","noscript","style","textarea","pre","code","math","select","option","mjx-container"],includeHtmlTags:ki({br:"\n",wbr:"","#comment":""}),ignoreHtmlClass:"mathjax_ignore",processHtmlClass:"mathjax_process"},cr("STYLES",lr.INSERTED+1);class no extends Vn{constructor(t,e,s){const[i,r]=qi(s,ro.OPTIONS);super(t,e,i),this.domStrings=this.options.DomStrings||new ro(r),this.domStrings.adaptor=e,this.styles=[]}findPosition(t,e,s,i){const r=this.adaptor,n=1/(i[t].length||1);let o=t;for(const[a,l]of i[t]){if(e<=l&&"#text"===r.kind(a))return{i:o,node:a,n:Math.max(e,0),delim:s};e-=l,o+=n}return{node:null,n:0,delim:s}}mathItem(t,e,s){const i=t.math,r=this.findPosition(t.n,t.start.n,t.open,s),n=this.findPosition(t.n,t.end.n,t.close,s);return new this.options.MathItem(i,e,t.display,r,n)}findMath(t){if(!this.processed.isSet("findMath")){this.adaptor.document=this.document,t=Fi({elements:this.options.elements||[this.adaptor.body(this.document)]},t);const e=this.adaptor.getElements(t.elements,this.document);for(const t of this.inputJax){const s=t.processStrings?this.findMathFromStrings(t,e):this.findMathFromDOM(t,e);this.math.merge(s)}this.processed.set("findMath")}return this}findMathFromStrings(t,e){const s=[],i=[];for(const t of e){const[e,r]=this.domStrings.find(t);s.push(...e),i.push(...r)}const r=new this.options.MathList;for(const e of t.findMath(s))r.push(this.mathItem(e,t,i));return r}findMathFromDOM(t,e){const s=[];for(const i of e)for(const e of t.findMath(i))s.push(new this.options.MathItem(e.math,t,e.display,e.start,e.end));return new this.options.MathList(...s)}updateDocument(){return this.processed.isSet("updateDocument")||(this.addPageElements(),this.addStyleSheet(),super.updateDocument(),this.processed.set("updateDocument")),this}addPageElements(){const t=this.adaptor,e=t.body(this.document),s=this.documentPageElements();if(s){const i=t.firstChild(e);i?t.insert(s,i):t.append(e,s)}}addStyleSheet(){const t=this.documentStyleSheet(),e=this.adaptor;if(t&&!e.parent(t)){const s=e.head(this.document),i=this.findSheet(s,e.getAttribute(t,"id"));i?e.replace(t,i):e.append(s,t)}}findSheet(t,e){if(e)for(const s of this.adaptor.tags(t,"style"))if(this.adaptor.getAttribute(s,"id")===e)return s;return null}removeFromDocument(t=!1){if(this.processed.isSet("updateDocument"))for(const e of this.math)e.state()>=lr.INSERTED&&e.state(lr.TYPESET,t);return this.processed.clear("updateDocument"),this}documentStyleSheet(){return this.outputJax.styleSheet(this)}documentPageElements(){return this.outputJax.pageElements(this)}addStyles(t){this.styles.push(t),"insertStyles"in this.outputJax&&this.outputJax.insertStyles(t)}getStyles(){return this.styles}}no.KIND="HTML",no.OPTIONS=Object.assign(Object.assign({},Vn.OPTIONS),{renderActions:ki(Object.assign(Object.assign({},Vn.OPTIONS.renderActions),{styles:[lr.STYLES,"","updateStyleSheet",!1]})),MathList:io,MathItem:so,DomStrings:null});class oo extends Xn{constructor(){super(...arguments),this.documentClass=no}handlesDocument(t){const e=this.adaptor;if("string"==typeof t)try{t=e.parse(t,"text/html")}catch(t){}return t instanceof e.window.Document||t instanceof e.window.HTMLElement||t instanceof e.window.DocumentFragment}create(t,e){const s=this.adaptor;if("string"==typeof t)t=s.parse(t,"text/html");else if(t instanceof s.window.HTMLElement||t instanceof s.window.DocumentFragment){const e=t;t=s.parse("","text/html"),s.append(s.body(t),e)}return super.create(t,e)}}function ao(t){const e=new oo(t);return eo.handlers.register(e),e}class lo{get cssText(){return this.getStyleString()}constructor(t=null){this.styles={},this.addStyles(t)}addStyles(t){if(t)for(const e of Object.keys(t))this.styles[e]||(this.styles[e]={}),Object.assign(this.styles[e],t[e])}removeStyles(...t){for(const e of t)delete this.styles[e]}clear(){this.styles={}}getStyleString(){return this.getStyleRules().join("\n\n")}getStyleRules(t=this.styles,e=""){const s=Object.keys(t),i=new Array(s.length);let r=0;for(const n of s){const s=t[n];i[r++]=`${e}${n} {\n${this.getStyleDefString(s,e)}\n${e}}`}return i}getStyleDefString(t,e){const s=Object.keys(t),i=new Array(s.length);let r=0;for(const n of s)i[r++]=t[n]instanceof Object?e+this.getStyleRules({[n]:t[n]},e+" ").join("\n"+e):" "+e+n+": "+t[n]+";";return i.join("\n"+e)}}var co;const ho=!!(null===(co=mi.window)||void 0===co?void 0:co.HTMLDialogElement);class uo{constructor(t){this.minW=200,this.minH=80,this.tx=0,this.ty=0,this.dragging=!1,this.events=[["mousemove",this.MouseMove.bind(this)],["mouseup",this.MouseUp.bind(this)]],this.mode="",this.actions={down:{move:t=>{t.dialog.classList.add("mjx-moving")}},move:{move:(t,e)=>[e.x-t.x,e.y-t.y,0,0],top:(t,e)=>[0,(e.y-t.y)/2,0,t.y-e.y],bottom:(t,e)=>[0,(e.y-t.y)/2,0,e.y-t.y],left:(t,e)=>[(e.x-t.x)/2,0,t.x-e.x,0],right:(t,e)=>[(e.x-t.x)/2,0,e.x-t.x,0],topleft:(t,e)=>[(e.x-t.x)/2,(e.y-t.y)/2,t.x-e.x,t.y-e.y],topright:(t,e)=>[(e.x-t.x)/2,(e.y-t.y)/2,e.x-t.x,t.y-e.y],botleft:(t,e)=>[(e.x-t.x)/2,(e.y-t.y)/2,t.x-e.x,e.y-t.y],botright:(t,e)=>[(e.x-t.x)/2,(e.y-t.y)/2,e.x-t.x,e.y-t.y]},up:{move:t=>{t.dialog.classList.remove("mjx-moving")}},keymove:{left:()=>[-5,0,0,0],right:()=>[5,0,0,0],up:()=>[0,-5,0,0],down:()=>[0,5,0,0]},bigmove:{left:()=>[-20,0,0,0],right:()=>[20,0,0,0],up:()=>[0,-20,0,0],down:()=>[0,20,0,0]},keysize:{left:()=>[-3,0,-6,0],right:()=>[3,0,6,0],up:()=>[0,-3,0,-6],down:()=>[0,3,0,6]},bigsize:{left:()=>[-10,0,-20,0],right:()=>[10,0,20,0],up:()=>[0,-10,0,-20],down:()=>[0,10,0,20]}};const{adaptor:e,node:s=null}=t;this.init(e),this.node=s,this.background=ho?null:e.node("mjx-dialog-background"),this.x=this.y=0,this.dragging=!1,this.action="",this.dialog=this.html(t),this.title=this.dialog.firstChild.firstChild.firstChild,this.content=this.dialog.firstChild.firstChild.nextSibling;const i=this.dialog.lastChild;i.addEventListener("click",this.closeDialog.bind(this)),i.addEventListener("keydown",this.actionKey.bind(this,this.closeDialog.bind(this)));const r=this.dialog.lastChild.previousSibling;r.addEventListener("click",this.helpDialog.bind(this,e)),r.addEventListener("keydown",this.actionKey.bind(this,this.helpDialog.bind(this,e))),this.noDrag=Array.from(this.dialog.querySelectorAll('[data-drag="none"]'))}init(t){const e=this.constructor;if(!t.document.head.querySelector("#"+e.styleId)){const s=t.node("style",{id:e.styleId});s.textContent=new lo(e.styles).cssText,t.document.head.append(s)}}html(t){const{title:e,message:s,adaptor:i,styles:r=null,extraNodes:n=[],className:o=uo.className}=t;if(r){const t=i.node("style");t.textContent=new lo(r).cssText,n.unshift(t)}const a="mjx-dialog-label-"+uo.id++,l=i.node("dialog",{closedby:"any",class:("mjx-dialog "+o).trim()},[i.node("mjx-dialog",{"aria-labeledby":a},[i.node("mjx-title",{},[i.node("h1",{id:a,tabIndex:0})]),i.node("div",{"data-drag":"none",tabIndex:0})]),...n,i.node("mjx-dialog-spacer",{"aria-hidden":!0}),i.node("mjx-dialog-drag",{"data-drag":"top","aria-hidden":!0}),i.node("mjx-dialog-drag",{"data-drag":"bottom","aria-hidden":!0}),i.node("mjx-dialog-drag",{"data-drag":"left","aria-hidden":!0}),i.node("mjx-dialog-drag",{"data-drag":"right","aria-hidden":!0}),i.node("mjx-dialog-drag",{"data-drag":"topleft","aria-hidden":!0}),i.node("mjx-dialog-drag",{"data-drag":"topright","aria-hidden":!0}),i.node("mjx-dialog-drag",{"data-drag":"botleft","aria-hidden":!0}),i.node("mjx-dialog-drag",{"data-drag":"botright","aria-hidden":!0}),i.node("mjx-dialog-help",{class:"mjx-dialog-button","data-drag":"none",tabIndex:0,role:"button","aria-label":"Dialog Help"},[i.node("mjx-dialog-icon",{"aria-hidden":!0},[i.text("?")])]),i.node("mjx-dialog-close",{class:"mjx-dialog-button","data-drag":"none",tabIndex:0,role:"button","aria-label":"Close Dialog Box"},[i.node("mjx-dialog-icon",{"aria-hidden":!0},[i.text("\xd7")])])]);return l.firstChild.firstChild.firstChild.innerHTML=e,l.firstChild.childNodes[1].innerHTML=s,l}attach(){ho?(this.dialog.addEventListener("mousedown",this.MouseDown.bind(this)),this.dialog.addEventListener("keydown",this.KeyDown.bind(this),!0),document.body.append(this.dialog),this.dialog.showModal()):(this.background.addEventListener("mousedown",this.MouseDown.bind(this)),this.background.addEventListener("keydown",this.KeyDown.bind(this),!0),this.dialog.setAttribute("tabindex","0"),this.dialog.addEventListener("click",this.stop),this.background.append(this.dialog),document.body.append(this.background)),mi.window.addEventListener("visibilitychange",this.Visibility.bind(this)),this.minW=Math.min(this.minW,this.dialog.clientWidth-8),this.minH=Math.min(this.minH,this.dialog.clientHeight-this.title.offsetHeight-8),this.title.focus()}dragAction(t,e=null){e&&this.stop(e);const s=this.actions[t][this.action],i=s?s(this,e):null;if(!i)return;let[r,n,o,a]=i;if(o){const t=this.w+o;t>=this.minW?(this.x=null==e?void 0:e.x,this.w=t,this.dialog.style.maxWidth=this.dialog.style.width=t+"px"):r=0}if(a){const t=this.h+a;t>=this.minH+this.title.offsetHeight?(this.y=null==e?void 0:e.y,this.h=t,this.dialog.style.maxHeight=this.dialog.style.height=t+"px"):n=0}(r||n)&&(r&&(this.x=null==e?void 0:e.x,this.tx+=r||0),n&&(this.y=null==e?void 0:e.y,this.ty+=n||0),this.dialog.style.transform=`translate(${this.tx}px, ${this.ty}px)`)}MouseDown(t){const e=t.target;if(!(1!==t.buttons||t.shiftKey||t.metaKey||t.altKey||t.ctrlKey))if(this.inDialog(t)){for(const t of this.noDrag)if(e===t||t.contains(e))return;this.action=e.getAttribute("data-drag")||"move",this.startDrag(t),this.dragAction("down",t)}else this.closeDialog(t)}MouseMove(t){1!==t.buttons&&this.endDrag(),this.dragging&&this.dragAction("move",t)}MouseUp(t){this.dragging&&(this.dragAction("up",t),this.endDrag())}Visibility(){mi.document.hidden&&this.closeDialog()}KeyDown(t){const e=this.constructor.keyActions.get(t.key);e&&e(this,t)}escKey(t){this.closeDialog(t)}aKey(t){(t.ctrlKey||t.metaKey)&&(this.selectAll(),this.stop(t))}mKey(t){this.mode="move"===this.mode?"":"move",this.stop(t)}sKey(t){this.mode="size"===this.mode?"":"size",this.stop(t)}arrowKey(t,e){t.ctrlKey||this.dragging||(this.action=e,this.getWH(),t.altKey||"move"===this.mode?(this.dragAction(t.shiftKey?"bigmove":"keymove"),this.stop(t)):(t.metaKey||"size"===this.mode)&&(this.dragAction(t.shiftKey?"bigsize":"keysize"),this.stop(t)),this.action="")}actionKey(t,e){"Enter"!==e.code&&"Space"!==e.code||t(e)}selectAll(){document.getSelection().selectAllChildren(this.content)}copyToClipboard(){this.selectAll();try{document.execCommand("copy")}catch(t){alert(`Can't copy to clipboard: ${t.message}`)}document.getSelection().removeAllRanges()}startDrag(t){this.x=t.x,this.y=t.y,this.getWH(),this.dragging=!0;const e=this.background||this.dialog;for(const[t,s]of this.events)e.addEventListener(t,s)}getWH(){this.w=this.dialog.clientWidth-8,this.h=this.dialog.clientHeight-8}endDrag(){this.action="",this.dragging=!1;const t=this.background||this.dialog;for(const[e,s]of this.events)t.removeEventListener(e,s)}closeDialog(t){var e;ho?(this.dialog.close(),this.dialog.remove()):this.background.remove(),null===(e=this.node)||void 0===e||e.focus(),t&&this.stop(t)}helpDialog(t,e){new uo({title:"MathJax Dialog Help",message:this.constructor.helpMessage,adaptor:t,className:"mjx-dialog-help",styles:{".mjx-dialog-help":{"max-width":"calc(min(50em, 80%))"}}}).attach(),this.stop(e)}inDialog(t){if(!this.dialog.contains(t.target))return!1;const{x:e,y:s}=t,{left:i,right:r,top:n,bottom:o}=this.dialog.getBoundingClientRect();return e>=i&&e<=r&&s>=n&&s<=o}stop(t){t.preventDefault&&t.preventDefault(),t.stopImmediatePropagation?t.stopImmediatePropagation():t.stopPropagation&&t.stopPropagation()}}uo.keyActions=new Map([["Escape",(t,e)=>t.escKey(e)],["a",(t,e)=>t.aKey(e)],["m",(t,e)=>t.mKey(e)],["s",(t,e)=>t.sKey(e)],["ArrowRight",(t,e)=>t.arrowKey(e,"right")],["ArrowLeft",(t,e)=>t.arrowKey(e,"left")],["ArrowUp",(t,e)=>t.arrowKey(e,"up")],["ArrowDown",(t,e)=>t.arrowKey(e,"down")]]),uo.styleId="MJX-DIALOG-styles",uo.className="",uo.id=0,uo.styles={"mjx-dialog-background":{display:"flex","flex-direction":"column","justify-content":"center",position:"fixed",top:0,left:0,right:0,bottom:0,"z-index":1001},".mjx-dialog":{"max-width":"calc(min(60em, 90%))","max-height":"calc(min(50em, 85%))",border:"3px outset","border-radius":"15px",color:"black","background-color":"#DDDDDD","box-shadow":"0px 10px 20px #808080",padding:"4px 4px",cursor:"grab",overflow:"visible",display:"flex","flex-direction":"column","align-items":"center",position:"relative",top:"-4%"},".mjx-dialog.mjx-moving":{cursor:"grabbing"},'.mjx-dialog > input[type="button"]':{width:"fit-content"},".mjx-dialog > mjx-dialog-spacer":{display:"block",height:".75em","flex-shrink":0},".mjx-dialog::backdrop":{opacity:0,cursor:"default"},"mjx-dialog":{all:"initial",cursor:"inherit",width:"100%",display:"flex","flex-direction":"column","flex-grow":1,"flex-shrink":1,overflow:"hidden"},"mjx-dialog > mjx-title":{display:"block","text-align":"center",margin:".25em 1.75em",overflow:"hidden","white-space":"nowrap","-webkit-user-select":"none","user-select":"none","flex-shrink":0},"mjx-dialog > mjx-title > h1":{"font-size":"125%",margin:0},"mjx-dialog > div":{margin:"0 1em .5em",padding:"8px 18px",overflow:"auto",border:"2px inset black","background-color":"white","text-align":"left",cursor:"default","flex-grow":1,"flex-shrink":1},"mjx-dialog > div > pre":{margin:0},".mjx-dialog-button":{position:"absolute",top:"6px",height:"17px",width:"17px",cursor:"default",display:"block",border:"2px solid #AAA","border-radius":"18px","font-family":'"Courier New", Courier',"text-align":"center",color:"#F0F0F0","-webkit-user-select":"none","user-select":"none"},".mjx-dialog-button:hover":{color:"white !important",border:"2px solid #CCC !important"},".mjx-dialog-button > mjx-dialog-icon":{display:"block","background-color":"#AAA",border:"1.5px solid","border-radius":"18px","line-height":0,padding:"8px 0 6px"},".mjx-dialog-button > mjx-dialog-icon:hover":{"background-color":"#CCC !important"},"mjx-dialog-close":{right:"6px","font-size":"20px;"},"mjx-dialog-help":{left:"6px","font-size":"14px;","font-weight":"bold"},".mjx-dialog-help mjx-dialog-help":{display:"none"},"mjx-dialog kbd":{display:"inline-block",padding:"3px 5px","font-size":"11px","line-height":"10px",color:"#444d56","vertical-align":"middle","background-color":"#fafbfc",border:"solid 1.5px #c6cbd1","border-bottom-color":"#959da5","border-radius":"3px","box-shadow":"inset -.5px -1px 0 #959da5"},'mjx-dialog-drag[data-drag="top"]':{height:"5px",position:"absolute",top:"-3px",left:"10px",right:"10px",cursor:"ns-resize"},'mjx-dialog-drag[data-drag="bottom"]':{height:"5px",position:"absolute",bottom:"-3px",left:"10px",right:"10px",cursor:"ns-resize"},'mjx-dialog-drag[data-drag="left"]':{width:"5px",position:"absolute",left:"-3px",top:"10px",bottom:"10px",cursor:"ew-resize"},'mjx-dialog-drag[data-drag="right"]':{width:"5px",position:"absolute",right:"-3px",top:"10px",bottom:"10px",cursor:"ew-resize"},'mjx-dialog-drag[data-drag="topleft"]':{width:"13px",height:"13px",position:"absolute",left:"-3px",top:"-3px",cursor:"nwse-resize"},'mjx-dialog-drag[data-drag="topright"]':{width:"13px",height:"13px",position:"absolute",right:"-3px",top:"-3px",cursor:"nesw-resize"},'mjx-dialog-drag[data-drag="botleft"]':{width:"13px",height:"13px",position:"absolute",left:"-3px",bottom:"-3px",cursor:"nesw-resize"},'mjx-dialog-drag[data-drag="botright"]':{width:"13px",height:"13px",position:"absolute",right:"-3px",bottom:"-3px",cursor:"nwse-resize"},"@media (prefers-color-scheme: dark)":{".mjx-dialog":{"background-color":"#303030","box-shadow":"0px 10px 20px #000",border:"3px outset #7C7C7C"},"mjx-dialog":{color:"#E0E0E0"},"mjx-dialog > div":{border:"2px inset #7C7C7C","background-color":"#222025"},"a[href]":{color:"#86A7F5"},"a[href]:visited":{color:"#DD98E2"},"mjx-dialog kbd":{color:"#F8F8F8","background-color":"#545454",border:"solid 1.5px #7A7C7E","border-bottom-color":"#707070","box-shadow":"inset -.5px -1px 0 #818589"},".mjx-dialog-button":{border:"2px solid #686868",color:"#A4A4A4"},".mjx-dialog-button:hover":{color:"#CBCBCB !important",border:"2px solid #888888 !important"},".mjx-dialog-button > mjx-dialog-icon":{"background-color":"#646464"},".mjx-dialog-button > mjx-dialog-icon:hover":{"background-color":"#888888 !important"}}},uo.helpMessage='\n <p>The dialog boxes in MathJax are movable and sizeable.</p>\n\n <p>For mouse users, dragging any of the edges will enlarge or shrink\n the dialog box by moving that side. Dragging any of the corners\n changes the two sides that meet at that corner. Dragging elsewhere on\n the dialog frame will move the dialog without changing its size.</p>\n\n <p>For keyboard users, there are two ways to adjust the position\n and size of the dialog box. The first is to hold the\n <kbd>Alt</kbd> or <kbd>Option</kbd> key and press any of the arrow\n keys to move the dialog box in the given direction. Hold the\n <kbd>Win</kbd> or <kbd>Command</kbd> key and press any of the\n arrow keys to enlarge or shrink the dialog box. Left and right\n move the right-hand edge of the dialog, while up and down move the\n bottom edge of the dialog.\n </p>\n\n <p>For some users, holding two keys down at once may be difficult,\n so the second way is to press the <kbd>m</kbd> to start "move"\n mode, then use the arrow keys to move the dialog box in the given\n direction. Press <kbd>m</kbd> again to stop moving the dialog.\n Similarly, press <kbd>s</kbd> to start and stop "sizing" mode,\n where the arrows will change the size of the dialog box.</p>\n\n <p>Holding a <kbd>shift</kbd> key along with the arrow key will\n make larger changes in the size or position, for either method\n described above.</p>\n\n <p>Use <kbd>Tab</kbd> to move among the text, buttons, and links\n within the dialog. The <kbd>Enter</kbd> or <kbd>Space</kbd> key\n activates the focused item. The <kbd>Escape</kbd> key closes the\n dialog, as does clicking outside the dialog box, or clicking the\n "\xd7" icon in the upper right-hand corner of the dialog.</p>\n ';class po extends uo{static post(t){const e=new this(t);return e.attach(),e}}function mo(t){return eo.asyncLoad?new Promise(((e,s)=>{const i=eo.asyncLoad(t);i instanceof Promise?i.then((t=>e(t))).catch((t=>s(t))):e(i)})):Promise.reject(`Can't load '${t}': No mathjax.asyncLoad method specified`)}const go=1e6,fo={px:1,in:96,cm:96/2.54,mm:96/25.4},bo={em:1,ex:.431,pt:.1,pc:1.2,mu:1/18},Eo={veryverythinmathspace:1/18,verythinmathspace:2/18,thinmathspace:3/18,mediummathspace:4/18,thickmathspace:5/18,verythickmathspace:6/18,veryverythickmathspace:7/18,negativeveryverythinmathspace:-1/18,negativeverythinmathspace:-2/18,negativethinmathspace:-3/18,negativemediummathspace:-4/18,negativethickmathspace:-5/18,negativeverythickmathspace:-6/18,negativeveryverythickmathspace:-7/18,thin:.04,medium:.06,thick:.1,normal:1,big:2,small:1/Math.sqrt(2),infinity:go};function xo(t,e=0,s=1,i=16){if("string"!=typeof t&&(t=String(t)),""===t||null==t)return e;if(Eo[t])return Eo[t];const r=t.match(/^\s*([-+]?(?:\.\d+|\d+(?:\.\d*)?))?(pt|em|ex|mu|px|pc|in|mm|cm|%)?/);if(!r||""===r[0])return e;const n=parseFloat(r[1]||"1"),o=r[2];return Object.hasOwn(fo,o)?n*fo[o]/i/s:Object.hasOwn(bo,o)?n*bo[o]:"%"===o?n/100*e:n*e}function yo(t){return(100*t).toFixed(1).replace(/\.?0+$/,"")+"%"}function No(t){return Math.abs(t)<.001?"0":t.toFixed(3).replace(/\.?0+$/,"")+"em"}function Ao(t,e=-go,s=16){return t*=s,e&&t<e&&(t=e),Math.abs(t)<.1?"0":t.toFixed(1).replace(/\.0$/,"")+"px"}class vo{static zero(){return new vo({h:0,d:0,w:0})}static empty(){return new vo}constructor(t={w:0,h:-go,d:-go}){this.w=t.w||0,this.h="h"in t?t.h:-go,this.d="d"in t?t.d:-go,this.L=this.R=this.ic=this.oc=this.sk=this.dx=0,this.scale=this.rscale=1,this.pwidth=""}empty(){return this.w=0,this.h=this.d=-go,this}clean(){this.w===-go&&(this.w=0),this.h===-go&&(this.h=0),this.d===-go&&(this.d=0)}rescale(t){this.w*=t,this.h*=t,this.d*=t}combine(t,e=0,s=0){const i=t.rscale,r=e+i*(t.w+t.L+t.R),n=s+i*t.h,o=i*t.d-s;r>this.w&&(this.w=r),n>this.h&&(this.h=n),o>this.d&&(this.d=o)}append(t){const e=t.rscale;this.w+=e*(t.w+t.L+t.R),e*t.h>this.h&&(this.h=e*t.h),e*t.d>this.d&&(this.d=e*t.d)}updateFrom(t){this.h=t.h,this.d=t.d,this.w=t.w,t.pwidth&&(this.pwidth=t.pwidth)}copy(){const t=new vo;return Object.assign(t,this),t}}vo.fullWidth="100%",vo.boxSides=[["Top",0,"h"],["Right",1,"w"],["Bottom",2,"d"],["Left",3,"w"]];const _o={loadMissingEntities:!0},wo={ApplyFunction:"\u2061",Backslash:"\u2216",Because:"\u2235",Breve:"\u02d8",Cap:"\u22d2",CenterDot:"\xb7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",Congruent:"\u2261",ContourIntegral:"\u222e",Coproduct:"\u2210",Cross:"\u2a2f",Cup:"\u22d3",CupCap:"\u224d",Dagger:"\u2021",Del:"\u2207",Delta:"\u0394",Diamond:"\u22c4",DifferentialD:"\u2146",DotEqual:"\u2250",DoubleDot:"\xa8",DoubleRightTee:"\u22a8",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownLeftVector:"\u21bd",DownRightVector:"\u21c1",DownTee:"\u22a4",Downarrow:"\u21d3",Element:"\u2208",EqualTilde:"\u2242",Equilibrium:"\u21cc",Exists:"\u2203",ExponentialE:"\u2147",FilledVerySmallSquare:"\u25aa",ForAll:"\u2200",Gamma:"\u0393",Gg:"\u22d9",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Hacek:"\u02c7",Hat:"^",HumpDownHump:"\u224e",HumpEqual:"\u224f",Im:"\u2111",ImaginaryI:"\u2148",Integral:"\u222b",Intersection:"\u22c2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Lambda:"\u039b",Larr:"\u219e",LeftAngleBracket:"\u27e8",LeftArrow:"\u2190",LeftArrowRightArrow:"\u21c6",LeftCeiling:"\u2308",LeftDownVector:"\u21c3",LeftFloor:"\u230a",LeftRightArrow:"\u2194",LeftTee:"\u22a3",LeftTriangle:"\u22b2",LeftTriangleEqual:"\u22b4",LeftUpVector:"\u21bf",LeftVector:"\u21bc",Leftarrow:"\u21d0",Leftrightarrow:"\u21d4",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",Ll:"\u22d8",Lleftarrow:"\u21da",LongLeftArrow:"\u27f5",LongLeftRightArrow:"\u27f7",LongRightArrow:"\u27f6",Longleftarrow:"\u27f8",Longleftrightarrow:"\u27fa",Longrightarrow:"\u27f9",Lsh:"\u21b0",MinusPlus:"\u2213",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotLeftTriangle:"\u22ea",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotPrecedes:"\u2280",NotPrecedesSlantEqual:"\u22e0",NotRightTriangle:"\u22eb",NotRightTriangleEqual:"\u22ed",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsSlantEqual:"\u22e1",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotVerticalBar:"\u2224",Omega:"\u03a9",OverBar:"\u203e",OverBrace:"\u23de",PartialD:"\u2202",Phi:"\u03a6",Pi:"\u03a0",PlusMinus:"\xb1",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",Product:"\u220f",Proportional:"\u221d",Psi:"\u03a8",Rarr:"\u21a0",Re:"\u211c",ReverseEquilibrium:"\u21cb",RightAngleBracket:"\u27e9",RightArrow:"\u2192",RightArrowLeftArrow:"\u21c4",RightCeiling:"\u2309",RightDownVector:"\u21c2",RightFloor:"\u230b",RightTee:"\u22a2",RightTeeArrow:"\u21a6",RightTriangle:"\u22b3",RightTriangleEqual:"\u22b5",RightUpVector:"\u21be",RightVector:"\u21c0",Rightarrow:"\u21d2",Rrightarrow:"\u21db",Rsh:"\u21b1",Sigma:"\u03a3",SmallCircle:"\u2218",Sqrt:"\u221a",Square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Star:"\u22c6",Subset:"\u22d0",SubsetEqual:"\u2286",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",SuchThat:"\u220b",Sum:"\u2211",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22d1",Therefore:"\u2234",Theta:"\u0398",Tilde:"\u223c",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",UnderBar:"_",UnderBrace:"\u23df",Union:"\u22c3",UnionPlus:"\u228e",UpArrow:"\u2191",UpDownArrow:"\u2195",UpTee:"\u22a5",Uparrow:"\u21d1",Updownarrow:"\u21d5",Upsilon:"\u03a5",Vdash:"\u22a9",Vee:"\u22c1",VerticalBar:"\u2223",VerticalTilde:"\u2240",Vvdash:"\u22aa",Wedge:"\u22c0",Xi:"\u039e",amp:"&",acute:"\xb4",aleph:"\u2135",alpha:"\u03b1",amalg:"\u2a3f",and:"\u2227",ang:"\u2220",angmsd:"\u2221",angsph:"\u2222",ape:"\u224a",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",beta:"\u03b2",beth:"\u2136",between:"\u226c",bigcirc:"\u25ef",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",blacklozenge:"\u29eb",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",bowtie:"\u22c8",boxdl:"\u2510",boxdr:"\u250c",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxul:"\u2518",boxur:"\u2514",bsol:"\\",bull:"\u2022",cap:"\u2229",check:"\u2713",chi:"\u03c7",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledR:"\xae",circledS:"\u24c8",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",clubs:"\u2663",colon:":",comp:"\u2201",ctdot:"\u22ef",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cup:"\u222a",curarr:"\u21b7",curlyvee:"\u22ce",curlywedge:"\u22cf",dagger:"\u2020",daleth:"\u2138",ddarr:"\u21ca",deg:"\xb0",delta:"\u03b4",digamma:"\u03dd",div:"\xf7",divideontimes:"\u22c7",dot:"\u02d9",doteqdot:"\u2251",dotplus:"\u2214",dotsquare:"\u22a1",dtdot:"\u22f1",ecir:"\u2256",efDot:"\u2252",egs:"\u2a96",ell:"\u2113",els:"\u2a95",empty:"\u2205",epsi:"\u03b5",epsiv:"\u03f5",erDot:"\u2253",eta:"\u03b7",eth:"\xf0",flat:"\u266d",fork:"\u22d4",frown:"\u2322",gEl:"\u2a8c",gamma:"\u03b3",gap:"\u2a86",gimel:"\u2137",gnE:"\u2269",gnap:"\u2a8a",gne:"\u2a88",gnsim:"\u22e7",gt:">",gtdot:"\u22d7",harrw:"\u21ad",hbar:"\u210f",hellip:"\u2026",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",imath:"\u0131",infin:"\u221e",intcal:"\u22ba",iota:"\u03b9",jmath:"\u0237",kappa:"\u03ba",kappav:"\u03f0",lEg:"\u2a8b",lambda:"\u03bb",lap:"\u2a85",larrlp:"\u21ab",larrtl:"\u21a2",lbrace:"{",lbrack:"[",le:"\u2264",leftleftarrows:"\u21c7",leftthreetimes:"\u22cb",lessdot:"\u22d6",lmoust:"\u23b0",lnE:"\u2268",lnap:"\u2a89",lne:"\u2a87",lnsim:"\u22e6",longmapsto:"\u27fc",looparrowright:"\u21ac",lowast:"\u2217",loz:"\u25ca",lt:"<",ltimes:"\u22c9",ltri:"\u25c3",macr:"\xaf",malt:"\u2720",mho:"\u2127",mu:"\u03bc",multimap:"\u22b8",nLeftarrow:"\u21cd",nLeftrightarrow:"\u21ce",nRightarrow:"\u21cf",nVDash:"\u22af",nVdash:"\u22ae",natur:"\u266e",nearr:"\u2197",nharr:"\u21ae",nlarr:"\u219a",not:"\xac",nrarr:"\u219b",nu:"\u03bd",nvDash:"\u22ad",nvdash:"\u22ac",nwarr:"\u2196",omega:"\u03c9",omicron:"\u03bf",or:"\u2228",osol:"\u2298",period:".",phi:"\u03c6",phiv:"\u03d5",pi:"\u03c0",piv:"\u03d6",prap:"\u2ab7",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",prime:"\u2032",psi:"\u03c8",quot:'"',rarrtl:"\u21a3",rbrace:"}",rbrack:"]",rho:"\u03c1",rhov:"\u03f1",rightrightarrows:"\u21c9",rightthreetimes:"\u22cc",ring:"\u02da",rmoust:"\u23b1",rtimes:"\u22ca",rtri:"\u25b9",scap:"\u2ab8",scnE:"\u2ab6",scnap:"\u2aba",scnsim:"\u22e9",sdot:"\u22c5",searr:"\u2198",sect:"\xa7",sharp:"\u266f",sigma:"\u03c3",sigmav:"\u03c2",simne:"\u2246",smile:"\u2323",spades:"\u2660",sub:"\u2282",subE:"\u2ac5",subnE:"\u2acb",subne:"\u228a",supE:"\u2ac6",supnE:"\u2acc",supne:"\u228b",swarr:"\u2199",tau:"\u03c4",theta:"\u03b8",thetav:"\u03d1",tilde:"\u02dc",times:"\xd7",triangle:"\u25b5",triangleq:"\u225c",upsi:"\u03c5",upuparrows:"\u21c8",veebar:"\u22bb",vellip:"\u22ee",weierp:"\u2118",xi:"\u03be",yen:"\xa5",zeta:"\u03b6",zigrarr:"\u21dd",nbsp:"\xa0",rsquo:"\u2019",lsquo:"\u2018"},To={};function Co(t,e){Object.assign(wo,t),To[e]=!0}function Lo(t){delete wo[t]}function Io(t){return t.replace(/&([a-z][a-z0-9]*|#(?:[0-9]+|x[0-9a-f]+));/gi,Ro)}function Ro(t,e){if("#"===e.charAt(0))return So(e.slice(1));if(wo[e])return wo[e];if(_o.loadMissingEntities){const t=e.match(/^[a-zA-Z](fr|scr|opf)$/)?RegExp.$1:e.charAt(0).toLowerCase();To[t]||(To[t]=!0,Pn(mo("./util/entities/"+t+".js")))}return t}function So(t){const e="x"===t.charAt(0)?parseInt(t.slice(1),16):parseInt(t);return String.fromCodePoint(e)}const ko=["top","right","bottom","left"],Oo=["width","style","color"];function Mo(t){const e=t.split(/((?:'[^'\n]*'|"[^"\n]*"|,[\s\n]|[^\s\n])*)/g),s=[];for(;e.length>1;)e.shift(),s.push(e.shift());return s}function Do(t){const e=Mo(this.styles[t]);0===e.length&&e.push(""),1===e.length&&e.push(e[0]),2===e.length&&e.push(e[0]),3===e.length&&e.push(e[1]);for(const s of Wo.connect[t].children)this.setStyle(this.childName(t,s),e.shift())}function Po(t){const e=Wo.connect[t].children,s=[];for(const i of e){const e=this.styles[t+"-"+i];if(!e)return void delete this.styles[t];s.push(e)}s[3]===s[1]&&(s.pop(),s[2]===s[0]&&(s.pop(),s[1]===s[0]&&s.pop())),this.styles[t]=s.join(" ")}const Bo=/^(?:[\d.]+(?:[a-z]+)|thin|medium|thick|inherit|initial|unset)$/,Fo=/^(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|inherit|initial|unset)$/;function Uo(t){const e={width:"",style:"",color:""};for(const s of Mo(this.styles[t]))s.match(Bo)&&""===e.width?e.width=s:s.match(Fo)&&""===e.style?e.style=s:e.color=s;for(const s of Wo.connect[t].children)this.setStyle(this.childName(t,s),e[s])}function jo(t){const e=[];for(const s of Wo.connect[t].children){const i=this.styles[this.childName(t,s)];i&&e.push(i)}e.length?this.styles[t]=e.join(" "):delete this.styles[t]}const qo={style:/^(?:normal|italic|oblique|inherit|initial|unset)$/,variant:new RegExp("^(?:"+["normal|none","inherit|initial|unset","common-ligatures|no-common-ligatures","discretionary-ligatures|no-discretionary-ligatures","historical-ligatures|no-historical-ligatures","contextual|no-contextual","(?:stylistic|character-variant|swash|ornaments|annotation)\\([^)]*\\)","small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","lining-nums|oldstyle-nums|proportional-nums|tabular-nums","diagonal-fractions|stacked-fractions","ordinal|slashed-zero","jis78|jis83|jis90|jis04|simplified|traditional","full-width|proportional-width","ruby"].join("|")+")$"),weight:/^(?:normal|bold|bolder|lighter|[1-9]00|inherit|initial|unset)$/,stretch:new RegExp("^(?:"+["normal","(?:(?:ultra|extra|semi)-)?(?:condensed|expanded)","inherit|initial|unset"].join("|")+")$"),size:new RegExp("^(?:"+["xx-small|x-small|small|medium|large|x-large|xx-large|larger|smaller","[\\d.]+%|[\\d.]+[a-z]+","inherit|initial|unset"].join("|")+")(?:/(?:normal|[\\d.]+(?:%|[a-z]+)?))?$")};function Ho(t,e){for(const s of Wo.connect[t].children){const i=this.childName(t,s);if(Array.isArray(e[s])){const t=e[s];t.length&&(this.styles[i]=t.join(" "))}else""!==e[s]&&(this.styles[i]=e[s])}}class Wo{constructor(t=""){this.parse(t)}sanitizeValue(t){const e=this.constructor.pattern;if(!t.match(e.sanitize))return t;const s=(t=t.replace(e.value,"$1")).replace(/\\./g,"").replace(/(['"]).*?\1/g,"").replace(/[^'"]/g,"");return s.length&&(t+=s.charAt(0)),t}get cssText(){var t,e;const s=[];for(const i of Object.keys(this.styles)){const r=this.parentName(i),n=i.replace(/.*-/,"");this.styles[r]&&(null===(e=null===(t=Wo.connect[r])||void 0===t?void 0:t.children)||void 0===e?void 0:e.includes(n))||s.push(`${i}: ${this.styles[i]};`)}return s.join(" ")}get styleList(){return Object.assign({},this.styles)}set(t,e){var s,i;for(t=this.normalizeName(t),this.setStyle(t,String(e)),Wo.connect[t]&&!Wo.connect[t].combine&&(this.combineChildren(t),delete this.styles[t]);t.match(/-/);){const e=t;if(t=this.parentName(t),!Wo.connect[e]&&!(null===(i=null===(s=Wo.connect[t])||void 0===s?void 0:s.children)||void 0===i?void 0:i.includes(e.substring(t.length+1))))break;Wo.connect[t].combine.call(this,t)}}get(t){return t=this.normalizeName(t),Object.hasOwn(this.styles,t)?this.styles[t]:""}setStyle(t,e){this.styles[t]=this.sanitizeValue(e),Wo.connect[t]&&Wo.connect[t].children&&Wo.connect[t].split.call(this,t),""===e&&delete this.styles[t]}combineChildren(t){const e=this.parentName(t);for(const s of Wo.connect[t].children){const t=this.childName(e,s);Wo.connect[t].combine.call(this,t)}}parentName(t){const e=t.replace(/-[^-]*$/,"");return t===e?"":e}childName(t,e){return e.match(/-/)?e:(Wo.connect[t]&&!Wo.connect[t].combine&&(e+=t.replace(/.*-/,"-"),t=this.parentName(t)),t+"-"+e)}normalizeName(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}parse(t=""){const e=this.constructor.pattern;this.styles={};const s=t.replace(/\n/g," ").replace(e.comment,"").split(e.style);for(;s.length>1;){const[t,e,i]=s.splice(0,3);if(t.match(/[^\s\n;]/))return;this.set(e,i)}}}function Vo(t){return t.reduce(((t,e)=>t+e),0)}function Go(t){return t.reduce(((t,e)=>Math.max(t,e)),0)}if(Wo.pattern={sanitize:/['";]/,value:/^((:?'(?:\\.|[^'])*(?:'|$)|"(?:\\.|[^"])*(?:"|$)|\n|\\.|[^'";])*?)[\s\n]*(?:;|$).*/,style:/([-a-z]+)[\s\n]*:[\s\n]*((?:'(?:\\.|[^'])*(?:'|$)|"(?:\\.|[^"])*(?:"|$)|\n|\\.|[^'";])*?)[\s\n]*(?:;|$)/g,comment:/\/\*[^]*?\*\//g},Wo.connect={padding:{children:ko,split:Do,combine:Po},margin:{children:ko,split:Do,combine:Po},border:{children:ko,split:function(t){for(const e of Wo.connect[t].children)this.setStyle(this.childName(t,e),this.styles[t])},combine:function(t){const e=[...Wo.connect[t].children],s=this.styles[this.childName(t,e.shift())];for(const i of e)if(this.styles[this.childName(t,i)]!==s)return void delete this.styles[t];this.styles[t]=s}},"border-top":{children:Oo,split:Uo,combine:jo},"border-right":{children:Oo,split:Uo,combine:jo},"border-bottom":{children:Oo,split:Uo,combine:jo},"border-left":{children:Oo,split:Uo,combine:jo},"border-width":{children:ko,split:Do,combine:null},"border-style":{children:ko,split:Do,combine:null},"border-color":{children:ko,split:Do,combine:null},font:{children:["style","variant","weight","stretch","line-height","size","family"],split:function(t){const e=Mo(this.styles[t]),s={style:"",variant:[],weight:"",stretch:"",size:"",family:"","line-height":""};for(const t of e){s.family||(s.family=t);for(const e of Object.keys(qo))if((Array.isArray(s[e])||""===s[e])&&t.match(qo[e]))if(s.family===t&&(s.family=""),"size"===e){const[i,r]=t.split(/\//);s[e]=i,r&&(s["line-height"]=r)}else""===s.size&&(Array.isArray(s[e])?s[e].push(t):""===s[e]&&(s[e]=t))}Ho.call(this,t,s),delete this.styles[t]},combine:function(t){}}},MathJax.loader&&MathJax.loader.checkVersion("core",ni,"core"),di({_:{adaptors:{HTMLAdaptor:c,browserAdaptor:h},components:{global:t},core:{DOMAdaptor:l,FindMath:d,Handler:ot,HandlerList:at,InputJax:u,MathDocument:nt,MathItem:f,MathList:g,MmlTree:{Attributes:x,MML:et,MathMLVisitor:ht,MmlFactory:st,MmlNode:N,MmlNodes:{HtmlNode:tt,TeXAtom:Q,maction:q,maligngroup:K,malignmark:J,math:A,mathchoice:Z,menclose:j,merror:P,mfenced:U,mfrac:k,mglyph:$,mi:v,mmultiscripts:V,mn:_,mo:C,mpadded:B,mphantom:F,mroot:M,mrow:S,ms:R,mspace:I,msqrt:O,mstyle:D,msubsup:H,mtable:G,mtd:z,mtext:L,mtr:X,munderover:W,semantics:Y},MmlVisitor:ct,OperatorDictionary:w,SerializedMmlVisitor:dt},OutputJax:p,Tree:{Factory:b,Node:y,NodeFactory:E,Visitor:lt,Wrapper:ut,WrapperFactory:pt}},handlers:{html_ts:yt,html:{HTMLDocument:Et,HTMLDomStrings:bt,HTMLHandler:xt,HTMLMathItem:gt,HTMLMathList:ft}},mathjax:mt,ui:{dialog:{DraggableDialog:At,InfoDialog:vt}},util:{AsyncLoad:_t,BBox:Tt,BitField:it,Entities:Ct,FunctionList:r,LinkedList:m,Options:o,PrioritizedList:i,Retries:rt,StyleJson:Nt,Styles:Lt,context:e,lengths:wt,numeric:It,string:T}}}),MathJax.startup&&(MathJax.startup.registerConstructor("HTMLHandler",oo),MathJax.startup.registerConstructor("browserAdaptor",Qi),MathJax.startup.useHandler("HTMLHandler"),MathJax.startup.useAdaptor("browserAdaptor")),MathJax.loader){const t=MathJax.config.loader;MathJax._.mathjax.mathjax.asyncLoad=e=>"node:"===e.substring(0,5)?t.require(e):MathJax.loader.load(e).then((t=>t[0]))}class Xo extends Zi{constructor(t){super(t),this.getPatterns()}getPatterns(){const t=this.options,e=[],s=[],i=[];this.end={},this.env=this.sub=0;let r=1;t.inlineMath.forEach((t=>this.addPattern(e,t,!1))),t.displayMath.forEach((t=>this.addPattern(e,t,!0))),e.length&&s.push(e.sort(Fr).join("|")),t.processEnvironments&&(s.push("\\\\begin\\s*\\{([^}]*)\\}"),this.env=r,r++),t.processEscapes&&i.push("\\\\([\\\\$])"),t.processRefs&&i.push("(\\\\(?:eq)?ref\\s*\\{[^}]*\\})"),i.length&&(s.push("("+i.join("|")+")"),this.sub=r),this.start=new RegExp(s.join("|"),"g"),this.hasPatterns=s.length>0}addPattern(t,e,s){const[i,r]=e;t.push(Ur(i)),this.end[i]=[r,s,this.endPattern(r)]}endPattern(t,e){return new RegExp((e||Ur(t))+"|\\\\(?:[a-zA-Z]|.)|[{}]","g")}findEnd(t,e,s,i){const[r,n,o]=i,a=o.lastIndex=s.index+s[0].length;let l,c=0;for(;l=o.exec(t);){if((l[1]||l[0])===r&&0===c)return or(s[0],t.substring(a,l.index),l[0],e,s.index,l.index+l[0].length,n);"{"===l[0]?c++:"}"===l[0]&&c&&c--}return null}findMathInString(t,e,s){let i,r;for(this.start.lastIndex=0;i=this.start.exec(s);){if(void 0!==i[this.env]&&this.env){const t="\\\\end\\s*(\\{"+Ur(i[this.env])+"\\})";r=this.findEnd(s,e,i,["{"+i[this.env]+"}",!0,this.endPattern(null,t)]),r&&(r.math=r.open+r.math+r.close,r.open=r.close="")}else if(void 0!==i[this.sub]&&this.sub){const t=i[this.sub],s=i.index+i[this.sub].length;r=2===t.length?or("\\",t.substring(1),"",e,i.index,s):or("",t,"",e,i.index,s,!1)}else r=this.findEnd(s,e,i,this.end[i[0]]);r&&(t.push(r),this.start.lastIndex=r.end.n)}}findMath(t){const e=[];if(this.hasPatterns)for(let s=0,i=t.length;s<i;s++)this.findMathInString(e,s,t[s]);return e}}Xo.OPTIONS={inlineMath:[["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:!0,processEnvironments:!0,processRefs:!0};const zo={attrs:new Set(["autoOP","fnOP","movesupsub","subsupOK","texprimestyle","useHeight","variantForm","withDelims","mathaccent","open","close"]),createEntity:t=>String.fromCodePoint(parseInt(t,16)),getChildren:t=>t.childNodes,getText:t=>t.getText(),appendChildren(t,e){for(const s of e)t.appendChild(s)},setAttribute(t,e,s){t.attributes.set(e,s)},setProperty(t,e,s){t.setProperty(e,s)},setProperties(t,e){for(const s of Object.keys(e)){const i=e[s];"texClass"===s?(t.texClass=i,t.setProperty(s,i)):"movablelimits"===s?(t.setProperty("movablelimits",i),(t.isKind("mo")||t.isKind("mstyle"))&&t.attributes.set("movablelimits",i)):"inferred"===s||(zo.attrs.has(s)?t.setProperty(s,i):t.attributes.set(s,i))}},getProperty:(t,e)=>t.getProperty(e),getAttribute:(t,e)=>t.attributes.get(e),removeAttribute(t,e){t.attributes.unset(e)},removeProperties(t,...e){t.removeProperty(...e)},getChildAt:(t,e)=>t.childNodes[e],setChild(t,e,s){t.childNodes[e]=s,s&&(s.parent=t)},copyChildren(t,e){const s=t.childNodes;for(let t=0;t<s.length;t++)this.setChild(e,t,s[t])},copyAttributes(t,e){e.attributes=t.attributes;for(const[s,i]of Object.entries(t.getAllProperties()))e.setProperty(s,i)},isType:(t,e)=>t.isKind(e),isEmbellished:t=>t.isEmbellished,getTexClass:t=>t.texClass,getCoreMO:t=>t.coreMO(),isNode:t=>t instanceof Ar||t instanceof Tr,isInferred:t=>t.isInferred,getForm(t){if(!t.isKind("mo"))return null;const e=t,s=e.getForms();for(const t of s){const s=this.getOp(e,t);if(s)return s}return null},getOp:(t,e="infix")=>Xr.OPTABLE[e][t.getText()]||null,getMoAttribute(t,e){var s,i;if(!t.attributes.isSet(e))for(const r of["infix","postfix","prefix"]){const n=null===(i=null===(s=this.getOp(t,r))||void 0===s?void 0:s[3])||void 0===i?void 0:i[e];if(void 0!==n)return n}return t.attributes.get(e)}},Ko=zo,Jo={Variant:{NORMAL:"normal",BOLD:"bold",ITALIC:"italic",BOLDITALIC:"bold-italic",DOUBLESTRUCK:"double-struck",FRAKTUR:"fraktur",BOLDFRAKTUR:"bold-fraktur",SCRIPT:"script",BOLDSCRIPT:"bold-script",SANSSERIF:"sans-serif",BOLDSANSSERIF:"bold-sans-serif",SANSSERIFITALIC:"sans-serif-italic",SANSSERIFBOLDITALIC:"sans-serif-bold-italic",MONOSPACE:"monospace",INITIAL:"inital",TAILED:"tailed",LOOPED:"looped",STRETCHED:"stretched",CALLIGRAPHIC:"-tex-calligraphic",BOLDCALLIGRAPHIC:"-tex-bold-calligraphic",OLDSTYLE:"-tex-oldstyle",BOLDOLDSTYLE:"-tex-bold-oldstyle",MATHITALIC:"-tex-mathit"},Form:{PREFIX:"prefix",INFIX:"infix",POSTFIX:"postfix"},LineBreak:{AUTO:"auto",NEWLINE:"newline",NOBREAK:"nobreak",GOODBREAK:"goodbreak",BADBREAK:"badbreak"},LineBreakStyle:{BEFORE:"before",AFTER:"after",DUPLICATE:"duplicate",INFIXLINBREAKSTYLE:"infixlinebreakstyle"},IndentAlign:{LEFT:"left",CENTER:"center",RIGHT:"right",AUTO:"auto",ID:"id",INDENTALIGN:"indentalign"},IndentShift:{INDENTSHIFT:"indentshift"},LineThickness:{THIN:"thin",MEDIUM:"medium",THICK:"thick"},Notation:{LONGDIV:"longdiv",ACTUARIAL:"actuarial",PHASORANGLE:"phasorangle",RADICAL:"radical",BOX:"box",ROUNDEDBOX:"roundedbox",CIRCLE:"circle",LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom",UPDIAGONALSTRIKE:"updiagonalstrike",DOWNDIAGONALSTRIKE:"downdiagonalstrike",VERTICALSTRIKE:"verticalstrike",HORIZONTALSTRIKE:"horizontalstrike",NORTHEASTARROW:"northeastarrow",MADRUWB:"madruwb",UPDIAGONALARROW:"updiagonalarrow"},Align:{TOP:"top",BOTTOM:"bottom",CENTER:"center",BASELINE:"baseline",AXIS:"axis",LEFT:"left",RIGHT:"right"},Lines:{NONE:"none",SOLID:"solid",DASHED:"dashed"},Side:{LEFT:"left",RIGHT:"right",LEFTOVERLAP:"leftoverlap",RIGHTOVERLAP:"rightoverlap"},Width:{AUTO:"auto",FIT:"fit"},Actiontype:{TOGGLE:"toggle",STATUSLINE:"statusline",TOOLTIP:"tooltip",INPUT:"input"},Overflow:{LINBREAK:"linebreak",SCROLL:"scroll",ELIDE:"elide",TRUNCATE:"truncate",SCALE:"scale"},Unit:{EM:"em",EX:"ex",PX:"px",IN:"in",CM:"cm",MM:"mm",PT:"pt",PC:"pc"},Attr:{LATEX:"data-latex",LATEXITEM:"data-latex-item"}};function $o(t,e,s){const i=e.attributes,r=s.attributes;t.forEach((t=>{const e=r.getExplicit(t);null!=e&&i.set(t,e)}))}function Yo(t,e){const s=(t,e)=>t.getExplicitNames().filter((s=>s!==e&&("stretchy"!==s||t.getExplicit("stretchy"))&&"data-latex"!==s&&"data-latex-item"!==s)),i=t.attributes,r=e.attributes,n=s(i,"lspace"),o=s(r,"rspace");if(n.length!==o.length)return!1;for(const t of n)if(i.getExplicit(t)!==r.getExplicit(t))return!1;return!0}function Qo(t,e,s){const i=[];for(const r of t.getList("m"+e+s)){const n=r.childNodes;if(n[r[e]]&&n[r[s]])continue;const o=r.parent,a=n[r[e]]?t.nodeFactory.create("node","m"+e,[n[r.base],n[r[e]]]):t.nodeFactory.create("node","m"+s,[n[r.base],n[r[s]]]);Ko.copyAttributes(r,a),o.replaceChild(a,r),i.push(r)}t.removeFromList("m"+e+s,i)}function Zo(t,e,s){const i=[];for(const r of t.getList(e)){if(r.attributes.get("displaystyle"))continue;const e=r.childNodes[r.base],n=e.coreMO();if(e.getProperty("movablelimits")&&!n.attributes.hasExplicit("movablelimits")){const e=t.nodeFactory.create("node",s,r.childNodes);Ko.copyAttributes(r,e),r.parent.replaceChild(e,r),i.push(r)}}t.removeFromList(e,i)}const ta={cleanStretchy(t){var e;const s=t.data;for(const t of s.getList("fixStretchy"))if(Ko.getProperty(t,"fixStretchy")){const s=Ko.getForm(t);(null===(e=null==s?void 0:s[3])||void 0===e?void 0:e.stretchy)&&Ko.setAttribute(t,"stretchy",!1),Ko.removeProperties(t,"fixStretchy")}},cleanAttributes(t){t.data.root.walkTree((t=>{const e=new Set((t.getProperty("keep-attrs")||"").split(/ /)),s=t.attributes;s.unset(Jo.Attr.LATEXITEM);for(const i of s.getExplicitNames())e.has(i)||s.get(i)!==t.attributes.getInherited(i)||s.unset(i)}))},combineRelations(t){const e=[];for(const s of t.data.getList("mo")){if(s.getProperty("relationsCombined")||!s.parent||s.parent&&!Ko.isType(s.parent,"mrow")||Ko.getTexClass(s)!==fr.REL)continue;let t;const i=s.parent.childNodes,r=i.indexOf(s)+1,n=Ko.getProperty(s,"variantForm");for(;r<i.length&&(t=i[r])&&Ko.isType(t,"mo")&&Ko.getTexClass(t)===fr.REL;){if(n!==Ko.getProperty(t,"variantForm")||!Yo(s,t)){s.attributes.hasExplicit("rspace")||Ko.setAttribute(s,"rspace","0pt"),t.attributes.hasExplicit("lspace")||Ko.setAttribute(t,"lspace","0pt");break}Ko.appendChildren(s,Ko.getChildren(t)),$o(["stretchy","rspace"],s,t);for(const e of t.getPropertyNames())s.setProperty(e,t.getProperty(e));t.attributes.get("data-latex")&&s.attributes.set("data-latex",s.attributes.get("data-latex")+t.attributes.get("data-latex")),i.splice(r,1),e.push(t),t.parent=null,t.setProperty("relationsCombined",!0),s.setProperty("texClass",fr.REL)}s.attributes.setInherited("form",s.getForms()[0])}t.data.removeFromList("mo",e)},cleanSubSup(t){const e=t.data;e.error||(Qo(e,"sub","sup"),Qo(e,"under","over"))},moveLimits(t){const e=t.data;Zo(e,"munderover","msubsup"),Zo(e,"munder","msub"),Zo(e,"mover","msup")},setInherited(t){t.data.root.setInheritedAttributes({},t.math.display,0,!1)},checkScriptlevel(t){const e=t.data,s=[];for(const t of e.getList("mstyle")){if(1!==t.childNodes[0].childNodes.length)continue;const e=t.attributes;for(const t of["displaystyle","scriptlevel"])e.getExplicit(t)===e.getInherited(t)&&e.unset(t);const i=e.getExplicitNames();if(0===i.filter((t=>"data-latex"!==t.substring(0,10))).length){const r=t.childNodes[0].childNodes[0];i.forEach((t=>r.attributes.set(t,e.get(t)))),t.parent.replaceChild(r,t),s.push(t)}}e.removeFromList("mstyle",s)}},ea=ta;var sa,ia;!function(t){t.HANDLER="handler",t.FALLBACK="fallback",t.ITEMS="items",t.TAGS="tags",t.OPTIONS="options",t.NODES="nodes",t.PREPROCESSORS="preprocessors",t.POSTPROCESSORS="postprocessors",t.INIT="init",t.CONFIG="config",t.PRIORITY="priority",t.PARSER="parser"}(sa||(sa={})),function(t){t.DELIMITER="delimiter",t.MACRO="macro",t.CHARACTER="character",t.ENVIRONMENT="environment"}(ia||(ia={}));const ra=7.2;const na={UNIT_CASES:new class{constructor(t){this.num="([-+]?([.,]\\d+|\\d+([.,]\\d*)?))",this.unit="",this.dimenEnd=/./,this.dimenRest=/./,this.map=new Map(t),this.updateDimen()}updateDimen(){this.unit=`(${Array.from(this.map.keys()).join("|")})`,this.dimenEnd=RegExp("^\\s*"+this.num+"\\s*"+this.unit+"\\s*$"),this.dimenRest=RegExp("^\\s*"+this.num+"\\s*"+this.unit+" ?")}set(t,e){return this.map.set(t,e),this.updateDimen(),this}get(t){return this.map.get(t)||this.map.get("pt")}delete(t){return!!this.map.delete(t)&&(this.updateDimen(),!0)}}([["em",1],["ex",.43],["pt",.1],["pc",1.2],["px",.1],["in",ra],["cm",ra/2.54],["mm",ra/25.4],["mu",1/18]]),matchDimen(t,e=!1){const s=t.match(e?na.UNIT_CASES.dimenRest:na.UNIT_CASES.dimenEnd);return s?function([t,e,s]){return"mu"!==e?[t,e,s]:[na.em(na.UNIT_CASES.get(e)*parseFloat(t)).slice(0,-2),"em",s]}([s[1].replace(/,/,"."),s[4],s[0].length]):[null,null,0]},dimen2em(t){const[e,s]=na.matchDimen(t),i=parseFloat(e||"1");return na.UNIT_CASES.get(s)*i},em:t=>Math.abs(t)<6e-4?"0em":t.toFixed(3).replace(/\.?0+$/,"")+"em",trimSpaces(t){if("string"!=typeof t)return t;let e=t.trim();return e.match(/\\$/)&&t.match(/ $/)&&(e+=" "),e}};class oa{constructor(t,e,s){this._factory=t,this._env=e,this.global={},this.stack=[],this.global={isInner:s},this.stack=[this._factory.create("start",this.global)],e&&(this.stack[0].env=e),this.env=this.stack[0].env}set env(t){this._env=t}get env(){return this._env}Push(...t){for(const e of t){if(!e)continue;const t=Ko.isNode(e)?this._factory.create("mml",e):e;t.global=this.global;const[s,i]=this.stack.length?this.Top().checkItem(t):[null,!0];i&&(s?(this.Pop(),this.Push(...s)):(t.isKind("null")||this.stack.push(t),t.env?(t.copyEnv&&Object.assign(t.env,this.env),this.env=t.env):t.env=this.env))}}Pop(){const t=this.stack.pop();return t.isOpen||delete t.env,this.env=this.stack.length?this.Top().env:{},t}Top(t=1){return this.stack.length<t?null:this.stack[this.stack.length-t]}Prev(t){const e=this.Top();return t?e.First:e.Pop()}get height(){return this.stack.length}toString(){return"stack[\n "+this.stack.join("\n ")+"\n]"}}class aa{static processString(t,e){const s=t.split(aa.pattern);for(let t=1,i=s.length;t<i;t+=2){let i=s[t].charAt(0);if(i>="0"&&i<="9")s[t]=e[parseInt(s[t],10)-1],"number"==typeof s[t]&&(s[t]=s[t].toString());else if("{"===i)if(i=s[t].substring(1),i>="0"&&i<="9")s[t]=e[parseInt(s[t].substring(1,s[t].length-1),10)-1],"number"==typeof s[t]&&(s[t]=s[t].toString());else{s[t].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/)&&(s[t]="%"+s[t])}}return s.join("")}constructor(t,e,...s){this.id=t,this.message=aa.processString(e,s)}}aa.pattern=/%(\d+|\{\d+\}|\{[a-z]+:%\d+(?:\|(?:%\{\d+\}|%.|[^}])*)+\}|.)/g;const la=aa;class ca{constructor(t){this._nodes=t,this.startStr="",this.startI=0,this.stopI=0}get nodes(){return this._nodes}Push(...t){this._nodes.push(...t)}Pop(){return this._nodes.pop()}get First(){return this._nodes[this.Size()-1]}set First(t){this._nodes[this.Size()-1]=t}get Last(){return this._nodes[0]}set Last(t){this._nodes[0]=t}Peek(t){return null==t&&(t=1),this._nodes.slice(this.Size()-t)}Size(){return this._nodes.length}Clear(){this._nodes=[]}toMml(t=!0,e){return 1!==this._nodes.length||e?this.create("node",t?"inferredMrow":"mrow",this._nodes,{}):this.First}create(t,...e){return this.factory.configuration.nodeFactory.create(t,...e)}}class ha extends ca{constructor(t,...e){super(e),this.factory=t,this.global={},this._properties={},this.isOpen&&(this._env={})}get kind(){return"base"}get env(){return this._env}set env(t){this._env=t}get copyEnv(){return!0}getProperty(t){return this._properties[t]}setProperty(t,e){return this._properties[t]=e,this}get isOpen(){return!1}get isClose(){return!1}get isFinal(){return!1}isKind(t){return t===this.kind}checkItem(t){if(t.isKind("over")&&this.isOpen&&(t.setProperty("num",this.toMml(!1)),this.Clear()),t.isKind("cell")&&this.isOpen){if(t.getProperty("linebreak"))return ha.fail;throw new la("Misplaced","Misplaced %1",t.getName())}if(t.isClose&&this.getErrors(t.kind)){const[e,s]=this.getErrors(t.kind);throw new la(e,s,t.getName())}return t.isFinal?(this.Push(t.First),ha.fail):ha.success}clearEnv(){for(const t of Object.keys(this.env))delete this.env[t]}setProperties(t){return Object.assign(this._properties,t),this}getName(){return this.getProperty("name")}toString(){return this.kind+"["+this.nodes.join("; ")+"]"}getErrors(t){return this.constructor.errors[t]||ha.errors[t]}addLatexItem(t,e=""){const s=this.startStr.slice(this.startI,this.stopI);if(s){const i=e?e+s:s;t.attributes.set(Jo.Attr.LATEXITEM,i),"}"!==i&&t.attributes.set(Jo.Attr.LATEX,i)}}}ha.fail=[null,!1],ha.success=[null,!0],ha.errors={end:["MissingBeginExtraEnd","Missing \\begin{%1} or extra \\end{%1}"],close:["ExtraCloseMissingOpen","Extra close brace or missing open brace"],right:["MissingLeftExtraRight","Missing \\left or extra \\right"],middle:["ExtraMiddle","Extra \\middle"]};class da{constructor(t,e,s){this._string=t,this.configuration=s,this.macroCount=0,this.i=0,this.currentCS="",this.saveI=0;const i=Object.hasOwn(e,"isInner"),r=e.isInner;let n;if(delete e.isInner,e){n={};for(const t of Object.keys(e))n[t]=e[t]}this.configuration.pushParser(this),this.stack=new oa(this.itemFactory,n,!i||r),this.Parse(),this.Push(this.itemFactory.create("stop")),this.stack.env=n}get options(){return this.configuration.options}get itemFactory(){return this.configuration.itemFactory}get tags(){return this.configuration.tags}set string(t){this._string=t}get string(){return this._string}parse(t,e){const s=this.saveI;this.saveI=this.i-("character"===t&&"&"!==e[1]?1:0);const i=this.configuration.handlers.get(t).parse(e);return"macro"!==t&&this.updateResult(e[1],s),this.saveI=s,i}lookup(t,e){return this.configuration.handlers.get(t).lookup(e)}contains(t,e){return this.configuration.handlers.get(t).contains(e)}toString(){let t="";for(const e of Array.from(this.configuration.handlers.keys()))t+=e+": "+this.configuration.handlers.get(e)+"\n";return t}Parse(){let t;for(;this.i<this.string.length;)t=this.getCodePoint(),this.i+=t.length,this.parse(ia.CHARACTER,[this,t])}Push(t){t instanceof ha&&(t.startI=this.saveI,t.stopI=this.i,t.startStr=this.string),t instanceof Ar&&t.isInferred?this.PushAll(t.childNodes):this.stack.Push(t)}PushAll(t){for(const e of t)this.stack.Push(e)}mml(){if(!this.stack.Top().isKind("mml"))return null;const t=this.stack.Top().First;this.configuration.popParser();const e=this.trimTex(this.string);return e&&t.attributes.set(Jo.Attr.LATEX,e),t}convertDelimiter(t){var e;const s=this.lookup(ia.DELIMITER,t);return null!==(e=null==s?void 0:s.char)&&void 0!==e?e:null}getCodePoint(){const t=this.string.codePointAt(this.i);return void 0===t?"":String.fromCodePoint(t)}nextIsSpace(){return!!this.string.charAt(this.i).match(/\s/)}GetNext(){for(;this.nextIsSpace();)this.i++;return this.getCodePoint()}GetCS(){const t=this.string.slice(this.i).match(/^(([a-z]+) ?|[\uD800-\uDBFF].|.)/i);return t?(this.i+=t[0].length,t[2]||t[1]):(this.i++," ")}GetArgument(t,e=!1){switch(this.GetNext()){case"":if(!e)throw new la("MissingArgFor","Missing argument for %1",this.currentCS);return null;case"}":if(!e)throw new la("ExtraCloseMissingOpen","Extra close brace or missing open brace");return null;case"\\":return this.i++,"\\"+this.GetCS();case"{":{const t=++this.i;let e=1;for(;this.i<this.string.length;)switch(this.string.charAt(this.i++)){case"\\":this.i++;break;case"{":e++;break;case"}":if(0===--e)return this.string.slice(t,this.i-1)}throw new la("MissingCloseBrace","Missing close brace")}}const s=this.getCodePoint();return this.i+=s.length,s}GetBrackets(t,e,s=!1){if("["!==this.GetNext())return e;const i=++this.i;let r=0,n=0;for(;this.i<this.string.length;)switch(this.string.charAt(this.i++)){case"{":r++;break;case"\\":this.i++;break;case"}":if(r--<=0)throw new la("ExtraCloseLooking","Extra close brace while looking for %1","']'");break;case"[":0===r&&n++;break;case"]":if(0===r){if(!s||0===n)return this.string.slice(i,this.i-1);n--}}throw new la("MissingCloseBracket","Could not find closing ']' for argument to %1",this.currentCS)}GetDelimiter(t,e=!1){let s=this.GetNext();if(this.i+=s.length,this.i<=this.string.length&&("\\"===s?s+=this.GetCS():"{"===s&&e&&(this.i--,s=this.GetArgument(t).trim()),this.contains(ia.DELIMITER,s)))return this.convertDelimiter(s);throw new la("MissingOrUnrecognizedDelim","Missing or unrecognized delimiter for %1",this.currentCS)}GetDimen(t){if("{"===this.GetNext()){const e=this.GetArgument(t),[s,i]=na.matchDimen(e);if(s)return s+i}else{const t=this.string.slice(this.i),[e,s,i]=na.matchDimen(t,!0);if(e)return this.i+=i,e+s}throw new la("MissingDimOrUnits","Missing dimension or its units for %1",this.currentCS)}GetUpTo(t,e){for(;this.nextIsSpace();)this.i++;const s=this.i;let i=0;for(;this.i<this.string.length;){const t=this.i;let r=this.GetNext();switch(this.i+=r.length,r){case"\\":r+=this.GetCS();break;case"{":i++;break;case"}":if(0===i)throw new la("ExtraCloseLooking","Extra close brace while looking for %1",e);i--}if(0===i&&r===e)return this.string.slice(s,t)}throw new la("TokenNotFoundForCommand","Could not find %1 for %2",e,this.currentCS)}ParseArg(t){return new da(this.GetArgument(t),this.stack.env,this.configuration).mml()}ParseUpTo(t,e){return new da(this.GetUpTo(t,e),this.stack.env,this.configuration).mml()}GetDelimiterArg(t){const e=na.trimSpaces(this.GetArgument(t));if(""===e)return null;if(this.contains(ia.DELIMITER,e))return e;throw new la("MissingOrUnrecognizedDelim","Missing or unrecognized delimiter for %1",this.currentCS)}GetStar(){const t="*"===this.GetNext();return t&&this.i++,t}create(t,...e){const s=this.configuration.nodeFactory.create(t,...e);return s.isToken&&s.attributes.hasExplicit("mathvariant")&&"-"===s.attributes.get("mathvariant").charAt(0)&&s.setProperty("ignore-variant",!0),s}trimTex(t){return t.trim()+(t.match(/(?:^|[^\\])(?:\\\\)*\\\s+$/)?" ":"")}updateResult(t,e){const s=this.stack.Prev(!0);if(!s)return;const i=Jo.Attr.LATEX,r=s.attributes.get(i),n=s.attributes.get(Jo.Attr.LATEXITEM);if(void 0!==n)return void(r||("}"===t||"}"===n?this.composeBraces(s):s.attributes.set(i,n)));e=e<this.saveI?this.saveI:e;const o=this.trimTex(e!==this.i?this.string.slice(e,this.i):t);if(o&&o!==r&&("\\"!==t||"\\"!==o)){if("_"===o||"^"===o)s.setProperty("sub-sup",o);else{switch(s.getProperty("sub-sup")){case"^":if(s.childNodes[2]&&("}"===o?this.composeBraces(s.childNodes[2]):s.childNodes[2].attributes.hasExplicit(i)||s.childNodes[2].attributes.set(i,o)),s.childNodes[1]){const t=s.childNodes[1].attributes.get(i);this.composeLatex(s,`_${t}^`,0,2)}else this.composeLatex(s,"^",0,2);return;case"_":if(s.childNodes[1]&&("}"===o?this.composeBraces(s.childNodes[1]):s.childNodes[1].attributes.hasExplicit(i)||s.childNodes[1].attributes.set(i,o)),s.childNodes[2]){const t=s.childNodes[2].attributes.get(i);this.composeLatex(s,`^${t}_`,0,1)}else this.composeLatex(s,"_",0,1);return}if("}"===o)return void this.composeBraces(s)}s.attributes.set(i,o)}}composeLatex(t,e,s,i){if(!t.childNodes[s]||!t.childNodes[i])return;const r=Jo.Attr.LATEX,n=(t.childNodes[s].attributes.get(r)||"")+e+t.childNodes[i].attributes.get(r);t.attributes.set(r,n)}composeBraces(t){const e=this.composeBracedContent(t);t.attributes.set(Jo.Attr.LATEX,`{${e}}`)}composeBracedContent(t){var e,s;const i=(null===(e=t.childNodes[0])||void 0===e?void 0:e.childNodes)||[];let r="";for(const t of i){const e=(null===(s=null==t?void 0:t.attributes)||void 0===s?void 0:s.get(Jo.Attr.LATEX))||"";e&&(r+=r&&r.match(/[a-zA-Z]$/)&&e.match(/^[a-zA-Z]/)?" "+e:e)}return r}}class ua extends ha{}class pa extends hr{constructor(){super(...arguments),this.defaultKind="dummy",this.configuration=null}}pa.DefaultStackItems={[ua.prototype.kind]:ua};const ma=pa;class ga{constructor(){this.mmlFactory=null,this.factory={node:ga.createNode,token:ga.createToken,text:ga.createText,error:ga.createError}}static createNode(t,e,s=[],i={},r){const n=t.mmlFactory.create(e);return n.setChildren(s),r&&n.appendChild(r),Ko.setProperties(n,i),n}static createToken(t,e,s={},i=""){const r=t.create("text",i);return t.create("node",e,[],s,r)}static createText(t,e){return null==e?null:t.mmlFactory.create("text").setText(e)}static createError(t,e){const s=t.create("text",e),i=t.create("node","mtext",[],{},s);return t.create("node","merror",[i],{"data-mjx-error":e})}setMmlFactory(t){this.mmlFactory=t}set(t,e){this.factory[t]=e}setCreators(t){for(const e in t)this.set(e,t[e])}create(t,...e){const s=(this.factory[t]||this.factory.node)(this,e[0],...e.slice(1));return"node"===t&&this.configuration.addNode(e[0],s),s}get(t){return this.factory[t]}}class fa{static oneof(...t){return new this("string",(e=>t.includes(e)),(t=>t))}constructor(t,e,s){this.name=t,this.verify=e,this.convert=s}}const ba={boolean:new fa("boolean",(t=>"true"===t||"false"===t),(t=>"true"===t)),number:new fa("number",(t=>!!t.match(/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[-+]?\d+)?$/)),(t=>parseFloat(t))),integer:new fa("integer",(t=>!!t.match(/^[-+]?\d+$/)),(t=>parseInt(t))),string:new fa("string",(t=>!0),(t=>t)),dimen:new fa("dimen",(t=>null!==na.matchDimen(t)[0]),(t=>t))};function Ea(t,e){if(0===e)return t.replace(/^\s+/,"").replace(/([^\\\s]|^)((?:\\\\)*(?:\\\s)?)?\s+$/,"$1$2");for(;e>0;)t=t.trim().slice(1,-1),e--;return t}function xa(t,e,s=!1,i=!1){const r=t.length;let n=0,o="",a=0,l=0,c=!0;for(;a<r;){const i=t[a++];switch(i){case"\\":o+=i+(t[a++]||""),c=!1;continue;case" ":break;case"{":c&&l++,n++;break;case"}":if(!n)throw new la("ExtraCloseMissingOpen","Extra close brace or missing open brace");n--,c=!1;break;default:if(!n&&e.includes(i))return[Ea(o,s?Math.min(1,l):l),i,t.slice(a)];l>n&&(l=n),c=!1}o+=i}if(n)throw new la("ExtraOpenMissingClose","Extra open brace or missing close brace");return i&&l?["","",Ea(o,1)]:[Ea(o,s?Math.min(1,l):l),"",t.slice(a)]}const ya={cols:(...t)=>t.map((t=>na.em(t))).join(" "),fenced(t,e,s,i,r="",n=""){const o=t.nodeFactory,a=o.create("node","mrow",[],{open:e,close:i,texClass:fr.INNER});let l;if(r)l=new da("\\"+r+"l"+e,t.parser.stack.env,t).mml();else{const t=o.create("text",e);l=o.create("node","mo",[],{fence:!0,stretchy:!0,symmetric:!0,texClass:fr.OPEN},t)}if(Ko.appendChildren(a,[l,s]),r)l=new da("\\"+r+"r"+i,t.parser.stack.env,t).mml();else{const t=o.create("text",i);l=o.create("node","mo",[],{fence:!0,stretchy:!0,symmetric:!0,texClass:fr.CLOSE},t)}return n&&l.attributes.set("mathcolor",n),Ko.appendChildren(a,[l]),a},fixedFence(t,e,s,i){const r=t.nodeFactory.create("node","mrow",[],{open:e,close:i,texClass:fr.ORD});return e&&Ko.appendChildren(r,[ya.mathPalette(t,e,"l")]),Ko.isType(s,"mrow")?Ko.appendChildren(r,Ko.getChildren(s)):Ko.appendChildren(r,[s]),i&&Ko.appendChildren(r,[ya.mathPalette(t,i,"r")]),r},mathPalette(t,e,s){"{"!==e&&"}"!==e||(e="\\"+e);const i="{\\big"+s+" "+e+"}";return new da("\\mathchoice"+("{\\bigg"+s+" "+e+"}")+i+i+i,{},t).mml()},fixInitialMO(t,e){for(let s=0,i=e.length;s<i;s++){const i=e[s];if(i&&!Ko.isType(i,"mspace")&&(!Ko.isType(i,"TeXAtom")||Ko.getChildren(i)[0]&&Ko.getChildren(Ko.getChildren(i)[0]).length)){if(Ko.isEmbellished(i)||Ko.isType(i,"TeXAtom")&&Ko.getTexClass(i)===fr.REL){const s=t.nodeFactory.create("node","mi");e.unshift(s)}break}}},internalMath(t,e,s,i){if(e=e.replace(/ +/g," "),t.configuration.options.internalMath)return t.configuration.options.internalMath(t,e,s,i);const r=i||t.stack.env.font,n=r?{mathvariant:r}:{};let o,a,l=[],c=0,h=0,d="",u=0;if(e.match(/\\?[${}\\]|\\\(|\\(?:eq)?ref\s*\{|\\U/)){for(;c<e.length;)if(o=e.charAt(c++),"$"===o)"$"===d&&0===u?(a=t.create("node","TeXAtom",[new da(e.slice(h,c-1),{},t.configuration).mml()]),l.push(a),d="",h=c):""===d&&(h<c-1&&l.push(ya.internalText(t,e.slice(h,c-1),n)),d="$",h=c);else if("{"===o&&""!==d)u++;else if("}"===o)if("}"===d&&0===u){const s=new da(e.slice(h,c),{},t.configuration).mml();a=t.create("node","TeXAtom",[s],n),l.push(a),d="",h=c}else""!==d&&u&&u--;else if("\\"===o)if(""===d&&e.substring(c).match(/^(eq)?ref\s*\{/)){const s=RegExp["$&"].length;h<c-1&&l.push(ya.internalText(t,e.slice(h,c-1),n)),d="}",h=c-1,c+=s}else if(o=e.charAt(c++),"("===o&&""===d)h<c-2&&l.push(ya.internalText(t,e.slice(h,c-2),n)),d=")",h=c;else if(")"===o&&")"===d&&0===u)a=t.create("node","TeXAtom",[new da(e.slice(h,c-2),{},t.configuration).mml()]),l.push(a),d="",h=c;else if(o.match(/[${}\\]/)&&""===d)c--,e=e.substring(0,c-1)+e.substring(c);else if("U"===o){const t=e.substring(c).match(/^\s*(?:([0-9A-F])|\{\s*([0-9A-F]+)\s*\})/);if(!t)throw new la("BadRawUnicode","Argument to %1 must a hexadecimal number with 1 to 6 digits","\\U");const s=String.fromCodePoint(parseInt(t[1]||t[2],16));e=e.substring(0,c-2)+s+e.substring(c+t[0].length),c=c-2+s.length}if(""!==d)throw new la("MathNotTerminated","Math mode is not properly terminated")}return h<e.length&&l.push(ya.internalText(t,e.slice(h),n)),null!=s?l=[t.create("node","mstyle",l,{displaystyle:!1,scriptlevel:s})]:l.length>1&&(l=[t.create("node","mrow",l)]),l},internalText(t,e,s){e=e.replace(/\n+/g," ").replace(/^ +/,wo.nbsp).replace(/ +$/,wo.nbsp);const i=t.create("text",e);return t.create("node","mtext",[],s,i)},underOver(t,e,s,i,r){if(ya.checkMovableLimits(e),Ko.isType(e,"munderover")&&Ko.isEmbellished(e)){Ko.setProperties(Ko.getCoreMO(e),{lspace:0,rspace:0});const s=t.create("node","mo",[],{rspace:0});e=t.create("node","mrow",[s,e])}const n=t.create("node","munderover",[e]);Ko.setChild(n,"over"===i?n.over:n.under,s);let o=n;return r&&(o=t.create("node","TeXAtom",[t.create("node","mstyle",[n],{displaystyle:!0,scriptlevel:0})],{texClass:fr.OP,movesupsub:!0})),Ko.setProperty(o,"subsupOK",!0),o},checkMovableLimits(t){const e=Ko.isType(t,"mo")?Ko.getForm(t):null;(Ko.getProperty(t,"movablelimits")||e&&e[3]&&e[3].movablelimits)&&Ko.setProperties(t,{movablelimits:!1})},setArrayAlign:(t,e,s)=>(s||(e=na.trimSpaces(e||"")),"t"===e?t.arraydef.align="baseline 1":"b"===e?t.arraydef.align="baseline -1":"c"===e?t.arraydef.align="axis":e&&(s?(s.string=`[${e}]`+s.string.slice(s.i),s.i=0):t.arraydef.align=e),t),substituteArgs(t,e,s){let i="",r="",n=0;for(;n<s.length;){let o=s.charAt(n++);if("\\"===o)i+=o+s.charAt(n++);else if("#"===o)if(o=s.charAt(n++),"#"===o)i+=o;else{if(!o.match(/[1-9]/)||parseInt(o,10)>e.length)throw new la("IllegalMacroParam","Illegal macro parameter reference");r=ya.addArgs(t,ya.addArgs(t,r,i),e[parseInt(o,10)-1]),i=""}else i+=o}return ya.addArgs(t,r,i)},addArgs(t,e,s){if(s.match(/^[a-z]/i)&&e.match(/(^|[^\\])(\\\\)*\\[a-z]+$/i)&&(e+=" "),e.length+s.length>t.configuration.options.maxBuffer)throw new la("MaxBufferSize","MathJax internal buffer size exceeded; is there a recursive macro call?");return e+s},checkMaxMacros(t,e=!0){if(!(++t.macroCount<=t.configuration.options.maxMacros))throw e?new la("MaxMacroSub1","MathJax maximum macro substitution count exceeded; is here a recursive macro call?"):new la("MaxMacroSub2","MathJax maximum substitution count exceeded; is there a recursive latex environment?")},checkEqnEnv(t,e=!0){const s=t.stack.Top(),i=s.First;if(!(s.getProperty("nestable")&&e&&!i||s.getProperty("nestStart"))&&(!s.isKind("start")||i))throw new la("ErroneousNestingEq","Erroneous nesting of equation structures")},copyNode(t,e){const s=t.copy(),i=e.configuration;return s.walkTree((t=>{i.addNode(t.kind,t);const e=(t.getProperty("in-lists")||"").split(/,/);for(const s of e)s&&i.addNode(s,t)})),s},mmlFilterAttribute:(t,e,s)=>s,getFontDef(t){const e=t.stack.env.font;return e?{mathvariant:e}:{}},keyvalOptions(t,e=null,s=!1,i=!1){const r=function(t,e=!1){const s={};let i,r,n,o=t,a=!0;for(;o;)[r,i,o]=xa(o,["=",","],e,a),a=!1,"="===i?([n,i,o]=xa(o,[","],e),n="false"===n||"true"===n?JSON.parse(n):n,s[r]=n):r&&(s[r]=!0);return s}(t,i);if(e)for(const t of Object.keys(r))if(Object.hasOwn(e,t)){if(e[t]instanceof fa){const s=e[t],i=String(r[t]);if(!s.verify(i))throw new la("InvalidValue","Value for key '%1' is not of the expected type",t);r[t]=s.convert(i)}}else{if(s)throw new la("InvalidOption","Invalid option: %1",t);delete r[t]}return r},isLatinOrGreekChar:t=>!!t.normalize("NFD").match(/[a-zA-Z\u0370-\u03F0]/)};class Na{constructor(){this.columnHandler={l:t=>t.calign[t.j++]="left",c:t=>t.calign[t.j++]="center",r:t=>t.calign[t.j++]="right",p:t=>this.getColumn(t,"top"),m:t=>this.getColumn(t,"middle"),b:t=>this.getColumn(t,"bottom"),w:t=>this.getColumn(t,"top",""),W:t=>this.getColumn(t,"top",""),"|":t=>this.addRule(t,"solid"),":":t=>this.addRule(t,"dashed"),">":t=>t.cstart[t.j]=(t.cstart[t.j]||"")+this.getBraces(t),"<":t=>t.cend[t.j-1]=(t.cend[t.j-1]||"")+this.getBraces(t),"@":t=>this.addAt(t,this.getBraces(t)),"!":t=>this.addBang(t,this.getBraces(t)),"*":t=>this.repeat(t),P:t=>this.macroColumn(t,">{$}p{#1}<{$}",1),M:t=>this.macroColumn(t,">{$}m{#1}<{$}",1),B:t=>this.macroColumn(t,">{$}b{#1}<{$}",1)," ":t=>{}},this.MAXCOLUMNS=1e4}process(t,e,s){const i={parser:t,template:e,i:0,j:0,c:"",cwidth:[],calign:[],cspace:[],clines:[],cstart:s.cstart,cend:s.cend,ralign:s.ralign,cextra:s.cextra};let r=0;for(;i.i<i.template.length;){if(r++>this.MAXCOLUMNS)throw new la("MaxColumns","Too many column specifiers (perhaps looping column definitions?)");const t=i.template.codePointAt(i.i),e=i.c=String.fromCodePoint(t);if(i.i+=e.length,!Object.hasOwn(this.columnHandler,e))throw new la("BadPreamToken","Illegal pream-token (%1)",e);this.columnHandler[e](i)}this.setColumnAlign(i,s),this.setColumnWidths(i,s),this.setColumnSpacing(i,s),this.setColumnLines(i,s),this.setPadding(i,s)}setColumnAlign(t,e){e.arraydef.columnalign=t.calign.join(" ")}setColumnWidths(t,e){if(!t.cwidth.length)return;const s=[...t.cwidth];s.length<t.calign.length&&s.push("auto"),e.arraydef.columnwidth=s.map((t=>t||"auto")).join(" ")}setColumnSpacing(t,e){if(!t.cspace.length)return;const s=[...t.cspace];s.length<t.calign.length&&s.push("1em"),e.arraydef.columnspacing=s.slice(1).map((t=>t||"1em")).join(" ")}setColumnLines(t,e){if(!t.clines.length)return;const s=[...t.clines];s[0]&&e.frame.push(["left",s[0]]),s.length>t.calign.length?e.frame.push(["right",s.pop()]):s.length<t.calign.length&&s.push("none"),s.length>1&&(e.arraydef.columnlines=s.slice(1).map((t=>t||"none")).join(" "))}setPadding(t,e){if(!t.cextra[0]&&!t.cextra[t.calign.length-1])return;const s=t.calign.length-1,i=t.cspace,r=t.cextra[s]?i[s]:null;e.arraydef["data-array-padding"]=`${i[0]||".5em"} ${r||".5em"}`}getColumn(t,e,s="left"){t.calign[t.j]=s||this.getAlign(t),t.cwidth[t.j]=this.getDimen(t),t.ralign[t.j]=[e,t.cwidth[t.j],t.calign[t.j]],t.j++}getDimen(t){const e=this.getBraces(t);if(!na.matchDimen(e)[0])throw new la("MissingColumnDimOrUnits","Missing dimension or its units for %1 column declaration",t.c);return e}getAlign(t){return Hi(this.getBraces(t).toLowerCase(),{l:"left",c:"center",r:"right"},"")}getBraces(t){for(;" "===t.template[t.i];)t.i++;if(t.i>=t.template.length)throw new la("MissingArgForColumn","Missing argument for %1 column declaration",t.c);if("{"!==t.template[t.i])return t.template[t.i++];const e=++t.i;let s=1;for(;t.i<t.template.length;)switch(t.template.charAt(t.i++)){case"\\":t.i++;break;case"{":s++;break;case"}":if(0===--s)return t.template.slice(e,t.i-1)}throw new la("MissingCloseBrace","Missing close brace")}macroColumn(t,e,s){const i=[];for(;s>0&&s--;)i.push(this.getBraces(t));t.template=ya.substituteArgs(t.parser,i,e)+t.template.slice(t.i),t.i=0}addRule(t,e){t.clines[t.j]&&this.addAt(t,"\\,"),t.clines[t.j]=e,"0"===t.cspace[t.j]&&(t.cstart[t.j]="\\hspace{.5em}")}addAt(t,e){const{cstart:s,cspace:i,j:r}=t;t.cextra[r]=!0,t.calign[r]="center",t.clines[r]&&(".5em"===i[r]?s[r-1]+="\\hspace{.25em}":i[r]||(t.cend[r-1]=(t.cend[r-1]||"")+"\\hspace{.5em}")),s[r]=e,i[r]="0",i[++t.j]="0"}addBang(t,e){const{cstart:s,cspace:i,j:r}=t;t.cextra[r]=!0,t.calign[r]="center",s[r]=("0"===i[r]&&t.clines[r]?"\\hspace{.25em}":"")+e,i[r]||(i[r]=".5em"),i[++t.j]=".5em"}repeat(t){const e=this.getBraces(t),s=this.getBraces(t),i=parseInt(e);if(String(i)!==e)throw new la("ColArgNotNum","First argument to %1 column specifier must be a number","*");t.template=new Array(i).fill(s).join("")+t.template.substring(t.i),t.i=0}}const Aa=Jo.Variant;class va{constructor(t,e=[]){this.options={},this.columnParser=new Na,this.packageData=new Map,this.parsers=[],this.root=null,this.nodeLists={},this.error=!1,this.handlers=t.handlers,this.nodeFactory=new ga,this.nodeFactory.configuration=this,this.nodeFactory.setCreators(t.nodes),this.itemFactory=new ma(t.items),this.itemFactory.configuration=this,Bi(this.options,...e),Bi(this.options,t.options),this.mathStyle=va.getVariant.get(this.options.mathStyle)||va.getVariant.get("TeX")}pushParser(t){this.parsers.unshift(t)}popParser(){this.parsers.shift()}get parser(){return this.parsers[0]}clear(){this.parsers=[],this.root=null,this.nodeLists={},this.error=!1,this.tags.resetTag()}addNode(t,e){let s=this.nodeLists[t];if(s||(s=this.nodeLists[t]=[]),s.push(e),e.kind!==t){const s=Ko.getProperty(e,"in-lists")||"",i=(s?s.split(/,/):[]).concat(t).join(",");Ko.setProperty(e,"in-lists",i)}}getList(t){const e=this.nodeLists[t]||[],s=[];for(const t of e)this.inTree(t)&&s.push(t);return this.nodeLists[t]=s,s}removeFromList(t,e){const s=this.nodeLists[t]||[];for(const t of e){const e=s.indexOf(t);e>=0&&s.splice(e,1)}}inTree(t){for(;t&&t!==this.root;)t=t.parent;return!!t}}va.getVariant=new Map([["TeX",(t,e)=>e&&t.match(/^[\u0391-\u03A9\u03F4]/)?Aa.NORMAL:""],["ISO",t=>Aa.ITALIC],["French",t=>t.normalize("NFD").match(/^[a-z]/)?Aa.ITALIC:Aa.NORMAL],["upright",t=>Aa.NORMAL]]);const _a=va;class wa{constructor(t="???",e=""){this.tag=t,this.id=e}}class Ta{constructor(t="",e=!1,s=!1,i=null,r="",n="",o=!1,a=""){this.env=t,this.taggable=e,this.defaultTags=s,this.tag=i,this.tagId=r,this.tagFormat=n,this.noTag=o,this.labelId=a}}class Ca{constructor(){this.counter=0,this.allCounter=0,this.configuration=null,this.ids={},this.allIds={},this.labels={},this.allLabels={},this.redo=!1,this.refUpdate=!1,this.currentTag=new Ta,this.history=[],this.stack=[],this.enTag=function(t,e){const s=this.configuration.nodeFactory,i=s.create("node","mtd",[t]),r=s.create("node","mlabeledtr",[e,i]);return s.create("node","mtable",[r],{side:this.configuration.options.tagSide,minlabelspacing:this.configuration.options.tagIndent,displaystyle:!0})}}start(t,e,s){this.currentTag&&this.stack.push(this.currentTag);const i=this.label;this.currentTag=new Ta(t,e,s),this.label=i}get env(){return this.currentTag.env}end(){this.history.push(this.currentTag);const t=this.label;this.currentTag=this.stack.pop(),t&&!this.label&&(this.label=t)}tag(t,e){this.currentTag.tag=t,this.currentTag.tagFormat=e?t:this.formatTag(t),this.currentTag.noTag=!1}notag(){this.tag("",!0),this.currentTag.noTag=!0}get noTag(){return this.currentTag.noTag}set label(t){this.currentTag.labelId=t}get label(){return this.currentTag.labelId}formatUrl(t,e){return e+"#"+encodeURIComponent(t)}formatTag(t){return["(",t,")"]}formatRef(t){return this.formatTag(t)}formatId(t){return"mjx-eqn:"+t.replace(/\s/g,"_")}formatNumber(t){return t.toString()}autoTag(){null==this.currentTag.tag&&(this.counter++,this.tag(this.formatNumber(this.counter),!1))}clearTag(){this.tag(null,!0),this.currentTag.tagId=""}getTag(t=!1){if(t)return this.autoTag(),this.makeTag();const e=this.currentTag;return e.taggable&&!e.noTag&&(e.defaultTags&&this.autoTag(),e.tag)?this.makeTag():null}resetTag(){this.history=[],this.redo=!1,this.refUpdate=!1,this.clearTag()}reset(t=0){this.resetTag(),this.counter=this.allCounter=t,this.allLabels={},this.allIds={},this.label=""}startEquation(t){this.history=[],this.stack=[],this.clearTag(),this.currentTag=new Ta("",void 0,void 0),this.labels={},this.ids={},this.counter=this.allCounter,this.redo=!1;const e=t.inputData.recompile;e&&(this.refUpdate=!0,this.counter=e.counter)}finishEquation(t){this.redo&&(t.inputData.recompile={state:t.state(),counter:this.allCounter}),this.refUpdate||(this.allCounter=this.counter),Object.assign(this.allIds,this.ids),Object.assign(this.allLabels,this.labels)}finalize(t,e){if(!e.display||this.currentTag.env||null==this.currentTag.tag)return t;const s=this.makeTag();return this.enTag(t,s)}makeId(){this.currentTag.tagId=this.formatId(this.configuration.options.useLabelIds&&this.label||this.currentTag.tag)}makeTag(){var t;this.makeId(),this.label&&(this.labels[this.label]=new wa(this.currentTag.tag,this.currentTag.tagId),this.label="");const e=this.currentTag.tagFormat,s=Array.isArray(e)?e:(null===(t=e.match(/^(\(|\[|\{)(.*)(\}|\]|\))$/))||void 0===t?void 0:t.slice(1))||[e],i=new da(s.map((t=>t?`\\text{${t}}`:"")).join(""),{},this.configuration).mml();return this.configuration.nodeFactory.create("node","mtd",[i],{id:this.currentTag.tagId,rowalign:this.configuration.options.tagAlign})}}class La extends Ca{autoTag(){}getTag(){return this.currentTag.tag?super.getTag():null}}class Ia extends Ca{finalize(t,e){if(!e.display||this.history.find((function(t){return t.taggable})))return t;const s=this.getTag(!0);return this.enTag(t,s)}}const Ra=new Map([["none",La],["all",Ia]]);let Sa="none";const ka={OPTIONS:{tags:Sa,tagSide:"right",tagIndent:"0.8em",useLabelIds:!0,ignoreDuplicateLabels:!1,tagAlign:"baseline"},add(t,e){Ra.set(t,e)},addTags(t){for(const e of Object.keys(t))ka.add(e,t[e])},create(t){const e=Ra.get(t)||Ra.get(Sa);if(!e)throw Error("Unknown tags class");return new e},setDefault(t){Sa=t},getDefault:()=>ka.create(Sa)};class Oa{constructor(t,e,s){this._token=t,this._char=e,this._attributes=s}get token(){return this._token}get char(){return this._char}get attributes(){return this._attributes}}class Ma{constructor(t,e,s=[]){this._token=t,this._func=e,this._args=s}get token(){return this._token}get func(){return this._func}get args(){return this._args}}function Da(t){return void 0===t||t}class Pa{constructor(t,e){this._name=t,this._parser=e,Ga.register(this)}get name(){return this._name}parserFor(t){return this.contains(t)?this.parser:null}parse([t,e]){const s=this.parserFor(e),i=this.lookup(e);return s&&i?Da(s(t,i)):null}set parser(t){this._parser=t}get parser(){return this._parser}}class Ba extends Pa{constructor(t,e,s){super(t,e),this._regExp=s}contains(t){return this._regExp.test(t)}lookup(t){return this.contains(t)?t:null}}class Fa extends Pa{constructor(){super(...arguments),this.map=new Map}lookup(t){return this.map.get(t)}contains(t){return this.map.has(t)}add(t,e){this.map.set(t,e)}remove(t){this.map.delete(t)}}class Ua extends Fa{constructor(t,e,s){super(t,e);for(const t of Object.keys(s)){const e=s[t],[i,r]="string"==typeof e?[e,null]:e,n=new Oa(t,i,r);this.add(t,n)}}}class ja extends Ua{parse([t,e]){return super.parse([t,"\\"+e])}}class qa extends Fa{constructor(t,e,s={}){super(t,null);const i=t=>"string"==typeof t?s[t]:t;for(const[t,s]of Object.entries(e)){let e,r;Array.isArray(s)?(e=i(s[0]),r=s.slice(1)):(e=i(s),r=[]);const n=new Ma(t,e,r);this.add(t,n)}}parserFor(t){const e=this.lookup(t);return e?e.func:null}parse([t,e]){const s=this.lookup(e),i=this.parserFor(e);return s&&i?Da(i(t,s.token,...s.args)):null}}class Ha extends qa{parse([t,e]){const s=this.lookup(e),i=this.parserFor(e);if(!s||!i)return null;const r=t.currentCS;t.currentCS="\\"+e;const n=i(t,"\\"+s.token,...s.args);return t.currentCS=r,Da(n)}}class Wa extends qa{constructor(t,e,s,i={}){super(t,s,i),this.parser=e}parse([t,e]){const s=this.lookup(e),i=this.parserFor(e);return s&&i?Da(this.parser(t,s.token,i,s.args)):null}}const Va=new Map,Ga={register(t){Va.set(t.name,t)},getMap:t=>Va.get(t)};class Xa{constructor(){this._configuration=new bi,this._fallback=new Ei}add(t,e,s=bi.DEFAULTPRIORITY){for(const e of t.slice().reverse()){const t=Ga.getMap(e);if(!t)return void this.warn(`Configuration '${e}' not found! Omitted.`);this._configuration.add(t,s)}e&&this._fallback.add(e,s)}remove(t,e=null){for(const e of t){const t=this.retrieve(e);t&&this._configuration.remove(t)}e&&this._fallback.remove(e)}parse(t){for(const{item:e}of this._configuration){const s=e.parse(t);if(s===Xa.FALLBACK)break;if(s)return s}const[e,s]=t;Array.from(this._fallback)[0].item(e,s)}lookup(t){const e=this.applicable(t);return e?e.lookup(t):null}contains(t){const e=this.applicable(t);return!(!e||e instanceof Ua&&null===e.lookup(t).char)}toString(){const t=[];for(const{item:e}of this._configuration)t.push(e.name);return t.join(", ")}applicable(t){for(const{item:e}of this._configuration)if(e.contains(t))return e;return null}retrieve(t){for(const{item:e}of this._configuration)if(e.name===t)return e;return null}warn(t){console.log("TexParser Warning: "+t)}}Xa.FALLBACK=Symbol("fallback");class za{constructor(){this.map=new Map}add(t,e,s=bi.DEFAULTPRIORITY){for(const i of Object.keys(t)){const r=i;let n=this.get(r);n||(n=new Xa,this.set(r,n)),n.add(t[r],e[r],s)}}remove(t,e){for(const s of Object.keys(t)){const i=this.get(s);i&&i.remove(t[s],e[s])}}set(t,e){this.map.set(t,e)}get(t){return this.map.get(t)}retrieve(t){for(const e of this.map.values()){const s=e.retrieve(t);if(s)return s}return null}keys(){return this.map.keys()}}class Ka{static makeProcessor(t,e){return Array.isArray(t)?t:[t,e]}static _create(t,e={}){var s;const i=null!==(s=e.priority)&&void 0!==s?s:bi.DEFAULTPRIORITY,r=e.init?this.makeProcessor(e.init,i):null,n=e.config?this.makeProcessor(e.config,i):null,o=(e.preprocessors||[]).map((t=>this.makeProcessor(t,i))),a=(e.postprocessors||[]).map((t=>this.makeProcessor(t,i))),l=e.parser||"tex";return new Ka(t,e[sa.HANDLER]||{},e[sa.FALLBACK]||{},e[sa.ITEMS]||{},e[sa.TAGS]||{},e[sa.OPTIONS]||{},e[sa.NODES]||{},o,a,r,n,i,l)}static create(t,e={}){const s=Ka._create(t,e);return $a.set(t,s),s}static local(t={}){return Ka._create("",t)}constructor(t,e={},s={},i={},r={},n={},o={},a=[],l=[],c=null,h=null,d,u){this.name=t,this.handler=e,this.fallback=s,this.items=i,this.tags=r,this.options=n,this.nodes=o,this.preprocessors=a,this.postprocessors=l,this.initMethod=c,this.configMethod=h,this.priority=d,this.parser=u,this.handler=Object.assign({[ia.CHARACTER]:[],[ia.DELIMITER]:[],[ia.MACRO]:[],[ia.ENVIRONMENT]:[]},e)}get init(){return this.initMethod?this.initMethod[0]:null}get config(){return this.configMethod?this.configMethod[0]:null}}const Ja=new Map,$a={set(t,e){Ja.set(t,e)},get:t=>Ja.get(t),keys:()=>Ja.keys()};class Ya{constructor(t,e=["tex"]){this.initMethod=new Ei,this.configMethod=new Ei,this.configurations=new bi,this.parsers=[],this.handlers=new za,this.items={},this.tags={},this.options={},this.nodes={},this.parsers=e;for(const e of t.slice().reverse())this.addPackage(e);for(const{item:t,priority:e}of this.configurations)this.append(t,e)}init(){this.initMethod.execute(this)}config(t){this.configMethod.execute(this,t);for(const e of this.configurations)this.addFilters(t,e.item)}addPackage(t){const e="string"==typeof t?t:t[0],s=this.getPackage(e);s&&this.configurations.add(s,"string"==typeof t?s.priority:t[1])}add(t,e,s={}){const i=this.getPackage(t);this.append(i),this.configurations.add(i,i.priority),this.init();const r=e.parseOptions;r.nodeFactory.setCreators(i.nodes);for(const t of Object.keys(i.items))r.itemFactory.setNodeClass(t,i.items[t]);ka.addTags(i.tags),Bi(r.options,i.options),Fi(r.options,s),this.addFilters(e,i),i.config&&i.config(this,e)}getPackage(t){const e=$a.get(t);if(e&&!this.parsers.includes(e.parser))throw Error(`Package '${t}' doesn't target the proper parser`);return e||this.warn(`Package '${t}' not found. Omitted.`),e}append(t,e){e=e||t.priority,t.initMethod&&this.initMethod.add(t.initMethod[0],t.initMethod[1]),t.configMethod&&this.configMethod.add(t.configMethod[0],t.configMethod[1]),this.handlers.add(t.handler,t.fallback,e),Object.assign(this.items,t.items),Object.assign(this.tags,t.tags),Bi(this.options,t.options),Object.assign(this.nodes,t.nodes)}addFilters(t,e){for(const[s,i]of e.preprocessors)t.preFilters.add(s,i);for(const[s,i]of e.postprocessors)t.postFilters.add(s,i)}warn(t){console.warn("MathJax Warning: "+t)}}class Qa extends ha{constructor(t,e){super(t),this.global=e}get kind(){return"start"}get isOpen(){return!0}checkItem(t){if(t.isKind("stop")){let t=this.toMml();return this.global.isInner||(t=this.factory.configuration.tags.finalize(t,this.env)),[[this.factory.create("mml",t)],!0]}return super.checkItem(t)}}class Za extends ha{get kind(){return"stop"}get isClose(){return!0}}class tl extends ha{get kind(){return"open"}get isOpen(){return!0}checkItem(t){if(t.isKind("close")){const e=this.toMml(),s=this.create("node","TeXAtom",[e]);return t.addLatexItem(s),[[this.factory.create("mml",s)],!0]}return super.checkItem(t)}}tl.errors=Object.assign(Object.create(ha.errors),{stop:["ExtraOpenMissingClose","Extra open brace or missing close brace"]});class el extends ha{get kind(){return"close"}get isClose(){return!0}}class sl extends ha{get kind(){return"null"}}class il extends ha{get kind(){return"prime"}checkItem(t){const[e,s]=this.Peek(2),i=(Ko.isType(e,"msubsup")||Ko.isType(e,"msup"))&&!Ko.getChildAt(e,e.sup),r=(Ko.isType(e,"munderover")||Ko.isType(e,"mover"))&&!Ko.getChildAt(e,e.over)&&!Ko.getProperty(e,"subsupOK");if(!i&&!r){return[[this.create("node",e.getProperty("movesupsub")?"mover":"msup",[e,s]),t],!0]}const n=i?e.sup:e.over;return Ko.setChild(e,n,s),[[e,t],!0]}}class rl extends ha{get kind(){return"subsup"}checkItem(t){if(t.isKind("open")||t.isKind("left"))return ha.success;const e=this.First,s=this.getProperty("position");if(t.isKind("mml")){if(this.getProperty("primes"))if(2!==s)Ko.setChild(e,2,this.getProperty("primes"));else{Ko.setProperty(this.getProperty("primes"),"variantForm",!0);const e=this.create("node","mrow",[this.getProperty("primes"),t.First]);t.First=e}Ko.setChild(e,s,t.First),null!=this.getProperty("movesupsub")&&Ko.setProperty(e,"movesupsub",this.getProperty("movesupsub"));return[[this.factory.create("mml",e)],!0]}super.checkItem(t);const i=this.getErrors(["","sub","sup"][s]);throw new la(i[0],i[1],...i.splice(2))}}rl.errors=Object.assign(Object.create(ha.errors),{stop:["MissingScript","Missing superscript or subscript argument"],sup:["MissingOpenForSup","Missing open brace for superscript"],sub:["MissingOpenForSub","Missing open brace for subscript"]});class nl extends ha{constructor(t){super(t),this.setProperty("name","\\over")}get kind(){return"over"}get isClose(){return!0}checkItem(t){if(t.isKind("over"))throw new la("AmbiguousUseOf","Ambiguous use of %1",t.getName());if(t.isClose){let e=this.create("node","mfrac",[this.getProperty("num"),this.toMml(!1)]);return null!=this.getProperty("thickness")&&Ko.setAttribute(e,"linethickness",this.getProperty("thickness")),(this.getProperty("ldelim")||this.getProperty("rdelim"))&&(Ko.setProperty(e,"withDelims",!0),e=ya.fixedFence(this.factory.configuration,this.getProperty("ldelim"),e,this.getProperty("rdelim"))),e.attributes.set(Jo.Attr.LATEXITEM,this.getProperty("name")),[[this.factory.create("mml",e),t],!0]}return super.checkItem(t)}toString(){return"over["+this.getProperty("num")+" / "+this.nodes.join("; ")+"]"}}class ol extends ha{constructor(t,e){super(t),this.setProperty("delim",e)}get kind(){return"left"}get isOpen(){return!0}checkItem(t){if(t.isKind("right")){const e=ya.fenced(this.factory.configuration,this.getProperty("delim"),this.toMml(),t.getProperty("delim"),"",t.getProperty("color")),s=e.childNodes[0],i=e.childNodes[e.childNodes.length-1],r=this.factory.create("mml",e);return this.addLatexItem(s,"\\left"),t.addLatexItem(i,"\\right"),r.Peek()[0].attributes.set(Jo.Attr.LATEXITEM,"\\left"+t.startStr.slice(this.startI,t.stopI)),[[r],!0]}if(t.isKind("middle")){const e={stretchy:!0};t.getProperty("color")&&(e.mathcolor=t.getProperty("color"));const s=this.create("token","mo",e,t.getProperty("delim"));return t.addLatexItem(s,"\\middle"),this.Push(this.create("node","TeXAtom",[],{texClass:fr.CLOSE}),s,this.create("node","TeXAtom",[],{texClass:fr.OPEN})),this.env={},[[this],!0]}return super.checkItem(t)}}ol.errors=Object.assign(Object.create(ha.errors),{stop:["ExtraLeftMissingRight","Extra \\left or missing \\right"]});class al extends ha{constructor(t,e,s){super(t),this.setProperty("delim",e),s&&this.setProperty("color",s)}get kind(){return"middle"}get isClose(){return!0}}class ll extends ha{constructor(t,e,s){super(t),this.setProperty("delim",e),s&&this.setProperty("color",s)}get kind(){return"right"}get isClose(){return!0}}class cl extends ha{get kind(){return"break"}constructor(t,e,s){super(t),this.setProperty("linebreak",e),this.setProperty("insert",s)}checkItem(t){var e,s;const i=this.getProperty("linebreak");if(t.isKind("mml")){const r=t.First;if(r.isKind("mo")){if("after"!==((null===(s=null===(e=Ko.getOp(r))||void 0===e?void 0:e[3])||void 0===s?void 0:s.linebreakstyle)||Ko.getAttribute(r,"linebreakstyle")))return Ko.setAttribute(r,"linebreak",i),[[t],!0];if(!this.getProperty("insert"))return[[t],!0]}}const r=this.create("token","mspace",{linebreak:i});return[[this.factory.create("mml",r),t],!0]}}class hl extends ha{get kind(){return"begin"}get isOpen(){return!0}checkItem(t){if(t.isKind("end")){if(t.getName()!==this.getName())throw new la("EnvBadEnd","\\begin{%1} ended with \\end{%2}",this.getName(),t.getName());const e=this.toMml();return t.addLatexItem(e),[[this.factory.create("mml",e)],!0]}if(t.isKind("stop"))throw new la("EnvMissingEnd","Missing \\end{%1}",this.getName());return super.checkItem(t)}}class dl extends ha{get kind(){return"end"}get isClose(){return!0}}class ul extends ha{get kind(){return"style"}checkItem(t){if(!t.isClose)return super.checkItem(t);const e=this.create("node","mstyle",this.nodes,this.getProperty("styles"));return[[this.factory.create("mml",e),t],!0]}}class pl extends ha{get kind(){return"position"}checkItem(t){if(t.isClose)throw new la("MissingBoxFor","Missing box for %1",this.getName());if(t.isFinal){let e=t.toMml();switch(this.getProperty("move")){case"vertical":return e=this.create("node","mpadded",[e],{height:this.getProperty("dh"),depth:this.getProperty("dd"),voffset:this.getProperty("dh")}),[[this.factory.create("mml",e)],!0];case"horizontal":return[[this.factory.create("mml",this.getProperty("left")),t,this.factory.create("mml",this.getProperty("right"))],!0]}}return super.checkItem(t)}}class ml extends ha{get kind(){return"cell"}get isClose(){return!0}}class gl extends ha{get isFinal(){return!0}get kind(){return"mml"}}class fl extends ha{get kind(){return"fn"}checkItem(t){const e=this.First;if(e){if(t.isOpen)return ha.success;if(!t.isKind("fn")){let s=t.First;if(!t.isKind("mml")||!s)return[[e,t],!0];if(Ko.isType(s,"mstyle")&&s.childNodes.length&&Ko.isType(s.childNodes[0].childNodes[0],"mspace")||Ko.isType(s,"mspace"))return[[e,t],!0];Ko.isEmbellished(s)&&(s=Ko.getCoreMO(s));const i=Ko.getForm(s);if(null!=i&&[0,0,1,1,0,1,1,0,0,0][i[2]])return[[e,t],!0]}if(e.isKind("TeXAtom")&&0===e.childNodes[0].childNodes.length)return[[e,t],!0];return[[e,this.create("token","mo",{texClass:fr.NONE},wo.ApplyFunction),t],!0]}return super.checkItem(t)}}class bl extends ha{constructor(){super(...arguments),this.remap=Ga.getMap("not_remap")}get kind(){return"not"}checkItem(t){let e,s,i;if(t.isKind("open")||t.isKind("left"))return ha.success;if(t.isKind("mml")&&(Ko.isType(t.First,"mo")||Ko.isType(t.First,"mi")||Ko.isType(t.First,"mtext"))&&(e=t.First,s=Ko.getText(e),1===s.length&&!Ko.getProperty(e,"movesupsub")&&1===Ko.getChildren(e).length))return this.remap.contains(s)?(i=this.create("text",this.remap.lookup(s).char),Ko.setChild(e,0,i)):(i=this.create("text","\u0338"),Ko.appendChildren(e,[i])),[[t],!0];i=this.create("text","\u29f8");const r=this.create("node","mtext",[],{},i),n=this.create("node","mpadded",[r],{width:0});return e=this.create("node","TeXAtom",[n],{texClass:fr.REL}),[[e,t],!0]}}class El extends ha{get kind(){return"nonscript"}checkItem(t){if(t.isKind("mml")&&1===t.Size()){let e=t.First;if(e.isKind("mstyle")&&e.notParent&&(e=Ko.getChildren(Ko.getChildren(e)[0])[0]),e.isKind("mspace")){if(e!==t.First){const e=this.create("node","mrow",[t.Pop()]);t.Push(e)}this.factory.configuration.addNode("nonscript",t.First)}}return[[t],!0]}}class xl extends ha{get kind(){return"dots"}checkItem(t){if(t.isKind("open")||t.isKind("left"))return ha.success;let e=this.getProperty("ldots");const s=t.First;if(t.isKind("mml")&&Ko.isEmbellished(s)){const t=Ko.getTexClass(Ko.getCoreMO(s));t!==fr.BIN&&t!==fr.REL||(e=this.getProperty("cdots"))}return[[e,t],!0]}}class yl extends ha{constructor(){super(...arguments),this.table=[],this.row=[],this.frame=[],this.hfill=[],this.arraydef={},this.cstart=[],this.cend=[],this.cextra=[],this.atEnd=!1,this.ralign=[],this.breakAlign={cell:"",row:"",table:""},this.templateSubs=0}get kind(){return"array"}get isOpen(){return!0}get copyEnv(){return!1}checkItem(t){if(t.isClose&&!t.isKind("over")){if(t.getProperty("isEntry"))return this.EndEntry(),this.clearEnv(),this.StartEntry(),ha.fail;if(t.getProperty("isCR"))return this.EndEntry(),this.EndRow(),this.clearEnv(),this.StartEntry(),ha.fail;this.EndTable(),this.clearEnv();const e=this.factory.create("mml",this.createMml());if(this.getProperty("requireClose")){if(t.isKind("close"))return[[e],!0];throw new la("MissingCloseBrace","Missing close brace")}return[[e,t],!0]}return super.checkItem(t)}createMml(){const t=this.arraydef.scriptlevel;delete this.arraydef.scriptlevel;let e=this.create("node","mtable",this.table,this.arraydef);return t&&e.setProperty("smallmatrix",!0),this.breakAlign.table&&Ko.setAttribute(e,"data-break-align",this.breakAlign.table),this.getProperty("arrayPadding")&&(Ko.setAttribute(e,"data-frame-styles",""),Ko.setAttribute(e,"framespacing",this.getProperty("arrayPadding"))),e=this.handleFrame(e),void 0!==t&&(e=this.create("node","mstyle",[e],{scriptlevel:t})),(this.getProperty("open")||this.getProperty("close"))&&(e=ya.fenced(this.factory.configuration,this.getProperty("open"),e,this.getProperty("close"))),e}handleFrame(t){if(!this.frame.length)return t;const e=new Map(this.frame),s=this.frame.reduce(((t,[,e])=>e===t?e:""),this.frame[0][1]);if(s){if(4===this.frame.length)return Ko.setAttribute(t,"frame",s),Ko.removeAttribute(t,"data-frame-styles"),t;if("solid"===s)return Ko.setAttribute(t,"data-frame-styles",""),t=this.create("node","menclose",[t],{notation:Array.from(e.keys()).join(" "),"data-padding":0})}const i=ko.map((t=>e.get(t)||"none")).join(" ");return Ko.setAttribute(t,"data-frame-styles",i),t}StartEntry(){const t=this.row.length;let e=this.cstart[t],s=this.cend[t];const i=this.ralign[t],r=this.cextra;if(!(e||s||i||r[t]||r[t+1]))return;let[n,o,a,l]=this.getEntry();if(!r[t]||this.atEnd&&!r[t+1]||(e+="&"),"&"!==a&&(l=!!o.trim()||!!(t||a&&"\\end"!==a.substring(0,4)),r[t+1]&&!r[t]&&(s=(s||"")+"&",this.atEnd=!0)),!l&&!n)return;const c=this.parser;if(l&&(e&&(o=ya.addArgs(c,e,o)),s&&(o=ya.addArgs(c,o,s)),i&&(o="\\text{"+o.trim()+"}"),(e||s||i)&&++this.templateSubs>c.configuration.options.maxTemplateSubtitutions))throw new la("MaxTemplateSubs","Maximum template substitutions exceeded; is there an invalid use of \\\\ in the template?");n&&(o=ya.addArgs(c,n,o)),c.string=ya.addArgs(c,o,c.string),c.i=0}getEntry(){const t=this.parser,e=/^([^]*?)([&{}]|\\\\|\\(?:begin|end)\s*\{array\}|\\cr|\\)/;let s,i=0,r=0,n=t.i;const o=["","","",!1];for(;null!==(s=t.string.slice(n).match(e));)switch(n+=s[0].length,s[2]){case"\\":n++;break;case"{":i++;break;case"}":if(!i)return o;i--;break;case"\\begin{array}":i||r++;break;case"\\end{array}":if(!i&&r){r--;break}default:{if(i||r)continue;n-=s[2].length;let e=t.string.slice(t.i,n).trim();const o=e.match(/^(?:\s*\\(?:h(?:dash)?line|hfil{1,3}|rowcolor\s*\{.*?\}))+/);return o&&(e=e.slice(o[0].length)),t.string=t.string.slice(n),t.i=0,[(null==o?void 0:o[0])||"",e,s[2],!0]}}return o}EndEntry(){const t=this.create("node","mtd",this.nodes);this.hfill.length&&(0===this.hfill[0]&&Ko.setAttribute(t,"columnalign","right"),this.hfill[this.hfill.length-1]===this.Size()&&Ko.setAttribute(t,"columnalign",Ko.getAttribute(t,"columnalign")?"center":"left"));const e=this.ralign[this.row.length];if(e){const[s,i,r]=e,n=this.create("node","mpadded",t.childNodes[0].childNodes,{width:i,"data-overflow":"auto","data-align":r,"data-vertical-align":s});n.setProperty("vbox",s),t.childNodes[0].childNodes=[],t.appendChild(n)}else this.breakAlign.cell&&Ko.setAttribute(t,"data-vertical-align",this.breakAlign.cell);this.breakAlign.cell="",this.row.push(t),this.Clear(),this.hfill=[]}EndRow(){let t="mtr";this.getProperty("isNumbered")&&3===this.row.length?(this.row.unshift(this.row.pop()),t="mlabeledtr"):this.getProperty("isLabeled")&&(t="mlabeledtr",this.setProperty("isLabeled",!1));const e=this.create("node",t,this.row);this.breakAlign.row&&(Ko.setAttribute(e,"data-break-align",this.breakAlign.row),this.breakAlign.row=""),this.addLatexItem(e),this.table.push(e),this.row=[],this.atEnd=!1}EndTable(){(this.Size()||this.row.length)&&(this.EndEntry(),this.EndRow()),this.checkLines()}checkLines(){if(this.arraydef.rowlines){const t=this.arraydef.rowlines.split(/ /);t.length===this.table.length?(this.frame.push(["bottom",t.pop()]),t.length?this.arraydef.rowlines=t.join(" "):delete this.arraydef.rowlines):t.length<this.table.length-1&&(this.arraydef.rowlines+=" none")}if(this.getProperty("rowspacing")){const t=this.arraydef.rowspacing.split(/ /);for(;t.length<this.table.length;)t.push(this.getProperty("rowspacing")+"em");this.arraydef.rowspacing=t.join(" ")}}addRowSpacing(t){if(this.arraydef.rowspacing){const e=this.arraydef.rowspacing.split(/ /);if(!this.getProperty("rowspacing")){const t=na.dimen2em(e[0]);this.setProperty("rowspacing",t)}const s=this.getProperty("rowspacing");for(;e.length<this.table.length;)e.push(na.em(s));e[this.table.length-1]=na.em(Math.max(0,s+na.dimen2em(t))),this.arraydef.rowspacing=e.join(" ")}}}class Nl extends yl{constructor(t,...e){super(t),this.maxrow=0,this.factory.configuration.tags.start(e[0],e[2],e[1])}get kind(){return"eqnarray"}EndEntry(){const t=this.arraydef.columnalign.split(/ /);"right"!==(this.row.length&&t.length?t[this.row.length%t.length]:"right")&&ya.fixInitialMO(this.factory.configuration,this.nodes),super.EndEntry()}EndRow(){this.row.length>this.maxrow&&(this.maxrow=this.row.length);const t=this.factory.configuration.tags.getTag();t&&(this.row=[t].concat(this.row),this.setProperty("isLabeled",!0)),this.factory.configuration.tags.clearTag(),super.EndRow()}EndTable(){super.EndTable(),this.factory.configuration.tags.end(),this.extendArray("columnalign",this.maxrow),this.extendArray("columnwidth",this.maxrow),this.extendArray("columnspacing",this.maxrow-1),this.extendArray("data-break-align",this.maxrow),this.addIndentshift()}extendArray(t,e){if(!this.arraydef[t])return;const s=this.arraydef[t].split(/ /),i=[...s];if(i.length>1){for(;i.length<e;)i.push(...s);this.arraydef[t]=i.slice(0,e).join(" ")}}addIndentshift(){const t=this.arraydef.columnalign.split(/ /);let e="";for(const s of t.keys()){if("left"===t[s]&&s>0){const t="center"===e?".7em":"2em";for(const e of this.table){const i=e.childNodes[e.isKind("mlabeledtr")?s+1:s];if(i){const e=this.create("node","mstyle",i.childNodes[0].childNodes,{indentshift:t});i.childNodes[0].childNodes=[],i.appendChild(e)}}}e=t[s]}}}class Al extends hl{get kind(){return"mstyle"}constructor(t,e,s){super(t),this.attrList=e,this.setProperty("name",s)}checkItem(t){if(t.isKind("end")&&t.getName()===this.getName()){return[[this.create("node","mstyle",[this.toMml()],this.attrList)],!0]}return super.checkItem(t)}}class vl extends ha{constructor(t,...e){super(t),this.factory.configuration.tags.start("equation",!0,e[0])}get kind(){return"equation"}get isOpen(){return!0}checkItem(t){if(t.isKind("end")){const e=this.toMml(),s=this.factory.configuration.tags.getTag();return this.factory.configuration.tags.end(),[[s?this.factory.configuration.tags.enTag(e,s):e,t],!0]}if(t.isKind("stop"))throw new la("EnvMissingEnd","Missing \\end{%1}",this.getName());return super.checkItem(t)}}const _l=1.2/.85,wl={fontfamily:1,fontsize:1,fontweight:1,fontstyle:1,color:1,background:1,id:1,class:1,href:1,style:1};function Tl(t,e=1/0){const s=t.replace(/\s+/g,"").split("").map((t=>{const e={t:"top",b:"bottom",m:"middle",c:"center"}[t];if(!e)throw new la("BadBreakAlign","Invalid alignment character: %1",t);return e}));if(s.length>e)throw new la("TooManyAligns","Too many alignment characters: %1",t);return 1===e?s[0]:s.join(" ")}function Cl(t,e){const s=t.stack.env,i=s.inRoot;s.inRoot=!0;const r=new da(e,s,t.configuration);let n=r.mml();const o=r.stack.global;if(o.leftRoot||o.upRoot){const e={};o.leftRoot&&(e.width=o.leftRoot),o.upRoot&&(e.voffset=o.upRoot,e.height=o.upRoot),n=t.create("node","mpadded",[n],e)}return s.inRoot=i,n}const Ll={Open(t,e){t.Push(t.itemFactory.create("open"))},Close(t,e){t.Push(t.itemFactory.create("close"))},Bar(t,e){t.Push(t.create("token","mo",{stretchy:!1,texClass:fr.ORD},e))},Tilde(t,e){t.Push(t.create("token","mtext",{},wo.nbsp))},Space(t,e){},Superscript(t,e){let s,i;t.GetNext().match(/\d/)&&(t.string=t.string.substring(0,t.i+1)+" "+t.string.substring(t.i+1));const r=t.stack.Top();r.isKind("prime")?([i,s]=r.Peek(2),t.stack.Pop()):(i=t.stack.Prev(),i||(i=t.create("token","mi",{},"")));const n=Ko.getProperty(i,"movesupsub");let o=Ko.isType(i,"msubsup")?i.sup:i.over;if(Ko.isType(i,"msubsup")&&!Ko.isType(i,"msup")&&Ko.getChildAt(i,i.sup)||Ko.isType(i,"munderover")&&!Ko.isType(i,"mover")&&Ko.getChildAt(i,i.over)&&!Ko.getProperty(i,"subsupOK"))throw new la("DoubleExponent","Double exponent: use braces to clarify");Ko.isType(i,"msubsup")&&!Ko.isType(i,"msup")||(n?((!Ko.isType(i,"munderover")||Ko.isType(i,"mover")||Ko.getChildAt(i,i.over))&&(i=t.create("node","munderover",[i],{movesupsub:!0})),o=i.over):(i=t.create("node","msubsup",[i]),o=i.sup)),t.Push(t.itemFactory.create("subsup",i).setProperties({position:o,primes:s,movesupsub:n}))},Subscript(t,e){let s,i;t.GetNext().match(/\d/)&&(t.string=t.string.substring(0,t.i+1)+" "+t.string.substring(t.i+1));const r=t.stack.Top();r.isKind("prime")?([i,s]=r.Peek(2),t.stack.Pop()):(i=t.stack.Prev(),i||(i=t.create("token","mi",{},"")));const n=Ko.getProperty(i,"movesupsub");let o=Ko.isType(i,"msubsup")?i.sub:i.under;if(Ko.isType(i,"msubsup")&&!Ko.isType(i,"msup")&&Ko.getChildAt(i,i.sub)||Ko.isType(i,"munderover")&&!Ko.isType(i,"mover")&&Ko.getChildAt(i,i.under)&&!Ko.getProperty(i,"subsupOK"))throw new la("DoubleSubscripts","Double subscripts: use braces to clarify");Ko.isType(i,"msubsup")&&!Ko.isType(i,"msup")||(n?((!Ko.isType(i,"munderover")||Ko.isType(i,"mover")||Ko.getChildAt(i,i.under))&&(i=t.create("node","munderover",[i],{movesupsub:!0})),o=i.under):(i=t.create("node","msubsup",[i]),o=i.sub)),t.Push(t.itemFactory.create("subsup",i).setProperties({position:o,primes:s,movesupsub:n}))},Prime(t,e){let s=t.stack.Prev();if(s||(s=t.create("token","mi")),Ko.isType(s,"msubsup")&&!Ko.isType(s,"msup")&&Ko.getChildAt(s,s.sup)||Ko.isType(s,"munderover")&&!Ko.isType(s,"mover")&&Ko.getChildAt(s,s.over)&&!Ko.getProperty(s,"subsupOK"))throw new la("DoubleExponentPrime","Prime causes double exponent: use braces to clarify");let i="";t.i--;do{i+=wo.prime,t.i++,e=t.GetNext()}while("'"===e||e===wo.rsquo);i=["","\u2032","\u2033","\u2034","\u2057"][i.length]||i;const r=t.create("token","mo",{variantForm:!0},i);t.Push(t.itemFactory.create("prime",s,r))},Comment(t,e){for(;t.i<t.string.length&&"\n"!==t.string.charAt(t.i);)t.i++},Hash(t,e){throw new la("CantUseHash1","You can't use 'macro parameter character #' in math mode")},MathFont(t,e,s,i=""){const r=t.GetArgument(e),n=new da(r,Object.assign(Object.assign({multiLetterIdentifiers:t.options.identifierPattern},t.stack.env),{font:s,italicFont:i,noAutoOP:!0}),t.configuration).mml();t.Push(t.create("node","TeXAtom",[n]))},SetFont(t,e,s){t.stack.env.font=s,t.Push(t.itemFactory.create("null"))},SetStyle(t,e,s,i,r){t.stack.env.style=s,t.stack.env.level=r,t.Push(t.itemFactory.create("style").setProperty("styles",{displaystyle:i,scriptlevel:r}))},SetSize(t,e,s){t.stack.env.size=s,t.Push(t.itemFactory.create("style").setProperty("styles",{mathsize:No(s)}))},Spacer(t,e,s){const i=t.create("node","mspace",[],{width:No(s)}),r=t.create("node","mstyle",[i],{scriptlevel:0});t.Push(r)},DiscretionaryTimes(t,e){t.Push(t.create("token","mo",{linebreakmultchar:"\xd7"},"\u2062"))},AllowBreak(t,e){t.Push(t.create("token","mspace"))},Break(t,e){t.Push(t.create("token","mspace",{linebreak:Jo.LineBreak.NEWLINE}))},Linebreak(t,e,s){let i=!0;const r=t.stack.Prev(!0);if(r&&r.isKind("mo")){Ko.getMoAttribute(r,"linebreakstyle")!==Jo.LineBreakStyle.BEFORE&&(r.attributes.set("linebreak",s),i=!1)}t.Push(t.itemFactory.create("break",s,i))},LeftRight(t,e){const s=e.substring(1);t.Push(t.itemFactory.create(s,t.GetDelimiter(e),t.stack.env.color))},NamedFn(t,e,s){s||(s=e.substring(1));const i=t.create("token","mi",{texClass:fr.OP},s);t.Push(t.itemFactory.create("fn",i))},NamedOp(t,e,s){s||(s=e.substring(1)),s=s.replace(/ /,"\u2006");const i=t.create("token","mo",{movablelimits:!0,movesupsub:!0,form:Jo.Form.PREFIX,texClass:fr.OP},s);t.Push(i)},Limits(t,e,s){let i=t.stack.Prev(!0);if(!i||Ko.getTexClass(Ko.getCoreMO(i))!==fr.OP&&null==Ko.getProperty(i,"movesupsub"))throw new la("MisplacedLimits","%1 is allowed only on operators",t.currentCS);const r=t.stack.Top();let n;Ko.isType(i,"munderover")&&!s?(n=t.create("node","msubsup"),Ko.copyChildren(i,n),i=r.Last=n):Ko.isType(i,"msubsup")&&s&&(n=t.create("node","munderover"),Ko.copyChildren(i,n),i=r.Last=n),Ko.setProperty(i,"movesupsub",!!s),Ko.setProperties(Ko.getCoreMO(i),{movablelimits:!1}),((Ko.isType(i,"mo")?Ko.getMoAttribute(i,"movableLimits"):Ko.getAttribute(i,"movablelimits"))||Ko.getProperty(i,"movablelimits"))&&Ko.setProperties(i,{movablelimits:!1})},Over(t,e,s,i){const r=t.itemFactory.create("over").setProperty("name",t.currentCS);s||i?(r.setProperty("ldelim",s),r.setProperty("rdelim",i)):e.match(/withdelims$/)&&(r.setProperty("ldelim",t.GetDelimiter(e)),r.setProperty("rdelim",t.GetDelimiter(e))),e.match(/^\\above/)?r.setProperty("thickness",t.GetDimen(e)):(e.match(/^\\atop/)||s||i)&&r.setProperty("thickness",0),t.Push(r)},Frac(t,e){const s=t.ParseArg(e),i=t.ParseArg(e),r=t.create("node","mfrac",[s,i]);t.Push(r)},Sqrt(t,e){const s=t.GetBrackets(e);let i=t.GetArgument(e);"\\frac"===i&&(i+="{"+t.GetArgument(i)+"}{"+t.GetArgument(i)+"}");let r=new da(i,t.stack.env,t.configuration).mml();r=s?t.create("node","mroot",[r,Cl(t,s)]):t.create("node","msqrt",[r]),t.Push(r)},Root(t,e){const s=t.GetUpTo(e,"\\of"),i=t.ParseArg(e),r=t.create("node","mroot",[i,Cl(t,s)]);t.Push(r)},MoveRoot(t,e,s){if(!t.stack.env.inRoot)throw new la("MisplacedMoveRoot","%1 can appear only within a root",t.currentCS);if(t.stack.global[s])throw new la("MultipleMoveRoot","Multiple use of %1",t.currentCS);let i=t.GetArgument(e);if(!i.match(/-?[0-9]+/))throw new la("IntegerArg","The argument to %1 must be an integer",t.currentCS);i=parseInt(i,10)/15+"em","-"!==i.substring(0,1)&&(i="+"+i),t.stack.global[s]=i},Accent(t,e,s,i){const r=t.ParseArg(e),n=Object.assign(Object.assign({},ya.getFontDef(t)),{accent:!0,mathaccent:void 0===i||i}),o=Ko.createEntity(s),a=t.create("token","mo",n,o);Ko.setAttribute(a,"stretchy",!!i);const l=Ko.isEmbellished(r)?Ko.getCoreMO(r):r;(Ko.isType(l,"mo")||Ko.getProperty(l,"movablelimits"))&&Ko.setProperties(l,{movablelimits:!1});const c=t.create("node","munderover");Ko.setChild(c,0,r),Ko.setChild(c,1,null),Ko.setChild(c,2,a);const h=t.create("node","TeXAtom",[c]);t.Push(h)},UnderOver(t,e,s,i){const r=Ko.createEntity(s),n=t.create("token","mo",{stretchy:!0,accent:!0},r);r.match(Xr.mathaccentsWithWidth)&&n.setProperty("mathaccent",!1);const o="o"===e.charAt(1)?"over":"under",a=t.ParseArg(e);t.Push(ya.underOver(t,a,n,o,i))},Overset(t,e){const s=t.ParseArg(e),i=t.ParseArg(e),r=s.coreMO(),n=r.isKind("mo")&&!0===Ko.getMoAttribute(r,"accent");ya.checkMovableLimits(i);const o=t.create("node","mover",[i,s],{accent:n});t.Push(o)},Underset(t,e){const s=t.ParseArg(e),i=t.ParseArg(e),r=s.coreMO(),n=r.isKind("mo")&&!0===Ko.getMoAttribute(r,"accent");ya.checkMovableLimits(i);const o=t.create("node","munder",[i,s],{accentunder:n});t.Push(o)},Overunderset(t,e){const s=t.ParseArg(e),i=t.ParseArg(e),r=t.ParseArg(e),n=s.coreMO(),o=i.coreMO(),a=n.isKind("mo")&&!0===Ko.getMoAttribute(n,"accent"),l=o.isKind("mo")&&!0===Ko.getMoAttribute(o,"accent");ya.checkMovableLimits(r);const c=t.create("node","munderover",[r,i,s],{accent:a,accentunder:l});t.Push(c)},TeXAtom(t,e,s){const i={texClass:s};let r,n;if(s===fr.OP){i.movesupsub=i.movablelimits=!0;const s=t.GetArgument(e),o=s.match(/^\s*\\rm\s+([a-zA-Z0-9 ]+)$/);if(o)i.mathvariant=Jo.Variant.NORMAL,n=t.create("token","mi",i,o[1]);else{const e=new da(s,t.stack.env,t.configuration).mml();n=t.create("node","TeXAtom",[e],i)}r=t.itemFactory.create("fn",n)}else r=t.create("node","TeXAtom",[t.ParseArg(e)],i);t.Push(r)},VBox(t,e,s){const i=new da(t.GetArgument(e),t.stack.env,t.configuration),r={"data-vertical-align":s,texClass:fr.ORD};i.stack.env.hsize&&(r.width=i.stack.env.hsize,r["data-overflow"]="linebreak");const n=t.create("node","mpadded",[i.mml()],r);n.setProperty("vbox",s),t.Push(n)},Hsize(t,e){"="===t.GetNext()&&t.i++,t.stack.env.hsize=t.GetDimen(e),t.Push(t.itemFactory.create("null"))},ParBox(t,e){const s=t.GetBrackets(e,"c"),i=t.GetDimen(e),r=ya.internalMath(t,t.GetArgument(e)),n=Tl(s,1),o=t.create("node","mpadded",r,{width:i,"data-overflow":"linebreak","data-vertical-align":n});o.setProperty("vbox",n),t.Push(o)},BreakAlign(t,e){const s=t.stack.Top();if(!(s instanceof yl))throw new la("BreakNotInArray","%1 must be used in an alignment environment",t.currentCS);switch(t.GetArgument(e).trim()){case"c":if(s.First)throw new la("BreakFirstInEntry","%1 must be at the beginning of an alignment entry",t.currentCS+"{c}");s.breakAlign.cell=Tl(t.GetArgument(e),1);break;case"r":if(s.row.length||s.First)throw new la("BreakFirstInRow","%1 must be at the beginning of an alignment row",t.currentCS+"{r}");s.breakAlign.row=Tl(t.GetArgument(e));break;case"t":if(s.table.length||s.row.length||s.First)throw new la("BreakFirstInTable","%1 must be at the beginning of an alignment",t.currentCS+"{t}");s.breakAlign.table=Tl(t.GetArgument(e));break;default:throw new la("BreakType","First argument to %1 must be one of c, r, or t",t.currentCS)}},MmlToken(t,e){const s=t.GetArgument(e);let i=t.GetBrackets(e,"").replace(/^\s+/,"");const r=t.GetArgument(e),n={},o=[];let a;try{a=t.create("node",s)}catch(t){a=null}if(!a||!a.isToken)throw new la("NotMathMLToken","%1 is not a token element",s);for(;""!==i;){const e=i.match(/^([a-z]+)\s*=\s*('[^'\n]*'|"[^"\n]*"|[^ ,\n]*)[\s\n]*,?[\s\n]*/i);if(!e)throw new la("InvalidMathMLAttr","Invalid MathML attribute: %1",i.split(/[\s\n=]/)[0]);if(!a.attributes.hasDefault(e[1])&&!wl[e[1]])throw new la("UnknownAttrForElement","%1 is not a recognized attribute for %2",e[1],s);let r=ya.mmlFilterAttribute(t,e[1],e[2].replace(/^(['"])(.*)\1$/,"$2"));r&&("true"===r.toLowerCase()?r=!0:"false"===r.toLowerCase()&&(r=!1),n[e[1]]=r,o.push(e[1])),i=i.substring(e[0].length)}o.length&&a.setProperty("keep-attrs",o.join(" "));const l=t.create("text",Vr(r));a.appendChild(l),Ko.setProperties(a,n),t.Push(a)},Strut(t,e){const s=t.create("node","mrow"),i=t.create("node","mpadded",[s],{height:"8.6pt",depth:"3pt",width:0});t.Push(i)},Phantom(t,e,s,i){let r=t.create("node","mphantom",[t.ParseArg(e)]);(s||i)&&(r=t.create("node","mpadded",[r]),i&&(Ko.setAttribute(r,"height",0),Ko.setAttribute(r,"depth",0)),s&&Ko.setAttribute(r,"width",0));const n=t.create("node","TeXAtom",[r]);t.Push(n)},Smash(t,e){const s=na.trimSpaces(t.GetBrackets(e,"")),i=t.create("node","mpadded",[t.ParseArg(e)]);switch(s){case"b":Ko.setAttribute(i,"depth",0);break;case"t":Ko.setAttribute(i,"height",0);break;default:Ko.setAttribute(i,"height",0),Ko.setAttribute(i,"depth",0)}const r=t.create("node","TeXAtom",[i]);t.Push(r)},Lap(t,e){const s=t.create("node","mpadded",[t.ParseArg(e)],{width:0});"\\llap"===e&&Ko.setAttribute(s,"lspace","-1width");const i=t.create("node","TeXAtom",[s]);t.Push(i)},RaiseLower(t,e){let s=t.GetDimen(e);const i=t.itemFactory.create("position").setProperties({name:t.currentCS,move:"vertical"});"-"===s.charAt(0)&&(s=s.slice(1),e="raise"===e.substring(1)?"\\lower":"\\raise"),"\\lower"===e?(i.setProperty("dh","-"+s),i.setProperty("dd","+"+s)):(i.setProperty("dh","+"+s),i.setProperty("dd","-"+s)),t.Push(i)},MoveLeftRight(t,e){let s=t.GetDimen(e),i="-"===s.charAt(0)?s.slice(1):"-"+s;if("\\moveleft"===e){const t=s;s=i,i=t}t.Push(t.itemFactory.create("position").setProperties({name:t.currentCS,move:"horizontal",left:t.create("node","mspace",[],{width:s}),right:t.create("node","mspace",[],{width:i})}))},Hskip(t,e,s=!1){const i=t.create("node","mspace",[],{width:t.GetDimen(e)});s&&Ko.setAttribute(i,"linebreak","nobreak"),t.Push(i)},Nonscript(t,e){t.Push(t.itemFactory.create("nonscript"))},Rule(t,e,s){const i={width:t.GetDimen(e),height:t.GetDimen(e),depth:t.GetDimen(e)};"blank"!==s&&(i.mathbackground=t.stack.env.color||"black");const r=t.create("node","mspace",[],i);t.Push(r)},rule(t,e){const s=t.GetBrackets(e),i=t.GetDimen(e),r=t.GetDimen(e);let n=t.create("node","mspace",[],{width:i,height:r,mathbackground:t.stack.env.color||"black"});s&&(n=t.create("node","mpadded",[n],{voffset:s}),s.match(/^-/)?(Ko.setAttribute(n,"height",s),Ko.setAttribute(n,"depth","+"+s.substring(1))):Ko.setAttribute(n,"height","+"+s)),t.Push(n)},MakeBig(t,e,s,i){const r=String(i*=_l).replace(/(\.\d\d\d).+/,"$1")+"em",n=t.GetDelimiter(e,!0),o=t.create("token","mo",{minsize:r,maxsize:r,fence:!0,stretchy:!0,symmetric:!0},n),a=t.create("node","TeXAtom",[o],{texClass:s});t.Push(a)},BuildRel(t,e){const s=t.ParseUpTo(e,"\\over"),i=t.ParseArg(e),r=t.create("node","munderover");Ko.setChild(r,0,i),Ko.setChild(r,1,null),Ko.setChild(r,2,s);const n=t.create("node","TeXAtom",[r],{texClass:fr.REL});t.Push(n)},HBox(t,e,s,i){t.PushAll(ya.internalMath(t,t.GetArgument(e),s,i))},FBox(t,e){const s=ya.internalMath(t,t.GetArgument(e)),i=t.create("node","menclose",s,{notation:"box"});t.Push(i)},FrameBox(t,e){const s=t.GetBrackets(e),i=t.GetBrackets(e)||"c";let r=ya.internalMath(t,t.GetArgument(e));s&&(r=[t.create("node","mpadded",r,{width:s,"data-align":Hi(i,{l:"left",r:"right"},"center")})]);const n=t.create("node","TeXAtom",[t.create("node","menclose",r,{notation:"box"})],{texClass:fr.ORD});t.Push(n)},MakeBox(t,e){const s=t.GetBrackets(e),i=t.GetBrackets(e,"c"),r=t.create("node","mpadded",ya.internalMath(t,t.GetArgument(e)));s&&Ko.setAttribute(r,"width",s);const n=Hi(i.toLowerCase(),{c:"center",r:"right"},"");n&&Ko.setAttribute(r,"data-align",n),i.toLowerCase()!==i&&Ko.setAttribute(r,"data-overflow","linebreak"),t.Push(r)},Not(t,e){t.Push(t.itemFactory.create("not"))},Dots(t,e){const s=Ko.createEntity("2026"),i=Ko.createEntity("22EF"),r=t.create("token","mo",{stretchy:!1},s),n=t.create("token","mo",{stretchy:!1},i);t.Push(t.itemFactory.create("dots").setProperties({ldots:r,cdots:n}))},Matrix(t,e,s,i,r,n,o,a,l,c){const h=t.GetNext();if(""===h)throw new la("MissingArgFor","Missing argument for %1",t.currentCS);"{"===h?t.i++:(t.string=h+"}"+t.string.slice(t.i+1),t.i=0);const d=t.itemFactory.create("array").setProperty("requireClose",!0);!s&&r||d.setProperty("arrayPadding",".2em .125em"),d.arraydef={rowspacing:o||"4pt",columnspacing:n||"1em"},l&&d.setProperty("isCases",!0),c&&(d.setProperty("isNumbered",!0),d.arraydef.side=c),(s||i)&&(d.setProperty("open",s),d.setProperty("close",i)),"D"===a&&(d.arraydef.displaystyle=!0),null!=r&&(d.arraydef.columnalign=r),t.Push(d)},Entry(t,e){t.Push(t.itemFactory.create("cell").setProperties({isEntry:!0,name:e}));const s=t.stack.Top(),i=s.getProperty("casesEnv");if(!s.getProperty("isCases")&&!i)return;const r=t.string;let n=0,o=-1,a=t.i,l=r.length;const c=i?new RegExp(`^\\\\end\\s*\\{${i.replace(/\*/,"\\*")}\\}`):null;for(;a<l;){const e=r.charAt(a);if("{"===e)n++,a++;else if("}"===e)0===n?l=0:(n--,0===n&&o<0&&(o=a-t.i),a++);else{if("&"===e&&0===n)throw new la("ExtraAlignTab","Extra alignment tab in \\cases text");if("\\"===e){const t=r.substring(a);t.match(/^((\\cr)[^a-zA-Z]|\\\\)/)||c&&t.match(c)?l=0:a+=2}else a++}}const h=r.substring(t.i,a);if(!h.match(/^\s*\\text[^a-zA-Z]/)||o!==h.replace(/\s+$/,"").length-1){const e=ya.internalMath(t,na.trimSpaces(h),0);t.PushAll(e),t.i=a}},Cr(t,e){t.Push(t.itemFactory.create("cell").setProperties({isCR:!0,name:e}))},CrLaTeX(t,e,s=!1){let i;if(!s&&("*"===t.string.charAt(t.i)&&t.i++,"["===t.string.charAt(t.i))){const s=t.GetBrackets(e,""),[r,n]=na.matchDimen(s);if(s&&!r)throw new la("BracketMustBeDimension","Bracket argument to %1 must be a dimension",t.currentCS);i=r+n}t.Push(t.itemFactory.create("cell").setProperties({isCR:!0,name:e,linebreak:!0}));const r=t.stack.Top();let n;r instanceof yl?i&&r.addRowSpacing(i):(n=t.create("node","mspace",[],{linebreak:Jo.LineBreak.NEWLINE}),i&&Ko.setAttribute(n,"data-lineleading",i),t.Push(n))},HLine(t,e,s){null==s&&(s="solid");const i=t.stack.Top();if(!(i instanceof yl)||i.Size())throw new la("Misplaced","Misplaced %1",t.currentCS);if(i.table.length){const t=i.arraydef.rowlines?i.arraydef.rowlines.split(/ /):[];for(;t.length<i.table.length;)t.push("none");t[i.table.length-1]=s,i.arraydef.rowlines=t.join(" ")}else i.frame.push(["top",s])},HFill(t,e){const s=t.stack.Top();if(!(s instanceof yl))throw new la("UnsupportedHFill","Unsupported use of %1",t.currentCS);s.hfill.push(s.Size())},NewColumnType(t,e){const s=t.GetArgument(e),i=t.GetBrackets(e,"0"),r=t.GetArgument(e);if(1!==s.length)throw new la("BadColumnName","Column specifier must be exactly one character: %1",s);if(!i.match(/^\d+$/))throw new la("PositiveIntegerArg","Argument to %1 must be a positive integer",i);const n=t.configuration.columnParser;n.columnHandler[s]=t=>n.macroColumn(t,r,parseInt(i)),t.Push(t.itemFactory.create("null"))},BeginEnd(t,e){const s=t.GetArgument(e);if(s.match(/\\/))throw new la("InvalidEnv","Invalid environment name '%1'",s);const i=t.configuration.handlers.get(ia.ENVIRONMENT).lookup(s);if(i&&"\\end"===e){if(!i.args[0]){const e=t.itemFactory.create("end").setProperty("name",s);return void t.Push(e)}t.stack.env.closing=s}ya.checkMaxMacros(t,!1),t.parse(ia.ENVIRONMENT,[t,s])},Array(t,e,s,i,r,n,o,a,l){r||(r=t.GetArgument("\\begin{"+e.getName()+"}"));const c=t.itemFactory.create("array");return"array"===e.getName()&&c.setProperty("arrayPadding",".5em .125em"),c.parser=t,c.arraydef={columnspacing:n||"1em",rowspacing:o||"4pt"},t.configuration.columnParser.process(t,r,c),s&&c.setProperty("open",t.convertDelimiter(s)),i&&c.setProperty("close",t.convertDelimiter(i)),"'"===(a||"").charAt(1)&&(c.arraydef["data-cramped"]=!0,a=a.charAt(0)),"D"===a?c.arraydef.displaystyle=!0:a&&(c.arraydef.displaystyle=!1),c.arraydef.scriptlevel="S"===a?1:0,l&&(c.arraydef.useHeight=!1),t.Push(e),c.StartEntry(),c},AlignedArray(t,e,s=""){const i=t.GetBrackets("\\begin{"+e.getName()+"}"),r=Ll.Array(t,e,null,null,null,null,null,s);return ya.setArrayAlign(r,i)},IndentAlign(t,e){const s=`\\begin{${e.getName()}}`,i=t.GetBrackets(s,""),r=t.GetBrackets(s,""),n=t.GetBrackets(s,"");if(i&&!na.matchDimen(i)[0]||r&&!na.matchDimen(r)[0]||n&&!na.matchDimen(n)[0])throw new la("BracketMustBeDimension","Bracket argument to %1 must be a dimension",s);const o=t.GetArgument(s);if(o&&!o.match(/^([lcr]{1,3})?$/))throw new la("BadAlignment","Alignment must be one to three copies of l, c, or r");const a=[...o].map((t=>({l:"left",c:"center",r:"right"}[t])));1===a.length&&a.push(a[0]);const l={};for(const[t,e]of[["indentshiftfirst",i],["indentshift",r||i],["indentshiftlast",n],["indentalignfirst",a[0]],["indentalign",a[1]],["indentalignlast",a[2]]])e&&(l[t]=e);t.Push(t.itemFactory.create("mstyle",l,e.getName()))},Equation:(t,e,s,i=!0)=>(t.configuration.mathItem.display=i,t.stack.env.display=i,ya.checkEqnEnv(t),t.Push(e),t.itemFactory.create("equation",s).setProperty("name",e.getName())),EqnArray(t,e,s,i,r,n,o){const a=e.getName(),l="gather"===a||"gather*"===a;i&&ya.checkEqnEnv(t,!l),t.Push(e),r=(r=r.replace(/[^clr]/g,"").split("").join(" ")).replace(/l/g,"left").replace(/r/g,"right").replace(/c/g,"center"),n=Tl(n);const c=t.itemFactory.create("eqnarray",a,s,i,t.stack.global);return c.arraydef={displaystyle:!0,columnalign:r,columnspacing:o||"1em",rowspacing:"3pt","data-break-align":n,side:t.options.tagSide,minlabelspacing:t.options.tagIndent},l&&c.setProperty("nestable",!0),c},HandleNoTag(t,e){t.tags.notag()},HandleLabel(t,e){const s=t.GetArgument(e);if(""!==s&&!t.tags.refUpdate){if(t.tags.label)throw new la("MultipleCommand","Multiple %1",t.currentCS);if(t.tags.label=s,(t.tags.allLabels[s]||t.tags.labels[s])&&!t.options.ignoreDuplicateLabels)throw new la("MultipleLabel","Label '%1' multiply defined",s);t.tags.labels[s]=new wa}},HandleRef(t,e,s){const i=t.GetArgument(e);let r=t.tags.allLabels[i]||t.tags.labels[i];r||(t.tags.refUpdate||(t.tags.redo=!0),r=new wa);let n=r.tag;s&&(n=t.tags.formatRef(n));const o=t.create("node","mrow",ya.internalMath(t,Array.isArray(n)?n.join(""):n),{href:t.tags.formatUrl(r.id,t.options.baseURL),class:"MathJax_ref"});t.Push(o)},Macro(t,e,s,i,r){if(i){const n=[];if(null!=r){const s=t.GetBrackets(e);n.push(null==s?r:s)}for(let s=n.length;s<i;s++)n.push(t.GetArgument(e));s=ya.substituteArgs(t,n,s)}t.string=ya.addArgs(t,s,t.string.slice(t.i)),t.i=0,ya.checkMaxMacros(t)},MathChoice(t,e){const s=t.ParseArg(e),i=t.ParseArg(e),r=t.ParseArg(e),n=t.ParseArg(e);t.Push(t.create("node","MathChoice",[s,i,r,n]))}},Il=Ll,Rl=Jo.Variant,Sl={variable(t,e){var s;const i=ya.getFontDef(t),r=t.stack.env;if(r.multiLetterIdentifiers&&""!==r.font&&(e=(null===(s=t.string.substring(t.i-1).match(r.multiLetterIdentifiers))||void 0===s?void 0:s[0])||e,t.i+=e.length-1,i.mathvariant===Rl.NORMAL&&r.noAutoOP&&e.length>1&&(i.autoOP=!1)),!i.mathvariant&&ya.isLatinOrGreekChar(e)){const s=t.configuration.mathStyle(e);s&&(i.mathvariant=s)}const n=t.create("token","mi",i,e);t.Push(n)},digit(t,e){const s=t.configuration.options.numberPattern,i=t.string.slice(t.i-1).match(s);if(!i)return!1;const r=ya.getFontDef(t),n=t.create("token","mn",r,i[0].replace(/[{}]/g,""));return t.i+=i[0].length-1,t.Push(n),!0},controlSequence(t,e){const s=t.GetCS();t.parse(ia.MACRO,[t,s])},lcGreek(t,e){const s={mathvariant:t.configuration.mathStyle(e.char)||Rl.ITALIC},i=t.create("token","mi",s,e.char);t.Push(i)},ucGreek(t,e){const s={mathvariant:t.stack.env.font||t.configuration.mathStyle(e.char,!0)||Rl.NORMAL},i=t.create("token","mi",s,e.char);t.Push(i)},mathchar0mi(t,e){const s=e.attributes||{mathvariant:Rl.ITALIC},i=t.create("token","mi",s,e.char);t.Push(i)},mathchar0mo(t,e){const s=e.attributes||{};s.stretchy=!1;const i=t.create("token","mo",s,e.char);Ko.setProperty(i,"fixStretchy",!0),t.configuration.addNode("fixStretchy",i),t.Push(i)},mathchar7(t,e){const s=e.attributes||{mathvariant:Rl.NORMAL};t.stack.env.font&&(s.mathvariant=t.stack.env.font);const i=t.create("token","mi",s,e.char);t.Push(i)},delimiter(t,e){let s=e.attributes||{};s=Object.assign({fence:!1,stretchy:!1},s);const i=t.create("token","mo",s,e.char);t.Push(i)},environment(t,e,s,i){const r=t.itemFactory.create("begin").setProperty("name",e);t.Push(s(t,r,...i.slice(1)))}},kl=Sl,Ol=No(Eo.thickmathspace),Ml=Jo.Variant;new Ba("letter",kl.variable,/[a-z]/i),new Ba("digit",kl.digit,/[0-9.,]/),new Ba("command",kl.controlSequence,/^\\/),new qa("special",{"{":Il.Open,"}":Il.Close,"~":Il.Tilde,"^":Il.Superscript,_:Il.Subscript,"|":Il.Bar," ":Il.Space,"\t":Il.Space,"\r":Il.Space,"\n":Il.Space,"'":Il.Prime,"%":Il.Comment,"&":Il.Entry,"#":Il.Hash,"\xa0":Il.Space,"\u2019":Il.Prime}),new Ua("lcGreek",kl.lcGreek,{alpha:"\u03b1",beta:"\u03b2",gamma:"\u03b3",delta:"\u03b4",epsilon:"\u03f5",zeta:"\u03b6",eta:"\u03b7",theta:"\u03b8",iota:"\u03b9",kappa:"\u03ba",lambda:"\u03bb",mu:"\u03bc",nu:"\u03bd",xi:"\u03be",omicron:"\u03bf",pi:"\u03c0",rho:"\u03c1",sigma:"\u03c3",tau:"\u03c4",upsilon:"\u03c5",phi:"\u03d5",chi:"\u03c7",psi:"\u03c8",omega:"\u03c9",varepsilon:"\u03b5",vartheta:"\u03d1",varpi:"\u03d6",varrho:"\u03f1",varsigma:"\u03c2",varphi:"\u03c6"}),new Ua("ucGreek",kl.ucGreek,{Gamma:"\u0393",Delta:"\u0394",Theta:"\u0398",Lambda:"\u039b",Xi:"\u039e",Pi:"\u03a0",Sigma:"\u03a3",Upsilon:"\u03a5",Phi:"\u03a6",Psi:"\u03a8",Omega:"\u03a9"}),new Ua("mathchar0mi",kl.mathchar0mi,{AA:"\u212b",S:["\xa7",{mathvariant:Ml.NORMAL}],aleph:["\u2135",{mathvariant:Ml.NORMAL}],hbar:["\u210f",{variantForm:!0}],imath:"\u0131",jmath:"\u0237",ell:"\u2113",wp:["\u2118",{mathvariant:Ml.NORMAL}],Re:["\u211c",{mathvariant:Ml.NORMAL}],Im:["\u2111",{mathvariant:Ml.NORMAL}],partial:["\u2202",{mathvariant:Ml.ITALIC}],infty:["\u221e",{mathvariant:Ml.NORMAL}],prime:["\u2032",{variantForm:!0}],emptyset:["\u2205",{mathvariant:Ml.NORMAL}],nabla:["\u2207",{mathvariant:Ml.NORMAL}],top:["\u22a4",{mathvariant:Ml.NORMAL}],bot:["\u22a5",{mathvariant:Ml.NORMAL}],angle:["\u2220",{mathvariant:Ml.NORMAL}],triangle:["\u25b3",{mathvariant:Ml.NORMAL}],backslash:["\\",{mathvariant:Ml.NORMAL}],forall:["\u2200",{mathvariant:Ml.NORMAL}],exists:["\u2203",{mathvariant:Ml.NORMAL}],neg:["\xac",{mathvariant:Ml.NORMAL}],lnot:["\xac",{mathvariant:Ml.NORMAL}],flat:["\u266d",{mathvariant:Ml.NORMAL}],natural:["\u266e",{mathvariant:Ml.NORMAL}],sharp:["\u266f",{mathvariant:Ml.NORMAL}],clubsuit:["\u2663",{mathvariant:Ml.NORMAL}],diamondsuit:["\u2662",{mathvariant:Ml.NORMAL}],heartsuit:["\u2661",{mathvariant:Ml.NORMAL}],spadesuit:["\u2660",{mathvariant:Ml.NORMAL}]}),new Ua("mathchar0mo",kl.mathchar0mo,{surd:"\u221a",coprod:["\u2210",{movesupsub:!0}],bigvee:["\u22c1",{movesupsub:!0}],bigwedge:["\u22c0",{movesupsub:!0}],biguplus:["\u2a04",{movesupsub:!0}],bigcap:["\u22c2",{movesupsub:!0}],bigcup:["\u22c3",{movesupsub:!0}],int:"\u222b",intop:["\u222b",{movesupsub:!0,movablelimits:!0}],iint:"\u222c",iiint:"\u222d",prod:["\u220f",{movesupsub:!0}],sum:["\u2211",{movesupsub:!0}],bigotimes:["\u2a02",{movesupsub:!0}],bigoplus:["\u2a01",{movesupsub:!0}],bigodot:["\u2a00",{movesupsub:!0}],oint:"\u222e",ointop:["\u222e",{movesupsub:!0,movablelimits:!0}],oiint:"\u222f",oiiint:"\u2230",bigsqcup:["\u2a06",{movesupsub:!0}],smallint:["\u222b",{largeop:!1}],triangleleft:"\u25c3",triangleright:"\u25b9",bigtriangleup:"\u25b3",bigtriangledown:"\u25bd",wedge:"\u2227",land:"\u2227",vee:"\u2228",lor:"\u2228",cap:"\u2229",cup:"\u222a",ddagger:"\u2021",dagger:"\u2020",sqcap:"\u2293",sqcup:"\u2294",uplus:"\u228e",amalg:"\u2a3f",diamond:"\u22c4",bullet:"\u2219",wr:"\u2240",div:"\xf7",odot:["\u2299",{largeop:!1}],oslash:["\u2298",{largeop:!1}],otimes:["\u2297",{largeop:!1}],ominus:["\u2296",{largeop:!1}],oplus:["\u2295",{largeop:!1}],mp:"\u2213",pm:"\xb1",circ:"\u2218",bigcirc:"\u25ef",setminus:"\u2216",cdot:"\u22c5",ast:"\u2217",times:"\xd7",star:"\u22c6",propto:"\u221d",sqsubseteq:"\u2291",sqsupseteq:"\u2292",parallel:"\u2225",mid:"\u2223",dashv:"\u22a3",vdash:"\u22a2",leq:"\u2264",le:"\u2264",geq:"\u2265",ge:"\u2265",lt:"<",gt:">",succ:"\u227b",prec:"\u227a",approx:"\u2248",succeq:"\u2ab0",preceq:"\u2aaf",supset:"\u2283",subset:"\u2282",supseteq:"\u2287",subseteq:"\u2286",in:"\u2208",ni:"\u220b",notin:"\u2209",owns:"\u220b",gg:"\u226b",ll:"\u226a",sim:"\u223c",simeq:"\u2243",perp:"\u27c2",equiv:"\u2261",asymp:"\u224d",smile:"\u2323",frown:"\u2322",ne:"\u2260",neq:"\u2260",cong:"\u2245",doteq:"\u2250",bowtie:"\u22c8",models:"\u22a7",notChar:"\u29f8",Leftrightarrow:"\u21d4",Leftarrow:"\u21d0",Rightarrow:"\u21d2",leftrightarrow:"\u2194",leftarrow:"\u2190",gets:"\u2190",rightarrow:"\u2192",to:["\u2192",{accent:!1}],mapsto:"\u21a6",leftharpoonup:"\u21bc",leftharpoondown:"\u21bd",rightharpoonup:"\u21c0",rightharpoondown:"\u21c1",nearrow:"\u2197",searrow:"\u2198",nwarrow:"\u2196",swarrow:"\u2199",rightleftharpoons:"\u21cc",hookrightarrow:"\u21aa",hookleftarrow:"\u21a9",longleftarrow:"\u27f5",Longleftarrow:"\u27f8",longrightarrow:"\u27f6",Longrightarrow:"\u27f9",Longleftrightarrow:"\u27fa",longleftrightarrow:"\u27f7",longmapsto:"\u27fc",ldots:"\u2026",cdots:"\u22ef",vdots:"\u22ee",ddots:"\u22f1",iddots:"\u22f0",dotsc:"\u2026",dotsb:"\u22ef",dotsm:"\u22ef",dotsi:"\u22ef",dotso:"\u2026",ldotp:[".",{texClass:fr.PUNCT}],cdotp:["\u22c5",{texClass:fr.PUNCT}],colon:[":",{texClass:fr.PUNCT}]}),new Ua("mathchar7",kl.mathchar7,{_:"_","#":"#",$:"$","%":"%","&":"&",And:"&"}),new ja("delimiter",kl.delimiter,{"(":"(",")":")","[":"[","]":"]","<":"\u27e8",">":"\u27e9","\\lt":"\u27e8","\\gt":"\u27e9","/":"/","|":["|",{texClass:fr.ORD}],".":"","\\lmoustache":"\u23b0","\\rmoustache":"\u23b1","\\lgroup":"\u27ee","\\rgroup":"\u27ef","\\arrowvert":"\u23d0","\\Arrowvert":"\u2016","\\bracevert":"\u23aa","\\Vert":["\u2016",{texClass:fr.ORD}],"\\|":["\u2016",{texClass:fr.ORD}],"\\vert":["|",{texClass:fr.ORD}],"\\uparrow":"\u2191","\\downarrow":"\u2193","\\updownarrow":"\u2195","\\Uparrow":"\u21d1","\\Downarrow":"\u21d3","\\Updownarrow":"\u21d5","\\backslash":"\\","\\rangle":"\u27e9","\\langle":"\u27e8","\\rbrace":"}","\\lbrace":"{","\\}":"}","\\{":"{","\\rceil":"\u2309","\\lceil":"\u2308","\\rfloor":"\u230b","\\lfloor":"\u230a","\\lbrack":"[","\\rbrack":"]"}),new Ha("macros",{displaystyle:[Il.SetStyle,"D",!0,0],textstyle:[Il.SetStyle,"T",!1,0],scriptstyle:[Il.SetStyle,"S",!1,1],scriptscriptstyle:[Il.SetStyle,"SS",!1,2],rm:[Il.SetFont,Ml.NORMAL],mit:[Il.SetFont,Ml.ITALIC],oldstyle:[Il.SetFont,Ml.OLDSTYLE],cal:[Il.SetFont,Ml.CALLIGRAPHIC],it:[Il.SetFont,Ml.MATHITALIC],bf:[Il.SetFont,Ml.BOLD],sf:[Il.SetFont,Ml.SANSSERIF],tt:[Il.SetFont,Ml.MONOSPACE],frak:[Il.MathFont,Ml.FRAKTUR],Bbb:[Il.MathFont,Ml.DOUBLESTRUCK],mathrm:[Il.MathFont,Ml.NORMAL],mathup:[Il.MathFont,Ml.NORMAL],mathnormal:[Il.MathFont,""],mathbf:[Il.MathFont,Ml.BOLD],mathbfup:[Il.MathFont,Ml.BOLD],mathit:[Il.MathFont,Ml.MATHITALIC],mathbfit:[Il.MathFont,Ml.BOLDITALIC],mathbb:[Il.MathFont,Ml.DOUBLESTRUCK],mathfrak:[Il.MathFont,Ml.FRAKTUR],mathbffrak:[Il.MathFont,Ml.BOLDFRAKTUR],mathscr:[Il.MathFont,Ml.SCRIPT],mathbfscr:[Il.MathFont,Ml.BOLDSCRIPT],mathsf:[Il.MathFont,Ml.SANSSERIF],mathsfup:[Il.MathFont,Ml.SANSSERIF],mathbfsf:[Il.MathFont,Ml.BOLDSANSSERIF],mathbfsfup:[Il.MathFont,Ml.BOLDSANSSERIF],mathsfit:[Il.MathFont,Ml.SANSSERIFITALIC],mathbfsfit:[Il.MathFont,Ml.SANSSERIFBOLDITALIC],mathtt:[Il.MathFont,Ml.MONOSPACE],mathcal:[Il.MathFont,Ml.CALLIGRAPHIC],mathbfcal:[Il.MathFont,Ml.BOLDCALLIGRAPHIC],symrm:[Il.MathFont,Ml.NORMAL],symup:[Il.MathFont,Ml.NORMAL],symnormal:[Il.MathFont,""],symbf:[Il.MathFont,Ml.BOLD,Ml.BOLDITALIC],symbfup:[Il.MathFont,Ml.BOLD],symit:[Il.MathFont,Ml.ITALIC],symbfit:[Il.MathFont,Ml.BOLDITALIC],symbb:[Il.MathFont,Ml.DOUBLESTRUCK],symfrak:[Il.MathFont,Ml.FRAKTUR],symbffrak:[Il.MathFont,Ml.BOLDFRAKTUR],symscr:[Il.MathFont,Ml.SCRIPT],symbfscr:[Il.MathFont,Ml.BOLDSCRIPT],symsf:[Il.MathFont,Ml.SANSSERIF,Ml.SANSSERIFITALIC],symsfup:[Il.MathFont,Ml.SANSSERIF],symbfsf:[Il.MathFont,Ml.BOLDSANSSERIF],symbfsfup:[Il.MathFont,Ml.BOLDSANSSERIF],symsfit:[Il.MathFont,Ml.SANSSERIFITALIC],symbfsfit:[Il.MathFont,Ml.SANSSERIFBOLDITALIC],symtt:[Il.MathFont,Ml.MONOSPACE],symcal:[Il.MathFont,Ml.CALLIGRAPHIC],symbfcal:[Il.MathFont,Ml.BOLDCALLIGRAPHIC],textrm:[Il.HBox,null,Ml.NORMAL],textup:[Il.HBox,null,Ml.NORMAL],textnormal:[Il.HBox],textit:[Il.HBox,null,Ml.ITALIC],textbf:[Il.HBox,null,Ml.BOLD],textsf:[Il.HBox,null,Ml.SANSSERIF],texttt:[Il.HBox,null,Ml.MONOSPACE],tiny:[Il.SetSize,.5],Tiny:[Il.SetSize,.6],scriptsize:[Il.SetSize,.7],small:[Il.SetSize,.85],normalsize:[Il.SetSize,1],large:[Il.SetSize,1.2],Large:[Il.SetSize,1.44],LARGE:[Il.SetSize,1.73],huge:[Il.SetSize,2.07],Huge:[Il.SetSize,2.49],arcsin:Il.NamedFn,arccos:Il.NamedFn,arctan:Il.NamedFn,arg:Il.NamedFn,cos:Il.NamedFn,cosh:Il.NamedFn,cot:Il.NamedFn,coth:Il.NamedFn,csc:Il.NamedFn,deg:Il.NamedFn,det:Il.NamedOp,dim:Il.NamedFn,exp:Il.NamedFn,gcd:Il.NamedOp,hom:Il.NamedFn,inf:Il.NamedOp,ker:Il.NamedFn,lg:Il.NamedFn,lim:Il.NamedOp,liminf:[Il.NamedOp,"lim inf"],limsup:[Il.NamedOp,"lim sup"],ln:Il.NamedFn,log:Il.NamedFn,max:Il.NamedOp,min:Il.NamedOp,Pr:Il.NamedOp,sec:Il.NamedFn,sin:Il.NamedFn,sinh:Il.NamedFn,sup:Il.NamedOp,tan:Il.NamedFn,tanh:Il.NamedFn,limits:[Il.Limits,!0],nolimits:[Il.Limits,!1],overline:[Il.UnderOver,"2015"],underline:[Il.UnderOver,"2015"],overbrace:[Il.UnderOver,"23DE",!0],underbrace:[Il.UnderOver,"23DF",!0],overparen:[Il.UnderOver,"23DC"],underparen:[Il.UnderOver,"23DD"],overrightarrow:[Il.UnderOver,"2192"],underrightarrow:[Il.UnderOver,"2192"],overleftarrow:[Il.UnderOver,"2190"],underleftarrow:[Il.UnderOver,"2190"],overleftrightarrow:[Il.UnderOver,"2194"],underleftrightarrow:[Il.UnderOver,"2194"],overset:Il.Overset,underset:Il.Underset,overunderset:Il.Overunderset,stackrel:[Il.Macro,"\\mathrel{\\mathop{#2}\\limits^{#1}}",2],stackbin:[Il.Macro,"\\mathbin{\\mathop{#2}\\limits^{#1}}",2],over:Il.Over,overwithdelims:Il.Over,atop:Il.Over,atopwithdelims:Il.Over,above:Il.Over,abovewithdelims:Il.Over,brace:[Il.Over,"{","}"],brack:[Il.Over,"[","]"],choose:[Il.Over,"(",")"],frac:Il.Frac,sqrt:Il.Sqrt,root:Il.Root,uproot:[Il.MoveRoot,"upRoot"],leftroot:[Il.MoveRoot,"leftRoot"],left:Il.LeftRight,right:Il.LeftRight,middle:Il.LeftRight,llap:Il.Lap,rlap:Il.Lap,raise:Il.RaiseLower,lower:Il.RaiseLower,moveleft:Il.MoveLeftRight,moveright:Il.MoveLeftRight,",":[Il.Spacer,Eo.thinmathspace],":":[Il.Spacer,Eo.mediummathspace],">":[Il.Spacer,Eo.mediummathspace],";":[Il.Spacer,Eo.thickmathspace],"!":[Il.Spacer,Eo.negativethinmathspace],enspace:[Il.Spacer,.5],quad:[Il.Spacer,1],qquad:[Il.Spacer,2],thinspace:[Il.Spacer,Eo.thinmathspace],negthinspace:[Il.Spacer,Eo.negativethinmathspace],"*":Il.DiscretionaryTimes,allowbreak:Il.AllowBreak,goodbreak:[Il.Linebreak,Jo.LineBreak.GOODBREAK],badbreak:[Il.Linebreak,Jo.LineBreak.BADBREAK],nobreak:[Il.Linebreak,Jo.LineBreak.NOBREAK],break:Il.Break,hskip:Il.Hskip,hspace:Il.Hskip,kern:[Il.Hskip,!0],mskip:Il.Hskip,mspace:Il.Hskip,mkern:[Il.Hskip,!0],rule:Il.rule,Rule:[Il.Rule],Space:[Il.Rule,"blank"],nonscript:Il.Nonscript,big:[Il.MakeBig,fr.ORD,.85],Big:[Il.MakeBig,fr.ORD,1.15],bigg:[Il.MakeBig,fr.ORD,1.45],Bigg:[Il.MakeBig,fr.ORD,1.75],bigl:[Il.MakeBig,fr.OPEN,.85],Bigl:[Il.MakeBig,fr.OPEN,1.15],biggl:[Il.MakeBig,fr.OPEN,1.45],Biggl:[Il.MakeBig,fr.OPEN,1.75],bigr:[Il.MakeBig,fr.CLOSE,.85],Bigr:[Il.MakeBig,fr.CLOSE,1.15],biggr:[Il.MakeBig,fr.CLOSE,1.45],Biggr:[Il.MakeBig,fr.CLOSE,1.75],bigm:[Il.MakeBig,fr.REL,.85],Bigm:[Il.MakeBig,fr.REL,1.15],biggm:[Il.MakeBig,fr.REL,1.45],Biggm:[Il.MakeBig,fr.REL,1.75],mathord:[Il.TeXAtom,fr.ORD],mathop:[Il.TeXAtom,fr.OP],mathopen:[Il.TeXAtom,fr.OPEN],mathclose:[Il.TeXAtom,fr.CLOSE],mathbin:[Il.TeXAtom,fr.BIN],mathrel:[Il.TeXAtom,fr.REL],mathpunct:[Il.TeXAtom,fr.PUNCT],mathinner:[Il.TeXAtom,fr.INNER],vtop:[Il.VBox,"top"],vcenter:[Il.VBox,"center"],vbox:[Il.VBox,"bottom"],hsize:Il.Hsize,parbox:Il.ParBox,breakAlign:Il.BreakAlign,buildrel:Il.BuildRel,hbox:[Il.HBox,0],text:Il.HBox,mbox:[Il.HBox,0],fbox:Il.FBox,boxed:[Il.Macro,"\\fbox{$\\displaystyle{#1}$}",1],framebox:Il.FrameBox,makebox:Il.MakeBox,strut:Il.Strut,mathstrut:[Il.Macro,"\\vphantom{(}"],phantom:Il.Phantom,vphantom:[Il.Phantom,1,0],hphantom:[Il.Phantom,0,1],smash:Il.Smash,acute:[Il.Accent,"00B4"],grave:[Il.Accent,"0060"],ddot:[Il.Accent,"00A8"],dddot:[Il.Accent,"20DB"],ddddot:[Il.Accent,"20DC"],tilde:[Il.Accent,"007E"],bar:[Il.Accent,"00AF"],breve:[Il.Accent,"02D8"],check:[Il.Accent,"02C7"],hat:[Il.Accent,"005E"],vec:[Il.Accent,"2192",!1],dot:[Il.Accent,"02D9"],widetilde:[Il.Accent,"007E",!0],widehat:[Il.Accent,"005E",!0],matrix:Il.Matrix,array:Il.Matrix,pmatrix:[Il.Matrix,"(",")"],cases:[Il.Matrix,"{","","left left",null,".2em",null,!0],eqalign:[Il.Matrix,null,null,"right left",Ol,".5em","D"],displaylines:[Il.Matrix,null,null,"center",null,".5em","D"],cr:Il.Cr,"\\":Il.CrLaTeX,newline:[Il.CrLaTeX,!0],hline:Il.HLine,hdashline:[Il.HLine,"dashed"],eqalignno:[Il.Matrix,null,null,"right left",Ol,".5em","D",null,"right"],leqalignno:[Il.Matrix,null,null,"right left",Ol,".5em","D",null,"left"],hfill:Il.HFill,hfil:Il.HFill,hfilll:Il.HFill,bmod:[Il.Macro,`\\mmlToken{mo}[lspace="${Ol}" rspace="${Ol}"]{mod}`],pmod:[Il.Macro,"\\pod{\\mmlToken{mi}{mod}\\kern 6mu #1}",1],mod:[Il.Macro,"\\mathchoice{\\kern18mu}{\\kern12mu}{\\kern12mu}{\\kern12mu}\\mmlToken{mi}{mod}\\,\\,#1",1],pod:[Il.Macro,"\\mathchoice{\\kern18mu}{\\kern8mu}{\\kern8mu}{\\kern8mu}(#1)",1],iff:[Il.Macro,"\\;\\Longleftrightarrow\\;"],skew:[Il.Macro,"{{#2{#3\\mkern#1mu}\\mkern-#1mu}{}}",3],pmb:[Il.Macro,"\\rlap{#1}\\kern1px{#1}",1],TeX:[Il.Macro,"T\\kern-.14em\\lower.5ex{E}\\kern-.115em X"],LaTeX:[Il.Macro,"L\\kern-.325em\\raise.21em{\\scriptstyle{A}}\\kern-.17em\\TeX"],not:Il.Not,dots:Il.Dots,space:Il.Tilde,"\xa0":Il.Tilde," ":Il.Tilde,begin:Il.BeginEnd,end:Il.BeginEnd,label:Il.HandleLabel,ref:Il.HandleRef,nonumber:Il.HandleNoTag,newcolumntype:Il.NewColumnType,mathchoice:Il.MathChoice,mmlToken:Il.MmlToken}),new Wa("environment",kl.environment,{displaymath:[Il.Equation,null,!1],math:[Il.Equation,null,!1,!1],array:[Il.AlignedArray],darray:[Il.AlignedArray,null,"D"],equation:[Il.Equation,null,!0],eqnarray:[Il.EqnArray,null,!0,!0,"rcl","bmt",ya.cols(0,Eo.thickmathspace),".5em"],indentalign:[Il.IndentAlign]}),new Ua("not_remap",null,{"\u2190":"\u219a","\u2192":"\u219b","\u2194":"\u21ae","\u21d0":"\u21cd","\u21d2":"\u21cf","\u21d4":"\u21ce","\u2208":"\u2209","\u220b":"\u220c","\u2223":"\u2224","\u2225":"\u2226","\u223c":"\u2241","~":"\u2241","\u2243":"\u2244","\u2245":"\u2247","\u2248":"\u2249","\u224d":"\u226d","=":"\u2260","\u2261":"\u2262","<":"\u226e",">":"\u226f","\u2264":"\u2270","\u2265":"\u2271","\u2272":"\u2274","\u2273":"\u2275","\u2276":"\u2278","\u2277":"\u2279","\u227a":"\u2280","\u227b":"\u2281","\u2282":"\u2284","\u2283":"\u2285","\u2286":"\u2288","\u2287":"\u2289","\u22a2":"\u22ac","\u22a8":"\u22ad","\u22a9":"\u22ae","\u22ab":"\u22af","\u227c":"\u22e0","\u227d":"\u22e1","\u2291":"\u22e2","\u2292":"\u22e3","\u22b2":"\u22ea","\u22b3":"\u22eb","\u22b4":"\u22ec","\u22b5":"\u22ed","\u2203":"\u2204"});const Dl=Jo.Variant;function Pl(t,e){const s=t.stack.env.font,i=t.stack.env.italicFont,r=s?{mathvariant:s}:{},n=Ga.getMap("remap").lookup(e),o=Dr(e),a=o[3],l=t.create("token",a,r,n?n.char:e),c=ya.isLatinOrGreekChar(e)?t.configuration.mathStyle(e,!0)||i:"",h=o[4]||(s&&c===Dl.NORMAL?"":c);h&&l.attributes.set("mathvariant",h),"mo"===a&&(Ko.setProperty(l,"fixStretchy",!0),t.configuration.addNode("fixStretchy",l)),t.Push(l)}new Ua("remap",null,{"-":"\u2212","*":"\u2217","`":"\u2018"});class Bl extends Ca{}const Fl=Ka.create("base",{[sa.CONFIG]:function(t,e){const s=e.parseOptions.options;s.digits&&(s.numberPattern=s.digits),new Ba("digit",kl.digit,s.initialDigit),new Ba("letter",kl.variable,s.initialLetter);t.handlers.get(ia.CHARACTER).add(["letter","digit"],null,4)},[sa.HANDLER]:{[ia.CHARACTER]:["command","special"],[ia.DELIMITER]:["delimiter"],[ia.MACRO]:["delimiter","macros","lcGreek","ucGreek","mathchar0mi","mathchar0mo","mathchar7"],[ia.ENVIRONMENT]:["environment"]},[sa.FALLBACK]:{[ia.CHARACTER]:Pl,[ia.MACRO]:function(t,e){throw new la("UndefinedControlSequence","Undefined control sequence %1","\\"+e)},[ia.ENVIRONMENT]:function(t,e){throw new la("UnknownEnv","Unknown environment '%1'",e)}},[sa.ITEMS]:{[Qa.prototype.kind]:Qa,[Za.prototype.kind]:Za,[tl.prototype.kind]:tl,[el.prototype.kind]:el,[sl.prototype.kind]:sl,[il.prototype.kind]:il,[rl.prototype.kind]:rl,[nl.prototype.kind]:nl,[ol.prototype.kind]:ol,[al.prototype.kind]:al,[ll.prototype.kind]:ll,[cl.prototype.kind]:cl,[hl.prototype.kind]:hl,[dl.prototype.kind]:dl,[ul.prototype.kind]:ul,[pl.prototype.kind]:pl,[ml.prototype.kind]:ml,[gl.prototype.kind]:gl,[fl.prototype.kind]:fl,[bl.prototype.kind]:bl,[El.prototype.kind]:El,[xl.prototype.kind]:xl,[yl.prototype.kind]:yl,[Nl.prototype.kind]:Nl,[vl.prototype.kind]:vl,[Al.prototype.kind]:Al},[sa.OPTIONS]:{maxMacros:1e3,digits:"",numberPattern:/^(?:[0-9]+(?:\{,\}[0-9]{3})*(?:\.[0-9]*)?|\.[0-9]+)/,initialDigit:/[0-9.,]/,identifierPattern:/^[a-zA-Z]+/,initialLetter:/[a-zA-Z]/,baseURL:mi.document&&0!==mi.document.getElementsByTagName("base").length?String(mi.document.location).replace(/#.*$/,""):""},[sa.TAGS]:{base:Bl},[sa.POSTPROCESSORS]:[[function({data:t}){for(const e of t.getList("nonscript"))if(e.attributes.get("scriptlevel")>0){const s=e.parent;if(s.childNodes.splice(s.childIndex(e),1),t.removeFromList(e.kind,[e]),e.isKind("mrow")){const s=e.childNodes[0];t.removeFromList("mstyle",[s]),t.removeFromList("mspace",s.childNodes[0].childNodes)}}else e.isKind("mrow")&&(e.parent.replaceChild(e.childNodes[0],e),t.removeFromList("mrow",[e]))},-4]]});class Ul extends tr{static configure(t){const e=new Ya(t,["tex"]);return e.init(),e}static tags(t,e){ka.addTags(e.tags),ka.setDefault(t.options.tags),t.tags=ka.getDefault(),t.tags.configuration=t}constructor(t={}){const[e,s,i]=qi(t,Ul.OPTIONS,Xo.OPTIONS);super(s),this.findTeX=this.options.FindTeX||new Xo(i);const r=this.options.packages,n=this.configuration=Ul.configure(r),o=this._parseOptions=new _a(n,[this.options,ka.OPTIONS]);Fi(o.options,e),n.config(this),Ul.tags(o,n),this.postFilters.addList([[ea.cleanSubSup,-7],[ea.setInherited,-6],[ea.checkScriptlevel,-5],[ea.moveLimits,-4],[ea.cleanStretchy,-3],[ea.cleanAttributes,-2],[ea.combineRelations,-1]])}setMmlFactory(t){super.setMmlFactory(t),this._parseOptions.nodeFactory.setMmlFactory(t)}get parseOptions(){return this._parseOptions}reset(t=0){this.parseOptions.tags.reset(t)}compile(t,e){let s,i;this.parseOptions.clear(),this.parseOptions.mathItem=t,this.executeFilters(this.preFilters,t,e,this.parseOptions),this.latex=t.math,this.parseOptions.tags.startEquation(t);try{i=new da(this.latex,{display:t.display,isInner:!1},this.parseOptions),s=i.mml()}catch(t){if(!(t instanceof la))throw t;this.parseOptions.error=!0,s=this.options.formatError(this,t)}return s=this.parseOptions.nodeFactory.create("node","math",[s]),s.attributes.set(Jo.Attr.LATEX,this.latex),t.display&&Ko.setAttribute(s,"display","block"),this.parseOptions.tags.finishEquation(t),this.parseOptions.root=s,this.executeFilters(this.postFilters,t,e,this.parseOptions),i&&i.stack.env.hsize&&(Ko.setAttribute(s,"maxwidth",i.stack.env.hsize),Ko.setAttribute(s,"overflow","linebreak")),this.mathNode=this.parseOptions.root,this.mathNode}findMath(t){return this.findTeX.findMath(t)}formatError(t){const e=t.message.replace(/\n.*/,"");return this.parseOptions.nodeFactory.create("error",e,t.id,this.latex)}}Ul.NAME="TeX",Ul.OPTIONS=Object.assign(Object.assign({},tr.OPTIONS),{FindTeX:null,packages:["base"],maxBuffer:5120,maxTemplateSubtitutions:1e4,mathStyle:"TeX",formatError:(t,e)=>t.formatError(e)});class jl extends yl{constructor(t,...e){super(t),this.factory.configuration.tags.start("multline",!0,e[0])}get kind(){return"multline"}EndEntry(){this.table.length&&ya.fixInitialMO(this.factory.configuration,this.nodes);const t=this.getProperty("shove"),e=this.create("node","mtd",this.nodes,t?{columnalign:t}:{});this.setProperty("shove",null),this.row.push(e),this.Clear()}EndRow(){if(1!==this.row.length)throw new la("MultlineRowsOneCol","The rows within the %1 environment must have exactly one column","multline");const t=this.create("node","mtr",this.row);this.table.push(t),this.row=[]}EndTable(){if(super.EndTable(),this.table.length){const t=this.table.length-1;let e=-1;Ko.getAttribute(Ko.getChildren(this.table[0])[0],"columnalign")||Ko.setAttribute(Ko.getChildren(this.table[0])[0],"columnalign",Jo.Align.LEFT),Ko.getAttribute(Ko.getChildren(this.table[t])[0],"columnalign")||Ko.setAttribute(Ko.getChildren(this.table[t])[0],"columnalign",Jo.Align.RIGHT);const s=this.factory.configuration.tags.getTag();if(s){e=this.arraydef.side===Jo.Align.LEFT?0:this.table.length-1;const t=this.table[e],i=this.create("node","mlabeledtr",[s].concat(Ko.getChildren(t)));Ko.copyAttributes(t,i),this.table[e]=i}}this.factory.configuration.tags.end()}}class ql extends Nl{get kind(){return"flalign"}constructor(t,e,s,i,r){super(t),this.name=e,this.numbered=s,this.padded=i,this.center=r,this.factory.configuration.tags.start(e,s,s)}EndEntry(){super.EndEntry();const t=this.getProperty("xalignat");if(t&&this.row.length>t)throw new la("XalignOverflow","Extra %1 in row of %2","&",this.name)}EndRow(){let t;const e=this.row,s=this.getProperty("xalignat");for(;e.length<s;)e.push(this.create("node","mtd"));for(this.row=[],this.padded&&this.row.push(this.create("node","mtd"));t=e.shift();)this.row.push(t),t=e.shift(),t&&this.row.push(t),(e.length||this.padded)&&this.row.push(this.create("node","mtd"));this.row.length>this.maxrow&&(this.maxrow=this.row.length),super.EndRow();const i=this.table[this.table.length-1];if(this.getProperty("zeroWidthLabel")&&i.isKind("mlabeledtr")){const t=Ko.getChildren(i)[0],e=this.factory.configuration.options.tagSide,s=Object.assign({width:0},"right"===e?{lspace:"-1width"}:{}),r=this.create("node","mpadded",Ko.getChildren(t),s);t.setChildren([r])}}EndTable(){if(super.EndTable(),this.center&&this.maxrow<=2){delete this.arraydef.width,delete this.global.indentalign}}}var Hl;!function(t){t.NEW_DELIMITER="new-Delimiter",t.NEW_COMMAND="new-Command",t.NEW_ENVIRONMENT="new-Environment"}(Hl||(Hl={}));const Wl=-100,Vl={GetCSname(t,e){if("\\"!==t.GetNext())throw new la("MissingCS","%1 must be followed by a control sequence",e);const s=na.trimSpaces(t.GetArgument(e)).substring(1);return this.checkProtectedMacros(t,s),s},GetCsNameArgument(t,e){let s=na.trimSpaces(t.GetArgument(e));if("\\"===s.charAt(0)&&(s=s.substring(1)),!s.match(/^(.|[a-z]+)$/i))throw new la("IllegalControlSequenceName","Illegal control sequence name for %1",e);return this.checkProtectedMacros(t,s),s},GetArgCount(t,e){let s=t.GetBrackets(e);if(s&&(s=na.trimSpaces(s),!s.match(/^[0-9]+$/)))throw new la("IllegalParamNumber","Illegal number of parameters specified in %1",e);return s},GetTemplate(t,e,s){let i=t.GetNext();const r=[];let n=0,o=t.i;for(;t.i<t.string.length;){if(i=t.GetNext(),"#"===i){if(o!==t.i&&(r[n]=t.string.substring(o,t.i)),i=t.string.charAt(++t.i),!i.match(/^[1-9]$/))throw new la("CantUseHash2","Illegal use of # in template for %1",s);if(parseInt(i)!==++n)throw new la("SequentialParam","Parameters for %1 must be numbered sequentially",s);o=t.i+1}else if("{"===i)return o!==t.i&&(r[n]=t.string.substring(o,t.i)),r.length>0?[n.toString()].concat(r):n;t.i++}throw new la("MissingReplacementString","Missing replacement string for definition of %1",e)},GetParameter(t,e,s){if(null==s)return t.GetArgument(e);let i=t.i,r=0,n=!1;for(;t.i<t.string.length;){const o=t.string.charAt(t.i);if("{"===o)n=t.i===i,t.GetArgument(e),r=t.i-i;else{if(this.MatchParam(t,s))return n&&(i++,r-=2),t.string.substring(i,i+r);if("\\"===o){t.i++,r++,n=!1;const e=t.string.substring(t.i).match(/[a-z]+|./i);e&&(t.i+=e[0].length,r=t.i-i)}else t.i++,r++,n=!1}}throw new la("RunawayArgument","Runaway argument for %1?",e)},MatchParam:(t,e)=>t.string.substring(t.i,t.i+e.length)!==e||e.match(/\\[a-z]+$/i)&&t.string.charAt(t.i+e.length).match(/[a-z]/i)?0:(t.i+=e.length,1),checkGlobal:(t,e,s)=>t.stack.env.isGlobal?t.configuration.packageData.get("begingroup").stack.checkGlobal(e,s):s.map((e=>t.configuration.handlers.retrieve(e))),checkProtectedMacros(t,e){var s;if(null===(s=t.options.protectedMacros)||void 0===s?void 0:s.includes(e))throw new la("ProtectedMacro","The control sequence %1 can't be redefined",`\\${e}`)},addDelimiter(t,e,s,i){const r=e.substring(1);this.checkProtectedMacros(t,r);const[n,o]=Vl.checkGlobal(t,[r,e],[Hl.NEW_COMMAND,Hl.NEW_DELIMITER]);r!==e&&n.remove(r),o.add(e,new Oa(e,s,i)),delete t.stack.env.isGlobal},addMacro(t,e,s,i,r=""){this.checkProtectedMacros(t,e);const n=Vl.checkGlobal(t,[e],[Hl.NEW_COMMAND])[0];this.undefineDelimiter(t,"\\"+e),n.add(e,new Ma(r||e,s,i)),delete t.stack.env.isGlobal},addEnvironment(t,e,s,i){Vl.checkGlobal(t,[e],[Hl.NEW_ENVIRONMENT])[0].add(e,new Ma(e,s,i)),delete t.stack.env.isGlobal},undefineMacro(t,e){const s=Vl.checkGlobal(t,[e],[Hl.NEW_COMMAND])[0];s.remove(e),t.configuration.handlers.get(ia.MACRO).applicable(e)&&(s.add(e,new Ma(e,(()=>Xa.FALLBACK),[])),this.undefineDelimiter(t,"\\"+e)),delete t.stack.env.isGlobal},undefineDelimiter(t,e){const s=Vl.checkGlobal(t,[e],[Hl.NEW_DELIMITER])[0];s.remove(e),t.configuration.handlers.get(ia.DELIMITER).applicable(e)&&s.add(e,new Oa(e,null,{})),delete t.stack.env.isGlobal}};function Gl(t){if(!t||t.isInferred&&0===t.childNodes.length)return[null,null];if(t.isKind("msubsup")&&Xl(t))return[t,null];const e=Ko.getChildAt(t,0);return t.isInferred&&e&&Xl(e)?(t.childNodes.splice(0,1),[e,t]):[null,t]}function Xl(t){const e=t.childNodes[0];return e&&e.isKind("mi")&&""===e.getText()}const zl={AmsEqnArray(t,e,s,i,r,n,o,a){const l=t.GetBrackets("\\begin{"+e.getName()+"}"),c=Il.EqnArray(t,e,s,i,r,n,o,a);return ya.setArrayAlign(c,l,t)},AlignAt(t,e,s,i){const r=e.getName();let n,o="",a="";const l=[];i||(n=t.GetBrackets("\\begin{"+r+"}"));const c=t.GetArgument("\\begin{"+r+"}");if(c.match(/[^0-9]/))throw new la("PositiveIntegerArg","Argument to %1 must be a positive integer","\\begin{"+r+"}");let h=parseInt(c,10);for(;h>0;)o+="rl",a+="bt",l.push("0em 0em"),h--;const d=l.join(" ");if(i)return zl.EqnArray(t,e,s,i,o,a,d);const u=zl.EqnArray(t,e,s,i,o,a,d);return ya.setArrayAlign(u,n,t)},Multline(t,e,s){ya.checkEqnEnv(t),t.Push(e);const i=t.options.ams.multlineIndent,r=t.itemFactory.create("multline",s,t.stack);return r.arraydef={displaystyle:!0,rowspacing:".5em",columnspacing:"100%",width:t.options.ams.multlineWidth,side:t.options.tagSide,minlabelspacing:t.options.tagIndent,"data-array-padding":`${i} ${i}`,"data-width-includes-label":!0},r},XalignAt(t,e,s,i){const r=t.GetArgument("\\begin{"+e.getName()+"}");if(r.match(/[^0-9]/))throw new la("PositiveIntegerArg","Argument to %1 must be a positive integer","\\begin{"+e.getName()+"}");const n=i?"crl":"rlc",o=i?"mbt":"btm",a=i?"fit auto auto":"auto auto fit",l=zl.FlalignArray(t,e,s,i,!1,n,o,a,!0);return l.setProperty("xalignat",2*parseInt(r)),l},FlalignArray(t,e,s,i,r,n,o,a,l=!1){ya.checkEqnEnv(t),t.Push(e),n=n.split("").join(" ").replace(/r/g,"right").replace(/l/g,"left").replace(/c/g,"center"),o=Tl(o);const c=t.itemFactory.create("flalign",e.getName(),s,i,r,t.stack);return c.arraydef={width:"100%",displaystyle:!0,columnalign:n,columnspacing:"0em",columnwidth:a,rowspacing:"3pt","data-break-align":o,side:t.options.tagSide,minlabelspacing:l?"0":t.options.tagIndent,"data-width-includes-label":!0},c.setProperty("zeroWidthLabel",l),c},HandleDeclareOp(t,e){const s=t.GetStar()?"*":"",i=Vl.GetCsNameArgument(t,e),r=t.GetArgument(e);Vl.addMacro(t,i,zl.Macro,[`\\operatorname${s}{${r}}`]),t.Push(t.itemFactory.create("null"))},HandleOperatorName(t,e){const s=t.GetStar(),i=na.trimSpaces(t.GetArgument(e));let r=new da(i,Object.assign(Object.assign({},t.stack.env),{font:Jo.Variant.NORMAL,multiLetterIdentifiers:t.options.ams.operatornamePattern,operatorLetters:!0,noAutoOP:!0}),t.configuration).mml();if(r.isKind("mi")?r.removeProperty("autoOP"):r=t.create("node","TeXAtom",[r]),Ko.setProperties(r,{movesupsub:s,movablelimits:!0,texClass:fr.OP}),!s){const e=t.GetNext(),s=t.i;"\\"===e&&++t.i&&"limits"!==t.GetCS()&&(t.i=s)}t.Push(t.itemFactory.create("fn",r))},SideSet(t,e){const[s,i]=Gl(t.ParseArg(e)),[r,n]=Gl(t.ParseArg(e)),o=t.ParseArg(e);let a=o;s&&(i?s.replaceChild(t.create("node","mphantom",[t.create("node","mpadded",[ya.copyNode(o,t)],{width:0})]),Ko.getChildAt(s,0)):(a=t.create("node","mmultiscripts",[o]),r&&Ko.appendChildren(a,[Ko.getChildAt(r,1)||t.create("node","none"),Ko.getChildAt(r,2)||t.create("node","none")]),Ko.setProperty(a,"scriptalign","left"),Ko.appendChildren(a,[t.create("node","mprescripts"),Ko.getChildAt(s,1)||t.create("node","none"),Ko.getChildAt(s,2)||t.create("node","none")]))),r&&a===o&&(r.replaceChild(o,Ko.getChildAt(r,0)),a=r);const l=t.create("node","TeXAtom",[],{texClass:fr.OP,movesupsub:!0,movablelimits:!0});i&&(s&&l.appendChild(s),l.appendChild(i)),l.appendChild(a),n&&l.appendChild(n),t.Push(l)},operatorLetter:(t,e)=>!!t.stack.env.operatorLetters&&kl.variable(t,e),MultiIntegral(t,e,s){let i=t.GetNext();if("\\"===i){const r=t.i;i=t.GetArgument(e),t.i=r,"\\limits"===i&&(s="\\!\\!\\mathop{\\,\\,"+s+"}")}t.string=s+" "+t.string.slice(t.i),t.i=0},xArrow(t,e,s,i,r,n=0){const o={width:"+"+na.em((i+r)/18),lspace:na.em(i/18)},a=t.GetBrackets(e),l=t.ParseArg(e),c=t.create("node","mspace",[],{depth:".2em"});let h=t.create("token","mo",{stretchy:!0,texClass:fr.ORD},String.fromCodePoint(s));n&&h.attributes.set("minsize",na.em(n)),h=t.create("node","mstyle",[h],{scriptlevel:0});const d=t.create("node","munderover",[h]);let u=t.create("node","mpadded",[l,c],o);if(Ko.setAttribute(u,"voffset","-.2em"),Ko.setAttribute(u,"height","-.2em"),Ko.setChild(d,d.over,u),a){const e=new da(a,t.stack.env,t.configuration).mml(),s=t.create("node","mspace",[],{height:".75em"});u=t.create("node","mpadded",[e,s],o),Ko.setAttribute(u,"voffset",".15em"),Ko.setAttribute(u,"depth","-.15em"),Ko.setChild(d,d.under,u)}Ko.setProperty(d,"subsupOK",!0),t.Push(t.create("node","TeXAtom",[t.create("node","TeXAtom",[],{texClass:fr.NONE}),d],{texClass:fr.REL}))},HandleShove(t,e,s){const i=t.stack.Top();if("multline"!==i.kind)throw new la("CommandOnlyAllowedInEnv","%1 only allowed in %2 environment",t.currentCS,"multline");if(i.Size())throw new la("CommandAtTheBeginingOfLine","%1 must come at the beginning of the line",t.currentCS);i.setProperty("shove",s)},CFrac(t,e){let s=na.trimSpaces(t.GetBrackets(e,""));const i=t.GetArgument(e),r=t.GetArgument(e),n={l:Jo.Align.LEFT,r:Jo.Align.RIGHT,"":""},o=new da("\\strut\\textstyle{"+i+"}",t.stack.env,t.configuration).mml(),a=new da("\\strut\\textstyle{"+r+"}",t.stack.env,t.configuration).mml(),l=t.create("node","mfrac",[o,a]);if(s=n[s],null==s)throw new la("IllegalAlign","Illegal alignment specified in %1",t.currentCS);s&&Ko.setProperties(l,{numalign:s,denomalign:s}),t.Push(l)},Genfrac(t,e,s,i,r,n){null==s&&(s=t.GetDelimiterArg(e)),null==i&&(i=t.GetDelimiterArg(e)),null==r&&(r=t.GetArgument(e)),null==n&&(n=na.trimSpaces(t.GetArgument(e)));const o=t.ParseArg(e),a=t.ParseArg(e);let l=t.create("node","mfrac",[o,a]);if(""!==r&&Ko.setAttribute(l,"linethickness",r),(s||i)&&(Ko.setProperty(l,"withDelims",!0),l=ya.fixedFence(t.configuration,s,l,i)),""!==n){const e=parseInt(n,10),s=["D","T","S","SS"][e];if(null==s)throw new la("BadMathStyleFor","Bad math style for %1",t.currentCS);l=t.create("node","mstyle",[l]),"D"===s?Ko.setProperties(l,{displaystyle:!0,scriptlevel:0}):Ko.setProperties(l,{displaystyle:!1,scriptlevel:e-1})}t.Push(l)},HandleTag(t,e){if(!t.tags.currentTag.taggable&&t.tags.env)throw new la("CommandNotAllowedInEnv","%1 not allowed in %2 environment",t.currentCS,t.tags.env);if(t.tags.currentTag.tag)throw new la("MultipleCommand","Multiple %1",t.currentCS);const s=t.GetStar(),i=na.trimSpaces(t.GetArgument(e));t.tags.tag(i,s),t.Push(t.itemFactory.create("null"))},HandleNoTag:Il.HandleNoTag,HandleRef:Il.HandleRef,Macro:Il.Macro,Accent:Il.Accent,Tilde:Il.Tilde,Array:Il.Array,Spacer:Il.Spacer,NamedOp:Il.NamedOp,EqnArray:Il.EqnArray,Equation:Il.Equation};new Ua("AMSmath-mathchar0mo",kl.mathchar0mo,{iiiint:["\u2a0c",{texClass:fr.OP}]}),new Ba("AMSmath-operatorLetter",zl.operatorLetter,/[-*]/i),new Ha("AMSmath-macros",{mathring:[zl.Accent,"02DA"],nobreakspace:zl.Tilde,negmedspace:[zl.Spacer,Eo.negativemediummathspace],negthickspace:[zl.Spacer,Eo.negativethickmathspace],idotsint:[zl.MultiIntegral,"\\int\\cdots\\int"],dddot:[zl.Accent,"20DB"],ddddot:[zl.Accent,"20DC"],sideset:zl.SideSet,boxed:[zl.Macro,"\\fbox{$\\displaystyle{#1}$}",1],tag:zl.HandleTag,notag:zl.HandleNoTag,eqref:[zl.HandleRef,!0],substack:[zl.Macro,"\\begin{subarray}{c}#1\\end{subarray}",1],injlim:[zl.NamedOp,"inj lim"],projlim:[zl.NamedOp,"proj lim"],varliminf:[zl.Macro,"\\mathop{\\underline{\\mmlToken{mi}{lim}}}"],varlimsup:[zl.Macro,"\\mathop{\\overline{\\mmlToken{mi}{lim}}}"],varinjlim:[zl.Macro,"\\mathop{\\underrightarrow{\\mmlToken{mi}{lim}}}"],varprojlim:[zl.Macro,"\\mathop{\\underleftarrow{\\mmlToken{mi}{lim}}}"],DeclareMathOperator:zl.HandleDeclareOp,operatorname:zl.HandleOperatorName,genfrac:zl.Genfrac,frac:[zl.Genfrac,"","","",""],tfrac:[zl.Genfrac,"","","","1"],dfrac:[zl.Genfrac,"","","","0"],binom:[zl.Genfrac,"(",")","0",""],tbinom:[zl.Genfrac,"(",")","0","1"],dbinom:[zl.Genfrac,"(",")","0","0"],cfrac:zl.CFrac,shoveleft:[zl.HandleShove,Jo.Align.LEFT],shoveright:[zl.HandleShove,Jo.Align.RIGHT],xrightarrow:[zl.xArrow,8594,5,10],xleftarrow:[zl.xArrow,8592,10,5]}),new Wa("AMSmath-environment",kl.environment,{"equation*":[zl.Equation,null,!1],"eqnarray*":[zl.EqnArray,null,!1,!0,"rcl","bmt",ya.cols(0,Eo.thickmathspace),".5em"],align:[zl.EqnArray,null,!0,!0,"rl","bt",ya.cols(0,2)],"align*":[zl.EqnArray,null,!1,!0,"rl","bt",ya.cols(0,2)],multline:[zl.Multline,null,!0],"multline*":[zl.Multline,null,!1],split:[zl.EqnArray,null,!1,!1,"rl","bt",ya.cols(0)],gather:[zl.EqnArray,null,!0,!0,"c","m"],"gather*":[zl.EqnArray,null,!1,!0,"c","m"],alignat:[zl.AlignAt,null,!0,!0],"alignat*":[zl.AlignAt,null,!1,!0],alignedat:[zl.AlignAt,null,!1,!1],aligned:[zl.AmsEqnArray,null,null,null,"rl","bt",ya.cols(0,2),".5em","D"],gathered:[zl.AmsEqnArray,null,null,null,"c","m",null,".5em","D"],xalignat:[zl.XalignAt,null,!0,!0],"xalignat*":[zl.XalignAt,null,!1,!0],xxalignat:[zl.XalignAt,null,!1,!1],flalign:[zl.FlalignArray,null,!0,!1,!0,"rlc","btm","auto auto fit"],"flalign*":[zl.FlalignArray,null,!1,!1,!0,"rlc","btm","auto auto fit"],subarray:[zl.Array,null,null,null,null,ya.cols(0),"0.1em","S",!0],smallmatrix:[zl.Array,null,null,null,"c",ya.cols(1/3),".2em","S",!0],matrix:[zl.Array,null,null,null,"c"],pmatrix:[zl.Array,null,"(",")","c"],bmatrix:[zl.Array,null,"[","]","c"],Bmatrix:[zl.Array,null,"\\{","\\}","c"],vmatrix:[zl.Array,null,"\\vert","\\vert","c"],Vmatrix:[zl.Array,null,"\\Vert","\\Vert","c"],cases:[zl.Array,null,"\\{",".","ll",null,".2em","T"]}),new ja("AMSmath-delimiter",kl.delimiter,{"\\lvert":["|",{texClass:fr.OPEN}],"\\rvert":["|",{texClass:fr.CLOSE}],"\\lVert":["\u2016",{texClass:fr.OPEN}],"\\rVert":["\u2016",{texClass:fr.CLOSE}]}),new Ua("AMSsymbols-mathchar0mi",kl.mathchar0mi,{digamma:"\u03dd",varkappa:"\u03f0",varGamma:["\u0393",{mathvariant:Jo.Variant.ITALIC}],varDelta:["\u0394",{mathvariant:Jo.Variant.ITALIC}],varTheta:["\u0398",{mathvariant:Jo.Variant.ITALIC}],varLambda:["\u039b",{mathvariant:Jo.Variant.ITALIC}],varXi:["\u039e",{mathvariant:Jo.Variant.ITALIC}],varPi:["\u03a0",{mathvariant:Jo.Variant.ITALIC}],varSigma:["\u03a3",{mathvariant:Jo.Variant.ITALIC}],varUpsilon:["\u03a5",{mathvariant:Jo.Variant.ITALIC}],varPhi:["\u03a6",{mathvariant:Jo.Variant.ITALIC}],varPsi:["\u03a8",{mathvariant:Jo.Variant.ITALIC}],varOmega:["\u03a9",{mathvariant:Jo.Variant.ITALIC}],beth:"\u2136",gimel:"\u2137",daleth:"\u2138",backprime:["\u2035",{variantForm:!0}],hslash:"\u210f",varnothing:["\u2205",{variantForm:!0}],blacktriangle:"\u25b4",triangledown:["\u25bd",{variantForm:!0}],blacktriangledown:"\u25be",square:"\u25fb",Box:"\u25fb",blacksquare:"\u25fc",lozenge:"\u25ca",Diamond:"\u25ca",blacklozenge:"\u29eb",circledS:["\u24c8",{mathvariant:Jo.Variant.NORMAL}],bigstar:"\u2605",sphericalangle:"\u2222",measuredangle:"\u2221",nexists:"\u2204",complement:"\u2201",mho:"\u2127",eth:["\xf0",{mathvariant:Jo.Variant.NORMAL}],Finv:"\u2132",diagup:"\u2571",Game:"\u2141",diagdown:"\u2572",Bbbk:["k",{mathvariant:Jo.Variant.DOUBLESTRUCK}],yen:"\xa5",circledR:"\xae",checkmark:"\u2713",maltese:"\u2720"}),new Ua("AMSsymbols-mathchar0mo",kl.mathchar0mo,{dotplus:"\u2214",ltimes:"\u22c9",smallsetminus:["\u2216",{variantForm:!0}],rtimes:"\u22ca",Cap:"\u22d2",doublecap:"\u22d2",leftthreetimes:"\u22cb",Cup:"\u22d3",doublecup:"\u22d3",rightthreetimes:"\u22cc",barwedge:"\u22bc",curlywedge:"\u22cf",veebar:"\u22bb",curlyvee:"\u22ce",doublebarwedge:"\u2a5e",boxminus:"\u229f",circleddash:"\u229d",boxtimes:"\u22a0",circledast:"\u229b",boxdot:"\u22a1",circledcirc:"\u229a",boxplus:"\u229e",centerdot:["\u22c5",{variantForm:!0}],divideontimes:"\u22c7",intercal:"\u22ba",leqq:"\u2266",geqq:"\u2267",leqslant:"\u2a7d",geqslant:"\u2a7e",eqslantless:"\u2a95",eqslantgtr:"\u2a96",lesssim:"\u2272",gtrsim:"\u2273",lessapprox:"\u2a85",gtrapprox:"\u2a86",approxeq:"\u224a",lessdot:"\u22d6",gtrdot:"\u22d7",lll:"\u22d8",llless:"\u22d8",ggg:"\u22d9",gggtr:"\u22d9",lessgtr:"\u2276",gtrless:"\u2277",lesseqgtr:"\u22da",gtreqless:"\u22db",lesseqqgtr:"\u2a8b",gtreqqless:"\u2a8c",doteqdot:"\u2251",Doteq:"\u2251",eqcirc:"\u2256",risingdotseq:"\u2253",circeq:"\u2257",fallingdotseq:"\u2252",triangleq:"\u225c",backsim:"\u223d",thicksim:["\u223c",{variantForm:!0}],backsimeq:"\u22cd",thickapprox:["\u2248",{variantForm:!0}],subseteqq:"\u2ac5",supseteqq:"\u2ac6",Subset:"\u22d0",Supset:"\u22d1",sqsubset:"\u228f",sqsupset:"\u2290",preccurlyeq:"\u227c",succcurlyeq:"\u227d",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",precsim:"\u227e",succsim:"\u227f",precapprox:"\u2ab7",succapprox:"\u2ab8",vartriangleleft:"\u22b2",lhd:"\u22b2",vartriangleright:"\u22b3",rhd:"\u22b3",trianglelefteq:"\u22b4",unlhd:"\u22b4",trianglerighteq:"\u22b5",unrhd:"\u22b5",vDash:"\u22a8",Vdash:"\u22a9",Vvdash:"\u22aa",smallsmile:["\u2323",{variantForm:!0}],shortmid:["\u2223",{variantForm:!0}],smallfrown:["\u2322",{variantForm:!0}],shortparallel:["\u2225",{variantForm:!0}],bumpeq:"\u224f",between:"\u226c",Bumpeq:"\u224e",pitchfork:"\u22d4",varpropto:["\u221d",{variantForm:!0}],backepsilon:"\u220d",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",therefore:"\u2234",because:"\u2235",eqsim:"\u2242",vartriangle:["\u25b3",{variantForm:!0}],Join:"\u22c8",nless:"\u226e",ngtr:"\u226f",nleq:"\u2270",ngeq:"\u2271",nleqslant:["\u2a87",{variantForm:!0}],ngeqslant:["\u2a88",{variantForm:!0}],nleqq:["\u2270",{variantForm:!0}],ngeqq:["\u2271",{variantForm:!0}],lneq:"\u2a87",gneq:"\u2a88",lneqq:"\u2268",gneqq:"\u2269",lvertneqq:["\u2268",{variantForm:!0}],gvertneqq:["\u2269",{variantForm:!0}],lnsim:"\u22e6",gnsim:"\u22e7",lnapprox:"\u2a89",gnapprox:"\u2a8a",nprec:"\u2280",nsucc:"\u2281",npreceq:["\u22e0",{variantForm:!0}],nsucceq:["\u22e1",{variantForm:!0}],precneqq:"\u2ab5",succneqq:"\u2ab6",precnsim:"\u22e8",succnsim:"\u22e9",precnapprox:"\u2ab9",succnapprox:"\u2aba",nsim:"\u2241",ncong:"\u2247",nshortmid:["\u2224",{variantForm:!0}],nshortparallel:["\u2226",{variantForm:!0}],nmid:"\u2224",nparallel:"\u2226",nvdash:"\u22ac",nvDash:"\u22ad",nVdash:"\u22ae",nVDash:"\u22af",ntriangleleft:"\u22ea",ntriangleright:"\u22eb",ntrianglelefteq:"\u22ec",ntrianglerighteq:"\u22ed",nsubseteq:"\u2288",nsupseteq:"\u2289",nsubseteqq:["\u2288",{variantForm:!0}],nsupseteqq:["\u2289",{variantForm:!0}],subsetneq:"\u228a",supsetneq:"\u228b",varsubsetneq:["\u228a",{variantForm:!0}],varsupsetneq:["\u228b",{variantForm:!0}],subsetneqq:"\u2acb",supsetneqq:"\u2acc",varsubsetneqq:["\u2acb",{variantForm:!0}],varsupsetneqq:["\u2acc",{variantForm:!0}],leftleftarrows:"\u21c7",rightrightarrows:"\u21c9",leftrightarrows:"\u21c6",rightleftarrows:"\u21c4",Lleftarrow:"\u21da",Rrightarrow:"\u21db",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",leftarrowtail:"\u21a2",rightarrowtail:"\u21a3",looparrowleft:"\u21ab",looparrowright:"\u21ac",leftrightharpoons:"\u21cb",rightleftharpoons:["\u21cc",{variantForm:!0}],curvearrowleft:"\u21b6",curvearrowright:"\u21b7",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",Lsh:"\u21b0",Rsh:"\u21b1",upuparrows:"\u21c8",downdownarrows:"\u21ca",upharpoonleft:"\u21bf",upharpoonright:"\u21be",downharpoonleft:"\u21c3",restriction:"\u21be",multimap:"\u22b8",downharpoonright:"\u21c2",leftrightsquigarrow:"\u21ad",rightsquigarrow:"\u21dd",leadsto:"\u21dd",dashrightarrow:"\u21e2",dashleftarrow:"\u21e0",nleftarrow:"\u219a",nrightarrow:"\u219b",nLeftarrow:"\u21cd",nRightarrow:"\u21cf",nleftrightarrow:"\u21ae",nLeftrightarrow:"\u21ce"}),new ja("AMSsymbols-delimiter",kl.delimiter,{"\\ulcorner":"\u231c","\\urcorner":"\u231d","\\llcorner":"\u231e","\\lrcorner":"\u231f"}),new Ha("AMSsymbols-macros",{implies:[zl.Macro,"\\;\\Longrightarrow\\;"],impliedby:[zl.Macro,"\\;\\Longleftarrow\\;"]});class Kl extends ha{get kind(){return"beginEnv"}get isOpen(){return!0}checkItem(t){if(t.isKind("end")){if(t.getName()!==this.getName())throw new la("EnvBadEnd","\\begin{%1} ended with \\end{%2}",this.getName(),t.getName());return[[this.factory.create("mml",this.toMml())],!0]}if(t.isKind("stop"))throw new la("EnvMissingEnd","Missing \\end{%1}",this.getName());return super.checkItem(t)}}const Jl={NewCommand(t,e){const s=Vl.GetCsNameArgument(t,e),i=Vl.GetArgCount(t,e),r=t.GetBrackets(e),n=t.GetArgument(e);Vl.addMacro(t,s,Jl.Macro,[n,i,r]),t.Push(t.itemFactory.create("null"))},NewEnvironment(t,e){const s=na.trimSpaces(t.GetArgument(e)),i=Vl.GetArgCount(t,e),r=t.GetBrackets(e),n=t.GetArgument(e),o=t.GetArgument(e);Vl.addEnvironment(t,s,Jl.BeginEnv,[!0,n,o,i,r]),t.Push(t.itemFactory.create("null"))},MacroDef(t,e){const s=Vl.GetCSname(t,e),i=Vl.GetTemplate(t,e,"\\"+s),r=t.GetArgument(e);i instanceof Array?Vl.addMacro(t,s,Jl.MacroWithTemplate,[r].concat(i)):Vl.addMacro(t,s,Jl.Macro,[r,i]),t.Push(t.itemFactory.create("null"))},Let(t,e){const s=Vl.GetCSname(t,e);let i=t.GetNext();"="===i&&(t.i++,i=t.GetNext());const r=t.configuration.handlers;if(t.Push(t.itemFactory.create("null")),"\\"===i){if(s===(e=Vl.GetCSname(t,e)))return;const i=r.get(ia.MACRO).applicable(e);if(i instanceof qa){const r=i.lookup(e);return void Vl.addMacro(t,s,r.func,r.args,r.token)}if(i instanceof Ua&&!(i instanceof ja)){const r=i.lookup(e),n=t=>i.parser(t,r);return void Vl.addMacro(t,s,n,[s,r.char])}const n=r.get(ia.DELIMITER).lookup("\\"+e);return n?void Vl.addDelimiter(t,"\\"+s,n.char,n.attributes):(Vl.checkProtectedMacros(t,s),Vl.undefineMacro(t,s),void Vl.undefineDelimiter(t,"\\"+s))}t.i++;const n=r.get(ia.DELIMITER).lookup(i);n?Vl.addDelimiter(t,"\\"+s,n.char,n.attributes):Vl.addMacro(t,s,Jl.Macro,[i])},MacroWithTemplate(t,e,s,i,...r){const n=parseInt(i,10);if(r.length){const i=[];if(t.GetNext(),r[0]&&!Vl.MatchParam(t,r[0]))throw new la("MismatchUseDef","Use of %1 doesn't match its definition",e);if(n){for(let s=0;s<n;s++)i.push(Vl.GetParameter(t,e,r[s+1]));s=ya.substituteArgs(t,i,s)}}t.string=ya.addArgs(t,s,t.string.slice(t.i)),t.i=0,ya.checkMaxMacros(t)},BeginEnv(t,e,s,i,r,n){const o=e.getName();if(t.stack.env.closing===o){delete t.stack.env.closing;if(t.stack.global.beginEnv&&(t.stack.global.beginEnv--,i)){const e=t.string.slice(t.i);t.string=ya.addArgs(t,t.string.substring(0,t.i),i),t.Parse(),t.string=e,t.i=0}return t.itemFactory.create("end").setProperty("name",o)}if(r){const e=[];if(null!=n){const s=t.GetBrackets(`\\begin{${o}}`);e.push(null==s?n:s)}for(let s=e.length;s<r;s++)e.push(t.GetArgument(`\\begin{${o}}`));s=ya.substituteArgs(t,e,s),i=ya.substituteArgs(t,[],i)}return t.string=ya.addArgs(t,s,t.string.slice(t.i)),t.i=0,t.stack.global.beginEnv=(t.stack.global.beginEnv||0)+1,t.itemFactory.create("beginEnv").setProperty("name",o)},Macro:Il.Macro},$l=Jl;function Yl(t,e){e.parseOptions.packageData.has("newcommand")||(e.parseOptions.packageData.set("newcommand",{}),new ja(Hl.NEW_DELIMITER,kl.delimiter,{}),new Ha(Hl.NEW_COMMAND,{}),new Wa(Hl.NEW_ENVIRONMENT,kl.environment,{}),e.parseOptions.handlers.add({[ia.CHARACTER]:[],[ia.DELIMITER]:[Hl.NEW_DELIMITER],[ia.MACRO]:[Hl.NEW_DELIMITER,Hl.NEW_COMMAND],[ia.ENVIRONMENT]:[Hl.NEW_ENVIRONMENT]},{},Wl))}new Ha("Newcommand-macros",{newcommand:$l.NewCommand,renewcommand:$l.NewCommand,newenvironment:$l.NewEnvironment,renewenvironment:$l.NewEnvironment,def:$l.MacroDef,let:$l.Let});const Ql=Ka.create("newcommand",{[sa.HANDLER]:{macro:["Newcommand-macros"]},[sa.ITEMS]:{[Kl.prototype.kind]:Kl},[sa.OPTIONS]:{maxMacros:1e3,protectedMacros:["begingroupSandbox"]},[sa.CONFIG]:Yl});class Zl extends Ca{}const tc=Ka.create("ams",{[sa.HANDLER]:{[ia.CHARACTER]:["AMSmath-operatorLetter"],[ia.DELIMITER]:["AMSsymbols-delimiter","AMSmath-delimiter"],[ia.MACRO]:["AMSsymbols-mathchar0mi","AMSsymbols-mathchar0mo","AMSsymbols-delimiter","AMSsymbols-macros","AMSmath-mathchar0mo","AMSmath-macros","AMSmath-delimiter"],[ia.ENVIRONMENT]:["AMSmath-environment"]},[sa.ITEMS]:{[jl.prototype.kind]:jl,[ql.prototype.kind]:ql},[sa.TAGS]:{ams:Zl},[sa.OPTIONS]:{multlineWidth:"",ams:{operatornamePattern:/^[-*a-zA-Z0-9]+/,multlineWidth:"100%",multlineIndent:"1em"}},[sa.CONFIG]:Yl}),ec=Gi.config;function sc(t,e){const s=t.parseOptions.options.require,i=t.parseOptions.packageData.get("require").required,r=e.substring(s.prefix.length);if(!i.includes(r)){i.push(r);const s=function(t,e=[]){const s=t.parseOptions.options.require.prefix,i=[];for(const r of e)if(r.substring(0,s.length)===s)try{sc(t,r)}catch(t){if(!t.retry)throw t;i.push(t.retry)}return i.length?Promise.all(i):null}(t,wi.dependencies[e]);s?eo.retryAfter(s.then((()=>ic(t,e,r)))):ic(t,e,r)}}function ic(t,e,s){const i=$a.get(s);if(i){let r=ec[e]||{};i.options&&1===Object.keys(i.options).length&&i.options[s]&&(r={[s]:r}),t.configuration.add(s,t,r);const n=t.parseOptions.packageData.get("require").configured;i.preprocessors.length&&!n.has(s)&&(n.set(s,!0),eo.retryAfter(Promise.resolve()))}}function rc(t,e){var s,i;const r=t.options.require,n=r.allow,o=("["===e.substring(0,1)?"":r.prefix)+e;if(!(Object.hasOwn(n,o)?n[o]:Object.hasOwn(n,e)?n[e]:r.defaultAllow))throw new la("BadRequire",'Extension "%1" is not allowed to be loaded',o);const a=fi.packages.get(o);if(a||eo.retryAfter(vi.load(o).catch((t=>{}))),a.hasFailed)throw new la("RequireFail",'Extension "%1" failed to load',e);const l=null===(s=wi[o])||void 0===s?void 0:s.rendererExtensions,c=null===(i=Gi.startup.document)||void 0===i?void 0:i.menu;l&&c&&c.addRequiredExtensions(l),sc(t.configuration.packageData.get("require").jax,o)}const nc={Require(t,e){const s=t.GetArgument(e);if(s.match(/[^_a-zA-Z0-9]/)||""===s)throw new la("BadPackageName","Argument for %1 is not a valid package name",e);rc(t,s),t.Push(t.itemFactory.create("null"))}},oc={require:{allow:ki({base:!1,autoload:!1,configmacros:!1,tagformat:!1,setoptions:!1,texhtml:!1}),defaultAllow:!0,prefix:"tex"}};new Ha("require",{require:nc.Require});const ac=Ka.create("require",{[sa.HANDLER]:{[ia.MACRO]:["require"]},[sa.CONFIG]:function(t,e){e.parseOptions.packageData.set("require",{jax:e,required:[...e.options.packages],configured:new Map});const s=e.parseOptions.options.require,i=s.prefix;if(i.match(/[^_a-zA-Z0-9]/))throw Error("Illegal characters used in \\require prefix");wi.paths[i]||(wi.paths[i]="[mathjax]/input/tex/extensions"),s.prefix="["+i+"]/"},[sa.OPTIONS]:oc});function lc(t,e,s,i){if(fi.packages.has(t.options.require.prefix+s)){const r=t.options.autoload[s],[n,o]=2===r.length&&Array.isArray(r[0])?r:[r,[]];for(const t of n)cc.remove(t);for(const t of o)hc.remove(t);t.string=(i?e+" ":"\\begin{"+e.slice(1)+"}")+t.string.slice(t.i),t.i=0}rc(t,s)}const cc=new Ha("autoload-macros",{}),hc=new Ha("autoload-environments",{}),dc=Ka.create("autoload",{[sa.HANDLER]:{[ia.MACRO]:["autoload-macros"],[ia.ENVIRONMENT]:["autoload-environments"]},[sa.OPTIONS]:{autoload:ki({action:["toggle","mathtip","texttip"],amscd:[[],["CD"]],bbox:["bbox"],boldsymbol:["boldsymbol"],braket:["bra","ket","braket","set","Bra","Ket","Braket","Set","ketbra","Ketbra"],bussproofs:[[],["prooftree"]],cancel:["cancel","bcancel","xcancel","cancelto"],color:["color","definecolor","textcolor","colorbox","fcolorbox"],enclose:["enclose"],extpfeil:["xtwoheadrightarrow","xtwoheadleftarrow","xmapsto","xlongequal","xtofrom","Newextarrow"],html:["data","href","class","style","cssId"],mhchem:["ce","pu"],newcommand:["newcommand","renewcommand","newenvironment","renewenvironment","def","let"],unicode:["unicode","U","char"],verb:["verb"]})},[sa.CONFIG]:function(t,e){const s=e.parseOptions,i=s.handlers.get(ia.MACRO),r=s.handlers.get(ia.ENVIRONMENT),n=s.options.autoload;s.packageData.set("autoload",{Autoload:lc});for(const t of Object.keys(n)){const e=n[t],[s,o]=2===e.length&&Array.isArray(e[0])?e:[e,[]];for(const e of s)i.lookup(e)&&"color"!==e||cc.add(e,new Ma(e,lc,[t,!0]));for(const e of o)r.lookup(e)||hc.add(e,new Ma(e,lc,[t,!1]))}s.packageData.get("require")||ac.config(t,e)},[sa.INIT]:function(t){t.options.require||Bi(t.options,ac.options)},[sa.PRIORITY]:10}),uc="configmacros-map",pc="configmacros-active-map",mc="configmacros-env-map";function gc(t,e,s){const i=s.parseOptions.handlers.retrieve(e),r=s.parseOptions.options[t];for(const t of Object.keys(r)){const e="string"==typeof r[t]?[r[t]]:r[t],s=Array.isArray(e[2])?new Ma(t,$l.MacroWithTemplate,e.slice(0,2).concat(e[2])):new Ma(t,$l.Macro,e);i.add(t,s)}}const fc=Ka.create("configmacros",{[sa.INIT]:function(t){new qa(pc,{}),new Ha(uc,{}),new Wa(mc,kl.environment,{}),t.append(Ka.local({handler:{[ia.CHARACTER]:[pc],[ia.MACRO]:[uc],[ia.ENVIRONMENT]:[mc]},priority:3}))},[sa.CONFIG]:function(t,e){!function(t){gc("active",pc,t)}(e),function(t){gc("macros",uc,t)}(e),function(t){const e=t.parseOptions.handlers.retrieve(mc),s=t.parseOptions.options.environments;for(const t of Object.keys(s))e.add(t,new Ma(t,$l.BeginEnv,[!0].concat(s[t])))}(e)},[sa.ITEMS]:{[Kl.prototype.kind]:Kl},[sa.OPTIONS]:{active:ki({}),macros:ki({}),environments:ki({})}});const bc=Ka.create("noundefined",{[sa.FALLBACK]:{[ia.MACRO]:function(t,e){const s=t.create("text","\\"+e),i=t.options.noundefined,r={};for(const t of["color","background","size"])i[t]&&(r["math"+t]=i[t]);t.Push(t.create("node","mtext",[],r,s))}},[sa.OPTIONS]:{noundefined:{color:"red",background:"",size:""}},[sa.PRIORITY]:3});class Ec extends da{get texParser(){return this.configuration.packageData.get("textmacros").texParser}get tags(){return this.texParser.tags}constructor(t,e,s,i){super(t,e,s),this.level=i}mml(){return this.copyLists(),this.configuration.popParser(),null!=this.level?this.create("node","mstyle",this.nodes,{displaystyle:!1,scriptlevel:this.level}):1===this.nodes.length?this.nodes[0]:this.create("node","mrow",this.nodes)}copyLists(){const t=this.texParser.configuration;for(const[e,s]of Object.entries(this.configuration.nodeLists))for(const i of s)t.addNode(e,i);this.configuration.nodeLists={}}Parse(){this.text="",this.nodes=[],this.envStack=[],super.Parse()}saveText(){if(this.text){const t=this.stack.env.mathvariant,e=ya.internalText(this,this.text,t?{mathvariant:t}:{});this.text="",this.Push(e)}}Push(t){if(this.text&&this.saveText(),t instanceof Za)return super.Push(t);t instanceof ul?this.stack.env.mathcolor=this.stack.env.color:t instanceof Ar&&(this.addAttributes(t),this.nodes.push(t))}PushMath(t){const e=this.stack.env;for(const s of["mathsize","mathcolor"])e[s]&&!t.attributes.hasExplicit(s)&&(t.isToken||t.isKind("mstyle")||(t=this.create("node","mstyle",[t])),Ko.setAttribute(t,s,e[s]));t.isInferred&&(t=this.create("node","mrow",t.childNodes)),t.isKind("TeXAtom")||(t=this.create("node","TeXAtom",[t])),this.nodes.push(t)}addAttributes(t){const e=this.stack.env;if(t.isToken)for(const s of["mathsize","mathcolor","mathvariant"])e[s]&&!t.attributes.hasExplicit(s)&&Ko.setAttribute(t,s,e[s])}ParseTextArg(t,e){const s=this.GetArgument(t);return e=Object.assign(Object.assign({},this.stack.env),e),new Ec(s,e,this.configuration).mml()}ParseArg(t){return new Ec(this.GetArgument(t),this.stack.env,this.configuration).mml()}Error(t,e,...s){throw new la(t,e,...s)}}const xc={Comment(t,e){for(;t.i<t.string.length&&"\n"!==t.string.charAt(t.i);)t.i++;t.i++},Math(t,e){t.saveText();const s=t.i;let i,r,n=0;for(;r=t.GetNext();)switch(i=t.i++,r){case"\\":")"===t.GetCS()&&(r="\\(");case"$":if(0===n&&e===r){const e=t.texParser.configuration,r=new da(t.string.substring(s,i),t.stack.env,e).mml();return void t.PushMath(r)}break;case"{":n++;break;case"}":0===n&&t.Error("ExtraCloseMissingOpen","Extra close brace or missing open brace"),n--}t.Error("MathNotTerminated","Math mode is not properly terminated")},MathModeOnly(t,e){t.Error("MathModeOnly","'%1' allowed only in math mode",e)},Misplaced(t,e){t.Error("Misplaced","Misplaced '%1'",e)},OpenBrace(t,e){const s=t.stack.env;t.envStack.push(s),t.stack.env=Object.assign({},s)},CloseBrace(t,e){t.envStack.length?(t.saveText(),t.stack.env=t.envStack.pop()):t.Error("ExtraCloseMissingOpen","Extra close brace or missing open brace")},OpenQuote(t,e){t.string.charAt(t.i)===e?(t.text+="\u201c",t.i++):t.text+="\u2018"},CloseQuote(t,e){t.string.charAt(t.i)===e?(t.text+="\u201d",t.i++):t.text+="\u2019"},Tilde(t,e){t.text+="\xa0"},Space(t,e){t.text+=" ",t.GetNext()},SelfQuote(t,e){t.text+=e.substring(1)},Insert(t,e,s){t.text+=s},Accent(t,e,s){const i=t.ParseArg(e),r=t.create("token","mo",{},s);t.addAttributes(r),t.Push(t.create("node","mover",[i,r]))},Emph(t,e){const s="-tex-mathit"===t.stack.env.mathvariant?"normal":"-tex-mathit";t.Push(t.ParseTextArg(e,{mathvariant:s}))},TextFont(t,e,s){t.saveText(),t.Push(t.ParseTextArg(e,{mathvariant:s}))},SetFont(t,e,s){t.saveText(),t.stack.env.mathvariant=s},SetSize(t,e,s){t.saveText(),t.stack.env.mathsize=s},CheckAutoload(t,e){const s=t.configuration.packageData.get("autoload"),i=t.texParser;e=e.slice(1);const r=i.lookup(ia.MACRO,e);if(!r||s&&r._func===s.Autoload){if(i.parse(ia.MACRO,[i,e]),!r)return;Pn(Promise.resolve())}i.parse(ia.MACRO,[t,e])},Macro:Il.Macro,Spacer:Il.Spacer,Hskip:Il.Hskip,rule:Il.rule,Rule:Il.Rule,HandleRef:Il.HandleRef,UnderOver:Il.UnderOver,Lap:Il.Lap,Phantom:Il.Phantom,Smash:Il.Smash,MmlToken:Il.MmlToken},yc=Jo.Variant;new qa("text-special",{$:xc.Math,"%":xc.Comment,"^":xc.MathModeOnly,_:xc.MathModeOnly,"&":xc.Misplaced,"#":xc.Misplaced,"~":xc.Tilde," ":xc.Space,"\t":xc.Space,"\r":xc.Space,"\n":xc.Space,"\xa0":xc.Tilde,"{":xc.OpenBrace,"}":xc.CloseBrace,"`":xc.OpenQuote,"'":xc.CloseQuote}),new Ha("text-macros",{"(":xc.Math,$:xc.SelfQuote,_:xc.SelfQuote,"%":xc.SelfQuote,"{":xc.SelfQuote,"}":xc.SelfQuote," ":xc.SelfQuote,"&":xc.SelfQuote,"#":xc.SelfQuote,"\\":[xc.Macro,"$\\\\$"],"'":[xc.Accent,"\xb4"],"\u2019":[xc.Accent,"\xb4"],"`":[xc.Accent,"`"],"\u2018":[xc.Accent,"`"],"^":[xc.Accent,"^"],'"':[xc.Accent,"\xa8"],"~":[xc.Accent,"~"],"=":[xc.Accent,"\xaf"],".":[xc.Accent,"\u02d9"],u:[xc.Accent,"\u02d8"],v:[xc.Accent,"\u02c7"],emph:xc.Emph,rm:[xc.SetFont,yc.NORMAL],mit:[xc.SetFont,yc.ITALIC],oldstyle:[xc.SetFont,yc.OLDSTYLE],cal:[xc.SetFont,yc.CALLIGRAPHIC],it:[xc.SetFont,"-tex-mathit"],bf:[xc.SetFont,yc.BOLD],sf:[xc.SetFont,yc.SANSSERIF],tt:[xc.SetFont,yc.MONOSPACE],frak:[xc.TextFont,yc.FRAKTUR],Bbb:[xc.TextFont,yc.DOUBLESTRUCK],tiny:[xc.SetSize,.5],Tiny:[xc.SetSize,.6],scriptsize:[xc.SetSize,.7],small:[xc.SetSize,.85],normalsize:[xc.SetSize,1],large:[xc.SetSize,1.2],Large:[xc.SetSize,1.44],LARGE:[xc.SetSize,1.73],huge:[xc.SetSize,2.07],Huge:[xc.SetSize,2.49],textnormal:[xc.Macro,"{\\rm #1}",1],textup:[xc.Macro,"{\\rm #1}",1],textrm:[xc.Macro,"{\\rm #1}",1],textit:[xc.Macro,"{\\it #1}",1],textbf:[xc.Macro,"{\\bf #1}",1],textsf:[xc.Macro,"{\\sf #1}",1],texttt:[xc.Macro,"{\\tt #1}",1],dagger:[xc.Insert,"\u2020"],ddagger:[xc.Insert,"\u2021"],S:[xc.Insert,"\xa7"],AA:[xc.Insert,"\u212b"],ldots:[xc.Insert,"\u2026"],vdots:[xc.Insert,"\u22ee"],",":[xc.Spacer,Eo.thinmathspace],":":[xc.Spacer,Eo.mediummathspace],">":[xc.Spacer,Eo.mediummathspace],";":[xc.Spacer,Eo.thickmathspace],"!":[xc.Spacer,Eo.negativethinmathspace],enspace:[xc.Spacer,.5],quad:[xc.Spacer,1],qquad:[xc.Spacer,2],thinspace:[xc.Spacer,Eo.thinmathspace],negthinspace:[xc.Spacer,Eo.negativethinmathspace],hskip:xc.Hskip,hspace:xc.Hskip,kern:xc.Hskip,mskip:xc.Hskip,mspace:xc.Hskip,mkern:xc.Hskip,rule:xc.rule,Rule:[xc.Rule],Space:[xc.Rule,"blank"],color:xc.CheckAutoload,textcolor:xc.CheckAutoload,colorbox:xc.CheckAutoload,fcolorbox:xc.CheckAutoload,href:xc.CheckAutoload,style:xc.CheckAutoload,class:xc.CheckAutoload,data:xc.CheckAutoload,cssId:xc.CheckAutoload,unicode:xc.CheckAutoload,U:xc.CheckAutoload,char:xc.CheckAutoload,ref:[xc.HandleRef,!1],eqref:[xc.HandleRef,!0],underline:[xc.UnderOver,"2015"],llap:xc.Lap,rlap:xc.Lap,phantom:xc.Phantom,vphantom:[xc.Phantom,1,0],hphantom:[xc.Phantom,0,1],smash:xc.Smash,mmlToken:xc.MmlToken});const Nc=Ka.create("text-base",{[sa.PARSER]:"text",[sa.PRIORITY]:1,[sa.HANDLER]:{[ia.CHARACTER]:["command","text-special"],[ia.MACRO]:["text-macros"]},[sa.FALLBACK]:{[ia.CHARACTER]:(t,e)=>{t.text+=e},[ia.MACRO]:(t,e)=>{const s=t.texParser,i=s.lookup(ia.MACRO,e);i&&i._func!==xc.Macro&&t.Error("MathMacro","%1 is only supported in math mode","\\"+e),s.parse(ia.MACRO,[t,e])}},[sa.ITEMS]:{[Qa.prototype.kind]:Qa,[Za.prototype.kind]:Za,[gl.prototype.kind]:gl,[ul.prototype.kind]:ul}});function Ac(t,e,s,i){const r=t.configuration.packageData.get("textmacros");return t instanceof Ec||(r.texParser=t),r.parseOptions.clear(),[new Ec(e,i?{mathvariant:i}:{},r.parseOptions,s).mml()]}const vc=Ka.create("textmacros",{[sa.PRIORITY]:1,[sa.CONFIG]:(t,e)=>{const s=new Ya(e.parseOptions.options.textmacros.packages,["tex","text"]);s.init();const i=new _a(s,[]);i.options=e.parseOptions.options,s.config(e),ka.addTags(s.tags),i.tags=ka.getDefault(),i.tags.configuration=i,i.packageData=e.parseOptions.packageData,i.packageData.set("textmacros",{textConf:s,parseOptions:i,jax:e,texParser:null}),i.options.internalMath=Ac},[sa.PREPROCESSORS]:[t=>{const e=t.data.packageData.get("textmacros");e.parseOptions.nodeFactory.setMmlFactory(e.jax.mmlFactory)}],[sa.OPTIONS]:{textmacros:{packages:["text-base"]}}});MathJax.loader&&MathJax.loader.checkVersion("input/tex",ni,"input"),di({_:{input:{tex_ts:te,tex:{ColumnParser:Wt,Configuration:Jt,FilterUtil:Ot,FindTeX:Rt,HandlerTypes:Mt,MapHandler:Kt,NodeFactory:qt,NodeUtil:St,ParseMethods:Qt,ParseOptions:Vt,ParseUtil:Ht,Stack:Pt,StackItem:Ft,StackItemFactory:jt,Tags:Gt,TexConstants:kt,TexError:Bt,TexParser:Ut,Token:Xt,TokenMap:zt,UnitUtil:Dt,ams:{AmsConfiguration:ae,AmsItems:ee,AmsMethods:ie},autoload:{AutoloadConfiguration:ce},base:{BaseConfiguration:Zt,BaseItems:$t,BaseMethods:Yt},configmacros:{ConfigMacrosConfiguration:he},newcommand:{NewcommandConfiguration:oe,NewcommandItems:re,NewcommandMethods:ne,NewcommandUtil:se},noundefined:{NoUndefinedConfiguration:de},require:{RequireConfiguration:le},textmacros:{TextMacrosConfiguration:me,TextMacrosMethods:pe,TextParser:ue}}}}}),vi.preLoaded("input/tex-base","[tex]/ams","[tex]/newcommand","[tex]/textmacros","[tex]/noundefined","[tex]/require","[tex]/autoload","[tex]/configmacros"),function(t=[],e=!0){if(MathJax.startup){e&&(MathJax.startup.registerConstructor("tex",MathJax._.input.tex_ts.TeX),MathJax.startup.useInput("tex")),MathJax.config.tex||(MathJax.config.tex={});let s=MathJax.config.tex.packages;MathJax.config.tex.packages=t,s&&(Array.isArray(s)&&(s={"[+]":s.filter((e=>!t.includes(e)))}),Pi(MathJax.config.tex,{packages:s}))}}(["base","ams","newcommand","textmacros","noundefined","require","autoload","configmacros"]);const _c="http://www.w3.org/1998/Math/MathML";class wc extends Zi{findMath(t){const e=new Set;this.findMathNodes(t,e),this.findMathPrefixed(t,e);const s=this.adaptor.root(this.adaptor.document);return"html"===this.adaptor.kind(s)&&0===e.size&&this.findMathNS(t,e),this.processMath(e)}findMathNodes(t,e){for(const s of this.adaptor.tags(t,"math"))e.add(s)}findMathPrefixed(t,e){const s=this.adaptor.root(this.adaptor.document);for(const i of this.adaptor.allAttributes(s))if("xmlns:"===i.name.substring(0,6)&&i.value===_c){const s=i.name.substring(6);for(const i of this.adaptor.tags(t,s+":math"))e.add(i)}}findMathNS(t,e){for(const s of this.adaptor.tags(t,"math",_c))e.add(s)}processMath(t){const e=this.adaptor,s=[];for(const i of t.values()){if("mjx-assistive-mml"===e.kind(e.parent(i)))continue;const t="block"===e.getAttribute(i,"display")||"display"===e.getAttribute(i,"mode"),r={node:i,n:0,delim:""},n={node:i,n:0,delim:""};s.push({math:e.outerHTML(i),start:r,end:n,display:t})}return s}}wc.OPTIONS={};class Tc{constructor(t={}){const e=this.constructor;this.options=Fi(Bi({},e.OPTIONS),t)}setMmlFactory(t){this.factory=t}compile(t){const e=this.makeNode(t);return e.verifyTree(this.options.verify),e.setInheritedAttributes({},!1,0,!1),e.walkTree(this.markMrows),e}makeNode(t){const e=this.adaptor;let s=!1;const i=e.kind(t).replace(/^.*:/,"");let r=e.getAttribute(t,"data-mjx-texclass")||"";r&&(r=this.filterAttribute("data-mjx-texclass",r)||"");let n=r&&"mrow"===i?"TeXAtom":i;for(const o of this.filterClassList(e.allClasses(t)))o.match(/^MJX-TeXAtom-/)&&"mrow"===i?(r=o.substring(12),n="TeXAtom"):"MJX-fixedlimits"===o&&(s=!0);return this.factory.getNodeClass(n)?this.createMml(n,t,r,s):this.unknownNode(n,t)}createMml(t,e,s,i){const r=this.factory.create(t);return"TeXAtom"!==t||"OP"!==s||i||(r.setProperty("movesupsub",!0),r.attributes.setInherited("movablelimits",!0)),s&&(r.texClass=fr[s],r.setProperty("texClass",r.texClass)),this.addAttributes(r,e),this.checkClass(r,e),this.addChildren(r,e),r}unknownNode(t,e){return this.factory.getNodeClass("html")&&this.options.allowHtmlInTokenNodes?this.factory.create("html").setHTML(e,this.adaptor):(this.error('Unknown node type "'+t+'"'),null)}addAttributes(t,e){let s=!1;for(const i of this.adaptor.allAttributes(e)){const e=i.name,r=this.filterAttribute(e,i.value);if(null!==r&&"xmlns"!==e)if("data-mjx-"===e.substring(0,9))switch(e.substring(9)){case"alternate":t.setProperty("variantForm",!0);break;case"variant":t.attributes.set("mathvariant",r),t.setProperty("ignore-variant",!0),s=!0;break;case"smallmatrix":t.setProperty("smallmatrix",!0),t.setProperty("useHeight",!1);break;case"mathaccent":t.setProperty("mathaccent","true"===r);break;case"auto-op":t.setProperty("autoOP","true"===r);break;case"script-align":t.setProperty("scriptalign",r);break;case"vbox":t.setProperty("vbox",r);break;default:t.attributes.set(e,r)}else if("class"!==e){const i=r.toLowerCase();"true"===i||"false"===i?t.attributes.set(e,"true"===i):s&&"mathvariant"===e||t.attributes.set(e,r)}}}filterAttribute(t,e){return e}filterClassList(t){return t}addChildren(t,e){if(0===t.arity)return;const s=this.adaptor;for(const i of s.childNodes(e)){const e=s.kind(i);if("#comment"!==e)if("#text"===e)this.addText(t,i);else if(t.isKind("annotation-xml"))t.appendChild(this.factory.create("XML").setXML(i,s));else{const e=t.appendChild(this.makeNode(i));0===e.arity&&s.childNodes(i).length&&!e.isKind("html")&&(this.options.fixMisplacedChildren?this.addChildren(t,i):e.mError("There should not be children for "+e.kind+" nodes",this.options.verify,!0))}}t.isToken&&this.trimSpace(t)}addText(t,e){let s=this.adaptor.value(e);(t.isToken||t.getProperty("isChars"))&&t.arity?(t.isToken&&(s=Io(s),s=this.normalizeSpace(s)),t.appendChild(this.factory.create("text").setText(s))):s.match(/\S/)&&this.error('Unexpected text node "'+s+'"')}checkClass(t,e){const s=[];for(const i of this.filterClassList(this.adaptor.allClasses(e)))"MJX-"===i.substring(0,4)?"MJX-variant"===i?t.setProperty("variantForm",!0):"MJX-TeXAtom"!==i.substring(0,11)&&t.attributes.set("mathvariant",this.fixCalligraphic(i.substring(3))):s.push(i);s.length&&t.attributes.set("class",s.join(" "))}fixCalligraphic(t){return t.replace(/caligraphic/,"calligraphic")}markMrows(t){if(t.isKind("mrow")&&!t.isInferred&&t.childNodes.length>=2){const e=t.childNodes[0],s=t.childNodes[t.childNodes.length-1];e.isKind("mo")&&e.attributes.get("fence")&&e.attributes.get("stretchy")&&s.isKind("mo")&&s.attributes.get("fence")&&s.attributes.get("stretchy")&&(e.childNodes.length&&t.setProperty("open",e.getText()),s.childNodes.length&&t.setProperty("close",s.getText()))}}normalizeSpace(t){return t.replace(/[\t\n\r]/g," ").replace(/ +/g," ")}trimSpace(t){let e=t.childNodes[0];e&&(e.isKind("text")&&e.setText(e.getText().replace(/^ +/,"")),e=t.childNodes[t.childNodes.length-1],e.isKind("text")&&e.setText(e.getText().replace(/ +$/,"")))}error(t){throw new Error(t)}}Tc.OPTIONS={MmlFactory:null,allowHtmlInTokenNodes:!1,fixMisplacedChildren:!0,verify:Object.assign({},Ar.verifyDefaults),translateEntities:!0};class Cc extends tr{constructor(t={}){const[e,s,i]=qi(t,wc.OPTIONS,Tc.OPTIONS);super(e),this.findMathML=this.options.FindMathML||new wc(s),this.mathml=this.options.MathMLCompile||new Tc(i),this.mmlFilters=new Ei(this.options.mmlFilters)}setAdaptor(t){super.setAdaptor(t),this.findMathML.adaptor=t,this.mathml.adaptor=t}setMmlFactory(t){super.setMmlFactory(t),this.mathml.setMmlFactory(t)}get processStrings(){return!1}compile(t,e){let s=t.start.node;if(!s||!t.end.node||this.options.forceReparse||"#text"===this.adaptor.kind(s)){let i=this.executeFilters(this.preFilters,t,e,(t.math||"<math></math>").trim());"html"===this.options.parseAs&&(i=`<html><head></head><body>${i}</body></html>`);const r=this.checkForErrors(this.adaptor.parse(i,"text/"+this.options.parseAs)),n=this.adaptor.body(r);1!==this.adaptor.childNodes(n).length&&this.error("MathML must consist of a single element"),s=this.adaptor.remove(this.adaptor.firstChild(n)),"math"!==this.adaptor.kind(s).replace(/^[a-z]+:/,"")&&this.error("MathML must be formed by a <math> element, not <"+this.adaptor.kind(s)+">")}s=this.executeFilters(this.mmlFilters,t,e,s);let i=this.mathml.compile(s);return i=this.executeFilters(this.postFilters,t,e,i),t.display="block"===i.attributes.get("display"),i}checkForErrors(t){const e=this.adaptor.tags(this.adaptor.body(t),"parsererror")[0];return e&&(""===this.adaptor.textContent(e)&&this.error("Error processing MathML"),this.options.parseError.call(this,e)),t}error(t){throw new Error(t)}findMath(t){return this.findMathML.findMath(t)}}Cc.NAME="MathML",Cc.OPTIONS=Bi({parseAs:"html",forceReparse:!1,mmlFilters:[],FindMathML:null,MathMLCompile:null,parseError:function(t){this.error(this.adaptor.textContent(t).replace(/\n.*/g,""))}},tr.OPTIONS),MathJax.loader&&MathJax.loader.checkVersion("input/mml",ni,"input"),di({_:{input:{mathml_ts:be,mathml:{FindMathML:ge,MathMLCompile:fe}}}}),MathJax.loader&&MathJax.loader.pathFilters.add((t=>(t.name=t.name.replace(/\/util\/entities\/.*?\.js/,"/input/mml/entities.js"),!0))),MathJax.startup&&(MathJax.startup.registerConstructor("mml",Cc),MathJax.startup.useInput("mml"));const Lc={None:"",Vertical:"v",Horizontal:"h"},Ic=Lc.Vertical,Rc=Lc.Horizontal;var Sc=function(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function a(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};const kc={dir:Lc.None};function Oc(t,e,s){return s?Bi(t,{[e]:s})[e]:t[e]}class Mc{get CLASS(){return this.constructor}static charOptions(t,e){const s=t[e];if(!Array.isArray(s))throw Error(`Character data hasn't been loaded for 0x${e.toString(16).toUpperCase()}`);return 3===s.length&&(s[3]={}),s[3]}static defineDynamicFiles(t,e=""){const s={};return(t||[]).forEach((([t,i,r])=>{s[t]={extension:e,file:t,variants:i,delimiters:r||[],promise:null,failed:!1,setup:e=>{s[t].failed=!0}}})),s}static dynamicSetup(t,e,s,i={},r=null){const n=t?this.dynamicExtensions.get(t):null;(t?n.files:this.dynamicFiles)[e].setup=e=>{Object.keys(s).forEach((t=>e.defineChars(t,s[t]))),e.defineDelimiters(i),t&&this.adjustDelimiters(e.delimiters,Object.keys(i),n.sizeN,n.stretchN),r&&e.addDynamicFontCss(r)}}static adjustDelimiters(t,e,s,i){e.forEach((e=>{const r=t[parseInt(e)];"dir"in r&&(r.variants&&(r.variants=this.adjustArrayIndices(r.variants,s)),r.stretchv&&(r.stretchv=this.adjustArrayIndices(r.stretchv,i)))}))}static adjustArrayIndices(t,e){return t.map((t=>t<0?e-1-t:t))}static addExtension(t,e=""){const s={name:t.name,prefix:e||`[${t.name}-extension]/${this.JAX.toLowerCase()}/dynamic`,files:this.defineDynamicFiles(t.ranges,t.name),sizeN:this.defaultSizeVariants.length,stretchN:this.defaultStretchVariants.length};this.dynamicExtensions.set(t.name,s);for(const[e,s]of[["options","OPTIONS"],["variants","defaultVariants"],["variantSmp","VariantSmp"],["cssFonts","defaultCssFonts"],["accentMap","defaultAccentMap"],["moMap","defaultMoMap"],["mnMap","defaultMnMap"],["parameters","defaultParams"],["chars","defaultChars"],["sizeVariants","defaultSizeVariants"],["stretchVariants","defaultStretchVariants"]])Oc(this,s,t[e]);t.delimiters&&(Object.assign(this.defaultDelimiters,t.delimiters),this.adjustDelimiters(this.defaultDelimiters,Object.keys(t.delimiters),s.sizeN,s.stretchN))}constructor(t=null){this.variant={},this.delimiters={},this.cssFontMap={},this.cssFontPrefix="",this.remapChars={},this.skewIcFactor=.75;const e=this.CLASS;this.options=Fi(Bi({},e.OPTIONS),t),this.params=Object.assign({},e.defaultParams),this.sizeVariants=[...e.defaultSizeVariants],this.stretchVariants=[...e.defaultStretchVariants],this.defineCssFonts(e.defaultCssFonts),this.cssFamilyPrefix=e.defaultCssFamilyPrefix,this.createVariants(e.defaultVariants),this.defineDelimiters(e.defaultDelimiters),Object.keys(e.defaultChars).forEach((t=>this.defineChars(t,e.defaultChars[t]))),this.defineRemap("accent",e.defaultAccentMap),this.defineRemap("mo",e.defaultMoMap),this.defineRemap("mn",e.defaultMnMap),this.defineDynamicCharacters(e.dynamicFiles),e.dynamicExtensions.forEach((t=>this.defineDynamicCharacters(t.files)))}setOptions(t){Bi(this.options,t)}addExtension(t,e=""){const s=this.constructor.JAX.toLowerCase(),i={name:t.name,prefix:e||`[${t.name}-extension]/${s}/dynamic`,files:this.CLASS.defineDynamicFiles(t.ranges,e),sizeN:this.sizeVariants.length,stretchN:this.stretchVariants.length};this.CLASS.dynamicExtensions.set(t.name,i),Bi(this.options,t.options||{}),Bi(this.params,t.parameters||{}),Oc(this,"sizeVariants",t.sizeVariants),Oc(this,"stretchVariants",t.stretchVariants),Oc(this.constructor,"VariantSmp",t.variantSmp),this.defineCssFonts(Oc({cssFonts:{}},"cssFonts",t.cssFonts)),this.createVariants(Oc({variants:[]},"variants",t.variants)),t.delimiters&&(this.defineDelimiters(Oc({delimiters:{}},"delimiters",t.delimiters)),this.CLASS.adjustDelimiters(this.delimiters,Object.keys(t.delimiters),i.sizeN,i.stretchN));for(const e of Object.keys(t.chars||{}))this.defineChars(e,t.chars[e]);return this.defineRemap("accent",t.accentMap),this.defineRemap("mo",t.moMap),this.defineRemap("mn",t.mnMap),t.ranges&&this.defineDynamicCharacters(i.files),[]}get styles(){return this._styles}set styles(t){this._styles=t}createVariant(t,e=null,s=null){const i={linked:[],chars:Object.create(e?this.variant[e].chars:{})};this.variant[s]&&(Object.assign(i.chars,this.variant[s].chars),this.variant[s].linked.push(i.chars),i.chars=Object.create(i.chars)),this.remapSmpChars(i.chars,t),this.variant[t]=i}remapSmpChars(t,e){const s=this.CLASS;let i=s.VariantSmp[e];if("string"==typeof i&&(i=s.VariantSmp[i]),!i)return;const r=s.SmpRemap,n=[null,null,s.SmpRemapGreekU,s.SmpRemapGreekL];for(const[e,o,a]of s.SmpRanges){const s=i[e];if(s){for(let e=o;e<=a;e++){if(930===e)continue;const i=s+e-o;t[e]=this.smpChar(r[i]||i)}if(n[e])for(const i of Object.keys(n[e]).map((t=>parseInt(t))))t[i]=this.smpChar(s+n[e][i])}}const o=i[5]||{};for(const e of Object.keys(o))t[e]=this.smpChar(i[5][e])}smpChar(t){return[,,,{smp:t}]}createVariants(t){for(const e of t)this.createVariant(e[0],e[1],e[2])}defineChars(t,e){const s=this.variant[t];Object.assign(s.chars,e);for(const t of s.linked)Object.assign(t,e)}defineCssFonts(t){Object.assign(this.cssFontMap,t);for(const e of Object.keys(t))"unknown"===this.cssFontMap[e][0]&&(this.cssFontMap[e][0]=this.options.unknownFamily)}defineDelimiters(t){Object.assign(this.delimiters,t)}defineRemap(t,e){e&&(Object.hasOwn(this.remapChars,t)||(this.remapChars[t]={}),Object.assign(this.remapChars[t],e))}defineDynamicCharacters(t){for(const e of Object.keys(t)){const s=t[e];for(const t of Object.keys(s.variants))this.defineChars(t,this.flattenRanges(s.variants[t],s));this.defineDelimiters(this.flattenRanges(s.delimiters,s))}}flattenRanges(t,e){const s={};for(const i of t)if(Array.isArray(i))for(let t=i[0];t<=i[1];t++)s[t]=e;else s[i]=e;return s}dynamicFileName(t){const e=t.extension?this.CLASS.dynamicExtensions.get(t.extension).prefix:this.options.dynamicPrefix;return t.file.match(/^(?:[/[]|[a-z]+:\/\/|[a-z]:)/i)?t.file:e+"/"+t.file.replace(/(\.js)?$/,".js")}loadDynamicFile(t){return Sc(this,void 0,void 0,(function*(){return t.failed?Promise.reject(new Error(`dynamic file '${t.file}' failed to load`)):(t.promise||(t.promise=mo(this.dynamicFileName(t)).catch((e=>{t.failed=!0,console.warn(e)}))),t.promise.then((()=>t.setup(this))))}))}loadDynamicFiles(){const t=this.CLASS.dynamicFiles,e=Object.keys(t).map((e=>this.loadDynamicFile(t[e])));for(const t of this.CLASS.dynamicExtensions.values())e.push(...Object.keys(t.files).map((e=>this.loadDynamicFile(t.files[e]))));return Promise.all(e)}loadDynamicFilesSync(){if(!eo.asyncIsSynchronous)throw Error("MathJax(loadDynamicFilesSync): mathjax.asyncLoad must be specified and synchronous\n Try importing #js/../components/require.mjs and #js/util/asyncLoad/node.js");const t=this.CLASS.dynamicFiles;Object.keys(t).forEach((e=>this.loadDynamicFileSync(t[e])));for(const t of this.CLASS.dynamicExtensions.values())Object.keys(t.files).forEach((e=>this.loadDynamicFileSync(t.files[e])))}loadDynamicFileSync(t){if(!t.promise){t.promise=Promise.resolve();try{eo.asyncLoad(this.dynamicFileName(t))}catch(e){t.failed=!0,console.warn(e)}t.setup(this)}}addDynamicFontCss(t,e){}getDelimiter(t){const e=this.delimiters[t];return e&&!("dir"in e)?(this.delimiters[t]=null,Pn(this.loadDynamicFile(e)),null):e}getSizeVariant(t,e){const s=this.getDelimiter(t);return s&&s.variants&&(e=s.variants[e]),this.sizeVariants[e]}getStretchVariant(t,e){const s=this.getDelimiter(t);return this.stretchVariants[s.stretchv?s.stretchv[e]:0]}getStretchVariants(t){return[0,1,2,3].map((e=>this.getStretchVariant(t,e)))}getChar(t,e){const s=this.variant[t].chars[e];if(s&&!Array.isArray(s)){const i=this.variant[t];return delete i.chars[e],i.linked.forEach((t=>delete t[e])),Pn(this.loadDynamicFile(s)),null}return s}getVariant(t){return this.variant[t]}getCssFont(t){return this.cssFontMap[t]||["serif",!1,!1]}getFamily(t){return this.cssFamilyPrefix?this.cssFamilyPrefix+", "+t:t}getRemappedChar(t,e){return(this.remapChars[t]||{})[e]}}Mc.OPTIONS={unknownFamily:"serif",dynamicPrefix:"."},Mc.JAX="common",Mc.NAME="",Mc.defaultVariants=[["normal"],["bold","normal"],["italic","normal"],["bold-italic","italic","bold"],["double-struck","bold"],["fraktur","normal"],["bold-fraktur","bold","fraktur"],["script","italic"],["bold-script","bold-italic","script"],["sans-serif","normal"],["bold-sans-serif","bold","sans-serif"],["sans-serif-italic","italic","sans-serif"],["sans-serif-bold-italic","bold-italic","bold-sans-serif"],["monospace","normal"],["-smallop","normal"],["-largeop","normal"],["-tex-calligraphic","italic"],["-tex-bold-calligraphic","bold-italic"],["-tex-oldstyle","normal"],["-tex-bold-oldstyle","bold"],["-tex-mathit","italic"],["-tex-variant","normal"]],Mc.defaultCssFonts={normal:["unknown",!1,!1],bold:["unknown",!1,!0],italic:["unknown",!0,!1],"bold-italic":["unknown",!0,!0],"double-struck":["unknown",!1,!0],fraktur:["unknown",!1,!1],"bold-fraktur":["unknown",!1,!0],script:["cursive",!1,!1],"bold-script":["cursive",!1,!0],"sans-serif":["sans-serif",!1,!1],"bold-sans-serif":["sans-serif",!1,!0],"sans-serif-italic":["sans-serif",!0,!1],"sans-serif-bold-italic":["sans-serif",!0,!0],monospace:["monospace",!1,!1],"-smallop":["unknown",!1,!1],"-largeop":["unknown",!1,!1],"-tex-calligraphic":["cursive",!0,!1],"-tex-bold-calligraphic":["cursive",!0,!0],"-tex-oldstyle":["unknown",!1,!1],"-tex-bold-oldstyle":["unknown",!1,!0],"-tex-mathit":["unknown",!0,!1],"-tex-variant":["unknown",!1,!1]},Mc.defaultCssFamilyPrefix="",Mc.VariantSmp={bold:[119808,119834,120488,120514,120782,{988:120778,989:120779}],italic:[119860,119886,120546,120572],"bold-italic":[119912,119938,120604,120630],script:[119964,119990],"bold-script":[120016,120042],fraktur:[120068,120094],"double-struck":[120120,120146,,,120792],"bold-fraktur":[120172,120198],"sans-serif":[120224,120250,,,120802],"bold-sans-serif":[120276,120302,120662,120688,120812],"sans-serif-italic":[120328,120354],"sans-serif-bold-italic":[120380,120406,120720,120746],monospace:[120432,120458,,,120822]},Mc.SmpRanges=[[0,65,90],[1,97,122],[2,913,937],[3,945,969],[4,48,57]],Mc.SmpRemap={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},Mc.SmpRemapGreekU={8711:25,1012:17},Mc.SmpRemapGreekL={977:27,981:29,982:31,1008:28,1009:30,1013:26,8706:25},Mc.defaultAccentMap={94:"\u02c6",126:"\u02dc",768:"\u02cb",769:"\u02ca",770:"\u02c6",771:"\u02dc",772:"\u02c9",774:"\u02d8",775:"\u02d9",776:"\xa8",778:"\u02da",780:"\u02c7",8594:"\u20d7"},Mc.defaultMoMap={45:"\u2212"},Mc.defaultMnMap={45:"\u2212"},Mc.defaultParams={x_height:.442,quad:1,num1:.676,num2:.394,num3:.444,denom1:.686,denom2:.345,sup1:.413,sup2:.363,sup3:.289,sub1:.15,sub2:.247,sup_drop:.386,sub_drop:.05,delim1:2.39,delim2:1,axis_height:.25,rule_thickness:.06,big_op_spacing1:.111,big_op_spacing2:.167,big_op_spacing3:.2,big_op_spacing4:.6,big_op_spacing5:.1,surd_height:.06,scriptspace:.05,nulldelimiterspace:.12,delimiterfactor:901,delimitershortfall:.3,rule_factor:1.25,min_rule_thickness:1.25,separation_factor:1.75,extra_ic:.033,extender_factor:.333},Mc.defaultDelimiters={},Mc.defaultChars={},Mc.defaultSizeVariants=[],Mc.defaultStretchVariants=[],Mc.dynamicFiles={},Mc.dynamicExtensions=new Map;class Dc extends vo{static from(t,e,s=null){const i=new this;return Object.assign(i,t),i.lineLeading=e,s&&(i.indentData=s),i}constructor(t,e=null){super(t),this.indentData=null,this.isFirst=!1,this.originalL=this.L,e&&(this.start=e)}append(t){this.isFirst&&(t.originalL+=t.L,t.L=0),t.indentData&&(this.indentData=t.indentData),this.lineLeading=t.lineLeading,super.append(t),this.isFirst=t.isFirst}copy(){const t=Dc.from(this,this.lineLeading);return t.indentData=this.indentData,t.lineLeading=this.lineLeading,t}getIndentData(t){let{indentalign:e,indentshift:s,indentalignfirst:i,indentshiftfirst:r,indentalignlast:n,indentshiftlast:o}=t.attributes.getAllAttributes();"indentalign"===i&&(i=t.attributes.getInherited("indentalign")),"indentshift"===r&&(r=t.attributes.getInherited("indentshift")),"indentalign"===n&&(n=e),"indentshift"===o&&(o=s),this.indentData=[[i,r],[e,s],[n,o]]}copyIndentData(t){return t.indentData.map((([t,e])=>[t,e]))}}const Pc=1e6;class Bc extends Kn{breakToWidth(t,e){}}class Fc extends Bc{constructor(){super(...arguments),this.PENALTY={newline:t=>0,nobreak:t=>Pc,goodbreak:t=>t-200*this.state.depth,badbreak:t=>t+200*this.state.depth,auto:t=>t},this.FACTORS={depth:t=>t+800*this.state.depth,width:t=>t+Math.floor((this.state.width-this.state.w)/this.state.width*2500),tail:t=>t+Math.floor(this.state.width/Math.max(1e-4,this.state.mathLeft-this.state.w)*500),open:(t,e)=>{const s=e.node.prevClass;if(s===fr.BIN||s===fr.REL||s===fr.OP)return t+5e3;const i=this.getPrevious(e);if(i&&("postfix"!==i.attributes.get("form")||"nobreak"===i.attributes.get("linebreak")))return t+5e3;const r=e.node.Parent;if((null==r?void 0:r.isKind("mmultiscripts"))&&e.node===this.getFirstToken(r)){if(!!r.childNodes.filter((t=>t.isKind("mprescripts"))).length)return Pc}return t-500},close:(t,e)=>{var s;const i=e.node.Parent;return!(null==i?void 0:i.isKind("msubsup"))||i.isKind("mmultiscripts")&&(null===(s=i.childNodes[1])||void 0===s?void 0:s.isKind("mprescripts"))||e.node!==this.getLastToken(i.childNodes[0])?t+500:Pc},space:(t,e)=>{const s=e;if(!s.canBreak)return Pc;const i=s.getBBox().w;return i<0?Pc:i<1?t:t-100*(i+4)},separator:t=>t+500,fuzz:t=>.99*t},this.TEXCLASS={[fr.BIN]:t=>t-250,[fr.REL]:t=>t-500}}breakToWidth(t,e){const s=this.state;this.state=this.createState(t),this.state.width=e;const i=t.breakCount;for(let s=0;s<=i;s++){(t.lineBBox[s]||t.getLineBBox(s)).w>e&&this.breakLineToWidth(t,s)}for(const[t,e]of this.state.breaks){if(null===e){const e=t.coreMO();e.setBreakStyle(e.node.attributes.get("linebreakstyle")||"before")}else t.setBreakAt(e);t.invalidateBBox()}this.state=s}createState(t){const e=t.getBBox().w;return{breaks:new Set,potential:[],width:0,w:0,prevWidth:0,prevBreak:null,depth:0,mathWidth:e,mathLeft:e}}breakLineToWidth(t,e){const s=this.state;s.potential=[],s.w=0,s.prevWidth=0,s.prevBreak=null,s.depth=0,this.visitNode(t,e)}addWidth(t,e=null){null===e&&(e=t.L+t.w+t.R),e&&(e*=t.rscale,this.state.w+=e,this.state.potential.length&&(this.state.potential[0][4]+=e),this.processBreak())}processBreak(){const t=this.state;for(;t.potential.length&&t.w>this.state.width;){const e=t.potential.pop(),[s,,i,r,n]=e;t.breaks.add(s),t.w=t.potential.reduce(((t,e)=>t+e[4]),r+n),t.prevBreak&&t.prevWidth+i<=t.width?(t.breaks.delete(t.prevBreak[0]),t.prevWidth+=i):t.prevWidth=i+r,t.potential.forEach((t=>t[2]-=i)),t.prevBreak=e,t.mathLeft-=i}}pushBreak(t,e,s,i){var r;const n=this.state;if(!(e>=Pc||0===n.w&&0===n.prevWidth)){for(;n.potential.length&&n.potential[0][1]>this.FACTORS.fuzz(e);){const t=n.potential.shift();n.potential.length&&(n.potential[0][4]+=t[4])}n.potential.unshift([[t,i],e,n.w-((null===(r=n.prevBreak)||void 0===r?void 0:r[3])||0),s,0])}}getBorderLR(t){var e;const s=t.styleData;if(!s)return[0,0];const i=(null===(e=null==s?void 0:s.border)||void 0===e?void 0:e.width)||[0,0,0,0],r=(null==s?void 0:s.padding)||[0,0,0,0];return[i[3]+r[3],i[1]+r[1]]}getFirstToken(t){return t.isToken?t:this.getFirstToken(t.childNodes[0])}getLastToken(t){return t.isToken?t:this.getLastToken(t.childNodes[t.childNodes.length-1])}visitNode(t,e){t&&(this.state.depth++,t.node.isEmbellished&&!t.node.isKind("mo")?this.visitEmbellishedOperator(t,e):super.visitNode(t,e),this.state.depth--)}visitDefault(t,e){var s;const i=t.getLineBBox(e);if(t.node.isToken||t.node.linebreakContainer||!(null===(s=t.childNodes)||void 0===s?void 0:s[0]))this.addWidth(i);else{const[s,r]=this.getBorderLR(t);0===e&&this.addWidth(i,i.L+s),this.visitNode(t.childNodes[0],e),e===t.breakCount&&this.addWidth(i,i.R+r)}}visitEmbellishedOperator(t,e){const s=t.coreMO(),i=Dc.from(t.getOuterBBox(),t.linebreakOptions.lineleading);i.getIndentData(s.node);const r=s.getBreakStyle(s.node.attributes.get("linebreakstyle")),n=s.processIndent("",i.indentData[1][1],"",i.indentData[0][1],this.state.width)[1],o=this.moPenalty(s);if("before"===r)this.pushBreak(t,o,n-i.L,null),this.addWidth(i);else{this.addWidth(i);const e=("after"===r?0:s.multChar?s.multChar.getBBox().w:i.w)+n;this.pushBreak(t,o,e,null)}}visitMoNode(t,e){const s=t,i=Dc.from(s.getOuterBBox(),s.linebreakOptions.lineleading);i.getIndentData(s.node);const r=s.getBreakStyle(s.node.attributes.get("linebreakstyle")),n=s.processIndent("",i.indentData[1][1],"",i.indentData[0][1],this.state.width)[1],o=this.moPenalty(s);if("before"===r)this.pushBreak(t,o,n-i.L,null),this.addWidth(i);else{this.addWidth(i);const e=("after"===r?0:s.multChar?s.multChar.getBBox().w:i.w)+n;this.pushBreak(t,o,e,null)}}moPenalty(t){const{linebreak:e,fence:s,form:i}=t.node.attributes.getList("linebreak","fence","form"),r=this.FACTORS;let n=r.tail(r.width(0));const o=s&&"prefix"===i||t.node.texClass===fr.OPEN,a=s&&"postfix"===i||t.node.texClass===fr.CLOSE;return o&&(n=r.open(n,t),this.state.depth++),a&&(n=r.close(n,t),this.state.depth--),n=(this.TEXCLASS[t.node.texClass]||(t=>t))(n),(this.PENALTY[e]||(t=>t))(r.depth(n))}getPrevious(t){let e=t.node,s=e.parent,i=s.childIndex(e);for(;s&&(s.notParent||s.isKind("mrow"))&&0===i;)e=s,s=e.parent,i=s.childIndex(e);if(!s||!i)return null;const r=s.childNodes[i-1];return r.isEmbellished?r.coreMO():null}visitMspaceNode(t,e){const s=t.getLineBBox(e),i=t;if(i.canBreak){const e=this.mspacePenalty(i);s.getIndentData(t.node);const r=t.processIndent("",s.indentData[1][1],"",s.indentData[0][1],this.state.width)[1];this.pushBreak(t,e,r-s.w,null)}this.addWidth(s)}mspacePenalty(t){const e=t.node.attributes.get("linebreak"),s=this.FACTORS,i=s.space(s.tail(s.width(0)),t);return(this.PENALTY[e]||(t=>t))(s.depth(i))}visitMtextNode(t,e){if(!t.getText().match(/ /))return void this.visitDefault(t,e);const s=t;s.clearBreakPoints();const i=s.textWidth(" "),r=t.getBBox(),[n,o]=this.getBorderLR(t);this.addWidth(r,r.L+n);const a=s.childNodes;for(const e of a.keys()){const n=a[e];if(n.node.isKind("text")){const o=n.node.getText().split(/ /),a=o.pop();for(const n of o.keys())this.addWidth(r,s.textWidth(o[n])),this.pushBreak(t,this.mtextPenalty(),-i,[e,n+1]),this.addWidth(r,i);this.addWidth(r,s.textWidth(a))}else this.addWidth(n.getBBox())}this.addWidth(r,r.R+o)}mtextPenalty(){const t=this.FACTORS;return t.depth(t.tail(t.width(0)))}visitMrowNode(t,e){const s=t.lineBBox[e]||t.getLineBBox(e),[i,r]=s.start||[0,0],[n,o]=s.end||[t.childNodes.length-1,0],[a,l]=this.getBorderLR(t);this.addWidth(s,s.L+a);for(let e=i;e<=n;e++)this.visitNode(t.childNodes[e],e===i?r:e===n?o:0);this.addWidth(s,s.R+l)}visitInferredMrowNode(t,e){this.state.depth--,this.visitMrowNode(t,e),this.state.depth++}visitMfracNode(t,e){const s=t;!s.node.attributes.get("bevelled")&&s.getOuterBBox().w>this.state.width&&(this.breakToWidth(s.childNodes[0],this.state.width),this.breakToWidth(s.childNodes[1],this.state.width)),this.visitDefault(t,e)}visitMsqrtNode(t,e){if(t.getOuterBBox().w>this.state.width){const e=t,s=e.childNodes[e.base];this.breakToWidth(s,this.state.width-e.rootWidth()),e.getStretchedSurd()}this.visitDefault(t,e)}visitMrootNode(t,e){this.visitMsqrtNode(t,e)}visitMsubNode(t,e){this.visitDefault(t,e);const s=t,i=s.getOffset()[0],r=s.scriptChild.getOuterBBox(),[n,o]=this.getBorderLR(t);this.addWidth(s.getLineBBox(e),i+n+r.rscale*r.w+s.font.params.scriptspace+o)}visitMsupNode(t,e){this.visitDefault(t,e);const s=t,i=s.getOffset()[0],r=s.scriptChild.getOuterBBox(),[n,o]=this.getBorderLR(t);this.addWidth(s.getLineBBox(e),i+n+r.rscale*r.w+s.font.params.scriptspace+o)}visitMsubsupNode(t,e){this.visitDefault(t,e);const s=t,i=s.subChild.getOuterBBox(),r=s.supChild.getOuterBBox(),n=s.getAdjustedIc(),o=Math.max(i.rscale*i.w,n+r.rscale*r.w)+s.font.params.scriptspace,[a,l]=this.getBorderLR(t);this.addWidth(t.getLineBBox(e),a+o+l)}visitMmultiscriptsNode(t,e){const s=t,i=s.scriptData;if(i.numPrescripts){const r=Math.max(i.psup.rscale*i.psup.w,i.psub.rscale*i.psub.w);this.addWidth(t.getLineBBox(e),r+s.font.params.scriptspace)}if(this.visitDefault(t,e),i.numScripts){const r=Math.max(i.sup.rscale*i.sup.w,i.sub.rscale*i.sub.w);this.addWidth(t.getLineBBox(e),r+s.font.params.scriptspace)}}visitMfencedNode(t,e){const s=t,i=t.getLineBBox(e),[r,n]=this.getBorderLR(t);0===e&&this.addWidth(i,i.L+r),this.visitNode(s.mrow,e),e===t.breakCount&&this.addWidth(i,i.R+n)}visitMactionNode(t,e){const s=t,i=t.getLineBBox(e),[r,n]=this.getBorderLR(t);0===e&&this.addWidth(i,i.L+r),this.visitNode(s.selected,e),e===t.breakCount&&this.addWidth(i,i.R+n)}}!function(){for(const t of Object.keys(Br.postfix)){const e=Br.postfix[t][3];e&&e.fence&&(e.linebreakstyle="after")}Br.infix["\u2061"]=[...Br.infix["\u2061"]],Br.infix["\u2061"][3]={linebreak:"nobreak"}}();const Uc="@mathjax/%%FONT%%-font";class jc extends er{get forceInlineBreaks(){return!1}constructor(t={},e=null,s=null){const[i,r]=t.fontData instanceof Mc?[t.fontData.constructor,t.fontData]:[t.fontData||s,null],[n,o]=qi(t,i.OPTIONS);super(n),this.factory=this.options.wrapperFactory||new e,this.factory.jax=this,this.styleJson=this.options.styleJson||new lo,this.font=r||new i(o),this.font.setOptions({mathmlSpacing:this.options.mathmlSpacing}),this.constructor.genericFont=i,this.unknownCache=new Map;const a=this.options.linebreaks.LinebreakVisitor||Fc;this.linebreaks=new a(this.factory)}setAdaptor(t){super.setAdaptor(t),"auto"===this.options.htmlHDW&&(this.options.htmlHDW=t.canMeasureNodes?"ignore":"force")}addExtension(t,e=""){return this.font.addExtension(t,e)}typeset(t,e){const s=this.constructor,i=s.genericFont;s.genericFont=this.font.constructor,this.setDocument(e);const r=this.createNode();try{this.toDOM(t,r,e)}finally{s.genericFont=i}return r}createNode(){const t=this.constructor.NAME;return this.html("mjx-container",{class:"MathJax",jax:t})}setScale(t,e){let s=this.getInitialScale()*this.options.scale;if("scale"===e.node.attributes.get("overflow")&&this.math.display){const t=e.getOuterBBox().w,i=Math.max(0,this.math.metrics.containerWidth-4)/this.pxPerEm;t>i&&t&&(s*=i/t)}1!==s&&this.adaptor.setStyle(t,"fontSize",yo(s))}getInitialScale(){return this.math.metrics.scale}toDOM(t,e,s=null){var i;this.setDocument(s),this.math=t,this.container=e,this.pxPerEm=t.metrics.ex/this.font.params.x_height,this.executeFilters(this.preFilters,t,s,e),this.nodeMap=new Map,t.root.attributes.getAllInherited().overflow=this.options.displayOverflow;const r=t.root.attributes.get("overflow");this.adaptor.setAttribute(e,"overflow",r);"linebreak"===r&&this.getLinebreakWidth();const n=this.options.linebreaks.inline&&!t.display;let o=!!t.root.getProperty("inlineMarked");!o||n&&this.forceInlineBreaks===t.root.getProperty("inlineForced")||(this.unmarkInlineBreaks(t.root),t.root.removeProperty("inlineMarked"),t.root.removeProperty("inlineForced"),o=!1),n&&!o&&(this.markInlineBreaks(null===(i=t.root.childNodes)||void 0===i?void 0:i[0]),t.root.setProperty("inlineMarked",!0),t.root.setProperty("inlineForced",this.forceInlineBreaks)),t.root.setTeXclass(null);const a=this.factory.wrap(t.root);this.setScale(e,a),this.processMath(a,e),this.nodeMap=null,this.executeFilters(this.postFilters,t,s,e)}getBBox(t,e){this.setDocument(e),this.math=t,t.root.setTeXclass(null),this.nodeMap=new Map;const s=this.factory.wrap(t.root).getOuterBBox();return this.nodeMap=null,s}getLinebreakWidth(){const t=this.math.metrics.containerWidth/this.pxPerEm,e=this.math.root.attributes.get("maxwidth")||this.options.linebreaks.width;this.containerWidth=xo(e,t,1,this.pxPerEm)}markInlineBreaks(t){if(!t)return;const e=this.forceInlineBreaks;let s=!1,i=!1,r="";for(const n of t.childNodes)if(r)i=this.markInlineBreak(i,e,r,t,n),r="",s=!1;else if(n.isEmbellished){if(n===t.childNodes[0])continue;const o=n.coreMO(),a=o.texClass,l=o.attributes.get("linebreak"),c=o.attributes.get("linebreakstyle");(a===fr.BIN||a===fr.REL||a===fr.ORD&&o.hasSpacingAttributes()||"auto"!==l)&&"nobreak"!==l&&("before"===c?s&&"auto"===l||(i=this.markInlineBreak(i,e,l,t,n,o)):r=l),s="newline"===l&&"after"===c}else if(n.isKind("mspace")){const r=n.attributes.get("linebreak");"nobreak"!==r&&n.canBreak&&(i=this.markInlineBreak(i,e,r,t,n)),s="newline"===r}else s=!1,n.isKind("mstyle")&&!n.attributes.get("style")&&!n.attributes.hasExplicit("mathbackground")||n.isKind("semantics")?(this.markInlineBreaks(n.childNodes[0]),n.getProperty("process-breaks")&&(n.setProperty("inline-breaks",!0),n.childNodes[0].setProperty("inline-breaks",!0),t.parent.setProperty("process-breaks","true"))):n.isKind("mrow")&&n.attributes.get("data-semantic-added")&&(this.markInlineBreaks(n),n.getProperty("process-breaks")&&(n.setProperty("inline-breaks",!0),t.parent.setProperty("process-breaks","true")))}markInlineBreak(t,e,s,i,r,n=null){return r.setProperty("breakable",!0),e&&"newline"!==s?(r.setProperty("forcebreak",!0),null==n||n.setProperty("forcebreak",!0)):(r.removeProperty("forcebreak"),null==n||n.removeProperty("forcebreak"),"newline"===s&&r.setProperty("newline",!0)),t||(i.setProperty("process-breaks",!0),i.parent.setProperty("process-breaks",!0),t=!0),t}unmarkInlineBreaks(t){if(t&&(t.removeProperty("forcebreak"),t.removeProperty("breakable"),t.getProperty("process-breaks"))){t.removeProperty("process-breaks");for(const e of t.childNodes)this.unmarkInlineBreaks(e)}}getMetrics(t){this.setDocument(t);const e=this.adaptor,s=this.getMetricMaps(t);for(const i of t.math){const t=e.parent(i.start.node);if(i.state()<lr.METRICS&&t){const e=s[i.display?1:0],{em:r,ex:n,containerWidth:o,scale:a,family:l}=e.get(t);i.setMetrics(r,n,o,a),this.options.mtextInheritFont&&(i.outputData.mtextFamily=l),this.options.merrorInheritFont&&(i.outputData.merrorFamily=l),i.state(lr.METRICS)}}}getMetricsFor(t,e){const s=this.options.mtextInheritFont||this.options.merrorInheritFont,i=this.getTestElement(t,e),r=Object.assign(Object.assign({},this.measureMetrics(i,s)),{display:e});return this.adaptor.remove(i),r}getMetricMaps(t){const e=this.adaptor,s=[new Map,new Map];for(const i of t.math){const t=e.parent(i.start.node);if(t&&i.state()<lr.METRICS){const e=s[i.display?1:0];e.has(t)||e.set(t,this.getTestElement(t,i.display))}}const i=this.options.mtextInheritFont||this.options.merrorInheritFont,r=[new Map,new Map];for(const t of r.keys())for(const e of s[t].keys())r[t].set(e,this.measureMetrics(s[t].get(e),i));for(const t of r.keys())for(const i of s[t].values())e.remove(i);return r}getTestElement(t,e){const s=this.adaptor;if(!this.testInline){this.testInline=this.html("mjx-test",{style:{display:"inline-block",width:"100%","font-style":"normal","font-weight":"normal","font-size":"100%","font-size-adjust":"none","text-indent":0,"text-transform":"none","letter-spacing":"normal","word-spacing":"normal",overflow:"hidden",height:"1px","margin-right":"-1px"}},[this.html("mjx-left-box",{style:{display:"inline-block",width:0,float:"left"}}),this.html("mjx-ex-box",{style:{position:"absolute",overflow:"hidden",width:"1px",height:"60ex"}}),this.html("mjx-right-box",{style:{display:"inline-block",width:0,float:"right"}})]),this.testDisplay=s.clone(this.testInline),s.setStyle(this.testDisplay,"display","table"),s.setStyle(this.testDisplay,"margin-right",""),s.setStyle(s.firstChild(this.testDisplay),"display","none");const t=s.lastChild(this.testDisplay);s.setStyle(t,"display","table-cell"),s.setStyle(t,"width","10000em"),s.setStyle(t,"float","")}return s.append(t,s.clone(e?this.testDisplay:this.testInline))}measureMetrics(t,e){const s=this.adaptor,i=e?s.fontFamily(t):"",r=s.fontSize(t),[n,o]=s.nodeSize(s.childNode(t,1)),a=n?o/60:r*this.options.exFactor;return{em:r,ex:a,containerWidth:n?"table"===s.getStyle(t,"display")?s.nodeSize(s.lastChild(t))[0]-1:s.nodeBBox(s.lastChild(t)).left-s.nodeBBox(s.firstChild(t)).left-2:1e6,scale:Math.max(this.options.minScale,this.options.matchFontHeight?a/this.font.params.x_height/r:1),family:i}}styleSheet(t){if(this.setDocument(t),this.styleJson.clear(),this.styleJson.addStyles(this.constructor.commonStyles),"getStyles"in t)for(const e of t.getStyles())this.styleJson.addStyles(e);this.addWrapperStyles(this.styleJson),this.addFontStyles(this.styleJson);return this.html("style",{id:"MJX-styles"},[this.text("\n"+this.styleJson.cssText+"\n")])}addFontStyles(t){t.addStyles(this.font.styles)}addWrapperStyles(t){for(const e of this.factory.getKinds())this.addClassStyles(this.factory.getNodeClass(e),t)}addClassStyles(t,e){t.addStyles(e,this)}insertStyles(t){}setDocument(t){t&&(this.document=t,this.adaptor.document=t.document)}html(t,e={},s=[],i){return this.adaptor.node(t,e,s,i)}text(t){return this.adaptor.text(t)}fixed(t,e=3){return Math.abs(t)<6e-4?"0":t.toFixed(e).replace(/\.?0+$/,"")}measureText(t,e,s=["",!1,!1]){const i=this.unknownText(t,e);if("-explicitFont"===e){const t=this.cssFontStyles(s);this.adaptor.setAttributes(i,{style:t})}return this.measureTextNodeWithCache(i,t,e,s)}measureTextNodeWithCache(t,e,s,i=["",!1,!1]){"-explicitFont"===s&&(s=[i[0],i[1]?"T":"F",i[2]?"T":"F",""].join("-")),this.unknownCache.has(s)||this.unknownCache.set(s,new Map);const r=this.unknownCache.get(s),n=r.get(e);if(n)return n;const o=this.measureTextNode(t);return r.set(e,o),o}cssFontStyles(t,e={}){const[s,i,r]=t;return e["font-family"]=this.font.getFamily(s),i&&(e["font-style"]="italic"),r&&(e["font-weight"]="bold"),e}getFontData(t){return t||(t=new Wo),[this.font.getFamily(t.get("font-family")),"italic"===t.get("font-style"),"bold"===t.get("font-weight")]}}jc.NAME="Common",jc.OPTIONS=Object.assign(Object.assign({},er.OPTIONS),{scale:1,minScale:.5,mtextInheritFont:!1,merrorInheritFont:!1,mtextFont:"",merrorFont:"serif",mathmlSpacing:!1,skipAttributes:{},exFactor:.5,displayAlign:"center",displayIndent:"0",displayOverflow:"overflow",linebreaks:{inline:!0,width:"100%",lineleading:.2,LinebreakVisitor:null},font:"",fontExtensions:[],htmlHDW:"auto",wrapperFactory:null,fontData:null,fontPath:Uc,styleJson:null}),jc.commonStyles={'mjx-container[overflow="scroll"][display]':{overflow:"auto clip","min-width":"initial !important"},'mjx-container[overflow="truncate"][display]':{overflow:"hidden clip","min-width":"initial !important"},"mjx-container[display]":{display:"block","text-align":"center","justify-content":"center",margin:".7em 0",padding:".3em 2px"},'mjx-container[display][width="full"]':{display:"flex"},'mjx-container[justify="left"]':{"text-align":"left","justify-content":"left"},'mjx-container[justify="right"]':{"text-align":"right","justify-content":"right"}};const qc=4,Hc=1,Wc=2,Vc=.067,Gc=.2,Xc=Vc+"em solid",zc={top:0,right:1,bottom:2,left:3},Kc=Object.keys(zc),Jc=t=>new Array(4).fill(t.thickness+t.padding),$c=t=>new Array(4).fill(t.padding),Yc=t=>new Array(4).fill(t.thickness),Qc=t=>Math.max(t.padding,t.thickness*(t.arrowhead.x+t.arrowhead.dx+1)),Zc=(t,e)=>{if(t.childNodes[0]){const{h:s,d:i}=t.childNodes[0].getBBox();e[0]=e[2]=Math.max(0,t.thickness*t.arrowhead.y-(s+i)/2)}return e},th=(t,e)=>{if(t.childNodes[0]){const{w:s}=t.childNodes[0].getBBox();e[1]=e[3]=Math.max(0,t.thickness*t.arrowhead.y-s/2)}return e},eh={up:[-Math.PI/2,!1,!0,"verticalstrike"],down:[Math.PI/2,!1,!0,"verticakstrike"],right:[0,!1,!1,"horizontalstrike"],left:[Math.PI,!1,!1,"horizontalstrike"],updown:[Math.PI/2,!0,!0,"verticalstrike uparrow downarrow"],leftright:[0,!0,!1,"horizontalstrike leftarrow rightarrow"]},sh={updiagonal:[-1,0,!1,"updiagonalstrike northeastarrow"],northeast:[-1,0,!1,"updiagonalstrike updiagonalarrow"],southeast:[1,0,!1,"downdiagonalstrike"],northwest:[1,Math.PI,!1,"downdiagonalstrike"],southwest:[-1,Math.PI,!1,"updiagonalstrike"],northeastsouthwest:[-1,0,!0,"updiagonalstrike northeastarrow updiagonalarrow southwestarrow"],northwestsoutheast:[1,0,!0,"downdiagonalstrike northwestarrow southeastarrow"]},ih={up:t=>th(t,[Qc(t),0,t.padding,0]),down:t=>th(t,[t.padding,0,Qc(t),0]),right:t=>Zc(t,[0,Qc(t),0,t.padding]),left:t=>Zc(t,[0,t.padding,0,Qc(t)]),updown:t=>th(t,[Qc(t),0,Qc(t),0]),leftright:t=>Zc(t,[0,Qc(t),0,Qc(t)])},rh=function(t){return e=>{const s=zc[e];return[e,{renderer:t,bbox:t=>{const e=[0,0,0,0];return e[s]=t.thickness+t.padding,e},border:t=>{const e=[0,0,0,0];return e[s]=t.thickness,e}}]}},nh=function(t){return(e,s,i)=>{const r=zc[s],n=zc[i];return[e,{renderer:t,bbox:t=>{const e=t.thickness+t.padding,s=[0,0,0,0];return s[r]=s[n]=e,s},border:t=>{const e=[0,0,0,0];return e[r]=e[n]=t.thickness,e},remove:s+" "+i}]}},oh=function(t){return e=>{const s="mjx-"+e.charAt(0)+"strike";return[e+"diagonalstrike",{renderer:t(s),bbox:Jc}]}},ah=function(t){return e=>{const[s,i,r,n]=sh[e];return[e+"arrow",{renderer:(e,n)=>{const[o,a]=e.arrowAW(),l=e.arrow(a,s*(o-i),r);t(e,l)},bbox:t=>{const{a:e,x:s,y:i}=t.arrowData(),[r,n,o]=[t.arrowhead.x,t.arrowhead.y,t.arrowhead.dx],[a,l]=t.getArgMod(r+o,n),c=i+(a>e?t.thickness*l*Math.sin(a-e):0),h=s+(a>Math.PI/2-e?t.thickness*l*Math.sin(a+e-Math.PI/2):0);return[c,h,c,h]},remove:n}]}},lh=function(t){return e=>{const[s,i,r,n]=eh[e];return[e+"arrow",{renderer:(e,n)=>{const{w:o,h:a,d:l}=e.getBBox(),[c,h]=r?[a+l,"X"]:[o,"Y"],d=e.getOffset(h),u=e.arrow(c,s,i,h,d);t(e,u)},bbox:ih[e],remove:n}]}},ch=2/18,hh=5/18;function dh(t,e,s){return e?t?ch:hh:t?s<ch?0:ch:s}const uh={[No(0)]:"0",[No(2/18)]:"1",[No(3/18)]:"2",[No(4/18)]:"3",[No(5/18)]:"4",[No(6/18)]:"5"};class ph extends Zn{static addStyles(t,e){t.addStyles(this.styles)}get jax(){return this.factory.jax}get adaptor(){return this.factory.jax.adaptor}get metrics(){return this.factory.jax.math.metrics}get containerWidth(){return this.parent?this.parent.containerWidth:this.jax.containerWidth}get linebreaks(){return this.jax.linebreaks}get linebreakOptions(){return this.jax.options.linebreaks}get fixesPWidth(){return!this.node.notParent&&!this.node.isToken}get breakCount(){if(this._breakCount<0){const t=this.node;this._breakCount=t.isEmbellished?this.coreMO().embellishedBreakCount:t.arity<0&&!t.linebreakContainer&&this.childNodes[0].isStack?this.childNodes[0].breakCount:0}return this._breakCount}breakTop(t,e){return this.node.linebreakContainer||!this.parent?t:this.parent.breakTop(t,this)}constructor(t,e,s=null){super(t,e),this.parent=null,this.dom=null,this.removedStyles=null,this.styles=null,this.styleData=null,this.variant="",this.bboxComputed=!1,this._breakCount=-1,this.lineBBox=[],this.stretch=kc,this.font=null,this.parent=s,this.font=t.jax.font,this.bbox=vo.zero(),this.getStyles(),this.getStyleData(),this.getVariant(),this.getScale(),this.getSpace(),this.childNodes=e.childNodes.map((t=>{const s=this.wrap(t);return s.bbox.pwidth&&(e.notParent||e.isKind("math"))&&(this.bbox.pwidth=vo.fullWidth),s}))}wrap(t,e=null){const s=this.factory.wrap(t,e||this);return e&&e.childNodes.push(s),this.jax.nodeMap.set(t,s),s}getBBox(t=!0){if(this.bboxComputed)return this.bbox;const e=t?this.bbox:vo.zero();return this.computeBBox(e),this.bboxComputed=t,e}getOuterBBox(t=!0){var e;const s=this.getBBox(t);if(!this.styleData)return s;const i=this.styleData.padding,r=(null===(e=this.styleData.border)||void 0===e?void 0:e.width)||[0,0,0,0],n=s.copy();for(const[,t,e]of vo.boxSides)n[e]+=i[t]+r[t];return n}getUnbrokenHD(){const t=this.breakCount+1;let e=0,s=0;for(let i=0;i<t;i++){const{h:t,d:r}=this.getLineBBox(i);t>e&&(e=t),r>s&&(s=r)}return[e,s]}computeBBox(t,e=!1){t.empty();for(const e of this.childNodes)t.append(e.getOuterBBox());t.clean(),this.fixesPWidth&&this.setChildPWidths(e)&&this.computeBBox(t,!0)}getLineBBox(t){if(!this.lineBBox[t]){const e=this.breakCount;if(e){const s=this.embellishedBBox(t)||this.computeLineBBox(t);this.lineBBox[t]=s,0===t&&(!this.node.isKind("mo")&&this.node.isEmbellished?s.originalL=this.getBBox().L:s.L=this.getBBox().L),t===e&&(s.R=this.getBBox().R)}else{const e=this.getOuterBBox();this.lineBBox[t]=Dc.from(e,this.linebreakOptions.lineleading)}}return this.lineBBox[t]}embellishedBBox(t){if(!this.node.isEmbellished||this.node.isKind("mo"))return null;const e=this.coreMO();return e.moLineBBox(t,e.embellishedBreakStyle,this.getOuterBBox())}computeLineBBox(t){return this.getChildLineBBox(this.childNodes[0],t)}getBreakNode(t){var e,s;if(!t.start)return[this,null];const[i,r]=t.start;if(this.node.isEmbellished)return[this,this.coreMO()];const n=(null===(s=null===(e=this.childNodes[0])||void 0===e?void 0:e.node)||void 0===s?void 0:s.isInferred)||this.node.isKind("semantics")?this.childNodes[0].childNodes:this.childNodes;return this.node.isToken||!n[i]?[this,null]:n[i].getBreakNode(n[i].getLineBBox(r))}getChildLineBBox(t,e){const s=this.breakCount;let i=t.getLineBBox(e);return(this.styleData||this.bbox.L||this.bbox.R)&&(i=i.copy()),this.addMiddleBorders(i),0===e?(i.L+=this.bbox.L,this.addLeftBorders(i)):e===s&&(i.R+=this.bbox.R,this.addRightBorders(i)),i}addLeftBorders(t){var e;if(!this.styleData)return;const s=this.styleData.border,i=this.styleData.padding;t.w+=((null===(e=null==s?void 0:s.width)||void 0===e?void 0:e[3])||0)+((null==i?void 0:i[3])||0)}addMiddleBorders(t){var e,s;if(!this.styleData)return;const i=this.styleData.border,r=this.styleData.padding;t.h+=((null===(e=null==i?void 0:i.width)||void 0===e?void 0:e[0])||0)+((null==r?void 0:r[0])||0),t.d+=((null===(s=null==i?void 0:i.width)||void 0===s?void 0:s[2])||0)+((null==r?void 0:r[2])||0)}addRightBorders(t){var e;if(!this.styleData)return;const s=this.styleData.border,i=this.styleData.padding;t.w+=((null===(e=null==s?void 0:s.width)||void 0===e?void 0:e[1])||0)+((null==i?void 0:i[1])||0)}setChildPWidths(t,e=null,s=!0){if(t)return!1;s&&(this.bbox.pwidth="");let i=!1;for(const r of this.childNodes){const n=r.getBBox();n.pwidth&&r.setChildPWidths(t,null===e?n.w:e,s)&&(i=!0)}return i}breakToWidth(t){}invalidateBBox(t=!0){(this.bboxComputed||this._breakCount>=0)&&(this.bboxComputed=!1,this.lineBBox=[],this._breakCount=-1,this.parent&&t&&this.parent.invalidateBBox())}copySkewIC(t){var e,s,i;const r=this.childNodes[0];(null===(e=null==r?void 0:r.bbox)||void 0===e?void 0:e.sk)&&(t.sk=r.bbox.sk),(null===(s=null==r?void 0:r.bbox)||void 0===s?void 0:s.dx)&&(t.dx=r.bbox.dx);const n=this.childNodes[this.childNodes.length-1];(null===(i=null==n?void 0:n.bbox)||void 0===i?void 0:i.ic)&&(t.ic=n.bbox.ic,t.w+=t.ic)}getStyles(){const t=this.node.attributes.getExplicit("style");if(!t)return;const e=this.styles=new Wo(t);for(let t=0,s=ph.removeStyles.length;t<s;t++){const s=ph.removeStyles[t];e.get(s)&&(this.removedStyles||(this.removedStyles={}),this.removedStyles[s]=e.get(s),e.set(s,""))}}getStyleData(){if(!this.styles)return;const t=Array(4).fill(0),e=Array(4).fill(0),s=Array(4),i=Array(4);let r=!1,n=!1;for(const[o,a]of vo.boxSides){const l="border"+o,c=this.styles.get(l+"Width");c&&(n=!0,e[a]=Math.max(0,this.length2em(c,1)),s[a]=this.styles.get(l+"Style")||"solid",i[a]=this.styles.get(l+"Color"));const h=this.styles.get("padding"+o);h&&(r=!0,t[a]=Math.max(0,this.length2em(h,1)))}this.styleData=r||n?{padding:t,border:n?{width:e,style:s,color:i}:null}:null}getVariant(){if(!this.node.isToken)return;const t=this.node.attributes;let e=t.get("mathvariant");if(t.hasExplicit("mathvariant"))this.font.getVariant(e)||(console.warn(`Invalid variant: ${e}`),e="normal");else{const s=t.getList("fontfamily","fontweight","fontstyle");if(this.removedStyles){const t=this.removedStyles;t.fontFamily&&(s.family=t.fontFamily),t.fontWeight&&(s.weight=t.fontWeight),t.fontStyle&&(s.style=t.fontStyle)}s.fontfamily&&(s.family=s.fontfamily),s.fontweight&&(s.weight=s.fontweight),s.fontstyle&&(s.style=s.fontstyle),s.weight&&s.weight.match(/^\d+$/)&&(s.weight=parseInt(s.weight)>600?"bold":"normal"),s.family?e=this.explicitVariant(s.family,s.weight,s.style):(this.node.getProperty("variantForm")&&(e="-tex-variant"),e=(ph.BOLDVARIANTS[s.weight]||{})[e]||e,e=(ph.ITALICVARIANTS[s.style]||{})[e]||e)}this.variant=e}explicitVariant(t,e,s){let i=this.styles;return i||(i=this.styles=new Wo),i.set("fontFamily",t),e&&i.set("fontWeight",e),s&&i.set("fontStyle",s),"-explicitFont"}getScale(){let t=1;const e=this.parent,s=e?e.bbox.scale:1,i=this.node.attributes,r=Math.min(i.get("scriptlevel"),2);let n=i.get("fontsize"),o=this.node.isToken||this.node.isKind("mstyle")?i.get("mathsize"):i.getInherited("mathsize");if(0!==r&&(t=Math.pow(i.get("scriptsizemultiplier"),r)),this.removedStyles&&this.removedStyles.fontSize&&!n&&(n=this.removedStyles.fontSize),n&&!i.hasExplicit("mathsize")&&(o=n),"1"!==o&&(t*=this.length2em(o,1,1)),0!==r){const e=this.length2em(i.get("scriptminsize"),.4,1);t<e&&(t=e)}this.bbox.scale=t,this.bbox.rscale=t/s}getSpace(){const t=this.isTopEmbellished(),e=this.node.hasSpacingAttributes();this.jax.options.mathmlSpacing||e?t&&this.getMathMLSpacing():this.getTeXSpacing(t,e)}getMathMLSpacing(){const t=this.node.coreMO(),e=t.coreParent(),s=e.parent;if(!s||!s.isKind("mrow")||1===s.childNodes.length)return;const i=s.childIndex(e);if(null===i)return;const r=t.getProperty("noDictDef"),n=t.attributes,o=n.get("scriptlevel")>0;if(this.bbox.L=n.isSet("lspace")?Math.max(0,this.length2em(n.get("lspace"))):dh(o,r,t.lspace),this.bbox.R=n.isSet("rspace")?Math.max(0,this.length2em(n.get("rspace"))):dh(o,r,t.rspace),!i)return;const a=s.childNodes[i-1];if(!a.isEmbellished)return;const l=this.jax.nodeMap.get(a).getBBox();l.R&&(this.bbox.L=Math.max(0,this.bbox.L-l.R))}getTeXSpacing(t,e){if(!e){const t=this.node.texSpacing();t&&(this.bbox.L=this.length2em(t))}if(t||e){const t=this.node.coreMO().attributes;t.isSet("lspace")&&(this.bbox.L=Math.max(0,this.length2em(t.get("lspace")))),t.isSet("rspace")&&(this.bbox.R=Math.max(0,this.length2em(t.get("rspace"))))}}isTopEmbellished(){return this.node.isEmbellished&&!(this.node.parent&&this.node.parent.isEmbellished)}core(){return this.jax.nodeMap.get(this.node.core())}coreMO(){return this.jax.nodeMap.get(this.node.coreMO())}coreRScale(){let t=this.bbox.rscale,e=this.coreMO();for(;e!==this&&e;)t*=e.bbox.rscale,e=e.parent;return t}getRScale(){let t=1,e=this;for(;e;)t*=e.bbox.rscale,e=e.parent;return t}getText(){let t="";if(this.node.isToken)for(const e of this.node.childNodes)e instanceof Cr&&(t+=e.getText());return t}canStretch(t){if(this.stretch=kc,this.node.isEmbellished){const e=this.core();e&&e.node!==this.node&&e.canStretch(t)&&(this.stretch=e.stretch)}return this.stretch.dir!==Lc.None}getAlignShift(){let{indentalign:t,indentshift:e,indentalignfirst:s,indentshiftfirst:i}=this.node.attributes.getAllAttributes();return"indentalign"!==s&&(t=s),"indentshift"!==i&&(e=i),this.processIndent(t,e)}processIndent(t,e,s="",i="",r=this.metrics.containerWidth){if(!this.jax.math.display)return["left",0];s&&"auto"!==s||(s=this.jax.math.root.getProperty("inlineMarked")?"left":this.jax.options.displayAlign),i&&"auto"!==i||(i=this.jax.math.root.getProperty("inlineMarked")?"0":this.jax.options.displayIndent),"auto"===t&&(t=s),"auto"===e&&(e=i,"right"!==t||e.match(/^\s*0[a-z]*\s*$/)||(e=("-"+e.trim()).replace(/^--/,"")));return[t,this.length2em(e,r)]}getAlignX(t,e,s){return"right"===s?t-(e.w+e.R)*e.rscale:"left"===s?e.L*e.rscale:(t-e.w*e.rscale)/2}getAlignY(t,e,s,i,r){return"top"===r?t-s:"bottom"===r?i-e:"center"===r?(t-s-(e-i))/2:0}getWrapWidth(t){return this.childNodes[t].getBBox().w}getChildAlign(t){return"left"}percent(t){return yo(t)}em(t){return No(t)}px(t,e=-go){return Ao(t,e,this.metrics.em)}length2em(t,e=1,s=null){null===s&&(s=this.bbox.scale);const i=this.font.params.rule_thickness,r=Hi(t,{medium:1,thin:2/3,thick:5/3},0);return r?r*i:xo(t,e,s,this.jax.pxPerEm)}unicodeChars(t,e=this.variant){let s=jr(t);const i=this.font.getVariant(e);if(i&&i.chars){const t=i.chars;s=s.map((e=>{var s,i;return(null===(i=null===(s=t[e])||void 0===s?void 0:s[3])||void 0===i?void 0:i.smp)||e}))}return s}remapChars(t){return t}mmlText(t){return this.node.factory.create("text").setText(t)}mmlNode(t,e={},s=[]){return this.node.factory.create(t,e,s)}createMo(t){const e=this.node.factory,s=e.create("text").setText(t),i=e.create("mo",{stretchy:!0},[s]);i.inheritAttributesFrom(this.node),i.parent=this.node.parent;const r=this.wrap(i);return r.parent=this,r}getVariantChar(t,e){const s=this.font.getChar(t,e)||[0,0,0,{unknown:!0}];return 3===s.length&&(s[3]={}),s}html(t,e={},s=[]){return this.jax.html(t,e,s)}}ph.kind="unknown",ph.styles={},ph.removeStyles=["fontSize","fontFamily","fontWeight","fontStyle","fontVariant","font"],ph.skipAttributes={fontfamily:!0,fontsize:!0,fontweight:!0,fontstyle:!0,color:!0,background:!0,class:!0,href:!0,style:!0,xmlns:!0},ph.BOLDVARIANTS={bold:{normal:"bold",italic:"bold-italic",fraktur:"bold-fraktur",script:"bold-script","sans-serif":"bold-sans-serif","sans-serif-italic":"sans-serif-bold-italic"},normal:{bold:"normal","bold-italic":"italic","bold-fraktur":"fraktur","bold-script":"script","bold-sans-serif":"sans-serif","sans-serif-bold-italic":"sans-serif-italic"}},ph.ITALICVARIANTS={italic:{normal:"italic",bold:"bold-italic","sans-serif":"sans-serif-italic","bold-sans-serif":"sans-serif-bold-italic"},normal:{italic:"normal","bold-italic":"bold","sans-serif-italic":"sans-serif","sans-serif-bold-italic":"bold-sans-serif"}};class mh extends to{constructor(){super(...arguments),this.jax=null}get Wrappers(){return this.node}}function gh(t){return class extends t{computeBBox(t,e=!1){super.computeBBox(t,e),this.childNodes[0]&&this.childNodes[0].bbox.ic&&(t.ic=this.childNodes[0].bbox.ic)}}}function fh(t){return class extends t{remappedText(t,e){const s=this.parent.stretch.c;return s?[s]:this.parent.remapChars(this.unicodeChars(t,e))}computeBBox(t,e=!1){const s=this.parent.variant,i=this.node.getText();if("-explicitFont"===s){const e=this.jax.getFontData(this.parent.styles),{w:r,h:n,d:o}=this.jax.measureText(i,s,e);t.h=n,t.d=o,t.w=r}else{const e=this.remappedText(i,s);let r="";t.empty();for(let i=0;i<e.length;i++){const[n,o,a,l]=this.getVariantChar(s,e[i]);if(l.unknown)r+=String.fromCodePoint(e[i]);else{if(r=this.addUtextBBox(t,r,s),this.updateBBox(t,n,o,a),t.ic=l.ic||0,t.sk=l.sk||0,t.dx=l.dx||0,!l.oc||i<e.length-1)continue;const c=this.parent.childNodes;if(this.node!==c[c.length-1].node)continue;const h=this.parent.parent.node;let d=h.isKind("mrow")||h.isInferred?h.childNodes[h.childIndex(this.parent.node)+1]:null;(null==d?void 0:d.isKind("mo"))&&"\u2062"===d.getText()&&(d=h.childNodes[h.childIndex(d)+1]),d&&d.attributes.get("mathvariant")===s?t.oc=l.oc:t.ic=l.oc}}this.addUtextBBox(t,r,s),e.length>1&&(t.sk=0),t.clean()}}addUtextBBox(t,e,s){if(e){const{h:i,d:r,w:n}=this.jax.measureText(e,s);this.updateBBox(t,i,r,n)}return""}updateBBox(t,e,s,i){t.w+=i,e>t.h&&(t.h=e),s>t.d&&(t.d=s)}getStyles(){}getVariant(){}getScale(){}getSpace(){}}}function bh(t){class e extends t{constructor(t,e,s=null){super(t,e,s),this.rscale=this.getRScale()}computeBBox(t,e=!1){const s=this.node.getXML(),i=this.getHDW(s,"use","force"),{h:r,d:n,w:o}=i?this.splitHDW(i):this.measureXmlNode(s);t.w=o,t.h=r,t.d=n}getHTML(){let t=this.adaptor.clone(this.node.getXML());const e=this.getFontStyles();return(this.getHDW(t,"force")||1!==this.jax.options.scale)&&(t=this.addHDW(t,e)),this.html("mjx-html",{variant:this.parent.variant,style:e},[t])}getHDW(t,e,s=e){const i=this.jax.options.htmlHDW,r=this.adaptor.getAttribute(t,"data-mjx-hdw");return!r||i!==e&&i!==s?null:r}splitHDW(t){const e=1/this.metrics.scale,[s,i,r]=Wr(t).map((t=>this.length2em(t||"0")*e));return{h:s,d:i,w:r}}getFontStyles(){var t;const e=this.adaptor,s=this.metrics;return{"font-family":(null===(t=this.parent.styles)||void 0===t?void 0:t.get("font-family"))||s.family||e.fontFamily(e.parent(this.jax.math.start.node))||"initial","font-size":this.jax.fixed(s.em*this.rscale)+"px"}}measureXmlNode(t){const e=this.adaptor,s=this.html("mjx-xml-block",{style:{display:"inline-block"}},[e.clone(t)]),i=this.html("mjx-baseline",{style:{display:"inline-block",width:0,height:0}}),r=this.getFontStyles(),n=this.html("mjx-measure-xml",{style:r},[i,s]),o=this.jax.container;e.append(e.parent(this.jax.math.start.node),o),e.append(o,n);const a=this.metrics,l=a.em*a.scale*this.rscale,{left:c,right:h,bottom:d,top:u}=e.nodeBBox(s),p=(h-c)/l,m=(e.nodeBBox(i).top-u)/l,g=(d-u)/l-m;return e.remove(o),e.remove(n),{w:p,h:m,d:g}}getStyles(){}getScale(){}getVariant(){}}return e.autoStyle=!1,e.styles={"mjx-measure-xml":{position:"absolute",left:0,top:0,display:"inline-block","line-height":"normal","white-space":"normal"},"mjx-html":{display:"inline-block","line-height":"normal","text-align":"initial","white-space":"initial"},"mjx-html-holder":{display:"block",position:"absolute",top:0,left:0,bottom:0,right:0}},e}mh.defaultNodes={};const Eh={dx:".2em",dy:".1em",postDelay:600,clearDelay:100,hoverTimer:new Map,clearTimer:new Map,stopTimers:(t,e)=>{e.clearTimer.has(t)&&(clearTimeout(e.clearTimer.get(t)),e.clearTimer.delete(t)),e.hoverTimer.has(t)&&(clearTimeout(e.hoverTimer.get(t)),e.hoverTimer.delete(t))}};function xh(t){return class extends t{get selected(){const t=this.node.attributes.get("selection"),e=Math.max(1,Math.min(this.childNodes.length,t))-1;return this.childNodes[e]||this.wrap(this.node.selected)}getParameters(){const t=this.node.attributes.get("data-offsets"),[e,s]=Wr(t||"");this.tipDx=this.length2em(e||Eh.dx),this.tipDy=this.length2em(s||Eh.dy)}constructor(t,e,s=null){super(t,e,s);const i=this.constructor.actions,r=this.node.attributes.get("actiontype"),[n,o]=i.get(r)||[(t,e)=>{},{}];this.action=n,this.data=o,this.getParameters()}computeBBox(t,e=!1){t.updateFrom(this.selected.getOuterBBox()),this.selected.setChildPWidths(e)}get breakCount(){return this.node.isEmbellished?this.selected.coreMO().embellishedBreakCount:this.selected.breakCount}computeLineBBox(t){return this.getChildLineBBox(this.selected,t)}}}function yh(t){return class extends t{getWrapWidth(t){return this.parent?this.getBBox().w:this.metrics.containerWidth/this.jax.pxPerEm}computeBBox(t,e=!1){super.computeBBox(t,e);const s=this.node.attributes;if(!this.parent&&this.jax.math.display&&"linebreak"===s.get("overflow")){const e=this.containerWidth;t.w>e&&this.childNodes[0].breakToWidth(e),t.updateFrom(this.childNodes[0].getBBox())}}}}function Nh(t){return class extends t{getParameters(){const t=this.node.attributes,e=t.get("data-padding");void 0!==e&&(this.padding=this.length2em(e,Gc));const s=t.get("data-thickness");void 0!==s&&(this.thickness=this.length2em(s,Vc));const i=t.get("data-arrowhead");if(void 0!==i){const[t,e,s]=Wr(i);this.arrowhead={x:t?parseFloat(t):qc,y:e?parseFloat(e):Wc,dx:s?parseFloat(s):Hc}}}getNotations(){const t=this.constructor.notations;for(const e of Wr(this.node.attributes.get("notation"))){const s=t.get(e);s&&(this.notations[e]=s,s.renderChild&&(this.renderChild=s.renderer))}}removeRedundantNotations(){for(const t of Object.keys(this.notations))if(this.notations[t]){const e=this.notations[t].remove||"";for(const t of e.split(/ /))delete this.notations[t]}}initializeNotations(){for(const t of Object.keys(this.notations)){const e=this.notations[t].init;e&&e(this)}}getBBoxExtenders(){const t=[0,0,0,0];for(const e of Object.keys(this.notations))this.maximizeEntries(t,this.notations[e].bbox(this));return t}getPadding(){const t=[0,0,0,0];for(const e of Object.keys(this.notations)){const s=this.notations[e].border;s&&this.maximizeEntries(t,s(this))}return[0,1,2,3].map((e=>this.TRBL[e]-t[e]))}maximizeEntries(t,e){for(let s=0;s<t.length;s++)t[s]<e[s]&&(t[s]=e[s])}getOffset(t){const[e,s,i,r]=this.TRBL,n=("X"===t?s-r:i-e)/2;return Math.abs(n)>.001?n:0}getArgMod(t,e){return[Math.atan2(e,t),Math.sqrt(t*t+e*e)]}arrow(t,e,s,i="",r=0){return null}arrowData(){const[t,e]=[this.padding,this.thickness],s=e*(this.arrowhead.x+Math.max(1,this.arrowhead.dx)),{h:i,d:r,w:n}=this.childNodes[0].getBBox(),o=i+r,a=Math.sqrt(o*o+n*n),l=Math.max(t,s*n/a),c=Math.max(t,s*o/a),[h,d]=this.getArgMod(n+2*l,o+2*c);return{a:h,W:d,x:l,y:c}}arrowAW(){const{h:t,d:e,w:s}=this.childNodes[0].getBBox(),[i,r,n,o]=this.TRBL;return this.getArgMod(o+s+r,i+t+e+n)}createMsqrt(t){const e=this.node.factory.create("msqrt");e.inheritAttributesFrom(this.node),e.childNodes[0]=t.node;const s=this.wrap(e);return s.parent=this,s}sqrtTRBL(){const t=this.msqrt.getBBox(),e=this.msqrt.childNodes[0].getBBox();return[t.h-e.h,0,t.d-e.d,t.w-e.w]}constructor(t,e,s=null){super(t,e,s),this.notations={},this.renderChild=null,this.msqrt=null,this.padding=Gc,this.thickness=Vc,this.arrowhead={x:qc,y:Wc,dx:Hc},this.TRBL=[0,0,0,0],this.getParameters(),this.getNotations(),this.removeRedundantNotations(),this.initializeNotations(),this.TRBL=this.getBBoxExtenders()}computeBBox(t,e=!1){const[s,i,r,n]=this.TRBL,o=this.childNodes[0].getBBox();t.combine(o,n,0),t.h+=s,t.d+=r,t.w+=i,this.setChildPWidths(e)}}}function Ah(t){return class extends t{createMrow(){const t=this.node.factory.create("inferredMrow");t.inheritAttributesFrom(this.node),this.mrow=this.wrap(t),this.mrow.parent=this}addMrowChildren(){const t=this.node,e=this.mrow;this.addMo(t.open),this.childNodes.length&&e.childNodes.push(this.childNodes[0]);let s=0;for(const i of this.childNodes.slice(1))this.addMo(t.separators[s++]),e.childNodes.push(i);this.addMo(t.close),e.stretchChildren()}addMo(t){if(!t)return;const e=this.wrap(t);this.mrow.childNodes.push(e),e.parent=this.mrow}constructor(t,e,s=null){super(t,e,s),this.mrow=null,this.createMrow(),this.addMrowChildren()}computeBBox(t,e=!1){t.updateFrom(this.mrow.getOuterBBox()),this.setChildPWidths(e)}get breakCount(){return this.mrow.breakCount}computeLineBBox(t){return this.mrow.getLineBBox(t)}}}function vh(t){return class extends t{getFractionBBox(t,e,s){const i=this.childNodes[0].getOuterBBox(),r=this.childNodes[1].getOuterBBox(),n=this.font.params.axis_height,{T:o,u:a,v:l}=this.getTUV(e,s);t.combine(i,0,n+o+Math.max(i.d*i.rscale,a)),t.combine(r,0,n-o-Math.max(r.h*r.rscale,l)),t.w+=2*this.pad+.2}getTUV(t,e){const s=this.font.params,i=s.axis_height,r=(t?3.5:1.5)*e;return{T:(t?3.5:1.5)*e,u:(t?s.num1:s.num2)-i-r,v:(t?s.denom1:s.denom2)+i-r}}getAtopBBox(t,e){const{u:s,v:i,nbox:r,dbox:n}=this.getUVQ(e);t.combine(r,0,s),t.combine(n,0,-i),t.w+=2*this.pad}getUVQ(t){const e=this.childNodes[0].getOuterBBox(),s=this.childNodes[1].getOuterBBox(),i=this.font.params;let[r,n]=t?[i.num1,i.denom1]:[i.num3,i.denom2];const o=(t?7:3)*i.rule_thickness;let a=r-e.d*e.scale-(s.h*s.scale-n);return a<o&&(r+=(o-a)/2,n+=(o-a)/2,a=o),{u:r,v:n,q:a,nbox:e,dbox:s}}getBevelledBBox(t,e){const{u:s,v:i,delta:r,nbox:n,dbox:o}=this.getBevelData(e),a=this.bevel.getOuterBBox();t.combine(n,0,s),t.combine(a,t.w-r/2,0),t.combine(o,t.w-r/2,i)}getBevelData(t){const e=this.childNodes[0].getOuterBBox(),s=this.childNodes[1].getOuterBBox(),i=t?.4:.15,r=Math.max(e.scale*(e.h+e.d),s.scale*(s.h+s.d))+2*i,n=this.font.params.axis_height;return{H:r,delta:i,u:e.scale*(e.d-e.h)/2+n+i,v:s.scale*(s.d-s.h)/2+n-i,nbox:e,dbox:s}}isDisplay(){const{displaystyle:t,scriptlevel:e}=this.node.attributes.getList("displaystyle","scriptlevel");return t&&0===e}constructor(t,e,s=null){if(super(t,e,s),this.bevel=null,this.pad=this.node.getProperty("withDelims")?0:this.font.params.nulldelimiterspace,this.node.attributes.get("bevelled")){const{H:t}=this.getBevelData(this.isDisplay()),e=this.bevel=this.createMo("/");e.node.attributes.set("symmetric",!0),e.canStretch(Lc.Vertical),e.getStretchedVariant([t],!0)}}computeBBox(t,e=!1){t.empty();const{linethickness:s,bevelled:i}=this.node.attributes.getList("linethickness","bevelled"),r=this.isDisplay();let n=null;if(i)this.getBevelledBBox(t,r);else{const e=this.length2em(String(s),.06);n=-2*this.pad,0===e?this.getAtopBBox(t,r):(this.getFractionBBox(t,r,e),n-=.2),n+=t.w}t.clean(),this.setChildPWidths(e,n)}canStretch(t){return!1}getChildAlign(t){const e=this.node.attributes;return e.get("bevelled")?"left":e.get(["numalign","denomalign"][t])}getWrapWidth(t){const e=this.node.attributes;if(e.get("bevelled"))return this.childNodes[t].getOuterBBox().w;return this.getBBox().w-(this.length2em(e.get("linethickness"))?.2:0)-2*this.pad}}}function _h(t){return class extends t{constructor(t,e,s=null){super(t,e,s),this.getParameters()}getParameters(){const{width:t,height:e,valign:s,src:i,index:r}=this.node.attributes.getList("width","height","valign","src","index");if(i)this.width="auto"===t?1:this.length2em(t),this.height="auto"===e?1:this.length2em(e),this.valign=this.length2em(s||"0");else{const t=String.fromCodePoint(parseInt(r)),e=this.node.factory;this.charWrapper=this.wrap(e.create("text").setText(t)),this.charWrapper.parent=this}}computeBBox(t,e=!1){this.charWrapper?t.updateFrom(this.charWrapper.getBBox()):(t.w=this.width,t.h=this.height+this.valign,t.d=-this.valign)}}}function wh(t){return class extends t{computeBBox(t,e=!1){super.computeBBox(t),this.copySkewIC(t)}}}const Th={base:"subList",subList:"supList",supList:"subList",psubList:"psupList",psupList:"psubList"},Ch=["sup","sup","psup","psub"];function Lh(t){return class extends t{combinePrePost(t,e){const s=new vo(t);return s.combine(e,0,0),s}getScriptData(){const t=this.scriptData={base:null,sub:vo.empty(),sup:vo.empty(),psub:vo.empty(),psup:vo.empty(),numPrescripts:0,numScripts:0},e=this.getScriptBBoxLists();this.combineBBoxLists(t.sub,t.sup,e.subList,e.supList),this.combineBBoxLists(t.psub,t.psup,e.psubList,e.psupList),t.base=e.base[0],t.numPrescripts=e.psubList.length,t.numScripts=e.subList.length}getScriptBBoxLists(){const t={base:[],subList:[],supList:[],psubList:[],psupList:[]};let e="base";for(const s of this.childNodes)s.node.isKind("mprescripts")?e="psubList":(t[e].push(s.getOuterBBox()),e=Th[e]);return this.firstPrescript=t.subList.length+t.supList.length+2,this.padLists(t.subList,t.supList),this.padLists(t.psubList,t.psupList),t}padLists(t,e){t.length>e.length&&e.push(vo.empty())}combineBBoxLists(t,e,s,i){for(let r=0;r<s.length;r++){const[n,o,a]=this.getScaledWHD(s[r]),[l,c,h]=this.getScaledWHD(i[r]),d=Math.max(n,l);t.w+=d,e.w+=d,o>t.h&&(t.h=o),a>t.d&&(t.d=a),c>e.h&&(e.h=c),h>e.d&&(e.d=h)}}getScaledWHD(t){const{w:e,h:s,d:i,rscale:r}=t;return[e*r,s*r,i*r]}getCombinedUV(){const t=this.scriptData,e=this.combinePrePost(t.sub,t.psub),s=this.combinePrePost(t.sup,t.psup);return this.getUVQ(e,s)}addPrescripts(t,e,s){const i=this.scriptData;if(i.numPrescripts){const r=this.font.params.scriptspace;t.combine(i.psup,r,e),t.combine(i.psub,r,s)}return t}addPostscripts(t,e,s){const i=this.scriptData;if(i.numScripts){const r=t.w;t.combine(i.sup,r,e),t.combine(i.sub,r,s),t.w+=this.font.params.scriptspace}return t}constructor(...t){super(...t),this.scriptData=null,this.firstPrescript=0,this.getScriptData()}appendScripts(t){t.empty();const[e,s]=this.getCombinedUV();return this.addPrescripts(t,e,s),t.append(this.scriptData.base),this.addPostscripts(t,e,s),t.clean(),t}computeLineBBox(t){const e=this.baseChild.breakCount,s=this.baseChild.getLineBBox(t).copy();let i=s;const[r,n]=this.getCombinedUV();return 0===t?(i=Dc.from(this.addPrescripts(vo.zero(),r,n),this.linebreakOptions.lineleading),i.append(s),this.addLeftBorders(i),i.L=this.bbox.L):t===e&&(i=this.addPostscripts(i,r,n),this.addRightBorders(i),i.R=this.bbox.R),this.addMiddleBorders(i),i}getUVQ(t,e){if(!this.UVQ){let[s,i,r]=[0,0,0];0===t.w?s=this.getU():0===e.w?s=-this.getV():[s,i,r]=super.getUVQ(t,e),this.UVQ=[s,i,r]}return this.UVQ}}}function Ih(t){return class extends t{remapChars(t){if(t.length){const e=this.font.getRemappedChar("mn",t[0]);if(e){const s=this.unicodeChars(e,this.variant);1===s.length?t[0]=s[0]:t=s.concat(t.slice(1))}}return t}}}function Rh(t){return class extends t{get breakCount(){return this.breakStyle?1:0}get embellishedBreakCount(){return this.embellishedBreakStyle?1:0}get embellishedBreakStyle(){return this.breakStyle||this.getBreakStyle()}protoBBox(t){const e=this.stretch.dir!==Lc.None;e&&null===this.size&&this.getStretchedVariant([0]),e&&this.size<0||(super.computeBBox(t),0!==t.w||!this.node.attributes.hasExplicit("fence")||""!==this.node.getText()||this.node.texClass!==fr.OPEN&&this.node.texClass!==fr.CLOSE||this.jax.options.mathmlSpacing||(t.R=this.font.params.nulldelimiterspace),this.copySkewIC(t))}getAccentOffset(){const t=vo.empty();return this.protoBBox(t),-t.w/2}getCenterOffset(t=null){return t||(t=vo.empty(),super.computeBBox(t)),(t.h+t.d)/2+this.font.params.axis_height-t.h}getStretchedVariant(t,e=!1){if(this.stretch.dir===Lc.None)return;let s=this.getWH(t);const i=this.getSize("minsize",0),r=this.getSize("maxsize",1/0),n=this.node.getProperty("mathaccent");s=Math.max(i,Math.min(r,s));const o=this.font.params.delimiterfactor/1e3,a=this.font.params.delimitershortfall,l=i||e?s:n?Math.min(s/o,s+a):Math.max(s*o,s-a),c=this.getText().codePointAt(0);let h=this.stretch;this.size&&(this.stretch=h=this.font.getDelimiter(c),this.size=null);const d=h.c||c;let u=0;if(h.sizes)for(const t of h.sizes){if(t>=l)return n&&u&&u--,void this.setDelimSize(d,u);u++}h.stretch?(this.size=-1,this.invalidateBBox(),this.getStretchBBox(t,this.checkExtendedHeight(s,h),h)):this.setDelimSize(d,u-1)}setDelimSize(t,e){const s=this.stretch;this.variant=this.font.getSizeVariant(t,e),this.size=e;const i=s.schar&&s.schar[Math.min(e,s.schar.length-1)]||t;this.stretch=Object.assign(Object.assign({},s),{c:i}),this.childNodes[0].invalidateBBox()}getSize(t,e){const s=this.node.attributes;return s.isSet(t)&&(e=this.length2em(s.get(t),1,1)),e}getWH(t){if(0===t.length)return 0;if(1===t.length)return t[0];const[e,s]=t,i=this.font.params.axis_height;return this.node.attributes.get("symmetric")?2*Math.max(e-i,s+i):e+s}getStretchBBox(t,e,s){Object.hasOwn(s,"min")&&s.min>e&&(e=s.min);let[i,r,n]=s.HDW;if(this.stretch.dir===Lc.Vertical)[i,r]=this.getBaseline(t,e,s);else if(n=e,this.stretch.hd&&!this.jax.options.mathmlSpacing){const t=this.font.params.extender_factor;i=i*(1-t)+this.stretch.hd[0]*t,r=r*(1-t)+this.stretch.hd[1]*t}this.bbox.h=i,this.bbox.d=r,this.bbox.w=n}getBaseline(t,e,s){const i=2===t.length&&t[0]+t[1]===e,r=this.node.attributes.get("symmetric"),[n,o]=i?t:[e,0];let[a,l]=[n+o,0];if(r){const t=this.font.params.axis_height;i&&(a=2*Math.max(n-t,o+t)),l=a/2-t}else if(i)l=o;else{const[t,e]=s.HDW||[.75,.25];l=e*(a/(t+e))}return[a-l,l]}checkExtendedHeight(t,e){if(e.fullExt){const[s,i]=e.fullExt;t=i+Math.ceil(Math.max(0,t-i)/s)*s}return t}setBreakStyle(t=""){var e;if(this.breakStyle=(null===(e=this.node.parent)||void 0===e?void 0:e.isEmbellished)&&!t?"":this.getBreakStyle(t),this.breakCount&&this.multChar){const t=this.parent.node.childIndex(this.node),e=this.parent.node.childNodes[t+1];e&&e.setTeXclass(this.multChar.node)}}getBreakStyle(t=""){const e=this.node.attributes;let s=t||("newline"===e.get("linebreak")||this.node.getProperty("forcebreak")?e.get("linebreakstyle"):"");return"infixlinebreakstyle"===s&&(s=e.get(s)),s}getMultChar(){const t=this.node.attributes.get("linebreakmultchar");t&&"\u2062"===this.getText()&&"\u2062"!==t&&(this.multChar=this.createMo(t))}constructor(t,e,s=null){super(t,e,s),this.size=null,this.isAccent=this.node.isAccent,this.getMultChar(),this.setBreakStyle()}computeBBox(t,e=!1){if(this.protoBBox(t),this.node.attributes.get("symmetric")&&this.stretch.dir!==Lc.Horizontal){const e=this.getCenterOffset(t);t.h+=e,t.d-=e}this.node.getProperty("mathaccent")&&(this.stretch.dir===Lc.None||this.size>=0)&&(t.w=0)}computeLineBBox(t){return this.moLineBBox(t,this.breakStyle)}moLineBBox(t,e,s=null){const i=this.node.attributes.get("lineleading"),r=this.length2em(i,this.linebreakOptions.lineleading);if(0===t&&"before"===e){const t=Dc.from(vo.zero(),r);return t.originalL=this.bbox.L,this.bbox.L=0,t}let n=Dc.from(s||this.getOuterBBox(),r);return 1===t&&("after"===e?(n.w=n.h=n.d=0,n.isFirst=!0,this.bbox.R=0):"duplicate"===e?n.L=0:this.multChar&&(n=Dc.from(this.multChar.getOuterBBox(),r)),n.getIndentData(this.node)),n}canStretch(t){if(this.stretch.dir!==Lc.None)return this.stretch.dir===t;if(!this.node.attributes.get("stretchy"))return!1;const e=this.getText();if(1!==Array.from(e).length)return!1;const s=this.font.getDelimiter(e.codePointAt(0));return this.stretch=s&&s.dir===t?s:kc,this.stretch.dir!==Lc.None}getVariant(){this.node.attributes.get("largeop")?this.variant=this.node.attributes.get("displaystyle")?"-largeop":"-smallop":this.node.attributes.hasExplicit("mathvariant")||!1!==this.node.getProperty("pseudoscript")?super.getVariant():this.variant="-tex-variant"}remapChars(t){const e=this.node.getProperty("primes");if(e)return jr(e);if(1===t.length){const e=this.node.coreParent().parent,s=this.isAccent&&!e.isKind("mrow")?"accent":"mo",i=this.font.getRemappedChar(s,t[0]);i&&(t=this.unicodeChars(i,this.variant))}return t}}}function Sh(t){return class extends t{get containerWidth(){const t=this.node.attributes,e=t.get("width").toString();return e.match(/^[-+]|%$/)||"linebreak"!==t.get("data-overflow")?this.parent.containerWidth:this.length2em(e)}getDimens(){const t=this.node.attributes.getList("width","height","depth","lspace","voffset"),e=this.childNodes[0].getOuterBBox();let{w:s,h:i,d:r}=e;const n=s,o=i,a=r;let l=0,c=0,h=0;""!==t.width&&(s=this.dimen(t.width,e,"w",0)),""!==t.height&&(i=this.dimen(t.height,e,"h",0)),""!==t.depth&&(r=this.dimen(t.depth,e,"d",0)),""!==t.voffset&&(c=this.dimen(t.voffset,e)),""!==t.lspace&&(l=this.dimen(t.lspace,e));const d=this.node.attributes.get("data-align");return d&&(h=this.getAlignX(s,e,d)),[o,a,n,i-o,r-a,s-n,l,c,h]}dimen(t,e,s="",i=null){const r=(t=String(t)).match(/width|height|depth/),n=r?e[r[0].charAt(0)]:s?e[s]:0;let o=this.length2em(t,n)||0;return t.match(/^[-+]/)&&s&&(o+=n),null!=i&&(o=Math.max(i,o)),o}setBBoxDimens(t){const[e,s,i,r,n,o]=this.getDimens();t.w=i+o,t.h=e+r,t.d=s+n}computeBBox(t,e=!1){this.setBBoxDimens(t);if(this.childNodes[0].getOuterBBox().w>t.w){const e=this.node.attributes.get("data-overflow");("linebreak"===e||"auto"===e&&"linebreak"===this.jax.math.root.attributes.get("overflow"))&&(this.childNodes[0].breakToWidth(t.w),this.setBBoxDimens(t))}this.setChildPWidths(e,t.w)}getWrapWidth(t){return this.getBBox().w}getChildAlign(t){return this.node.attributes.get("data-align")||"left"}}}function kh(t){return class extends t{get root(){return 1}combineRootBBox(t,e,s){const i=this.childNodes[this.root].getOuterBBox(),r=this.getRootDimens(e,s)[1];t.combine(i,0,r)}getRootDimens(t,e){const s=this.surd,i=this.childNodes[this.root].getOuterBBox(),r=(s.size<0?.5:.6)*t.w,{w:n,rscale:o}=i,a=Math.max(n,r/o),l=Math.max(0,a-n);return[a*o-r,this.rootHeight(i,t,s.size,e),l]}rootHeight(t,e,s,i){const r=e.h+e.d;return(s<0?1.9:.55*r)-(r-i)+Math.max(0,t.d*t.rscale)}rootWidth(){const t=this.childNodes[this.root].getOuterBBox();return.4+t.w*t.rscale}}}function Oh(t){return class extends t{stretchChildren(){const t=[];for(const e of this.childNodes)e.canStretch(Lc.Vertical)&&t.push(e);const e=t.length,s=this.childNodes.length;if(e&&s>1){let i=0,r=0;const n=e>1&&e===s;for(const t of this.childNodes){const e=t.stretch.dir===Lc.None;if(n||e){const e=t.getBBox().rscale;let[s,n]=t.getUnbrokenHD();s*=e,n*=e,s>i&&(i=s),n>r&&(r=n)}}for(const e of t){const t=e.coreRScale();e.coreMO().getStretchedVariant([i/t,r/t])}}}get fixesPWidth(){return!1}get breakCount(){return this._breakCount<0&&(this._breakCount=this.childNodes.length?this.childNodes.reduce(((t,e)=>t+e.breakCount),0):0),this._breakCount}breakTop(t,e){const s=this;return this.isStack?this.parent.breakTop(s,s):s}constructor(t,e,s=null){super(t,e,s),this.dh=0;const i=this;this.isStack=!this.parent||this.parent.node.isInferred||this.parent.breakTop(i,i)!==i,this.stretchChildren();for(const t of this.childNodes)if(t.bbox.pwidth){this.bbox.pwidth=vo.fullWidth;break}}computeBBox(t,e=!1){const s=this.breakCount;this.lineBBox=s?[new Dc({h:.75,d:.25,w:0},[0,0])]:[],t.empty();for(const e of this.childNodes.keys()){const i=this.childNodes[e];t.append(i.getOuterBBox()),s&&this.computeChildLineBBox(i,e)}t.clean(),s&&!this.coreMO().node.isEmbellished&&this.computeLinebreakBBox(t),this.fixesPWidth&&this.setChildPWidths(e)&&this.computeBBox(t,!0),this.vboxAdjust(t)}computeLinebreakBBox(t){var e;t.empty();const s=this.isStack,i=this.lineBBox,r=i.length-1;if(s)for(const t of i.keys()){const e=i[t];this.addMiddleBorders(e),0===t&&this.addLeftBorders(e),t===r&&this.addRightBorders(e)}let n=0;for(const s of i.keys()){const r=i[s];t.combine(r,0,n),n-=Math.max(.25,r.d)+r.lineLeading+Math.max(.75,(null===(e=i[s+1])||void 0===e?void 0:e.h)||0)}s?(i[0].L=this.bbox.L,i[r].R=this.bbox.R):(t.w=Math.max(...this.lineBBox.map((t=>t.w))),this.shiftLines(t),this.jax.math.display||this.linebreakOptions.inline||(t.pwidth=vo.fullWidth,this.node.isInferred&&(this.parent.bbox.pwidth=vo.fullWidth))),t.clean()}vboxAdjust(t){if(!this.parent)return;const e=this.breakCount,s=this.parent.node.attributes.get("data-vertical-align");if(e&&"bottom"===s)this.dh=e?t.d-this.lineBBox[e-1].d:0;else{if(!("center"===s||e&&"middle"===s))return void(this.dh=0);{const{h:e,d:s}=t,i=this.font.params.axis_height;this.dh=(e+s)/2+i-e}}t.h+=this.dh,t.d-=this.dh}computeChildLineBBox(t,e){const s=this.lineBBox[this.lineBBox.length-1];s.end=[e,0],s.append(t.getLineBBox(0));const i=t.breakCount+1;if(1!==i)for(let s=1;s<i;s++){const i=new Dc({h:.75,d:.25,w:0});i.start=i.end=[e,s],i.isFirst=!0,i.append(t.getLineBBox(s)),this.lineBBox.push(i)}}getLineBBox(t){return this.getBBox(),this.isStack?super.getLineBBox(t):Dc.from(this.getOuterBBox(),this.linebreakOptions.lineleading)}shiftLines(t){var e,s;const i=t.w,r=this.lineBBox,n=r.length-1,[o,a]=(null===(e=r[1].indentData)||void 0===e?void 0:e[0])||["left","0"];for(const e of r.keys()){const l=r[e],[c,h]=0===e?[o,a]:(null===(s=l.indentData)||void 0===s?void 0:s[e===n?2:1])||["left","0"],[d,u]=this.processIndent(c,h,o,a,i);l.L=0,l.L=this.getAlignX(i,l,d)+u;const p=l.L+l.w;p>t.w&&(t.w=p)}}setChildPWidths(t,e=null,s=!0){return this.breakCount?!t&&(null!==e&&this.bbox.w!==e&&(this.bbox.w=e,this.shiftLines(this.bbox)),!0):super.setChildPWidths(t,e,s)}breakToWidth(t){this.linebreaks.breakToWidth(this,t)}}}function Mh(t){return class extends t{getScale(){this.bbox.scale=this.parent.bbox.scale,this.bbox.rscale=1}}}function Dh(t){return class extends t{createText(t){const e=this.wrap(this.mmlText(t));return e.parent=this,e}constructor(t,e,s=null){super(t,e,s);const i=this.node.attributes,r=i.getList("lquote","rquote");"monospace"!==this.variant&&(i.isSet("lquote")||'"'!==r.lquote||(r.lquote="\u201c"),i.isSet("rquote")||'"'!==r.rquote||(r.rquote="\u201d")),this.childNodes.unshift(this.createText(r.lquote)),this.childNodes.push(this.createText(r.rquote))}}}function Ph(t){return class extends t{get canBreak(){return this.node.canBreak}get breakCount(){return this.breakStyle?1:0}setBreakStyle(t=""){this.breakStyle=t||(this.node.hasNewline||this.node.getProperty("forcebreak")?"before":"")}constructor(t,e,s=null){super(t,e,s),this.setBreakStyle()}computeBBox(t,e=!1){const s=this.node.attributes;t.w=this.length2em(s.get("width"),0),t.h=this.length2em(s.get("height"),0),t.d=this.length2em(s.get("depth"),0)}computeLineBBox(t){const e=this.node.attributes.get("data-lineleading"),s=this.length2em(e,this.linebreakOptions.lineleading),i=Dc.from(vo.zero(),s);return 1===t&&(i.getIndentData(this.node),i.w=this.getBBox().w,i.isFirst=0===i.w),i}}}function Bh(t){return class extends t{get base(){return 0}get root(){return null}combineRootBBox(t,e,s){}getPQ(t){const e=this.font.params.rule_thickness,s=this.font.params.surd_height,i=this.node.attributes.get("displaystyle")?this.font.params.x_height:e;return[i,t.h+t.d>this.surdH?(t.h+t.d-(this.surdH-e-s-i/2))/2:s+i/4]}getRootDimens(t,e){return[0,0,0,0]}rootWidth(){return 1.25}getStretchedSurd(){const t=this.font.params.rule_thickness,e=this.font.params.surd_height,s=this.node.attributes.get("displaystyle")?this.font.params.x_height:t,{h:i,d:r}=this.childNodes[this.base].getOuterBBox();this.surdH=i+r+t+e+s/4,this.surd.getStretchedVariant([this.surdH-r,r],!0)}constructor(t,e,s=null){super(t,e,s),this.surd=this.createMo("\u221a"),this.surd.canStretch(Lc.Vertical),this.getStretchedSurd()}computeBBox(t,e=!1){t.empty();const s=this.surd.getBBox(),i=new vo(this.childNodes[this.base].getOuterBBox()),r=this.getPQ(s)[1],n=this.font.params.rule_thickness,o=this.font.params.surd_height,a=i.h+r+n,[l]=this.getRootDimens(s,a);t.h=a+o,this.combineRootBBox(t,s,a),t.combine(s,l,a-s.h),t.combine(i,l+s.w,0),t.clean(),this.setChildPWidths(e)}invalidateBBox(){super.invalidateBBox(),this.surd.childNodes[0].invalidateBBox()}}}function Fh(t){var e;return(e=class extends t{get scriptChild(){return this.childNodes[this.node.sub]}getOffset(){return[this.baseIsChar?0:this.getAdjustedIc(),-this.getV()]}}).useIC=!1,e}function Uh(t){return class extends t{get scriptChild(){return this.childNodes[this.node.sup]}getOffset(){return[this.getAdjustedIc()-(this.baseRemoveIc?0:this.baseIc),this.getU()]}}}function jh(t){var e;return e=class extends t{constructor(){super(...arguments),this.UVQ=null}get subChild(){return this.childNodes[this.node.sub]}get supChild(){return this.childNodes[this.node.sup]}get scriptChild(){return this.supChild}getUVQ(t=this.subChild.getOuterBBox(),e=this.supChild.getOuterBBox()){const s=this.baseCore,i=s.getLineBBox(s.breakCount);if(this.UVQ)return this.UVQ;const r=this.font.params,n=3*r.rule_thickness,o=this.length2em(this.node.attributes.get("subscriptshift"),r.sub2),a=this.baseCharZero(i.d*this.baseScale+r.sub_drop*t.rscale),l=e.d*e.rscale,c=t.h*t.rscale;let[h,d]=[this.getU(),Math.max(a,o)],u=h-l-(c-d);if(u<n){d+=n-u;const t=.8*r.x_height-(h-l);t>0&&(h+=t,d-=t)}return h=Math.max(this.length2em(this.node.attributes.get("superscriptshift"),h),h),d=Math.max(this.length2em(this.node.attributes.get("subscriptshift"),d),d),u=h-l-(c-d),this.UVQ=[h,-d,u],this.UVQ}appendScripts(t){const[e,s]=[this.subChild.getOuterBBox(),this.supChild.getOuterBBox()],i=this.getBaseWidth(),r=this.getAdjustedIc(),[n,o]=this.getUVQ(),a=t.d-this.baseChild.getLineBBox(this.baseChild.breakCount).d;return t.combine(e,i+(this.baseIsChar?0:r),o-a),t.combine(s,i+r,n-a),t.w+=this.font.params.scriptspace,t}},e.useIC=!1,e}const qh=.333;function Hh(t){return class extends t{get tableRows(){return this.childNodes}findContainer(){let t=this,e=t.parent;for(;e&&(e.node.notParent||e.node.isKind("mrow"));)t=e,e=e.parent;this.container=e,this.containerI=t.node.childPosition()}getPercentageWidth(){if(this.hasLabels)this.bbox.pwidth=vo.fullWidth;else{const t=this.node.attributes.get("width");Hr(t)&&(this.bbox.pwidth=t)}}stretchRows(){const t=this.node.attributes.get("equalrows"),e=t?this.getEqualRowHeight():0,{H:s,D:i}=t?this.getTableData():{H:[0],D:[0]},r=this.tableRows;for(let n=0;n<this.numRows;n++){const o=t?[(e+s[n]-i[n])/2,(e-s[n]+i[n])/2]:null;r[n].stretchChildren(o)}}stretchColumns(){const t=this.getColumnAttributes("columnwidth",0);for(let e=0;e<this.numCols;e++){const s="number"==typeof this.cWidths[e]?this.cWidths[e]:null;this.stretchColumn(e,s),null!==s&&this.breakColumn(e,s,t[e])}}stretchColumn(t,e){const s=[];for(const e of this.tableRows){const i=e.getChild(t);if(i){const t=i.childNodes[0];t.stretch.dir===Lc.None&&t.canStretch(Lc.Horizontal)&&s.push(t)}}const i=s.length;if(i&&null===e){e=0;const s=i===this.childNodes.length;for(const i of this.tableRows){const r=i.getChild(t);if(r){const t=r.childNodes[0],i=t.stretch.dir===Lc.None;if(s||i){const{w:s}=t.getBBox(i);s>e&&(e=s)}}}}if(null!==e){const i=this.getTableData().W;for(const r of s){const s=r.getBBox().w;r.coreMO().getStretchedVariant([Math.max(e,s)/r.coreRScale()]),s>i[t]&&(i[t]=s)}}}breakColumn(t,e,s){if("linebreak"!==this.jax.math.root.attributes.get("overflow")||!this.jax.math.display)return;const{H:i,D:r}=this.getTableData();let n=0,o=0;for(const s of this.tableRows){const a=s.getChild(t);if(a){const l=s.getBBox().rscale,c=a.getBBox();if(a&&c.w*l>e){a.childNodes[0].breakToWidth(e);const o=s.node.attributes.get("rowalign");this.updateHDW(a,t,n,o,i,r)}c.w*l>o&&(o=c.w*l)}const l=s.getBBox();l.h=i[n],l.d=r[n],n++}("fit"===s||"auto"===s||Hr(s)||o>this.cWidths[t])&&(this.cWidths[t]=o)}getTableData(){if(this.data)return this.data;const t=new Array(this.numRows).fill(0),e=new Array(this.numRows).fill(0),s=new Array(this.numCols).fill(0),i=new Array(this.numRows),r=new Array(this.numRows),n=[0],o=this.tableRows;for(let a=0;a<o.length;a++){const l=o[a],c=l.node.attributes.get("rowalign");for(let i=0;i<l.numCells;i++){const r=l.getChild(i);this.updateHDW(r,i,a,c,t,e,s),this.recordPWidthCell(r,i)}i[a]=t[a],r[a]=e[a],l.labeled&&this.updateHDW(l.childNodes[0],0,a,c,t,e,n),l.bbox.h=t[a],l.bbox.d=e[a]}const a=n[0];return this.data={H:t,D:e,W:s,NH:i,ND:r,L:a},this.data}updateHDW(t,e,s,i,r,n,o=null){let{h:a,d:l,w:c}=t.getBBox();const h=t.parent.bbox.rscale;1!==t.parent.bbox.rscale&&(a*=h,l*=h,c*=h),this.node.getProperty("useHeight")&&(a<.75&&(a=.75),l<.25&&(l=.25)),i=t.node.attributes.get("rowalign")||i,Object.hasOwn(this.adjustHD,i)||(i="other"),this.adjustHD[i](a,l,r,n,s),o&&c>o[e]&&(o[e]=c)}recordPWidthCell(t,e){t.childNodes[0]&&t.childNodes[0].getBBox().pwidth&&this.pwidthCells.push([t,e])}setColumnPWidths(){const t=this.cWidths;for(const[e,s]of this.pwidthCells)e.setChildPWidths(!1,t[s])&&(e.invalidateBBox(),e.getBBox())}getBBoxHD(t){const[e,s]=this.getAlignmentRow();if(null===s){const s=this.font.params.axis_height,i=t/2;return{top:[0,t],center:[i,i],bottom:[t,0],baseline:[i,i],axis:[i+s,i-s]}[e]||[i,i]}{const i=this.getVerticalPosition(s,e);return[i,t-i]}}getBBoxLR(){var t;if(this.hasLabels){const t=this.node.attributes,e=t.get("side");let[s,i]=this.getPadAlignShift(e);const r=this.hasLabels&&!!t.get("data-width-includes-label");return r&&this.frame&&this.fSpace[0]&&(s-=this.fSpace[0]),"center"!==i||r?"left"===e?[s,0]:[0,s]:[s,s]}return[(null===(t=this.bbox)||void 0===t?void 0:t.L)||0,0]}getPadAlignShift(t){const{L:e}=this.getTableData();let s=e+this.length2em(this.node.attributes.get("minlabelspacing"));const[i,r]=null==this.styles?["",""]:[this.styles.get("padding-left"),this.styles.get("padding-right")];(i||r)&&(s=Math.max(s,this.length2em(i||"0"),this.length2em(r||"0")));let[n,o]=this.getAlignShift();return n===t&&(o="left"===t?Math.max(s,o)-s:Math.min(-s,o)+s),[s,n,o]}getWidth(){return this.pWidth||this.getBBox().w}adjustWideTable(){const t=this.node.attributes;if("auto"!==t.get("width"))return;const[e,s]=this.getPadAlignShift(t.get("side")),i=Math.max(this.containerWidth/10,this.containerWidth-e-("center"===s?e:0));this.naturalWidth()>i&&this.adjustColumnWidths(i)}naturalWidth(){return Vo(this.getComputedWidths().concat(this.cLines,this.cSpace))+2*this.fLine+this.fSpace[0]+this.fSpace[2]}getEqualRowHeight(){const{H:t,D:e}=this.getTableData(),s=Array.from(t.keys()).map((s=>t[s]+e[s]));return Math.max(...s)}getComputedWidths(){const t=this.getTableData().W;let e=Array.from(t.keys()).map((e=>"number"==typeof this.cWidths[e]?this.cWidths[e]:t[e]));return this.node.attributes.get("equalcolumns")&&(e=Array(e.length).fill(Go(e))),e}getColumnWidths(){const t=this.node.attributes.get("width");if(this.node.attributes.get("equalcolumns"))return this.getEqualColumns(t);const e=this.getColumnAttributes("columnwidth",0);return"auto"===t?this.getColumnWidthsAuto(e):Hr(t)?this.getColumnWidthsPercent(e):this.getColumnWidthsFixed(e,this.length2em(t))}getEqualColumns(t){const e=Math.max(1,this.numCols);let s;if("auto"===t){const{W:t}=this.getTableData();s=Go(t)}else if(Hr(t))s=this.percent(1/e);else{const i=Vo([].concat(this.cLines,this.cSpace))+this.fSpace[0]+this.fSpace[2];s=Math.max(0,this.length2em(t)-i)/e}return Array(this.numCols).fill(s)}getColumnWidthsAuto(t){return t.map((t=>"auto"===t||"fit"===t?null:Hr(t)?t:this.length2em(t)))}getColumnWidthsPercent(t){const e=t.includes("fit"),{W:s}=e?this.getTableData():{W:null};return Array.from(t.keys()).map((i=>{const r=t[i];return"fit"===r?null:"auto"===r?e?s[i]:null:Hr(r)?r:this.length2em(r)}))}getColumnWidthsFixed(t,e){const s=Array.from(t.keys()),i=s.filter((e=>"fit"===t[e])),r=s.filter((e=>"auto"===t[e])),n=i.length||r.length,{W:o}=n?this.getTableData():{W:null},a=e-Vo([].concat(this.cLines,this.cSpace))-this.fSpace[0]-this.fSpace[2];let l=a;s.forEach((e=>{const s=t[e];l-="fit"===s||"auto"===s?o[e]:this.length2em(s,a)}));const c=n&&l>0?l/n:0;return s.map((e=>{const s=t[e];return"fit"===s?o[e]+c:"auto"===s?o[e]+(0===i.length?c:0):this.length2em(s,a)}))}adjustColumnWidths(t){const{W:e}=this.getTableData(),s=this.getColumnAttributes("columnwidth",0),i=Array.from(s.keys()),r=[...i.filter((t=>"fit"===s[t])).sort(((t,s)=>e[s]-e[t])),...i.filter((t=>"auto"===s[t])).sort(((t,s)=>e[s]-e[t])),...i.filter((t=>Hr(s[t]))).sort(((t,s)=>e[s]-e[t])),...i.filter((t=>"fit"!==s[t]&&"auto"!==s[t]&&!Hr(s[t]))).sort(((t,s)=>e[s]-e[t]))];if(!r.length)return;this.cWidths=i.map((t=>"number"==typeof this.cWidths[t]?this.cWidths[t]:e[t]));const n=t-Vo([].concat(this.cLines,this.cSpace))-this.fSpace[0]-this.fSpace[2];let o=Vo(this.cWidths)-n,a=0,l=0;for(;l<r.length&&(a+=e[r[l++]],!(a&&o/a<qh)););o=1-o/a,r.slice(0,l).forEach((t=>this.cWidths[t]*=o))}getVerticalPosition(t,e){const s=this.node.attributes.get("equalrows"),{H:i,D:r}=this.getTableData(),n=s?this.getEqualRowHeight():0,o=this.getRowHalfSpacing();let a=this.fLine;for(let e=0;e<t;e++)a+=o[e]+(s?n:i[e]+r[e])+o[e+1]+this.rLines[e];const[l,c]=s?[(n+i[t]-r[t])/2,(n-i[t]+r[t])/2]:[i[t],r[t]];return a+={top:0,center:o[t]+(l+c)/2,bottom:o[t]+l+c+o[t+1],baseline:o[t]+l,axis:o[t]+l-.25}[e]||0,a}getFrameSpacing(){const t=this.fframe?this.convertLengths(this.getAttributeArray("framespacing")):[0,0];t[2]=t[0];const e=this.node.attributes.get("data-array-padding");if(e){const[s,i]=this.convertLengths(Wr(e));t[0]=s,t[2]=i}return t}getEmHalfSpacing(t,e,s=1){const i=this.addEm(e,2/s);return i.unshift(this.em(t[0]*s)),i.push(this.em(t[1]*s)),i}getRowHalfSpacing(){const t=this.rSpace.map((t=>t/2));return t.unshift(this.fSpace[1]),t.push(this.fSpace[1]),t}getColumnHalfSpacing(){const t=this.cSpace.map((t=>t/2));return t.unshift(this.fSpace[0]),t.push(this.fSpace[2]),t}getAlignmentRow(){const[t,e]=Wr(this.node.attributes.get("align"));if(null==e)return[t,null];let s=parseInt(e);return s<0&&(s+=this.numRows+1),[t,s<1||s>this.numRows?null:s-1]}getColumnAttributes(t,e=1){const s=this.numCols-e,i=this.getAttributeArray(t);if(0===i.length)return null;for(;i.length<s;)i.push(i[i.length-1]);return i.length>s&&i.splice(s),i}getRowAttributes(t,e=1){const s=this.numRows-e,i=this.getAttributeArray(t);if(0===i.length)return null;for(;i.length<s;)i.push(i[i.length-1]);return i.length>s&&i.splice(s),i}getAttributeArray(t){const e=this.node.attributes.get(t);return e?Wr(e):[this.node.attributes.getDefault(t)]}addEm(t,e=1){return t?t.map((t=>this.em(t/e))):null}convertLengths(t){return t?t.map((t=>this.length2em(t))):null}constructor(t,e,s=null){super(t,e,s),this.numCols=0,this.numRows=0,this.data=null,this.pwidthCells=[],this.pWidth=0,this.adjustHD={top:(t,e,s,i,r)=>{t>s[r]&&(i[r]-=t-s[r],s[r]=t),t+e>s[r]+i[r]&&(i[r]=t+e-s[r])},bottom:(t,e,s,i,r)=>{e>i[r]&&(s[r]-=e-i[r],i[r]=e),t+e>s[r]+i[r]&&(s[r]=t+e-i[r])},center:(t,e,s,i,r)=>{t+e>s[r]+i[r]&&(s[r]=i[r]=(t+e)/2)},other:(t,e,s,i,r)=>{t>s[r]&&(s[r]=t),e>i[r]&&(i[r]=e)}},this.numCols=Go(this.tableRows.map((t=>t.numCells))),this.numRows=this.childNodes.length,this.hasLabels=this.childNodes.reduce(((t,e)=>t||e.node.isKind("mlabeledtr")),!1),this.findContainer(),this.isTop=!this.container||this.container.node.isKind("math")&&!this.container.parent,this.isTop&&(this.jax.table=this),this.getPercentageWidth();const i=this.node.attributes,r=i.get("frame");this.frame="none"!==r,this.fframe=this.frame||void 0!==i.get("data-frame-styles"),this.fLine=this.frame?.07:0,this.fSpace=this.getFrameSpacing(),this.cSpace=this.convertLengths(this.getColumnAttributes("columnspacing")),this.rSpace=this.convertLengths(this.getRowAttributes("rowspacing")),this.cLines=this.getColumnAttributes("columnlines").map((t=>"none"===t?0:.07)),this.rLines=this.getRowAttributes("rowlines").map((t=>"none"===t?0:.07)),this.cWidths=this.getColumnWidths(),this.adjustWideTable(),this.stretchColumns(),this.stretchRows()}getStyles(){super.getStyles();const t=this.node.attributes.get("data-frame-styles");if(!t)return;this.styles||(this.styles=new Wo(""));const e=t.split(/ /);for(const t of ko.keys()){const s=e[t];"none"!==s&&this.styles.set(`border-${ko[t]}`,`.07em ${s}`)}}computeBBox(t,e=!1){const{H:s,D:i}=this.getTableData();let r,n;if(this.node.attributes.get("equalrows")){const t=this.getEqualRowHeight();r=Vo([].concat(this.rLines,this.rSpace))+t*this.numRows}else r=Vo(s.concat(i,this.rLines,this.rSpace));r+=2*(this.fLine+this.fSpace[1]),n=this.naturalWidth();const o=this.node.attributes.get("width");"auto"!==o&&(n=Math.max(this.length2em(o,0)+2*this.fLine,n));const[a,l]=this.getBBoxHD(r);t.h=a,t.d=l,t.w=n;const[c,h]=this.getBBoxLR();t.L=c,t.R=h,Hr(o)||this.setColumnPWidths()}setChildPWidths(t,e,s){const i=this.node.attributes.get("width");if(!Hr(i))return!1;this.hasLabels||(this.bbox.pwidth="",this.container.bbox.pwidth="");const{w:r,L:n,R:o}=this.bbox,a=this.node.attributes.get("data-width-includes-label"),l=Math.max(r,this.length2em(i,Math.max(e,n+r+o)))-(a?n+o:0),c=this.node.attributes.get("equalcolumns")?Array(this.numCols).fill(this.percent(1/Math.max(1,this.numCols))):this.getColumnAttributes("columnwidth",0);return this.cWidths=this.getColumnWidthsFixed(c,l),this.pWidth=this.naturalWidth(),this.isTop&&(this.bbox.w=this.pWidth),this.setColumnPWidths(),this.pWidth!==r&&this.parent.invalidateBBox(),this.pWidth!==r}getAlignShift(){return this.isTop?super.getAlignShift():[this.container.getChildAlign(this.containerI),0]}}}function Wh(t){return class extends t{get fixesPWidth(){return!1}invalidateBBox(){this.bboxComputed=!1,this.lineBBox=[]}getWrapWidth(t){const e=this.parent.parent,s=this.parent,i=this.node.childPosition()-(s.labeled?1:0);return"number"==typeof e.cWidths[i]?e.cWidths[i]:e.getTableData().W[i]}getChildAlign(t){return this.node.attributes.get("columnalign")}}}function Vh(t){var e;return e=class extends t{constructor(){super(...arguments),this.breakPoints=[]}textWidth(t){let e=this.textNode;if(!e){const t=this.node.factory.create("text");t.parent=this.node,e=this.textNode=this.factory.wrap(t),e.parent=this}return e.node.setText(t),e.invalidateBBox(!1),e.getBBox().w}get breakCount(){return this.breakPoints.length}getVariant(){const t=this.jax.options,e=this.jax.math.outputData,s=(!!e.merrorFamily||!!t.merrorFont)&&this.node.Parent.isKind("merror");if(e.mtextFamily||t.mtextFont||s){const i=this.node.attributes.get("mathvariant"),r=this.constructor.INHERITFONTS[i]||this.jax.font.getCssFont(i),n=r[0]||(s?e.merrorFamily||t.merrorFont:e.mtextFamily||t.mtextFont);this.variant=this.explicitVariant(n,r[2]?"bold":"",r[1]?"italic":"")}else super.getVariant()}setBreakAt(t){this.breakPoints.push(t)}clearBreakPoints(){this.breakPoints=[]}computeLineBBox(t){const e=Dc.from(this.getOuterBBox(),this.linebreakOptions.lineleading);return this.breakCount?(e.w=this.getBreakWidth(t),0===t?(e.R=0,this.addLeftBorders(e)):(e.L=0,e.indentData=[["left","0"],["left","0"],["left","0"]],t===this.breakCount&&this.addRightBorders(e)),e):e}getBreakWidth(t){const e=this.childNodes;let[s,i]=this.breakPoints[t-1]||[0,0];const[r,n]=this.breakPoints[t]||[e.length,0];let o=e[s].node.getText().split(/ /);if(s===r)return this.textWidth(o.slice(i,n).join(" "));let a=this.textWidth(o.slice(i).join(" "));for(;++s<r&&s<e.length;)a+=e[s].getBBox().w;return s<e.length&&(o=e[s].node.getText().split(/ /),a+=this.textWidth(o.slice(0,n).join(" "))),a}},e.INHERITFONTS={normal:["",!1,!1],bold:["",!1,!0],italic:["",!0,!1],"bold-italic":["",!0,!0]},e}function Gh(t){return class extends t{get numCells(){return this.childNodes.length}get labeled(){return!1}get tableCells(){return this.childNodes}getChild(t){return this.childNodes[t]}getChildBBoxes(){return this.childNodes.map((t=>t.getBBox()))}stretchChildren(t=null){const e=[],s=this.labeled?this.childNodes.slice(1):this.childNodes;for(const t of s){const s=t.childNodes[0];s.canStretch(Lc.Vertical)&&e.push(s)}const i=e.length,r=this.childNodes.length;if(i&&r>1&&!t){let e=0,n=0;const o=i>1&&i===r;for(const t of s){const s=t.childNodes[0],i=s.stretch.dir===Lc.None;if(o||i){const{h:t,d:r}=s.getBBox(i);t>e&&(e=t),r>n&&(n=r)}}t=[e,n]}if(t)for(const s of e){const e=s.coreRScale();s.coreMO().getStretchedVariant(t.map((t=>t*e)))}}get fixesPWidth(){return!1}}}function Xh(t){return class extends t{get numCells(){return Math.max(0,this.childNodes.length-1)}get labeled(){return!0}get tableCells(){return this.childNodes.slice(1)}getChild(t){return this.childNodes[t+1]}getChildBBoxes(){return this.childNodes.slice(1).map((t=>t.getBBox()))}}}function zh(t){return class extends t{get scriptChild(){return this.childNodes[this.node.under]}constructor(...t){super(...t),this.stretchChildren()}computeBBox(t,e=!1){if(this.hasMovableLimits())return void super.computeBBox(t,e);t.empty();const s=this.baseChild.getOuterBBox(),i=this.scriptChild.getOuterBBox(),r=this.getUnderKV(s,i)[1],n=this.isLineBelow?0:this.getDelta(this.scriptChild,!0),[o,a]=this.getDeltaW([s,i],[0,-n]);t.combine(s,o,0),t.combine(i,a,r),t.d+=this.font.params.big_op_spacing5,t.clean(),this.setChildPWidths(e)}}}function Kh(t){return class extends t{get scriptChild(){return this.childNodes[this.node.over]}constructor(...t){super(...t),this.stretchChildren()}computeBBox(t){if(this.hasMovableLimits())return void super.computeBBox(t);t.empty();const e=this.baseChild.getOuterBBox(),s=this.scriptChild.getOuterBBox();this.node.attributes.get("accent")&&(e.h=Math.max(e.h,this.font.params.x_height*this.baseScale));const i=this.getOverKU(e,s)[1],r=this.isLineAbove?0:this.getDelta(this.scriptChild),[n,o]=this.getDeltaW([e,s],[0,r]);t.combine(e,n,0),t.combine(s,o,i),t.h+=this.font.params.big_op_spacing5,t.clean()}}}function Jh(t){return class extends t{get underChild(){return this.childNodes[this.node.under]}get overChild(){return this.childNodes[this.node.over]}get subChild(){return this.underChild}get supChild(){return this.overChild}constructor(...t){super(...t),this.stretchChildren()}computeBBox(t){if(this.hasMovableLimits())return void super.computeBBox(t);t.empty();const e=this.overChild.getOuterBBox(),s=this.baseChild.getOuterBBox(),i=this.underChild.getOuterBBox();this.node.attributes.get("accent")&&(s.h=Math.max(s.h,this.font.params.x_height*this.baseScale));const r=this.getOverKU(s,e)[1],n=this.getUnderKV(s,i)[1],o=this.getDelta(this.overChild),a=this.getDelta(this.underChild,!0),[l,c,h]=this.getDeltaW([s,i,e],[0,this.isLineBelow?0:-a,this.isLineAbove?0:o]);t.combine(s,l,0),t.combine(e,h,r),t.combine(i,c,n);const d=this.font.params.big_op_spacing5;t.h+=d,t.d+=d,t.clean()}}}function $h(t){var e;return e=class extends t{get baseChild(){return this.childNodes[this.node.base]}get scriptChild(){return this.childNodes[1]}getBaseCore(){let t=this.getSemanticBase()||this.childNodes[0],e=null==t?void 0:t.node;for(;t&&(1===t.childNodes.length&&(e.isKind("mrow")||e.isKind("TeXAtom")||e.isKind("mstyle")||e.isKind("mpadded")&&!e.getProperty("vbox")||e.isKind("mphantom")||e.isKind("semantics"))||e.isKind("munderover")&&t.isMathAccent);)this.setBaseAccentsFor(t),t=t.childNodes[0],e=null==t?void 0:t.node;return t||(this.baseHasAccentOver=this.baseHasAccentUnder=!1),t||this.childNodes[0]}setBaseAccentsFor(t){t.node.isKind("munderover")&&(null===this.baseHasAccentOver&&(this.baseHasAccentOver=!!t.node.attributes.get("accent")),null===this.baseHasAccentUnder&&(this.baseHasAccentUnder=!!t.node.attributes.get("accentunder")))}getSemanticBase(){const t=this.node.attributes.getExplicit("data-semantic-fencepointer");return this.getBaseFence(this.baseChild,t)}getBaseFence(t,e){if(!t||!t.node.attributes||!e)return null;if(t.node.attributes.getExplicit("data-semantic-id")===e)return t;for(const s of t.childNodes){const t=this.getBaseFence(s,e);if(t)return t}return null}getBaseScale(){let t=this.baseCore,e=1;for(;t&&t!==this;){e*=t.getOuterBBox().rscale,t=t.parent}return e}getBaseIc(){return this.baseCore.getOuterBBox().ic*this.baseScale}getAdjustedIc(){return this.baseIc?1.05*this.baseIc+.05:0}isCharBase(){const t=this.baseCore;return(t.node.isKind("mo")&&null===t.size||t.node.isKind("mi")||t.node.isKind("mn"))&&1===t.bbox.rscale&&1===Array.from(t.getText()).length}checkLineAccents(){if(this.node.isKind("munderover"))if(this.node.isKind("mover"))this.isLineAbove=this.isLineAccent(this.scriptChild);else if(this.node.isKind("munder"))this.isLineBelow=this.isLineAccent(this.scriptChild);else{const t=this;this.isLineAbove=this.isLineAccent(t.overChild),this.isLineBelow=this.isLineAccent(t.underChild)}}isLineAccent(t){const e=t.coreMO().node;return e.isToken&&"\u2015"===e.getText()}getBaseWidth(){const t=this.baseChild.getLineBBox(this.baseChild.breakCount);return t.w*t.rscale-(this.baseRemoveIc?this.baseIc:0)+this.font.params.extra_ic}getOffset(){return[0,0]}baseCharZero(t){const e=!!this.baseCore.node.attributes.get("largeop"),s=!(!this.baseCore.node.isKind("mo")||!this.baseCore.size),i=this.baseScale;return!this.baseIsChar||e||s||1!==i?t:0}getV(){const t=this.baseCore,e=t.getLineBBox(t.breakCount),s=this.scriptChild.getOuterBBox(),i=this.font.params,r=this.length2em(this.node.attributes.get("subscriptshift"),i.sub1);return Math.max(this.baseCharZero(e.d*this.baseScale+i.sub_drop*s.rscale),r,s.h*s.rscale-.8*i.x_height)}getU(){const t=this.baseCore,e=t.getLineBBox(t.breakCount),s=this.scriptChild.getOuterBBox(),i=this.font.params,r=this.node.attributes.getList("displaystyle","superscriptshift"),n=this.node.getProperty("texprimestyle")?i.sup3:r.displaystyle?i.sup1:i.sup2,o=this.length2em(r.superscriptshift,n);return Math.max(this.baseCharZero(e.h*this.baseScale-i.sup_drop*s.rscale),o,s.d*s.rscale+1/4*i.x_height)}hasMovableLimits(){const t=this.node.attributes.get("displaystyle"),e=this.baseChild.coreMO().node;return!t&&!!e.attributes.get("movablelimits")}getOverKU(t,e){const s=this.node.attributes.get("accent"),i=this.font.params,r=e.d*e.rscale,n=i.rule_thickness*i.separation_factor,o=this.baseHasAccentOver?n:0,a=this.isLineAbove?3*i.rule_thickness:n,l=(s?a:Math.max(i.big_op_spacing1,i.big_op_spacing3-Math.max(0,r)))-o;return[l,t.h*t.rscale+l+r]}getUnderKV(t,e){const s=this.node.attributes.get("accentunder"),i=this.font.params,r=e.h*e.rscale,n=i.rule_thickness*i.separation_factor,o=this.baseHasAccentUnder?n:0,a=this.isLineBelow?3*i.rule_thickness:n,l=(s?a:Math.max(i.big_op_spacing2,i.big_op_spacing4-r))-o;return[l,-(t.d*t.rscale+l+r)]}getDeltaW(t,e=[0,0,0]){const s=this.node.attributes.get("align"),i=t.map((t=>t.w*t.rscale));i[0]-=this.baseRemoveIc&&!this.baseCore.node.attributes.get("largeop")?this.baseIc:0;const r=Math.max(...i),n=[];let o=0;for(const t of i.keys())n[t]=("center"===s?(r-i[t])/2:"right"===s?r-i[t]:0)+e[t],n[t]<o&&(o=-n[t]);if(o)for(const t of n.keys())n[t]+=o;return[1,2].map((e=>n[e]+=t[e]?t[e].dx*t[0].rscale:0)),n}getDelta(t,e=!1){const s=this.node.attributes.get("accent");let{sk:i,ic:r}=this.baseCore.getOuterBBox();return s&&(i-=t.getOuterBBox().sk),((s&&!e?i:0)+this.font.skewIcFactor*r)*this.baseScale}stretchChildren(){const t=[];for(const e of this.childNodes)e.canStretch(Lc.Horizontal)&&t.push(e);const e=t.length,s=this.childNodes.length;if(e&&s>1){let i=0;const r=e>1&&e===s;for(const t of this.childNodes){const e=t.stretch.dir===Lc.None;if(r||e){const{w:s,rscale:r}=t.getOuterBBox(e);s*r>i&&(i=s*r)}}for(const e of t){const t=e.coreMO();null===t.size&&t.getStretchedVariant([i/e.coreRScale()])}}}constructor(t,e,s=null){super(t,e,s),this.baseScale=1,this.baseIc=0,this.baseRemoveIc=!1,this.baseIsChar=!1,this.baseHasAccentOver=null,this.baseHasAccentUnder=null,this.isLineAbove=!1,this.isLineBelow=!1,this.isMathAccent=!1;const i=this.baseCore=this.getBaseCore();i&&(this.setBaseAccentsFor(i),this.baseScale=this.getBaseScale(),this.baseIc=this.getBaseIc(),this.baseIsChar=this.isCharBase(),this.isMathAccent=this.baseIsChar&&this.scriptChild&&void 0!==this.scriptChild.coreMO().node.getProperty("mathaccent"),this.checkLineAccents(),this.baseRemoveIc=!this.isLineAbove&&!this.isLineBelow&&(!this.constructor.useIC||this.isMathAccent))}computeBBox(t,e=!1){t.empty(),t.append(this.baseChild.getOuterBBox()),this.appendScripts(t),t.clean(),this.setChildPWidths(e)}appendScripts(t){const e=this.getBaseWidth(),[s,i]=this.getOffset();return t.combine(this.scriptChild.getOuterBBox(),e+s,i),t.w+=this.font.params.scriptspace,t}get breakCount(){return this._breakCount<0&&(this._breakCount=this.node.isEmbellished?this.coreMO().embellishedBreakCount:this.node.linebreakContainer?0:this.childNodes[0].breakCount),this._breakCount}breakTop(t,e){return this.node.linebreakContainer||!this.parent||this.node.childIndex(e.node)?t:this.parent.breakTop(t,this)}computeLineBBox(t){const e=this.breakCount;if(!e)return Dc.from(this.getOuterBBox(),this.linebreakOptions.lineleading);const s=this.baseChild.getLineBBox(t).copy();return t<e?(0===t&&this.addLeftBorders(s),this.addMiddleBorders(s)):(this.appendScripts(s),this.addMiddleBorders(s),this.addRightBorders(s)),s}},e.useIC=!0,e}function Yh(t){return class extends t{computeBBox(t,e=!1){if(this.childNodes.length){const{w:e,h:s,d:i}=this.childNodes[0].getBBox();t.w=e,t.h=s,t.d=i}}get breakCount(){return this.node.isEmbellished?this.coreMO().embellishedBreakCount:this.childNodes[0].breakCount}}}class Qh extends ph{constructor(){super(...arguments),this.dx=0,this.utext=""}toSVG(t){this.toEmbellishedSVG(t)||this.addChildren(this.standardSvgNodes(t))}toEmbellishedSVG(t){if(t.length<=1||!this.node.isEmbellished)return!1;const e=this.coreMO().embellishedBreakStyle,s=[];for(const[i,r]of[[t[0],"before"],[t[1],"after"]])e!==r?(this.toSVG([i]),s.push(this.dom[0]),this.place(0,0)):s.push(this.createSvgNodes([i])[0]);return this.dom=s,!0}addChildren(t){let e=0;for(const s of this.childNodes){s.toSVG(t);const i=s.getOuterBBox();s.dom&&s.place(e+i.L*i.rscale,0),e+=(i.L+i.w+i.R)*i.rscale}}standardSvgNodes(t){const e=this.createSvgNodes(t);return this.handleStyles(),this.handleScale(),this.handleBorder(),this.handleColor(),this.handleAttributes(),e}createSvgNodes(t){this.dom=t.map((t=>this.svg("g",{"data-mml-node":this.node.kind}))),t=this.handleHref(t);for(const e of t.keys())this.adaptor.append(t[e],this.dom[e]);return this.dom}handleHref(t){const e=this.node.attributes.get("href");if(!e)return t;let s=0;const i=this.node.isEmbellished&&!this.node.isKind("mo");return t.map((t=>{t=this.adaptor.append(t,this.svg("a",{href:e}));const{h:r,d:n,w:o}=i?this.getOuterBBox():this.getLineBBox(s);return this.adaptor.append(this.dom[s++],this.svg("rect",{"data-hitbox":!0,fill:"none",stroke:"none","pointer-events":"all",width:this.fixed(o),height:this.fixed(r+n),x:1===s||i?this.fixed(-this.dx):0,y:this.fixed(-n)})),t}))}handleStyles(){var t,e,s;if(!this.styles)return;const i=this.styles.cssText;i&&this.dom.forEach((t=>this.adaptor.setAttribute(t,"style",i)));const r=((null===(t=this.styleData)||void 0===t?void 0:t.padding)||[0,0,0,0])[3],n=((null===(s=null===(e=this.styleData)||void 0===e?void 0:e.border)||void 0===s?void 0:s.width)||[0,0,0,0])[3];(r||n)&&(this.dx=r+n)}handleScale(){if(1!==this.bbox.rscale){const t="scale("+this.fixed(this.bbox.rscale/1e3,3)+")";this.dom.forEach((e=>this.adaptor.setAttribute(e,"transform",t)))}}handleColor(){var t;const e=this.adaptor,s=this.node.attributes,i=s.getExplicit("mathcolor")||s.getExplicit("color"),r=s.getExplicit("mathbackground")||s.getExplicit("background")||(null===(t=this.styles)||void 0===t?void 0:t.get("background-color"));if(i&&this.dom.forEach((t=>{e.setAttribute(t,"fill",i),e.setAttribute(t,"stroke",i)})),r){let t=0;const s=this.node.isEmbellished&&!this.node.isKind("mo");this.dom.forEach((i=>{const{h:n,d:o,w:a}=s?this.getOuterBBox():this.getLineBBox(t++),l=this.svg("rect",{fill:r,x:1===t||s?this.fixed(-this.dx):0,y:this.fixed(-o),width:this.fixed(a),height:this.fixed(n+o),"data-bgcolor":!0}),c=e.firstChild(i);c?e.insert(l,c):e.append(i,l)}))}}handleBorder(){var t;const e=null===(t=this.styleData)||void 0===t?void 0:t.border;if(!e)return;const s=Qh.borderFuzz,i=this.adaptor;let r=0;const n=this.dom.length-1,o=this.node.isEmbellished&&!this.node.isKind("mo");for(const t of this.dom){const a=n&&r?0:1,l=n&&r!==n?0:1,c=o?this.getOuterBBox():this.getLineBBox(r++),[h,d,u]=[c.h+s,c.d+s,c.w+s],p=[u,h],m=[-s,h],g=[u,-d],f=[-s,-d],b=[u-l*e.width[1],h-e.width[0]],E=[-s+a*e.width[3],h-e.width[0]],x=[u-l*e.width[1],-d+e.width[2]],y=[-s+a*e.width[3],-d+e.width[2]],N=[[m,p,b,E],[g,p,b,x],[f,g,x,y],[f,m,E,y]],A=i.firstChild(t),v=a*this.dx;for(const s of[0,1,2,3]){if(!e.width[s]||3===s&&!a||1===s&&!l)continue;const i=N[s];"dashed"===e.style[s]||"dotted"===e.style[s]?this.addBorderBroken(i,e.color[s],e.style[s],e.width[s],s,t,v):this.addBorderSolid(i,e.color[s],A,t,v)}}}addBorderSolid(t,e,s,i,r){const n=this.svg("polygon",{points:t.map((([t,e])=>`${this.fixed(t-r)},${this.fixed(e)}`)).join(" "),stroke:"none"});e&&this.adaptor.setAttribute(n,"fill",e),s?this.adaptor.insert(n,s):this.adaptor.append(i,n)}addBorderBroken(t,e,s,i,r,n,o){const a="dotted"===s,l=i/2,[c,h,d,u]=[[l,-l,-l,-l],[-l,l,-l,-l],[l,l,-l,l],[l,l,l,-l]][r],[p,m]=t,g=p[0]+c-o,f=p[1]+h,b=m[0]+d-o,E=m[1]+u,x=Math.abs(r%2?E-f:b-g),y=a?Math.ceil(x/(2*i)):Math.ceil((x-i)/(4*i)),N=x/(4*y+1),A=this.svg("line",{x1:this.fixed(g),y1:this.fixed(f),x2:this.fixed(b),y2:this.fixed(E),"stroke-width":this.fixed(i),stroke:e,"stroke-linecap":a?"round":"square","stroke-dasharray":a?[1,this.fixed(x/y-.002)].join(" "):[this.fixed(N),this.fixed(3*N)].join(" ")}),v=this.adaptor,_=v.firstChild(n);_?v.insert(A,_):v.append(n,A)}handleAttributes(){const t=this.adaptor,e=this.node.attributes,s=e.getAllDefaults(),i=Qh.skipAttributes;for(const r of e.getExplicitNames())!1!==i[r]&&(r in s||i[r]||t.hasAttribute(this.dom[0],r))||this.dom.forEach((s=>t.setAttribute(s,r,e.getExplicit(r))));if(e.get("class"))for(const s of Wr(e.get("class")))this.dom.forEach((e=>t.addClass(e,s)))}place(t,e,s=null){if(s||(t+=this.dx*this.bbox.rscale),!t&&!e)return;s||(s=this.dom[0],e=this.handleId(e));const i=`translate(${this.fixed(t)},${this.fixed(e)})`,r=this.adaptor.getAttribute(s,"transform")||"";this.adaptor.setAttribute(s,"transform",i+(r?" "+r:""))}handleId(t){if(!this.node.attributes||!this.node.attributes.get("id"))return t;const e=this.adaptor,{h:s,rscale:i}=this.getBBox(),r=e.childNodes(this.dom[0]);r.forEach((t=>e.remove(t)));const n=this.svg("g",{"data-idbox":!0,transform:`translate(0,${this.fixed(-s)})`},r);return e.append(this.dom[0],this.svg("text",{"data-id-align":!0},[this.text("")])),e.append(this.dom[0],n),t+s*i}firstChild(t=this.dom[0]){const e=this.adaptor;let s=e.firstChild(t);return s&&"text"===e.kind(s)&&e.getAttribute(s,"data-id-align")&&(s=e.firstChild(e.next(s))),s&&"rect"===e.kind(s)&&e.getAttribute(s,"data-hitbox")&&(s=e.next(s)),s}placeChar(t,e,s,i,r=null,n=!1){null===r&&(r=this.variant);const o=t.toString(16).toUpperCase(),[,,a,l]=this.getVariantChar(r,t);if(l.unknown)return this.utext+=String.fromCodePoint(t),n?0:this.addUtext(e,s,i,r);const c=this.addUtext(e,s,i,r);if("p"in l){e+=c;const t=l.p?"M"+l.p+"Z":"";return this.place(e,s,this.adaptor.append(i,this.charNode(r,o,t))),a+c}if("c"in l){const t=this.adaptor.append(i,this.svg("g",{"data-c":o}));this.place(e+c,s,t),e=0;for(const i of this.unicodeChars(l.c,r))e+=this.placeChar(i,e,s,t,r);return e+c}return a}addUtext(t,e,s,i){const r=this.utext;if(!r)return 0;this.utext="";const n=this.adaptor.append(s,this.jax.unknownText(r,i));return this.place(t,e,n),this.jax.measureTextNodeWithCache(n,r,i).w}charNode(t,e,s){return"none"!==this.jax.options.fontCache?this.useNode(t,e,s):this.pathNode(e,s)}pathNode(t,e){return this.svg("path",{"data-c":t,d:e})}useNode(t,e,s){const i=this.svg("use",{"data-c":e}),r="#"+this.jax.fontCache.cachePath(t,e,s);return this.adaptor.setAttribute(i,"href",r,this.jax.options.useXlink?iu:null),i}drawBBox(){var t,e;const{w:s,h:i,d:r}=this.getOuterBBox(),n=((null===(e=null===(t=this.styleData)||void 0===t?void 0:t.border)||void 0===e?void 0:e.width)||[0,0,0,0])[3],o={style:{opacity:.25}};n&&(o.transform=`translate(${this.fixed(-n)}, 0)`);const a=this.svg("g",o,[this.svg("rect",{fill:"red",height:this.fixed(i),width:this.fixed(s)}),this.svg("rect",{fill:"green",height:this.fixed(r),width:this.fixed(s),y:this.fixed(-r)})]),l=this.dom[0]||this.parent.dom[0];this.adaptor.append(l,a)}html(t,e={},s=[]){return this.jax.html(t,e,s)}svg(t,e={},s=[]){return this.jax.svg(t,e,s)}text(t){return this.jax.text(t)}fixed(t,e=1){return this.jax.fixed(1e3*t,e)}}Qh.kind="unknown",Qh.borderFuzz=.005;const Zh=["url(data:application/x-font-woff;charset=utf-8;base64,","T1RUTwAJAIAAAwAQQ0ZGIGnFMZkAAARQAAAAlE9TLzJpUWOBAAABAAAAAGBjbWFwAAwAUwAABAQAAAAs","aGVhZCFRvpAAAACcAAAANmhoZWEC8AD9AAAA1AAAACRobXR4A+gAAAAABOQAAAAIbWF4cAACUAAAAAD4","AAAABm5hbWVNb8+2AAABYAAAAqNwb3N0AAMAAAAABDAAAAAgAAEAAAABAABVWOu4Xw889QADA+gAAAAA","3ym+2AAAAADfKb7YAAAAAAPoAAAAAAADAAIAAAAAAAAAAQAAAu79EgAAA+gAAAAAAAAAAQAAAAAAAAAA","AAAAAAAAAAIAAFAAAAIAAAADA+gB9AAFAAACigK7AAAAjAKKArsAAAHfADEBAgAAAAAAAAAAAAAAAAAA","AAEAAAAAAAAAAAAAAABYWFhYAEAAIAAgAu79EgAAAu4C7gAAAAEAAAAAAXcAAAAgACAAAAAAACIBngAB","AAAAAAAAAAEAQQABAAAAAAABAAsAAAABAAAAAAACAAcAIQABAAAAAAADABUAxgABAAAAAAAEABMANgAB","AAAAAAAFAAsApQABAAAAAAAGABIAbwABAAAAAAAHAAEAQQABAAAAAAAIAAEAQQABAAAAAAAJAAEAQQAB","AAAAAAAKAAEAQQABAAAAAAALAAEAQQABAAAAAAAMAAEAQQABAAAAAAANAAEAQQABAAAAAAAOAAEAQQAB","AAAAAAAQAAsAAAABAAAAAAARAAcAIQADAAEECQAAAAIAXwADAAEECQABABYACwADAAEECQACAA4AKAAD","AAEECQADACoA2wADAAEECQAEACYASQADAAEECQAFABYAsAADAAEECQAGACQAgQADAAEECQAHAAIAXwAD","AAEECQAIAAIAXwADAAEECQAJAAIAXwADAAEECQAKAAIAXwADAAEECQALAAIAXwADAAEECQAMAAIAXwAD","AAEECQANAAIAXwADAAEECQAOAAIAXwADAAEECQAQABYACwADAAEECQARAA4AKG1qeC1sbS16ZXJvAG0A","agB4AC0AbABtAC0AegBlAHIAb1JlZ3VsYXIAUgBlAGcAdQBsAGEAcm1qeC1sbS16ZXJvIFJlZ3VsYXIA","bQBqAHgALQBsAG0ALQB6AGUAcgBvACAAUgBlAGcAdQBsAGEAcm1qeC1sbS16ZXJvUmVndWxhcgBtAGoA","eAAtAGwAbQAtAHoAZQByAG8AUgBlAGcAdQBsAGEAclZlcnNpb24gMC4xAFYAZQByAHMAaQBvAG4AIAAw","AC4AMSA6bWp4LWxtLXplcm8gUmVndWxhcgAgADoAbQBqAHgALQBsAG0ALQB6AGUAcgBvACAAUgBlAGcA","dQBsAGEAcgAAAAABAAMAAQAAAAwABAAgAAAABAAEAAEAAAAg//8AAAAg////4QABAAAAAAADAAAAAAAA","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAEAQABAQETbWp4LWxtLXplcm9SZWd1bGFyAAEBASf4GwD4","HAL4HQP4HgSLi/mC+nwFHQAAAIYPHQAAAIkRix0AAACUEgAFAQEMHyoxNlZlcnNpb24gMC4xbWp4LWxt","LXplcm8gUmVndWxhcm1qeC1sbS16ZXJvUmVndWxhcnNwYWNlAAAAAYsAAgEBAwaLDvp8DgAAAAAD6AAA",') format("woff")'].join(""),td=function(){var t;const e=yh(Qh);return(t=class extends e{handleDisplay(){const[t,e]=this.getAlignShift();if("center"!==t&&this.adaptor.setAttribute(this.jax.container,"justify",t),this.bbox.pwidth===vo.fullWidth){if(this.adaptor.setAttribute(this.jax.container,"width","full"),this.jax.table){let{L:s,w:i,R:r}=this.jax.table.getOuterBBox();"right"===t?r=Math.max(r||-e,-e):"left"===t?s=Math.max(s||e,e):"center"===t&&(i+=2*Math.abs(e)),this.jax.minwidth=Math.max(0,s+i+r)}}else this.jax.shift=e}toSVG(t){super.toSVG(t);const e=this.adaptor;"block"===this.node.attributes.get("display")&&(e.setAttribute(this.jax.container,"display","true"),this.handleDisplay())}setChildPWidths(t,e=null,s=!0){return super.setChildPWidths(t,this.parent?e:this.metrics.containerWidth/this.jax.pxPerEm,!1)}}).kind=Ir.prototype.kind,t.styles={'mjx-container[jax="SVG"] mjx-break':{"white-space":"normal","line-height":"0","clip-path":"rect(0 0 0 0)","font-family":"MJX-ZERO ! important"},'mjx-break[size="0"]':{"letter-spacing":"-0.999em"},'mjx-break[size="1"]':{"letter-spacing":"-0.889em"},'mjx-break[size="2"]':{"letter-spacing":"-0.833em"},'mjx-break[size="3"]':{"letter-spacing":"-0.778em"},'mjx-break[size="4"]':{"letter-spacing":"-0.722em"},'mjx-break[size="5"]':{"letter-spacing":"-0.667em"},'mjx-container[jax="SVG"] mjx-break[newline]::before':{"white-space":"pre",content:'"\\A"'},'mjx-break[newline] + svg[width="0.054ex"]':{"margin-right":"-1px"},"mjx-break[prebreak]":{"letter-spacing":"-.999em"},"@font-face /* zero */":{"font-family":"MJX-ZERO",src:Zh}},t}(),ed=function(){var t;const e=Oh(Qh);return t=class extends e{constructor(){super(...arguments),this.linebreakCount=0}toSVG(t){this.getBBox();const e=this.linebreakCount=this.isStack?0:this.breakCount;t=e||!this.node.isInferred?this.standardSvgNodes(t):this.getSvgNodes(t),this.addChildren(t),e&&this.placeLines(t)}getSvgNodes(t){if(this.dh){const e=this.svg("g",{transform:`translate(0 ${this.fixed(this.dh)})`});t=[this.adaptor.append(t[0],e)]}return this.dom=t,t}placeLines(t){var e;const s=this.lineBBox,i=this.jax.math.display;let r=this.dh;for(const n of t.keys()){const o=s[n];this.place(o.L||0,r,t[n]),r-=Math.max(.25,o.d)+(i?o.lineLeading:0)+Math.max(.75,(null===(e=s[n+1])||void 0===e?void 0:e.h)||0)}}createSvgNodes(t){const e=this.linebreakCount;if(!e)return super.createSvgNodes(t);const s=this.adaptor,i=this.node.isInferred?{"data-mjx-linestack":!0}:{"data-mml-node":this.node.kind};this.dom=[s.append(t[0],this.svg("g",i))],this.dom=[s.append(this.handleHref(t)[0],this.dom[0])];const r=Array(e);for(let t=0;t<=e;t++)r[t]=s.append(this.dom[0],this.svg("g",{"data-mjx-linebox":!0,"data-mjx-lineno":t}));return r}addChildren(t){let e=0,s=0;for(const i of this.childNodes){const r=i.breakCount;if(i.toSVG(t.slice(s,s+r+1)),i.dom){let t=0;for(const s of i.dom){if(s){const r=t?0:i.dx,n=i.getLineBBox(t++);e+=(n.L+r)*n.rscale,this.place(e,0,s),e+=(n.w+n.R-r)*n.rscale}r&&(e=0)}if(r){const t=i.getLineBBox(r);e+=(t.w+t.R)*t.rscale}}s+=r}}},t.kind=$r.prototype.kind,t}(),sd=function(){var t;const e=Mh(ed);return(t=class extends e{}).kind=Yr.prototype.kind,t}(),id=function(){var t;const e=wh(Qh);return(t=class extends e{}).kind=Rr.prototype.kind,t}();class rd extends Mc{static charOptions(t,e){return super.charOptions(t,e)}static addExtension(t,e=""){super.addExtension(t,e),Oc(this,"variantCacheIds",t.cacheIds)}}function nd(t,e,s){for(const s of Object.keys(e)){const i=parseInt(s);rd.charOptions(t,i).p=e[i]}for(const e of Object.keys(s)){const i=parseInt(e);rd.charOptions(t,i).c=s[i]}return t}rd.OPTIONS=Object.assign(Object.assign({},Mc.OPTIONS),{dynamicPrefix:"./svg/dynamic"}),rd.JAX="SVG";const od=.1,ad=function(){var t;const e=Rh(Qh);return t=class extends e{toSVG(t){const e=this.node.attributes,s=e.get("symmetric")&&this.stretch.dir!==Lc.Horizontal,i=this.stretch.dir!==Lc.None;i&&null===this.size&&this.getStretchedVariant([]);const r=this.standardSvgNodes(t);if(r.length>1&&"duplicate"!==this.breakStyle){const t="after"===this.breakStyle?1:0;this.adaptor.remove(r[t]),r[t]=null}if(i&&this.size<0)this.stretchSvg();else{const t=s||e.get("largeop")?this.fixed(this.getCenterOffset()):"0",i=this.node.getProperty("mathaccent")?this.fixed(this.getAccentOffset()):"0";"0"===t&&"0"===i||(r[0]&&this.adaptor.setAttribute(r[0],"transform",`translate(${i} ${t})`),r[1]&&this.adaptor.setAttribute(r[1],"transform",`translate(${i} ${t})`)),r[0]&&this.addChildren([r[0]]),r[1]&&(this.multChar||this).addChildren([r[1]])}}stretchSvg(){const t=this.stretch.stretch,e=this.getStretchVariants(),s=this.getBBox();this.stretch.dir===Lc.Vertical?this.stretchVertical(t,e,s):this.stretchHorizontal(t,e,s)}getStretchVariants(){const t=this.stretch.c||this.getText().codePointAt(0),e=[];for(const s of this.stretch.stretch.keys())e[s]=this.font.getStretchVariant(t,s);return e}stretchVertical(t,e,s){const{h:i,d:r,w:n}=s,o=this.addTop(t[0],e[0],i,n),a=this.addBot(t[2],e[2],r,n);if(4===t.length){const[s,l]=this.addMidV(t[3],e[3],n);this.addExtV(t[1],e[1],i,-s,o,0,n),this.addExtV(t[1],e[1],-l,r,0,a,n)}else this.addExtV(t[1],e[1],i,r,o,a,n)}stretchHorizontal(t,e,s){const i=s.w,r=this.addLeft(t[0],e[0]),n=this.addRight(t[2],e[2],i);if(4===t.length){const[s,o]=this.addMidH(t[3],e[3],i),a=i/2;this.addExtH(t[1],e[1],a,r,a-s),this.addExtH(t[1],e[1],a,o-a,n,a)}else this.addExtH(t[1],e[1],i,r,n)}getChar(t,e){const s=this.font.getChar(e,t)||[0,0,0,null];return[s[0],s[1],s[2],s[3]||{}]}addGlyph(t,e,s,i,r=null){if(r)return this.placeChar(t,s,i,r,e);if(this.dom[0]){const r=this.placeChar(t,s,i,this.dom[0],e);if(!this.dom[1])return r}return this.placeChar(t,s,i,this.dom[1],e)}addTop(t,e,s,i){if(!t)return 0;const[r,n,o]=this.getChar(t,e);return this.addGlyph(t,e,(i-o)/2,s-r),r+n}addExtV(t,e,s,i,r,n,o){if(!t)return;r=Math.max(0,r-od),n=Math.max(0,n-od);const a=this.adaptor,[l,c,h]=this.getChar(t,e),d=s+i-r-n,u=1.5*d/(l+c),p=(u*(l-c)-d)/2;if(d<=0)return;const m=this.svg("svg",{width:this.fixed(h),height:this.fixed(d),y:this.fixed(n-i),x:this.fixed((o-h)/2),viewBox:[0,p,h,d].map((t=>this.fixed(t))).join(" ")});this.addGlyph(t,e,0,0,m);const g=a.lastChild(m);a.setAttribute(g,"transform",`scale(1,${this.jax.fixed(u)})`),this.dom[0]&&a.append(this.dom[0],m),this.dom[1]&&a.append(this.dom[1],this.dom[0]?a.clone(m):m)}addBot(t,e,s,i){if(!t)return 0;const[r,n,o]=this.getChar(t,e);return this.addGlyph(t,e,(i-o)/2,n-s),r+n}addMidV(t,e,s){if(!t)return[0,0];const[i,r,n]=this.getChar(t,e),o=(r-i)/2+this.font.params.axis_height;return this.addGlyph(t,e,(s-n)/2,o),[i+o,r-o]}addLeft(t,e){return t?this.addGlyph(t,e,0,0):0}addExtH(t,e,s,i,r,n=0){if(!t)return;r=Math.max(0,r-.1),i=Math.max(0,i-.1);const o=this.adaptor,[a,l,c]=this.getChar(t,e),h=s-i-r,d=a+l+.2,u=h/c*1.5,p=-(l+od);if(h<=0)return;const m=this.svg("svg",{width:this.fixed(h),height:this.fixed(d),x:this.fixed(n+i),y:this.fixed(p),viewBox:[(u*c-h)/2,p,h,d].map((t=>this.fixed(t))).join(" ")});this.addGlyph(t,e,0,0,m);const g=o.lastChild(m);o.setAttribute(g,"transform",`scale(${this.jax.fixed(u)},1)`),this.dom[0]&&o.append(this.dom[0],m),this.dom[1]&&o.append(this.dom[1],this.dom[0]?o.clone(m):m)}addRight(t,e,s){if(!t)return 0;const i=this.getChar(t,e)[2];return this.addGlyph(t,e,s-i,0)}addMidH(t,e,s){if(!t)return[0,0];const i=this.getChar(t,e)[2];return this.addGlyph(t,e,(s-i)/2,0),[(s-i)/2,(s+i)/2]}},t.kind=Xr.prototype.kind,t}(),ld=function(){var t;const e=Ih(Qh);return(t=class extends e{}).kind=Sr.prototype.kind,t}(),cd=function(){var t;const e=Dh(Qh);return(t=class extends e{}).kind=Jr.prototype.kind,t}(),hd=function(){var t;const e=Vh(Qh);return(t=class extends e{toSVG(t){if(!this.breakCount)return void super.toSVG(t);const e=this.standardSvgNodes(t),s=this.textNode.node,i=this.childNodes;for(const t of e.keys()){const r=[e[t]];let[n,o]=this.breakPoints[t-1]||[0,0];const[a,l]=this.breakPoints[t]||[i.length,0];let c=i[n].node.getText().split(/ /);if(n===a){s.setText(c.slice(o,l).join(" ")),this.textNode.toSVG(r);continue}s.setText(c.slice(o).join(" ")),this.textNode.toSVG(r);let h=this.textNode.getBBox().w;for(;++n<a&&n<i.length;){const t=i[n];t.toSVG(r),t.dom&&t.place(h,0),h+=t.getBBox().w}n<i.length&&(c=i[n].node.getText().split(/ /),s.setText(c.slice(0,l).join(" ")),this.textNode.toSVG(r),this.textNode.place(h,0))}}}).kind=zr.prototype.kind,t}(),dd=function(){var t;return(t=class extends Qh{toSVG(t){const e=this.standardSvgNodes(t),{h:s,d:i,w:r}=this.getBBox();this.adaptor.append(this.dom[0],this.svg("rect",{"data-background":!0,width:this.fixed(r),height:this.fixed(s+i),y:this.fixed(-i)}));const n=this.node.attributes.get("title");n&&this.adaptor.append(this.dom[0],this.svg("title",{},[this.adaptor.text(n)])),this.addChildren(e)}}).kind=sn.prototype.kind,t.styles={'g[data-mml-node="merror"] > g':{fill:"red",stroke:"red"},'g[data-mml-node="merror"] > rect[data-background]':{fill:"yellow",stroke:"none"}},t}(),ud=function(){var t;const e=Ph(Qh);return(t=class extends e{}).kind=Kr.prototype.kind,t}(),pd=function(){var t;const e=Sh(Qh);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;let e=this.standardSvgNodes(t);const[,,,,,s,i,r,n]=this.getDimens(),o=this.node.attributes.get("data-align")||"left",a=i+n-(s<0&&"left"!==o?"center"===o?s/2:s:0);(a||r)&&(e=[this.adaptor.append(e[0],this.svg("g"))],this.place(a,r,e[0])),this.addChildren(e)}}).kind=rn.prototype.kind,t}(),md=function(){var t;return(t=class extends Qh{toSVG(t){this.standardSvgNodes(t)}}).kind=nn.prototype.kind,t}(),gd=function(){var t;const e=vh(Qh);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;this.standardSvgNodes(t);const{linethickness:e,bevelled:s}=this.node.attributes.getList("linethickness","bevelled"),i=this.isDisplay();if(s)this.makeBevelled(i);else{const t=this.length2em(String(e),.06);0===t?this.makeAtop(i):this.makeFraction(i,t)}}makeFraction(t,e){const s=this.dom,{numalign:i,denomalign:r}=this.node.attributes.getList("numalign","denomalign"),[n,o]=this.childNodes,a=n.getOuterBBox(),l=o.getOuterBBox(),c=this.font.params,h=c.axis_height,d=this.node.getProperty("withDelims")?0:c.nulldelimiterspace,u=Math.max((a.L+a.w+a.R)*a.rscale,(l.L+l.w+l.R)*l.rscale),p=this.getAlignX(u,a,i)+.1+d,m=this.getAlignX(u,l,r)+.1+d,{T:g,u:f,v:b}=this.getTUV(t,e);n.toSVG(s),n.place(p,h+g+Math.max(a.d*a.rscale,f)),o.toSVG(s),o.place(m,h-g-Math.max(l.h*l.rscale,b)),this.adaptor.append(s[0],this.svg("rect",{width:this.fixed(u+.2),height:this.fixed(e),x:this.fixed(d),y:this.fixed(h-e/2)}))}makeAtop(t){const e=this.dom,{numalign:s,denomalign:i}=this.node.attributes.getList("numalign","denomalign"),[r,n]=this.childNodes,o=r.getOuterBBox(),a=n.getOuterBBox(),l=this.font.params,c=this.node.getProperty("withDelims")?0:l.nulldelimiterspace,h=Math.max((o.L+o.w+o.R)*o.rscale,(a.L+a.w+a.R)*a.rscale),d=this.getAlignX(h,o,s)+c,u=this.getAlignX(h,a,i)+c,{u:p,v:m}=this.getUVQ(t);r.toSVG(e),r.place(d,p),n.toSVG(e),n.place(u,-m)}makeBevelled(t){const e=this.dom,[s,i]=this.childNodes,{u:r,v:n,delta:o,nbox:a,dbox:l}=this.getBevelData(t),c=(a.L+a.w+a.R)*a.rscale;s.toSVG(e),this.bevel.toSVG(e),i.toSVG(e),s.place(a.L*a.rscale,r),this.bevel.place(c-o/2,0),i.place(c+this.bevel.getOuterBBox().w+l.L*l.rscale-o,n)}}).kind=Qr.prototype.kind,t}(),fd=function(){var t;const e=Bh(Qh);return t=class extends e{constructor(){super(...arguments),this.dx=0}addRoot(t,e,s,i){return 0}toSVG(t){const e=this.surd,s=this.childNodes[this.base],i=this.root?this.childNodes[this.root]:null,r=e.getBBox(),n=s.getOuterBBox(),o=this.getPQ(r)[1],a=this.font.params.surd_height*this.bbox.scale,l=n.h+o+a,c=this.standardSvgNodes(t);e.toSVG(c);const h=this.addRoot(c,i,r,l),d=this.adaptor.append(c[0],this.svg("g"));s.toSVG([d]),e.place(h,l-r.h),s.place(h+r.w,0),this.adaptor.append(c[c.length-1],this.svg("rect",{width:this.fixed(n.w),height:this.fixed(a),x:this.fixed(h+r.w),y:this.fixed(l-a)}))}},t.kind=Zr.prototype.kind,t}(),bd=function(){var t;const e=kh(fd);return t=class extends e{addRoot(t,e,s,i){e.toSVG(t);const[r,n,o]=this.getRootDimens(s,i),a=e.getOuterBBox();return e.place(o*a.rscale,n),r}},t.kind=tn.prototype.kind,t}(),Ed=function(){var t;const e=Ah(Qh);return(t=class extends e{toSVG(t){const e=this.standardSvgNodes(t);this.setChildrenParent(this.mrow),this.mrow.toSVG(e),this.setChildrenParent(this)}setChildrenParent(t){for(const e of this.childNodes)e.parent=t}}).kind=on.prototype.kind,t}(),xd=function(){var t;const e=$h(Qh);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;const e=this.standardSvgNodes(t),s=this.getBaseWidth(),[i,r]=this.getOffset();this.baseChild.toSVG(e),this.baseChild.place(0,0),this.scriptChild.toSVG([e[e.length-1]]),this.scriptChild.place(s+i,r)}}).kind="scriptbase",t}(),yd=function(){var t;const e=Fh(xd);return(t=class extends e{}).kind=hn.prototype.kind,t}(),Nd=function(){var t;const e=Uh(xd);return(t=class extends e{}).kind=dn.prototype.kind,t}(),Ad=function(){var t;const e=jh(xd);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;const e=this.standardSvgNodes(t),[s,i,r]=[this.baseChild,this.supChild,this.subChild],n=this.getBaseWidth(),o=this.getAdjustedIc(),[a,l]=this.getUVQ();s.toSVG(e);const c=[e[e.length-1]];i.toSVG(c),r.toSVG(c),s.place(0,0),r.place(n+(this.baseIsChar?0:o),l),i.place(n+o,a)}}).kind=cn.prototype.kind,t}(),vd=function(){var t;const e=zh(yd);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;if(this.hasMovableLimits())return void super.toSVG(t);const e=this.standardSvgNodes(t),[s,i]=[this.baseChild,this.scriptChild],[r,n]=[s.getOuterBBox(),i.getOuterBBox()];s.toSVG(e),i.toSVG(e);const o=this.isLineBelow?0:this.getDelta(this.scriptChild,!0),a=this.getUnderKV(r,n)[1],[l,c]=this.getDeltaW([r,n],[0,-o]);s.place(l,0),i.place(c,a)}}).kind=pn.prototype.kind,t}(),_d=function(){var t;const e=Kh(Nd);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;if(this.hasMovableLimits())return void super.toSVG(t);const e=this.standardSvgNodes(t),[s,i]=[this.baseChild,this.scriptChild],[r,n]=[s.getOuterBBox(),i.getOuterBBox()];s.toSVG(e),i.toSVG(e);const o=this.isLineAbove?0:this.getDelta(this.scriptChild),a=this.getOverKU(r,n)[1],[l,c]=this.getDeltaW([r,n],[0,o]);s.place(l,0),i.place(c,a)}}).kind=mn.prototype.kind,t}(),wd=function(){var t;const e=Jh(Ad);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;if(this.hasMovableLimits())return void super.toSVG(t);const e=this.standardSvgNodes(t),[s,i,r]=[this.baseChild,this.overChild,this.underChild],[n,o,a]=[s.getOuterBBox(),i.getOuterBBox(),r.getOuterBBox()];s.toSVG(e),r.toSVG(e),i.toSVG(e);const l=this.getDelta(this.overChild),c=this.getDelta(this.underChild,!0),h=this.getOverKU(n,o)[1],d=this.getUnderKV(n,a)[1],[u,p,m]=this.getDeltaW([n,a,o],[0,this.isLineBelow?0:-c,this.isLineAbove?0:l]);s.place(u,0),r.place(p,d),i.place(m,h)}}).kind=un.prototype.kind,t}();function Td(t){return{left:(t,e)=>0,center:(t,e)=>(e-t)/2,right:(t,e)=>e-t}[t]||((t,e)=>0)}const Cd=function(){var t;const e=Lh(Ad);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;const e=this.standardSvgNodes(t),s=this.scriptData,i=this.node.getProperty("scriptalign")||"right left",[r,n]=Wr(i+" "+i),[o,a]=this.getCombinedUV();let l=0;s.numPrescripts&&(l=this.addScripts(this.dom[0],this.font.params.scriptspace,o,a,this.firstPrescript,s.numPrescripts,r));const c=this.baseChild;c.toSVG(e),c.place(l,0),this.breakCount&&(l=0),l+=c.getLineBBox(c.breakCount).w,s.numScripts&&this.addScripts(this.dom[this.dom.length-1],l,o,a,1,s.numScripts,n)}addScripts(t,e,s,i,r,n,o){const a=this.adaptor,l=Td(o),c=a.append(t,this.svg("g")),h=a.append(t,this.svg("g"));this.place(e,s,c),this.place(e,i,h);const d=r+2*n;let u=0;for(;r<d;){const[t,e]=[this.childNodes[r++],this.childNodes[r++]],[s,i]=[t.getOuterBBox(),e.getOuterBBox()],[n,o]=[s.rscale,i.rscale],a=Math.max(s.w*n,i.w*o);t.toSVG([h]),e.toSVG([c]),t.place(u+l(s.w*n,a),0),e.place(u+l(i.w*o,a),0),u+=a}return e+u}}).kind=gn.prototype.kind,t}(),Ld=function(){var t;const e=Hh(Qh);return t=class extends e{placeRows(t){const e=this.node.attributes.get("equalrows"),{H:s,D:i}=this.getTableData(),r=this.getEqualRowHeight(),n=this.getRowHalfSpacing(),o=[this.fLine,...this.rLines,this.fLine];let a=this.getBBox().h-o[0];for(let l=0;l<this.numRows;l++){const c=this.childNodes[l];[c.H,c.D]=this.getRowHD(e,r,s[l],i[l]),[c.tSpace,c.bSpace]=[n[l],n[l+1]],[c.tLine,c.bLine]=[o[l],o[l+1]],c.toSVG([t]),c.place(0,a-n[l]-c.H),a-=n[l]+c.H+c.D+n[l+1]+o[l+1]}}getRowHD(t,e,s,i){return t?[(e+s-i)/2,(e-s+i)/2]:[s,i]}handleColor(){super.handleColor();const t=this.firstChild();t&&this.adaptor.setAttribute(t,"width",this.fixed(this.getWidth()))}handleColumnLines(t){if("none"===this.node.attributes.get("columnlines"))return;const e=this.getColumnAttributes("columnlines");if(!e)return;const s=this.getColumnHalfSpacing(),i=this.cLines,r=this.getComputedWidths();let n=this.fLine;for(let o=0;o<e.length;o++)n+=s[o]+r[o]+s[o+1],"none"!==e[o]&&this.adaptor.append(t,this.makeVLine(n,e[o],i[o])),n+=i[o]}handleRowLines(t){if("none"===this.node.attributes.get("rowlines"))return;const e=this.getRowAttributes("rowlines");if(!e)return;const s=this.node.attributes.get("equalrows"),{H:i,D:r}=this.getTableData(),n=this.getEqualRowHeight(),o=this.getRowHalfSpacing(),a=this.rLines;let l=this.getBBox().h-this.fLine;for(let c=0;c<e.length;c++){const[h,d]=this.getRowHD(s,n,i[c],r[c]);l-=o[c]+h+d+o[c+1],"none"!==e[c]&&this.adaptor.append(t,this.makeHLine(l,e[c],a[c])),l-=a[c]}}handleFrame(t){if(this.frame&&this.fLine){const{h:e,d:s,w:i}=this.getBBox(),r=this.node.attributes.get("frame");this.adaptor.append(t,this.makeFrame(i,e,s,r))}}handlePWidth(t){if(!this.pWidth)return 0;const{w:e,L:s,R:i}=this.getBBox(),r=s+this.pWidth+i,n=this.getAlignShift()[0],o=Math.max(this.isTop?r:0,this.container.getWrapWidth(this.containerI))-s-i,a=e-(this.pWidth>o?o:this.pWidth),l="left"===n?0:"right"===n?a:a/2;if(l){const e=this.svg("g",{},this.adaptor.childNodes(t));this.place(l,0,e),this.adaptor.append(t,e)}return l}lineClass(t){return"mjx-"+t}makeFrame(t,e,s,i){const r=this.fLine;return this.svg("rect",this.setLineThickness(r,i,{"data-frame":!0,class:this.lineClass(i),width:this.fixed(t-r),height:this.fixed(e+s-r),x:this.fixed(r/2),y:this.fixed(r/2-s)}))}makeVLine(t,e,s){const{h:i,d:r}=this.getBBox(),n="dotted"===e?s/2:0,o=this.fixed(t+s/2);return this.svg("line",this.setLineThickness(s,e,{"data-line":"v",class:this.lineClass(e),x1:o,y1:this.fixed(n-r),x2:o,y2:this.fixed(i-n)}))}makeHLine(t,e,s){const i=this.getBBox().w,r="dotted"===e?s/2:0,n=this.fixed(t-s/2);return this.svg("line",this.setLineThickness(s,e,{"data-line":"h",class:this.lineClass(e),x1:this.fixed(r),y1:n,x2:this.fixed(i-r),y2:n}))}setLineThickness(t,e,s){return.07!==t&&(s["stroke-thickness"]=this.fixed(t),"solid"!==e&&(s["stroke-dasharray"]=("dotted"===e?"0,":"")+this.fixed(2*t))),s}handleLabels(t,e,s){if(!this.hasLabels)return;const i=this.labels,r=this.node.attributes.get("side");this.spaceLabels(),this.isTop?this.topTable(t,i,r):this.subTable(t,i,r,s)}spaceLabels(){const t=this.adaptor,e=this.getBBox().h,s=this.getTableData().L,i=this.getRowHalfSpacing();let r=e-this.fLine,n=t.firstChild(this.labels);for(let e=0;e<this.numRows;e++){const o=this.childNodes[e];if(o.node.isKind("mlabeledtr")){const a=o.childNodes[0];r-=i[e]+o.H,o.placeCell(a,{x:0,y:r,w:s,lSpace:0,rSpace:0,lLine:0,rLine:0}),r-=o.D+i[e+1]+this.rLines[e],n=t.next(n)}else r-=i[e]+o.H+o.D+i[e+1]+this.rLines[e]}}topTable(t,e,s){const i=this.adaptor,{h:r,d:n,w:o,L:a,R:l}=this.getBBox(),c=a+(this.pWidth||o)+l,h=this.getTableData().L,[,d,u]=this.getPadAlignShift(s),p=u+("right"===d?-c:"center"===d?-c/2:0)+a,m="matrix(1 0 0 -1 0 0)",g=`scale(${this.jax.fixed(1e3*this.font.params.x_height/this.metrics.ex,2)})`,f=`translate(0 ${this.fixed(r)}) ${m} ${g}`,b=this.svg("svg",{"data-table":!0,preserveAspectRatio:"left"===d?"xMinYMid":"right"===d?"xMaxYMid":"xMidYMid",viewBox:`${this.fixed(-p)} ${this.fixed(-r)} 1 ${this.fixed(r+n)}`},[this.svg("g",{transform:m},i.childNodes(t))]);e=this.svg("svg",{"data-labels":!0,preserveAspectRatio:"left"===s?"xMinYMid":"xMaxYMid",viewBox:["left"===s?0:this.fixed(h),this.fixed(-r),1,this.fixed(r+n)].join(" ")},[e]),i.append(t,this.svg("g",{transform:f},[b,e])),this.place(-a,0,t)}subTable(t,e,s,i){const r=this.adaptor,{w:n,L:o,R:a}=this.getBBox(),l=o+(this.pWidth||n)+a,c=this.getTableData().L,h=this.getAlignShift()[0],d=Math.max(l,this.container.getWrapWidth(this.containerI));this.place("left"===s?("left"===h?0:"right"===h?l-d+i:(l-d)/2+i)-o:("left"===h?d:"right"===h?l+i:(d+l)/2+i)-o-c,0,e),r.append(t,e)}constructor(t,e,s=null){super(t,e,s);const i={"data-labels":!0};this.isTop&&(i.transform="matrix(1 0 0 -1 0 0)"),this.labels=this.svg("g",i)}toSVG(t){const e=this.standardSvgNodes(t)[0];this.placeRows(e),this.handleColumnLines(e),this.handleRowLines(e),this.handleFrame(e);const s=this.handlePWidth(e);this.handleLabels(e,t[0],s)}},t.kind=En.prototype.kind,t.styles={'g[data-mml-node="mtable"] > line[data-line], svg[data-table] > g > line[data-line]':{"stroke-width":"70px",fill:"none"},'g[data-mml-node="mtable"] > rect[data-frame], svg[data-table] > g > rect[data-frame]':{"stroke-width":"70px",fill:"none"},'g[data-mml-node="mtable"] > .mjx-dashed, svg[data-table] > g > .mjx-dashed':{"stroke-dasharray":"140"},'g[data-mml-node="mtable"] > .mjx-dotted, svg[data-table] > g > .mjx-dotted':{"stroke-linecap":"round","stroke-dasharray":"0,140"},'g[data-mml-node="mtable"] > g > svg':{overflow:"visible"}},t}(),Id=function(){var t;const e=Gh(Qh);return t=class extends e{placeCell(t,e){const{x:s,y:i,lSpace:r,w:n,rSpace:o,lLine:a,rLine:l}=e,c=1/this.getBBox().rscale,[h,d]=[this.H*c,this.D*c],[u,p]=[this.tSpace*c,this.bSpace*c],[m,g]=t.placeCell(s+r,i,n,h,d),f=r+n+o;return t.placeColor(-(m+r+a/2),-(d+p+g),f+(a+l)/2,h+d+u+p),f+l}placeCells(t){const e=this.parent,s=e.getColumnHalfSpacing(),i=[e.fLine,...e.cLines,e.fLine],r=e.getComputedWidths(),n=1/this.getBBox().rscale;let o=i[0];for(let e=0;e<this.numCells;e++){const a=this.getChild(e);a.toSVG(t),o+=this.placeCell(a,{x:o,y:0,lSpace:s[e]*n,rSpace:s[e+1]*n,w:r[e]*n,lLine:i[e]*n,rLine:i[e+1]*n})}}placeColor(){const t=1/this.getBBox().rscale,e=this.adaptor,s=this.firstChild();if(s&&"rect"===e.kind(s)&&e.getAttribute(s,"data-bgcolor")){const[i,r]=[this.tLine/2*t,this.bLine/2*t],[n,o]=[this.tSpace*t,this.bSpace*t],[a,l]=[this.H*t,this.D*t];e.setAttribute(s,"y",this.fixed(-(l+o+r))),e.setAttribute(s,"width",this.fixed(this.parent.getWidth()*t)),e.setAttribute(s,"height",this.fixed(i+n+a+l+o+r))}}toSVG(t){const e=this.standardSvgNodes(t);this.placeCells(e),this.placeColor()}},t.kind=xn.prototype.kind,t}(),Rd=function(){var t;const e=Xh(Id);return(t=class extends e{toSVG(t){super.toSVG(t);const e=this.childNodes[0];e&&e.toSVG([this.parent.labels])}}).kind=yn.prototype.kind,t}(),Sd=function(){var t;const e=Wh(Qh);return t=class extends e{placeCell(t,e,s,i,r){const n=this.getBBox(),o=Math.max(n.h,.75),a=Math.max(n.d,.25),l=this.node.attributes.get("columnalign"),c=this.node.attributes.get("rowalign"),h=this.getAlignX(s,n,l),d=this.getAlignY(i,r,o,a,c);return this.place(t+h,e+d),[h,d]}placeColor(t,e,s,i){const r=this.adaptor,n=this.firstChild();n&&"rect"===r.kind(n)&&r.getAttribute(n,"data-bgcolor")&&(r.setAttribute(n,"x",this.fixed(t)),r.setAttribute(n,"y",this.fixed(e)),r.setAttribute(n,"width",this.fixed(s)),r.setAttribute(n,"height",this.fixed(i)))}},t.kind=Nn.prototype.kind,t}(),kd=function(){var t;const e=xh(Qh);return(t=class extends e{setEventHandler(t,e,s=null){(s?[s]:this.dom).forEach((s=>s.addEventListener(t,e)))}Px(t){return this.px(t)}toSVG(t){if(this.toEmbellishedSVG(t))return;const e=this.standardSvgNodes(t),s=this.selected;let i=0;this.dom.forEach((t=>{const{h:e,d:r,w:n}=s.getLineBBox(i++);this.adaptor.append(t,this.svg("rect",{width:this.fixed(n),height:this.fixed(e+r),x:1===i?this.fixed(-this.dx):0,y:this.fixed(-r),fill:"none","pointer-events":"all"}))})),s.toSVG(e);const r=s.getOuterBBox();s.dom&&s.place(r.L*r.rscale,0),this.action(this,this.data)}}).kind=ln.prototype.kind,t.styles={'[jax="SVG"] mjx-tool':{display:"inline-block",position:"relative",width:0,height:0},'[jax="SVG"] mjx-tool > mjx-tip':{position:"absolute",top:0,left:0},"mjx-tool > mjx-tip":{display:"inline-block","line-height":0,padding:".2em",border:"1px solid #888","background-color":"#F8F8F8",color:"black","box-shadow":"2px 2px 5px #AAAAAA"},'g[data-mml-node="maction"][data-toggle]':{cursor:"pointer"},"mjx-status":{display:"block",position:"fixed",left:"1em",bottom:"1em","min-width":"25%",padding:".2em .4em",border:"1px solid #888","font-size":"90%","background-color":"#F8F8F8",color:"black"},"g[data-mjx-collapsed]":{fill:"#55F"},"@media (prefers-color-scheme: dark) /* svg maction */":{"mjx-tool > mjx-tip":{"background-color":"#303030",color:"#E0E0E0","box-shadow":"2px 2px 5px #000"},"mjx-status":{"background-color":"#303030",color:"#E0E0E0"},"g[data-mjx-collapsed]":{fill:"#88F"}}},t.actions=new Map([["toggle",[(t,e)=>{t.dom.forEach((e=>{t.adaptor.setAttribute(e,"data-toggle",t.node.attributes.get("selection"))}));const s=t.factory.jax.math,i=t.factory.jax.document,r=t.node;t.setEventHandler("click",(t=>{s.end.node||(s.start.node=s.end.node=s.typesetRoot,s.start.n=s.end.n=0),r.nextToggleSelection(),s.rerender(i,r.attributes.get("data-maction-id")?lr.ENRICHED:lr.RERENDER),t.stopPropagation()}))},{}]],["tooltip",[(t,e)=>{const s=t.childNodes[1];if(s)for(const i of t.dom){const r=t.firstChild(i);if(s.node.isKind("mtext")){const e=s.node.getText();t.adaptor.insert(t.svg("title",{},[t.text(e)]),r)}else{const s=t.adaptor,n=t.jax.container,o=t.node.factory.create("math",{},[t.childNodes[1].node]),a=t.html("mjx-tool",{},[t.html("mjx-tip")]),l=s.append(r,t.svg("foreignObject",{style:{display:"none"}},[a]));t.jax.processMath(t.jax.factory.wrap(o),s.firstChild(a)),t.childNodes[1].node.parent=t.node,t.setEventHandler("mouseover",(r=>{e.stopTimers(i,e),e.hoverTimer.set(i,setTimeout((()=>{s.setStyle(a,"left","0"),s.setStyle(a,"top","0"),s.append(n,a);const e=s.nodeBBox(a),r=s.nodeBBox(i),o=(r.right-e.left)/t.metrics.em+t.tipDx,l=(r.bottom-e.bottom)/t.metrics.em+t.tipDy;s.setStyle(a,"left",t.Px(o)),s.setStyle(a,"top",t.Px(l))}),e.postDelay)),r.stopPropagation()}),i),t.setEventHandler("mouseout",(t=>{e.stopTimers(i,e);const r=setTimeout((()=>s.append(l,a)),e.clearDelay);e.clearTimer.set(i,r),t.stopPropagation()}),i)}}},Eh]],["statusline",[(t,e)=>{const s=t.childNodes[1];if(s&&s.node.isKind("mtext")){const i=t.adaptor,r=s.node.getText();t.dom.forEach((t=>i.setAttribute(t,"data-statusline",r))),t.setEventHandler("mouseover",(s=>{if(null===e.status){const s=i.body(i.document);e.status=i.append(s,t.html("mjx-status",{},[t.text(r)]))}s.stopPropagation()})),t.setEventHandler("mouseout",(t=>{e.status&&(i.remove(e.status),e.status=null),t.stopPropagation()}))}},{status:null}]]]),t}(),Od={top:(t,e,s,i)=>[0,t-i,s,t-i],right:(t,e,s,i)=>[s-i,-e,s-i,t],bottom:(t,e,s,i)=>[0,i-e,s,i-e],left:(t,e,s,i)=>[i,-e,i,t],vertical:(t,e,s,i)=>[s/2,t,s/2,-e],horizontal:(t,e,s,i)=>[0,(t-e)/2,s,(t-e)/2],up:(t,e,s,i)=>[i,i-e,s-i,t-i],down:(t,e,s,i)=>[i,t-i,s-i,i-e]},Md=function(t,e,s=""){const{h:i,d:r,w:n}=t.getBBox(),o=t.thickness/2;return Dd(Od[e](i,r,n,o),t,s)},Dd=function(t,e,s){if(s){const i=e.getOffset(s);i&&("X"===s?(t[0]-=i,t[2]-=i):(t[1]-=i,t[3]-=i))}return t},Pd=function(t,e=""){return(s,i)=>{const r=s.line(Md(s,t,e));s.adaptor.append(s.dom[0],r)}},Bd=function(t){return rh(((e,s)=>{e.adaptor.append(e.dom[0],e.line(Md(e,t)))}))(t)},Fd=function(t,e,s){return nh(((t,i)=>{t.adaptor.append(t.dom[0],t.line(Md(t,e))),t.adaptor.append(t.dom[0],t.line(Md(t,s)))}))(t,e,s)},Ud=function(t){return oh((e=>(e,s)=>{e.adaptor.append(e.dom[0],e.line(Md(e,t)))}))(t)},jd=function(t){return ah(((t,e)=>{t.adaptor.append(t.dom[0],e)}))(t)},qd=function(t){return lh(((t,e)=>{t.adaptor.append(t.dom[0],e)}))(t)},Hd=function(){var t;const e=Nh(Qh);return(t=class extends e{line(t){const[e,s,i,r]=t;return this.svg("line",{x1:this.fixed(e),y1:this.fixed(s),x2:this.fixed(i),y2:this.fixed(r),"stroke-width":this.fixed(this.thickness)})}box(t,e,s,i=0){const r=this.thickness,n={x:this.fixed(r/2),y:this.fixed(r/2-s),width:this.fixed(t-r),height:this.fixed(e+s-r),fill:"none","stroke-width":this.fixed(r)};return i&&(n.rx=this.fixed(i)),this.svg("rect",n)}ellipse(t,e,s){const i=this.thickness;return this.svg("ellipse",{rx:this.fixed((t-i)/2),ry:this.fixed((e+s-i)/2),cx:this.fixed(t/2),cy:this.fixed((e-s)/2),fill:"none","stroke-width":this.fixed(i)})}path(t,...e){return this.svg("path",{d:e.map((t=>"string"==typeof t?t:this.fixed(t))).join(" "),style:{"stroke-width":this.fixed(this.thickness)},"stroke-linecap":"round","stroke-linejoin":t,fill:"none"})}fill(...t){return this.svg("path",{d:t.map((t=>"string"==typeof t?t:this.fixed(t))).join(" ")})}arrow(t,e,s,i="",r=0){const{w:n,h:o,d:a}=this.getBBox(),l=(t-n)/2,c=(o-a)/2,h=this.thickness,d=h/2,[u,p,m]=[h*this.arrowhead.x,h*this.arrowhead.y,h*this.arrowhead.dx],g=s?this.fill("M",n+l,c,"l",-(u+m),p,"l",m,d-p,"L",u-l,c+d,"l",m,p-d,"l",-(u+m),-p,"l",u+m,-p,"l",-m,p-d,"L",n+l-u,c-d,"l",-m,d-p,"Z"):this.fill("M",n+l,c,"l",-(u+m),p,"l",m,d-p,"L",-l,c+d,"l",0,-h,"L",n+l-u,c-d,"l",-m,d-p,"Z"),f=[];if(r&&f.push("X"===i?`translate(${this.fixed(-r)} 0)`:`translate(0 ${this.fixed(r)})`),e){const t=this.jax.fixed(180*-e/Math.PI);f.push(`rotate(${t} ${this.fixed(n/2)} ${this.fixed(c)})`)}return f.length&&this.adaptor.setAttribute(g,"transform",f.join(" ")),g}toSVG(t){const e=this.standardSvgNodes(t),s=this.getBBoxExtenders()[3],i={};s>0&&(i.transform="translate("+this.fixed(s)+", 0)");const r=this.adaptor.append(e[0],this.svg("g",i));this.renderChild?this.renderChild(this,r):(this.childNodes[0].toSVG([r]),this.childNodes[0].place(0,0));for(const t of Object.keys(this.notations)){const s=this.notations[t];s.renderChild||s.renderer(this,e[0])}}}).kind=an.prototype.kind,t.notations=new Map([Bd("top"),Bd("right"),Bd("bottom"),Bd("left"),Fd("actuarial","top","right"),Fd("madruwb","bottom","right"),Ud("up"),Ud("down"),["horizontalstrike",{renderer:Pd("horizontal","Y"),bbox:t=>[0,t.padding,0,t.padding]}],["verticalstrike",{renderer:Pd("vertical","X"),bbox:t=>[t.padding,0,t.padding,0]}],["box",{renderer:(t,e)=>{const{w:s,h:i,d:r}=t.getBBox();t.adaptor.append(t.dom[0],t.box(s,i,r))},bbox:Jc,border:Yc,remove:"left right top bottom"}],["roundedbox",{renderer:(t,e)=>{const{w:s,h:i,d:r}=t.getBBox(),n=t.thickness+t.padding;t.adaptor.append(t.dom[0],t.box(s,i,r,n))},bbox:Jc}],["circle",{renderer:(t,e)=>{const{w:s,h:i,d:r}=t.getBBox();t.adaptor.append(t.dom[0],t.ellipse(s,i,r))},bbox:Jc}],["phasorangle",{renderer:(t,e)=>{const{w:s,h:i,d:r}=t.getBBox(),n=t.getArgMod(1.75*t.padding,i+r)[0],o=t.thickness/2,a=i+r,l=Math.cos(n);t.adaptor.append(t.dom[0],t.path("mitre","M",s,o-r,"L",o+l*o,o-r,"L",l*a+o,a-r-o))},bbox:t=>{const e=t.padding/2,s=t.thickness;return[2*e,e,e+s,3*e+s]},border:t=>[0,0,t.thickness,0],remove:"bottom"}],qd("up"),qd("down"),qd("left"),qd("right"),qd("updown"),qd("leftright"),jd("updiagonal"),jd("northeast"),jd("southeast"),jd("northwest"),jd("southwest"),jd("northeastsouthwest"),jd("northwestsoutheast"),["longdiv",{renderer:(t,e)=>{const{w:s,h:i,d:r}=t.getBBox(),n=t.thickness/2,o=t.padding;t.adaptor.append(t.dom[0],t.path("round","M",n,n-r,"a",o-n/2,(i+r)/2-4*n,0,"0,1",0,i+r-2*n,"L",s-n,i-n))},bbox:t=>{const e=t.padding,s=t.thickness;return[e+s,e,e,2*e+s/2]}}],["radical",{renderer:(t,e)=>{t.msqrt.toSVG([e]);const s=t.sqrtTRBL()[3];t.place(-s,0,e)},init:t=>{t.msqrt=t.createMsqrt(t.childNodes[0])},bbox:t=>t.sqrtTRBL(),renderChild:!0}]]),t}(),Wd=function(){var t;const e=Yh(Qh);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;const e=this.standardSvgNodes(t);this.childNodes.length&&this.childNodes[0].toSVG(e)}}).kind=wn.prototype.kind,t}(),Vd=function(){var t;return(t=class extends Qh{toSVG(t){super.toSVG(t)}computeBBox(){return this.bbox}}).kind=Cn.prototype.kind,t}(),Gd=function(){var t;return(t=class extends Qh{}).kind=Tn.prototype.kind,t.styles={"foreignObject[data-mjx-xml]":{"font-family":"initial","line-height":"normal",overflow:"visible"}},t}(),Xd=function(){var t;const e=bh(Qh);return t=class extends e{toSVG(t){const e=this.jax.math.metrics,s=e.em*e.scale*this.rscale,i=this.fixed(1/s,3),{w:r,h:n,d:o}=this.getBBox();this.dom=[this.adaptor.append(t[0],this.svg("foreignObject",{"data-mjx-xml":!0,y:this.jax.fixed(-n*s)+"px",width:this.jax.fixed(r*s)+"px",height:this.jax.fixed((n+o)*s)+"px",transform:`scale(${i}) matrix(1 0 0 -1 0 0)`},[this.getHTML()]))]}addHDW(t,e){t=this.html("mjx-html-holder",{style:e},[t]);const{h:s,d:i,w:r}=this.getBBox(),n=this.metrics.scale;return e.height=this.em((s+i)*n),e.width=this.em(r*n),e["vertical-align"]=this.em(-i*n),delete e["font-size"],delete e["font-family"],t}},t.kind=Lr.prototype.kind,t.styles=Object.assign({"foreignObject[data-mjx-html]":{overflow:"visible"}},e.styles),t}(),zd=function(){var t;const e=_h(Qh);return(t=class extends e{toSVG(t){const e=this.standardSvgNodes(t);if(this.charWrapper)return void this.charWrapper.toSVG(e);const{src:s,alt:i}=this.node.attributes.getList("src","alt"),r=this.fixed(this.height),n={width:this.fixed(this.width),height:r,transform:"translate(0 "+this.fixed(this.height+(this.valign||0))+") matrix(1 0 0 -1 0 0)",preserveAspectRatio:"none","aria-label":i,href:s},o=this.svg("image",n);this.adaptor.append(e[0],o)}}).kind=_n.prototype.kind,t}(),Kd=function(){var t;const e=gh(Qh);return(t=class extends e{toSVG(t){super.toSVG(t),this.adaptor.setAttribute(this.dom[0],"data-mjx-texclass",br[this.node.texClass])}}).kind=Ln.prototype.kind,t}(),Jd=function(){var t;const e=fh(Qh);return(t=class extends e{static addStyles(t,e){t.addStyles({'mjx-container[jax="SVG"] path[data-c], mjx-container[jax="SVG"] use[data-c]':{"stroke-width":e.options.blacker}})}toSVG(t){const e=this.adaptor,s=this.parent.variant,i=this.node.getText();if(0!==i.length)if("-explicitFont"===s)this.dom=[e.append(t[0],this.jax.unknownText(i,s))];else{const r=this.remappedText(i,s);this.parent.childNodes.length>1?t=this.dom=[e.append(t[0],this.svg("g",{"data-mml-node":"text"}))]:this.dom=t;let n=0;for(const e of r)n+=this.placeChar(e,n,0,t[0],s,!0);this.addUtext(n,0,t[0],s)}}}).kind=Cr.prototype.kind,t}(),$d=function(){var t;return(t=class extends Xd{}).kind=Rn.prototype.kind,t}(),Yd={[td.kind]:td,[ed.kind]:ed,[sd.kind]:sd,[id.kind]:id,[ad.kind]:ad,[ld.kind]:ld,[cd.kind]:cd,[hd.kind]:hd,[dd.kind]:dd,[ud.kind]:ud,[pd.kind]:pd,[md.kind]:md,[gd.kind]:gd,[fd.kind]:fd,[bd.kind]:bd,[Ed.kind]:Ed,[yd.kind]:yd,[Nd.kind]:Nd,[Ad.kind]:Ad,[vd.kind]:vd,[_d.kind]:_d,[wd.kind]:wd,[Cd.kind]:Cd,[Ld.kind]:Ld,[Id.kind]:Id,[Rd.kind]:Rd,[Sd.kind]:Sd,[kd.kind]:kd,[Hd.kind]:Hd,[Wd.kind]:Wd,[Vd.kind]:Vd,[Gd.kind]:Gd,[Xd.kind]:Xd,[zd.kind]:zd,[Kd.kind]:Kd,[Jd.kind]:Jd,[$d.kind]:$d,[Qh.kind]:Qh};class Qd extends mh{}Qd.defaultNodes=Yd;class Zd{constructor(t){this.cache=new Map,this.defs=null,this.localID="",this.nextID=0,this.jax=t}cachePath(t,e,s){const i="MJX-"+this.localID+(this.jax.font.getVariant(t).cacheID||"")+"-"+e;return this.cache.has(i)||(this.cache.set(i,s),this.jax.adaptor.append(this.defs,this.jax.svg("path",{id:i,d:s}))),i}clearLocalID(){this.localID=""}useLocalID(t=null){this.localID=(null==t?++this.nextID:t)+(""===t?"":"-")}clearCache(){this.cache=new Map,this.defs=this.jax.svg("defs")}getCache(){return this.defs}}const tu="mathjax-newcm",eu=null,su="http://www.w3.org/2000/svg",iu="http://www.w3.org/1999/xlink";class ru extends jc{get forceInlineBreaks(){return!0}constructor(t={}){super(t,Qd,eu),this.minwidth=0,this.shift=0,this.svgStyles=null,this.fontCache=new Zd(this),this.options.matchFontHeight=!0}initialize(){"global"===this.options.fontCache&&this.fontCache.clearCache()}clearFontCache(){this.fontCache.clearCache()}reset(){this.clearFontCache()}escaped(t,e){return this.setDocument(e),this.html("span",{},[this.text(t.math)])}styleSheet(t){if(this.svgStyles)return this.svgStyles;const e=this.svgStyles=super.styleSheet(t);return this.adaptor.setAttribute(e,"id",ru.STYLESHEETID),e}insertStyles(t){this.svgStyles&&this.adaptor.insertRules(this.svgStyles,new lo(t).getStyleRules())}pageElements(t){return"global"!==this.options.fontCache||this.findCache(t)?null:this.svg("svg",{xmlns:su,id:ru.FONTCACHEID,style:{display:"none"}},[this.fontCache.getCache()])}findCache(t){const e=this.adaptor,s=e.tags(e.body(t.document),"svg");for(let t=s.length-1;t>=0;t--)if(this.adaptor.getAttribute(s[t],"id")===ru.FONTCACHEID)return!0;return!1}getInitialScale(){return 1}processMath(t,e){const s=this.container;this.container=e;const[i,r]=this.createRoot(t);this.typesetSvg(t,i,r),t.node.getProperty("process-breaks")&&this.handleInlineBreaks(t,i,r),this.container=s}createRoot(t){const{w:e,h:s,d:i,pwidth:r}=t.getOuterBBox(),[n,o]=this.createSVG(s,i,e);if(r){const e=this.adaptor;e.setStyle(n,"min-width",e.getStyle(n,"width")),e.setAttribute(n,"width",r),e.setAttribute(n,"data-mjx-viewBox",e.getAttribute(n,"viewBox")),e.removeAttribute(n,"viewBox");const i=this.fixed(t.metrics.ex/(1e3*this.font.params.x_height),6);e.setAttribute(o,"transform",`scale(${i},-${i}) translate(0, ${this.fixed(1e3*-s,1)})`)}return[n,o]}createSVG(t,e,s){const i=this.math.metrics.em/1e3,r=Math.max(s,i),n=Math.max(t+e,i),o=this.svg("g",{stroke:"currentColor",fill:"currentColor","stroke-width":0,transform:"scale(1,-1)"}),a=this.adaptor,l=a.append(this.container,this.svg("svg",{xmlns:su,width:this.ex(r),height:this.ex(n),role:"img",focusable:!1,style:{"vertical-align":this.ex(-e)},viewBox:[0,this.fixed(1e3*-t,1),this.fixed(1e3*r,1),this.fixed(1e3*n,1)].join(" ")},[o]));return.001===r&&(a.setAttribute(l,"preserveAspectRatio","xMidYMid slice"),s<0&&a.setStyle(this.container,"margin-right",this.ex(s))),"none"!==this.options.fontCache&&this.options.useXlink&&a.setAttribute(l,"xmlns:xlink",iu),[l,o]}typesetSvg(t,e,s){const i=this.adaptor;if(this.minwidth=this.shift=0,"local"===this.options.fontCache&&(this.fontCache.clearCache(),this.fontCache.useLocalID(this.options.localID),i.insert(this.fontCache.getCache(),s)),t.toSVG([s]),this.fontCache.clearLocalID(),this.minwidth)i.setStyle(e,"minWidth",this.ex(this.minwidth)),i.setStyle(this.container,"minWidth",this.ex(this.minwidth));else if(this.shift){const t=i.getAttribute(this.container,"justify")||"center";this.setIndent(e,t,this.shift)}}setIndent(t,e,s){"center"!==e&&"left"!==e||this.adaptor.setStyle(t,"margin-left",this.ex(s)),"center"!==e&&"right"!==e||this.adaptor.setStyle(t,"margin-right",this.ex(-s))}handleInlineBreaks(t,e,s){const i=t.childNodes[0].breakCount;if(!i)return;const r=this.adaptor,n=r.firstChild(s),o=r.childNodes(r.firstChild(n)),a=t.childNodes[0].lineBBox;r.remove(s);for(let s=0;s<=i;s++){const i=a[s]||t.childNodes[0].getLineBBox(s),{h:l,d:c,w:h}=i,[d,u]=t.childNodes[0].getBreakNode(i),{scale:p}=d.getBBox(),[m,g]=this.createSVG(l*p,c*p,h*p),f=r.append(g,r.clone(n,!1));for(const t of r.childNodes(o[s]))r.append(f,t);r.insert(m,e);const b=!(!u||!u.node.getProperty("forcebreak"));if(b&&"after"===u.node.attributes.get("linebreakstyle")){const t=d.parent.node.childIndex(d.node)+1,e=d.parent.childNodes[t],s=e?e.getLineBBox(0).originalL*p:0;s&&this.addInlineBreak(m,s,b)}else if(b||s){const t=d&&s?d.getLineBBox(0).originalL*p:0;!t&&b||this.addInlineBreak(m,t,b||!!d.node.getProperty("forcebreak"))}}r.childNodes(e).length&&r.append(r.firstChild(r.parent(e)),r.firstChild(e)),r.remove(e)}addInlineBreak(t,e,s){const i=this.adaptor,r=No(e);s||i.insert(i.node("mjx-break",{prebreak:!0},[i.text(" ")]),t),i.insert(i.node("mjx-break",s?uh[r]?{size:uh[r]}:{style:`letter-spacing: ${No(e-1)}`}:{newline:!0},[i.text(" ")]),t)}ex(t){return t/=this.font.params.x_height,Math.abs(t)<.001?"0":t.toFixed(3).replace(/\.?0+$/,"")+"ex"}svg(t,e={},s=[]){return this.html(t,e,s,su)}unknownText(t,e){const s=this.math.metrics,i=this.font.params.x_height/s.ex*s.em*1e3,r=this.svg("text",{"data-variant":e,transform:"scale(1,-1)","font-size":this.fixed(i,1)+"px"},[this.text(t)]),n=this.adaptor;if("-explicitFont"!==e){const s=jr(t);if(1!==s.length||s[0]<119808||s[0]>120831){const[t,s,i]=this.font.getCssFont(e);n.setAttribute(r,"font-family",t),s&&n.setAttribute(r,"font-style","italic"),i&&n.setAttribute(r,"font-weight","bold")}}return r}measureTextNode(t){const e=this.adaptor;t=e.clone(t),e.removeAttribute(t,"transform");const s=this.fixed(1e3*this.font.params.x_height,1),i=this.svg("svg",{position:"absolute",visibility:"hidden",width:"1ex",height:"1ex",top:0,left:0,viewBox:[0,0,s,s].join(" ")},[t]);e.append(e.body(e.document),i);const r=e.nodeSize(t,1e3,!0)[0];return e.remove(i),{w:r,h:.75,d:.2}}}function nu(t,e,s,i=""){const r=s.fontPath||`[fonts]/%%FONT%%-font${i}`,n=t.match(/^[a-z]+:/)?(t.match(/[^/:\\]*$/)||[e])[0]:t;return hi(MathJax.config.loader,"paths",{[n+i]:n===t?r.replace(/%%FONT%%/g,t):t}),`[${n}${i}]`}ru.NAME="SVG",ru.OPTIONS=Object.assign(Object.assign({},jc.OPTIONS),{blacker:3,fontCache:"local",localID:null,useXlink:!0}),ru.commonStyles=Object.assign(Object.assign({},jc.commonStyles),{'mjx-container[jax="SVG"]':{direction:"ltr","white-space":"nowrap"},'mjx-container[jax="SVG"] > svg':{overflow:"visible","min-height":"1px","min-width":"1px"},'mjx-container[jax="SVG"] > svg a':{fill:"blue",stroke:"blue"},[["rect[data-sre-highlighter-added]:has(+ .mjx-selected)","rect[data-sre-highlighter-bbox].mjx-selected"].join(", ")]:{stroke:"black","stroke-width":"80px"},"@media (prefers-color-scheme: dark)":{[["rect[data-sre-highlighter-added]:has(+ .mjx-selected)","rect[data-sre-highlighter-bbox].mjx-selected"].join(", ")]:{stroke:"#C8C8C8"}}}),ru.FONTCACHEID="MJX-SVG-global-cache",ru.STYLESHEETID="MJX-SVG-styles",MathJax.loader&&MathJax.loader.checkVersion("output/svg",ni,"output"),di({_:{output:{common_ts:Ae,common:{Direction:Ee,FontData:xe,LineBBox:ye,LinebreakVisitor:Ne,Notation:ve,Wrapper:_e,WrapperFactory:we,Wrappers:{TeXAtom:Te,TextNode:Ce,XmlNode:Le,maction:Ie,math:Re,menclose:Se,mfenced:ke,mfrac:Oe,mglyph:Me,mi:De,mmultiscripts:Pe,mn:Be,mo:Fe,mpadded:Ue,mroot:je,mrow:qe,ms:He,mspace:We,msqrt:Ve,msubsup:Ge,mtable:Xe,mtd:ze,mtext:Ke,mtr:Je,munderover:$e,scriptbase:Ye,semantics:Qe}},svg_ts:Ps,svg:{DefaultFont:Ds,FontCache:Ms,FontData:rs,Notation:ws,Wrapper:Ze,WrapperFactory:Os,Wrappers_ts:ks,Wrappers:{HtmlNode:Ss,TeXAtom:Is,TextNode:Rs,maction:_s,math:es,menclose:Ts,merror:cs,mfenced:fs,mfrac:ps,mglyph:Ls,mi:is,mmultiscripts:ys,mn:os,mo:ns,mpadded:ds,mphantom:us,mroot:gs,mrow:ss,ms:as,mspace:hs,msqrt:ms,msubsup:Es,mtable:Ns,mtd:vs,mtext:ls,mtr:As,munderover:xs,scriptbase:bs,semantics:Cs,zero:ts}}}}});const ou={config(t,e,s,i){if(MathJax.loader){hi(MathJax.config,t,MathJax.config.output||{});let e=MathJax.config[t],r=e.font||e.fontData||s;"string"!=typeof r&&(e.fontData=r,e.font=r=r.NAME),"["!==r.charAt(0)&&(r=nu(r,t,e));const n=r.substring(1,r.length-1),o=function(t,e){const s=[];for(const i of e.fontExtensions||[]){const r=`${nu(i,t,e,"-extension")}/${t}`;s.push(r)}return s}(t,e);if(o.length&&MathJax.loader.addPackageData(`${r}/${t}`,{extraLoads:o}),n===s&&i){const e=MathJax.config.loader[`${r}/${t}`]?.extraLoads;e&&MathJax.loader.addPackageData(`output/${t}`,{extraLoads:e}),di({_:{output:{fonts:{[n]:{[t+"_ts"]:{[i.NAME+"Font"]:i}}}}}}),hi(MathJax,"config",{output:{font:r},[t]:{fontData:i,dynamicPrefix:`${r}/${t}/dynamic`}}),"chtml"===t&&hi(MathJax.config,t,{fontURL:fi.resolvePath(`${r}/${t}/woff2`,!1)})}else MathJax.loader.addPackageData(`output/${t}`,{extraLoads:[`${r}/${t}`]})}MathJax.startup&&(MathJax.startup.registerConstructor(t,e),MathJax.startup.useOutput(t))},loadFont:(t,e,s,i)=>MathJax.loader?(i&&MathJax.loader.preLoaded(`[${s}]/${e}`),fi.loadPromise(`output/${e}`).then(t)):t};var au;ou.config("svg",ru,tu,eu),function(t){t[t.RETURN=13]="RETURN",t[t.ESCAPE=27]="ESCAPE",t[t.SPACE=32]="SPACE",t[t.LEFT=37]="LEFT",t[t.UP=38]="UP",t[t.RIGHT=39]="RIGHT",t[t.DOWN=40]="DOWN"}(au||(au={}));const lu="click",cu="dblclick",hu="mousedown",du="mouseup",uu="mouseover",pu="mouseout",mu="selectstart";class gu{constructor(){this.bubble=!1}bubbleKey(){this.bubble=!0}keydown(t){switch(t.keyCode){case au.ESCAPE:this.escape(t);break;case au.RIGHT:this.right(t);break;case au.LEFT:this.left(t);break;case au.UP:this.up(t);break;case au.DOWN:this.down(t);break;case au.RETURN:case au.SPACE:this.space(t);break;default:return}this.bubble?this.bubble=!1:this.stop(t)}escape(t){}space(t){}left(t){}right(t){}up(t){}down(t){}stop(t){t&&(t.stopPropagation(),t.preventDefault(),t.cancelBubble=!0)}mousedown(t){return this.stop(t)}mouseup(t){return this.stop(t)}mouseover(t){return this.stop(t)}mouseout(t){return this.stop(t)}click(t){return this.stop(t)}addEvents(t){t.addEventListener(hu,this.mousedown.bind(this)),t.addEventListener(du,this.mouseup.bind(this)),t.addEventListener(uu,this.mouseover.bind(this)),t.addEventListener(pu,this.mouseout.bind(this)),t.addEventListener(lu,this.click.bind(this)),t.addEventListener("keydown",this.keydown.bind(this)),t.addEventListener("dragstart",this.stop.bind(this)),t.addEventListener(mu,this.stop.bind(this)),t.addEventListener("contextmenu",this.stop.bind(this)),t.addEventListener(cu,this.stop.bind(this))}}class fu extends gu{addAttributes(t){for(const e in t)this.html.setAttribute(e,t[e])}get html(){return this._html||this.generateHtml(),this._html}set html(t){this._html=t,this.addEvents(t)}generateHtml(){const t=document.createElement("div");t.classList.add(this.className),t.setAttribute("role",this.role),this.html=t}focus(){const t=this.html;t.setAttribute("tabindex","0"),setTimeout((()=>t.focus()),50)}unfocus(){const t=this.html;t.hasAttribute("tabindex")&&t.setAttribute("tabindex","-1");try{t.blur()}catch(t){}t.blur()}}class bu extends fu{constructor(){super(...arguments),this.posted=!1}isPosted(){return this.posted}post(t,e){this.posted||(void 0!==t&&void 0!==e&&this.html.setAttribute("style","left: "+t+"px; top: "+e+"px;"),this.display(),this.posted=!0)}unpost(){if(!this.posted)return;const t=this.html;t.parentNode&&t.parentNode.removeChild(t),this.posted=!1}}function Eu(t){return"CtxtMenu_"+t}function xu(t){return Eu(t)}function yu(t){return Eu(t)}const Nu={ATTACHED:xu("Attached"),CONTEXTMENU:xu("ContextMenu"),MENU:xu("Menu"),MENUARROW:xu("MenuArrow"),MENUACTIVE:xu("MenuActive"),MENUCHECK:xu("MenuCheck"),MENUCLOSE:xu("MenuClose"),MENUCOMBOBOX:xu("MenuComboBox"),MENUDISABLED:xu("MenuDisabled"),MENUFRAME:xu("MenuFrame"),MENUITEM:xu("MenuItem"),MENULABEL:xu("MenuLabel"),MENURADIOCHECK:xu("MenuRadioCheck"),MENUINPUTBOX:xu("MenuInputBox"),MENURULE:xu("MenuRule"),MENUSLIDER:xu("MenuSlider"),MOUSEPOST:xu("MousePost"),RTL:xu("RTL"),INFO:xu("Info"),INFOCLOSE:xu("InfoClose"),INFOCONTENT:xu("InfoContent"),INFOSIGNATURE:xu("InfoSignature"),INFOTITLE:xu("InfoTitle"),SLIDERVALUE:xu("SliderValue"),SLIDERBAR:xu("SliderBar"),SELECTION:xu("Selection"),SELECTIONBOX:xu("SelectionBox"),SELECTIONMENU:xu("SelectionMenu"),SELECTIONDIVIDER:xu("SelectionDivider"),SELECTIONITEM:xu("SelectionItem")},Au={COUNTER:yu("Counter"),KEYDOWNFUNC:yu("keydownFunc"),CONTEXTMENUFUNC:yu("contextmenuFunc"),OLDTAB:yu("Oldtabindex"),TOUCHFUNC:yu("TouchFunc")};class vu extends fu{constructor(t,e){super(),this._menu=t,this._type=e,this.className=Nu.MENUITEM,this.role="menuitem",this.hidden=!1}get menu(){return this._menu}set menu(t){this._menu=t}get type(){return this._type}hide(){this.hidden=!0,this.menu.generateMenu()}show(){this.hidden=!1,this.menu.generateMenu()}isHidden(){return this.hidden}}function _u(t){const e=t.menu;e.baseMenu?e.baseMenu.unpost():e.unpost()}function wu(t){const e=t.menu;return(e.baseMenu?e.baseMenu:e).store.active}function Tu(t,e){console.error("ContextMenu Error: "+e)}function Cu(){return Lu++}let Lu=0;class Iu extends vu{constructor(t,e,s,i){super(t,e),this._content=s,this.disabled=!1,this.callbacks=[],this._id=i||s}get content(){return this._content}set content(t){this._content=t,this.generateHtml(),this.menu&&this.menu.generateHtml()}get id(){return this._id}press(){this.disabled||(this.executeAction(),this.executeCallbacks_())}executeAction(){}registerCallback(t){-1===this.callbacks.indexOf(t)&&this.callbacks.push(t)}unregisterCallback(t){const e=this.callbacks.indexOf(t);-1!==e&&this.callbacks.splice(e,1)}mousedown(t){this.press(),this.stop(t)}mouseover(t){this.focus(),this.stop(t)}mouseout(t){this.deactivate(),this.stop(t)}generateHtml(){super.generateHtml();const t=this.html;t.setAttribute("aria-disabled","false"),t.textContent=this.content}activate(){this.disabled||this.html.classList.add(Nu.MENUACTIVE)}deactivate(){this.html.classList.remove(Nu.MENUACTIVE)}focus(){this.menu.focused=this,super.focus(),this.activate()}unfocus(){this.deactivate(),super.unfocus()}escape(t){_u(this)}up(t){this.menu.up(t)}down(t){this.menu.down(t)}left(t){this.menu.left(t)}right(t){this.menu.right(t)}space(t){this.press()}disable(){this.disabled=!0;const t=this.html;t.classList.add(Nu.MENUDISABLED),t.setAttribute("aria-disabled","true")}enable(){this.disabled=!1;const t=this.html;t.classList.remove(Nu.MENUDISABLED),t.removeAttribute("aria-disabled")}executeCallbacks_(){for(const t of this.callbacks)try{t(this)}catch(t){Tu(0,"Callback for menu entry "+this.id+" failed.")}}}class Ru extends Iu{static fromJson(t,{content:e,menu:s,id:i},r){const n=new this(r,e,i),o=t.get("subMenu")(t,s,n);return n.submenu=o,n}constructor(t,e,s){super(t,"submenu",e,s),this._submenu=null}set submenu(t){this._submenu=t}get submenu(){return this._submenu}mouseover(t){this.focus(),this.stop(t)}mouseout(t){this.stop(t)}unfocus(){if(this.submenu.isPosted()){if(this.menu.focused!==this)return super.unfocus(),void this.menu.unpostSubmenus();this.html.setAttribute("tabindex","-1"),this.html.blur()}else super.unfocus()}focus(){super.focus(),this.submenu.isPosted()||this.disabled||this.submenu.post()}executeAction(){this.submenu.isPosted()?this.submenu.unpost():this.submenu.post()}generateHtml(){super.generateHtml();const t=this.html;this.span=document.createElement("span"),this.span.textContent="\u25ba",this.span.classList.add(Nu.MENUARROW),this.span.setAttribute("aria-hidden","true"),t.appendChild(this.span),t.setAttribute("aria-haspopup","true")}left(t){this.submenu.isPosted()?this.submenu.unpost():super.left(t)}right(t){this.submenu.isPosted()?this.submenu.down(t):this.submenu.post()}toJson(){return{type:""}}}class Su extends bu{constructor(){super(...arguments),this.className=Nu.CONTEXTMENU,this.role="menu",this._items=[],this._baseMenu=null}set baseMenu(t){this._baseMenu=t}get baseMenu(){return this._baseMenu}get items(){return this._items}set items(t){this._items=t}get pool(){return this.variablePool}get focused(){return this._focused}set focused(t){if(this._focused===t)return;this._focused||this.unfocus();const e=this._focused;this._focused=t,e&&e.unfocus()}up(t){const e=this.items.filter((t=>t instanceof Iu&&!t.isHidden()));if(0===e.length)return;if(!this.focused)return void e[e.length-1].focus();let s=e.indexOf(this.focused);-1!==s&&(s=s?--s:e.length-1,e[s].focus())}down(t){const e=this.items.filter((t=>t instanceof Iu&&!t.isHidden()));if(0===e.length)return;if(!this.focused)return void e[0].focus();let s=e.indexOf(this.focused);-1!==s&&(s++,s=s===e.length?0:s,e[s].focus())}generateHtml(){super.generateHtml(),this.generateMenu()}generateMenu(){const t=this.html;t.classList.add(Nu.MENU);for(const e of this.items){if(!e.isHidden()){t.appendChild(e.html);continue}const s=e.html;s.parentNode&&s.parentNode.removeChild(s)}}post(t,e){this.variablePool.update(),super.post(t,e)}unpostSubmenus(){const t=this.items.filter((t=>t instanceof Ru));for(const e of t)e.submenu.unpost(),e!==this.focused&&e.unfocus()}unpost(){super.unpost(),this.unpostSubmenus(),this.focused=null}find(t){for(const e of this.items)if("rule"!==e.type){if(e.id===t)return e;if("submenu"===e.type){const s=e.submenu.find(t);if(s)return s}}return null}}class ku{constructor(t){this.menu=t,this.store=[],this._active=null,this.counter=0,this.attachedClass=Nu.ATTACHED+"_"+Cu(),this.taborder=!0,this.attrMap={}}set active(t){do{if(-1!==this.store.indexOf(t)){this._active=t;break}t=t.parentNode}while(t)}get active(){return this._active}next(){const t=this.store.length;if(0===t)return this.active=null,null;let e=this.store.indexOf(this.active);return e=-1===e?0:e<t-1?e+1:0,this.active=this.store[e],this.active}previous(){const t=this.store.length;if(0===t)return this.active=null,null;const e=t-1;let s=this.store.indexOf(this.active);return s=-1===s||0===s?e:s-1,this.active=this.store[s],this.active}clear(){this.remove(this.store)}insert(t){const e=t instanceof HTMLElement?[t]:t;for(const t of e)this.insertElement(t);this.sort()}remove(t){const e=t instanceof HTMLElement?[t]:t;for(const t of e)this.removeElement(t);this.sort()}inTaborder(t){this.taborder&&!t&&this.removeTaborder(),!this.taborder&&t&&this.insertTaborder(),this.taborder=t}insertTaborder(){this.taborder&&this.insertTaborder_()}removeTaborder(){this.taborder&&this.removeTaborder_()}insertElement(t){t.classList.contains(this.attachedClass)||(t.classList.add(this.attachedClass),this.taborder&&this.addTabindex(t),this.addEvents(t))}removeElement(t){t.classList.contains(this.attachedClass)&&(t.classList.remove(this.attachedClass),this.taborder&&this.removeTabindex(t),this.removeEvents(t))}sort(){const t=document.getElementsByClassName(this.attachedClass);this.store=[].slice.call(t)}insertTaborder_(){this.store.forEach((t=>t.setAttribute("tabindex","0")))}removeTaborder_(){this.store.forEach((t=>t.setAttribute("tabindex","-1")))}addTabindex(t){t.hasAttribute("tabindex")&&t.setAttribute(Au.OLDTAB,t.getAttribute("tabindex")),t.setAttribute("tabindex","0")}removeTabindex(t){t.hasAttribute(Au.OLDTAB)?(t.setAttribute("tabindex",t.getAttribute(Au.OLDTAB)),t.removeAttribute(Au.OLDTAB)):t.removeAttribute("tabindex")}addEvents(t){t.hasAttribute(Au.COUNTER)||(this.addEvent(t,"contextmenu",this.menu.post.bind(this.menu)),this.addEvent(t,"keydown",this.keydown.bind(this)),t.setAttribute(Au.COUNTER,this.counter.toString()),this.counter++)}addEvent(t,e,s){const i=Au[e.toUpperCase()+"FUNC"];this.attrMap[i+this.counter]=s,t.addEventListener(e,s)}removeEvents(t){if(!t.hasAttribute(Au.COUNTER))return;const e=t.getAttribute(Au.COUNTER);this.removeEvent(t,"contextmenu",e),this.removeEvent(t,"keydown",e),t.removeAttribute(Au.COUNTER)}removeEvent(t,e,s){const i=Au[e.toUpperCase()+"FUNC"],r=this.attrMap[i+s];t.removeEventListener(e,r)}keydown(t){t.keyCode===au.SPACE&&(this.menu.post(t),t.preventDefault(),t.stopImmediatePropagation())}}class Ou{constructor(){this.pool={}}insert(t){this.pool[t.name]=t}lookup(t){return this.pool[t]}remove(t){delete this.pool[t]}update(){for(const t in this.pool)this.pool[t].update()}}class Mu extends Su{static fromJson(t,{pool:e,items:s,id:i=""}){const r=new this(t);r.id=i;const n=t.get("variable");e.forEach((e=>n(t,e,r.pool)));const o=t.get("items")(t,s,r);return r.items=o,r}constructor(t){super(),this.factory=t,this.id="",this.moving=!1,this._store=new ku(this),this.widgets=[],this.variablePool=new Ou}generateHtml(){this.isPosted()&&this.unpost(),super.generateHtml(),this._frame=document.createElement("div"),this._frame.classList.add(Nu.MENUFRAME);const t="left: 0px; top: 0px; z-index: 200; width: 100%; height: 100%; border: 0px; padding: 0px; margin: 0px;";this._frame.setAttribute("style","position: absolute; "+t);const e=document.createElement("div");e.setAttribute("style","position: fixed; "+t),this._frame.appendChild(e),e.addEventListener("mousedown",function(t){this.unpost(),this.unpostWidgets(),this.stop(t)}.bind(this))}display(){document.body.appendChild(this.frame),this.frame.appendChild(this.html),this.focus()}escape(t){this.unpost(),this.unpostWidgets()}unpost(){if(super.unpost(),this.widgets.length>0)return;this.frame.parentNode.removeChild(this.frame);const t=this.store;this.moving||t.insertTaborder(),t.active.focus()}left(t){this.move_(this.store.previous())}right(t){this.move_(this.store.next())}get frame(){return this._frame}get store(){return this._store}post(t,e){if(void 0!==e)return this.moving||this.store.removeTaborder(),void super.post(t,e);const s=t;let i,r,n;if(s instanceof Event?(i=s.target,this.stop(s)):i=s,s instanceof MouseEvent&&(r=s.pageX,n=s.pageY,r||n||!s.clientX||(r=s.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,n=s.clientY+document.body.scrollTop+document.documentElement.scrollTop)),!r&&!n&&i){const t=window.pageXOffset||document.documentElement.scrollLeft,e=window.pageYOffset||document.documentElement.scrollTop,s=i.getBoundingClientRect();r=(s.right+s.left)/2+t,n=(s.bottom+s.top)/2+e}this.store.active=i,this.anchor=this.store.active;const o=this.html;r+o.offsetWidth>document.body.offsetWidth-5&&(r=document.body.offsetWidth-o.offsetWidth-5),this.post(r,n)}registerWidget(t){this.widgets.push(t)}unregisterWidget(t){const e=this.widgets.indexOf(t);e>-1&&this.widgets.splice(e,1),0===this.widgets.length&&this.unpost()}unpostWidgets(){this.widgets.forEach((t=>t.unpost()))}toJson(){return{type:""}}move_(t){this.anchor&&t!==this.anchor&&(this.moving=!0,this.unpost(),this.post(t),this.moving=!1)}}class Du extends Su{static fromJson(t,{items:e},s){const i=new this(s),r=t.get("items")(t,e,i);return i.items=r,i}constructor(t){super(),this._anchor=t,this.variablePool=this.anchor.menu.pool,this.setBaseMenu()}get anchor(){return this._anchor}post(){if(!this.anchor.menu.isPosted())return;let t=this.anchor.html;const e=this.html,s=this.baseMenu.frame,i=t.offsetWidth;let r=i-2,n=0;for(;t&&t!==s;)r+=t.offsetLeft,n+=t.offsetTop,t=t.parentNode;r+e.offsetWidth>document.body.offsetWidth-5&&(r=Math.max(5,r-i-e.offsetWidth+6)),super.post(r,n)}display(){this.baseMenu.frame.appendChild(this.html)}setBaseMenu(){let t=this;do{t=t.anchor.menu}while(t instanceof Du);this.baseMenu=t}left(t){this.focused=null,this.anchor.focus()}toJson(){return{type:""}}}class Pu extends Iu{generateHtml(){super.generateHtml();const t=this.html;this.span||this.generateSpan(),t.appendChild(this.span),this.update()}register(){this.variable.register(this)}unregister(){this.variable.unregister(this)}update(){this.updateAria(),this.span&&this.updateSpan()}}class Bu extends Pu{static fromJson(t,{content:e,variable:s,id:i},r){return new this(r,e,s,i)}constructor(t,e,s,i){super(t,"radio",e,i),this.role="menuitemradio",this.variable=t.pool.lookup(s),this.register()}executeAction(){this.variable.setValue(this.id),_u(this)}generateSpan(){this.span=document.createElement("span"),this.span.textContent="\u2713",this.span.classList.add(Nu.MENURADIOCHECK),this.span.setAttribute("aria-hidden","true")}updateAria(){this.html.setAttribute("aria-checked",this.variable.getValue()===this.id?"true":"false")}updateSpan(){this.span.style.display=this.variable.getValue()===this.id?"":"none"}toJson(){return{type:""}}}class Fu extends vu{static fromJson(t,e,s){return new this(s)}constructor(t){super(t,"rule"),this.className=Nu.MENUITEM,this.role="separator"}generateHtml(){super.generateHtml();const t=this.html;t.classList.add(Nu.MENURULE),t.setAttribute("aria-orientation","vertical")}addEvents(t){}toJson(){return{type:"rule"}}}class Uu extends Iu{static fromJson(t,{content:e,action:s,id:i},r){return new this(r,e,s,i)}constructor(t,e,s,i){super(t,"command",e,i),this.command=s}mousedown(t){this.stop(t)}mouseup(t){this.press(),this.stop(t)}executeAction(){try{this.command(wu(this))}catch(t){Tu(0,"Illegal command callback.")}_u(this)}toJson(){return{type:""}}}class ju{static fromJson(t,{name:e,getter:s,setter:i},r){const n=new this(e,s,i);r.insert(n)}constructor(t,e,s){this._name=t,this.getter=e,this.setter=s,this.items=[]}get name(){return this._name}getValue(t){try{return this.getter(t)}catch(t){return Tu(0,"Command of variable "+this.name+" failed."),null}}setValue(t,e){try{this.setter(t,e)}catch(t){Tu(0,"Command of variable "+this.name+" failed.")}this.update()}register(t){-1===this.items.indexOf(t)&&this.items.push(t)}unregister(t){const e=this.items.indexOf(t);-1!==e&&this.items.splice(e,1)}update(){this.items.forEach((t=>t.update()))}registerCallback(t){this.items.forEach((e=>e.registerCallback(t)))}unregisterCallback(t){this.items.forEach((e=>e.unregisterCallback(t)))}toJson(){return{type:"variable",name:this.name,getter:this.getter.toString(),setter:this.setter.toString()}}}class qu extends Pu{static fromJson(t,{content:e,variable:s,id:i},r){return new this(r,e,s,i)}constructor(t,e,s,i){super(t,"checkbox",e,i),this.role="menuitemcheckbox",this.variable=t.pool.lookup(s),this.register()}executeAction(){this.variable.setValue(!this.variable.getValue()),_u(this)}generateSpan(){this.span=document.createElement("span"),this.span.textContent="\u2713",this.span.classList.add(Nu.MENUCHECK),this.span.setAttribute("aria-hidden","true")}updateAria(){this.html.setAttribute("aria-checked",this.variable.getValue()?"true":"false")}updateSpan(){this.span.style.display=this.variable.getValue()?"":"none"}toJson(){return{type:""}}}class Hu extends Pu{static fromJson(t,{content:e,variable:s,id:i},r){return new this(r,e,s,i)}constructor(t,e,s,i){super(t,"combobox",e,i),this.role="combobox",this.inputEvent=!1,this.variable=t.pool.lookup(s),this.register()}executeAction(){this.variable.setValue(this.input.value,wu(this))}space(t){super.space(t),_u(this)}focus(){super.focus(),this.input.focus()}unfocus(){super.unfocus(),this.updateSpan()}generateHtml(){super.generateHtml();this.html.classList.add(Nu.MENUCOMBOBOX)}generateSpan(){this.span=document.createElement("span"),this.span.classList.add(Nu.MENUINPUTBOX),this.input=document.createElement("input"),this.input.addEventListener("keydown",this.inputKey.bind(this)),this.input.setAttribute("size","10em"),this.input.setAttribute("type","text"),this.input.setAttribute("tabindex","-1"),this.span.appendChild(this.input)}inputKey(t){this.bubbleKey(),this.inputEvent=!0}keydown(t){if(this.inputEvent&&t.keyCode!==au.ESCAPE&&t.keyCode!==au.RETURN)return this.inputEvent=!1,void t.stopPropagation();super.keydown(t),t.stopPropagation()}updateAria(){}updateSpan(){let t;try{t=this.variable.getValue(wu(this))}catch(e){t=""}this.input.value=t}toJson(){return{type:""}}}class Wu extends Iu{static fromJson(t,{content:e,id:s},i){return new this(i,e,s)}constructor(t,e,s){super(t,"label",e,s)}generateHtml(){super.generateHtml();this.html.classList.add(Nu.MENULABEL)}toJson(){return{type:""}}}class Vu extends Pu{static fromJson(t,{content:e,variable:s,id:i},r){return new this(r,e,s,i)}constructor(t,e,s,i){super(t,"slider",e,i),this.role="slider",this.labelId="ctx_slideLabel"+Cu(),this.valueId="ctx_slideValue"+Cu(),this.inputEvent=!1,this.variable=t.pool.lookup(s),this.register()}executeAction(){this.variable.setValue(this.input.value,wu(this)),this.update()}space(t){super.space(t),_u(this)}focus(){super.focus(),this.input.focus()}unfocus(){super.unfocus(),this.updateSpan()}generateHtml(){super.generateHtml();this.html.classList.add(Nu.MENUSLIDER),this.valueSpan=document.createElement("span"),this.valueSpan.setAttribute("id",this.valueId),this.valueSpan.classList.add(Nu.SLIDERVALUE),this.html.appendChild(this.valueSpan)}generateSpan(){this.span=document.createElement("span"),this.labelSpan=document.createElement("span"),this.labelSpan.setAttribute("id",this.labelId),this.labelSpan.appendChild(this.html.childNodes[0]),this.html.appendChild(this.labelSpan),this.input=document.createElement("input"),this.input.setAttribute("type","range"),this.input.setAttribute("min","0"),this.input.setAttribute("max","100"),this.input.setAttribute("aria-valuemin","0"),this.input.setAttribute("aria-valuemax","100"),this.input.setAttribute("aria-labelledby",this.labelId),this.input.addEventListener("keydown",this.inputKey.bind(this)),this.input.addEventListener("input",this.executeAction.bind(this)),this.input.classList.add(Nu.SLIDERBAR),this.span.appendChild(this.input)}inputKey(t){this.inputEvent=!0}mousedown(t){t.stopPropagation()}mouseup(t){_u(this),t.stopPropagation()}keydown(t){const e=t.keyCode;return e===au.UP||e===au.DOWN?(t.preventDefault(),void super.keydown(t)):this.inputEvent&&e!==au.ESCAPE&&e!==au.RETURN?(this.inputEvent=!1,void t.stopPropagation()):(super.keydown(t),void t.stopPropagation())}updateAria(){const t=this.variable.getValue();t&&this.input&&(this.input.setAttribute("aria-valuenow",t),this.input.setAttribute("aria-valuetext",t+"%"))}updateSpan(){let t;try{t=this.variable.getValue(wu(this)),this.valueSpan.innerHTML=t+"%"}catch(e){t=""}this.input.value=t}toJson(){return{type:""}}}class Gu extends bu{constructor(t){super(),this.element=t,this.className=Nu.MENUCLOSE,this.role="button"}generateHtml(){const t=document.createElement("span");t.classList.add(this.className),t.setAttribute("role",this.role),t.setAttribute("tabindex","0");const e=document.createElement("span");e.textContent="\xd7",t.appendChild(e),this.html=t}display(){}unpost(){super.unpost(),this.element.unpost()}keydown(t){this.bubbleKey(),super.keydown(t)}space(t){this.unpost(),this.stop(t)}mousedown(t){this.unpost(),this.stop(t)}}class Xu extends bu{constructor(t,e,s){super(),this.title=t,this.signature=s,this.className=Nu.INFO,this.role="dialog",this.contentDiv=this.generateContent(),this.close=this.generateClose(),this.content=e||function(){return""}}attachMenu(t){this.menu=t}generateHtml(){super.generateHtml();const t=this.html;t.appendChild(this.generateTitle()),t.appendChild(this.contentDiv),t.appendChild(this.generateSignature()),t.appendChild(this.close.html),t.setAttribute("tabindex","0")}post(){super.post();const t=document.documentElement,e=this.html,s=window.innerHeight||t.clientHeight||t.scrollHeight||0,i=Math.floor(-e.offsetWidth/2),r=Math.floor((s-e.offsetHeight)/3);e.setAttribute("style","margin-left: "+i+"px; top: "+r+"px;"),window.event instanceof MouseEvent&&e.classList.add(Nu.MOUSEPOST),e.focus()}display(){this.menu.registerWidget(this),this.contentDiv.innerHTML=this.content();const t=this.menu.html;t.parentNode&&t.parentNode.removeChild(t),this.menu.frame.appendChild(this.html)}click(t){}keydown(t){this.bubbleKey(),super.keydown(t)}escape(t){this.unpost()}unpost(){super.unpost(),this.html.classList.remove(Nu.MOUSEPOST),this.menu.unregisterWidget(this)}generateClose(){const t=new Gu(this),e=t.html;return e.classList.add(Nu.INFOCLOSE),e.setAttribute("aria-label","Close Dialog Box"),t}generateTitle(){const t=document.createElement("span");return t.innerHTML=this.title,t.classList.add(Nu.INFOTITLE),t}generateContent(){const t=document.createElement("div");return t.classList.add(Nu.INFOCONTENT),t.setAttribute("tabindex","0"),t}generateSignature(){const t=document.createElement("span");return t.innerHTML=this.signature,t.classList.add(Nu.INFOSIGNATURE),t}toJson(){return{type:""}}}class zu extends Su{static fromJson(t,{title:e,values:s,variable:i},r){const n=new this(r),o=t.get("label")(t,{content:e||"",id:e||"id"},n),a=t.get("rule")(t,{},n),l=s.map((e=>t.get("radio")(t,{content:e,variable:i,id:e},n))),c=[o,a].concat(l);return n.items=c,n}constructor(t){super(),this.anchor=t,this.className=Nu.SELECTIONMENU,this.variablePool=this.anchor.menu.pool,this.baseMenu=this.anchor.menu}generateHtml(){super.generateHtml(),this.items.forEach((t=>t.html.classList.add(Nu.SELECTIONITEM)))}display(){}right(t){this.anchor.right(t)}left(t){this.anchor.left(t)}}class Ku extends Xu{static fromJson(t,{title:e,signature:s,selections:i,order:r,grid:n},o){const a=new this(e,s,r,n);a.attachMenu(o);const l=i.map((e=>t.get("selectionMenu")(t,e,a)));return a.selections=l,a}constructor(t,e,s="none",i="vertical"){super(t,null,e),this.style=s,this.grid=i,this._selections=[],this.prefix="ctxt-selection",this._balanced=!0}attachMenu(t){this.menu=t}get selections(){return this._selections}set selections(t){this._selections=[],t.forEach((t=>this.addSelection(t)))}addSelection(t){t.anchor=this,this._selections.push(t)}rowDiv(t){const e=document.createElement("div");this.contentDiv.appendChild(e);const s=t.map((t=>(e.appendChild(t.html),t.html.id||(t.html.id=this.prefix+Cu()),t.html.getBoundingClientRect()))),i=s.map((t=>t.width)),r=i.reduce(((t,e)=>t+e),0),n=s.reduce(((t,e)=>Math.max(t,e.height)),0);return e.classList.add(Nu.SELECTIONDIVIDER),e.setAttribute("style","height: "+n+"px;"),[e,r,n,i]}display(){if(super.display(),this.order(),!this.selections.length)return;const t=[];let e=0,s=[];const i=this.getChunkSize(this.selections.length);for(let r=0;r<this.selections.length;r+=i){const n=this.selections.slice(r,r+i),[o,a,l,c]=this.rowDiv(n);t.push(o),e=Math.max(e,a),n.forEach((t=>t.html.style.height=l+"px")),s=this.combineColumn(s,c)}this._balanced&&(this.balanceColumn(t,s),e=s.reduce(((t,e)=>t+e),20)),t.forEach((t=>t.style.width=e+"px"))}getChunkSize(t){switch(this.grid){case"square":return Math.floor(Math.sqrt(t));case"horizontal":return Math.floor(t/Ku.chunkSize);default:return Ku.chunkSize}}balanceColumn(t,e){t.forEach((t=>{const s=Array.from(t.children);for(let t,i=0;t=s[i];i++)t.style.width=e[i]+"px"}))}combineColumn(t,e){let s=[],i=0;for(;t[i]||e[i];){if(!t[i]){s=s.concat(e.slice(i));break}if(!e[i]){s=s.concat(t.slice(i));break}s.push(Math.max(t[i],e[i])),i++}return s}left(t){this.move(t,(t=>(0===t?this.selections.length:t)-1))}right(t){this.move(t,(t=>t===this.selections.length-1?0:t+1))}generateHtml(){super.generateHtml(),this.html.classList.add(Nu.SELECTION)}generateContent(){const t=super.generateContent();return t.classList.add(Nu.SELECTIONBOX),t.removeAttribute("tabindex"),t}findSelection(t){const e=t.target;let s=null;if(e.id&&(s=this.selections.find((t=>t.html.id===e.id))),!s){const t=e.parentElement.id;s=this.selections.find((e=>e.html.id===t))}return s}move(t,e){const s=this.findSelection(t);s.focused&&s.focused.unfocus();const i=e(this.selections.indexOf(s));this.selections[i].focus()}order(){this.selections.sort(Ku.orderMethod.get(this.style))}toJson(){return{type:""}}}Ku.chunkSize=4,Ku.orderMethod=new Map([["alphabetical",(t,e)=>t.items[0].content.localeCompare(e.items[0].content)],["none",(t,e)=>1],["decreasing",(t,e)=>{const s=t.items.length,i=e.items.length;return s<i?1:i<s?-1:0}],["increasing",(t,e)=>{const s=t.items.length,i=e.items.length;return s<i?-1:i<s?1:0}]]);class Ju{constructor(t){this._parser=new Map(t)}get(t){return this._parser.get(t)}add(t,e){this._parser.set(t,e)}}var $u=function(t,e){var s={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(s[i[r]]=t[i[r]])}return s};class Yu{constructor(t=[]){this._initList=[["command",Uu.fromJson.bind(Uu)],["checkbox",qu.fromJson.bind(qu)],["combo",Hu.fromJson.bind(Hu)],["slider",Vu.fromJson.bind(Vu)],["label",Wu.fromJson.bind(Wu)],["radio",Bu.fromJson.bind(Bu)],["rule",Fu.fromJson.bind(Fu)],["submenu",Ru.fromJson.bind(Ru)],["contextMenu",Mu.fromJson.bind(Mu)],["subMenu",Du.fromJson.bind(Du)],["variable",ju.fromJson.bind(ju)],["items",this.items.bind(this)],["selectionMenu",zu.fromJson.bind(zu)],["selectionBox",Ku.fromJson.bind(Ku)]],this._factory=new Ju(this._initList),t.forEach((([t,e])=>this.factory.add(t,e)))}get factory(){return this._factory}items(t,e,s){const i=[];for(const t of e){const e=this.parse(t,s);e&&(s.items.push(e),t.disabled&&e.disable(),t.hidden&&i.push(e))}return i.forEach((t=>t.hide())),s.items}parse(t,...e){var{type:s}=t,i=$u(t,["type"]);const r=this.factory.get(s);return r?r(this.factory,i,...e):null}}function Qu(t){return"."+(Nu[t]||t)}function Zu(t,e=";"){return"{\n "+t.join(e+"\n ")+";\n}"}const tp={};tp[Qu("MENU")]=Zu(["position: absolute","background-color: white","color: black","width: auto","padding: 5px 0px","border: 1px solid #CCCCCC","margin: 0","cursor: default","font: menu","text-align: left","text-indent: 0","text-transform: none","line-height: normal","letter-spacing: normal","word-spacing: normal","word-wrap: normal","white-space: nowrap","float: none","z-index: 1001","border-radius: 5px","box-shadow: 0px 10px 20px #808080"]),tp[Qu("MENUITEM")]=Zu(["padding: 1px 2em","background: transparent"]),tp[Qu("MENUARROW")]=Zu(["position: absolute","right: 0.5em","padding-top: 0.25em","color: #666666","font-family: null","font-size: 0.75em"]),tp[Qu("MENUACTIVE")+" "+Qu("MENUARROW")]=Zu(["color: white"]),tp[Qu("MENUARROW")+Qu("RTL")]=Zu(["left: 0.5em","right: auto"]),tp[Qu("MENUCHECK")]=Zu(["position: absolute","left: 0.7em","font-family: null"]),tp[Qu("MENUCHECK")+Qu("RTL")]=Zu(["right: 0.7em","left: auto"]),tp[Qu("MENURADIOCHECK")]=Zu(["position: absolute","left: 0.7em"]),tp[Qu("MENURADIOCHECK")+Qu("RTL")]=Zu(["right: 0.7em","left: auto"]),tp[Qu("MENUINPUTBOX")]=Zu(["padding-left: 1em","right: 0.5em","color: #666666","font-family: null"]),tp[Qu("MENUINPUTBOX")+Qu("RTL")]=Zu(["left: 0.1em"]),tp[Qu("MENUCOMBOBOX")]=Zu(["left: 0.1em","padding-bottom: 0.5em"]),tp[Qu("MENUSLIDER")]=Zu(["left: 0.1em"]),tp[Qu("SLIDERVALUE")]=Zu(["position: absolute","right: 0.1em","padding-top: 0.25em","color: #333333","font-size: 0.75em"]),tp[Qu("MENUACTIVE")+" "+Qu("SLIDERVALUE")]=Zu(["color: #DDDDDD"]),tp[Qu("SLIDERBAR")]=Zu(["outline: none","background: #D3D3D3"]),tp[Qu("MENULABEL")]=Zu(["padding: 1px 2em 3px 1.33em","font-style: italic"]),tp[Qu("MENURULE")]=Zu(["border-top: 1px solid #DDDDDD","margin: 4px 3px"]),tp[Qu("MENUDISABLED")]=Zu(["color: #999"]),tp[Qu("MENUACTIVE")]=Zu(["background-color: #606872","color: white"]),tp[Qu("MENUDISABLED")+":focus"]=Zu(["background-color: #E8E8E8"]),tp[Qu("MENULABEL")+":focus"]=Zu(["background-color: #E8E8E8"]),tp[Qu("CONTEXTMENU")+":focus"]=Zu(["outline: none"]),tp[Qu("CONTEXTMENU")+" "+Qu("MENUITEM")+":focus"]=Zu(["outline: none"]),tp[Qu("SELECTIONMENU")]=Zu(["position: relative","float: left","border-bottom: none","box-shadow: none ! important","border-radius: 0px !important"]),tp[Qu("SELECTIONITEM")]=Zu(["padding-right: 1em"]),tp[Qu("SELECTION")]=Zu(["right: 40%","width: 50%"]),tp[Qu("SELECTIONBOX")]=Zu(["padding: 0em","max-height: 20em","max-width: none","background-color: #FFFFFF"]),tp[Qu("SELECTIONDIVIDER")]=Zu(["clear: both","border-top: 2px solid #000000"]),tp[Qu("MENU")+" "+Qu("MENUCLOSE")]=Zu(["top: -10px","left: -10px"]),tp["@media (prefers-color-scheme: dark) /* menu */"]=Zu([Qu("MENU")+" "+Zu(["color: #E0E0E0","background-color: #242436","box-shadow: 0px 10px 20px #000","border: 1px solid #808080"]),Qu("SLIDERVALUE")+" "+Zu(["color: #D0D0D0"]),Qu("MENUDISABLED")+":focus "+Zu(["background-color: #383838"]),Qu("MENULABEL")+":focus "+Zu(["background-color: #585858"]),Qu("MENURULE")+" "+Zu(["border-top: 1px solid #808080"]),Qu("SELECTIONDIVIDER")+" "+Zu(["border-top: 2px solid #808080"])],"");const ep={};ep[Qu("MENUCLOSE")]=Zu(["position: absolute","cursor: pointer","display: inline-block","border: 2px solid #AAA","border-radius: 18px",'font-family: "Courier New", Courier',"font-size: 24px","color: #F0F0F0"]),ep[Qu("MENUCLOSE")+" span"]=Zu(["display: block","background-color: #AAA","border: 1.5px solid","border-radius: 18px","line-height: 0","padding: 8px 0 6px"]),ep[Qu("MENUCLOSE")+":hover"]=Zu(["color: white !important","border: 2px solid #CCC !important"]),ep[Qu("MENUCLOSE")+":hover span"]=Zu(["background-color: #CCC !important"]),ep[Qu("MENUCLOSE")+":hover:focus"]=Zu(["outline: none"]);function sp(t,e=document,s="MJX-Menu-styles"){if(e.head.querySelector("#"+s))return;const i=e.createElement("style");i.id=s;const r=[];for(const e in t)r.push(`${e} ${t[e]}`);i.textContent=r.join("\n"),e.head.appendChild(i)}class ip extends Mu{constructor(){super(...arguments),this.mathItem=null,this.nofocus=!1,this.errorMsg=""}post(t,e){var s,i;if(this.mathItem){const r=null===(i=null===(s=this.mathItem)||void 0===s?void 0:s.explorers)||void 0===i?void 0:i.speech;(null==r?void 0:r.active)&&(r.restarted=r.semanticFocus()),void 0!==e&&(this.getOriginalMenu(),this.getSemanticsMenu(),this.getSpeechMenu(),this.getBrailleMenu(),this.getSvgMenu(),this.getErrorMessage(),this.dynamicSubmenus()),super.post(t,e)}}unpost(){this.posted&&super.unpost(),this.mathItem&&(this.mathItem.outputData.nofocus=this.nofocus),this.mathItem=null,this.nofocus=!1}findID(...t){let e=this,s=null;for(const i of t){if(!e)return null;for(s of e.items){if(s.id===i){e=s instanceof Ru?s.submenu:null;break}e=s=null}}return s}setJax(t){this.jax=t}getOriginalMenu(){const t=this.mathItem.inputJax.name,e=this.findID("Show","Original");e.content="MathML"===t?"Original MathML":t+" Commands";this.findID("Copy","Original").content=e.content}getSemanticsMenu(){const t=this.findID("Settings","MathmlIncludes","semantics");"MathML"===this.mathItem.inputJax.name?t.disable():t.enable()}getSpeechMenu(){const t=this.mathItem.outputData.speech;this.findID("Show","Speech")[t?"enable":"disable"](),this.findID("Copy","Speech")[t?"enable":"disable"]()}getBrailleMenu(){const t=this.mathItem.outputData.braille;this.findID("Show","Braille")[t?"enable":"disable"](),this.findID("Copy","Braille")[t?"enable":"disable"]()}getSvgMenu(){const t=this.jax.SVG;this.findID("Show","SVG")[t?"enable":"disable"](),this.findID("Copy","SVG")[t?"enable":"disable"]()}getErrorMessage(){const t=this.mathItem.root.childNodes[0].childNodes;let e=!0;if(this.errorMsg="",1===t.length&&t[0].isKind("merror")){const s=t[0].attributes;this.errorMsg=s.get("data-mjx-error")||s.get("data-mjx-message")||"",e=!this.errorMsg}this.findID("Show","Error")[e?"disable":"enable"](),this.findID("Copy","Error")[e?"disable":"enable"]()}dynamicSubmenus(){for(const[t,[e,s]]of ip.DynamicSubmenus){const i=this.find(t);i&&e(this,i,(t=>{var e;i.submenu=t,!(null===(e=null==t?void 0:t.items)||void 0===e?void 0:e.length)||s&&!this.settings[s]?i.disable():i.enable()}))}}}ip.DynamicSubmenus=new Map;class rp extends Ku{constructor(t,e,s,i,r,n){super(t,e,i,r),this.attachMenu(n);const o=n.factory;this.selections=s.map((t=>o.get("selectionMenu")(o,t,this)))}post(){const t=Array.from(Object.values(this.menu.jax)).filter((t=>!!t))[0],e=new po({title:this.title,message:"",adaptor:t.adaptor,styles:{"mjx-dialog > div":{padding:0}}});e.attach(),this.contentDiv=e.content,this.display()}display(){const t=this;if(t.order(),!this.selections.length)return;const e=[];let s=0,i=[];const r=t.getChunkSize(this.selections.length);for(let n=0;n<this.selections.length;n+=r){const o=this.selections.slice(n,n+r),[a,l,c,h]=t.rowDiv(o);e.push(a),s=Math.max(s,l),o.forEach((t=>t.html.style.height=c+"px")),i=t.combineColumn(i,h)}t._balanced&&(t.balanceColumn(e,i),s=i.reduce(((t,e)=>t+e-2),20)),e.forEach((t=>t.style.width=s+"px"))}}var np,op,ap;!function(t){t.DOMAIN="domain",t.STYLE="style",t.LOCALE="locale",t.TOPIC="topic",t.MODALITY="modality"}(np||(np={}));class lp{static createProp(...t){const e=cp.DEFAULT_ORDER,s={};for(let i=0,r=t.length,n=e.length;i<r&&i<n;i++)s[e[i]]=t[i];return new lp(s)}constructor(t,e=Object.keys(t)){this.properties=t,this.order=e}getProperties(){return this.properties}getOrder(){return this.order}getAxes(){return this.order}getProperty(t){return this.properties[t]}updateProperties(t){this.properties=t}allProperties(){const t=[];return this.order.forEach((e=>t.push(this.getProperty(e).slice()))),t}toString(){const t=[];return this.order.forEach((e=>t.push(e+": "+this.getProperty(e).toString()))),t.join("\n")}}class cp extends lp{static createCstr(...t){const e=cp.DEFAULT_ORDER,s={};for(let i=0,r=t.length,n=e.length;i<r&&i<n;i++)s[e[i]]=t[i];return new cp(s)}static defaultCstr(){return cp.createCstr.apply(null,cp.DEFAULT_ORDER.map((function(t){return cp.DEFAULT_VALUES[t]})))}static validOrder(t){const e=cp.DEFAULT_ORDER.slice();return t.every((t=>{const s=e.indexOf(t);return-1!==s&&e.splice(s,1)}))}constructor(t,e){const s={};for(const[e,i]of Object.entries(t))s[e]=[i];super(s,e),this.components=t}getComponents(){return this.components}getValue(t){return this.components[t]}getValues(){return this.order.map((t=>this.getValue(t)))}allProperties(){const t=super.allProperties();for(let e,s,i=0;e=t[i],s=this.order[i];i++){const t=this.getValue(s);-1===e.indexOf(t)&&e.unshift(t)}return t}toString(){return this.getValues().join(".")}equal(t){const e=t.getAxes();if(this.order.length!==e.length)return!1;for(let s,i=0;s=e[i];i++){const e=this.getValue(s);if(!e||t.getValue(s)!==e)return!1}return!0}}cp.DEFAULT_ORDER=[np.LOCALE,np.MODALITY,np.DOMAIN,np.STYLE,np.TOPIC],cp.BASE_LOCALE="base",cp.DEFAULT_VALUE="default",cp.DEFAULT_VALUES={[np.LOCALE]:"en",[np.DOMAIN]:cp.DEFAULT_VALUE,[np.STYLE]:cp.DEFAULT_VALUE,[np.TOPIC]:cp.DEFAULT_VALUE,[np.MODALITY]:"speech"};class hp{constructor(t){this.order=t}parse(t){const e=t.split("."),s={};if(e.length>this.order.length)throw new Error("Invalid dynamic constraint: "+s);let i=0;for(let t,r=0;t=this.order[r],e.length;r++,i++){const i=e.shift();s[t]=i}return new cp(s,this.order.slice(0,i))}}class dp{constructor(t,e=new lp(t.getProperties(),t.getOrder())){this.reference=t,this.fallback=e,this.order=this.reference.getOrder()}getReference(){return this.reference}setReference(t,e){this.reference=t,this.fallback=e||new lp(t.getProperties(),t.getOrder()),this.order=this.reference.getOrder()}match(t){const e=t.getAxes();return e.length===this.reference.getAxes().length&&e.every((e=>{const s=t.getValue(e);return s===this.reference.getValue(e)||-1!==this.fallback.getProperty(e).indexOf(s)}))}compare(t,e){let s=!1;for(let i,r=0;i=this.order[r];r++){const r=t.getValue(i),n=e.getValue(i);if(!s){const t=this.reference.getValue(i);if(t===r&&t!==n)return-1;if(t===n&&t!==r)return 1;if(t===r&&t===n)continue;t!==r&&t!==n&&(s=!0)}const o=this.fallback.getProperty(i),a=o.indexOf(r),l=o.indexOf(n);if(a<l)return-1;if(l<a)return 1}return 0}toString(){return this.reference.toString()+"\n"+this.fallback.toString()}}!function(t){t.SYNC="sync",t.ASYNC="async",t.HTTP="http"}(op||(op={})),function(t){t.PITCH="pitch",t.RATE="rate",t.VOLUME="volume",t.PAUSE="pause",t.JOIN="join",t.LAYOUT="layout"}(ap||(ap={}));ap.PITCH,ap.RATE,ap.VOLUME,ap.PAUSE,ap.JOIN;var up,pp;!function(t){t.NONE="none",t.SHALLOW="shallow",t.DEEP="deep"}(up||(up={})),function(t){t.NONE="none",t.LAYOUT="layout",t.COUNTING="counting",t.PUNCTUATION="punctuation",t.SSML="ssml",t.ACSS="acss",t.SABLE="sable",t.VOICEXML="voicexml"}(pp||(pp={}));var mp=__webpack_require__(556);function gp(t){return t.match("/$")?t:t+"/"}class fp{static getInstance(){return fp.instance=fp.instance||new fp,fp.instance}init(t){return t&&this.startDebugFile_(t),this.isActive_=!0,this.fileHandle}output(...t){this.isActive_&&this.output_(t)}generate(t){this.isActive_&&this.output_(t.apply(t,[]))}exit(t=()=>{}){this.fileHandle.then((()=>{this.isActive_&&this.stream_&&this.stream_.end("","",t)}))}constructor(){this.isActive_=!1,this.fileHandle=Promise.resolve(),this.stream_=null}startDebugFile_(t){this.fileHandle=mp.f.fs.promises.open(t,"w"),this.fileHandle=this.fileHandle.then((e=>{this.stream_=e.createWriteStream(t),this.outputFunction=function(...t){this.stream_.write(t.join(" ")),this.stream_.write("\n")}.bind(this),this.stream_.on("error",function(t){console.info("Invalid log file. Debug information sent to console."),this.outputFunction=console.info}.bind(this)),this.stream_.on("finish",(function(){console.info("Finalizing debug file.")}))}))}output_(t){this.stream_?this.fileHandle.then((()=>this.outputFunction.apply(this.outputFunction,["Speech Rule Engine Debugger:"].concat(t)))):console.info(...["Speech Rule Engine Debugger:"].concat(t))}}var bp=__webpack_require__(904);class Ep{constructor(t={}){this.delay=!1,this.domain="clearspeak",this.style=cp.DEFAULT_VALUES[np.STYLE],this.locale=cp.DEFAULT_VALUES[np.LOCALE],this.subiso="",this.modality=cp.DEFAULT_VALUES[np.MODALITY],this.speech=up.NONE,this.markup=pp.NONE,this.mark=!0,this.automark=!1,this.character=!0,this.cleanpause=!0,this.cayleyshort=!0,this.linebreaks=!1,this.rate="100",this.walker="Table",this.structure=!1,this.aria=!1,this.tree=!1,this.strict=!1,this.pprint=!1,this.rules="",this.prune="",this.set(t)}set(t){this.ensureDomain(t);for(const[e,s]of Object.entries(t))(Ep.BINARY_FEATURES.includes(e)||Ep.STRING_FEATURES.includes(e))&&(this[e]=s)}json(){const t={};return[].concat(Ep.STRING_FEATURES,Ep.BINARY_FEATURES).forEach((e=>t[e]=this[e])),t}ensureDomain(t){if(t.modality&&"speech"!==t.modality||!t.modality&&"speech"!==this.modality)return;if(!t.domain&&!t.locale)return;if("default"===t.domain)return void(t.domain="mathspeak");const e=t.locale||this.locale,s=t.domain||this.domain;-1===xp.indexOf(e)||"mathspeak"===s?"en"!==e?"mathspeak"!==s&&"clearspeak"!==s&&(t.domain="mathspeak"):-1===yp.indexOf(s)&&(t.domain="mathspeak"):t.domain="mathspeak"}}Ep.BINARY_FEATURES=["automark","mark","character","cleanpause","strict","structure","aria","pprint","cayleyshort","linebreaks","tree"],Ep.STRING_FEATURES=["markup","style","domain","speech","walker","locale","delay","modality","rate","rules","subiso","prune"];const xp=["ca","da","es"],yp=["chromevox","clearspeak","mathspeak","emacspeak","html"];class Np extends Error{constructor(t=""){super(),this.message=t,this.name="SRE Error"}}class Ap{set defaultLocale(t){this._defaultLocale=bp.u.ensureLocale(t,this._defaultLocale)}get defaultLocale(){return this._defaultLocale}static getInstance(){return Ap.instance=Ap.instance||new Ap,Ap.instance}static defaultEvaluator(t,e){return t}static evaluateNode(t){return Ap.nodeEvaluator(t)}getRate(){const t=parseInt(this.options.rate,10);return isNaN(t)?100:t}setDynamicCstr(t){if(this.defaultLocale&&(cp.DEFAULT_VALUES[np.LOCALE]=this.defaultLocale),t){const e=Object.keys(t);for(let s=0;s<e.length;s++){const i=e[s];if(-1!==cp.DEFAULT_ORDER.indexOf(i)){const e=t[i];this.options[i]=e}}}const e=[this.options.locale,this.options.modality,this.options.domain,this.options.style].join("."),s=lp.createProp([cp.DEFAULT_VALUES[np.LOCALE]],[cp.DEFAULT_VALUES[np.MODALITY]],[cp.DEFAULT_VALUES[np.DOMAIN]],[cp.DEFAULT_VALUES[np.STYLE]]),i=this.comparators[this.options.domain],r=this.parsers[this.options.domain];this.parser=r||this.defaultParser,this.dynamicCstr=this.parser.parse(e),this.dynamicCstr.updateProperties(s.getProperties()),this.comparator=i?i():new dp(this.dynamicCstr)}constructor(){this.options=new Ep,this.config=!1,this.customLoader=null,this.parsers={},this.comparator=null,this.mode=op.SYNC,this.init=!0,this.comparators={},this._defaultLocale=cp.DEFAULT_VALUES[np.LOCALE],this.options.locale=this.defaultLocale,this.evaluator=Ap.defaultEvaluator,this.defaultParser=new hp(cp.DEFAULT_ORDER),this.parser=this.defaultParser,this.dynamicCstr=cp.defaultCstr()}configurate(t){this.mode!==op.HTTP||mp.f.webworker||this.config||(!function(t){const e=document.documentElement.querySelectorAll('script[type="text/x-sre-config"]');for(let s=0,i=e.length;s<i;s++){let i;try{i=e[s].innerHTML;const r=JSON.parse(i);for(const[e,s]of Object.entries(r))t[e]=s}catch(t){fp.getInstance().output("Illegal configuration ",i)}}}(t),this.config=!0),function(t){if("undefined"!=typeof SREfeature)for(const[e,s]of Object.entries(SREfeature))t[e]=s}(t)}setCustomLoader(t){t&&(this.customLoader=t)}setup(t){void 0!==t.mode&&(this.mode=t.mode),this.configurate(t),this.options.set(t),t.json&&(mp.f.jsonPath=gp(t.json)),this.setCustomLoader(t.custom)}json(){return Object.assign({mode:this.mode},this.options.json())}reset(){this.options=new Ep}}Ap.nodeEvaluator=function(t){return[]};class vp{static get(t=Ap.getInstance().options.locale){return vp.promises[t]||Promise.resolve("")}static getall(){return Promise.all(Object.values(vp.promises))}}vp.loaded={},vp.promises={};const _p=mp.f.xpath,wp={xhtml:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",mml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function Tp(t){return wp[t]||null}class Cp{constructor(){this.lookupNamespaceURI=Tp}}function Lp(t,e,s){return _p.evaluate(t,e,new Cp,s,null)}function Ip(t){const e=[];for(let s=0,i=t.length;s<i;s++)e.push(t[s]);return e}function Rp(t){const e=new mp.f.xmldom.DOMParser,s=function(t){return(t=t.replace(/ /g,"\xa0")).replace(/>[ \f\n\r\t\v\u200b]+</g,"><").trim()}(t),i=!!s.match(/&(?!lt|gt|amp|quot|apos)\w+;/g);if(!s)throw new Np("Empty input!");try{const t=e.parseFromString(s,i?"text/html":"text/xml");return Ap.getInstance().mode===op.HTTP?(_p.currentDocument=t,i?t.body.childNodes[0]:t.documentElement):t.documentElement}catch(t){throw new Np("Illegal input: "+t.message)}}var Sp;function kp(t,e){t.parentNode&&(t.parentNode.insertBefore(e,t),t.parentNode.removeChild(t))}function Op(t){return mp.f.document.createElement(t)}function Mp(t){let e="",s=/(>)(<)(\/*)/g,i=0,r=(t=t.replace(s,"$1\r\n$2$3")).split("\r\n");for(s=/(\.)*(<)(\/*)/g,r=r.map((t=>t.replace(s,"$1\r\n$2$3").split("\r\n"))).reduce(((t,e)=>t.concat(e)),[]);r.length;){let t=r.shift();if(!t)continue;let s=0;if(t.match(/^<\w[^>/]*>[^>]+$/)){const e=Dp(t,r[0]);e[0]?e[1]?(t+=r.shift().slice(0,-e[1].length),e[1].trim()&&r.unshift(e[1])):t+=r.shift():s=1}else if(t.match(/^<\/\w/))0!==i&&(i-=1);else if(t.match(/^<\w[^>]*[^/]>.*$/))s=1;else if(t.match(/^<\w[^>]*\/>.+$/)){const e=t.indexOf(">")+1,s=t.slice(e);s.trim()&&r.unshift(),t=t.slice(0,e)+s}else s=0;e+=new Array(i+1).join(" ")+t+"\r\n",i+=s}return e}function Dp(t,e){if(!e)return[!1,""];const s=t.match(/^<([^> ]+).*>/),i=e.match(/^<\/([^>]+)>(.*)/);return s&&i&&s[1]===i[1]?[!0,i[2]]:[!1,""]}function Pp(t){return t.tagName.toUpperCase()}function Bp(t){return(new mp.f.xmldom.XMLSerializer).serializeToString(t)}!function(t){t[t.ELEMENT_NODE=1]="ELEMENT_NODE",t[t.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",t[t.TEXT_NODE=3]="TEXT_NODE",t[t.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",t[t.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",t[t.ENTITY_NODE=6]="ENTITY_NODE",t[t.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",t[t.COMMENT_NODE=8]="COMMENT_NODE",t[t.DOCUMENT_NODE=9]="DOCUMENT_NODE",t[t.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",t[t.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",t[t.NOTATION_NODE=12]="NOTATION_NODE"}(Sp||(Sp={}));class Fp{constructor(t,e,s){this.domain=t,this.name=e,this.func=s,this.active=!1}annotate(t){t.childNodes.forEach(this.annotate.bind(this)),t.contentNodes.forEach(this.annotate.bind(this)),t.addAnnotation(this.domain,this.func(t))}}class Up{constructor(t,e,s,i={}){this.domain=t,this.name=e,this.func=s,this.def=i,this.active=!1}visit(t,e){let s=this.func(t,e);t.addAnnotation(this.domain,s[0]);for(let e,i=0;e=t.childNodes[i];i++)s=this.visit(e,s[1]);for(let e,i=0;e=t.contentNodes[i];i++)s=this.visit(e,s[1]);return s}}const jp=new Map,qp=new Map;function Hp(t){const e=t.domain+":"+t.name;t instanceof Fp?jp.set(e,t):qp.set(e,t)}function Wp(t,e){const s=t+":"+e,i=jp.get(s)||qp.get(s);i&&(i.active=!0)}var Vp,Gp,Xp;function zp(t){const e=t.toString(16).toUpperCase();return e.length>3?e:("000"+e).slice(-4)}function Kp([t,e],s){const i=parseInt(t,16),r=parseInt(e,16),n=[];for(let t=i;t<=r;t++){let e=zp(t);!1!==s[e]&&(e=s[e]||e,n.push(e))}return n}function Jp(t,e={}){return Kp(t,e).map((t=>String.fromCodePoint(parseInt(t,16))))}!function(t){t.BOLD="bold",t.BOLDFRAKTUR="bold-fraktur",t.BOLDITALIC="bold-italic",t.BOLDSCRIPT="bold-script",t.DOUBLESTRUCK="double-struck",t.DOUBLESTRUCKITALIC="double-struck-italic",t.FULLWIDTH="fullwidth",t.FRAKTUR="fraktur",t.ITALIC="italic",t.MONOSPACE="monospace",t.NORMAL="normal",t.SCRIPT="script",t.SANSSERIF="sans-serif",t.SANSSERIFITALIC="sans-serif-italic",t.SANSSERIFBOLD="sans-serif-bold",t.SANSSERIFBOLDITALIC="sans-serif-bold-italic"}(Vp||(Vp={})),function(t){t.SUPER="super",t.SUB="sub",t.CIRCLED="circled",t.PARENTHESIZED="parenthesized",t.PERIOD="period",t.NEGATIVECIRCLED="negative-circled",t.DOUBLECIRCLED="double-circled",t.CIRCLEDSANSSERIF="circled-sans-serif",t.NEGATIVECIRCLEDSANSSERIF="negative-circled-sans-serif",t.COMMA="comma",t.SQUARED="squared",t.NEGATIVESQUARED="negative-squared"}(Gp||(Gp={})),function(t){t.LATINCAP="latinCap",t.LATINSMALL="latinSmall",t.GREEKCAP="greekCap",t.GREEKSMALL="greekSmall",t.DIGIT="digit"}(Xp||(Xp={}));const $p=[{interval:["1D400","1D419"],base:Xp.LATINCAP,subst:{},capital:!0,category:"Lu",font:Vp.BOLD},{interval:["1D41A","1D433"],base:Xp.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Vp.BOLD},{interval:["1D56C","1D585"],base:Xp.LATINCAP,subst:{},capital:!0,category:"Lu",font:Vp.BOLDFRAKTUR},{interval:["1D586","1D59F"],base:Xp.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Vp.BOLDFRAKTUR},{interval:["1D468","1D481"],base:Xp.LATINCAP,subst:{},capital:!0,category:"Lu",font:Vp.BOLDITALIC},{interval:["1D482","1D49B"],base:Xp.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Vp.BOLDITALIC},{interval:["1D4D0","1D4E9"],base:Xp.LATINCAP,subst:{},capital:!0,category:"Lu",font:Vp.BOLDSCRIPT},{interval:["1D4EA","1D503"],base:Xp.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Vp.BOLDSCRIPT},{interval:["1D538","1D551"],base:Xp.LATINCAP,subst:{"1D53A":"2102","1D53F":"210D","1D545":"2115","1D547":"2119","1D548":"211A","1D549":"211D","1D551":"2124"},capital:!0,category:"Lu",font:Vp.DOUBLESTRUCK},{interval:["1D552","1D56B"],base:Xp.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Vp.DOUBLESTRUCK},{interval:["1D504","1D51D"],base:Xp.LATINCAP,subst:{"1D506":"212D","1D50B":"210C","1D50C":"2111","1D515":"211C","1D51D":"2128"},capital:!0,category:"Lu",font:Vp.FRAKTUR},{interval:["1D51E","1D537"],base:Xp.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Vp.FRAKTUR},{interval:["FF21","FF3A"],base:Xp.LATINCAP,subst:{},capital:!0,category:"Lu",font:Vp.FULLWIDTH},{interval:["FF41","FF5A"],base:Xp.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Vp.FULLWIDTH},{interval:["1D434","1D44D"],base:Xp.LATINCAP,subst:{},capital:!0,category:"Lu",font:Vp.ITALIC},{interval:["1D44E","1D467"],base:Xp.LATINSMALL,subst:{"1D455":"210E"},capital:!1,category:"Ll",font:Vp.ITALIC},{interval:["1D670","1D689"],base:Xp.LATINCAP,subst:{},capital:!0,category:"Lu",font:Vp.MONOSPACE},{interval:["1D68A","1D6A3"],base:Xp.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Vp.MONOSPACE},{interval:["0041","005A"],base:Xp.LATINCAP,subst:{},capital:!0,category:"Lu",font:Vp.NORMAL},{interval:["0061","007A"],base:Xp.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Vp.NORMAL},{interval:["1D49C","1D4B5"],base:Xp.LATINCAP,subst:{"1D49D":"212C","1D4A0":"2130","1D4A1":"2131","1D4A3":"210B","1D4A4":"2110","1D4A7":"2112","1D4A8":"2133","1D4AD":"211B"},capital:!0,category:"Lu",font:Vp.SCRIPT},{interval:["1D4B6","1D4CF"],base:Xp.LATINSMALL,subst:{"1D4BA":"212F","1D4BC":"210A","1D4C4":"2134"},capital:!1,category:"Ll",font:Vp.SCRIPT},{interval:["1D5A0","1D5B9"],base:Xp.LATINCAP,subst:{},capital:!0,category:"Lu",font:Vp.SANSSERIF},{interval:["1D5BA","1D5D3"],base:Xp.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Vp.SANSSERIF},{interval:["1D608","1D621"],base:Xp.LATINCAP,subst:{},capital:!0,category:"Lu",font:Vp.SANSSERIFITALIC},{interval:["1D622","1D63B"],base:Xp.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Vp.SANSSERIFITALIC},{interval:["1D5D4","1D5ED"],base:Xp.LATINCAP,subst:{},capital:!0,category:"Lu",font:Vp.SANSSERIFBOLD},{interval:["1D5EE","1D607"],base:Xp.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Vp.SANSSERIFBOLD},{interval:["1D63C","1D655"],base:Xp.LATINCAP,subst:{},capital:!0,category:"Lu",font:Vp.SANSSERIFBOLDITALIC},{interval:["1D656","1D66F"],base:Xp.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Vp.SANSSERIFBOLDITALIC},{interval:["0391","03A9"],base:Xp.GREEKCAP,subst:{"03A2":"03F4"},capital:!0,category:"Lu",font:Vp.NORMAL},{interval:["03B0","03D0"],base:Xp.GREEKSMALL,subst:{"03B0":"2207","03CA":"2202","03CB":"03F5","03CC":"03D1","03CD":"03F0","03CE":"03D5","03CF":"03F1","03D0":"03D6"},capital:!1,category:"Ll",font:Vp.NORMAL},{interval:["1D6A8","1D6C0"],base:Xp.GREEKCAP,subst:{},capital:!0,category:"Lu",font:Vp.BOLD},{interval:["1D6C1","1D6E1"],base:Xp.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:Vp.BOLD},{interval:["1D6E2","1D6FA"],base:Xp.GREEKCAP,subst:{},capital:!0,category:"Lu",font:Vp.ITALIC},{interval:["1D6FB","1D71B"],base:Xp.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:Vp.ITALIC},{interval:["1D71C","1D734"],base:Xp.GREEKCAP,subst:{},capital:!0,category:"Lu",font:Vp.BOLDITALIC},{interval:["1D735","1D755"],base:Xp.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:Vp.BOLDITALIC},{interval:["1D756","1D76E"],base:Xp.GREEKCAP,subst:{},capital:!0,category:"Lu",font:Vp.SANSSERIFBOLD},{interval:["1D76F","1D78F"],base:Xp.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:Vp.SANSSERIFBOLD},{interval:["1D790","1D7A8"],base:Xp.GREEKCAP,subst:{},capital:!0,category:"Lu",font:Vp.SANSSERIFBOLDITALIC},{interval:["1D7A9","1D7C9"],base:Xp.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:Vp.SANSSERIFBOLDITALIC},{interval:["0030","0039"],base:Xp.DIGIT,subst:{},offset:0,category:"Nd",font:Vp.NORMAL},{interval:["2070","2079"],base:Xp.DIGIT,subst:{2071:"00B9",2072:"00B2",2073:"00B3"},offset:0,category:"No",font:Gp.SUPER},{interval:["2080","2089"],base:Xp.DIGIT,subst:{},offset:0,category:"No",font:Gp.SUB},{interval:["245F","2473"],base:Xp.DIGIT,subst:{"245F":"24EA"},offset:0,category:"No",font:Gp.CIRCLED},{interval:["3251","325F"],base:Xp.DIGIT,subst:{},offset:21,category:"No",font:Gp.CIRCLED},{interval:["32B1","32BF"],base:Xp.DIGIT,subst:{},offset:36,category:"No",font:Gp.CIRCLED},{interval:["2474","2487"],base:Xp.DIGIT,subst:{},offset:1,category:"No",font:Gp.PARENTHESIZED},{interval:["2487","249B"],base:Xp.DIGIT,subst:{2487:"1F100"},offset:0,category:"No",font:Gp.PERIOD},{interval:["2775","277F"],base:Xp.DIGIT,subst:{2775:"24FF"},offset:0,category:"No",font:Gp.NEGATIVECIRCLED},{interval:["24EB","24F4"],base:Xp.DIGIT,subst:{},offset:11,category:"No",font:Gp.NEGATIVECIRCLED},{interval:["24F5","24FE"],base:Xp.DIGIT,subst:{},offset:1,category:"No",font:Gp.DOUBLECIRCLED},{interval:["277F","2789"],base:Xp.DIGIT,subst:{"277F":"1F10B"},offset:0,category:"No",font:Gp.CIRCLEDSANSSERIF},{interval:["2789","2793"],base:Xp.DIGIT,subst:{2789:"1F10C"},offset:0,category:"No",font:Gp.NEGATIVECIRCLEDSANSSERIF},{interval:["FF10","FF19"],base:Xp.DIGIT,subst:{},offset:0,category:"Nd",font:Vp.FULLWIDTH},{interval:["1D7CE","1D7D7"],base:Xp.DIGIT,subst:{},offset:0,category:"Nd",font:Vp.BOLD},{interval:["1D7D8","1D7E1"],base:Xp.DIGIT,subst:{},offset:0,category:"Nd",font:Vp.DOUBLESTRUCK},{interval:["1D7E2","1D7EB"],base:Xp.DIGIT,subst:{},offset:0,category:"Nd",font:Vp.SANSSERIF},{interval:["1D7EC","1D7F5"],base:Xp.DIGIT,subst:{},offset:0,category:"Nd",font:Vp.SANSSERIFBOLD},{interval:["1D7F6","1D7FF"],base:Xp.DIGIT,subst:{},offset:0,category:"Nd",font:Vp.MONOSPACE},{interval:["1F101","1F10A"],base:Xp.DIGIT,subst:{},offset:0,category:"No",font:Gp.COMMA},{interval:["24B6","24CF"],base:Xp.LATINCAP,subst:{},capital:!0,category:"So",font:Gp.CIRCLED},{interval:["24D0","24E9"],base:Xp.LATINSMALL,subst:{},capital:!1,category:"So",font:Gp.CIRCLED},{interval:["1F110","1F129"],base:Xp.LATINCAP,subst:{},capital:!0,category:"So",font:Gp.PARENTHESIZED},{interval:["249C","24B5"],base:Xp.LATINSMALL,subst:{},capital:!1,category:"So",font:Gp.PARENTHESIZED},{interval:["1F130","1F149"],base:Xp.LATINCAP,subst:{},capital:!0,category:"So",font:Gp.SQUARED},{interval:["1F170","1F189"],base:Xp.LATINCAP,subst:{},capital:!0,category:"So",font:Gp.NEGATIVESQUARED},{interval:["1F150","1F169"],base:Xp.LATINCAP,subst:{},capital:!0,category:"So",font:Gp.NEGATIVECIRCLED}],Yp=new Map;function Qp(t,e){return t+e.split("-").map((t=>t[0].toUpperCase()+t.slice(1))).join("")}for(const t of $p){const e=Qp(t.base,t.font),s=Jp(t.interval,t.subst);let i=Yp.get(e);i?i.unicode=i.unicode.concat(s):(i=t,i.unicode=s,Yp.set(e,i))}var Zp;!function(t){t.PUNCTUATION="punctuation",t.FENCE="fence",t.NUMBER="number",t.IDENTIFIER="identifier",t.TEXT="text",t.OPERATOR="operator",t.RELATION="relation",t.LARGEOP="largeop",t.FUNCTION="function",t.ACCENT="accent",t.FENCED="fenced",t.FRACTION="fraction",t.PUNCTUATED="punctuated",t.RELSEQ="relseq",t.MULTIREL="multirel",t.INFIXOP="infixop",t.PREFIXOP="prefixop",t.POSTFIXOP="postfixop",t.APPL="appl",t.INTEGRAL="integral",t.BIGOP="bigop",t.SQRT="sqrt",t.ROOT="root",t.LIMUPPER="limupper",t.LIMLOWER="limlower",t.LIMBOTH="limboth",t.SUBSCRIPT="subscript",t.SUPERSCRIPT="superscript",t.UNDERSCORE="underscore",t.OVERSCORE="overscore",t.TENSOR="tensor",t.TABLE="table",t.MULTILINE="multiline",t.MATRIX="matrix",t.VECTOR="vector",t.CASES="cases",t.ROW="row",t.LINE="line",t.CELL="cell",t.ENCLOSE="enclose",t.INFERENCE="inference",t.RULELABEL="rulelabel",t.CONCLUSION="conclusion",t.PREMISES="premises",t.UNKNOWN="unknown",t.EMPTY="empty"}(Zp||(Zp={}));const tm=Object.assign({},Zp);var em;!function(t){t.COMMA="comma",t.SEMICOLON="semicolon",t.ELLIPSIS="ellipsis",t.FULLSTOP="fullstop",t.QUESTION="question",t.EXCLAMATION="exclamation",t.QUOTES="quotes",t.DASH="dash",t.TILDE="tilde",t.PRIME="prime",t.DEGREE="degree",t.VBAR="vbar",t.COLON="colon",t.OPENFENCE="openfence",t.CLOSEFENCE="closefence",t.APPLICATION="application",t.DUMMY="dummy",t.UNIT="unit",t.LABEL="label",t.OPEN="open",t.CLOSE="close",t.TOP="top",t.BOTTOM="bottom",t.NEUTRAL="neutral",t.METRIC="metric",t.LATINLETTER="latinletter",t.GREEKLETTER="greekletter",t.OTHERLETTER="otherletter",t.NUMBERSET="numbersetletter",t.INTEGER="integer",t.FLOAT="float",t.OTHERNUMBER="othernumber",t.INFTY="infty",t.MIXED="mixed",t.MULTIACCENT="multiaccent",t.OVERACCENT="overaccent",t.UNDERACCENT="underaccent",t.UNDEROVER="underover",t.SUBSUP="subsup",t.LEFTSUB="leftsub",t.LEFTSUPER="leftsuper",t.RIGHTSUB="rightsub",t.RIGHTSUPER="rightsuper",t.LEFTRIGHT="leftright",t.ABOVEBELOW="abovebelow",t.INTERVAL="interval",t.SETEMPTY="set empty",t.SETEXT="set extended",t.SETSINGLE="set singleton",t.SETCOLLECT="set collection",t.STRING="string",t.SPACE="space",t.ANNOTATION="annotation",t.TEXT="text",t.SEQUENCE="sequence",t.ENDPUNCT="endpunct",t.STARTPUNCT="startpunct",t.NEGATIVE="negative",t.POSITIVE="positive",t.NEGATION="negation",t.MULTIOP="multiop",t.PREFIXOP="prefix operator",t.POSTFIXOP="postfix operator",t.LIMFUNC="limit function",t.INFIXFUNC="infix function",t.PREFIXFUNC="prefix function",t.POSTFIXFUNC="postfix function",t.SIMPLEFUNC="simple function",t.COMPFUNC="composed function",t.SUM="sum",t.INTEGRAL="integral",t.GEOMETRY="geometry",t.BOX="box",t.BLOCK="block",t.ADDITION="addition",t.MULTIPLICATION="multiplication",t.SUBTRACTION="subtraction",t.IMPLICIT="implicit",t.DIVISION="division",t.VULGAR="vulgar",t.EQUALITY="equality",t.INEQUALITY="inequality",t.ARROW="arrow",t.ELEMENT="element",t.NONELEMENT="nonelement",t.REELEMENT="reelement",t.RENONELEMENT="renonelement",t.SET="set",t.DETERMINANT="determinant",t.ROWVECTOR="rowvector",t.BINOMIAL="binomial",t.SQUAREMATRIX="squarematrix",t.CYCLE="cycle",t.MULTILINE="multiline",t.MATRIX="matrix",t.VECTOR="vector",t.CASES="cases",t.TABLE="table",t.CAYLEY="cayley",t.PROOF="proof",t.LEFT="left",t.RIGHT="right",t.UP="up",t.DOWN="down",t.FINAL="final",t.SINGLE="single",t.HYP="hyp",t.AXIOM="axiom",t.LOGIC="logic",t.UNKNOWN="unknown",t.MGLYPH="mglyph"}(em||(em={}));const sm=Object.assign({},em);var im;!function(t){t.CALIGRAPHIC="caligraphic",t.CALIGRAPHICBOLD="caligraphic-bold",t.OLDSTYLE="oldstyle",t.OLDSTYLEBOLD="oldstyle-bold",t.UNKNOWN="unknown"}(im||(im={}));const rm=Object.assign(Object.assign(Object.assign({},Vp),im),Gp);var nm;!function(t){t.ALLLETTERS="allLetters",t.D="d",t.BAR="bar",t.TILDE="tilde"}(nm||(nm={}));const om=Object.assign(Object.assign({},Xp),nm);var am=function(t,e){var s={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(s[i[r]]=t[i[r]])}return s};const lm={functionApplication:String.fromCodePoint(8289),invisibleTimes:String.fromCodePoint(8290),invisibleComma:String.fromCodePoint(8291),invisiblePlus:String.fromCodePoint(8292)};class cm extends Map{get(t){return super.get(t)||{role:sm.UNKNOWN,type:tm.UNKNOWN,font:rm.UNKNOWN}}}class hm extends Map{set(t,e,s=""){return super.set(this.secKey(e,t),s||e),this}has(t,e){return super.has(this.secKey(e,t))}get(t,e){return super.get(this.secKey(e,t))}secKey(t,e){return e?`${t} ${e}`:`${t}`}}const dm={Meaning:new cm,Secondary:new hm,FencesHoriz:new Map,FencesVert:new Map,LatexCommands:new Map};function um(t,e){for(const s of t)dm.Meaning.set(s,{role:e.role||sm.UNKNOWN,type:e.type||tm.UNKNOWN,font:e.font||rm.UNKNOWN}),e.secondary&&dm.Secondary.set(s,e.secondary)}function pm(t,e,s=1){const i={},r=function(t){let e=[];for(const s of t)Array.isArray(s)?e=e.concat(Kp(s,{}).map((t=>parseInt(t,16)))):e.push(parseInt(s,16));return e}(e);for(const e of r)i[e]||(t.set(String.fromCodePoint(e),String.fromCodePoint(e+s)),i[e]=!0,i[e+s]=!0)}const mm=["cos","cot","csc","sec","sin","tan","arccos","arccot","arccsc","arcsec","arcsin","arctan"].concat(["cosh","coth","csch","sech","sinh","tanh","arcosh","arcoth","arcsch","arsech","arsinh","artanh"],["deg","det","dim","hom","ker","Tr"],["log","ln","lg","exp","gcd","lcm","arg","im","re","Pr"]);function gm(t,e,s,i,r,n=[],o={},a={}){const l=Yp.get(Qp(t,i));l&&(l.unicode.forEach((t=>{dm.Meaning.set(t,{type:e,role:s,font:r}),n.forEach((e=>dm.Secondary.set(t,e)))})),function(t,e){for(const[s,i]of Object.entries(e)){const e=t[s];void 0!==e&&dm.Meaning.set(e,i)}}(l.unicode,o),function(t,e){for(const[s,i]of Object.entries(e)){const e=t[s];void 0!==e&&dm.Secondary.set(e,i)}}(l.unicode,a))}[{set:["23","26","40","5c","a1","a7","b6","bf","2017",["2022","2025"],"2027","203b","203c",["2041","2043"],["2047","2049"],["204b","204d"],"2050","2055","2056",["2058","205e"],"2234","2235","fe45","fe46","fe5f","fe60","fe68","fe6b","ff03","ff06","ff0f","ff20","ff3c"],type:tm.PUNCTUATION,role:sm.UNKNOWN},{set:["22","ab","bb","2dd",["2018","201f"],"2039","203a",["301d","301f"],"fe10","ff02","ff07"],type:tm.PUNCTUATION,role:sm.QUOTES},{set:["3b","204f","2a1f","2a3e","fe14","fe54","ff1b"],type:tm.PUNCTUATION,role:sm.SEMICOLON},{set:["3f","203d","fe16","fe56","ff1f"],type:tm.PUNCTUATION,role:sm.QUESTION},{set:["21","fe15","fe57","ff01"],type:tm.PUNCTUATION,role:sm.EXCLAMATION},{set:["5e","60","a8","aa","b4","ba","2c7",["2d8","2da"],"2040","207a","207d","207e","ff3e","ff40"],type:tm.PUNCTUATION,role:sm.OVERACCENT},{set:["b8","2db","2038","203f","2054","208a","208d","208e"],type:tm.PUNCTUATION,role:sm.UNDERACCENT},{set:["3a","2982","fe13","fe30","fe55","ff1a"],type:tm.PUNCTUATION,role:sm.COLON},{set:["2c","2063","fe50","ff0c"],type:tm.PUNCTUATION,role:sm.COMMA},{set:["2026",["22ee","22f1"],"fe19"],type:tm.PUNCTUATION,role:sm.ELLIPSIS},{set:["2e","fe52","ff0e"],type:tm.PUNCTUATION,role:sm.FULLSTOP},{set:["2d","207b","208b","2212","2796","fe63","ff0d"],type:tm.OPERATOR,role:sm.DASH,secondary:om.BAR},{set:["5f","af",["2010","2015"],"203e","208b",["fe49","fe4f"],"fe58","ff3f","ffe3"],type:tm.PUNCTUATION,role:sm.DASH,secondary:om.BAR},{set:["7e","2dc","2f7","303","330","334","2053","223c","223d","301c","ff5e"],type:tm.OPERATOR,role:sm.TILDE,secondary:om.TILDE},{set:["27","2b9","2ba",["2032","2037"],"2057"],type:tm.PUNCTUATION,role:sm.PRIME},{set:["b0"],type:tm.PUNCTUATION,role:sm.DEGREE},{set:["2b","b1","2064","2213","2214","2228","222a",["228c","228e"],"2294","2295","229d","229e","22bb","22bd","22c4","22ce","22d3","2304","271b","271c","2795","27cf","29fa","29fb","29fe",["2a22","2a28"],"2a2d","2a2e","2a39","2a42","2a45","2a46","2a48","2a4a","2a4c","2a4f","2a50","2a52","2a54","2a56","2a57","2a59","2a5b","2a5d",["2a61","2a63"],"2adc","2add","fe62","ff0b"],type:tm.OPERATOR,role:sm.ADDITION},{set:["2a","b7","d7","2020","2021","204e","2051","2062",["2217","2219"],"2227","2229","2240","2293","2297",["2299","229b"],"22a0","22a1","22b9","22bc",["22c5","22cc"],"22cf","22d2","22d4","2303","2305","2306","25cb","2715","2716","27ce","27d1",["29d1","29d7"],"29e2","2a1d",["2a2f","2a37"],["2a3b","2a3d"],"2a40","2a43","2a44","2a47","2a49","2a4b","2a4d","2a4e","2a51","2a53","2a55","2a58","2a5a","2a5c",["2a5e","2a60"],"2ada","2adb","fe61","ff0a"],type:tm.OPERATOR,role:sm.MULTIPLICATION},{set:["2d","af","2010","2011","2052","207b","208b","2212","2216","2238","2242","2296","229f","2796","29ff",["2a29","2a2c"],"2a3a","2a41","fe63","ff0d"],type:tm.OPERATOR,role:sm.SUBTRACTION},{set:["2f","f7","2044","2215","2298","2797","27cc","29bc",["29f5","29f9"],"2a38"],type:tm.OPERATOR,role:sm.DIVISION},{set:["25","2030","2031","ff05","fe6a"],type:tm.OPERATOR,role:sm.POSTFIXOP},{set:["ac","2200","2201","2203","2204","2206",["221a","221c"],"2310","ffe2"],type:tm.OPERATOR,role:sm.PREFIXOP},{set:["2320","2321","23aa","23ae","23af","23b2","23b3","23b6","23b7"],type:tm.OPERATOR,role:sm.PREFIXOP},{set:["1d7ca","1d7cb"],type:tm.OPERATOR,role:sm.PREFIXOP,font:rm.BOLD},{set:["3d","7e","207c","208c","221d","2237",["223a","223f"],"2243","2245","2248",["224a","224e"],["2251","225f"],"2261","2263","229c","22cd","22d5","29e4","29e6","2a66","2a67",["2a6a","2a6c"],["2a6c","2a78"],"fe66","ff1d"],type:tm.RELATION,role:sm.EQUALITY},{set:["3c","3e","2241","2242","2244","2246","2247","2249","224f","2250","2260","2262",["2264","2281"],"22b0","22b1",["22d6","22e1"],["22e6","22e9"],["2976","2978"],"29c0","29c1","29e1","29e3","29e5",["2a79","2abc"],["2af7","2afa"],"fe64","fe65","ff1c","ff1e"],type:tm.RELATION,role:sm.INEQUALITY},{set:[["2282","228b"],["228f","2292"],["22b2","22b8"],"22d0","22d1",["22e2","22e5"],["22ea","22ed"],"27c3","27c4",["27c7","27c9"],["27d5","27d7"],"27dc",["2979","297b"],"29df",["2abd","2ad8"]],type:tm.RELATION,role:sm.SET},{set:["2236",["27e0","27e5"],"292b","292c",["29b5","29bb"],"29be","29bf",["29c2","29d0"]],type:tm.RELATION,role:sm.UNKNOWN},{set:["2205",["29b0","29b4"]],type:tm.IDENTIFIER,role:sm.SETEMPTY},{set:["1ab2","221e",["29dc","29de"]],type:tm.IDENTIFIER,role:sm.INFTY},{set:["22a2","22a3",["22a6","22af"],"27da","27db","27dd","27de","2ade",["2ae2","2ae6"],"2aec","2aed"],type:tm.RELATION,role:sm.LOGIC},{set:["22a4","22a5","22ba","27d8","27d9","27df","2adf","2ae0",["2ae7","2aeb"],"2af1"],type:tm.IDENTIFIER,role:sm.LOGIC},{set:[["2190","21ff"],"2301","2324","238b","2794",["2798","27af"],["27b1","27be"],["27f0","27ff"],["2900","292a"],["292d","2975"],["297c","297f"],["2b00","2b11"],["2b30","2b4c"],["ffe9","ffec"]],type:tm.RELATION,role:sm.ARROW},{set:["2208","220a",["22f2","22f9"],"22ff","27d2","2ad9"],type:tm.OPERATOR,role:sm.ELEMENT},{set:["2209"],type:tm.OPERATOR,role:sm.NONELEMENT},{set:["220b","220d",["22fa","22fe"]],type:tm.OPERATOR,role:sm.REELEMENT},{set:["220c"],type:tm.OPERATOR,role:sm.RENONELEMENT},{set:[["220f","2211"],["22c0","22c3"],["2a00","2a0b"],"2a3f","2afc","2aff"],type:tm.LARGEOP,role:sm.SUM},{set:["2140"],type:tm.LARGEOP,role:sm.SUM,font:rm.DOUBLESTRUCK},{set:[["222b","2233"],["2a0c","2a17"],["2a17","2a1c"]],type:tm.LARGEOP,role:sm.INTEGRAL},{set:[["2500","257F"]],type:tm.RELATION,role:sm.BOX},{set:[["2580","259F"]],type:tm.IDENTIFIER,role:sm.BLOCK},{set:[["25A0","25FF"],["2B12","2B2F"],["2B50","2B59"]],type:tm.RELATION,role:sm.GEOMETRY},{set:["220e","2300","2302","2311","29bd","29e0",["29e8","29f3"],"2a1e","2afe","ffed","ffee"],type:tm.OPERATOR,role:sm.GEOMETRY},{set:[["221f","2222"],"22be","22bf",["2312","2314"],"237c","27c0",["299b","29af"]],type:tm.OPERATOR,role:sm.GEOMETRY},{set:["24",["a2","a5"],"b5","2123",["2125","2127"],"212a","212b","fe69","ff04","ffe0","ffe1","ffe5","ffe6"],type:tm.IDENTIFIER,role:sm.UNKNOWN},{set:["a9","ae","210f","2114","2116","2117",["211e","2122"],"212e","2132",["2139","213b"],["2141","2144"],"214d","214e",["1f12a","1f12c"],"1f18a"],type:tm.IDENTIFIER,role:sm.OTHERLETTER},{set:["2224","2226","2239","2307","27b0","27bf","27c1","27c2","27ca","27cb","27cd","27d0","27d3","27d4","2981","2999","299a","29e7","29f4","2a20","2a21","2a64","2a65","2a68","2a69","2ae1",["2aee","2af0"],"2af2","2af3","2af5","2af6","2afb","2afd"],type:tm.OPERATOR,role:sm.UNKNOWN},{set:["2605","2606","26aa","26ab",["2720","274d"]],type:tm.OPERATOR,role:sm.UNKNOWN},{set:[["2145","2149"]],type:tm.IDENTIFIER,role:sm.LATINLETTER,font:rm.DOUBLESTRUCKITALIC,secondary:om.ALLLETTERS},{set:[["213c","213f"]],type:tm.IDENTIFIER,role:sm.GREEKLETTER,font:rm.DOUBLESTRUCK,secondary:om.ALLLETTERS},{set:["3d0","3d7","3f6",["1d26","1d2a"],"1d5e","1d60",["1d66","1d6a"]],type:tm.IDENTIFIER,role:sm.GREEKLETTER,font:rm.NORMAL,secondary:om.ALLLETTERS},{set:[["2135","2138"]],type:tm.IDENTIFIER,role:sm.OTHERLETTER,font:rm.NORMAL,secondary:om.ALLLETTERS},{set:["131","237"],type:tm.IDENTIFIER,role:sm.LATINLETTER,font:rm.NORMAL},{set:["1d6a4","1d6a5"],type:tm.IDENTIFIER,role:sm.LATINLETTER,font:rm.ITALIC},{set:["2113","2118"],type:tm.IDENTIFIER,role:sm.LATINLETTER,font:rm.SCRIPT},{set:[["c0","d6"],["d8","f6"],["f8","1bf"],["1c4","2af"],["1d00","1d25"],["1d6b","1d9a"],["1e00","1ef9"],["363","36f"],["1dd3","1de6"],["1d62","1d65"],"1dca","2071","207f",["2090","209c"],"2c7c"],type:tm.IDENTIFIER,role:sm.LATINLETTER,font:rm.NORMAL},{set:[["00bc","00be"],["2150","215f"],"2189"],type:tm.NUMBER,role:sm.FLOAT},{set:["23E8",["3248","324f"]],type:tm.NUMBER,role:sm.INTEGER},{set:[["214A","214C"],"2705","2713","2714","2717","2718"],type:tm.IDENTIFIER,role:sm.UNKNOWN},{set:["20","a0","ad",["2000","200f"],["2028","202f"],["205f","2060"],"206a","206b","206e","206f","feff",["fff9","fffb"]],type:tm.TEXT,role:sm.SPACE},{set:["7c","a6","2223","23b8","23b9","23d0","2758",["fe31","fe34"],"ff5c","ffe4","ffe8"],type:tm.FENCE,role:sm.NEUTRAL},{set:["2016","2225","2980","2af4"],type:tm.FENCE,role:sm.METRIC}].forEach((t=>{var{set:e}=t,s=am(t,["set"]);return um(function(t){let e=[];for(const s of t)Array.isArray(s)?e=e.concat(Jp(s)):e.push(String.fromCodePoint(parseInt(s,16)));return e}(e),s)})),pm(dm.FencesVert,["23b4",["23dc","23e1"],["fe35","fe44"],"fe47"]),pm(dm.FencesHoriz,["28","2045","207D","208D",["2308","230f"],["231c","231f"],"2329","23b0",["2768","2775"],"27c5",["27e6","27ef"],["2983","2998"],["29d8","29db"],"29fc",["2e22","2e29"],["3008","3011"],["3014","301b"],"fd3e","fe17",["fe59","fe5e"],"ff08","ff5f","ff62"]),pm(dm.FencesHoriz,["5b","7b","ff3b","ff5b"],2),pm(dm.FencesHoriz,[["239b","23a6"]],3),pm(dm.FencesHoriz,[["23a7","23a9"]],4),um([...dm.FencesHoriz.keys()],{type:tm.FENCE,role:sm.OPEN}),um([...dm.FencesHoriz.values()],{type:tm.FENCE,role:sm.CLOSE}),um([...dm.FencesVert.keys()],{type:tm.FENCE,role:sm.TOP}),um([...dm.FencesVert.values()],{type:tm.FENCE,role:sm.BOTTOM}),function(){for(const[t,e]of Object.entries(rm)){const s=!!Gp[t]?rm.UNKNOWN:e===rm.FULLWIDTH?rm.NORMAL:e;gm(Xp.LATINCAP,tm.IDENTIFIER,sm.LATINLETTER,e,s,[om.ALLLETTERS]),gm(Xp.LATINSMALL,tm.IDENTIFIER,sm.LATINLETTER,e,s,[om.ALLLETTERS],{},{3:om.D}),gm(Xp.GREEKCAP,tm.IDENTIFIER,sm.GREEKLETTER,e,s,[om.ALLLETTERS]),gm(Xp.GREEKSMALL,tm.IDENTIFIER,sm.GREEKLETTER,e,s,[om.ALLLETTERS],{0:{type:tm.OPERATOR,role:sm.PREFIXOP,font:s},26:{type:tm.OPERATOR,role:sm.PREFIXOP,font:s}}),gm(Xp.DIGIT,tm.NUMBER,sm.INTEGER,e,s)}}(),um(["inf","lim","liminf","limsup","max","min","sup","injlim","projlim"],{type:tm.FUNCTION,role:sm.LIMFUNC}),um(mm,{type:tm.FUNCTION,role:sm.PREFIXFUNC}),um(["mod","rem"],{type:tm.OPERATOR,role:sm.PREFIXFUNC});const fm=[];function bm(t,e){for(let s,i=0;s=fm[i];i++){const i=s.compare(t,e);if(0!==i)return i}return 0}function Em(t){if(t.length<=1)return t;const e=t.slice();!function(t){t.sort(bm)}(e);const s=[];let i;do{i=e.pop(),s.push(i)}while(i&&e.length&&0===bm(e[e.length-1],i));return s}function xm(t,e){return t.match(/^.+:.+$/)||!e?t:t+":"+e}new class{constructor(t,e=null){this.comparator=t,this.type=e,function(t){fm.push(t)}(this)}compare(t,e){return this.type&&this.type===t.type&&this.type===e.type?this.comparator(t,e):0}}((function(t,e){return t.role===sm.SIMPLEFUNC?1:e.role===sm.SIMPLEFUNC?-1:0}),tm.IDENTIFIER);class ym extends Map{set(t,e){return super.set(xm(t,e.font),e),this}setNode(t){this.set(t.textContent,t.meaning())}get(t,e=null){return super.get(xm(t,e))}getNode(t){return this.get(t.textContent,t.font)}}class Nm extends Map{add(t,e){const s=this.get(t);s?s.push(e):super.set(t,[e])}get(t,e=null){return super.get(xm(t,e))}getNode(t){return this.get(t.textContent,t.font)}minimize(){for(const[t,e]of this)1===e.length&&this.delete(t)}isMultiValued(){for(const t of this.values())if(t.length>1)return!0;return!1}}class Am extends Nm{add(t,e){super.add(xm(t,e.font),e)}addNode(t){this.add(t.textContent,t)}toString(){const t=[];for(const[e,s]of this){const i=Array(e.length+3).join(" "),r=s.map((t=>t.toString())).join("\n"+i);t.push(e+": "+r)}return t.join("\n")}collateMeaning(){const t=new vm;for(const[e,s]of this)t.set(e,s.map((t=>t.meaning())));return t}}class vm extends Nm{add(t,e){const s=this.get(t,e.font);s&&s.find((function(t){return i=e,(s=t).type===i.type&&s.role===i.role&&s.font===i.font;var s,i}))||super.add(xm(t,e.font),e)}addNode(t){this.add(t.textContent,t.meaning())}toString(){const t=[];for(const[e,s]of this){const i=Array(e.length+3).join(" "),r=s.map((t=>`{type: ${t.type}, role: ${t.role}, font: ${t.font}}`)).join("\n"+i);t.push(e+": "+r)}return t.join("\n")}reduce(){for(const[t,e]of this)1!==e.length&&this.set(t,Em(e))}default(){const t=new ym;for(const[e,s]of this)1===s.length&&t.set(e,s[0]);return t}newDefault(){const t=this.default();this.reduce();const e=this.default();return t.size!==e.size?e:null}}var _m;!function(t){t.ANNOTATION="ANNOTATION",t.ANNOTATIONXML="ANNOTATION-XML",t.MACTION="MACTION",t.MALIGNGROUP="MALIGNGROUP",t.MALIGNMARK="MALIGNMARK",t.MATH="MATH",t.MENCLOSE="MENCLOSE",t.MERROR="MERROR",t.MFENCED="MFENCED",t.MFRAC="MFRAC",t.MGLYPH="MGLYPH",t.MI="MI",t.MLABELEDTR="MLABELEDTR",t.MMULTISCRIPTS="MMULTISCRIPTS",t.MN="MN",t.MO="MO",t.MOVER="MOVER",t.MPADDED="MPADDED",t.MPHANTOM="MPHANTOM",t.MPRESCRIPTS="MPRESCRIPTS",t.MROOT="MROOT",t.MROW="MROW",t.MS="MS",t.MSPACE="MSPACE",t.MSQRT="MSQRT",t.MSTYLE="MSTYLE",t.MSUB="MSUB",t.MSUBSUP="MSUBSUP",t.MSUP="MSUP",t.MTABLE="MTABLE",t.MTD="MTD",t.MTEXT="MTEXT",t.MTR="MTR",t.MUNDER="MUNDER",t.MUNDEROVER="MUNDEROVER",t.NONE="NONE",t.SEMANTICS="SEMANTICS"}(_m||(_m={}));const wm=Object.values(_m),Tm=[_m.MO,_m.MI,_m.MN,_m.MTEXT,_m.MS,_m.MSPACE],Cm=[_m.MERROR,_m.MPHANTOM,_m.MALIGNGROUP,_m.MALIGNMARK,_m.MPRESCRIPTS,_m.ANNOTATION,_m.ANNOTATIONXML],Lm=[_m.MATH,_m.MROW,_m.MPADDED,_m.MACTION,_m.NONE,_m.MSTYLE,_m.SEMANTICS],Im=[_m.MROOT,_m.MSQRT],Rm=["aria-label","exact-speech","alt"];function Sm(t){return!!t&&Pp(t)===_m.MATH}function km(t){return!!t&&(Cm.includes(Pp(t))||!wm.includes(Pp(t)))}function Om(t){return!!t&&Lm.includes(Pp(t))}function Mm(t){return!!t&&Pp(t)===_m.MGLYPH&&!function(t){return!!t&&Tm.includes(Pp(t))}(t.parentNode)}function Dm(t){const e=[];for(let s,i=0;s=t[i];i++){if(s.nodeType!==Sp.ELEMENT_NODE)continue;const t=Pp(s);Cm.includes(t)||(Lm.includes(t)&&0===s.childNodes.length||e.push(s))}return e}function Pm(t,e){var s;if(null===(s=e.attributes)||void 0===s?void 0:s.length){const s=e.attributes;for(let e=s.length-1;e>=0;e--){const i=s[e].name;i.match(/^ext/)&&(t.attributes[i]=s[e].value,t.nobreaking=!0),Rm.includes(i)&&(t.attributes["ext-speech"]=s[e].value,t.nobreaking=!0),"href"===i&&(t.attributes.href=s[e].value,t.nobreaking=!0),"data-latex"!==i.toLowerCase()&&"latex"!==i.toLowerCase()||(t.attributes.latex=s[e].value),i.match(/texclass$/)&&(t.attributes.texclass=s[e].value),"color"!==i&&"mathcolor"!==i||(t.attributes.color=s[e].value)}}}function Bm(t){return t&&t.embellished&&t.childNodes.length>0?Bm(t.childNodes[0]):t}function Fm(t,e,s){s&&t.reverse();const i=[];for(let r,n=0;r=t[n];n++){if(e(r))return s?{head:t.slice(n+1).reverse(),div:r,tail:i.reverse()}:{head:i,div:r,tail:t.slice(n+1)};i.push(r)}return s?{head:[],div:null,tail:i.reverse()}:{head:i,div:null,tail:[]}}function Um(t,e){let s=t;const i=[],r=[];let n=null;do{n=Fm(s,e),r.push(n.head),i.push(n.div),s=n.tail}while(n.div);return i.pop(),{rel:i,comp:r}}var jm;!function(t){t.EMBELLISHED="embellished",t.FENCEPOINTER="fencepointer",t.FONT="font",t.ID="id",t.ANNOTATION="annotation",t.ROLE="role",t.TYPE="type",t.CHILDREN="children",t.CONTENT="content",t.TEXT="$t"}(jm||(jm={}));class qm{static fromXml(t){const e=parseInt(t.getAttribute("id"),10),s=new qm(e);return s.type=t.tagName,qm.setAttribute(s,t,"role"),qm.setAttribute(s,t,"font"),qm.setAttribute(s,t,"embellished"),qm.setAttribute(s,t,"fencepointer","fencePointer"),t.getAttribute("annotation")&&s.parseAnnotation(t.getAttribute("annotation")),Pm(s,t),qm.processChildren(s,t),s}static setAttribute(t,e,s,i){i=i||s;const r=e.getAttribute(s);r&&(t[i]=r)}static processChildren(t,e){for(const s of Ip(e.childNodes)){if(s.nodeType===Sp.TEXT_NODE){t.textContent=s.textContent;continue}const e=Ip(s.childNodes).map(qm.fromXml);e.forEach((e=>e.parent=t)),"CONTENT"===Pp(s)?t.contentNodes=e:t.childNodes=e}}constructor(t){this.id=t,this.mathml=[],this.parent=null,this.type=tm.UNKNOWN,this.role=sm.UNKNOWN,this.font=rm.UNKNOWN,this.embellished=null,this.fencePointer="",this.childNodes=[],this.textContent="",this.mathmlTree=null,this.contentNodes=[],this.annotation={},this.attributes={},this.nobreaking=!1}querySelectorAll(t){let e=[];for(let s,i=0;s=this.childNodes[i];i++)e=e.concat(s.querySelectorAll(t));for(let s,i=0;s=this.contentNodes[i];i++)e=e.concat(s.querySelectorAll(t));return t(this)&&e.unshift(this),e}xml(t,e){const s=function(s,i){const r=i.map((function(s){return s.xml(t,e)})),n=t.createElementNS("",s);for(let t,e=0;t=r[e];e++)n.appendChild(t);return n},i=t.createElementNS("",this.type);return e||this.xmlAttributes(i),i.textContent=this.textContent,this.contentNodes.length>0&&i.appendChild(s(jm.CONTENT,this.contentNodes)),this.childNodes.length>0&&i.appendChild(s(jm.CHILDREN,this.childNodes)),i}toString(t=!1){const e=Rp("<snode/>");return Bp(this.xml(e.ownerDocument,t))}allAttributes(){const t=[];return t.push([jm.ROLE,this.role]),this.font!==rm.UNKNOWN&&t.push([jm.FONT,this.font]),Object.keys(this.annotation).length&&t.push([jm.ANNOTATION,this.annotationXml()]),this.embellished&&t.push([jm.EMBELLISHED,this.embellished]),this.fencePointer&&t.push([jm.FENCEPOINTER,this.fencePointer]),t.push([jm.ID,this.id.toString()]),t}annotationXml(){const t=[];for(const[e,s]of Object.entries(this.annotation))s.forEach((s=>t.push(e+":"+s)));return t.join(";")}attributesXml(){const t=[];for(const[e,s]of Object.entries(this.attributes))t.push(e+":"+qm.escapeValue(s));return t.join(";")}toJson(){const t={};t[jm.TYPE]=this.type;const e=this.allAttributes();for(let s,i=0;s=e[i];i++)t[s[0]]=s[1].toString();return this.textContent&&(t[jm.TEXT]=this.textContent),this.childNodes.length&&(t[jm.CHILDREN]=this.childNodes.map((function(t){return t.toJson()}))),this.contentNodes.length&&(t[jm.CONTENT]=this.contentNodes.map((function(t){return t.toJson()}))),t}updateContent(t,e){const s=e?t.replace(/^[ \f\n\r\t\v\u200b]*/,"").replace(/[ \f\n\r\t\v\u200b]*$/,""):t.trim();if(t=t&&!s?t:s,this.textContent===t)return;const i=dm.Meaning.get(t.replace(/\s/g," "));this.textContent=t,this.role=i.role,this.type=i.type,this.font=i.font}addMathmlNodes(t){for(let e,s=0;e=t[s];s++)-1===this.mathml.indexOf(e)&&this.mathml.push(e)}appendChild(t){this.childNodes.push(t),this.addMathmlNodes(t.mathml),t.parent=this}replaceChild(t,e){const s=this.childNodes.indexOf(t);if(-1===s)return;t.parent=null,e.parent=this,this.childNodes[s]=e;const i=t.mathml.filter((function(t){return-1===e.mathml.indexOf(t)})),r=e.mathml.filter((function(e){return-1===t.mathml.indexOf(e)}));this.removeMathmlNodes(i),this.addMathmlNodes(r)}appendContentNode(t){t&&(this.contentNodes.push(t),this.addMathmlNodes(t.mathml),t.parent=this)}removeContentNode(t){if(t){const e=this.contentNodes.indexOf(t);-1!==e&&this.contentNodes.slice(e,1)}}equals(t){if(!t)return!1;if(this.type!==t.type||this.role!==t.role||this.textContent!==t.textContent||this.childNodes.length!==t.childNodes.length||this.contentNodes.length!==t.contentNodes.length)return!1;for(let e,s,i=0;e=this.childNodes[i],s=t.childNodes[i];i++)if(!e.equals(s))return!1;for(let e,s,i=0;e=this.contentNodes[i],s=t.contentNodes[i];i++)if(!e.equals(s))return!1;return!0}displayTree(){console.info(this.displayTree_(0))}addAnnotation(t,e){e&&this.addAnnotation_(t,e)}getAnnotation(t){const e=this.annotation[t];return e||[]}hasAnnotation(t,e){const s=this.annotation[t];return!!s&&-1!==s.indexOf(e)}parseAnnotation(t){const e=t.split(";");for(let t=0,s=e.length;t<s;t++){const s=e[t].split(":");this.addAnnotation(s[0],s[1])}}meaning(){return{type:this.type,role:this.role,font:this.font}}xmlAttributes(t){const e=this.allAttributes();for(let s,i=0;s=e[i];i++)t.setAttribute(s[0],s[1]);this.addExternalAttributes(t)}addExternalAttributes(t){for(const[e,s]of Object.entries(this.attributes))t.setAttribute(e,s)}static escapeValue(t){return t.replace(/;/g,"\\0003B")}parseAttributes(t){if(!t)return;const e=t.split(";");for(let t=0,s=e.length;t<s;t++){const[s,...i]=e[t].split(":");s&&(this.attributes[s]=i.join("").replace(/\\0003B/g,";"))}}removeMathmlNodes(t){const e=this.mathml;for(let s,i=0;s=t[i];i++){const t=e.indexOf(s);-1!==t&&e.splice(t,1)}this.mathml=e}displayTree_(t){t++;const e=Array(t).join(" ");let s="";s+="\n"+e+this.toString(),s+="\n"+e+"MathmlTree:",s+="\n"+e+this.mathmlTreeString(),s+="\n"+e+"MathML:";for(let t,i=0;t=this.mathml[i];i++)s+="\n"+e+t.toString();return s+="\n"+e+"Begin Content",this.contentNodes.forEach((function(e){s+=e.displayTree_(t)})),s+="\n"+e+"End Content",s+="\n"+e+"Begin Children",this.childNodes.forEach((function(e){s+=e.displayTree_(t)})),s+="\n"+e+"End Children",s}mathmlTreeString(){return this.mathmlTree?this.mathmlTree.toString():"EMPTY"}addAnnotation_(t,e){const s=this.annotation[t];s&&!s.includes(e)?s.push(e):this.annotation[t]=[e]}}class Hm{constructor(){this.leafMap=new Am,this.defaultMap=new ym,this.idCounter_=-1}makeNode(t){return this.createNode_(t)}makeUnprocessed(t){const e=this.createNode_();return e.mathml=[t],e.mathmlTree=t,e}makeEmptyNode(){const t=this.createNode_();return t.type=tm.EMPTY,t}makeContentNode(t){const e=this.createNode_();return e.updateContent(t),e}makeMultipleContentNodes(t,e){const s=[];for(let i=0;i<t;i++)s.push(this.makeContentNode(e));return s}makeLeafNode(t,e){if(!t)return this.makeEmptyNode();const s=this.makeContentNode(t);s.font=e||s.font;const i=this.defaultMap.getNode(s);return i&&(s.type=i.type,s.role=i.role,s.font=i.font),this.leafMap.addNode(s),s}makeBranchNode(t,e,s,i){const r=this.createNode_();return i&&r.updateContent(i),r.type=t,r.childNodes=e,r.contentNodes=s,e.concat(s).forEach((function(t){t.parent=r,r.addMathmlNodes(t.mathml)})),r}createNode_(t){return void 0!==t?this.idCounter_=Math.max(this.idCounter_,t):t=++this.idCounter_,new qm(t)}}class Wm{constructor(t){this.type=t,this.factory_=new Hm}getFactory(){return this.factory_}setFactory(t){this.factory_=t}getType(){return this.type}parseList(t){const e=[];for(let s,i=0;s=t[i];i++)e.push(this.parse(s));return e}}function Vm(t,e){return t.type===e}function Gm(t,e){return t.embellished===e}function Xm(t,e){return t.role===e}function zm(t){return Vm(t,tm.FENCE)||Vm(t,tm.PUNCTUATION)||Vm(t,tm.OPERATOR)||Vm(t,tm.RELATION)}function Km(t){return tg(t)&&!Xm(t,sm.DIVISION)||Vm(t,tm.APPL)||Qm(t)}function Jm(t){return tg(t)||Qm(t)}function $m(t,e){return!!e&&Vm(e,tm.IDENTIFIER)&&dm.Secondary.has(t.textContent,om.D)}function Ym(t){if(Vm(t,tm.IDENTIFIER)){const e=t.textContent[0];return e&&t.textContent[1]&&dm.Secondary.has(e,om.D)}return!1}function Qm(t){return eg(t)||sg(t)}function Zm(t){return t.embellished?t.embellished:(e=t.type)===tm.OPERATOR||e===tm.RELATION||e===tm.FENCE||e===tm.PUNCTUATION?t.type:null;var e}function tg(t){return Vm(t,tm.OPERATOR)||Gm(t,tm.OPERATOR)}function eg(t){return Vm(t,tm.RELATION)||Gm(t,tm.RELATION)}function sg(t){return Vm(t,tm.PUNCTUATION)||Gm(t,tm.PUNCTUATION)}function ig(t){return Vm(t,tm.FENCE)||Gm(t,tm.FENCE)}function rg(t){return!(!t||!ig(t))&&(!t.embellished||ng(t))}function ng(t){return!t.embellished||!function(t){return Vm(t,tm.TENSOR)&&(!Vm(t.childNodes[1],tm.EMPTY)||!Vm(t.childNodes[2],tm.EMPTY))&&(!Vm(t.childNodes[3],tm.EMPTY)||!Vm(t.childNodes[4],tm.EMPTY))}(t)&&((!Xm(t,sm.CLOSE)||!Vm(t,tm.TENSOR))&&((!Xm(t,sm.OPEN)||!Vm(t,tm.SUBSCRIPT)&&!Vm(t,tm.SUPERSCRIPT))&&ng(t.childNodes[0])))}function og(t){return!!t&&(Vm(t,tm.TABLE)||Vm(t,tm.MULTILINE))}function ag(t){return!!t&&lg(t)&&og(t.childNodes[0])}function lg(t){return!!t&&Vm(t,tm.FENCED)&&(Xm(t,sm.LEFTRIGHT)||Ag(t))&&1===t.childNodes.length}function cg(t,e){return e.length>0&&Xm(e[e.length-1],sm.OPENFENCE)}function hg(t){return t.childNodes.every((function(t){return t.childNodes.length<=1}))}function dg(t){return Vm(t,tm.LARGEOP)||Vm(t,tm.LIMBOTH)||Vm(t,tm.LIMLOWER)||Vm(t,tm.LIMUPPER)||Vm(t,tm.FUNCTION)&&Xm(t,sm.LIMFUNC)||(Vm(t,tm.OVERSCORE)||Vm(t,tm.UNDERSCORE))&&dg(t.childNodes[0])}function ug(t,e,s){return 1===e.length&&(t[s].type===tm.PUNCTUATION||t[s].embellished===tm.PUNCTUATION)&&t[s]===e[0]}function pg(t){return Vm(t,tm.IDENTIFIER)&&Xm(t,sm.SIMPLEFUNC)}const mg=[tm.PUNCTUATION,tm.PUNCTUATED,tm.RELSEQ,tm.MULTIREL,tm.TABLE,tm.MULTILINE,tm.CASES,tm.INFERENCE],gg=[tm.LIMUPPER,tm.LIMLOWER,tm.LIMBOTH,tm.SUBSCRIPT,tm.SUPERSCRIPT,tm.UNDERSCORE,tm.OVERSCORE,tm.TENSOR];function fg(t){const e=t.type;return-1===mg.indexOf(e)&&(e!==tm.INFIXOP||t.role===sm.IMPLICIT)&&(e===tm.FENCED?t.role!==sm.LEFTRIGHT||fg(t.childNodes[0]):-1===gg.indexOf(e)||fg(t.childNodes[0]))}function bg(t){return function(t){return t.type===tm.NUMBER&&(t.role===sm.INTEGER||t.role===sm.FLOAT)}(t)||t.role===sm.VULGAR||t.role===sm.MIXED}function Eg(t){const e=t.childNodes;return t.role===sm.UNIT&&(!e.length||e[0].role===sm.UNIT)}function xg(t){const e=t.childNodes;return t.type===tm.INFIXOP&&(t.role===sm.MULTIPLICATION||t.role===sm.IMPLICIT)&&e.length&&(Eg(e[0])||bg(e[0]))&&t.childNodes.slice(1).every(Eg)}function yg(t){return t.type===tm.INFIXOP&&(t.role===sm.IMPLICIT||t.role===sm.UNIT&&!!t.contentNodes.length&&t.contentNodes[0].textContent===lm.invisibleTimes)}function Ng(t){return t.type===tm.INFIXOP&&t.role===sm.IMPLICIT}function Ag(t){return t.role===sm.NEUTRAL||t.role===sm.METRIC}function vg(t,e){return Ag(t)&&Ag(e)&&Bm(t).textContent===Bm(e).textContent}function _g(t){return!!Ag(t)&&(!t.embellished||t.type!==tm.SUPERSCRIPT&&t.type!==tm.SUBSCRIPT&&(t.type!==tm.TENSOR||t.childNodes[3].type===tm.EMPTY&&t.childNodes[4].type===tm.EMPTY))}function wg(t){return!!Ag(t)&&(!t.embellished||(t.type!==tm.TENSOR||t.childNodes[1].type===tm.EMPTY&&t.childNodes[2].type===tm.EMPTY))}function Tg(t){return[sm.ELEMENT,sm.NONELEMENT,sm.REELEMENT,sm.RENONELEMENT].includes(t.role)}const Cg={factory:null,options:new Ep,updateFactory:function(t){Cg.factory=t},heuristics:new Map,flags:{combine_juxtaposition:!0,convert_juxtaposition:!0,multioperator:!0},blacklist:{},add:function(t){const e=t.name;Cg.heuristics.set(e,t),Cg.flags[e]||(Cg.flags[e]=!1)},run:function(t,e,s){const i=Cg.heuristics.get(t);return i&&!Cg.blacklist[t]&&(Cg.flags[t]||i.applicable(e))?i.apply(e):s?s(e):e}};class Lg{static getInstance(){return Lg.instance=Lg.instance||new Lg,Lg.instance}static tableToMultiline(t){if(!hg(t))return Cg.run("rewrite_subcases",t,Lg.classifyTable);t.type=tm.MULTILINE;for(let e,s=0;e=t.childNodes[s];s++)Lg.rowToLine_(e,sm.MULTILINE);var e;return 1!==t.childNodes.length||Vm(e=t.childNodes[0],tm.LINE)&&e.contentNodes.length&&Xm(e.contentNodes[0],sm.LABEL)||!lg(t.childNodes[0].childNodes[0])||Lg.tableToMatrixOrVector_(Lg.rewriteFencedLine_(t)),Lg.binomialForm_(t),Lg.classifyMultiline(t),t}static number(t){t.type!==tm.UNKNOWN&&t.type!==tm.IDENTIFIER||(t.type=tm.NUMBER),Lg.meaningFromContent(t,Lg.numberRole_),Lg.exprFont_(t)}static classifyMultiline(t){let e=0;const s=t.childNodes.length;let i;for(;e<s&&(!(i=t.childNodes[e])||!i.childNodes.length);)e++;if(e>=s)return;const r=i.childNodes[0].role;r!==sm.UNKNOWN&&t.childNodes.every((function(t){const e=t.childNodes[0];return!e||e.role===r&&(Vm(e,tm.RELATION)||Vm(e,tm.RELSEQ))}))&&(t.role=r)}static classifyTable(t){const e=Lg.computeColumns_(t);return Lg.classifyByColumns_(t,e,sm.EQUALITY)||Lg.classifyByColumns_(t,e,sm.INEQUALITY,[sm.EQUALITY])||Lg.classifyByColumns_(t,e,sm.ARROW)||Lg.detectCaleyTable(t),t}static detectCaleyTable(t){if(!t.mathmlTree)return!1;const e=t.mathmlTree,s=e.getAttribute("columnlines"),i=e.getAttribute("rowlines");return!(!s||!i)&&(!(!Lg.cayleySpacing(s)||!Lg.cayleySpacing(i))&&(t.role=sm.CAYLEY,!0))}static cayleySpacing(t){const e=t.split(" ");return("solid"===e[0]||"dashed"===e[0])&&e.slice(1).every((t=>"none"===t))}static proof(t,e,s){const i=Lg.separateSemantics(e);return Lg.getInstance().proof(t,i,s)}static findSemantics(t,e,s){const i=null==s?null:s,r=Lg.getSemantics(t);return!!r&&(!!r[e]&&(null==i||r[e]===i))}static getSemantics(t){const e=t.getAttribute("semantics");return e?Lg.separateSemantics(e):null}static removePrefix(t){const[,...e]=t.split("_");return e.join("_")}static separateSemantics(t){const e={};return t.split(";").forEach((function(t){const[s,i]=t.split(":");e[Lg.removePrefix(s)]=i})),e}static matchSpaces_(t,e){for(let s,i=0;s=e[i];i++){const e=t[i].mathmlTree,r=t[i+1].mathmlTree;if(!e||!r)continue;const n=e.nextSibling;if(!n||n===r)continue;const o=Lg.getSpacer_(n);o&&o!==r&&(s.mathml.push(o),s.mathmlTree=o,s.role=sm.SPACE)}}static getSpacer_(t){if(Pp(t)===_m.MSPACE)return t;for(;Om(t)&&1===t.childNodes.length;)if(Pp(t=t.childNodes[0])===_m.MSPACE)return t;return null}static fenceToPunct_(t){const e=Lg.FENCE_TO_PUNCT_[t.role];if(e){for(;t.embellished;)t.embellished=tm.PUNCTUATION,Xm(t,sm.SUBSUP)||Xm(t,sm.UNDEROVER)||(t.role=e),t=t.childNodes[0];t.type=tm.PUNCTUATION,t.role=e}}static classifyFunction_(t,e){if(t.type===tm.APPL||t.type===tm.BIGOP||t.type===tm.INTEGRAL)return"";if(e[0]&&e[0].textContent===lm.functionApplication){Lg.getInstance().funcAppls[t.id]=e.shift();let s=sm.SIMPLEFUNC;return Cg.run("simple2prefix",t),t.role!==sm.PREFIXFUNC&&t.role!==sm.LIMFUNC||(s=t.role),Lg.propagateFunctionRole_(t,s),"prefix"}const s=Lg.CLASSIFY_FUNCTION_[t.role];return s||((i=t).type===tm.IDENTIFIER||i.role===sm.LATINLETTER||i.role===sm.GREEKLETTER||i.role===sm.OTHERLETTER?"simple":"");var i}static propagateFunctionRole_(t,e){if(t){if(t.type===tm.INFIXOP)return;Xm(t,sm.SUBSUP)||Xm(t,sm.UNDEROVER)||(t.role=e),Lg.propagateFunctionRole_(t.childNodes[0],e)}}static getFunctionOp_(t,e){if(e(t))return t;for(let s,i=0;s=t.childNodes[i];i++){const t=Lg.getFunctionOp_(s,e);if(t)return t}return null}static tableToMatrixOrVector_(t){const e=t.childNodes[0];Vm(e,tm.MULTILINE)?Lg.tableToVector_(t):Lg.tableToMatrix_(t),t.contentNodes.forEach(e.appendContentNode.bind(e));for(let t,s=0;t=e.childNodes[s];s++)Lg.assignRoleToRow_(t,Lg.getComponentRoles_(e));return e.parent=null,e}static tableToVector_(t){const e=t.childNodes[0];e.type=tm.VECTOR,1!==e.childNodes.length?Lg.binomialForm_(e):Lg.tableToSquare_(t)}static binomialForm_(t){Xm(t,sm.UNKNOWN)&&(2===t.childNodes.length&&(t.role=sm.BINOMIAL,t.childNodes[0].role=sm.BINOMIAL,t.childNodes[1].role=sm.BINOMIAL))}static tableToMatrix_(t){const e=t.childNodes[0];e.type=tm.MATRIX,e.childNodes&&e.childNodes.length>0&&e.childNodes[0].childNodes&&e.childNodes.length===e.childNodes[0].childNodes.length?Lg.tableToSquare_(t):e.childNodes&&1===e.childNodes.length&&(e.role=sm.ROWVECTOR)}static tableToSquare_(t){const e=t.childNodes[0];Xm(e,sm.UNKNOWN)&&(Ag(t)?e.role=sm.DETERMINANT:e.role=sm.SQUAREMATRIX)}static getComponentRoles_(t){const e=t.role;return e&&e!==sm.UNKNOWN?e:t.type.toLowerCase()||sm.UNKNOWN}static tableToCases_(t,e){for(let e,s=0;e=t.childNodes[s];s++)Lg.assignRoleToRow_(e,sm.CASES);return t.type=tm.CASES,t.appendContentNode(e),hg(t)&&Lg.binomialForm_(t),t}static rewriteFencedLine_(t){const e=t.childNodes[0],s=t.childNodes[0].childNodes[0],i=t.childNodes[0].childNodes[0].childNodes[0];return s.parent=t.parent,t.parent=s,i.parent=e,s.childNodes=[t],e.childNodes=[i],s}static rowToLine_(t,e){const s=e||sm.UNKNOWN;Vm(t,tm.ROW)&&(t.type=tm.LINE,t.role=s,1===t.childNodes.length&&Vm(t.childNodes[0],tm.CELL)&&(t.childNodes=t.childNodes[0].childNodes,t.childNodes.forEach((function(e){e.parent=t}))))}static assignRoleToRow_(t,e){Vm(t,tm.LINE)?t.role=e:Vm(t,tm.ROW)&&(t.role=e,t.childNodes.forEach((function(t){Vm(t,tm.CELL)&&(t.role=e)})))}static nextSeparatorFunction_(t){let e;if(t){if(t.match(/^\s+$/))return null;e=t.replace(/\s/g,"").split("").filter((function(t){return t}))}else e=[","];return function(){return e.length>1?e.shift():e[0]}}static meaningFromContent(t,e){const s=[...t.textContent].filter((t=>t.match(/[^\s]/))),i=s.map((t=>dm.Meaning.get(t)));e(t,s,i)}static numberRole_(t,e,s){if(t.role===sm.UNKNOWN)return s.every((function(t){return t.type===tm.NUMBER&&t.role===sm.INTEGER||t.type===tm.PUNCTUATION&&t.role===sm.COMMA}))?(t.role=sm.INTEGER,void("0"===e[0]&&t.addAnnotation("general","basenumber"))):void(s.every((function(t){return t.type===tm.NUMBER&&t.role===sm.INTEGER||t.type===tm.PUNCTUATION}))?t.role=sm.FLOAT:t.role=sm.OTHERNUMBER)}static exprFont_(t){t.font===rm.UNKNOWN&&Lg.compSemantics(t,"font",rm)}static compSemantics(t,e,s){const i=[...t.textContent].map((t=>dm.Meaning.get(t))).reduce((function(t,i){return t&&i[e]&&i[e]!==s.UNKNOWN&&i[e]!==t?t===s.UNKNOWN?i[e]:null:t}),s.UNKNOWN);i&&(t[e]=i)}static purgeFences_(t){const e=t.rel,s=t.comp,i=[],r=[];for(;e.length>0;){const t=e.shift();let n=s.shift();rg(t)?(i.push(t),r.push(n)):(Lg.fenceToPunct_(t),n.push(t),n=n.concat(s.shift()),s.unshift(n))}return r.push(s.shift()),{rel:i,comp:r}}static rewriteFencedNode_(t){const e=t.contentNodes[0],s=t.contentNodes[1];let i=Lg.rewriteFence_(t,e);return t.contentNodes[0]=i.fence,i=Lg.rewriteFence_(i.node,s),t.contentNodes[1]=i.fence,t.contentNodes[0].parent=t,t.contentNodes[1].parent=t,i.node.parent=null,i.node}static rewriteFence_(t,e){if(!e.embellished)return{node:t,fence:e};const s=e.childNodes[0],i=Lg.rewriteFence_(t,s);return Vm(e,tm.SUPERSCRIPT)||Vm(e,tm.SUBSCRIPT)||Vm(e,tm.TENSOR)?(Xm(e,sm.SUBSUP)||(e.role=t.role),s!==i.node&&(e.replaceChild(s,i.node),s.parent=t),Lg.propagateFencePointer_(e,s),{node:e,fence:i.fence}):(e.replaceChild(s,i.fence),e.mathmlTree&&-1===e.mathml.indexOf(e.mathmlTree)&&e.mathml.push(e.mathmlTree),{node:i.node,fence:e})}static propagateFencePointer_(t,e){t.fencePointer=e.fencePointer||e.id.toString(),t.embellished=null}static classifyByColumns_(t,e,s,i=[]){const r=[s].concat(i);return!!(3===e.length&&Lg.testColumns_(e,1,(t=>Lg.isPureRelation_(t,r)))||2===e.length&&(Lg.testColumns_(e,1,(t=>Lg.isEndRelation_(t,r)||Lg.isPureRelation_(t,r)))||Lg.testColumns_(e,0,(t=>Lg.isEndRelation_(t,r,!0)||Lg.isPureRelation_(t,r)))))&&(t.role=s,!0)}static isEndRelation_(t,e,s){const i=s?t.childNodes.length-1:0;return Vm(t,tm.RELSEQ)&&e.some((e=>Xm(t,e)))&&Vm(t.childNodes[i],tm.EMPTY)}static isPureRelation_(t,e){return Vm(t,tm.RELATION)&&e.some((e=>Xm(t,e)))}static computeColumns_(t){const e=[];for(let s,i=0;s=t.childNodes[i];i++)for(let t,i=0;t=s.childNodes[i];i++){e[i]?e[i].push(t):e[i]=[t]}return e}static testColumns_(t,e,s){const i=t[e];return!!i&&(i.some((function(t){return t.childNodes.length&&s(t.childNodes[0])}))&&i.every((function(t){return!t.childNodes.length||s(t.childNodes[0])})))}setNodeFactory(t){Lg.getInstance().factory_=t,Cg.updateFactory(Lg.getInstance().factory_)}getNodeFactory(){return Lg.getInstance().factory_}identifierNode(t,e,s){if("MathML-Unit"===s)t.type=tm.IDENTIFIER,t.role=sm.UNIT;else if(!e&&1===t.textContent.length&&(t.role===sm.INTEGER||t.role===sm.LATINLETTER||t.role===sm.GREEKLETTER)&&t.font===rm.NORMAL)return t.font=rm.ITALIC,Cg.run("simpleNamedFunction",t);return t.type===tm.UNKNOWN&&(t.type=tm.IDENTIFIER),Lg.exprFont_(t),Cg.run("simpleNamedFunction",t)}implicitNode(t){if(t=Lg.getInstance().getMixedNumbers_(t),1===(t=Lg.getInstance().combineUnits_(t)).length)return t[0];const e=Lg.getInstance().implicitNode_(t);return Cg.run("combine_juxtaposition",e)}text(t,e){if(Lg.exprFont_(t),t.type=tm.TEXT,e===_m.ANNOTATIONXML)return t.role=sm.ANNOTATION,t;if(e===_m.MS)return t.role=sm.STRING,t;if(e===_m.MSPACE||t.textContent.match(/^\s*$/))return t.role=sm.SPACE,t;if(/\s/.exec(t.textContent))return t.role=sm.TEXT,t;const s=[...t.textContent];if(1!==s.length)return t.role=sm.UNKNOWN,t;const i=dm.Meaning.get(s[0]);return i.type===tm.UNKNOWN||i.type===tm.IDENTIFIER||(t.type=i.type,t.role=i.role,t.font=i.font,t.addAnnotation("general","text")),t}row(t){return 0===(t=t.filter((function(t){return!Vm(t,tm.EMPTY)}))).length?Lg.getInstance().factory_.makeEmptyNode():(t=Lg.getInstance().getFencesInRow_(t),t=Lg.getInstance().tablesInRow(t),t=Lg.getInstance().getPunctuationInRow_(t),t=Lg.getInstance().getTextInRow_(t),t=Lg.getInstance().getFunctionsInRow_(t),Lg.getInstance().relationsInRow_(t))}limitNode(t,e){if(!e.length)return Lg.getInstance().factory_.makeEmptyNode();let s,i=e[0],r=tm.UNKNOWN;if(!e[1])return i;if(Cg.run("op_with_limits",e),dg(i)){s=Lg.MML_TO_LIMIT_[t];const n=s.length;if(r=s.type,e=e.slice(0,s.length+1),1===n&&zm(e[1])||2===n&&zm(e[1])&&zm(e[2]))return s=Lg.MML_TO_BOUNDS_[t],Lg.getInstance().accentNode_(i,e,s.type,s.length,s.accent);if(2===n){if(zm(e[1]))return i=Lg.getInstance().accentNode_(i,[i,e[1]],{MSUBSUP:tm.SUBSCRIPT,MUNDEROVER:tm.UNDERSCORE}[t],1,!0),e[2]?Lg.getInstance().makeLimitNode_(i,[i,e[2]],null,tm.LIMUPPER):i;if(e[2]&&zm(e[2]))return i=Lg.getInstance().accentNode_(i,[i,e[2]],{MSUBSUP:tm.SUPERSCRIPT,MUNDEROVER:tm.OVERSCORE}[t],1,!0),Lg.getInstance().makeLimitNode_(i,[i,e[1]],null,tm.LIMLOWER);e[n]||(r=tm.LIMLOWER)}return Lg.getInstance().makeLimitNode_(i,e,null,r)}return s=Lg.MML_TO_BOUNDS_[t],Lg.getInstance().accentNode_(i,e,s.type,s.length,s.accent)}tablesInRow(t){let e=Um(t,ag),s=[];for(let t,i=0;t=e.rel[i];i++)s=s.concat(e.comp.shift()),s.push(Lg.tableToMatrixOrVector_(t));s=s.concat(e.comp.shift()),e=Um(s,og),s=[];for(let t,i=0;t=e.rel[i];i++){const i=e.comp.shift();cg(0,i)&&Lg.tableToCases_(t,i.pop()),s=s.concat(i),s.push(t)}return s.concat(e.comp.shift())}mfenced(t,e,s,i){if(s&&i.length>0){const t=Lg.nextSeparatorFunction_(s),e=[i.shift()];i.forEach((s=>{e.push(Lg.getInstance().factory_.makeContentNode(t())),e.push(s)})),i=e}return t&&e?Lg.getInstance().horizontalFencedNode_(Lg.getInstance().factory_.makeContentNode(t),Lg.getInstance().factory_.makeContentNode(e),i):(t&&i.unshift(Lg.getInstance().factory_.makeContentNode(t)),e&&i.push(Lg.getInstance().factory_.makeContentNode(e)),Lg.getInstance().row(i))}fractionLikeNode(t,e,s,i){let r;if(!i&&function(t){if(!t)return!1;if(["negativeveryverythinmathspace","negativeverythinmathspace","negativethinmathspace","negativemediummathspace","negativethickmathspace","negativeverythickmathspace","negativeveryverythickmathspace"].includes(t))return!0;const e=t.match(/[0-9.]+/);return!!e&&0===parseFloat(e[0])}(s)){const s=Lg.getInstance().factory_.makeBranchNode(tm.LINE,[t],[]),i=Lg.getInstance().factory_.makeBranchNode(tm.LINE,[e],[]);return r=Lg.getInstance().factory_.makeBranchNode(tm.MULTILINE,[s,i],[]),Lg.binomialForm_(r),Lg.classifyMultiline(r),r}return r=Lg.getInstance().fractionNode_(t,e),i&&r.addAnnotation("general","bevelled"),r}tensor(t,e,s,i,r){const n=Lg.getInstance().factory_.makeBranchNode(tm.TENSOR,[t,Lg.getInstance().scriptNode_(e,sm.LEFTSUB),Lg.getInstance().scriptNode_(s,sm.LEFTSUPER),Lg.getInstance().scriptNode_(i,sm.RIGHTSUB),Lg.getInstance().scriptNode_(r,sm.RIGHTSUPER)],[]);return n.role=t.role,n.embellished=Zm(t),n}pseudoTensor(t,e,s){const i=t=>!Vm(t,tm.EMPTY),r=e.filter(i).length,n=s.filter(i).length;if(!r&&!n)return t;const o=r?n?_m.MSUBSUP:_m.MSUB:_m.MSUP,a=[t];return r&&a.push(Lg.getInstance().scriptNode_(e,sm.RIGHTSUB,!0)),n&&a.push(Lg.getInstance().scriptNode_(s,sm.RIGHTSUPER,!0)),Lg.getInstance().limitNode(o,a)}font(t){const e=Lg.MATHJAX_FONTS[t];return e||t}proof(t,e,s){if(e.inference||e.axiom||console.log("Noise"),e.axiom){const e=Lg.getInstance().cleanInference(t.childNodes),i=e.length?Lg.getInstance().factory_.makeBranchNode(tm.INFERENCE,s(e),[]):Lg.getInstance().factory_.makeEmptyNode();return i.role=sm.AXIOM,i.mathmlTree=t,i}const i=Lg.getInstance().inference(t,e,s);return e.proof&&(i.role=sm.PROOF,i.childNodes[0].role=sm.FINAL),i}inference(t,e,s){if(e.inferenceRule){const e=Lg.getInstance().getFormulas(t,[],s);return Lg.getInstance().factory_.makeBranchNode(tm.INFERENCE,[e.conclusion,e.premises],[])}const i=e.labelledRule,r=Ip(t.childNodes),n=[];"left"!==i&&"both"!==i||n.push(Lg.getInstance().getLabel(t,r,s,sm.LEFT)),"right"!==i&&"both"!==i||n.push(Lg.getInstance().getLabel(t,r,s,sm.RIGHT));const o=Lg.getInstance().getFormulas(t,r,s),a=Lg.getInstance().factory_.makeBranchNode(tm.INFERENCE,[o.conclusion,o.premises],n);return a.mathmlTree=t,a}getLabel(t,e,s,i){const r=Lg.getInstance().findNestedRow(e,"prooflabel",i),n=Lg.getInstance().factory_.makeBranchNode(tm.RULELABEL,s(Ip(r.childNodes)),[]);return n.role=i,n.mathmlTree=r,n}getFormulas(t,e,s){const i=e.length?Lg.getInstance().findNestedRow(e,"inferenceRule"):t,r="up"===Lg.getSemantics(i).inferenceRule,n=r?i.childNodes[1]:i.childNodes[0],o=r?i.childNodes[0]:i.childNodes[1],a=n.childNodes[0].childNodes[0],l=Ip(a.childNodes[0].childNodes),c=[];let h=1;for(const t of l)h%2&&c.push(t.childNodes[0]),h++;const d=s(c),u=s(Ip(o.childNodes[0].childNodes))[0],p=Lg.getInstance().factory_.makeBranchNode(tm.PREMISES,d,[]);p.mathmlTree=a;const m=Lg.getInstance().factory_.makeBranchNode(tm.CONCLUSION,[u],[]);return m.mathmlTree=o.childNodes[0].childNodes[0],{conclusion:m,premises:p}}findNestedRow(t,e,s){return Lg.getInstance().findNestedRow_(t,e,0,s)}cleanInference(t){return Ip(t).filter((function(t){return"MSPACE"!==Pp(t)}))}operatorNode(t){return t.type===tm.UNKNOWN&&(t.type=tm.OPERATOR),Cg.run("multioperator",t)}constructor(){this.funcAppls={},this.splitRoles=new Map([[sm.SUBTRACTION,sm.NEGATIVE],[sm.ADDITION,sm.POSITIVE]]),this.splitOps=["\u2212","-","\u2010","\u2011","+"],this.factory_=new Hm,Cg.updateFactory(this.factory_)}implicitNode_(t){const e=Lg.getInstance().factory_.makeMultipleContentNodes(t.length-1,lm.invisibleTimes);Lg.matchSpaces_(t,e);const s=Lg.getInstance().infixNode_(t,e[0]);return s.role=sm.IMPLICIT,e.forEach((function(t){t.parent=s})),s.contentNodes=e,s}infixNode_(t,e){let s=Lg.getInstance().factory_.makeBranchNode(tm.INFIXOP,t,[e],Bm(e).textContent);return s.role=e.role,s=Cg.run("propagateInterval",s),Cg.run("propagateSimpleFunction",s)}explicitMixed_(t){const e=Um(t,(function(t){return t.textContent===lm.invisiblePlus}));if(!e.rel.length)return t;let s=[];for(let t,i=0;t=e.rel[i];i++){const r=e.comp[i],n=e.comp[i+1],o=r.length-1;if(r[o]&&n[0]&&Vm(r[o],tm.NUMBER)&&!Xm(r[o],sm.MIXED)&&Vm(n[0],tm.FRACTION)){const t=Lg.getInstance().factory_.makeBranchNode(tm.NUMBER,[r[o],n[0]],[]);t.role=sm.MIXED,s=s.concat(r.slice(0,o)),s.push(t),n.shift()}else s=s.concat(r),s.push(t)}return s.concat(e.comp[e.comp.length-1])}concatNode_(t,e,s){if(0===e.length)return t;const i=e.map((function(t){return Bm(t).textContent})).join(" "),r=Lg.getInstance().factory_.makeBranchNode(s,[t],e,i);return e.length>1&&(r.role=sm.MULTIOP),r}prefixNode_(t,e){const s=this.splitSingles(e);let i=t;for(;s.length>0;){const t=s.pop();i=Lg.getInstance().concatNode_(i,t,tm.PREFIXOP),1===t.length&&-1!==this.splitOps.indexOf(t[0].textContent)&&(i.role=this.splitRoles.get(t[0].role))}return i}splitSingles(t){let e=0;const s=[];let i=0;for(;i<t.length;){const r=t[i];!this.splitRoles.has(r.role)||t[i-1]&&t[i-1].role===r.role||t[i+1]&&t[i+1].role===r.role||-1===this.splitOps.indexOf(r.textContent)||(s.push(t.slice(e,i)),s.push(t.slice(i,i+1)),e=i+1),i++}return e<i&&s.push(t.slice(e,i)),s}postfixNode_(t,e){return e.length?Lg.getInstance().concatNode_(t,e,tm.POSTFIXOP):t}combineUnits_(t){const e=Um(t,(function(t){return!Xm(t,sm.UNIT)}));if(t.length===e.rel.length)return e.rel;const s=[];let i,r;do{const t=e.comp.shift();i=e.rel.shift();let n=null;r=s.pop(),r&&(t.length&&bg(r)?t.unshift(r):s.push(r)),1===t.length&&(n=t.pop()),t.length>1&&(n=Lg.getInstance().implicitNode_(t),n.role=sm.UNIT),n&&s.push(n),i&&s.push(i)}while(i);return s}getMixedNumbers_(t){const e=Um(t,(function(t){return Vm(t,tm.FRACTION)&&Xm(t,sm.VULGAR)}));if(!e.rel.length)return t;let s=[];for(let t,i=0;t=e.rel[i];i++){const r=e.comp[i],n=r.length-1;if(r[n]&&Vm(r[n],tm.NUMBER)&&(Xm(r[n],sm.INTEGER)||Xm(r[n],sm.FLOAT))){const e=Lg.getInstance().factory_.makeBranchNode(tm.NUMBER,[r[n],t],[]);e.role=sm.MIXED,s=s.concat(r.slice(0,n)),s.push(e)}else s=s.concat(r),s.push(t)}return s.concat(e.comp[e.comp.length-1])}getTextInRow_(t){if(0===t.length)return t;if(1===t.length)return t[0].type===tm.TEXT&&t[0].role===sm.UNKNOWN&&(t[0].role=sm.ANNOTATION),t;const{rel:e,comp:s}=Um(t,(t=>Vm(t,tm.TEXT)&&!t.annotation.factor));if(0===e.length)return t;const i=[];let r=s.shift();for(;e.length>0;){let t=e.shift(),n=s.shift();const o=[];for(;!n.length&&e.length&&t.role!==sm.SPACE&&e[0].role!==sm.SPACE;)o.push(t),t=e.shift(),n=s.shift();if(o.length&&(o.push(t),t=Lg.getInstance().dummyNode_(o)),t.role!==sm.UNKNOWN){const e=Ig(r,t,n);if(e){r=e;continue}r.length&&i.push(Lg.getInstance().row(r)),i.push(t),r=n;continue}const a=dm.Meaning.get(t.textContent);if(a.type!==tm.UNKNOWN){t.type=a.type,t.role=a.role,t.font=a.font,t.addAnnotation("general","text"),r.push(t),r=r.concat(n);continue}if(Lg.meaningFromContent(t,((t,e,s)=>{if(t.role===sm.UNKNOWN){if(Lg.numberRole_(t,e,s),t.role===sm.OTHERNUMBER)return s.some((t=>t.type!==tm.NUMBER&&t.type!==tm.IDENTIFIER))?(t.type=tm.TEXT,void(t.role=sm.ANNOTATION)):void(t.role=sm.UNKNOWN);t.type=tm.NUMBER}})),t.role===sm.UNKNOWN&&(e.length||n.length?n.length&&n[0].type===tm.FENCED?(t.type=tm.FUNCTION,t.role=sm.PREFIXFUNC):t.role=sm.TEXT:(t.type=tm.IDENTIFIER,t.role=sm.UNIT)),t.type!==tm.TEXT){r.push(t),r=r.concat(n);continue}const l=Ig(r,t,n);l?r=l:(r.length&&i.push(Lg.getInstance().row(r)),i.push(t),r=n)}return r.length>0&&i.push(Lg.getInstance().row(r)),i.length>1?[Lg.getInstance().dummyNode_(i)]:i}relationsInRow_(t){const e=Um(t,eg),s=e.rel[0];if(!s)return Lg.getInstance().operationsInRow_(t);if(1===t.length)return t[0];const i=e.comp.map(Lg.getInstance().operationsInRow_);let r;return e.rel.some((function(t){return!t.equals(s)}))?(r=Lg.getInstance().factory_.makeBranchNode(tm.MULTIREL,i,e.rel),e.rel.every((function(t){return t.role===s.role}))&&(r.role=s.role),r):(r=Lg.getInstance().factory_.makeBranchNode(tm.RELSEQ,i,e.rel,Bm(s).textContent),r.role=s.role,r)}operationsInRow_(t){if(0===t.length)return Lg.getInstance().factory_.makeEmptyNode();if(1===(t=Lg.getInstance().explicitMixed_(t)).length)return t[0];const e=[];for(;t.length>0&&tg(t[0]);)e.push(t.shift());if(0===t.length)return Lg.getInstance().prefixNode_(e.pop(),e);if(1===t.length)return Lg.getInstance().prefixNode_(t[0],e);const s=Fm(t=Cg.run("convert_juxtaposition",t),tg),i=Lg.getInstance().wrapFactor(e,s);return Lg.getInstance().addFactor(i,s)}wrapPostfix(t){var e;(null===(e=t.div)||void 0===e?void 0:e.role)===sm.POSTFIXOP&&(t.tail.length&&t.tail[0].type!==tm.OPERATOR?t.div.role=sm.DIVISION:(t.head=[Lg.getInstance().postfixNode_(Lg.getInstance().implicitNode(t.head),[t.div])],t.div=t.tail.shift(),Lg.getInstance().wrapPostfix(t)))}wrapFactor(t,e){return Lg.getInstance().wrapPostfix(e),Lg.getInstance().prefixNode_(Lg.getInstance().implicitNode(e.head),t)}addFactor(t,e){return e.div?Lg.getInstance().operationsTree_(e.tail,t,e.div):(xg(t)&&(t.role=sm.UNIT),t)}operationsTree_(t,e,s,i=[]){if(0===t.length){if(i.unshift(s),e.type===tm.INFIXOP){const t=Lg.getInstance().postfixNode_(e.childNodes.pop(),i);return e.appendChild(t),e}return Lg.getInstance().postfixNode_(e,i)}const r=Fm(t,tg);if(0===r.head.length)return i.push(r.div),Lg.getInstance().operationsTree_(r.tail,e,s,i);const n=Lg.getInstance().wrapFactor(i,r),o=Lg.getInstance().appendOperand_(e,s,n);return Lg.getInstance().addFactor(o,r)}appendOperand_(t,e,s){if(t.type!==tm.INFIXOP)return Lg.getInstance().infixNode_([t,s],e);const i=Lg.getInstance().appendDivisionOp_(t,e,s);return i||(Lg.getInstance().appendExistingOperator_(t,e,s)?t:e.role===sm.MULTIPLICATION?Lg.getInstance().appendMultiplicativeOp_(t,e,s):Lg.getInstance().appendAdditiveOp_(t,e,s))}appendDivisionOp_(t,e,s){return e.role===sm.DIVISION?yg(t)?Lg.getInstance().infixNode_([t,s],e):Lg.getInstance().appendLastOperand_(t,e,s):t.role===sm.DIVISION?Lg.getInstance().infixNode_([t,s],e):null}appendLastOperand_(t,e,s){let i=t,r=t.childNodes[t.childNodes.length-1];for(;r&&r.type===tm.INFIXOP&&!yg(r);)i=r,r=i.childNodes[t.childNodes.length-1];const n=Lg.getInstance().infixNode_([i.childNodes.pop(),s],e);return i.appendChild(n),t}appendMultiplicativeOp_(t,e,s){if(yg(t))return Lg.getInstance().infixNode_([t,s],e);let i=t,r=t.childNodes[t.childNodes.length-1];for(;r&&r.type===tm.INFIXOP&&!yg(r);)i=r,r=i.childNodes[t.childNodes.length-1];const n=Lg.getInstance().infixNode_([i.childNodes.pop(),s],e);return i.appendChild(n),t}appendAdditiveOp_(t,e,s){return Lg.getInstance().infixNode_([t,s],e)}appendExistingOperator_(t,e,s){return!(!t||t.type!==tm.INFIXOP||yg(t))&&(t.contentNodes[0].equals(e)?(t.appendContentNode(e),t.appendChild(s),!0):Lg.getInstance().appendExistingOperator_(t.childNodes[t.childNodes.length-1],e,s))}getFencesInRow_(t){let e=Um(t,ig);e=Lg.purgeFences_(e);const s=e.comp.shift();return Lg.getInstance().fences_(e.rel,e.comp,[],[s])}fences_(t,e,s,i){if(0===t.length&&0===s.length)return i[0];const r=Cg.run("bracketed_interval",[t[0],t[1],...e[0]||[]],(()=>null));if(r){t.shift(),t.shift(),e.shift();const n=i.pop()||[];return i.push([...n,r,...e.shift()]),Lg.getInstance().fences_(t,e,s,i)}const n=t=>Xm(t,sm.OPEN);if(0===t.length){const t=i.shift();for(;s.length>0;){if(n(s[0])){const e=s.shift();Lg.fenceToPunct_(e),t.push(e)}else{const e=Fm(s,n),r=e.head.length-1,o=Lg.getInstance().neutralFences_(e.head,i.slice(0,r));i=i.slice(r),t.push(...o),e.div&&e.tail.unshift(e.div),s=e.tail}t.push(...i.shift())}return t}const o=s[s.length-1],a=t[0].role;if(a===sm.OPEN||Ag(t[0])&&(!o||!vg(t[0],o))){s.push(t.shift());const r=e.shift();return r&&i.push(r),Lg.getInstance().fences_(t,e,s,i)}if(o&&a===sm.CLOSE&&o.role===sm.OPEN){const r=Lg.getInstance().horizontalFencedNode_(s.pop(),t.shift(),i.pop());return i.push(i.pop().concat([r],e.shift())),Lg.getInstance().fences_(t,e,s,i)}if(o&&vg(t[0],o)){if(!_g(o)||!wg(t[0])){s.push(t.shift());const r=e.shift();return r&&i.push(r),Lg.getInstance().fences_(t,e,s,i)}const r=Lg.getInstance().horizontalFencedNode_(s.pop(),t.shift(),i.pop());return i.push(i.pop().concat([r],e.shift())),Lg.getInstance().fences_(t,e,s,i)}if(o&&a===sm.CLOSE&&Ag(o)&&s.some(n)){const r=Fm(s,n,!0),o=i.pop(),a=i.length-r.tail.length+1,l=Lg.getInstance().neutralFences_(r.tail,i.slice(a));i=i.slice(0,a);const c=Lg.getInstance().horizontalFencedNode_(r.div,t.shift(),i.pop().concat(l,o));return i.push(i.pop().concat([c],e.shift())),Lg.getInstance().fences_(t,e,r.head,i)}const l=t.shift();return Lg.fenceToPunct_(l),i.push(i.pop().concat([l],e.shift())),Lg.getInstance().fences_(t,e,s,i)}neutralFences_(t,e){if(0===t.length)return t;if(1===t.length)return Lg.fenceToPunct_(t[0]),t;const s=t.shift();if(!_g(s)){Lg.fenceToPunct_(s);const i=e.shift();return i.unshift(s),i.concat(Lg.getInstance().neutralFences_(t,e))}const i=Fm(t,(function(t){return vg(t,s)}));if(!i.div){Lg.fenceToPunct_(s);const i=e.shift();return i.unshift(s),i.concat(Lg.getInstance().neutralFences_(t,e))}if(!wg(i.div))return Lg.fenceToPunct_(i.div),t.unshift(s),Lg.getInstance().neutralFences_(t,e);const r=Lg.getInstance().combineFencedContent_(s,i.div,i.head,e);if(i.tail.length>0){const t=r.shift(),e=Lg.getInstance().neutralFences_(i.tail,r);return t.concat(e)}return r[0]}combineFencedContent_(t,e,s,i){if(0===s.length){const s=Lg.getInstance().horizontalFencedNode_(t,e,i.shift());return i.length>0?i[0].unshift(s):i=[[s]],i}const r=i.shift(),n=s.length-1,o=i.slice(0,n),a=(i=i.slice(n)).shift(),l=Lg.getInstance().neutralFences_(s,o);r.push(...l),r.push(...a);const c=Lg.getInstance().horizontalFencedNode_(t,e,r);return i.length>0?i[0].unshift(c):i=[[c]],i}horizontalFencedNode_(t,e,s){const i=Lg.getInstance().row(s);let r=Lg.getInstance().factory_.makeBranchNode(tm.FENCED,[i],[t,e]);return t.role===sm.OPEN?(Lg.getInstance().classifyHorizontalFence_(r),r=Cg.run("propagateComposedFunction",r)):r.role=t.role,r=Cg.run("detect_cycle",r),Lg.rewriteFencedNode_(r)}classifyHorizontalFence_(t){if(Cg.run("interval_heuristic",t),t.role===sm.INTERVAL)return;t.role=sm.LEFTRIGHT;const e=t.childNodes;if(!function(t){return function(t){return!!t&&-1!==["{","\ufe5b","\uff5b"].indexOf(t.textContent)}(t.contentNodes[0])&&function(t){return!!t&&-1!==["}","\ufe5c","\uff5d"].indexOf(t.textContent)}(t.contentNodes[1])}(t)||e.length>1)return;if(0===e.length||e[0].type===tm.EMPTY)return void(t.role=sm.SETEMPTY);const s=e[0].type;if(1===e.length&&fg(e[0]))return void(t.role=sm.SETSINGLE);const i=e[0].role;if(s===tm.PUNCTUATED&&i===sm.SEQUENCE){if(e[0].contentNodes[0].role!==sm.COMMA)return 1!==e[0].contentNodes.length||e[0].contentNodes[0].role!==sm.VBAR&&e[0].contentNodes[0].role!==sm.COLON?void 0:(t.role=sm.SETEXT,void Lg.getInstance().setExtension_(t));t.role=sm.SETCOLLECT}}setExtension_(t){const e=t.childNodes[0].childNodes[0];e&&e.type===tm.INFIXOP&&1===e.contentNodes.length&&Tg(e.contentNodes[0])&&(e.addAnnotation("set","intensional"),e.contentNodes[0].addAnnotation("set","intensional"))}getPunctuationInRow_(t){if(t.length<=1)return t;const e=t=>{const e=t.type;return"punctuation"===e||"text"===e||"operator"===e||"relation"===e},s=Um(t,(function(s){if(!sg(s))return!1;if(sg(s)&&!Xm(s,sm.ELLIPSIS))return!0;const i=t.indexOf(s);if(0===i)return!t[1]||!e(t[1]);const r=t[i-1];if(i===t.length-1)return!e(r);const n=t[i+1];return!e(r)||!e(n)}));if(0===s.rel.length)return t;let i=[],r=s.comp.shift();r.length>0&&i.push(Lg.getInstance().row(r));let n=0;for(;s.comp.length>0;){let t=[];const e=n;do{t.push(s.rel[n++]),r=s.comp.shift()}while(s.rel[n]&&r&&0===r.length);t=Cg.run("ellipses",t),s.rel.splice(e,n-e,...t),n=e+t.length,i=i.concat(t),r&&r.length>0&&i.push(Lg.getInstance().row(r))}return 1===i.length&&1===s.rel.length?i:[Lg.getInstance().punctuatedNode_(i,s.rel)]}punctuatedNode_(t,e){const s=Lg.getInstance().factory_.makeBranchNode(tm.PUNCTUATED,t,e);if(e.length===t.length){const t=e[0].role;if(t!==sm.UNKNOWN&&e.every((function(e){return e.role===t})))return s.role=t,s}const i=e[0];return ug(t,e,0)?s.role=i.childNodes.length&&!i.embellished?i.role:sm.STARTPUNCT:ug(t,e,t.length-1)?s.role=i.childNodes.length&&!i.embellished?i.role:sm.ENDPUNCT:e.every((t=>Xm(t,sm.DUMMY)))?s.role=sm.TEXT:e.every((t=>Xm(t,sm.SPACE)))?s.role=sm.SPACE:s.role=sm.SEQUENCE,s}dummyNode_(t){const e=Lg.getInstance().factory_.makeMultipleContentNodes(t.length-1,lm.invisibleComma);return e.forEach((function(t){t.role=sm.DUMMY})),Lg.getInstance().punctuatedNode_(t,e)}accentRole_(t,e){if(!zm(t))return!1;const s=t.textContent,i=dm.Secondary.get(s,om.BAR)||dm.Secondary.get(s,om.TILDE)||t.role;return t.role=e===tm.UNDERSCORE?sm.UNDERACCENT:sm.OVERACCENT,t.addAnnotation("accent",i),!0}accentNode_(t,e,s,i,r){const n=(e=e.slice(0,i+1))[1],o=e[2];let a;if(!r&&o&&(a=Lg.getInstance().factory_.makeBranchNode(tm.SUBSCRIPT,[t,n],[]),a.role=sm.SUBSUP,e=[a,o],s=tm.SUPERSCRIPT),r){const i=Lg.getInstance().accentRole_(n,s);if(o){Lg.getInstance().accentRole_(o,tm.OVERSCORE)&&!i?(a=Lg.getInstance().factory_.makeBranchNode(tm.OVERSCORE,[t,o],[]),e=[a,n],s=tm.UNDERSCORE):(a=Lg.getInstance().factory_.makeBranchNode(tm.UNDERSCORE,[t,n],[]),e=[a,o],s=tm.OVERSCORE),a.role=sm.UNDEROVER}}return Lg.getInstance().makeLimitNode_(t,e,a,s)}makeLimitNode_(t,e,s,i){if(i===tm.LIMUPPER&&t.type===tm.LIMLOWER)return t.childNodes.push(e[1]),e[1].parent=t,t.type=tm.LIMBOTH,t;if(i===tm.LIMLOWER&&t.type===tm.LIMUPPER)return t.childNodes.splice(1,-1,e[1]),e[1].parent=t,t.type=tm.LIMBOTH,t;const r=Lg.getInstance().factory_.makeBranchNode(i,e,[]),n=Zm(t);return s&&(s.embellished=n),r.embellished=n,r.role=t.role,r}getFunctionsInRow_(t,e){const s=e||[];if(0===t.length)return s;const i=t.shift(),r=Lg.classifyFunction_(i,t);if(!r)return s.push(i),Lg.getInstance().getFunctionsInRow_(t,s);const n=Lg.getInstance().getFunctionsInRow_(t,[]),o=Lg.getInstance().getFunctionArgs_(i,n,r);return s.concat(o)}getFunctionArgs_(t,e,s){let i,r,n;switch(s){case"integral":{const s=Lg.getInstance().getIntegralArgs_(e);if(!s.intvar&&!s.integrand.length)return s.rest.unshift(t),s.rest;const i=Lg.getInstance().row(s.integrand);return n=Lg.getInstance().integralNode_(t,i,s.intvar),Cg.run("intvar_from_fraction",n),s.rest.unshift(n),s.rest}case"prefix":if(e[0]&&e[0].type===tm.FENCED){const s=e.shift();return Ag(s)||(s.role=sm.LEFTRIGHT),n=Lg.getInstance().functionNode_(t,s),e.unshift(n),e}if(i=Fm(e,Km),i.head.length)r=Lg.getInstance().row(i.head),i.div&&i.tail.unshift(i.div);else{if(!i.div||!Vm(i.div,tm.APPL))return e.unshift(t),e;r=i.div}return n=Lg.getInstance().functionNode_(t,r),i.tail.unshift(n),i.tail;case"bigop":return i=Fm(e,Jm),i.head.length?(r=Lg.getInstance().row(i.head),n=Lg.getInstance().bigOpNode_(t,r),i.div&&i.tail.unshift(i.div),i.tail.unshift(n),i.tail):(e.unshift(t),e);default:{if(0===e.length)return[t];const s=e[0];return s.type===tm.FENCED&&!Ag(s)&&function(t){const e=t.childNodes;if(0===e.length)return!0;if(e.length>1)return!1;const s=e[0];if(s.type===tm.INFIXOP){if(s.role!==sm.IMPLICIT)return!1;if(s.childNodes.some((t=>Vm(t,tm.INFIXOP))))return!1}return!0}(s)?(s.role=sm.LEFTRIGHT,Lg.propagateFunctionRole_(t,sm.SIMPLEFUNC),n=Lg.getInstance().functionNode_(t,e.shift()),e.unshift(n),e):(e.unshift(t),e)}}}getIntegralArgs_(t,e=[]){if(0===t.length){const t=Fm(e,Jm);return t.div&&t.tail.unshift(t.div),{integrand:t.head,intvar:null,rest:t.tail}}Cg.run("intvar_from_implicit",t);const s=t[0];if(Qm(s)){const{integrand:s,rest:i}=Lg.getInstance().getIntegralArgs_(e);return{integrand:s,intvar:null,rest:i.concat(t)}}if(Ym(s))return s.role=sm.INTEGRAL,{integrand:e,intvar:s,rest:t.slice(1)};if(t[1]&&$m(s,t[1])){const i=Lg.getInstance().prefixNode_(t[1],[s]);return i.role=sm.INTEGRAL,{integrand:e,intvar:i,rest:t.slice(2)}}return e.push(t.shift()),Lg.getInstance().getIntegralArgs_(t,e)}functionNode_(t,e){const s=Lg.getInstance().factory_.makeContentNode(lm.functionApplication),i=Lg.getInstance().funcAppls[t.id];i&&(s.mathmlTree=i.mathmlTree,s.mathml=i.mathml,s.annotation=i.annotation,s.attributes=i.attributes,delete Lg.getInstance().funcAppls[t.id]),s.type=tm.PUNCTUATION,s.role=sm.APPLICATION;const r=Lg.getFunctionOp_(t,(function(t){return Vm(t,tm.FUNCTION)||Vm(t,tm.IDENTIFIER)&&Xm(t,sm.SIMPLEFUNC)}));return Lg.getInstance().functionalNode_(tm.APPL,[t,e],r,[s])}bigOpNode_(t,e){const s=Lg.getFunctionOp_(t,(t=>Vm(t,tm.LARGEOP)));return Lg.getInstance().functionalNode_(tm.BIGOP,[t,e],s,[])}integralNode_(t,e,s){e=e||Lg.getInstance().factory_.makeEmptyNode(),s=s||Lg.getInstance().factory_.makeEmptyNode();const i=Lg.getFunctionOp_(t,(t=>Vm(t,tm.LARGEOP)));return Lg.getInstance().functionalNode_(tm.INTEGRAL,[t,e,s],i,[])}functionalNode_(t,e,s,i){const r=e[0];let n;s&&(n=s.parent,i.push(s));const o=Lg.getInstance().factory_.makeBranchNode(t,e,i);return o.role=r.role,n&&(s.parent=n),o}fractionNode_(t,e){const s=Lg.getInstance().factory_.makeBranchNode(tm.FRACTION,[t,e],[]);return s.role=s.childNodes.every((function(t){return Vm(t,tm.NUMBER)&&Xm(t,sm.INTEGER)}))?sm.VULGAR:s.childNodes.every(Eg)?sm.UNIT:sm.DIVISION,Cg.run("propagateSimpleFunction",s)}scriptNode_(t,e,s){let i;switch(t.length){case 0:i=Lg.getInstance().factory_.makeEmptyNode();break;case 1:if(i=t[0],s)return i;break;default:i=Lg.getInstance().dummyNode_(t),i.addAnnotation("general","script")}return i.role=e,i}findNestedRow_(t,e,s,i){if(s>3)return null;for(let r,n=0;r=t[n];n++){const t=Pp(r);if(t!==_m.MSPACE){if(t===_m.MROW)return Lg.getInstance().findNestedRow_(Ip(r.childNodes),e,s+1,i);if(Lg.findSemantics(r,e,i))return r}}return null}}function Ig(t,e,s){const i=t[t.length-1];if(i&&(i.type===tm.RELATION||i.type===tm.OPERATOR))return e.addAnnotation("factor",i.type),[...t,e,...s];const r=s[0];return!r||r.type!==tm.RELATION&&r.type!==tm.OPERATOR?null:(e.addAnnotation("factor",r.type),[...t,e,...s])}Lg.FENCE_TO_PUNCT_={[sm.METRIC]:sm.METRIC,[sm.NEUTRAL]:sm.VBAR,[sm.OPEN]:sm.OPENFENCE,[sm.CLOSE]:sm.CLOSEFENCE},Lg.MML_TO_LIMIT_={[_m.MSUB]:{type:tm.LIMLOWER,length:1},[_m.MUNDER]:{type:tm.LIMLOWER,length:1},[_m.MSUP]:{type:tm.LIMUPPER,length:1},[_m.MOVER]:{type:tm.LIMUPPER,length:1},[_m.MSUBSUP]:{type:tm.LIMBOTH,length:2},[_m.MUNDEROVER]:{type:tm.LIMBOTH,length:2}},Lg.MML_TO_BOUNDS_={[_m.MSUB]:{type:tm.SUBSCRIPT,length:1,accent:!1},[_m.MSUP]:{type:tm.SUPERSCRIPT,length:1,accent:!1},[_m.MSUBSUP]:{type:tm.SUBSCRIPT,length:2,accent:!1},[_m.MUNDER]:{type:tm.UNDERSCORE,length:1,accent:!0},[_m.MOVER]:{type:tm.OVERSCORE,length:1,accent:!0},[_m.MUNDEROVER]:{type:tm.UNDERSCORE,length:2,accent:!0}},Lg.CLASSIFY_FUNCTION_={[sm.INTEGRAL]:"integral",[sm.SUM]:"bigop",[sm.PREFIXFUNC]:"prefix",[sm.LIMFUNC]:"prefix",[sm.SIMPLEFUNC]:"prefix",[sm.COMPFUNC]:"prefix"},Lg.MATHJAX_FONTS={"-tex-caligraphic":rm.CALIGRAPHIC,"-tex-caligraphic-bold":rm.CALIGRAPHICBOLD,"-tex-calligraphic":rm.CALIGRAPHIC,"-tex-calligraphic-bold":rm.CALIGRAPHICBOLD,"-tex-oldstyle":rm.OLDSTYLE,"-tex-oldstyle-bold":rm.OLDSTYLEBOLD,"-tex-mathit":rm.ITALIC};class Rg extends Wm{static getAttribute_(t,e,s){if(!t.hasAttribute(e))return s;const i=t.getAttribute(e);return i.match(/^\s*$/)?null:i}constructor(t){super("MathML"),this.options=t,Cg.options=t,this.parseMap_=new Map([[_m.SEMANTICS,this.semantics_.bind(this)],[_m.MATH,this.rows_.bind(this)],[_m.MROW,this.rows_.bind(this)],[_m.MPADDED,this.rows_.bind(this)],[_m.MSTYLE,this.rows_.bind(this)],[_m.MFRAC,this.fraction_.bind(this)],[_m.MSUB,this.limits_.bind(this)],[_m.MSUP,this.limits_.bind(this)],[_m.MSUBSUP,this.limits_.bind(this)],[_m.MOVER,this.limits_.bind(this)],[_m.MUNDER,this.limits_.bind(this)],[_m.MUNDEROVER,this.limits_.bind(this)],[_m.MROOT,this.root_.bind(this)],[_m.MSQRT,this.sqrt_.bind(this)],[_m.MTABLE,this.table_.bind(this)],[_m.MLABELEDTR,this.tableLabeledRow_.bind(this)],[_m.MTR,this.tableRow_.bind(this)],[_m.MTD,this.tableCell_.bind(this)],[_m.MS,this.text_.bind(this)],[_m.MTEXT,this.text_.bind(this)],[_m.MSPACE,this.space_.bind(this)],[_m.ANNOTATIONXML,this.text_.bind(this)],[_m.MI,this.identifier_.bind(this)],[_m.MN,this.number_.bind(this)],[_m.MO,this.operator_.bind(this)],[_m.MFENCED,this.fenced_.bind(this)],[_m.MENCLOSE,this.enclosed_.bind(this)],[_m.MMULTISCRIPTS,this.multiscripts_.bind(this)],[_m.ANNOTATION,this.empty_.bind(this)],[_m.NONE,this.empty_.bind(this)],[_m.MACTION,this.action_.bind(this)]]);const e={type:tm.IDENTIFIER,role:sm.NUMBERSET,font:rm.DOUBLESTRUCK};["C","H","N","P","Q","R","Z","\u2102","\u210d","\u2115","\u2119","\u211a","\u211d","\u2124"].forEach((t=>this.getFactory().defaultMap.set(t,e)).bind(this))}parse(t){Lg.getInstance().setNodeFactory(this.getFactory());const e=Ip(t.childNodes),s=Pp(t),i=this.parseMap_.get(s),r=(i||this.dummy_.bind(this))(t,e);return Pm(r,t),-1!==[_m.MATH,_m.MROW,_m.MPADDED,_m.MSTYLE,_m.SEMANTICS,_m.MACTION].indexOf(s)||(r.mathml.unshift(t),r.mathmlTree=t),r}semantics_(t,e){return e.length?this.parse(e[0]):this.getFactory().makeEmptyNode()}rows_(t,e){const s=t.getAttribute("semantics");if(s&&s.match("bspr_"))return Lg.proof(t,s,this.parseList.bind(this));let i;if(1===(e=Dm(e)).length)i=this.parse(e[0]),i.type!==tm.EMPTY||i.mathmlTree||(i.mathmlTree=t);else{const s=Cg.run("function_from_identifiers",t);i=s&&s!==t?s:Lg.getInstance().row(this.parseList(e))}return i.mathml.unshift(t),i}fraction_(t,e){if(!e.length)return this.getFactory().makeEmptyNode();const s=this.parse(e[0]),i=e[1]?this.parse(e[1]):this.getFactory().makeEmptyNode();return Lg.getInstance().fractionLikeNode(s,i,t.getAttribute("linethickness"),"true"===t.getAttribute("bevelled"))}limits_(t,e){return Lg.getInstance().limitNode(Pp(t),this.parseList(e))}root_(t,e){return e[1]?this.getFactory().makeBranchNode(tm.ROOT,[this.parse(e[1]),this.parse(e[0])],[]):this.sqrt_(t,e)}sqrt_(t,e){const s=this.parseList(Dm(e));return this.getFactory().makeBranchNode(tm.SQRT,[Lg.getInstance().row(s)],[])}table_(t,e){const s=t.getAttribute("semantics");if(s&&s.match("bspr_"))return Lg.proof(t,s,this.parseList.bind(this));const i=this.getFactory().makeBranchNode(tm.TABLE,this.parseList(e),[]);return i.mathmlTree=t,Lg.tableToMultiline(i)}tableRow_(t,e){const s=this.getFactory().makeBranchNode(tm.ROW,this.parseList(e),[]);return s.role=sm.TABLE,s}tableLabeledRow_(t,e){var s;if(!e.length)return this.tableRow_(t,e);const i=this.parse(e[0]);i.role=sm.LABEL,(null===(s=i.childNodes[0])||void 0===s?void 0:s.type)===tm.TEXT&&(i.childNodes[0].role=sm.LABEL);const r=this.getFactory().makeBranchNode(tm.ROW,this.parseList(e.slice(1)),[i]);return r.role=sm.TABLE,r}tableCell_(t,e){const s=this.parseList(Dm(e));let i;i=s.length?1===s.length&&Vm(s[0],tm.EMPTY)?s:[Lg.getInstance().row(s)]:[];const r=this.getFactory().makeBranchNode(tm.CELL,i,[]);return r.role=sm.TABLE,r}space_(t,e){const s=t.getAttribute("width"),i=s&&s.match(/[a-z]*$/);if(!i)return this.empty_(t,e);const r=i[0],n=parseFloat(s.slice(0,i.index)),o={cm:.4,pc:.5,em:.5,ex:1,in:.15,pt:5,mm:5}[r];if(!o||isNaN(n)||n<o)return this.empty_(t,e);const a=this.getFactory().makeUnprocessed(t);return Lg.getInstance().text(a,Pp(t))}text_(t,e){const s=this.leaf_(t,e);return t.textContent?(s.updateContent(t.textContent,!0),Lg.getInstance().text(s,Pp(t))):s}identifier_(t,e){const s=this.leaf_(t,e);return Lg.getInstance().identifierNode(s,Lg.getInstance().font(t.getAttribute("mathvariant")),t.getAttribute("class"))}number_(t,e){const s=this.leaf_(t,e);return Lg.number(s),s}operator_(t,e){const s=this.leaf_(t,e);return Lg.getInstance().operatorNode(s),s}fenced_(t,e){const s=this.parseList(Dm(e)),i=Rg.getAttribute_(t,"separators",","),r=Rg.getAttribute_(t,"open","("),n=Rg.getAttribute_(t,"close",")"),o=Lg.getInstance().mfenced(r,n,i,s);return Lg.getInstance().tablesInRow([o])[0]}enclosed_(t,e){const s=this.parseList(Dm(e)),i=this.getFactory().makeBranchNode(tm.ENCLOSE,[Lg.getInstance().row(s)],[]);return i.role=t.getAttribute("notation")||sm.UNKNOWN,i}multiscripts_(t,e){if(!e.length)return this.getFactory().makeEmptyNode();const s=this.parse(e.shift());if(!e.length)return s;const i=[],r=[],n=[],o=[];let a=!1,l=0;for(let t,s=0;t=e[s];s++)Pp(t)!==_m.MPRESCRIPTS?(a?1&l?i.push(t):r.push(t):1&l?n.push(t):o.push(t),l++):(a=!0,l=0);return Dm(i).length||Dm(r).length?Lg.getInstance().tensor(s,this.parseList(r),this.parseList(i),this.parseList(o),this.parseList(n)):Lg.getInstance().pseudoTensor(s,this.parseList(o),this.parseList(n))}empty_(t,e){return this.getFactory().makeEmptyNode()}action_(t,e){const s=e[t.hasAttribute("selection")?parseInt(t.getAttribute("selection"),10)-1:0],i=this.parse(s);return i.mathmlTree=s,i}dummy_(t,e){const s=this.getFactory().makeUnprocessed(t);return s.role=t.tagName,s.textContent=t.textContent,s}leaf_(t,e){if(1===e.length&&e[0].nodeType!==Sp.TEXT_NODE){const s=this.getFactory().makeUnprocessed(t);return s.role=e[0].tagName,Pm(s,e[0]),s}const s=this.getFactory().makeLeafNode(t.textContent,Lg.getInstance().font(t.getAttribute("mathvariant")));return t.hasAttribute("data-latex")&&dm.LatexCommands.set(t.getAttribute("data-latex"),t.textContent),s}}class Sg{constructor(t,e,s=t=>!1){this.name=t,this.apply=e,this.applicable=s}}class kg extends Sg{}class Og extends Sg{}function Mg(t,e){const s=[];for(;t.length||e.length;)t.length&&s.push(t.shift()),e.length&&s.push(e.shift());return s}const Dg="data-semantic-";var Pg;!function(t){t.ADDED="data-semantic-added",t.ALTERNATIVE="data-semantic-alternative",t.CHILDREN="data-semantic-children",t.COLLAPSED="data-semantic-collapsed",t.CONTENT="data-semantic-content",t.EMBELLISHED="data-semantic-embellished",t.FENCEPOINTER="data-semantic-fencepointer",t.FONT="data-semantic-font",t.ID="data-semantic-id",t.ANNOTATION="data-semantic-annotation",t.ATTRIBUTES="data-semantic-attributes",t.OPERATOR="data-semantic-operator",t.OWNS="data-semantic-owns",t.PARENT="data-semantic-parent",t.POSTFIX="data-semantic-postfix",t.PREFIX="data-semantic-prefix",t.ROLE="data-semantic-role",t.SPEECH="data-semantic-speech",t.STRUCTURE="data-semantic-structure",t.SUMMARY="data-semantic-summary",t.TYPE="data-semantic-type"}(Pg||(Pg={}));const Bg=[Pg.ADDED,Pg.ALTERNATIVE,Pg.CHILDREN,Pg.COLLAPSED,Pg.CONTENT,Pg.EMBELLISHED,Pg.FENCEPOINTER,Pg.FONT,Pg.ID,Pg.ANNOTATION,Pg.ATTRIBUTES,Pg.OPERATOR,Pg.OWNS,Pg.PARENT,Pg.POSTFIX,Pg.PREFIX,Pg.ROLE,Pg.SPEECH,Pg.STRUCTURE,Pg.SUMMARY,Pg.TYPE];function Fg(t){return t.map((function(t){return t.id})).join(",")}function Ug(t,e){t.setAttribute(Pg.TYPE,e.type);const s=e.allAttributes();for(let e,i=0;e=s[i];i++)t.setAttribute(Dg+e[0].toLowerCase(),e[1]);e.childNodes.length&&t.setAttribute(Pg.CHILDREN,Fg(e.childNodes)),e.contentNodes.length&&t.setAttribute(Pg.CONTENT,Fg(e.contentNodes)),e.parent&&t.setAttribute(Pg.PARENT,e.parent.id.toString());const i=e.attributesXml();i&&t.setAttribute(Pg.ATTRIBUTES,i),function(t,e){const s=[];e.role===sm.MGLYPH&&s.push("image");e.attributes.href&&s.push("link");s.length&&t.setAttribute(Pg.POSTFIX,s.join(" "))}(t,e)}function jg(){const t=Op("mrow");return t.setAttribute(Pg.ADDED,"true"),t}class qg{static fromTree(t){return qg.fromNode(t.root)}static fromNode(t){return new qg(qg.fromNode_(t))}static fromString(t){return new qg(qg.fromString_(t))}static simpleCollapseStructure(t){return"number"==typeof t}static contentCollapseStructure(t){return!!t&&!qg.simpleCollapseStructure(t)&&"c"===t[0]}static interleaveIds(t,e){return Mg(qg.collapsedLeafs(t),qg.collapsedLeafs(e))}static collapsedLeafs(...t){return t.reduce(((t,e)=>{return t.concat((s=e,qg.simpleCollapseStructure(s)?[s]:qg.contentCollapseStructure(s[1])?s.slice(2):s.slice(1)));var s}),[])}static fromStructure(t,e,s){return new qg(qg.tree_(t,e.root,s))}static combineContentChildren(t,e,s,i){switch(t){case tm.RELSEQ:case tm.INFIXOP:case tm.MULTIREL:return Mg(i,s);case tm.PREFIXOP:return s.concat(i);case tm.POSTFIXOP:return i.concat(s);case tm.MATRIX:case tm.VECTOR:case tm.FENCED:return i.unshift(s[0]),i.push(s[1]),i;case tm.CASES:return i.unshift(s[0]),i;case tm.APPL:return[i[0],s[0],i[1]];case tm.ROOT:return[i[0],i[1]];case tm.ROW:case tm.LINE:return s.length&&i.push(s[0]),i;default:return i}}static makeSexp_(t){return qg.simpleCollapseStructure(t)?t.toString():qg.contentCollapseStructure(t)?"(c "+t.slice(1).map(qg.makeSexp_).join(" ")+")":"("+t.map(qg.makeSexp_).join(" ")+")"}static fromString_(t){let e=t.replace(/\(/g,"[");return e=e.replace(/\)/g,"]"),e=e.replace(/ /g,","),e=e.replace(/c/g,'"c"'),JSON.parse(e)}static fromNode_(t){if(!t)return[];const e=t.contentNodes;let s;e.length&&(s=e.map(qg.fromNode_),s.unshift("c"));const i=t.childNodes;if(!i.length)return e.length?[t.id,s]:t.id;const r=i.map(qg.fromNode_);return e.length&&r.unshift(s),r.unshift(t.id),r}static tree_(t,e,s,i=0,r=1,n=1){if(!e)return[];const o=e.id,a=[o];!function(t){if(Ap.getInstance().mode!==op.HTTP)return;let e=t;for(;e&&!e.evaluate;)e=e.parentNode;e&&e.evaluate?_p.currentDocument=e:t.ownerDocument&&(_p.currentDocument=t.ownerDocument)}(t);const l=function(t,e){let s;try{s=Lp(t,e,_p.result.ORDERED_NODE_ITERATOR_TYPE)}catch(t){return[]}const i=[];for(let t=s.iterateNext();t;t=s.iterateNext())i.push(t);return i}(`.//self::*[@${Pg.ID}=${o}]`,t)[0];if(!e.childNodes.length)return qg.addAria(l,i,r,n,s),e.id;const c=qg.combineContentChildren(e.type,e.role,e.contentNodes.map((function(t){return t})),e.childNodes.map((function(t){return t})));l&&qg.addOwns_(l,c);for(let e,r=0,n=c.length;e=c[r];r++)a.push(qg.tree_(t,e,s,i+1,r+1,n));return qg.addAria(l,i,r,n,s),a}static addAria(t,e,s,i,r){const n=r.tree?e?"treeitem":"tree":"treeitem";r.aria&&t&&(t.setAttribute("aria-level",e.toString()),t.setAttribute("aria-posinset",s.toString()),t.setAttribute("aria-setsize",i.toString()),t.setAttribute("role",n),t.hasAttribute(Pg.OWNS)&&t.setAttribute("aria-owns",t.getAttribute(Pg.OWNS)))}static addOwns_(t,e){const s=t.getAttribute(Pg.COLLAPSED),i=s?qg.realLeafs_(qg.fromString(s).array):e.map((t=>t.id));t.setAttribute(Pg.OWNS,i.join(" "))}static realLeafs_(t){if(qg.simpleCollapseStructure(t))return[t];if(qg.contentCollapseStructure(t))return[];let e=[];for(let s=1;s<t.length;s++)e=e.concat(qg.realLeafs_(t[s]));return e}constructor(t){this.parents=null,this.levelsMap=null,t=0===t?t:t||[],this.array=t}populate(){this.parents&&this.levelsMap||(this.parents={},this.levelsMap={},this.populate_(this.array,this.array,[]))}toString(){return qg.makeSexp_(this.array)}populate_(t,e,s){if(qg.simpleCollapseStructure(t))return this.levelsMap[t]=e,void(this.parents[t]=t===s[0]?s.slice(1):s);const i=qg.contentCollapseStructure(t)?t.slice(1):t,r=[i[0]].concat(s);for(let e=0,s=i.length;e<s;e++){const s=i[e];this.populate_(s,t,r)}}isRoot(t){return t===this.levelsMap[t][0]}directChildren(t){if(!this.isRoot(t))return[];return this.levelsMap[t].slice(1).map((t=>qg.simpleCollapseStructure(t)?t:qg.contentCollapseStructure(t)?t[1]:t[0]))}subtreeNodes(t){if(!this.isRoot(t))return[];const e=(t,s)=>{qg.simpleCollapseStructure(t)?s.push(t):(qg.contentCollapseStructure(t)&&(t=t.slice(1)),t.forEach((t=>e(t,s))))},s=this.levelsMap[t],i=[];return e(s.slice(1),i),i}}function Hg(t,e,s){let i=null;if(!t.length)return i;const r=s[s.length-1],n=r&&r.length,o=e&&e.length,a=Lg.getInstance();if(n&&o){if(e[0].type===tm.INFIXOP&&e[0].role===sm.IMPLICIT)return i=t.pop(),r.push(a.postfixNode_(r.pop(),t)),i;i=t.shift();const s=a.prefixNode_(e.shift(),t);return e.unshift(s),i}return n?(r.push(a.postfixNode_(r.pop(),t)),i):(o&&e.unshift(a.prefixNode_(e.shift(),t)),i)}function Wg(t,e,s){if(!e.length)return t;const i=t.pop(),r=e.shift(),n=s.shift();if(r.type===tm.INFIXOP&&(r.role===sm.IMPLICIT||r.role===sm.UNIT)){fp.getInstance().output("Juxta Heuristic Case 2");const o=(i?[i,r]:[r]).concat(n);return Wg(t.concat(o),e,s)}if(!i)return fp.getInstance().output("Juxta Heuristic Case 3"),Wg([r].concat(n),e,s);const o=n.shift();if(!o){fp.getInstance().output("Juxta Heuristic Case 9");const n=Cg.factory.makeBranchNode(tm.INFIXOP,[i,e.shift()],[r],r.textContent);return n.role=sm.IMPLICIT,Cg.run("combine_juxtaposition",n),e.unshift(n),Wg(t,e,s)}if(tg(i)||tg(o))return fp.getInstance().output("Juxta Heuristic Case 4"),Wg(t.concat([i,r,o]).concat(n),e,s);let a=null;return Ng(i)&&Ng(o)?(fp.getInstance().output("Juxta Heuristic Case 5"),i.contentNodes.push(r),i.contentNodes=i.contentNodes.concat(o.contentNodes),i.childNodes.push(o),i.childNodes=i.childNodes.concat(o.childNodes),o.childNodes.forEach((t=>t.parent=i)),r.parent=i,i.addMathmlNodes(r.mathml),i.addMathmlNodes(o.mathml),a=i):Ng(i)?(fp.getInstance().output("Juxta Heuristic Case 6"),i.contentNodes.push(r),i.childNodes.push(o),o.parent=i,r.parent=i,i.addMathmlNodes(r.mathml),i.addMathmlNodes(o.mathml),a=i):Ng(o)?(fp.getInstance().output("Juxta Heuristic Case 7"),o.contentNodes.unshift(r),o.childNodes.unshift(i),i.parent=o,r.parent=o,o.addMathmlNodes(r.mathml),o.addMathmlNodes(i.mathml),a=o):(fp.getInstance().output("Juxta Heuristic Case 8"),a=Cg.factory.makeBranchNode(tm.INFIXOP,[i,o],[r],r.textContent),a.role=sm.IMPLICIT),t.push(a),Wg(t.concat(n),e,s)}function Vg(t){return t.childNodes[0]&&t.childNodes[0].childNodes[0]&&Pp(t.childNodes[0])===_m.MPADDED&&Pp(t.childNodes[0].childNodes[0])===_m.MPADDED&&Pp(t.childNodes[0].childNodes[t.childNodes[0].childNodes.length-1])===_m.MPHANTOM}Cg.add(new kg("combine_juxtaposition",(function(t){for(let e,s=t.childNodes.length-1;e=t.childNodes[s];s--)Ng(e)&&!e.nobreaking&&(t.childNodes.splice(s,1,...e.childNodes),t.contentNodes.splice(s,0,...e.contentNodes),e.childNodes.concat(e.contentNodes).forEach((function(e){e.parent=t})),t.addMathmlNodes(e.mathml));return t}))),Cg.add(new kg("propagateSimpleFunction",(t=>(t.type!==tm.INFIXOP&&t.type!==tm.FRACTION||!t.childNodes.every(pg)||(t.role=sm.COMPFUNC),t)),(t=>"clearspeak"===Cg.options.domain))),Cg.add(new kg("simpleNamedFunction",(t=>(t.role!==sm.UNIT&&-1!==["f","g","h","F","G","H"].indexOf(t.textContent)&&(t.role=sm.SIMPLEFUNC),t)),(t=>"clearspeak"===Cg.options.domain))),Cg.add(new kg("propagateComposedFunction",(t=>(t.type===tm.FENCED&&t.childNodes[0].role===sm.COMPFUNC&&(t.role=sm.COMPFUNC),t)),(t=>"clearspeak"===Cg.options.domain))),Cg.add(new kg("multioperator",(t=>{t.role!==sm.UNKNOWN||t.textContent.length<=1||(Lg.compSemantics(t,"role",sm),Lg.compSemantics(t,"type",tm))}))),Cg.add(new Og("convert_juxtaposition",(t=>{let e=Um(t,(function(t){return t.textContent===lm.invisibleTimes&&t.type===tm.OPERATOR}));e=e.rel.length?function(t){const e=[],s=[];let i=t.comp.shift(),r=null,n=[];for(;t.comp.length;)if(n=[],i.length)r&&e.push(r),s.push(i),r=t.rel.shift(),i=t.comp.shift();else{for(r&&n.push(r);!i.length&&t.comp.length;)i=t.comp.shift(),n.push(t.rel.shift());r=Hg(n,i,s)}n.length||i.length?(e.push(r),s.push(i)):(n.push(r),Hg(n,i,s));return{rel:e,comp:s}}(e):e,t=e.comp[0];for(let s,i,r=1;s=e.comp[r],i=e.rel[r-1];r++)t.push(i),t=t.concat(s);return e=Um(t,(function(t){return t.textContent===lm.invisibleTimes&&(t.type===tm.OPERATOR||t.type===tm.INFIXOP)})),e.rel.length?Wg(e.comp.shift(),e.rel,e.comp):t}))),Cg.add(new kg("simple2prefix",(t=>(t.textContent.length>1&&!t.textContent[0].match(/[A-Z]/)&&(t.role=sm.PREFIXFUNC),t)),(t=>"braille"===Cg.options.modality&&t.type===tm.IDENTIFIER))),Cg.add(new kg("detect_cycle",(t=>{t.type=tm.MATRIX,t.role=sm.CYCLE;const e=t.childNodes[0];return e.type=tm.ROW,e.role=sm.CYCLE,e.textContent="",e.contentNodes=[],t}),(t=>t.type===tm.FENCED&&t.childNodes[0].type===tm.INFIXOP&&t.childNodes[0].role===sm.IMPLICIT&&t.childNodes[0].childNodes.every((function(t){return t.type===tm.NUMBER}))&&t.childNodes[0].contentNodes.every((function(t){return t.role===sm.SPACE}))))),Cg.add(new Og("intvar_from_implicit",(function(t){const e=t[0].childNodes;t.splice(0,1,...e),t.forEach((t=>t.parent=null))}),(t=>t[0]&&yg(t[0])))),Cg.add(new kg("intvar_from_fraction",(function(t){const e=t.childNodes[1],s=e.childNodes[0];if(Ym(s))return void(s.role=sm.INTEGRAL);if(!yg(s))return;const i=s.childNodes.length,r=s.childNodes[i-2],n=s.childNodes[i-1];if(Ym(n))return void(n.role=sm.INTEGRAL);if($m(r,n)){const t=Lg.getInstance().prefixNode_(n,[r]);t.role=sm.INTEGRAL,2===i?e.childNodes[0]=t:(s.childNodes.pop(),s.contentNodes.pop(),s.childNodes[i-2]=t,t.parent=s)}}),(t=>{if(t.type!==tm.INTEGRAL)return!1;const[,e,s]=t.childNodes;return s.type===tm.EMPTY&&e.type===tm.FRACTION}))),Cg.add(new kg("rewrite_subcases",(function(t){t.addAnnotation("Emph","top");let e=[];if(t.hasAnnotation("Emph","left")){const s=Xg(t.childNodes[0].childNodes[0].childNodes[0],!0);s.forEach((t=>t.addAnnotation("Emph","left"))),e=e.concat(s);for(let e,s=0;e=t.childNodes[s];s++)e.childNodes.shift()}if(e.push(t),t.hasAnnotation("Emph","right")){const s=Xg(t.childNodes[0].childNodes[t.childNodes[0].childNodes.length-1].childNodes[0]);s.forEach((t=>t.addAnnotation("Emph","left"))),e=e.concat(s),t.childNodes[0].childNodes.pop()}Lg.tableToMultiline(t);const s=Lg.getInstance().row(e),i=t.annotation.Emph;return t.annotation.Emph=["table"],i.forEach((t=>s.addAnnotation("Emph",t))),s}),(t=>{let e=!0,s=!0;const i=t.childNodes[0].childNodes[0];if(!i)return!1;if(Vg(i.mathmlTree)){for(let s,i=1;s=t.childNodes[i];i++)if(s.childNodes[0].childNodes.length){e=!1;break}}else e=!1;e&&t.addAnnotation("Emph","left");if(Vg(t.childNodes[0].childNodes[t.childNodes[0].childNodes.length-1].mathmlTree)){const e=t.childNodes[0].childNodes.length;for(let i,r=1;i=t.childNodes[r];r++)if(i.childNodes.length>=e){s=!1;break}}else s=!1;return s&&t.addAnnotation("Emph","right"),e||s})));const Gg=[tm.PUNCTUATED,tm.RELSEQ,tm.MULTIREL,tm.INFIXOP,tm.PREFIXOP,tm.POSTFIXOP];function Xg(t,e){if(!t.childNodes.length)return Kg(t),[t];let s=null;if(t.type===tm.PUNCTUATED&&(e?t.role===sm.ENDPUNCT:t.role===sm.STARTPUNCT)){const i=t.childNodes;Kg(i[e?i.length-1:0])&&(t=i[e?0:i.length-1],s=i[e?i.length-1:0])}if(-1!==Gg.indexOf(t.type)){const i=t.childNodes;Kg(i[e?i.length-1:0]);const r=qg.combineContentChildren(t.type,t.role,t.contentNodes,t.childNodes);return s&&(e?r.push(s):r.unshift(s)),r}return s?e?[t,s]:[s,t]:[t]}const zg={[sm.METRIC]:sm.METRIC,[sm.VBAR]:sm.NEUTRAL,[sm.OPENFENCE]:sm.OPEN,[sm.CLOSEFENCE]:sm.CLOSE};function Kg(t){if(t.type!==tm.PUNCTUATION)return!1;const e=zg[t.role];return!!e&&(t.role=e,t.type=tm.FENCE,t.addAnnotation("Emph","fence"),!0)}function Jg(t,e,s,i=s){const r=[];for(;t&&t.role===s;)r.push(t),t=e.shift();return r.length?(t&&e.unshift(t),[1===r.length?r[0]:$g(r,i),e]):[t,e]}function $g(t,e){const s=Cg.factory.makeBranchNode(tm.PUNCTUATION,t,[]);return s.role=e,s}function Yg(t){return["[","\uff3b"].includes(t)}function Qg(t){return["]","\uff3d"].includes(t)}function Zg(t){return["(","\u207d","\u208d"].includes(t)}function tf(t){return[")","\u207e","\u208e"].includes(t)}function ef(t){return t.role===sm.INFTY||t.type===tm.PREFIXOP&&t.childNodes[0].role===sm.INFTY}function sf(t){const e=t.childNodes[0];if(t.type!==tm.FENCED||(null==e?void 0:e.type)!==tm.PUNCTUATED||3!==(null==e?void 0:e.childNodes.length)||1!==(null==e?void 0:e.contentNodes.length)||(null==e?void 0:e.childNodes[1].role)!==sm.COMMA)return!1;const s=t.childNodes[0].childNodes[0],i=t.childNodes[0].childNodes[2],r=t.contentNodes[0].textContent,n=t.contentNodes[1].textContent;return!!(Yg(r)&&tf(n)||Zg(r)&&Qg(n))||!(!Zg(r)||!tf(n)||!ef(s)&&!ef(i))}function rf(t){return lf(t)||function(t){return of(t)||t.type===tm.INFIXOP&&t.role===sm.IMPLICIT&&(2===t.childNodes.length&&(of(t.childNodes[0])||lf(t.childNodes[0]))&&of(t.childNodes[1])||3===t.childNodes.length&&lf(t.childNodes[0])&&of(t.childNodes[1])&&of(t.childNodes[2]))}(t)||function(t){return t.type===tm.PUNCTUATED&&t.role===sm.ENDPUNCT&&2===t.childNodes.length&&t.childNodes[1].role===sm.DEGREE&&(of(t.childNodes[0])||af(t.childNodes[0])||t.childNodes[0].type===tm.PREFIXOP&&t.childNodes[0].role===sm.NEGATIVE&&(of(t.childNodes[0].childNodes[0])||af(t.childNodes[0].childNodes[0])))}(t)||function(t){return t.type===tm.PREFIXOP&&t.role===sm.NEGATIVE&&nf(t.childNodes[0])&&t.childNodes[0].type!==tm.PREFIXOP&&t.childNodes[0].type!==tm.APPL&&t.childNodes[0].type!==tm.PUNCTUATED}(t)||function(t){return t.type===tm.APPL&&(t.childNodes[0].role===sm.PREFIXFUNC||t.childNodes[0].role===sm.SIMPLEFUNC)&&(nf(t.childNodes[1])||t.childNodes[1].type===tm.FENCED&&nf(t.childNodes[1].childNodes[0]))}(t)}function nf(t){return t.hasAnnotation("clearspeak","simple")}function of(t){return t.type===tm.IDENTIFIER&&(t.role===sm.LATINLETTER||t.role===sm.GREEKLETTER||t.role===sm.OTHERLETTER||t.role===sm.SIMPLEFUNC)}function af(t){return t.type===tm.NUMBER&&(t.role===sm.INTEGER||t.role===sm.FLOAT)}function lf(t){return af(t)||function(t){if(cf("Fraction_Over")||cf("Fraction_FracOver"))return!1;if(t.type!==tm.FRACTION||t.role!==sm.VULGAR)return!1;if(cf("Fraction_Ordinal"))return!0;const e=parseInt(t.childNodes[0].textContent,10),s=parseInt(t.childNodes[1].textContent,10);return e>0&&e<20&&s>0&&s<11}(t)}function cf(t){return Ap.getInstance().options.style===t}function hf(t){return t.type===tm.TEXT&&t.role!==sm.LABEL||t.type===tm.PUNCTUATED&&t.role===sm.TEXT&&af(t.childNodes[0])&&function(t){for(let e=0;e<t.length-1;e++)if(t[e].type!==tm.TEXT||""!==t[e].textContent)return!1;return t[t.length-1].type===tm.TEXT}(t.childNodes.slice(1))||t.type===tm.IDENTIFIER&&t.role===sm.UNIT||t.type===tm.INFIXOP&&(t.role===sm.IMPLICIT||t.role===sm.UNIT)}Cg.add(new Og("ellipses",(t=>{const e=[];let s=t.shift();for(;s;)[s,t]=Jg(s,t,sm.FULLSTOP,sm.ELLIPSIS),[s,t]=Jg(s,t,sm.DASH),e.push(s),s=t.shift();return e}),(t=>t.length>1))),Cg.add(new Og("op_with_limits",(t=>{const e=t[0];return e.type=tm.LARGEOP,e.role=sm.SUM,t}),(t=>t[0].type===tm.OPERATOR&&t.slice(1).some((t=>t.type===tm.RELSEQ||t.type===tm.MULTIREL||t.type===tm.INFIXOP&&t.role===sm.ELEMENT||t.type===tm.PUNCTUATED&&t.role===sm.SEQUENCE))))),Cg.add(new class extends Sg{}("function_from_identifiers",(t=>{const e=Ip(t.childNodes).map((t=>t.textContent.trim())).join("");if(dm.Meaning.get(e).type===tm.UNKNOWN)return t;const s=Cg.factory.makeLeafNode(e,Lg.getInstance().font(t.getAttribute("mathvariant")));return s.mathmlTree=t,s}),(t=>{const e=Ip(t.childNodes);return!(e.length<2)&&e.every((t=>Pp(t)===_m.MI&&dm.Meaning.get(t.textContent.trim()).role===sm.LATINLETTER))}))),Cg.add(new Og("bracketed_interval",(t=>{const e=t[0],s=t[1],i=t.slice(2),r=Lg.getInstance().row(i),n=Cg.factory.makeBranchNode(tm.FENCED,[r],[e,s]);return n.role=sm.INTERVAL,n}),(t=>{const e=t[0],s=t[1],i=t.slice(2);if(!(e&&s&&(Qg(e.textContent)&&(Yg(s.textContent)||Qg(s.textContent))||Yg(s.textContent)&&(Yg(e.textContent)||Qg(e.textContent)))))return!1;if(1===i.length&&i[0].type===tm.PUNCTUATED&&1===i[0].contentNodes.length)return!0;const r=Um(i,sg);return!(1!==r.rel.length||!r.comp[0].length||!r.comp[1].length)}))),Cg.add(new kg("interval_heuristic",(t=>(t.role=sm.INTERVAL,t)),(t=>sf(t)))),Cg.add(new kg("propagateInterval",(t=>(t.childNodes.forEach((t=>{sf(t)&&(t.role=sm.INTERVAL)})),t)),(t=>Tg(t)))),Hp(new Fp("clearspeak","simple",(function(t){return rf(t)?"simple":""}))),Wp("clearspeak","simple"),Hp(new Fp("clearspeak","unit",(function(t){return hf(t)?"unit":""}))),Wp("clearspeak","unit");const df=[tm.MULTIREL,tm.RELSEQ,tm.APPL,tm.ROW,tm.LINE],uf=[tm.SUBSCRIPT,tm.SUPERSCRIPT,tm.OVERSCORE,tm.UNDERSCORE];function pf(t,e){const s=t.parent;if(!s)return!1;const i=s.type;return-1!==df.indexOf(i)||i===tm.PREFIXOP&&s.role===sm.NEGATIVE&&!e.script&&!e.enclosed||i===tm.PREFIXOP&&s.role===sm.GEOMETRY||!(i!==tm.PUNCTUATED||e.enclosed&&s.role!==sm.TEXT)}Hp(new Up("nemeth","number",(function(t,e){return t.childNodes.length?(-1!==uf.indexOf(t.type)&&(e.script=!0),t.type===tm.FENCED?(e.number=!1,e.enclosed=!0,["",e]):t.type===tm.PREFIXOP&&t.role!==sm.GEOMETRY&&t.role!==sm.NEGATIVE?(e.number=!1,["",e]):(pf(t,e)&&(e.number=!0,e.enclosed=!1),["",e])):(pf(t,e)&&(e.number=!0,e.script=!1,e.enclosed=!1),[e.number?"number":"",{number:!1,enclosed:e.enclosed,script:e.script}])}),{number:!0})),Wp("nemeth","number"),Hp(new Up("depth","depth",(function(t){return t.parent?[parseInt(t.parent.annotation.depth[0])+1]:[1]}))),Wp("depth","depth");class mf{static empty(){const t=Rp("<math/>"),e=new mf(t,new Ep);return e.mathml=t,e}static fromNode(t,e){const s=mf.empty();return s.root=t,e&&(s.mathml=e),s}static fromRoot(t,e){let s=t;for(;s.parent;)s=s.parent;const i=mf.fromNode(s);return e&&(i.mathml=e),i}static fromXml(t){const e=mf.empty();return t.childNodes[0]&&(e.root=qm.fromXml(t.childNodes[0])),e}constructor(t,e){this.mathml=t,this.options=e,this.parser=new Rg(e),this.root=this.parser.parse(t),this.collator=this.parser.getFactory().leafMap.collateMeaning();const s=this.collator.newDefault();s&&(this.parser=new Rg(e),this.parser.getFactory().defaultMap=s,this.root=this.parser.parse(t)),gf.visit(this.root,{}),function(t){for(const e of jp.values())e.active&&e.annotate(t);for(const e of qp.values())e.active&&e.visit(t,Object.assign({},e.def))}(this.root)}xml(t){const e=Rp("<stree></stree>"),s=this.root.xml(e.ownerDocument,t);return e.appendChild(s),e}toString(t){return Bp(this.xml(t))}formatXml(t){return Mp(this.toString(t))}displayTree(){this.root.displayTree()}replaceNode(t,e){const s=t.parent;s?s.replaceChild(t,e):this.root=e}toJson(){const t={};return t.stree=this.root.toJson(),t}}const gf=new Up("general","unit",((t,e)=>(xg(t)&&(t.role=sm.UNIT),!1)));function ff(t,e){return new mf(t,e)}const bf=[],Ef=!0,xf=new Map;function yf(t){fp.getInstance().generate((()=>["WALKING START: ",t.toString()]));const e=function(t){for(let e,s=0;e=bf[s];s++)if(e.test(t))return e.constr(t);return null}(t);let s;if(e)return s=e.getMathml(),fp.getInstance().generate((()=>["WALKING END: ",t.toString()])),Of(s);if(1===t.mathml.length){if(fp.getInstance().output("Walktree Case 0"),!t.childNodes.length)return fp.getInstance().output("Walktree Case 0.1"),s=t.mathml[0],Ug(s,t),fp.getInstance().generate((()=>["WALKING END: ",t.toString()])),Of(s);const e=t.childNodes[0];if(1===t.childNodes.length&&e.type===tm.EMPTY)return fp.getInstance().output("Walktree Case 0.2"),s=t.mathml[0],Ug(s,t),s.appendChild(yf(e)),fp.getInstance().generate((()=>["WALKING END: ",t.toString()])),Of(s);t.childNodes.forEach((t=>{t.mathml.length||(t.mathml=[qf(t)])}))}const i=t.contentNodes.map(Uf);Hf(t,i);const r=t.childNodes.map(yf),n=qg.combineContentChildren(t.type,t.role,i,r);if(s=t.mathmlTree,null===s)fp.getInstance().output("Walktree Case 1"),s=Nf(n,t);else{const t=Rf(n);fp.getInstance().output("Walktree Case 2"),t?(fp.getInstance().output("Walktree Case 2.1"),s=Bf(t)):(fp.getInstance().output("Walktree Case 2.2"),s=Wf(s))}return s=jf(s),function(t,e,s){if(!e.length)return;if(1===e.length&&t===e[0])return;const i=s.role===sm.IMPLICIT&&Cg.flags.combine_juxtaposition?function(t,e,s){const i=[];let r=Ip(t.childNodes),n=!1;for(;r.length;){const t=r.shift();if(t.hasAttribute(Pg.TYPE)){i.push(t);continue}const s=vf(t,e);0!==s.length&&(1!==s.length?(n?t.setAttribute("AuxiliaryImplicit",!0):n=!0,r=s.concat(r)):i.push(t))}const o=[],a=s.childNodes.map((function(t){return t.mathmlTree}));for(;a.length;){const t=a.pop();if(t){if(-1!==i.indexOf(t))break;-1!==e.indexOf(t)&&o.unshift(t)}}return i.concat(o)}(t,e,s):Ip(t.childNodes);if(!i.length)return void e.forEach((function(e){t.appendChild(e)}));let r=0;for(;e.length;){const s=e[0];if(i[r]===s||Lf(i[r],s)){e.shift(),r++;continue}if(i[r]&&-1===e.indexOf(i[r])){r++;continue}if(Cf(s,t)){e.shift();continue}const n=i[r];if(n)_f(t,n,s),e.shift();else{if(s.parentNode){t=Bf(s),e.shift();continue}const i=e[1];if(i&&i.parentNode){wf(t=Bf(i),s,i),e.shift(),e.shift();continue}wf(t,s,null),e.shift()}}}(s,n,t),xf.has(t.id)||(xf.set(t.id,!0),Ug(s,t)),fp.getInstance().generate((()=>["WALKING END: ",t.toString()])),Of(s)}function Nf(t,e){const s=function(t){const e=Rf(t);if(!e)return{type:If.INVALID,node:null};const s=Rf(t.slice().reverse());if(e===s)return{type:If.VALID,node:e};const i=Sf(e),r=function(t,e){let s=0;for(;t[s]&&-1===e.indexOf(t[s]);)s++;return t.slice(0,s+1)}(i,t),n=Sf(s,(function(t){return-1!==r.indexOf(t)})),o=n[0],a=r.indexOf(o);if(-1===a)return{type:If.INVALID,node:null};return{type:r.length!==i.length?If.PRUNED:kf(r[a+1],n[1])?If.VALID:If.INVALID,node:o}}(t);let i=s.node;const r=s.type;if(r!==If.VALID||!Om(i)||!i.parentNode&&e.parent)if(fp.getInstance().output("Walktree Case 1.1"),i=jg(),r===If.PRUNED)fp.getInstance().output("Walktree Case 1.1.0"),i=function(t,e,s){let i=Mf(e);if(Sm(i)){fp.getInstance().output("Walktree Case 1.1.0.0"),Af(i,t),Ip(i.childNodes).forEach((function(e){t.appendChild(e)}));const e=t;t=i,i=e}const r=s.indexOf(e);return s[r]=i,kp(i,t),t.appendChild(i),s.forEach((function(e){t.appendChild(e)})),t}(i,s.node,t);else if(t[0]){fp.getInstance().output("Walktree Case 1.1.1");const e=Rf(t);if(e){const s=function(t,e){const s=Ip(t.childNodes);let i=1/0,r=-1/0;return e.forEach((function(t){const e=s.indexOf(t);-1!==e&&(i=Math.min(i,e),r=Math.max(r,e))})),s.slice(i,r+1)}(Bf(e),t);kp(e,i),s.forEach((function(t){i.appendChild(t)}))}else Af(i,t[0]),i=t[0]}return e.mathmlTree||(e.mathmlTree=i),i}function Af(t,e){for(const s of Bg)t.hasAttribute(s)&&(e.setAttribute(s,t.getAttribute(s)),t.removeAttribute(s))}function vf(t,e){const s=[];let i=Ip(t.childNodes);for(;i.length;){const t=i.shift();t.nodeType===Sp.ELEMENT_NODE&&(t.hasAttribute(Pg.TYPE)||-1!==e.indexOf(t)?s.push(t):i=Ip(t.childNodes).concat(i))}return s}function _f(t,e,s){let i=e,r=Bf(i);for(;r&&Tf(r,i)&&!i.hasAttribute("AuxiliaryImplicit")&&r!==t;)i=r,r=Bf(i);r&&(wf(r,s,i),i.removeAttribute("AuxiliaryImplicit"))}function wf(t,e,s){Pp(t)===_m.MACTION?wf(Bf(t),e,t):t.insertBefore(e,s)}function Tf(t,e){if(Pp(t)!==_m.MACTION)return t.firstChild===e;const s=parseInt(t.getAttribute("selection"))||1;return t.childNodes[s-1]===e}function Cf(t,e){if(!t)return!1;do{if((t=Bf(t))===e)return!0}while(t);return!1}function Lf(t,e){const s=lm.functionApplication;if(t&&e&&t.textContent&&e.textContent&&t.textContent===s&&e.textContent===s&&"true"===e.getAttribute(Pg.ADDED)){for(let s,i=0;s=t.attributes[i];i++)e.hasAttribute(s.nodeName)||e.setAttribute(s.nodeName,s.nodeValue);return kp(t,e),!0}return!1}var If;function Rf(t){let e=0,s=null;for(;!s&&e<t.length;)t[e].parentNode&&(s=t[e]),e++;return s}function Sf(t,e){const s=e||(t=>!1),i=[t];for(;!s(t)&&!Sm(t)&&t.parentNode;)t=Bf(t),i.unshift(t);return i}function kf(t,e){return!(!t||!e||t.previousSibling||e.nextSibling)}function Of(t){for(;!Sm(t)&&Df(t);)t=Bf(t);return t}function Mf(t){const e=Ip(t.childNodes);if(!e)return t;const s=e.filter((function(t){return t.nodeType===Sp.ELEMENT_NODE&&!km(t)}));return 1===s.length&&Om(s[0])&&!s[0].hasAttribute(Pg.TYPE)?Mf(s[0]):t}function Df(t){const e=Bf(t);return!(!e||!Om(e))&&Ip(e.childNodes).every((function(e){return e===t||Pf(e)}))}function Pf(t){if(t.nodeType!==Sp.ELEMENT_NODE)return!0;if(!t||km(t))return!0;const e=Ip(t.childNodes);return!(!Om(t)&&e.length||function(t){return!!t&&Im.includes(Pp(t))}(t)||t.hasAttribute(Pg.TYPE)||Mm(t))&&Ip(t.childNodes).every(Pf)}function Bf(t){return t.parentNode}function Ff(t,e){const s=new qg(e);t.setAttribute(Pg.COLLAPSED,s.toString())}function Uf(t){if(t.mathml.length)return yf(t);const e=Ef?qf(t):jg();return t.mathml=[e],e}function jf(t){if(Pp(t)!==_m.MFENCED)return t;const e=jg();for(let s,i=0;s=t.attributes[i];i++)-1===["open","close","separators"].indexOf(s.name)&&e.setAttribute(s.name,s.value);return Ip(t.childNodes).forEach((function(t){e.appendChild(t)})),kp(t,e),e}function qf(t){const e=Op("mo"),s=(i=t.textContent,mp.f.document.createTextNode(i));var i;return e.appendChild(s),Ug(e,t),e.setAttribute(Pg.ADDED,"true"),e}function Hf(t,e){const s=t.type+(t.textContent?","+t.textContent:"");e.forEach((function(t){Wf(t).setAttribute(Pg.OPERATOR,s)}))}function Wf(t){const e=Ip(t.childNodes);if(!e)return t;const s=e.filter((function(t){return!Pf(t)})),i=[];for(let t,e=0;t=s[e];e++)if(Om(t)&&t.getAttribute(Pg.TYPE)!==tm.PUNCTUATION){const e=Wf(t);e&&e!==t&&i.push(e)}else i.push(t);return 1===i.length?i[0]:t}function Vf(t){return Mp(t.toString()).toString().replace(new RegExp(Dg,"g"),"")}function Gf(t,e){const s=!!e,i=e||[],r=t.parent,n=t.contentNodes.map((function(t){return t.id}));n.unshift("c");const o=[t.id,n];for(let e,n=0;e=t.childNodes[n];n++){const t=yf(e);i.push(t);const n=Wf(t);r&&!s&&n.setAttribute(Pg.PARENT,r.id.toString()),o.push(e.id)}return o}!function(t){t.VALID="valid",t.INVALID="invalid",t.PRUNED="pruned"}(If||(If={}));class Xf{constructor(t){this.semantic=t}}class zf extends Xf{static test(t){return!t.mathmlTree&&t.type===tm.LINE&&t.role===sm.BINOMIAL}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){if(!this.semantic.childNodes.length)return this.mml;const t=this.semantic.childNodes[0];if(this.mml=yf(t),this.mml.hasAttribute(Pg.TYPE)){const t=jg();kp(this.mml,t),t.appendChild(this.mml),this.mml=t}return Ug(this.mml,this.semantic),this.mml}}class Kf extends Xf{static test(t){if(!t.mathmlTree||!t.childNodes.length)return!1;const e=Pp(t.mathmlTree),s=t.childNodes[0].role;return e===_m.MSUBSUP&&s===sm.SUBSUP||e===_m.MUNDEROVER&&s===sm.UNDEROVER}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){const t=this.semantic.childNodes[0],e=t.childNodes[0],s=this.semantic.childNodes[1],i=t.childNodes[1],r=yf(s),n=yf(e),o=yf(i);return Ug(this.mml,this.semantic),this.mml.setAttribute(Pg.CHILDREN,Fg([e,i,s])),[n,o,r].forEach((t=>Wf(t).setAttribute(Pg.PARENT,this.mml.getAttribute(Pg.ID)))),this.mml.setAttribute(Pg.TYPE,t.role),Ff(this.mml,[this.semantic.id,[t.id,e.id,i.id],s.id]),this.mml}}class Jf extends Xf{static multiscriptIndex(t){return t.type===tm.PUNCTUATED&&t.contentNodes[0].role===sm.DUMMY&&t.hasAnnotation("general","script")?Gf(t):(yf(t),t.id)}static createNone_(t){const e=Op("none");return t&&Ug(e,t),e.setAttribute(Pg.ADDED,"true"),e}constructor(t){super(t),this.mml=t.mathmlTree}completeMultiscript(t,e){const s=Ip(this.mml.childNodes).slice(1);let i=0;const r=t=>{for(const e of t){const t=s[i];if(t&&e===parseInt(t.getAttribute(Pg.ID)))t.setAttribute(Pg.PARENT,this.semantic.id.toString()),i++;else if(t&&e===parseInt(Wf(t).getAttribute(Pg.ID)))Wf(t).setAttribute(Pg.PARENT,this.semantic.id.toString()),i++;else{const s=this.semantic.querySelectorAll((t=>t.id===e));this.mml.insertBefore(Jf.createNone_(s[0]),t||null)}}};r(t),s[i]&&Pp(s[i])!==_m.MPRESCRIPTS?this.mml.insertBefore(s[i],Op("mprescripts")):i++,r(e)}}class $f extends Jf{static test(t){if(!t.mathmlTree)return!1;return Pp(t.mathmlTree)===_m.MMULTISCRIPTS&&(t.type===tm.SUPERSCRIPT||t.type===tm.SUBSCRIPT)}constructor(t){super(t)}getMathml(){let t,e,s;if(Ug(this.mml,this.semantic),this.semantic.childNodes[0]&&this.semantic.childNodes[0].role===sm.SUBSUP){const i=this.semantic.childNodes[0];t=i.childNodes[0],e=Jf.multiscriptIndex(this.semantic.childNodes[1]),s=Jf.multiscriptIndex(i.childNodes[1]);const r=[this.semantic.id,[i.id,t.id,s],e];Ff(this.mml,r),this.mml.setAttribute(Pg.TYPE,i.role),this.completeMultiscript(qg.interleaveIds(s,e),[])}else{t=this.semantic.childNodes[0],e=Jf.multiscriptIndex(this.semantic.childNodes[1]);const s=[this.semantic.id,t.id,e];Ff(this.mml,s)}const i=qg.collapsedLeafs(s||[],e);return Wf(yf(t)).setAttribute(Pg.PARENT,this.semantic.id.toString()),i.unshift(t.id),this.mml.setAttribute(Pg.CHILDREN,i.join(",")),this.mml}}class Yf extends Jf{static test(t){return!!t.mathmlTree&&t.type===tm.TENSOR}constructor(t){super(t)}getMathml(){yf(this.semantic.childNodes[0]);const t=Jf.multiscriptIndex(this.semantic.childNodes[1]),e=Jf.multiscriptIndex(this.semantic.childNodes[2]),s=Jf.multiscriptIndex(this.semantic.childNodes[3]),i=Jf.multiscriptIndex(this.semantic.childNodes[4]);Ug(this.mml,this.semantic);const r=[this.semantic.id,this.semantic.childNodes[0].id,t,e,s,i];Ff(this.mml,r);const n=qg.collapsedLeafs(t,e,s,i);return n.unshift(this.semantic.childNodes[0].id),this.mml.setAttribute(Pg.CHILDREN,n.join(",")),this.completeMultiscript(qg.interleaveIds(s,i),qg.interleaveIds(t,e)),this.mml}}class Qf extends Xf{static test(t){return!(!t.mathmlTree||!t.fencePointer||t.mathmlTree.getAttribute("data-semantic-type"))}static makeEmptyNode_(t){const e=jg(),s=new qm(t);return s.type=tm.EMPTY,s.mathmlTree=e,s}static fencedMap_(t,e){e[t.id]=t.mathmlTree,t.embellished&&Qf.fencedMap_(t.childNodes[0],e)}constructor(t){super(t),this.fenced=null,this.fencedMml=null,this.fencedMmlNodes=[],this.ofence=null,this.ofenceMml=null,this.ofenceMap={},this.cfence=null,this.cfenceMml=null,this.cfenceMap={},this.parentCleanup=[]}getMathml(){this.getFenced_(),this.fencedMml=yf(this.fenced),this.getFencesMml_(),this.fenced.type!==tm.EMPTY||this.fencedMml.parentNode||(this.fencedMml.setAttribute(Pg.ADDED,"true"),this.cfenceMml.parentNode.insertBefore(this.fencedMml,this.cfenceMml)),this.getFencedMml_();return this.rewrite_()}fencedElement(t){return t.type===tm.FENCED||t.type===tm.MATRIX||t.type===tm.VECTOR}getFenced_(){let t=this.semantic;for(;!this.fencedElement(t);)t=t.childNodes[0];this.fenced=t.childNodes[0],this.ofence=t.contentNodes[0],this.cfence=t.contentNodes[1],Qf.fencedMap_(this.ofence,this.ofenceMap),Qf.fencedMap_(this.cfence,this.cfenceMap)}getFencedMml_(){let t=this.ofenceMml.nextSibling;for(t=t===this.fencedMml?t:this.fencedMml;t&&t!==this.cfenceMml;)this.fencedMmlNodes.push(t),t=t.nextSibling}getFencesMml_(){let t=this.semantic;const e=Object.keys(this.ofenceMap),s=Object.keys(this.cfenceMap);for(;!(this.ofenceMml&&this.cfenceMml||t===this.fenced);)-1===e.indexOf(t.fencePointer)||this.ofenceMml||(this.ofenceMml=t.mathmlTree),-1===s.indexOf(t.fencePointer)||this.cfenceMml||(this.cfenceMml=t.mathmlTree),t=t.childNodes[0];this.ofenceMml||(this.ofenceMml=this.ofence.mathmlTree),this.cfenceMml||(this.cfenceMml=this.cfence.mathmlTree),this.ofenceMml&&(this.ofenceMml=Of(this.ofenceMml)),this.cfenceMml&&(this.cfenceMml=Of(this.cfenceMml))}rewrite_(){let t=this.semantic,e=null;const s=this.introduceNewLayer_();for(Ug(s,this.fenced.parent);!this.fencedElement(t);){const i=t.mathmlTree,r=this.specialCase_(t,i);if(r)t=r;else{Ug(i,t);const e=[];for(let s,i=1;s=t.childNodes[i];i++)e.push(yf(s));t=t.childNodes[0]}const n=Op("dummy"),o=i.childNodes[0];kp(i,n),kp(s,i),kp(i.childNodes[0],s),kp(n,o),e||(e=i)}return yf(this.ofence),yf(this.cfence),this.cleanupParents_(),e||s}specialCase_(t,e){const s=Pp(e);let i,r=null;if(s===_m.MSUBSUP?(r=t.childNodes[0],i=Kf):s===_m.MMULTISCRIPTS&&(t.type===tm.SUPERSCRIPT||t.type===tm.SUBSCRIPT?i=$f:t.type===tm.TENSOR&&(i=Yf),r=i&&t.childNodes[0]&&t.childNodes[0].role===sm.SUBSUP?t.childNodes[0]:t),!r)return null;const n=r.childNodes[0],o=Qf.makeEmptyNode_(n.id);return r.childNodes[0]=o,e=new i(t).getMathml(),r.childNodes[0]=n,this.parentCleanup.push(e),r.childNodes[0]}introduceNewLayer_(){const t=this.fullFence(this.ofenceMml),e=this.fullFence(this.cfenceMml);let s=jg();if(kp(this.fencedMml,s),this.fencedMmlNodes.forEach((t=>s.appendChild(t))),s.insertBefore(t,this.fencedMml),s.appendChild(e),!s.parentNode){const t=jg();for(;s.childNodes.length>0;)t.appendChild(s.childNodes[0]);s.appendChild(t),s=t}return s}fullFence(t){const e=this.fencedMml.parentNode;let s=t;for(;s.parentNode&&s.parentNode!==e;)s=s.parentNode;return s}cleanupParents_(){this.parentCleanup.forEach((function(t){const e=t.childNodes[1].getAttribute(Pg.PARENT);t.childNodes[0].setAttribute(Pg.PARENT,e)}))}}class Zf extends Xf{static test(t){return!!t.mathmlTree&&t.hasAnnotation("Emph","top")}constructor(t){super(t),this.mrows=[],this.mml=t.mathmlTree}getMathml(){if(this.recurseToTable(this.semantic),this.mrows.length){const t=jg();this.mml.parentNode.insertBefore(t,this.mml);for(const e of this.mrows)t.appendChild(e);t.appendChild(this.mml)}return this.mml}recurseToTable(t){var e,s;if(t.hasAnnotation("Emph","top")||t.hasAnnotation("Emph","fence")||!t.hasAnnotation("Emph","left")&&!t.hasAnnotation("Emph","right")){if(!t.mathmlTree||Pp(t.mathmlTree)===_m.MTABLE&&(null===(e=t.annotation.Emph)||void 0===e?void 0:e.length)&&"table"!==t.annotation.Emph[0]){const e=jg();Ug(e,t),this.mrows.unshift(e)}else{if(Pp(t.mathmlTree)===_m.MTABLE&&(null===(s=t.annotation.Emph)||void 0===s?void 0:s.length)&&"table"===t.annotation.Emph[0])return void this.finalizeTable(t);Ug(t.mathmlTree,t)}if(t.childNodes.forEach(this.recurseToTable.bind(this)),t.textContent||"punctuated"===t.type){const e=t.contentNodes.map((t=>{const e=Uf(t);return e.hasAttribute("data-semantic-added")?this.mrows.unshift(e):this.recurseToTable(t),e}));Hf(t,e)}else t.contentNodes.forEach(this.recurseToTable.bind(this))}else yf(t)}finalizeTable(t){Ug(t.mathmlTree,t),t.contentNodes.forEach((t=>{yf(t)})),t.childNodes.forEach((t=>{yf(t)}))}}class tb extends Xf{static test(t){if(!t.mathmlTree||!t.childNodes.length)return!1;const e=Pp(t.mathmlTree),s=t.type;return(s===tm.LIMUPPER||s===tm.LIMLOWER)&&(e===_m.MSUBSUP||e===_m.MUNDEROVER)||s===tm.LIMBOTH&&(e===_m.MSUB||e===_m.MUNDER||e===_m.MSUP||e===_m.MOVER)}static walkTree_(t){t&&yf(t)}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){const t=this.semantic.childNodes;return this.semantic.type!==tm.LIMBOTH&&this.mml.childNodes.length>=3&&(this.mml=Nf([this.mml],this.semantic)),Ug(this.mml,this.semantic),t[0].mathmlTree||(t[0].mathmlTree=this.semantic.mathmlTree),t.forEach(tb.walkTree_),this.mml}}class eb extends Xf{static test(t){return!!t.mathmlTree&&t.type===tm.LINE}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){return this.semantic.contentNodes.length&&yf(this.semantic.contentNodes[0]),this.semantic.childNodes.length&&yf(this.semantic.childNodes[0]),Ug(this.mml,this.semantic),this.mml}}class sb extends Xf{static test(t){return!!t.mathmlTree&&(t.type===tm.INFERENCE||t.type===tm.PREMISES)}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){return this.semantic.childNodes.length?(this.semantic.contentNodes.forEach((function(t){yf(t),Ug(t.mathmlTree,t)})),this.semantic.childNodes.forEach((function(t){yf(t)})),Ug(this.mml,this.semantic),this.mml.getAttribute("data-semantic-id")===this.mml.getAttribute("data-semantic-parent")&&this.mml.removeAttribute("data-semantic-parent"),this.mml):this.mml}}class ib extends Xf{static test(t){return t.type===tm.MATRIX||t.type===tm.VECTOR||t.type===tm.CASES}constructor(t){super(t),this.inner=[],this.mml=t.mathmlTree}getMathml(){const t=Uf(this.semantic.contentNodes[0]),e=this.semantic.contentNodes[1]?Uf(this.semantic.contentNodes[1]):null;if(this.inner=this.semantic.childNodes.map(yf),this.mml)if(Pp(this.mml)===_m.MFENCED){const s=this.mml.childNodes;this.mml.insertBefore(t,s[0]||null),e&&this.mml.appendChild(e),this.mml=jf(this.mml)}else{const s=[t,this.mml];e&&s.push(e),this.mml=Nf(s,this.semantic)}else this.mml=Nf([t].concat(this.inner,[e]),this.semantic);return Ug(this.mml,this.semantic),this.mml}}class rb extends Xf{static test(t){return t.type===tm.PUNCTUATED&&(t.role===sm.TEXT||t.contentNodes.every((t=>t.role===sm.DUMMY)))}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){const t=[],e=Gf(this.semantic,t);return this.mml=Nf(t,this.semantic),Ug(this.mml,this.semantic),this.mml.removeAttribute(Pg.CONTENT),Ff(this.mml,e),this.mml}}function nb(t,e){const s=t.cloneNode(!0);return function(t,e,s){return fp.getInstance().generate((()=>["Original MathML",Vf(t)])),xf.clear(),yf(e.root),s.structure&&t.setAttribute(Pg.STRUCTURE,qg.fromStructure(t,e,s).toString()),fp.getInstance().generate((()=>["Semantic Tree\n",Vf(e),"Semantically enriched MathML\n",Vf(t)])),t}(s,ff(s,e),e)}bf.push({test:tb.test,constr:t=>new tb(t)},{test:Qf.test,constr:t=>new Qf(t)},{test:Kf.test,constr:t=>new Kf(t)},{test:Yf.test,constr:t=>new Yf(t)},{test:$f.test,constr:t=>new $f(t)},{test:eb.test,constr:t=>new eb(t)},{test:zf.test,constr:t=>new zf(t)},{test:sb.test,constr:t=>new sb(t)},{test:Zf.test,constr:t=>new Zf(t)},{test:ib.test,constr:t=>new ib(t)},{test:rb.test,constr:t=>new rb(t)});const ob=new lp({AbsoluteValue:["Auto","AbsEnd","Cardinality","Determinant"],Bar:["Auto","Conjugate"],Caps:["Auto","SayCaps"],CombinationPermutation:["Auto","ChoosePermute"],Currency:["Auto","Position","Prefix"],Ellipses:["Auto","AndSoOn"],Enclosed:["Auto","EndEnclose"],Exponent:["Auto","AfterPower","Ordinal","OrdinalPower","Exponent"],Fraction:["Auto","EndFrac","FracOver","General","GeneralEndFrac","Ordinal","Over","OverEndFrac","Per"],Functions:["Auto","None","Reciprocal"],Inference:["Auto","Long"],ImpliedTimes:["Auto","MoreImpliedTimes","None"],Log:["Auto","LnAsNaturalLog"],Matrix:["Auto","Combinatoric","EndMatrix","EndVector","SilentColNum","SpeakColNum","Vector"],MultiLineLabel:["Auto","Case","Constraint","Equation","Line","None","Row","Step"],MultiLineOverview:["Auto","None"],MultiLinePausesBetweenColumns:["Auto","Long","Short"],MultsymbolDot:["Auto","Dot"],MultsymbolX:["Auto","By","Cross"],Paren:["Auto","CoordPoint","Interval","Silent","Speak","SpeakNestingLevel"],Prime:["Auto","Angle","Length"],Roots:["Auto","PosNegSqRoot","PosNegSqRootEnd","RootEnd"],SetMemberSymbol:["Auto","Belongs","Element","Member","In"],Sets:["Auto","SilentBracket","woAll"],TriangleSymbol:["Auto","Delta"],Trig:["Auto","ArcTrig","TrigInverse","Reciprocal"],VerticalLine:["Auto","Divides","Given","SuchThat"]}),ab="Auto";function lb(t){const e=t.split(":"),s={},i=ob.getProperties(),r=Object.keys(i);for(let t,n=0;t=e[n];n++){const e=t.split("_");if(-1===r.indexOf(e[0]))continue;const n=e[1];n&&n!==ab&&-1!==i[e[0]].indexOf(n)&&(s[e[0]]=e[1])}return s}function cb(t){const e=Object.keys(t),s=[];for(let i=0;i<e.length;i++)s.push(e[i]+"_"+t[e[i]]);return s.length?s.join(":"):cp.DEFAULT_VALUE}const hb=bp.u.LOCALES,db=t=>Ap.getInstance().setup(t),ub=()=>Ap.getInstance().json(),pb=t=>function(t,e){const s=Rp(t);try{return nb(s,e)}catch(t){return console.error(t),s}}(t,Ap.getInstance().options),mb=Rp,gb=function(t,e,s){if("default"===t)return e+"_"+s;const i=lb(t);return i[e]=s,cb(i)},fb=lb,bb=cb;var Eb=function(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function a(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};let xb={},yb=null;function Nb(t){var e,s;const i=null==t?void 0:t.match(/^clearspeak-(.*)/);return yb=null!==(s=null!==(e=i&&i[1])&&void 0!==e?e:yb)&&void 0!==s?s:"default",yb}const Ab=new Map;const vb=new Map;let _b=0;function wb(t,e){const s=Ab.get(e);!function(t,e){const s=t.pool.lookup("speechRules"),i=Nb(t.settings.speechRules);xb=fb(i);for(const i of e)t.factory.get("variable")(t.factory,{name:"csprf_"+i,setter:t=>{xb[i]=t,s.setValue("clearspeak-"+bb(xb))},getter:()=>xb[i]||"Auto"},t.pool)}(t,Object.keys(s));const i=[];for(const t of Object.getOwnPropertyNames(s))i.push({title:t,values:s[t].map((e=>e.replace(RegExp("^"+t+"_"),""))),variable:"csprf_"+t});const r=new rp("Clearspeak Preferences","",i,"alphabetical","square",t);return{type:"command",id:"ClearspeakPreferences",content:"Select Preferences",action:()=>r.post()}}function Tb(t,e,s){return Eb(this,void 0,void 0,(function*(){var i,r;const n=i=>{s(t.factory.get("subMenu")(t.factory,{items:i,id:"Clearspeak"},e))};if(!t.settings.speech||!t.settings.enrich)return void n([]);const o=t.pool.lookup("locale").getValue();if(yield function(t,e){return Eb(this,void 0,void 0,(function*(){Ab.has(e)||(yield t.mathItem.generatorPool.getLocalePreferences(Ab))}))}(t,o),!Ab.get(o))return void n([]);const a=wb(t,o);let l=[];if(t.settings.speech){const e=t.mathItem,s=null===(i=null==e?void 0:e.explorers)||void 0===i?void 0:i.speech,n=Nb(t.settings.speechRules);l=l.concat(function(t){return[{type:"radio",content:"No Preferences",id:"clearspeak-default",variable:"speechRules"},{type:"radio",content:"Current Preferences",id:"clearspeak-"+t,variable:"speechRules"},{type:"rule"}]}(n));const a=null==s?void 0:s.refocus,c=null!==(r=null==a?void 0:a.getAttribute("data-semantic-id"))&&void 0!==r?r:null,h=_b++;yield e.generatorPool.getRelevantPreferences(e,c,vb,h);const d=vb.get(h);if(vb.delete(h),d){const t=function(t,e,s){const i=Ab.get(s);return[{type:"label",content:"Preferences for "+e},{type:"rule"}].concat(i[e].map((function(e){const[s,i]=e.split("_");return{type:"radioCompare",content:i,id:"clearspeak-"+gb(t,s,i),variable:"speechRules",comparator:(t,e)=>{if(t===e)return!0;if("Auto"!==i)return!1;const[r,n]=t.split("-"),[o]=e.split("-");return r===o&&!fb(n)[s]}}})))}(n,d,o);l=l.concat(t)}}l.splice(2,0,a),n(l)}))}ip.DynamicSubmenus.set("Clearspeak",[Tb,"speech"]);let Cb=null;function Lb(t,e,s){if(Cb)return void s(Cb);const i=[];for(const t of hb.keys())"nemeth"!==t&&"euro"!==t&&i.push({type:"radio",id:t,content:hb.get(t)||t,variable:"locale"});i.sort(((t,e)=>t.content.localeCompare(e.content,"en"))),Cb=t.factory.get("subMenu")(t.factory,{items:i,id:"Language"},e),s(Cb)}ip.DynamicSubmenus.set("A11yLanguage",[Lb,"speech"]);const Ib="MacOS"===mi.os;function Rb(t){const e=mi.document,s=e.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.cssText="height: 1px; width: 1px; padding: 1px; position: absolute; left: -10px",e.body.appendChild(s),s.select();try{e.execCommand("copy")}catch(t){alert(`Can't copy to clipboard: ${t.message}`)}e.body.removeChild(s)}function Sb(t,e,s){return(i,r,n)=>{!function(t,e,s){if(!t)return;for(const i of t.childNodes)if(i.isKind("annotation")){const t=Ob(i,e);if(t){const e=i.childNodes.reduce(((t,e)=>t+e.toString()),"");s.push([t,e])}}}(function(t){var e;let s=null===(e=t.mathItem)||void 0===e?void 0:e.root;for(;s&&!s.isKind("semantics");){if(s.isToken||1!==s.childNodes.length)return null;s=s.childNodes[0]}return s}(i),e,s),n(Db(i,r,s,t))}}function kb(t){return(e,s,i)=>{const r=t.slice();t.length=0,i(Db(e,s,r,(()=>Rb(Mb.trim()))))}}function Ob(t,e){const s=t.attributes.get("encoding");for(const t of Object.keys(e))if(e[t].includes(s))return t;return null}let Mb="";function Db(t,e,s,i){return t.factory.get("subMenu")(t.factory,{items:s.map((([t,e])=>({type:"command",id:t,content:t,action:()=>{Mb=e,i()}}))),id:"annotations"},e)}class Pb extends po{static post(t){return super.post(t)}html(t){var e;null!==(e=t.extraNodes)&&void 0!==e||(t.extraNodes=[]);const s=t.adaptor.node("input",{type:"button",value:"Copy to Clipboard","data-drag":"none"});return s.addEventListener("click",this.copyToClipboard.bind(this)),t.extraNodes.push(s),t.code&&(t.message="<pre>"+this.formatSource(t.message)+"</pre>"),super.html(t)}formatSource(t){return t.trim().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}}class Bb extends Bu{static fromJson(t,{content:e,variable:s,id:i,comparator:r},n){return new this(n,e,s,i,r)}constructor(t,e,s,i,r){super(t,e,s,i),this.comparator=r,this.role="menuitemradiocompare"}updateAria(){this.html.setAttribute("aria-checked",this.comparator(this.variable.getValue(),this.id)?"true":"false")}updateSpan(){this.span.style.display=this.comparator(this.variable.getValue(),this.id)?"":"none"}}class Fb extends Qn{constructor(){super(...arguments),this.options={filterSRE:!0,filterTex:!0,texHints:!0,semantics:!1},this.mathItem=null}visitTree(t,e=null,s={}){return this.mathItem=e,Fi(this.options,s),this.visitNode(t,"")}visitTeXAtomNode(t,e){return this.options.texHints?super.visitDefault(t,e):t.childNodes[0]&&1===t.childNodes[0].childNodes.length?this.visitNode(t.childNodes[0],e):`${e}<mrow${this.getAttributes(t)}>\n`+this.childNodeMml(t,e+" ","\n")+`${e}</mrow>`}visitMathNode(t,e){if(!this.options.semantics||"TeX"!==this.mathItem.inputJax.name)return super.visitDefault(t,e);const s=t.childNodes.length&&t.childNodes[0].childNodes.length>1;return`${e}<math${this.getAttributes(t)}>\n${e} <semantics>\n`+(s?e+" <mrow>\n":"")+this.childNodeMml(t,e+(s?" ":" "),"\n")+(s?e+" </mrow>\n":"")+`${e} <annotation encoding="application/x-tex">`+this.mathItem.math+`</annotation>\n${e} </semantics>\n${e}</math>`}getAttributeList(t){const e=super.getAttributeList(t);if(this.options.filterTex&&(delete e["data-latex"],delete e["data-latex-item"]),this.options.filterSRE){const t=Object.keys(e).filter((t=>t.match(/^(?:data-semantic-.*?|data-speech-node|role|aria-(?:level|posinset|setsize|owns))$/)));for(const s of t)delete e[s]}return e}}var Ub=function(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function a(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};const jb=ui;class qb{get isLoading(){return qb.loading>0}get loadingPromise(){return this.isLoading?(qb._loadingPromise||(qb._loadingPromise=new Promise(((t,e)=>{qb._loadingOK=t,qb._loadingFailed=e}))),qb._loadingPromise):Promise.resolve()}about(){const t=[];if(t.push("Input Jax: "+this.document.inputJax.map((t=>t.name)).join(", ")),t.push("Output Jax: "+this.document.outputJax.name),t.push("Document Type: "+this.document.kind),jb&&jb.loader){t.push("<hr/>Modules Loaded:");const e=jb._.components.package.Package,s=jb.loader.versions;for(const i of Array.from(e.packages.keys()).sort(this.sortPackages)){const r=s.get(e.resolvePath(i));r&&t.push(`    ${i} <mjx-v>(${r})</mjx-v>`)}}po.post({title:"MathJax <mjx-v>v"+eo.version+"</mjx-v>",message:t.join("<br/>"),adaptor:this.document.adaptor,styles:{".mjx-dialog":{"max-height":"calc(min(20em, 85%))"},"mjx-dialog > div":{"white-space":"nowrap"},"dialog.mjx-dialog-help > mjx-dialog > div":{"white-space":"normal"},"mjx-v":{"font-size":"80%"}},extraNodes:[this.document.adaptor.node("a",{href:"https://www.mathjax.org","data-drag":"false"},[this.document.adaptor.text("https://www.mathjax.org")])]})}sortPackages(t,e){const[s,i]=t.includes("/")?t.split(/\//):["",t],[r,n]=e.includes("/")?e.split(/\//):["",e];return s===r?i<n?-1:1:"["===s.charAt(0)?"["===r.charAt(0)&&s<r?-1:1:"["===r.charAt(0)||s<r?-1:1}help(){po.post({title:"MathJax Help",message:["<p><b>MathJax</b> is a JavaScript library that allows page"," authors to include mathematics within their web pages."," As a reader, you don't need to do anything to make that happen.</p>","<p><b>Browsers</b>: MathJax works with all modern browsers including"," Edge, Firefox, Chrome, Safari, Opera, and most mobile browsers.</p>","<p><b>Math Menu</b>: MathJax adds a contextual menu to equations."," Right-click or CTRL-click on any mathematics to access the menu.</p>",'<div style="margin-left: 1em;">',"<p><b>Show Math As:</b> These options allow you to view the formula's"," source markup (as MathML or in its original format).</p>","<p><b>Copy to Clipboard:</b> These options copy the formula's source markup,"," as MathML or in its original format, to the clipboard"," (in browsers that support that).</p>","<p><b>Math Settings:</b> These give you control over features of MathJax,"," such the size of the mathematics, the mechanism used to display equations,"," how to handle equations that are too wide, and the language to use for"," MathJax's menus and error messages (not yet implemented in v4).","</p>","<p><b>Accessibility</b>: MathJax can work with screen"," readers to make mathematics accessible to the visually impaired."," Turn on speech or braille generation to enable creation of speech strings"," and the ability to investigate expressions interactively. You can control"," the style of the explorer in its menu.</p>","</div>","<p><b>Math Zoom</b>: If you are having difficulty reading an"," equation, MathJax can enlarge it to help you see it better, or"," you can scale all the math on the page to make it larger."," Turn these features on in the <b>Math Settings</b> menu.</p>","<p><b>Preferences</b>: MathJax uses your browser's localStorage database"," to save the preferences set via this menu locally in your browser. These"," are not used to track you, and are not transferred or used remotely by"," MathJax in any way.</p>"].join("\n"),adaptor:this.document.adaptor,extraNodes:[this.document.adaptor.node("a",{href:"https://www.mathjax.org","data-drag":"none"},[this.document.adaptor.text("https://www.mathjax.org")])]})}mathMLCode(){Pb.post({title:"MathJax MathML Expression",message:this.menu.mathItem?this.toMML(this.menu.mathItem):"",adaptor:this.document.adaptor,code:!0})}originalText(){var t,e;Pb.post({title:"MathJax Original Source",message:null!==(e=null===(t=this.menu.mathItem)||void 0===t?void 0:t.math)&&void 0!==e?e:"",adaptor:this.document.adaptor,code:!0})}annotationBox(){Pb.post({title:"MathJax Annotation Text",message:Mb,adaptor:this.document.adaptor,code:!0})}svgImage(){return Ub(this,void 0,void 0,(function*(){Pb.post({title:"MathJax SVG Image",message:yield this.toSVG(this.menu.mathItem),adaptor:this.document.adaptor,code:!0})}))}speechText(){var t,e,s;Pb.post({title:"MathJax Speech Text",message:null!==(s=null===(e=null===(t=this.menu.mathItem)||void 0===t?void 0:t.outputData)||void 0===e?void 0:e.speech)&&void 0!==s?s:"",adaptor:this.document.adaptor,code:!0})}brailleText(){var t,e,s;Pb.post({title:"MathJax Braille Text",message:null!==(s=null===(e=null===(t=this.menu.mathItem)||void 0===t?void 0:t.outputData)||void 0===e?void 0:e.braille)&&void 0!==s?s:"",adaptor:this.document.adaptor,code:!0})}errorMessage(){Pb.post({title:"MathJax Error Message",message:this.menu.mathItem?this.menu.errorMsg:"",adaptor:this.document.adaptor,code:!0})}zoomBox(){let t="";if(this.menu.mathItem){const e=this.menu.mathItem.typesetRoot,s=this.document.adaptor.fontSize(e),i=e.cloneNode(!0);i.style.margin="0";t=`<div style="font-size: ${s*parseFloat(this.settings.zscale)/100}px">${i.outerHTML}</div>`}po.post({title:"MathJax Zoomed Expression",message:t,adaptor:this.document.adaptor,styles:{"mjx-dialog > div":{padding:"1.8em"}}})}constructor(t,e={}){this.settings=null,this.defaultSettings=null,this.menu=null,this.current=null,this.MmlVisitor=new Fb,this.jax={CHTML:null,SVG:null},this.rerenderStart=lr.LAST,this.requiredExtensions=[],this.document=t,this.options=Fi(Bi({},this.constructor.OPTIONS),e),this.initSettings(),this.mergeUserSettings(),this.initMenu(),this.applySettings()}initSettings(){var t;this.settings=this.options.settings,this.jax=this.options.jax;const e=this.document.outputJax;this.jax[e.name]=e,this.settings.renderer=e.name,this.settings.scale=e.options.scale,e.options.displayOverflow&&(this.settings.overflow=e.options.displayOverflow.substring(0,1).toUpperCase()+e.options.displayOverflow.substring(1).toLowerCase()),this.settings.breakInline=null===(t=e.options.linebreaks)||void 0===t?void 0:t.inline,this.defaultSettings=Object.assign({},this.document.options.a11y,this.settings),this.setA11y({roleDescription:this.settings.roleDescription})}initMenu(){const t=new Yu([["contextMenu",ip.fromJson.bind(ip)],["radioCompare",Bb.fromJson.bind(Bb)]]);this.menu=t.parse({type:"contextMenu",id:"MathJax_Menu",pool:[this.variable("showSRE"),this.variable("showTex"),this.variable("texHints"),this.variable("semantics"),this.variable("zoom"),this.variable("zscale"),this.variable("renderer",(t=>this.setRenderer(t))),this.variable("overflow",(t=>this.setOverflow(t))),this.variable("breakInline",(t=>this.setInlineBreaks(t))),this.variable("alt"),this.variable("cmd"),this.variable("ctrl"),this.variable("shift"),this.variable("scale",(t=>this.setScale(t))),this.a11yVar("speech",(t=>this.setSpeech(t))),this.a11yVar("braille",(t=>this.setBraille(t))),this.variable("brailleCode",(t=>this.setBrailleCode(t))),this.a11yVar("brailleSpeech",(t=>this.setBrailleSpeech(t))),this.a11yVar("brailleCombine",(t=>this.setBrailleCombine(t))),this.a11yVar("highlight",(t=>this.setHighlight(t))),this.a11yVar("backgroundColor",(t=>this.setColor("bg",t))),this.a11yVar("backgroundOpacity",(t=>this.setColor("bg",null,t))),this.a11yVar("foregroundColor",(t=>this.setColor("fg",t))),this.a11yVar("foregroundOpacity",(t=>this.setColor("fg",null,t))),this.a11yVar("subtitles"),this.a11yVar("viewBraille"),this.a11yVar("voicing"),this.a11yVar("roleDescription",(()=>this.setRoleDescription())),this.a11yVar("help"),this.a11yVar("locale",(t=>this.setLocale(t))),this.variable("speechRules",(t=>{const[e,s]=t.split("-");this.document.options.sre.domain=e,this.document.options.sre.style=s,this.rerender(lr.COMPILED)})),this.a11yVar("magnification"),this.a11yVar("magnify"),this.a11yVar("treeColoring"),this.a11yVar("infoType"),this.a11yVar("infoRole"),this.a11yVar("infoPrefix"),this.variable("autocollapse"),this.variable("collapsible",(t=>this.setCollapsible(t))),this.variable("enrich",(t=>this.setEnrichment(t))),this.variable("inTabOrder",(t=>this.setTabOrder(t))),this.a11yVar("tabSelects"),this.variable("assistiveMml",(t=>this.setAssistiveMml(t)))],items:[this.submenu("Show","Show Math As",[this.command("MathMLcode","MathML Code",(()=>this.mathMLCode())),this.command("Original","Original Form",(()=>this.originalText())),this.rule(),this.command("Speech","Speech Text",(()=>this.speechText()),{disabled:!0}),this.command("Braille","Braille Code",(()=>this.brailleText()),{disabled:!0}),this.command("SVG","SVG Image",(()=>this.svgImage()),{disabled:!0}),this.submenu("ShowAnnotation","Annotation"),this.rule(),this.command("Error","Error Message",(()=>this.errorMessage()),{disabled:!0})]),this.submenu("Copy","Copy to Clipboard",[this.command("MathMLcode","MathML Code",(()=>this.copyMathML())),this.command("Original","Original Form",(()=>this.copyOriginal())),this.rule(),this.command("Speech","Speech Text",(()=>this.copySpeechText()),{disabled:!0}),this.command("Braille","Braille Code",(()=>this.copyBrailleText()),{disabled:!0}),this.command("SVG","SVG Image",(()=>this.copySvgImage()),{disabled:!0}),this.submenu("CopyAnnotation","Annotation"),this.rule(),this.command("Error","Error Message",(()=>this.copyErrorMessage()),{disabled:!0})]),this.rule(),this.submenu("Settings","Math Settings",[this.submenu("Renderer","Math Renderer",this.radioGroup("renderer",[["CHTML"],["SVG"]])),this.submenu("Overflow","Wide Expressions",[this.radioGroup("overflow",[["Overflow"],["Scroll"],["Linebreak"],["Scale"],["Truncate"],["Elide"]]),this.rule(),this.checkbox("BreakInline","Allow In-line Breaks","breakInline")]),this.rule(),this.submenu("MathmlIncludes","MathML/SVG has",[this.checkbox("showSRE","Semantic attributes","showSRE"),this.checkbox("showTex","LaTeX attributes","showTex"),this.checkbox("texHints","TeX hints","texHints"),this.checkbox("semantics","Original as annotation","semantics")]),this.submenu("Language","Language"),this.rule(),this.submenu("ZoomTrigger","Zoom Trigger",[this.command("ZoomNow","Zoom Once Now",(()=>this.zoom(null,""))),this.rule(),this.radioGroup("zoom",[["Click"],["DoubleClick","Double-Click"],["NoZoom","No Zoom"]]),this.rule(),this.label("TriggerRequires","Trigger Requires:"),this.checkbox(Ib?"Option":"Alt",Ib?"Option":"Alt","alt"),this.checkbox("Command","Command","cmd",{hidden:!Ib}),this.checkbox("Control","Control","ctrl",{hidden:Ib}),this.checkbox("Shift","Shift","shift")]),this.submenu("ZoomFactor","Zoom Factor",this.radioGroup("zscale",[["150%"],["175%"],["200%"],["250%"],["300%"],["400%"]])),this.rule(),this.command("Scale","Scale All Math...",(()=>this.scaleAllMath())),this.rule(),this.command("Reset","Reset to defaults",(()=>this.resetDefaults()))]),this.rule(),this.label("Accessibility","\xa0\xa0 Accessibility:"),this.submenu("Speech","\xa0 \xa0 Speech",[this.checkbox("Generate","Generate","speech"),this.checkbox("Subtitles","Show Subtitles","subtitles"),this.checkbox("Auto Voicing","Auto Voicing","voicing"),this.rule(),this.label("Rules","Rules:"),this.submenu("Mathspeak","Mathspeak",this.radioGroup("speechRules",[["mathspeak-default","Verbose"],["mathspeak-brief","Brief"],["mathspeak-sbrief","Superbrief"]])),this.submenu("Clearspeak","Clearspeak",this.radioGroup("speechRules",[["clearspeak-default","Auto"]])),this.rule(),this.submenu("A11yLanguage","Language")]),this.submenu("Braille","\xa0 \xa0 Braille",[this.checkbox("Generate","Generate","braille"),this.checkbox("Subtitles","Show Subtitles","viewBraille"),this.checkbox("BrailleSpeech","Replace Speech","brailleSpeech",{hidden:!0}),this.checkbox("BrailleCombine","Combine with Speech","brailleCombine"),this.rule(),this.label("Code","Code Format:"),this.radioGroup("brailleCode",[["nemeth","Nemeth"],["ueb","UEB"],["euro","Euro"]])]),this.submenu("Explorer","\xa0 \xa0 Explorer",[this.submenu("Highlight","Highlight",[this.submenu("Background","Background",this.radioGroup("backgroundColor",[["Blue"],["Red"],["Green"],["Yellow"],["Cyan"],["Magenta"],["White"],["Black"]])),{type:"slider",variable:"backgroundOpacity",content:" "},this.submenu("Foreground","Foreground",this.radioGroup("foregroundColor",[["Black"],["White"],["Magenta"],["Cyan"],["Yellow"],["Green"],["Red"],["Blue"]])),{type:"slider",variable:"foregroundOpacity",content:" "},this.rule(),this.radioGroup("highlight",[["None"],["Hover"],["Flame"]]),this.rule(),this.checkbox("TreeColoring","Tree Coloring","treeColoring")]),this.submenu("Magnification","Magnification",[this.radioGroup("magnification",[["None"],["Keyboard"],["Mouse"]]),this.rule(),this.radioGroup("magnify",[["200%"],["300%"],["400%"],["500%"]])]),this.submenu("Semantic Info","Semantic Info",[this.checkbox("Type","Type","infoType"),this.checkbox("Role","Role","infoRole"),this.checkbox("Prefix","Prefix","infoPrefix")]),this.rule(),this.submenu("Role Description","Describe math as",[this.radioGroup("roleDescription",[["MathJax expression"],["MathJax"],["math"],["clickable math"],["explorable math"],["none"]])]),this.checkbox("Math Help","Help message on focus","help")]),this.submenu("Options","\xa0 \xa0 Options",[this.checkbox("Enrich","Semantic Enrichment","enrich"),this.checkbox("Collapsible","Collapsible Math","collapsible"),this.checkbox("AutoCollapse","Auto Collapse","autocollapse",{disabled:!0}),this.rule(),this.checkbox("InTabOrder","Include in Tab Order","inTabOrder"),this.submenu("TabSelects","Tabbing Focuses on",[this.radioGroup("tabSelects",[["all","Whole Expression"],["last","Last Explored Node"]])]),this.rule(),this.checkbox("AssistiveMml","Include Hidden MathML","assistiveMml")]),this.rule(),this.command("About","About MathJax",(()=>this.about())),this.command("Help","MathJax Help",(()=>this.help()))]});const e=this.menu;e.settings=this.settings,e.findID("Settings","Overflow","Elide").disable(),e.findID("Braille","ueb").hide(),e.setJax(this.jax),this.checkLoadableItems();const s=[];ip.DynamicSubmenus.set("ShowAnnotation",[Sb((()=>this.annotationBox()),this.options.annotationTypes,s),""]),ip.DynamicSubmenus.set("CopyAnnotation",[kb(s),""]),function(t){sp(Object.assign(Object.assign({},tp),ep),t)}(this.document.document)}checkLoadableItems(){var t,e,s,i,r,n;if(jb&&jb._&&jb.loader&&jb.startup){const o=this.settings,a=this.document.options;(o.enrich||o.speech&&a.enableSpeech||o.braille&&a.enableBraille)&&!(null===(e=null===(t=jb._)||void 0===t?void 0:t.a11y)||void 0===e?void 0:e.explorer)&&this.loadA11y("explorer"),o.collapsible&&!(null===(i=null===(s=jb._)||void 0===s?void 0:s.a11y)||void 0===i?void 0:i.complexity)&&this.loadA11y("complexity"),o.assistiveMml&&!(null===(n=null===(r=jb._)||void 0===r?void 0:r.a11y)||void 0===n?void 0:n["assistive-mml"])&&this.loadA11y("assistive-mml")}else{const t=this.menu;for(const e of Object.keys(this.jax))this.jax[e]||t.findID("Settings","Renderer",e).disable();t.findID("Speech").disable(),t.findID("Braille").disable(),t.findID("Explorer").disable(),t.findID("Options","AutoCollapse").disable(),t.findID("Options","Collapsible").disable(),t.findID("Options","Enrich").disable(),t.findID("Options","AssistiveMml").disable()}}enableAccessibilityItems(t,e){const s=this.menu.findID(t).submenu;for(const t of s.items.slice(1))t instanceof Fu||(!e||t instanceof Ru&&!t.submenu.items.length?t.disable():t.enable())}mergeUserSettings(){try{const t=localStorage.getItem(qb.MENU_STORAGE);if(!t)return;Object.assign(this.settings,JSON.parse(t)),this.setA11y(this.settings)}catch(t){console.log("MathJax localStorage error: "+t.message)}}saveUserSettings(){const t={};for(const e of Object.keys(this.settings))this.settings[e]!==this.defaultSettings[e]&&(t[e]=this.settings[e]);try{Object.keys(t).length?localStorage.setItem(qb.MENU_STORAGE,JSON.stringify(t)):localStorage.removeItem(qb.MENU_STORAGE)}catch(t){console.log("MathJax localStorage error: "+t.message)}}setA11y(t){var e,s;(null===(s=null===(e=jb._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.explorer)&&jb._.a11y.explorer_ts.setA11yOptions(this.document,t)}getA11y(t){var e,s;if(null===(s=null===(e=jb._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.explorer)return void 0!==this.document.options.a11y[t]?this.document.options.a11y[t]:this.document.options.sre[t]}applySettings(){this.setTabOrder(this.settings.inTabOrder);this.document.options.enableAssistiveMml=this.settings.assistiveMml,this.enableAccessibilityItems("Speech",this.settings.speech),this.enableAccessibilityItems("Braille",this.settings.braille),this.setAccessibilityMenus();const t=this.settings.renderer.replace(/[^a-zA-Z0-9]/g,"")||"CHTML";(qb._loadingPromise||Promise.resolve()).then((()=>{const e=this.settings,s=this.document.outputJax.options;if(s.scale=parseFloat(e.scale),s.displayOverflow=e.overflow.toLowerCase(),s.linebreaks&&(s.linebreaks.inline=e.breakInline),!e.speechRules){const t=this.document.options.sre;e.speechRules=`${t.domain||"clearspeak"}-${t.style||"default"}`}t!==this.defaultSettings.renderer&&this.document.whenReady((()=>this.setRenderer(t,!1)))}))}setOverflow(t){this.document.outputJax.options.displayOverflow=t.toLowerCase(),qb.loading||this.document.rerenderPromise()}setInlineBreaks(t){this.document.outputJax.options.linebreaks.inline=t,qb.loading||this.document.rerenderPromise()}setScale(t){this.document.outputJax.options.scale=parseFloat(t),qb.loading||this.document.rerenderPromise()}setRenderer(t,e=!0){if(Object.hasOwn(this.jax,t)&&this.jax[t])return this.setOutputJax(t,e);const s=t.toLowerCase();return new Promise(((i,r)=>{this.loadComponent("output/"+s,(()=>{const n=jb.startup;if(!(s in n.constructors))return r(new Error(`Component ${s} not loaded`));n.useOutput(s,!0),n.output=n.getOutputJax(),n.output.setAdaptor(this.document.adaptor),n.output.initialize(),this.jax[t]=n.output,this.setOutputJax(t,e).then((()=>i())).catch((t=>r(t)))}))}))}setOutputJax(t,e=!0){this.jax[t].setAdaptor(this.document.adaptor),this.document.outputJax=this.jax[t];const s=this.loadRequiredExtensions();return e?s.then((()=>eo.handleRetriesFor((()=>this.rerender())))):s.then((()=>{}))}loadRequiredExtensions(){const t=this.document.outputJax.name.toLowerCase(),e=[];for(const s of this.requiredExtensions)e.push(jb.loader.load(`[${s}]/${t}`));return this.requiredExtensions=[],Promise.all(e)}addRequiredExtensions(t){if(t){const e=new Set([...this.requiredExtensions,...t]);this.requiredExtensions=[...e]}}setTabOrder(t){const e=this.menu.findID("Options","TabSelects");t?e.enable():e.disable(),this.menu.store.inTaborder(t)}setAssistiveMml(t){var e,s;this.document.options.enableAssistiveMml=t,t&&this.noRerender((()=>{this.settings.speech&&this.menu.pool.lookup("speech").setValue(!1),this.settings.braille&&this.menu.pool.lookup("braille").setValue(!1)})),!t||(null===(s=null===(e=jb._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s["assistive-mml"])?this.rerender():this.loadA11y("assistive-mml")}setAccessibilityMenus(){const t=this.settings.enrich,e=t?"enable":"disable";["Speech","Braille","Explorer"].forEach((t=>this.menu.findID(t)[e]()));const s=this.document.options;s.enableSpeech=s.enableBraille=s.enableExplorer=t,t||(this.settings.collapsible=!1,this.document.options.enableCollapsible=!1)}setSpeech(t){var e,s;this.enableAccessibilityItems("Speech",t),this.document.options.enableSpeech=t,t&&(this.settings.assistiveMml&&this.noRerender((()=>this.menu.pool.lookup("assistiveMml").setValue(!1))),this.settings.brailleSpeech&&this.noRerender((()=>this.menu.pool.lookup("brailleSpeech").setValue(!1)))),!t||(null===(s=null===(e=jb._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.explorer)?this.rerender(lr.COMPILED):this.loadA11y("explorer")}setBraille(t){var e,s;this.enableAccessibilityItems("Braille",t),this.document.options.enableBraille=t,t&&this.settings.assistiveMml&&this.noRerender((()=>this.menu.pool.lookup("assistiveMml").setValue(!1))),!t||(null===(s=null===(e=jb._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.explorer)?this.rerender(lr.COMPILED):this.loadA11y("explorer")}setBrailleCode(t){this.document.options.sre.braille=t,this.rerender(lr.COMPILED)}setBrailleSpeech(t){t&&this.settings.speech?this.noRerender((()=>this.menu.pool.lookup("speech").setValue(!1))):this.enableAccessibilityItems("Speech",!0),this.settings.brailleCombine=this.document.options.a11y.brailleCombine=!1,this.rerender(lr.COMPILED)}setBrailleCombine(t){this.settings.brailleSpeech&&this.menu.pool.lookup("brailleSpeech").setValue(!1),this.settings.brailleSpeech=this.document.options.a11y.brailleSpeech=!1,this.rerender(lr.COMPILED)}setLocale(t){this.document.options.sre.locale=t,this.rerender(lr.COMPILED)}setRoleDescription(){this.rerender(lr.COMPILED)}setEnrichment(t){var e,s;this.document.options.enableEnrichment=t,this.setAccessibilityMenus(),!t||(null===(s=null===(e=jb._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.explorer)?this.rerender(lr.COMPILED):this.loadA11y("explorer")}setCollapsible(t){var e,s;this.document.options.enableComplexity=t,t&&!this.settings.enrich&&(this.settings.enrich=this.document.options.enableEnrichment=!0,this.setAccessibilityMenus()),t||this.menu.pool.lookup("highlight").setValue("None"),!t||(null===(s=null===(e=jb._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.complexity)?this.rerender(lr.COMPILED):this.loadA11y("complexity")}setHighlight(t){var e,s;if("None"!==t){if(!this.settings.collapsible){const t=this.menu.pool.lookup("collapsible");t.setValue(!0),null===(s=null===(e=t.items[0])||void 0===e?void 0:e.executeCallbacks_)||void 0===s||s.call(e)}qb.loadingPromises.has("a11y/complexity")||this.rerender(lr.COMPILED)}}setColor(t,e,s){const i=this.document.options.a11y;e||(e=i["fg"===t?"foregroundColor":"backgroundColor"]),s||(s=i["fg"===t?"foregroundOpacity":"backgroundOpacity"]),jb._.a11y.explorer.Region.LiveRegion.setColor(t,1,e.toLowerCase(),parseInt(s)/100)}scaleAllMath(){const t=(100*parseFloat(this.settings.scale)).toFixed(1).replace(/.0$/,""),e=prompt("Scale all mathematics (compared to surrounding text) by",t+"%");if(this.current){const t=this.menu.mathItem.explorers.speech;t.refocus=this.current,t.focus()}if(e)if(e.match(/^\s*\d+(\.\d*)?\s*%?\s*$/)){const t=parseFloat(e)/100;t?this.menu.pool.lookup("scale").setValue(String(t)):alert("The scale should not be zero")}else alert("The scale should be a percentage (e.g., 120%)")}resetDefaults(){this.noRerender((()=>{const t=this.menu.pool,e=this.defaultSettings;for(const s of Object.keys(e)){const i=t.lookup(s);if(i){if(i.getValue()!==e[s]){i.setValue(e[s]);const t=i.items[0];t&&t.executeCallbacks_()}}else Object.hasOwn(this.settings,s)&&(this.settings[s]=e[s])}})),this.rerender(lr.COMPILED)}checkComponent(t){const e=qb.loadingPromises.get(t);e&&eo.retryAfter(e)}loadComponent(t,e){if(qb.loadingPromises.has(t))return;const s=jb.loader;if(!s)return;qb.loading++;const i=s.load(t).then((()=>{qb.loading--,qb.loadingPromises.delete(t),0===qb.loading&&qb._loadingPromise&&(qb._loadingPromise=null,qb._loadingOK()),e()})).catch((t=>{qb._loadingPromise?(qb._loadingPromise=null,qb._loadingFailed(t)):console.log(t)}));qb.loadingPromises.set(t,i)}loadA11y(t){const e=!lr.ENRICHED;this.loadComponent("a11y/"+t,(()=>{var s,i;const r=jb.startup;eo.handlers.unregister(r.handler),r.handler=r.getHandler(),eo.handlers.register(r.handler);const n=this.document;this.document=r.document=r.getDocument(),this.document.processed=n.processed,this.document.menu=this,n.webworker&&(this.document.webworker=n.webworker),this.setA11y(this.settings),this.defaultSettings=Object.assign({},this.document.options.a11y,(null===(i=null===(s=jb.config)||void 0===s?void 0:s.options)||void 0===i?void 0:i.a11y)||{},this.defaultSettings),this.document.outputJax.reset(),this.transferMathList(n),this.document.processed=n.processed,qb._loadingPromise||(this.document.outputJax.reset(),eo.handleRetriesFor((()=>{this.rerender("complexity"===t||e?lr.COMPILED:lr.TYPESET)})))}))}transferMathList(t){const e=this.document.options.MathItem;for(const s of t.math){const t=new e;Object.assign(t,s),this.document.math.push(t)}}toMML(t){return this.MmlVisitor.visitTree(t.root,t,{filterSRE:!this.settings.showSRE,filterTex:!this.settings.showTex,texHints:this.settings.texHints,semantics:this.settings.semantics&&"MathML"!==t.inputJax.name})}toSVG(t){return Ub(this,void 0,void 0,(function*(){const e=this.jax.SVG;if(!e)return"SVG can't be produced.<br>Try switching to SVG output first.";const s=e.adaptor,i=e.options.fontCache,r=!!t.root.getProperty("process-breaks");if("global"!==i&&(t.display||!r)&&"SVG"===s.getAttribute(t.typesetRoot,"jax"))for(const e of s.childNodes(t.typesetRoot))if("svg"===s.kind(e))return this.formatSvg(s.serializeXML(e));return this.typesetSVG(t,i,r)}))}typesetSVG(t,e,s){return Ub(this,void 0,void 0,(function*(){const i=this.jax.SVG,r=i.html("div");"global"===e&&(i.options.fontCache="local");const n=t.root;return t.root=n.copy(!0),t.root.setInheritedAttributes({},t.display,0,!1),s&&(i.unmarkInlineBreaks(t.root),t.root.setProperty("inlineMarked",!1)),yield eo.handleRetriesFor((()=>{i.toDOM(t,r,i.document)})),t.root=n,i.options.fontCache=e,this.formatSvg(i.adaptor.serializeXML(r))}))}formatSvg(t){const e=this.constructor.SvgCss,s=(t=(t=t.match(/^<svg.*?><defs>/)?t.replace(/<defs>/,`<defs><style>${e}</style>`):t.replace(/^(<svg.*?>)/,`$1<defs><style>${e}</style></defs>`)).replace(/ (?:role|focusable)=".*?"/g,"").replace(/"currentColor"/g,'"black"')).split(/(<\/?[a-zA-Z].*?>)/);for(let t=2,e="";t<s.length;t+=2){const i=s[t-1],r=s[t+1];"/"!==i.charAt(1)&&"/"!==i.charAt(i.length-2)&&(e+=" "),r&&("/"===r.charAt(1)&&(e=e.slice(2)),s[t+1]=r.replace(' xmlns:xlink="http://www.w3.org/1999/xlink"',"")),s[t]&&(s[t]="\n "+e+s[t].replace(/\n/g,"\n "+e)),s[t]+="\n"+e}return t=s.join(""),this.settings.showSRE||(t=t.replace(/ (?:data-semantic-.*?|data-speech-node)=".*?"/g,"")),this.settings.showTex||(t=t.replace(/ data-latex(?:-item)?=".*?"/g,"")),this.settings.texHints||(t=t.replace(/ data-mjx-(?:texclass|alternate|variant|pseudoscript|smallmatrix|mathaccent|auto-op|script-align|vbox)=".*?"/g,"").replace(/ data-mml-node="TeXAtom"/g,"")),`<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n${t}`}zoom(t,e){t&&!this.isZoomEvent(t,e)||this.zoomBox()}isZoomEvent(t,e){return this.settings.zoom===e&&(!this.settings.alt||t.altKey)&&(!this.settings.ctrl||t.ctrlKey)&&(!this.settings.cmd||t.metaKey)&&(!this.settings.shift||t.shiftKey)}rerender(t=lr.TYPESET){this.rerenderStart=Math.min(t,this.rerenderStart),!qb.loading&&jb.startup.hasTypeset&&this.document.whenReady((()=>Ub(this,void 0,void 0,(function*(){this.rerenderStart<=lr.COMPILED&&this.document.reset({inputJax:[]}),yield this.document.rerenderPromise(this.rerenderStart),this.rerenderStart=lr.LAST}))))}noRerender(t){qb.loading++;try{t(),qb.loading--}catch(t){throw qb.loading--,t}}copyMathML(){Rb(this.toMML(this.menu.mathItem))}copyOriginal(){Rb(this.menu.mathItem.math.trim())}copySvgImage(){this.toSVG(this.menu.mathItem).then((t=>{Rb(t)}))}copySpeechText(){Rb(this.menu.mathItem.outputData.speech)}copyBrailleText(){Rb(this.menu.mathItem.outputData.braille)}copyErrorMessage(){Rb(this.menu.errorMsg.trim())}addMenu(t){this.addEvents(t),this.menu.store.insert(t.typesetRoot),t.typesetRoot.tabIndex=this.settings.inTabOrder?0:-1}addEvents(t){const e=t.typesetRoot;e.addEventListener("mousedown",(()=>{var e,s;this.menu.mathItem=t,this.current=null===(s=null===(e=t.explorers)||void 0===e?void 0:e.speech)||void 0===s?void 0:s.current}),!0),e.addEventListener("contextmenu",(()=>{var e;this.menu.mathItem=t;const s=null===(e=t.explorers)||void 0===e?void 0:e.speech;s&&(t.outputData.nofocus=!this.current,s.refocus=this.current)}),!0),e.addEventListener("keydown",(()=>this.menu.mathItem=t),!0),e.addEventListener("click",(t=>this.zoom(t,"Click")),!0),e.addEventListener("dblclick",(t=>this.zoom(t,"DoubleClick")),!0)}clear(){this.menu.store.clear()}variable(t,e){return{name:t,getter:()=>this.settings[t],setter:s=>{this.settings[t]=s,e&&e(s),this.saveUserSettings()}}}a11yVar(t,e){return{name:t,getter:()=>this.getA11y(t),setter:s=>{this.settings[t]=s,this.setA11y({[t]:s}),e&&e(s),this.saveUserSettings()}}}submenu(t,e,s=[],i=!1){let r=[];for(const t of s)Array.isArray(t)?r=r.concat(t):r.push(t);return{type:"submenu",id:t,content:e,menu:{items:r},disabled:0===r.length||i}}command(t,e,s,i={}){return Object.assign({type:"command",id:t,content:e,action:s},i)}checkbox(t,e,s,i={}){return Object.assign({type:"checkbox",id:t,content:e,variable:s},i)}radioGroup(t,e){return e.map((e=>this.radio(e[0],e[1]||e[0],t)))}radio(t,e,s,i={}){return Object.assign({type:"radio",id:t,content:e,variable:s},i)}label(t,e){return{type:"label",id:t,content:e}}rule(){return{type:"rule"}}}function Hb(t){return class extends t{addMenu(t,e=!1){this.state()>=lr.CONTEXT_MENU||(this.isEscaped||!t.options.enableMenu&&!e||t.menu.addMenu(this),this.state(lr.CONTEXT_MENU))}getMenus(t){t.menu.menu.store.sort()}checkLoading(t){t.checkLoading()}}}function Wb(t){var e;return e=class extends t{constructor(...t){super(...t),this.menu=new this.options.MenuClass(this,this.options.menuOptions);const e=this.constructor.ProcessBits;e.has("context-menu")||e.allocate("context-menu"),this.options.MathItem=Hb(this.options.MathItem);const s=this.menu.settings,i=this.options,r=i.enableEnrichment=s.enrich;i.enableSpeech=s.speech&&r,i.enableBraille=s.braille&&r,i.enableComplexity=s.collapsible&&r,i.enableExplorer=r}addMenu(){if(!this.processed.isSet("context-menu")){for(const t of this.math)t.addMenu(this);this.processed.set("context-menu")}return this}getMenus(){this.menu.menu.store.sort()}checkLoading(){let t=!0;try{this._checkLoading(),t=!1}catch(t){if(!t.retry)throw t}return t}_checkLoading(){return this.menu.isLoading&&eo.retryAfter(this.menu.loadingPromise.catch((t=>console.log(t)))),this.options.enableComplexity&&this.menu.checkComponent("a11y/complexity"),this.options.enableExplorer&&this.menu.checkComponent("a11y/explorer"),this}state(t,e=!1){return super.state(t,e),t<lr.CONTEXT_MENU&&this.processed.clear("context-menu"),this}},e.OPTIONS=Object.assign(Object.assign({enableEnrichment:!0,enableComplexity:!0,enableSpeech:!0,enableBraille:!0,enableExplorer:!0,enableExplorerHelp:!0,enrichSpeech:"none",enrichError:(t,e,s)=>console.warn("Enrichment Error:",s)},t.OPTIONS),{MenuClass:qb,menuOptions:qb.OPTIONS,enableMenu:!0,sre:t.OPTIONS.sre||ki({}),a11y:t.OPTIONS.a11y||ki({}),renderActions:ki(Object.assign(Object.assign({},t.OPTIONS.renderActions),{addMenu:[lr.CONTEXT_MENU],getMenus:[lr.INSERTED+5,!1],checkLoading:[lr.UNPROCESSED+1,t=>t.checkLoading(),"",!1]}))}),e}function Vb(t){return t.documentClass=Wb(t.documentClass),t}qb.MENU_STORAGE="MathJax-Menu-Settings",qb.OPTIONS={settings:{showSRE:!1,showTex:!1,texHints:!0,semantics:!1,zoom:"NoZoom",zscale:"200%",renderer:"CHTML",alt:!0,cmd:!1,ctrl:!1,shift:!1,scale:1,overflow:"Scroll",breakInline:!0,autocollapse:!1,collapsible:!1,enrich:!0,inTabOrder:!0,assistiveMml:!1,speech:!0,braille:!0,brailleCode:"nemeth",brailleSpeech:!1,brailleCombine:!1,speechRules:"clearspeak-default",roleDescription:"math",tabSelects:"all",help:!0},jax:{CHTML:null,SVG:null},annotationTypes:ki({TeX:["TeX","LaTeX","application/x-tex"],StarMath:["StarMath 5.0"],Maple:["Maple"],ContentMathML:["MathML-Content","application/mathml-content+xml"],OpenMath:["OpenMath"]})},qb.SvgCss=["svg a{fill:blue;stroke:blue}",'[data-mml-node="merror"]>g{fill:red;stroke:red}','[data-mml-node="merror"]>rect[data-background]{fill:yellow;stroke:none}',"[data-frame],[data-line]{stroke-width:70px;fill:none}",".mjx-dashed{stroke-dasharray:140}",".mjx-dotted{stroke-linecap:round;stroke-dasharray:0,140}","use[data-c]{stroke-width:3px}"].join("\n"),qb.loading=0,qb.loadingPromises=new Map,qb._loadingPromise=null,qb._loadingOK=null,qb._loadingFailed=null,cr("CONTEXT_MENU",170),MathJax.loader&&MathJax.loader.checkVersion("ui/menu",ni,"ui"),di({_:{a11y:{speech:{SpeechMenu:Us}},ui:{menu:{AnnotationMenu:qs,MJContextMenu:Bs,Menu:Vs,MenuHandler:Gs,MenuUtil:js,MmlVisitor:Ws,RadioCompare:Hs}}}}),MathJax.startup&&pi&&MathJax.startup.extendHandler((t=>Vb(t)),20),MathJax.loader&&MathJax.loader.checkVersion("a11y/sre",ni,"a11y"),di({_:{a11y:{sre_ts:Fs}}}),cr("ENRICHED",lr.COMPILED+10);class Gb extends Qn{visitTree(t,e){this.mactionId=0;const s=super.visitTree(t);return this.mactionId&&(e.inputData.hasMaction=!0),s}visitHtmlNode(t,e){return t.getSerializedXML()}visitMactionNode(t,e){const[s,i]=0===t.childNodes.length?["",""]:["\n",e],r=this.childNodeMml(t,e+" ",s);let n=this.getAttributes(t);if("toggle"===t.attributes.get("actiontype")){const e=++this.mactionId;t.setProperty("mactionId",e),n=` data-maction-id="${e}" selection="${t.attributes.get("selection")}"`+n.replace(/ selection="\d+"/,"").replace(/ data-maction-id="\d+"/,"")}return`${e}<maction${n}>`+(r.match(/\S/)?s+r+i:"")+"</maction>"}}function Xb(t,e,s){return class extends t{constructor(){super(...arguments),this.toMathML=s}serializeMml(t){if("outerHTML"in t)return t.outerHTML;if("undefined"!=typeof Element&&"undefined"!=typeof window&&t instanceof Element){const e=window.document.createElement("div");return e.appendChild(t),e.innerHTML}return t.toString()}enrich(t,s=!1){if(!(this.state()>=lr.ENRICHED)){if(!this.isEscaped&&(t.options.enableEnrichment||s)){const s=new t.options.MathItem("",e);try{let e;e=this.inputData.originalMml?this.adjustSelections():this.inputData.originalMml=this.toMathML(this.root,this);const i=pb(e);this.inputData.enrichedMml=s.math=this.serializeMml(i),s.math=s.math.replace(/ role="treeitem"/g,' data-speech-node="true"').replace(/ aria-level/g," data-semantic-level-number").replace(/ aria-(?:posinset|owns|setsize)=".*?"/g,""),s.display=this.display,s.compile(t),this.root=s.root}catch(e){t.options.enrichError(t,this,e)}}this.state(lr.ENRICHED)}}toEnriched(t){return this.serializeMml(pb(t))}unEnrich(t){const s=this.inputData.originalMml;if(!s)return;const i=new t.options.MathItem("",e);i.math=s,i.display=this.display,i.compile(t),this.root=i.root}adjustSelections(){const t=this.inputData.originalMml;if(!this.inputData.hasMaction)return t;const e=[];return this.root.walkTree((t=>{t.isKind("maction")&&(e[t.attributes.get("data-maction-id")]=t)})),t.replace(/(data-maction-id="(\d+)" selection=)"\d+"/g,((t,s,i)=>`${s}"${e[i].attributes.get("selection")}"`))}}}function zb(t,e){var s;return(s=class extends t{constructor(...t){super(...t),e.setMmlFactory(this.mmlFactory);const s=this.constructor.ProcessBits;s.has("enriched")||s.allocate("enriched");const i=new Gb(this.mmlFactory);this.options.MathItem=Xb(this.options.MathItem,e,((t,e)=>i.visitTree(t,e)))}enrich(){if(!this.processed.isSet("enriched")){if(this.options.enableEnrichment){db(this.options.sre);for(const t of this.math)t.enrich(this)}this.processed.set("enriched")}return this}enrichError(t,e,s){console.warn("Enrichment error:",s)}state(t,e=!1){if(super.state(t,e),t<lr.ENRICHED&&(this.processed.clear("enriched"),t>=lr.COMPILED))for(const t of this.math)t.unEnrich(this);return this}}).OPTIONS=Object.assign(Object.assign({},t.OPTIONS),{enableEnrichment:!0,enrichError:(t,e,s)=>t.enrichError(t,e,s),renderActions:ki(Object.assign(Object.assign({},t.OPTIONS.renderActions),{enrich:[lr.ENRICHED]})),sre:ki({speech:"none",locale:"en",domain:"clearspeak",style:"default",braille:"nemeth",structure:!0,aria:!0})}),s}function Kb(t,e){return e.setAdaptor(t.adaptor),t.documentClass=zb(t.documentClass,e),t}MathJax.loader&&MathJax.loader.checkVersion("a11y/semantic-enrich",ni,"a11y"),di({_:{a11y:{"semantic-enrich":Xs}}}),MathJax.startup&&MathJax.startup.extendHandler((t=>Kb(t,new Cc({allowHtmlInTokenNodes:!0}))));const Jb=["pitch","rate","volume"];function $b(t){const e=mb(t),s=[],i=[];return Yb(Array.from(e.childNodes),s,i),[i.join(" "),s]}function Yb(t,e,s,i={}){for(const r of t)if(3!==r.nodeType){if(1===r.nodeType){const t=r,n=t.tagName;if("speak"===n)continue;if("prosody"===n){Yb(Array.from(r.childNodes),e,s,Zb(t,i));continue}switch(n){case"break":e.push({pause:t.getAttribute("time")});break;case"mark":e.push({mark:t.getAttribute("name")});break;case"say-as":{const r=t.textContent;e.push(Object.assign({text:r,character:!0},i)),s.push(r);break}}}}else{const t=r.textContent.trim();t&&(s.push(t),e.push(Object.assign({text:t},i)))}}const Qb={pitch:(t,e)=>t/100*1,volume:(t,e)=>t/100*.5,rate:(t,e)=>t/100*1};function Zb(t,e){const s={};for(const i of Jb)if(t.hasAttribute(i)){const[r,n]=eE(t.getAttribute(i));if(!r){s[i]="volume"===i?.5:1;continue}let o=e[i];o=o||("volume"===i?.5:1);const a=Qb[i](parseInt(n,10),r);s[i]="-"===r?o-a:o+a}return s}const tE=/([+-]?)([0-9]+)%/;function eE(t){const e=t.match(tE);return e?[e[1],e[2]]:(console.warn("Something went wrong with the prosody matching."),["","100"])}function sE(t,e,s,i=" "){if(!t)return"";const r=[t];return e&&r.unshift(e),s&&r.push(s),r.join(i)}function iE(t,e="en",s="100"){return $b(`<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="${e}"><prosody rate="${s}%">${t}</prosody></speak>`)}function rE(){const t=new AudioContext,e=t.createOscillator();e.frequency.value=300,e.connect(t.destination),e.start(t.currentTime),e.stop(t.currentTime+.05)}var nE,oE;!function(t){t[t.NONE=0]="NONE",t[t.DEPTH=1]="DEPTH",t[t.SUMMARY=2]="SUMMARY"}(nE||(nE={})),function(t){t.SPEECH="data-semantic-speech-none",t.SPEECH_SSML="data-semantic-speech",t.SUMMARY="data-semantic-summary-none",t.SUMMARY_SSML="data-semantic-summary",t.PREFIX="data-semantic-prefix-none",t.PREFIX_SSML="data-semantic-prefix",t.POSTFIX="data-semantic-postfix-none",t.POSTFIX_SSML="data-semantic-postfix",t.BRAILLE="data-semantic-braille"}(oE||(oE={}));class aE{constructor(){this.promise=Promise.resolve(),this.adaptor=null,this._options={},this._init=!1}set element(t){this._element=t}get element(){return this._element}set options(t){this._options=Object.assign({},(null==t?void 0:t.sre)||{},{enableSpeech:t.enableSpeech,enableBraille:t.enableBraille}),delete this._options.custom}get options(){return this._options}init(t,e,s){this.options=t,this._init||(this.adaptor=e,this.webworker=s,this._init=!0)}update(t){Object.assign(this.options,t)}Speech(t){const e=t.outputData.mml,s=Object.assign({},this.options,{modality:"speech"});return this.promise=this.webworker.Speech(e,s,t)}SpeechFor(t,e){const s=Object.assign({},this.options,{modality:"speech"});return this.webworker.speechFor(e,s,t)}cancel(t){var e;null===(e=this.webworker)||void 0===e||e.Cancel(t)}updateRegions(t,e,s){e.Update(this.getLabel(t)),s.Update(this.getBraille(t))}getOptions(t){var e,s,i,r;return{locale:null!==(e=this.adaptor.getAttribute(t,"data-semantic-locale"))&&void 0!==e?e:"",domain:null!==(s=this.adaptor.getAttribute(t,"data-semantic-domain"))&&void 0!==s?s:"",style:null!==(i=this.adaptor.getAttribute(t,"data-semantic-style"))&&void 0!==i?i:"",domain2style:null!==(r=this.adaptor.getAttribute(t,"data-semantic-domain2style"))&&void 0!==r?r:""}}nextRules(t){const e=this.getOptions(t.typesetRoot);return this.update(e),this.promise=this.webworker.nextRules(t.outputData.mml,Object.assign({},this.options,{modality:"speech"}),t)}nextStyle(t,e){const s=this.getOptions(e.typesetRoot);return this.update(s),this.promise=this.webworker.nextStyle(e.outputData.mml,Object.assign({},this.options,{modality:"speech"}),this.adaptor.getAttribute(t,"data-semantic-id"),e)}getLabel(t,e="",s=" "){const i=this.adaptor;return sE(i.getAttribute(t,oE.SPEECH_SSML),i.getAttribute(t,oE.PREFIX_SSML),i.getAttribute(t,oE.POSTFIX_SSML),s)||i.getAttribute(t,"aria-label")}getBraille(t){const e=this.adaptor;return e.getAttribute(t,"aria-braillelabel")||e.getAttribute(t,oE.BRAILLE)}getLocalePreferences(t){return this.promise=this.webworker.clearspeakLocalePreferences(this.options,t)}getRelevantPreferences(t,e,s,i){const r=t.outputData.mml;return this.promise=this.webworker.clearspeakRelevantPreferences(r,e,s,i)}}var lE=function(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function a(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};class cE{constructor(t,e,s,i){this.cmd=t,this.item=e,this.resolve=s,this.reject=i}}class hE{constructor(t,e){this.adaptor=t,this.options=e,this.ready=!1,this.tasks=[],this.Commands={Ready(t,e){t.ready=!0,t.postNext()},Finished(t,e){const s=t.tasks.shift();e.success?s.resolve(e.result):s.reject(e.error),t.postNext()},Log(t,e){t.options.debug&&console.log("Log:",e)}}}Start(){return lE(this,void 0,void 0,(function*(){if(this.ready)throw Error("Worker already started");this.worker=yield this.adaptor.createWorker(this.Listener.bind(this),this.options)}))}debug(t,...e){this.options.debug&&console.info(t,...e)}Listener(t){this.debug("Worker >>> Client:",t.data),Object.hasOwn(this.Commands,t.data.cmd)?this.Commands[t.data.cmd](this,t.data.data):this.debug("Invalid command from worker: "+t.data.cmd)}Post(t,e){const s=new Promise(((s,i)=>{this.tasks.push(new cE(t,e,s,i))}));return this.ready&&1===this.tasks.length&&this.postNext(),s}postNext(){if(this.tasks.length){const t=Object.assign({},this.tasks[0].cmd,{debug:this.options.debug});this.worker.postMessage(t)}}Cancel(t){const e=this.tasks.findIndex((e=>e.item===t));e>0&&(this.tasks[e].reject(`Task ${this.tasks[e].cmd.cmd} cancelled`),this.tasks.splice(e,1))}Setup(t){return this.Post({cmd:"setup",data:{domain:t.domain,style:t.style,locale:t.locale,modality:t.modality}})}Speech(t,e,s){return lE(this,void 0,void 0,(function*(){this.Attach(s,e.enableSpeech,e.enableBraille,yield this.Post({cmd:"speech",data:{mml:t,options:e}},s))}))}nextRules(t,e,s){return lE(this,void 0,void 0,(function*(){this.Attach(s,e.enableSpeech,e.enableBraille,yield this.Post({cmd:"nextRules",data:{mml:t,options:e}},s))}))}nextStyle(t,e,s,i){return lE(this,void 0,void 0,(function*(){this.Attach(i,e.enableSpeech,e.enableBraille,yield this.Post({cmd:"nextStyle",data:{mml:t,options:e,nodeId:s}},i))}))}speechFor(t,e,s){return lE(this,void 0,void 0,(function*(){const i=yield this.Post({cmd:"speech",data:{mml:t,options:e}},s);return JSON.parse(i)}))}Attach(t,e,s,i){const r=JSON.parse(i),n=t.typesetRoot;if(!n)return;this.setSpecialAttributes(n,r.options,"data-semantic-",["locale","domain","style","domain2style"]);const o=this.adaptor;this.setSpecialAttributes(n,r.translations,"data-semantic-");for(const[t,e]of Object.entries(r.mactions)){let s=o.getElement("#"+t,n);s&&o.childNodes(s)[0]&&(s=o.childNodes(s)[0],"rect"===o.kind(s)&&(s=o.next(s)),o.setAttribute(s,"data-semantic-type","dummy"),this.setSpecialAttributes(s,e,""))}this.setSpeechAttributes(o.childNodes(n)[0],"",r,e,s),e&&(r.label&&(o.setAttribute(n,oE.SPEECH,r.label),o.setAttribute(n,oE.SPEECH_SSML,r.ssml),t.outputData.speech=r.label),o.setAttribute(n,"data-speech-attached","true")),s&&(r.braillelabel&&(o.setAttribute(n,oE.BRAILLE,r.braillelabel),t.outputData.braille=r.braillelabel),r.braille&&o.setAttribute(n,"data-braille-attached","true"))}setSpeechAttribute(t,e,s,i){var r,n;const o=this.adaptor,a=o.getAttribute(t,"data-semantic-id");if(o.removeAttribute(t,"data-speech-node"),s&&e.speech[a]["speech-none"]){o.setAttribute(t,"data-speech-node","true");for(let[s,i]of Object.entries(e.speech[a]))s=s.replace(/-ssml$/,""),i&&o.setAttribute(t,`data-semantic-${s}`,i)}if(i&&(null===(n=null===(r=e.braille)||void 0===r?void 0:r[a])||void 0===n?void 0:n["braille-none"])){o.setAttribute(t,"data-speech-node","true");const s=e.braille[a]["braille-none"];o.setAttribute(t,oE.BRAILLE,s)}}setSpeechAttributes(t,e,s,i,r){const n=this.adaptor;if(!t||"#text"===n.kind(t)||"#comment"===n.kind(t))return e;n.hasAttribute(t,"data-semantic-id")&&(this.setSpeechAttribute(t,s,i,r),e||n.hasAttribute(t,"data-semantic-parent")||(e=n.getAttribute(t,"data-semantic-id")));for(const o of Array.from(n.childNodes(t)))e=this.setSpeechAttributes(o,e,s,i,r);return e}setSpecialAttributes(t,e,s,i){if(e){i=i||Object.keys(e);for(const r of i){const i=e[r];i&&this.adaptor.setAttribute(t,`${s}${r.toLowerCase()}`,i)}}}Detach(t){const e=t.typesetRoot;this.adaptor.removeAttribute(e,"data-speech-attached"),this.adaptor.removeAttribute(e,"data-braille-attached"),this.detachSpeech(e)}detachSpeech(t){const e=this.adaptor,s=e.childNodes(t);if(s){if("#text"!==e.kind(t))for(const s of["none","summary-none","speech","speech-none","summary","braille"])e.removeAttribute(t,`data-semantic-${s}`);for(const t of s)this.detachSpeech(t)}}Terminate(){this.debug("Terminating pending tasks");for(const t of this.tasks)t.reject(`${t.cmd.data.cmd} cancelled by WorkerHandler termination`);return this.tasks=[],this.debug("Terminating worker"),this.worker.terminate()}Stop(){return lE(this,void 0,void 0,(function*(){if(!this.worker)throw Error("Worker has not been started");yield this.Terminate(),this.worker=null,this.ready=!1}))}clearspeakLocalePreferences(t,e){return lE(this,void 0,void 0,(function*(){yield this.Post({cmd:"localePreferences",data:{options:t}}).then((s=>{e.set(t.locale,JSON.parse(s))}))}))}clearspeakRelevantPreferences(t,e,s,i){return lE(this,void 0,void 0,(function*(){yield this.Post({cmd:"relevantPreferences",data:{mml:t,id:e}}).then((t=>{s.set(i,t)}))}))}}const dE=ui.config||{},uE=()=>(dE?.loader?.paths?.mathjax||dE?.__dirname||"/")+"/sre";var pE=function(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function a(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};function mE(t){return class extends t{constructor(){super(...arguments),this.generatorPool=new aE}attachSpeech(t){if(this.outputData.speechPromise=null,this.state()>=lr.ATTACHSPEECH)return;if(this.state(lr.ATTACHSPEECH),this.isEscaped||!t.options.enableSpeech&&!t.options.enableBraille||!t.options.enableEnrichment)return;t.getWebworker(),this.generatorPool.init(t.options,t.adaptor,t.webworker),this.outputData.mml=this.toMathML(this.root,this);const e=this.generatorPool.Speech(this).catch((e=>t.options.speechError(t,this,e)));t.savePromise(e),this.outputData.speechPromise=e}detachSpeech(t){t.webworker.Detach(this)}speechFor(t){return pE(this,void 0,void 0,(function*(){t=this.toEnriched(t);const e=yield this.generatorPool.SpeechFor(this,t);return[e.label,e.braillelabel]}))}clear(){this.generatorPool.cancel(this)}}}function gE(t){var e;return e=class extends t{constructor(...t){super(...t),this.webworker=null;const e=this.constructor.ProcessBits;e.has("attach-speech")||e.allocate("attach-speech"),this.options.MathItem=mE(this.options.MathItem)}getWebworker(){this.webworker||(this.webworker=new hE(this.adaptor,this.options.worker),this.webworker.Start())}attachSpeech(){if(!this.processed.isSet("attach-speech")){const t=this.options;if(t.enableEnrichment&&(t.enableSpeech||t.enableBraille)){this.getWebworker();for(const t of this.math)t.attachSpeech(this)}this.processed.set("attach-speech")}return this}speechError(t,e,s){console.warn("Speech generation error:",s)}state(t,e=!1){if(super.state(t,e),t<lr.ATTACHSPEECH&&(this.processed.clear("attach-speech"),t>=lr.TYPESET))for(const t of this.math)t.detachSpeech(this);return this}done(){const t=Object.create(null,{done:{get:()=>super.done}});return pE(this,void 0,void 0,(function*(){var e;return yield null===(e=this.webworker)||void 0===e?void 0:e.Stop(),t.done.call(this)}))}},e.OPTIONS=Object.assign(Object.assign({},t.OPTIONS),{enableSpeech:!0,enableBraille:!0,speechError:(t,e,s)=>t.speechError(t,e,s),renderActions:ki(Object.assign(Object.assign({},t.OPTIONS.renderActions),{attachSpeech:[lr.ATTACHSPEECH]})),worker:{path:uE(),maps:uE().replace(/[cm]js\/a11y\/sre$/,"bundle/sre/mathmaps"),worker:"speech-worker.js",debug:!1},a11y:ki({speech:!0,braille:!0})}),e}function fE(t,e){return!t.documentClass.prototype.enrich&&e&&(t=Kb(t,e)),t.documentClass=gE(t.documentClass),t}if(cr("ATTACHSPEECH",lr.INSERTED+10),MathJax.loader&&MathJax.loader.checkVersion("a11y/speech",ni,"a11y"),di({_:{a11y:{speech_ts:$s,speech:{GeneratorPool:Ks,SpeechUtil:zs,WebWorker:Js}}}}),MathJax.loader){let t=fi.resolvePath("[sre]",!1),e=fi.resolvePath("[mathmaps]",!1);if(mi.window)t=new URL(t,location).href,e=new URL(e,location).href;else{const s="undefined"!=typeof require?require:MathJax.config.loader.require;s?.resolve?(t=mi.path(s.resolve(`${t}/require.mjs`)).replace(/\/[^\/]*$/,""),e=mi.path(s.resolve(`${e}/base.json`)).replace(/\/[^\/]*$/,"")):t=e=""}t&&hi(MathJax.config,"options",{worker:{path:t,maps:e}})}MathJax.startup&&MathJax.startup.extendHandler((t=>fE(t)));class bE{constructor(t){this.document=t,this.CLASS=this.constructor,this.AddStyles()}static get sheetId(){return"MJX-"+this.name+"-styles"}static get styleSheet(){return document.head.querySelector("#"+this.sheetId)}AddStyles(){const t=this.CLASS.sheetId;if(!this.CLASS.style||this.document.adaptor.head().querySelector("#"+t))return;const e=this.document.adaptor.node("style",{id:t});e.innerHTML=this.CLASS.style.cssText,this.document.adaptor.head().appendChild(e)}AddElement(){if(this.div)return;const t=this.document.adaptor.node("div");t.classList.add(this.CLASS.className),this.div=t,this.inner=this.document.adaptor.node("div"),this.div.appendChild(this.inner),this.document.adaptor.body(this.document.adaptor.document).appendChild(this.div)}Show(t){this.AddElement(),this.position(t),this.div.classList.add(this.CLASS.className+"_Show")}Hide(){this.div&&(this.div.remove(),this.div=null,this.inner=null)}stackRegions(t){const e=t.getBoundingClientRect();let s=0,i=Number.POSITIVE_INFINITY;const r=this.document.adaptor.document.getElementsByClassName(this.CLASS.className+"_Show");for(let t,e=0;t=r[e];e++)t!==this.div&&(s=Math.max(t.getBoundingClientRect().bottom,s),i=Math.min(t.getBoundingClientRect().left,i));const n=(s||e.bottom+10)+window.scrollY,o=(i<Number.POSITIVE_INFINITY?i:e.left)+window.scrollX;this.div.style.top=n+"px",this.div.style.left=o+"px"}}class EE extends bE{Clear(){}Update(){}Hide(){}Show(){}AddElement(){}AddStyles(){}position(){}}class xE extends bE{Clear(){this.div&&(this.Update(""),this.inner.style.top="",this.inner.style.backgroundColor="")}Update(t){t&&this.AddElement(),this.inner&&(this.inner.textContent="",this.inner.textContent=t||"\xa0")}position(t){this.stackRegions(t)}}class yE extends xE{}yE.className="MJX_ToolTip",yE.style=new lo({[`.${yE.className}`]:{width:"auto",height:"auto",opacity:1,"text-align":"center","border-radius":"4px",padding:0,"border-bottom":"1px dotted black",position:"absolute",display:"inline-block","background-color":"white","z-index":202},[`.${yE.className} > div`]:{"border-radius":"inherit",padding:"0 2px"},"@media (prefers-color-scheme: dark)":{["."+yE.className]:{"background-color":"#222025","box-shadow":"0px 5px 20px #000",border:"1px solid #7C7C7C"}}});class NE extends xE{static setColor(t,e,s,i){const r=this.styleSheet;if(r){const n=r.sheet.cssRules[0].style,o=`--mjx-${t}${e}-color`,a=`rgba(var(--mjx-${t}-${s}), ${1===i?1:`var(--mjx-${t}${e}-alpha)`})`;n.getPropertyValue(o)!==a&&n.setProperty(o,a);const l=`--mjx-${t}${e}-alpha`;n.getPropertyValue(l)!==String(i)&&(n.setProperty(l,i),r.sheet.cssRules[1].cssRules[0].style.setProperty(l,Math.pow(i,.7071)))}}}NE.className="MJX_LiveRegion",NE.priority={primary:1,secondary:2},NE.style=new lo({":root":{"--mjx-fg-red":"255, 0, 0","--mjx-fg-green":"0, 255, 0","--mjx-fg-blue":"0, 0, 255","--mjx-fg-yellow":"255, 255, 0","--mjx-fg-cyan":"0, 255, 255","--mjx-fg-magenta":"255, 0, 255","--mjx-fg-white":"255, 255, 255","--mjx-fg-black":"0, 0, 0","--mjx-bg-red":"255, 0, 0","--mjx-bg-green":"0, 255, 0","--mjx-bg-blue":"0, 0, 255","--mjx-bg-yellow":"255, 255, 0","--mjx-bg-cyan":"0, 255, 255","--mjx-bg-magenta":"255, 0, 255","--mjx-bg-white":"255, 255, 255","--mjx-bg-black":"0, 0, 0","--mjx-live-bg-color":"white","--mjx-live-shadow-color":"#888","--mjx-live-border-color":"#CCCCCC","--mjx-bg1-color":"rgba(var(--mjx-bg-blue), var(--mjx-bg-alpha))","--mjx-fg1-color":"rgba(var(--mjx-fg-black), 1)","--mjx-bg2-color":"rgba(var(--mjx-bg-red), 1)","--mjx-fg2-color":"rgba(var(--mjx-fg-black), 1)","--mjx-bg1-alpha":.2,"--mjx-fg1-alpha":1,"--mjx-bg2-alpha":1,"--mjx-fg2-alpha":1},"@media (prefers-color-scheme: dark)":{":root":{"--mjx-bg-blue":"132, 132, 255","--mjx-bg-white":"0, 0, 0","--mjx-bg-black":"255, 255, 255","--mjx-fg-white":"0, 0, 0","--mjx-fg-black":"255, 255, 255","--mjx-live-bg-color":"#222025","--mjx-live-shadow-color":"black","--mjx-live-border-color":"#7C7C7C","--mjx-bg1-alpha":.3,"--mjx-fg1-alpha":1,"--mjx-bg2-alpha":1,"--mjx-fg2-alpha":1}},[`.${NE.className}`]:{position:"absolute",top:0,display:"none",width:"auto",height:"auto",padding:0,opacity:1,"z-index":"202",left:0,right:0,margin:"0 auto","background-color":"var(--mjx-live-bg-color)","box-shadow":"0px 5px 20px var(--mjx-live-shadow-color)",border:"2px solid var(--mjx-live-border-color)"},[`.${NE.className}_Show`]:{display:"block"},[`.${NE.className} > div`]:{color:"var(--mjx-fg1-color)","background-color":"var(--mjx-bg1-color)"},"mjx-container [data-sre-highlight-1]:not([data-mjx-collapsed], rect)":{color:"var(--mjx-fg1-color) ! important",fill:"var(--mjx-fg1-color) ! important"},[["mjx-container:not([data-mjx-clone-container])","[data-sre-highlight-1]:not([data-sre-enclosed], rect)"].join(" ")]:{"background-color":"var(--mjx-bg1-color) ! important"},"mjx-container rect[data-sre-highlight-1]:not([data-sre-enclosed])":{fill:"var(--mjx-bg1-color) ! important"},"mjx-container [data-sre-highlight-2]":{color:"var(--mjx-fg2-color) ! important","background-color":"var(--mjx-bg2-color) ! important",fill:"var(--mjx-fg2-color) ! important"},"mjx-container rect[data-sre-highlight-2]":{fill:"var(--mjx-bg2-color) ! important"}});class AE extends NE{constructor(){super(...arguments),this.active=!1,this.node=null,this.clear=!1,this.voiceRequest=!1,this.voiceCancelled=!1}Show(t){super.Update("\xa0"),this.node=t,super.Show(t)}Update(t){if(this.voiceRequest)return void this.makeVoice(t);speechSynthesis.onvoiceschanged=(()=>this.voiceRequest=!0).bind(this);new Promise((t=>{setTimeout((()=>{this.voiceRequest?t(!0):setTimeout((()=>{this.voiceRequest=!0,t(!0)}),100)}),100)})).then((()=>this.makeVoice(t)))}makeVoice(t){this.active=this.document.options.a11y.voicing&&!!speechSynthesis.getVoices().length,speechSynthesis.cancel(),this.clear=!0;const[e,s]=iE(t,this.document.options.sre.locale,this.document.options.sre.rate);super.Update(e),this.active&&e&&this.makeUtterances(s,this.document.options.sre.locale)}makeUtterances(t,e){this.voiceCancelled=!1;let s=null;for(const i of t)if(i.mark){if(!s){this.highlightNode(i.mark,!0);continue}s.addEventListener("end",(t=>{this.voiceCancelled||this.highlightNode(i.mark)}))}else if(i.pause){const t=parseInt(i.pause.match(/^[0-9]+/)[0]);if(isNaN(t)||!s)continue;s.addEventListener("end",(e=>{speechSynthesis.pause(),setTimeout((()=>{speechSynthesis.resume()}),t)}))}else s=new SpeechSynthesisUtterance(i.text),i.rate&&(s.rate=i.rate),i.pitch&&(s.pitch=i.pitch),s.lang=e,speechSynthesis.speak(s);s&&s.addEventListener("end",(t=>{this.highlighter.unhighlight()}))}Hide(){this.cancelVoice(),super.Hide()}cancelVoice(){this.voiceCancelled=!0,speechSynthesis.cancel(),this.highlighter.unhighlight()}highlightNode(t,e=!1){this.highlighter.unhighlight();const s=Array.from(this.node.querySelectorAll(`[data-semantic-id="${t}"]`));this.clear&&!e||this.highlighter.highlight(s),this.clear=!1}}AE.style=null;class vE extends bE{position(t){const e=t.getBoundingClientRect(),s=this.div.getBoundingClientRect();let i,r=e.left+e.width/2-s.width/2;switch(r=r<0?0:r,r+=window.scrollX,this.document.options.a11y.align){case"top":i=e.top-s.height-10;break;case"bottom":i=e.bottom+10;break;default:i=e.top+e.height/2-s.height/2}i+=window.scrollY,i=i<0?0:i,this.div.style.top=i+"px",this.div.style.left=r+"px"}Show(t){this.AddElement(),this.div.style.fontSize=this.document.options.a11y.magnify,this.Update(t),super.Show(t)}Clear(){this.div&&(this.inner.textContent="",this.inner.style.top="",this.inner.style.backgroundColor="")}Update(t){if(!this.div)return;this.Clear();const e=this.cloneNode(t),s=e.querySelector("[data-mjx-clone]");this.inner.style.backgroundColor=t.style.backgroundColor,s.style.backgroundColor="",s.classList.remove("mjx-selected"),this.inner.appendChild(e),this.position(t)}cloneNode(t){let e=t.cloneNode(!0);if(e.setAttribute("data-mjx-clone","true"),"MJX-CONTAINER"!==e.nodeName){"g"!==e.nodeName&&(e.style.marginLeft=e.style.marginRight="0");const s=t.closest("mjx-container");if("MJX-MATH"!==e.nodeName&&"svg"!==e.nodeName){let i=s.firstChild;"MJX-BBOX"===i.nodeName&&(i=i.nextSibling),e=i.cloneNode(!1).appendChild(e).parentElement;const r=Array.from(s.querySelectorAll("[data-sre-enclosed]"));"svg"===i.nodeName?this.svgClone(t,r,e,s):this.chtmlClone(t,r,e)}e=s.cloneNode(!1).appendChild(e).parentElement,e.style.margin="0",e.style.minWidth=""}return e.setAttribute("data-mjx-clone-container","true"),e}chtmlClone(t,e,s){for(const i of e)if(i!==t){const t=i.getAttribute("data-semantic-id");t&&s.querySelector(`[data-semantic-id="${t}"]`)||s.appendChild(i.cloneNode(!0))}}svgClone(t,e,s,i){var r;let{x:n,y:o,width:a,height:l}=t.getBBox();if(e.length){s.firstChild.remove();const r=i.querySelector("g").cloneNode(!1);for(const s of e){const e=r.appendChild(s.cloneNode(!0));s===t&&e.setAttribute("data-mjx-clone","true");const[i,n]=this.xy(s);e.setAttribute("transform",`translate(${i}, ${n})`)}s.appendChild(r);const c=t.previousSibling,h=c.getBBox();a=h.width,l=h.height;const[d,u]=this.xy(c);n=d,o=u+h.y}const c=i.querySelector("g");if("full"===i.getAttribute("width")&&c.firstChild.lastChild===t)return s.innerHTML="",s.appendChild(i.cloneNode(!0).firstChild),s.querySelector(".mjx-selected").setAttribute("data-mjx-clone","true"),void(null===(r=s.querySelector("[data-sre-highlighter-added]"))||void 0===r||r.remove());s.firstChild.setAttribute("transform","scale(1, -1)");const h=parseFloat((s.getAttribute("viewBox")||s.getAttribute("data-mjx-viewBox")).split(/ /)[2]),d=parseFloat(s.style.minWidth||s.getAttribute("width"));s.setAttribute("viewBox",[n,-(o+l),a,l].join(" ")),s.removeAttribute("style"),s.setAttribute("width",d/h*a+"ex"),s.setAttribute("height",d/h*l+"ex")}xy(t){const e=DOMPoint.fromPoint({x:0,y:0}).matrixTransform(t.getCTM().inverse());return[-e.x,-e.y]}}vE.className="MJX_HoverRegion",vE.style=new lo({[`.${vE.className}`]:{display:"block",position:"absolute",width:"max-content",height:"auto",padding:0,opacity:1,"z-index":"202",margin:"0 auto","background-color":"white","line-height":0,"box-shadow":"0px 10px 20px #888",border:"2px solid #CCCCCC"},[`.${vE.className} > div`]:{overflow:"hidden",color:"var(--mjx-fg1-color)","background-color":"var(--mjx-bg1-color)"},"@media (prefers-color-scheme: dark)":{["."+vE.className]:{"background-color":"#222025","box-shadow":"0px 5px 20px #000",border:"1px solid #7C7C7C"}},"mjx-container[data-mjx-clone-container]":{padding:"2px ! important"},"mjx-math > mjx-mlabeledtr":{display:"inline-block","margin-right":".5em ! important"},"mjx-math > mjx-mtd":{float:"right"}});class _E{get highlighter(){return this.pool.highlighter}static stopEvent(t){t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopImmediatePropagation?t.stopImmediatePropagation():t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0}static create(t,e,s,i,...r){return new this(t,e,s,i,...r)}constructor(t,e,s,i,...r){this.document=t,this.pool=e,this.region=s,this.node=i,this.stoppable=!0,this.events=[],this._active=!1}Events(){return this.events}get active(){return this._active}set active(t){this._active=t}Attach(){this.AddEvents()}Detach(){this.RemoveEvents()}Start(){this.active=!0}Stop(){this.active&&(this.region.Clear(),this.region.Hide(),this.active=!1)}AddEvents(){for(const[t,e]of this.events)this.node.addEventListener(t,e)}RemoveEvents(){for(const[t,e]of this.events)this.node.removeEventListener(t,e)}Update(t=!1){}stopEvent(t){this.stoppable&&_E.stopEvent(t)}}var wE=function(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function a(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};const TE="Windows"===mi.os,CE=Array(40).fill("\u2800").join(""),LE="[data-speech-node]";function IE(t){return t.matches("mjx-container")}function RE(t,e=!0){return t.shiftKey&&e||t.metaKey||t.altKey||t.ctrlKey}class SE extends _E{static helpMessage(t,e,s){return`\n <h2 role="heading" aria-level="2">Exploring expressions ${t}</h2>\n\n <p>The mathematics on this page is being rendered by <a\n href="https://www.mathjax.org/" target="_blank">MathJax</a>, which\n generates both the text spoken by screen readers, as well as the\n visual layout for sighted users.</p>\n\n <p>Expressions typeset by MathJax can be explored interactively, and\n are focusable. You can use the <kbd>Tab</kbd> key to move to a typeset\n expression${e}. Initially, the expression will be read in full,\n but you can use the following keys to explore the expression\n further:</p>\n\n <ul>\n\n <li><kbd>Down Arrow</kbd> moves one level deeper into the\n expression to allow you to explore the current subexpression term by\n term.</li>\n\n <li><kbd>Up Arrow</kbd> moves back up a level within the\n expression.</li>\n\n <li><kbd>Right Arrow</kbd> moves to the next term in the\n current subexpression.</li>\n\n <li><kbd>Left Arrow</kbd> moves to the next term in the\n current subexpression.</li>\n\n <li><kbd>Shift</kbd>+<kbd>Arrow</kbd> moves to a\n neighboring cell within a table.</li>\n\n <li><kbd>0-9</kbd>+<kbd>0-9</kbd> jumps to a cell\n by its index in the table, where 0 = 10.</li>\n\n <li><kbd>Home</kbd> takes you to the top of the\n expression.</li>\n\n <li><kbd>Enter</kbd> or <kbd>Return</kbd> clicks a\n link or activates an active subexpression.</li>\n\n <li><kbd>Space</kbd> opens the MathJax contextual menu\n where you can view or copy the source format of the expression, or\n modify MathJax's settings.</li>\n\n <li><kbd>Escape</kbd> exits the expression\n explorer.</li>\n\n <li><kbd>x</kbd> gives a summary of the current\n subexpression.</li>\n\n <li><kbd>z</kbd> gives the full text of a collapsed\n expression.</li>\n\n <li><kbd>d</kbd> gives the current depth within the\n expression.</li>\n\n <li><kbd>s</kbd> starts or stops auto-voicing with\n synchronized highlighting.</li>\n\n <li><kbd>v</kbd> marks the current position in the\n expression.</li>\n\n <li><kbd>p</kbd> cycles through the marked positions in\n the expression.</li>\n\n <li><kbd>u</kbd> clears all marked positions and returns\n to the starting position.</li>\n\n <li><kbd>></kbd> cycles through the available speech\n rule sets (MathSpeak, ClearSpeak).</li>\n\n <li><kbd><</kbd> cycles through the verbosity levels\n for the current rule set.</li>\n\n <li><kbd>b</kbd> toggles whether Braille notation is combined\n with speech text for tactile Braille devices, as discussed\n below.\n\n <li><kbd>h</kbd> produces this help listing.</li>\n </ul>\n\n <p>The MathJax contextual menu allows you to enable or disable speech\n or Braille generation for mathematical expressions, the language to\n use for the spoken mathematics, and other features of MathJax. In\n particular, the Explorer submenu allows you to specify how the\n mathematics should be identified in the page (e.g., by saying "math"\n when the expression is spoken), and whether or not to include a\n message about the letter "h" bringing up this dialog box. Turning off\n speech and Braille will disable the expression explorer, its\n highlighting, and its help icon.</p>\n\n <p>Support for tactile Braille devices varies across screen readers,\n browsers, and operative systems. If you are using a Braille output\n device, you may need to select the "Combine with Speech" option in the\n contextual menu's Braille submenu in order to obtain Nemeth or Euro\n Braille output rather than the speech text on your Braille\n device. ${s}</p>\n\n <p>The contextual menu also provides options for viewing or copying a\n MathML version of the expression or its original source format,\n creating an SVG version of the expression, and viewing various other\n information.</p>\n\n <p>Finally, selecting the "Insert Hidden MathML" item from the options\n submenu will turn of MathJax's speech and Braille generation and\n instead use visually hidden MathML that some screen readers can voice,\n though support for this is not universal across all screen readers and\n operating systems. Selecting speech or Braille generation in their\n submenus will remove the hidden MathML again.</p>\n\n <p>For more help, see the <a\n href="https://docs.mathjax.org/en/latest/basic/accessibility.html"\n target="_blank">MathJax accessibility documentation.</a></p>\n `}get generators(){var t;return null===(t=this.item)||void 0===t?void 0:t.generatorPool}get role(){return this.item.ariaRole}get description(){return this.item.roleDescription}get none(){return this.document.options.a11y.brailleSpeech?this.item.brailleNone:this.item.none}get brailleNone(){return this.item.brailleNone}FocusIn(t){this.item.outputData.nofocus?this.item.outputData.nofocus=!1:(this.clicked||(this.Start(),this.backTab=t.target===this.img),this.clicked=null)}FocusOut(t){this.current&&!this.focusSpeech&&(this.document.options.keepRegions||(this.setCurrent(null),this.Stop()),document.hasFocus()||this.focusTop())}KeyDown(t){if(this.pendingIndex.shift(),this.region.cancelVoice(),RE(t,!1))return;const e=this.constructor,s=1===t.key.length?t.key.toLowerCase():t.key,[i,r]=e.keyMap.get(s)||[],n=i?void 0===r||this.active?i(this,t):r:this.undefinedKey(t);n||(this.stopEvent(t),!1===n&&this.sound&&this.NoMove())}MouseDown(t){var e;if(this.pendingIndex=[],this.region.cancelVoice(),RE(t)||2===t.buttons)return void(this.item.outputData.nofocus=!0);const s=this.findClicked(t.target,t.x,t.y);s!==this.document.infoIcon?(null===(e=document.getSelection())||void 0===e||e.removeAllRanges(),t.target.getAttribute("sre-highlighter-added")?this.refocus=s:this.clicked=s):this.stopEvent(t)}Click(t){if(RE(t)||2===t.buttons||"Range"===document.getSelection().type)return void this.FocusOut(null);const e=this.findClicked(t.target,t.x,t.y);if(e===this.document.infoIcon)return this.stopEvent(t),void this.help();e&&!this.node.contains(e)||(this.stopEvent(t),this.refocus=e,this.triggerLinkMouse()||this.Start())}DblClick(t){var e;const s=null!==(e=document.getSelection().direction)&&void 0!==e?e:"none";RE(t)||2===t.buttons||"none"!==s?this.FocusOut(null):(this.stopEvent(t),this.refocus=this.rootNode(),this.Start())}spaceKey(){return this.refocus=this.current,!0}hKey(){if(!this.document.options.enableExplorerHelp)return!0;this.refocus=this.current,this.help()}escapeKey(){return this.Stop(),this.focusTop(),this.setCurrent(null),!0}tabKey(t){if(0===this.anchors.length||!this.current)return!0;if(this.backTab){if(!t.shiftKey)return!0;const e=this.linkFor(this.anchors[this.anchors.length-1]);return 1===this.anchors.length&&e===this.current||void this.setCurrent(e)}const[e,s,i]=t.shiftKey?[this.anchors.slice(0).reverse(),Node.DOCUMENT_POSITION_PRECEDING,this.isLink()?this.getAnchor():this.current]:[this.anchors,Node.DOCUMENT_POSITION_FOLLOWING,this.current];for(const t of e)if(i.compareDocumentPosition(t)&s)return void this.setCurrent(this.linkFor(t));return!0}enterKey(t){if(this.active)if(this.triggerLinkKeyboard(t))this.Stop();else{const t=this.actionable(this.current);if(!t)return!1;this.refocus=t,t.dispatchEvent(new Event("click"))}else this.Start()}homeKey(){this.setCurrent(this.rootNode())}moveDown(t){return t?this.moveToNeighborCell(1,0):this.moveTo(this.firstNode(this.current))}moveUp(t){return t?this.moveToNeighborCell(-1,0):this.moveTo(this.getParent(this.current))}moveRight(t){return t?this.moveToNeighborCell(0,1):this.moveTo(this.nextSibling(this.current))}moveLeft(t){return t?this.moveToNeighborCell(0,-1):this.moveTo(this.prevSibling(this.current))}moveTo(t){if(!t)return!1;this.setCurrent(t)}moveToNeighborCell(t,e){const s=this.tableCell(this.current);if(!s)return!1;const[i,r]=this.cellPosition(s);if(null==i)return!1;const n=this.cellAt(this.cellTable(s),i+t,r+e);if(!n)return!1;this.setCurrent(n)}undefinedKey(t){return!this.active||RE(t)}addMark(){this.current===this.marks[this.marks.length-1]?this.setCurrent(this.current):(this.currentMark=this.marks.length-1,this.marks.push(this.current),this.speak("Position marked"))}prevMark(){if(this.currentMark<0){if(0===this.marks.length)return void this.setCurrent(this.lastMark||this.rootNode());this.currentMark=this.marks.length-1}const t=this.currentMark;this.setCurrent(this.marks[t]),this.currentMark=t-1}clearMarks(){this.marks=[],this.currentMark=-1,this.prevMark()}autoVoice(){const t=!this.document.options.a11y.voicing;this.document.menu?this.document.menu.menu.pool.lookup("voicing").setValue(t):this.document.options.a11y.voicing=t,this.Update()}toggleBraille(){const t=!this.document.options.a11y.brailleCombine;this.document.menu?this.document.menu.menu.pool.lookup("brailleCombine").setValue(t):this.document.options.a11y.brailleCombine=t}numberKey(t){if(!this.tableCell(this.current))return!1;if(0===t&&(t=10),this.pendingIndex.length){const e=this.cellTable(this.tableCell(this.current)),s=this.cellAt(e,this.pendingIndex[0]-1,t-1);if(this.pendingIndex=[],this.speak(String(t)),!s)return!1;setTimeout((()=>this.setCurrent(s)),500)}else this.pendingIndex=[null,t],this.speak(`Jump to row ${t} and column`)}depth(){var t,e,s;if("d"===this.speechType)return void this.setCurrent(this.current);this.speechType="d";const i=[[null!==(t=this.node.getAttribute("data-semantic-level"))&&void 0!==t?t:"Level",null!==(e=this.current.getAttribute("data-semantic-level-number"))&&void 0!==e?e:"0"].join(" ").trim()],r=this.actionable(this.current);r&&i.unshift(null!==(s=this.node.getAttribute("1"===r.getAttribute("toggle")?"data-semantic-expandable":"data-semantic-collapsible"))&&void 0!==s?s:""),this.speak(i.join(" "),this.current.getAttribute(oE.BRAILLE))}summary(){if("x"===this.speechType)return void this.setCurrent(this.current);this.speechType="x";const t=this.current.getAttribute(oE.SUMMARY);this.speak(t,this.current.getAttribute(oE.BRAILLE),this.SsmlAttributes(this.current,oE.SUMMARY_SSML))}nextRules(){this.node.removeAttribute("data-speech-attached"),this.restartAfter(this.generators.nextRules(this.item))}nextStyle(){this.node.removeAttribute("data-speech-attached"),this.restartAfter(this.generators.nextStyle(this.current,this.item))}details(){const t=this.actionable(this.current);if(!t||!t.getAttribute("data-collapsible")||"1"!==t.getAttribute("toggle")||"z"===this.speechType)return void this.setCurrent(this.current);this.speechType="z";const e=this.nodeId(this.current);let s;this.item.root.walkTree((t=>{t.attributes.get("data-semantic-id")===e&&(s=t)}));let i=this.item.toMathML(s,this.item);s.isKind("math")||(i=`<math>${i}</math>`),i=i.replace(/ (?:data-semantic-|aria-|data-speech-|data-latex).*?=".*?"/g,""),this.item.speechFor(i).then((([t,e])=>this.speak(t,e)))}help(){if(!this.document.options.enableExplorerHelp)return;const t=this.constructor,[e,s,i]=t.helpData.get(mi.os);po.post({title:"MathJax Expression Explorer Help",message:t.helpMessage(e,s,i),node:this.node,adaptor:this.document.adaptor,styles:{".mjx-dialog":{"max-height":"calc(min(35em, 90%))"},"mjx-dialog mjx-title":{"font-size":"133%",margin:".5em 1.75em"},"mjx-dialog h2":{"font-size":"20px",margin:".5em 0"},"mjx-dialog ul":{"list-style-type":"none"},"mjx-dialog li":{"margin-bottom":".5em"}}})}setCurrent(t,e=!1){if(this.backTab=!1,this.speechType="",document.hasFocus()||(this.refocus=this.current),this.node.setAttribute("aria-busy","true"),this.current){this.pool.unhighlight();for(const t of Array.from(this.node.querySelectorAll(".mjx-selected")))t.classList.remove("mjx-selected");"last"===this.document.options.a11y.tabSelects&&(this.refocus=this.current),t||(this.lastMark=this.current,this.removeSpeech()),this.current=null}if(this.current=t,this.currentMark=-1,this.current){const s=[...this.getSplitNodes(this.current)];this.highlighter.encloseNodes(s,this.node);for(const t of s)t.getAttribute("data-sre-enclosed")||t.classList.add("mjx-selected");this.pool.highlight(s),this.addSpeech(t,e),this.node.setAttribute("tabindex","-1"),this.Update()}this.node.removeAttribute("aria-busy")}getSplitNodes(t){const e=this.nodeId(t);if(!e)return[t];if(this.cacheParts.has(e))return this.cacheParts.get(e);const s=Array.from(this.node.querySelectorAll(`[data-semantic-id="${e}"]`)),i=this.subtree(e,s);return this.cacheParts.set(e,[...s,...i]),this.cacheParts.get(e)}subtree(t,e){const s=this.subtrees.get(t),i=new Set;for(const t of e)Array.from(t.querySelectorAll("[data-semantic-id]")).forEach((t=>i.add(this.nodeId(t))));return[...function(t,e){if(!t)return new Set;if(!e)return t;return new Set([...t].filter((t=>!e.has(t))))}(s,i)].map((t=>this.getNode(t))).filter((t=>null!==t))}addSpeech(t,e){var s;if(!this.document.options.enableSpeech&&!this.document.options.enableBraille)return;this.anchors.length?setTimeout((()=>{var t;return null===(t=this.img)||void 0===t?void 0:t.remove()}),10):null===(s=this.img)||void 0===s||s.remove();let i=this.addComma([t.getAttribute(oE.PREFIX),t.getAttribute(oE.SPEECH),t.getAttribute(oE.POSTFIX)]).join(" ").trim();if(e){let t=this.description===this.none?"":", "+this.description;this.document.options.a11y.help&&this.document.options.enableExplorerHelp&&(t+=", press h for help"),i+=t}this.speak(i,t.getAttribute(oE.BRAILLE),this.SsmlAttributes(t,oE.SPEECH_SSML))}addComma(t){return t[2]&&(t[1]||t[0])&&(t[1]+=","),t}removeSpeech(){this.speech&&(this.unspeak(this.speech),this.speech=null,this.img&&this.node.append(this.img),this.node.setAttribute("tabindex","0"))}speak(t,e="",s=null,i=this.none){const r=this.speech,n=this.speech=document.createElement("mjx-speech");if(n.setAttribute("role",this.role),n.setAttribute("aria-label",t||this.none),n.setAttribute("aria-roledescription",i||this.none),n.setAttribute(oE.SPEECH,t),s&&(n.setAttribute(oE.PREFIX_SSML,s[0]||""),n.setAttribute(oE.SPEECH_SSML,s[1]||""),n.setAttribute(oE.POSTFIX_SSML,s[2]||"")),e&&(this.document.options.a11y.brailleSpeech&&(n.setAttribute("aria-label",e),n.setAttribute("aria-roledescription",this.brailleNone)),n.setAttribute("aria-braillelabel",e),n.setAttribute("aria-brailleroledescription",this.brailleNone),this.document.options.a11y.brailleCombine&&n.setAttribute("aria-label",e+CE+t)),n.setAttribute("tabindex","0"),TE){const t=document.createElement("mjx-speech-container");t.setAttribute("role","application"),t.setAttribute("aria-roledescription",this.none),t.setAttribute("aria-brailleroledescription",this.brailleNone),t.append(n),this.node.append(t),n.setAttribute("role","img")}else this.node.append(n);this.focusSpeech=!0,n.focus(),this.focusSpeech=!1,this.Update(),r&&setTimeout((()=>this.unspeak(r)),100)}unspeak(t){TE&&(t=t.parentElement),t.remove()}attachSpeech(){var t;const e=this.item,s=this.node;if(!s.hasAttribute("has-speech")){for(const t of Array.from(s.childNodes))t.setAttribute("aria-hidden","true");s.setAttribute("has-speech","true")}const i=e.roleDescription,r=(s.getAttribute(oE.SPEECH)||"")+(i?", "+i:"");null===(t=this.img)||void 0===t||t.remove(),this.img=this.document.adaptor.node("mjx-speech",{"aria-label":r,role:"img","aria-roledescription":e.none});const n=s.getAttribute(oE.BRAILLE);n&&(this.document.options.a11y.brailleSpeech&&(this.img.setAttribute("aria-label",n),this.img.setAttribute("aria-roledescription",this.brailleNone)),this.img.setAttribute("aria-braillelabel",n),this.img.setAttribute("aria-brailleroledescription",this.brailleNone),this.document.options.a11y.brailleCombine&&this.img.setAttribute("aria-label",n+CE+r)),s.appendChild(this.img),this.adjustAnchors()}detachSpeech(){var t;const e=this.node;null===(t=this.img)||void 0===t||t.remove(),e.removeAttribute("has-speech");for(const t of Array.from(e.childNodes))t.removeAttribute("aria-hidden");this.restoreAnchors()}adjustAnchors(){this.anchors=Array.from(this.node.querySelectorAll("a[href]"));for(const t of this.anchors){const e=t.getAttribute("href");t.setAttribute("data-mjx-href",e),t.removeAttribute("href")}this.anchors.length&&this.img.setAttribute("tabindex","0")}restoreAnchors(){for(const t of this.anchors)t.setAttribute("href",t.getAttribute("data-mjx-href")),t.removeAttribute("data-mjx-href");this.anchors=[]}focus(){this.node.focus()}nodeId(t){return t.getAttribute("data-semantic-id")}parentId(t){return t.getAttribute("data-semantic-parent")}getNode(t){return t?this.node.querySelector(`[data-semantic-id="${t}"]`):null}getParent(t){return this.getNode(this.parentId(t))}childArray(t){return t?t.getAttribute("data-semantic-children").split(/,/):[]}isCell(t){return!!t&&this.cellTypes.includes(t.getAttribute("data-semantic-type"))}isRow(t){return!!t&&"row"===t.getAttribute("data-semantic-type")}tableCell(t){for(;t&&t!==this.node;){if(this.isCell(t))return t;t=t.parentNode}return null}cellTable(t){const e=this.getParent(t);return this.isRow(e)?this.getParent(e):e}cellPosition(t){const e=this.getParent(t),s=this.childArray(e).indexOf(this.nodeId(t));if(!this.isRow(e))return[s,1];const i=this.getParent(e);return[this.childArray(i).indexOf(this.nodeId(e)),s]}cellAt(t,e,s){const i=this.getNode(this.childArray(t)[e]);if(!this.isRow(i))return 1===s?i:null;return this.getNode(this.childArray(i)[s])}firstNode(t){const e=t.getAttribute("data-semantic-owns");if(!e)return t.querySelector(LE);const s=e.split(/ /);for(const t of s){const e=this.getNode(t);if(null==e?void 0:e.hasAttribute("data-speech-node"))return e}return t.querySelector(LE)}rootNode(){const t=this.node.querySelector("[data-semantic-structure]");if(!t)return this.node.querySelector(LE);const e=t.getAttribute("data-semantic-structure").split(/ /)[0].replace("(","");return this.getNode(e)}nextSibling(t){var e;const s=this.parentId(t);if(!s)return null;const i=null===(e=this.getNode(s).getAttribute("data-semantic-owns"))||void 0===e?void 0:e.split(/ /);if(!i)return null;let r,n=i.indexOf(this.nodeId(t));do{r=this.getNode(i[++n])}while(r&&!r.hasAttribute("data-speech-node"));return r}prevSibling(t){var e;const s=this.parentId(t);if(!s)return null;const i=null===(e=this.getNode(s).getAttribute("data-semantic-owns"))||void 0===e?void 0:e.split(/ /);if(!i)return null;let r,n=i.indexOf(this.nodeId(t));do{r=this.getNode(i[--n])}while(r&&!r.hasAttribute("data-speech-node"));return r}findClicked(t,e,s){const i=this.document.infoIcon;if(i===t||i.contains(t))return i;if("SVG"!==this.node.getAttribute("jax"))return t.closest(LE);let r=null,n=this.node;for(;n;){n.matches(LE)&&(r=n);const t=Array.from(n.childNodes);n=null;for(const i of t)if(i!==this.speech&&i!==this.img&&i.tagName&&"rect"!==i.tagName.toLowerCase()){const{left:t,right:r,top:o,bottom:a}=i.getBoundingClientRect();if(t<=e&&e<=r&&o<=s&&s<=a){n=i;break}}}return r}isLink(t=this.current){var e;return!!(null===(e=null==t?void 0:t.getAttribute("data-semantic-attributes"))||void 0===e?void 0:e.includes("href:"))}getAnchor(t=this.current){const e=t.closest("a");return e&&this.node.contains(e)?e:null}linkFor(t){return null==t?void 0:t.querySelector('[data-semantic-attributes*="href:"]')}parentLink(t){const e=null==t?void 0:t.closest('[data-semantic-attributes*="href:"]');return e&&this.node.contains(e)?e:null}focusTop(){this.focusSpeech=!0,this.node.focus(),this.focusSpeech=!1}SsmlAttributes(t,e){return[t.getAttribute(oE.PREFIX_SSML),t.getAttribute(e),t.getAttribute(oE.POSTFIX_SSML)]}restartAfter(t){return wE(this,void 0,void 0,(function*(){yield t,this.attachSpeech();const e=this.current;this.current=null,this.pool.unhighlight(),this.setCurrent(e)}))}constructor(t,e,s,i,r,n,o,a){super(t,e,null,i),this.document=t,this.pool=e,this.region=s,this.node=i,this.brailleRegion=r,this.magnifyRegion=n,this.item=a,this.sound=!1,this.current=null,this.clicked=null,this.refocus=null,this.focusSpeech=!1,this.restarted=null,this.speech=null,this.speechType="",this.img=null,this.attached=!1,this.eventsAttached=!1,this.marks=[],this.currentMark=-1,this.lastMark=null,this.pendingIndex=[],this.cellTypes=["cell","line"],this.backTab=!1,this.events=super.Events().concat([["focusin",this.FocusIn.bind(this)],["focusout",this.FocusOut.bind(this)],["keydown",this.KeyDown.bind(this)],["mousedown",this.MouseDown.bind(this)],["click",this.Click.bind(this)],["dblclick",this.DblClick.bind(this)]]),this.subtrees=null,this.cacheParts=new Map}findStartNode(){let t=this.refocus||this.current;return!t&&this.restarted&&(t=this.node.querySelector(this.restarted)),this.refocus=this.restarted=null,t}Start(){const t=Object.create(null,{Start:{get:()=>super.Start}});return wE(this,void 0,void 0,(function*(){if(this.subtrees||(this.subtrees=new Map,this.getSubtrees()),!this.attached||this.active)return;if(this.document.activeItem=this.item,this.item.state()<lr.ATTACHSPEECH&&(this.item.attachSpeech(this.document),yield this.generators.promise),this.focusSpeech)return;this.node.classList.add("mjx-explorer-active"),this.document.options.enableExplorerHelp&&this.node.append(this.document.infoIcon);const e=this.findStartNode();this.setCurrent(e||this.rootNode(),!e),t.Start.call(this);const s=this.document.options,i=s.a11y;i.subtitles&&i.speech&&s.enableSpeech&&this.region.Show(this.node),i.viewBraille&&i.braille&&s.enableBraille&&this.brailleRegion.Show(this.node),i.keyMagnifier&&this.magnifyRegion.Show(this.current),this.Update()}))}Stop(){this.active&&(this.node.classList.remove("mjx-explorer-active"),this.document.options.enableExplorerHelp&&this.document.infoIcon.remove(),this.pool.unhighlight(),this.magnifyRegion.Hide(),this.region.Hide(),this.brailleRegion.Hide()),super.Stop()}Update(){this.active&&(this.region.node=this.node,(this.document.options.enableSpeech||this.document.options.enableBraille)&&this.generators.updateRegions(this.speech||this.node,this.region,this.brailleRegion),this.magnifyRegion.Update(this.current))}Attach(){this.attached||(super.Attach(),this.node.setAttribute("tabindex","0"),this.attached=!0)}Detach(){var t;super.RemoveEvents(),this.node.removeAttribute("role"),this.node.removeAttribute("aria-roledescription"),this.node.removeAttribute("aria-label"),null===(t=this.img)||void 0===t||t.remove(),this.active&&this.node.setAttribute("tabindex","0"),this.attached=!1}NoMove(){rE()}AddEvents(){this.eventsAttached||(super.AddEvents(),this.eventsAttached=!0)}actionable(t){const e=null==t?void 0:t.parentNode;return e&&this.highlighter.isMactionNode(e)?e:null}triggerLinkKeyboard(t){return this.current?this.triggerLink(this.current):t.target instanceof HTMLAnchorElement&&(t.target.dispatchEvent(new MouseEvent("click")),!0)}triggerLink(t){if(this.isLink(t)){const e=this.getAnchor(t);return e.classList.add("mjx-visited"),setTimeout((()=>this.FocusOut(null)),50),window.location.href=e.getAttribute("data-mjx-href"),!0}return!1}triggerLinkMouse(){const t=this.parentLink(this.refocus);return!!this.triggerLink(t)}semanticFocus(){const t=[];let e="data-semantic-id",s=this.current||this.refocus||this.node;const i=this.actionable(s);i&&(e=i.hasAttribute("data-maction-id")?"data-maction-id":"id",s=i,t.push(LE));const r=s.getAttribute(e);return r&&t.unshift(`[${e}="${r}"]`),t.join(" ")}getSubtrees(){const t=this.node.querySelector("[data-semantic-structure]");if(!t)return;const e=t.getAttribute("data-semantic-structure");const s=function(t){const e=[[]];for(const s of t)if("("===s){const t=[];e[e.length-1].push(t),e.push(t)}else")"===s?e.pop():e[e.length-1].push(s);return e[0][0]}(e.replace(/\(/g," ( ").replace(/\)/g," ) ").trim().split(/\s+/));kE(s,this.subtrees)}}function kE(t,e){if("string"==typeof t)return e.has(t)||e.set(t,new Set),new Set;const[s,...i]=t,r=s,n=new Set;for(const t of i){const s="string"==typeof t?t:t[0],i=kE(t,e);n.add(s),i.forEach((t=>n.add(t)))}return e.set(r,n),n}SE.helpData=new Map([["MacOS",["on MacOS and iOS using VoiceOver",", or the VoiceOver arrow keys to select an expression",""]],["Windows",["in Windows using NVDA or JAWS",". The screen reader should enter focus or forms mode automatically\n when the expression gets the browser focus, but if not, you can toggle\n focus mode using NVDA+space in NVDA; for JAWS, Enter should start\n forms mode while Numpad Plus leaves it. Also note that you can use\n the NVDA or JAWS key plus the arrow keys to explore the expression\n even in browse mode, and you can use NVDA+shift+arrow keys to\n navigate out of an expression that has the focus in NVDA","NVDA users need to select this option, while JAWS users should be able\n to get Braille output without changing this setting."]],["Unix",["in Unix using Orca",", and Orca should enter focus mode automatically. If not, use the\n Orca+a key to toggle focus mode on or off. Also note that you can use\n Orca+arrow keys to explore expressions even in browse mode",""]],["unknown",["with a Screen Reader.","",""]]]),SE.keyMap=new Map([["Tab",[(t,e)=>t.tabKey(e)]],["Escape",[t=>t.escapeKey()]],["Enter",[(t,e)=>t.enterKey(e)]],["Home",[t=>t.homeKey()]],["ArrowDown",[(t,e)=>t.moveDown(e.shiftKey),!0]],["ArrowUp",[(t,e)=>t.moveUp(e.shiftKey),!0]],["ArrowLeft",[(t,e)=>t.moveLeft(e.shiftKey),!0]],["ArrowRight",[(t,e)=>t.moveRight(e.shiftKey),!0]],[" ",[t=>t.spaceKey()]],["h",[t=>t.hKey()]],[">",[t=>t.nextRules(),!1]],["<",[t=>t.nextStyle(),!1]],["x",[t=>t.summary(),!1]],["z",[t=>t.details(),!1]],["d",[t=>t.depth(),!1]],["v",[t=>t.addMark(),!1]],["p",[t=>t.prevMark(),!1]],["u",[t=>t.clearMarks(),!1]],["s",[t=>t.autoVoice(),!1]],["b",[t=>t.toggleBraille(),!1]],...[..."0123456789"].map((t=>[t,[e=>e.numberKey(parseInt(t)),!1]]))]);class OE extends _E{constructor(){super(...arguments),this.events=super.Events().concat([["mouseover",this.MouseOver.bind(this)],["mouseout",this.MouseOut.bind(this)]])}MouseOver(t){this.Start()}MouseOut(t){this.Stop()}}class ME extends OE{constructor(t,e,s,i,r,n){super(t,e,s,i),this.document=t,this.pool=e,this.region=s,this.node=i,this.nodeQuery=r,this.nodeAccess=n}MouseOut(t){this.highlighter.unhighlight(),this.region.Hide(),super.MouseOut(t)}MouseOver(t){super.MouseOver(t);const e=t.target,[s,i]=this.getNode(e);s&&(this.highlighter.unhighlight(),this.highlighter.highlight([s]),this.region.Update(i),this.region.Show(s))}getNode(t){const e=t;for(;t&&t!==this.node;){if(this.nodeQuery(t))return[t,this.nodeAccess(t)];t=t.parentNode}for(t=e;t;){if(this.nodeQuery(t))return[t,this.nodeAccess(t)];const e=t.childNodes[0];t=e&&"defs"===e.tagName?t.childNodes[1]:e}return[null,null]}}class DE extends ME{}class PE extends ME{}class BE extends ME{constructor(t,e,s,i){super(t,e,new EE(t),i,(t=>this.highlighter.isMactionNode(t)),(()=>{})),this.document=t,this.pool=e,this.node=i}}class FE extends _E{constructor(t,e,s,i,r){super(t,e,null,i),this.document=t,this.pool=e,this.region=s,this.node=i,this.mml=r,this.stoppable=!1}Attach(){super.Attach(),this.Start()}Detach(){this.Stop(),super.Detach()}}class UE extends FE{Start(){this.active||(this.active=!0,this.highlighter.highlightAll(this.node))}Stop(){this.active&&this.highlighter.unhighlightAll(),this.active=!1}}class jE extends FE{constructor(){super(...arguments),this.contrast=new qE,this.leaves=[],this.modality="data-semantic-foreground"}Start(){this.active||(this.active=!0,this.node.hasAttribute("hasforegroundcolor")||(this.colorLeaves(),this.node.setAttribute("hasforegroundcolor","true")),this.leaves.forEach((t=>this.colorize(t))))}Stop(){this.active&&this.leaves.forEach((t=>this.uncolorize(t))),this.active=!1}colorLeaves(){this.leaves=Array.from(this.node.querySelectorAll("[data-semantic-id]:not([data-semantic-children])"));for(const t of this.leaves)t.setAttribute(this.modality,this.contrast.generate()),this.contrast.increment()}colorize(t){t.hasAttribute(this.modality)&&(t.setAttribute(this.modality+"-old",t.style.color),t.style.color=t.getAttribute(this.modality))}uncolorize(t){const e=this.modality+"-old";t.hasAttribute(e)&&(t.style.color=t.getAttribute(e))}}class qE{constructor(){this.hue=10,this.sat=100,this.light=50,this.incr=53}generate(){return qE.hsl2rgb(this.hue,this.sat,this.light)}increment(){this.hue=(this.hue+this.incr)%360}static hsl2rgb(t,e,s){e=e>1?e/100:e,s=s>1?s/100:s;const i=(1-Math.abs(2*s-1))*e,r=i*(1-Math.abs(t/60%2-1)),n=s-i/2;let o=0,a=0,l=0;return 0<=t&&t<60?[o,a,l]=[i,r,0]:60<=t&&t<120?[o,a,l]=[r,i,0]:120<=t&&t<180?[o,a,l]=[0,i,r]:180<=t&&t<240?[o,a,l]=[0,r,i]:240<=t&&t<300?[o,a,l]=[r,0,i]:300<=t&&t<360&&([o,a,l]=[i,0,r]),`rgb(${255*(o+n)}, ${255*(a+n)}, ${255*(l+n)})`}}const HE={color:"blue",alpha:.2},WE={color:"black",alpha:1},VE={ENCLOSED:"data-sre-enclosed",BBOX:"data-sre-highlighter-bbox",ADDED:"data-sre-highlighter-added"};class GE{constructor(t){this.currentHighlights=[],this.priority=t,this.ATTR="data-sre-highlight-"+t}highlight(t){this.currentHighlights.push(t);for(const e of t)this.highlightNode(e),this.setHighlighted(e)}highlightAll(t){const e=this.getMactionNodes(t);for(const t of e)this.highlight([t])}unhighlight(){const t=this.currentHighlights.pop();t&&t.forEach((t=>{this.isHighlighted(t)&&(this.unhighlightNode(t),this.unsetHighlighted(t))}))}unhighlightAll(){for(;this.currentHighlights.length>0;)this.unhighlight()}encloseNodes(t,e){if(1===t.length)return t;const s=this.constructor,i=s.lineSelector,r=s.lineAttr,n=new Map;for(const e of t){const t=e.closest(i),s=t?t.getAttribute(r):"";n.has(s)||n.set(s,[]),n.get(s).push(e)}for(const s of n.values())if(s.length>1){let[i,r,n,o]=[1/0,1/0,-1/0,-1/0];for(const t of s){t.setAttribute(VE.ENCLOSED,"true");const{left:e,top:s,right:a,bottom:l}=t.getBoundingClientRect();s===l&&e===a||(e<i&&(i=e),s<r&&(r=s),l>o&&(o=l),a>n&&(n=a))}const a=this.createEnclosure(i,o,n-i,o-r,e,s[0]);t.push(a)}return t}setColorCSS(t,e,s){var i,r;const n=null!==(i=e.color)&&void 0!==i?i:s.color,o=null!==(r=e.alpha)&&void 0!==r?r:s.alpha;NE.setColor(t,this.priority,n,o)}setColor(t,e){this.setColorCSS("fg",e,WE),this.setColorCSS("bg",t,HE)}isHighlighted(t){return t.hasAttribute(this.ATTR)}setHighlighted(t){t.setAttribute(this.ATTR,"true")}unsetHighlighted(t){t.removeAttribute(this.ATTR),t.removeAttribute(VE.ENCLOSED)}}class XE extends GE{highlightNode(t){if(this.isHighlighted(t)||"svg"===t.tagName||"MJX-CONTAINER"===t.tagName||t.hasAttribute(VE.BBOX)||t.hasAttribute(VE.ENCLOSED))return;const{x:e,y:s,width:i,height:r}=t.getBBox(),n=this.createRect(e,s,i,r,t.getAttribute("transform"));this.setHighlighted(n),t.parentNode.insertBefore(n,t)}unhighlightNode(t){if(t.hasAttribute(VE.BBOX))return void t.remove();const e=t.previousSibling;(null==e?void 0:e.hasAttribute(VE.ADDED))&&e.remove()}createEnclosure(t,e,s,i,r,n){const[o,a]=this.screen2svg(t,e,n),[l,c]=this.screen2svg(t+s,e-i,n),h=this.createRect(o,a,l-o,c-a,n.getAttribute("transform"));return h.setAttribute(VE.BBOX,"true"),n.parentNode.insertBefore(h,n),h}screen2svg(t,e,s){const i=s,r=DOMPoint.fromPoint({x:t,y:e}).matrixTransform(i.getScreenCTM().inverse());return[r.x,r.y]}createRect(t,e,s,i,r){const n=document.createElementNS("http://www.w3.org/2000/svg","rect");return n.setAttribute(VE.ADDED,"true"),n.setAttribute("x",String(t-40)),n.setAttribute("y",String(e-40)),n.setAttribute("width",String(s+80)),n.setAttribute("height",String(i+80)),r&&n.setAttribute("transform",r),n}isMactionNode(t){return"maction"===t.getAttribute("data-mml-node")}getMactionNodes(t){return Array.from(t.querySelectorAll('[data-mml-node="maction"]'))}}XE.lineSelector="[data-mjx-linebox]",XE.lineAttr="data-mjx-lineno";class zE extends GE{highlightNode(t){}unhighlightNode(t){"mjx-bbox"===t.tagName.toLowerCase()&&t.remove()}createEnclosure(t,e,s,i,r){const n=r.getBoundingClientRect(),o=document.createElement("mjx-bbox");return o.style.width=s+"px",o.style.height=i+"px",o.style.left=t-n.left+"px",o.style.top=e-i-n.top+"px",o.style.position="absolute",r.prepend(o),o}isMactionNode(t){var e;return"mjx-maction"===(null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase())}getMactionNodes(t){return Array.from(t.querySelectorAll("mjx-maction"))}}function KE(t,e,s,i){const r=new JE[i](t);return r.setColor(e,s),r}zE.lineSelector="mjx-linebox",zE.lineAttr="lineno";const JE={SVG:XE,CHTML:zE,generic:zE};class $E{constructor(t){this.document=t,this.speechRegion=new AE(this.document),this.brailleRegion=new NE(this.document),this.magnifier=new vE(this.document),this.tooltip1=new yE(this.document),this.tooltip2=new yE(this.document),this.tooltip3=new yE(this.document)}}const YE={speech:(t,e,s,...i)=>{const r=SE.create(t,e,t.explorerRegions.speechRegion,s,t.explorerRegions.brailleRegion,t.explorerRegions.magnifier,i[0],i[1]);return r.sound=!0,r},mouseMagnifier:(t,e,s,...i)=>PE.create(t,e,t.explorerRegions.magnifier,s,(t=>t.hasAttribute("data-semantic-type")),(t=>t)),hover:(t,e,s,...i)=>BE.create(t,e,null,s),infoType:(t,e,s,...i)=>DE.create(t,e,t.explorerRegions.tooltip1,s,(t=>t.hasAttribute("data-semantic-type")),(t=>t.getAttribute("data-semantic-type"))),infoRole:(t,e,s,...i)=>DE.create(t,e,t.explorerRegions.tooltip2,s,(t=>t.hasAttribute("data-semantic-role")),(t=>t.getAttribute("data-semantic-role"))),infoPrefix:(t,e,s,...i)=>DE.create(t,e,t.explorerRegions.tooltip3,s,(t=>{var e;return null===(e=t.hasAttribute)||void 0===e?void 0:e.call(t,"data-semantic-prefix-none")}),(t=>{var e;return null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"data-semantic-prefix-none")})),flame:(t,e,s,...i)=>UE.create(t,e,null,s),treeColoring:(t,e,s,...i)=>jE.create(t,e,null,s,...i)};class QE{constructor(){this.explorers={},this.attached=[],this._restart=[],this.speechExplorerKeys=["speech","braille","keyMagnifier"]}get highlighter(){if(this._renderer!==this.document.outputJax.name)return this._renderer=this.document.outputJax.name,this.setPrimaryHighlighter(),this._highlighter;const[t,e]=this.colorOptions();return this._highlighter.setColor(e,t),this._highlighter}init(t,e,s,i){this.document=t,this.mml=s,this.node=e,this.setPrimaryHighlighter();for(const t of Object.keys(YE))this.explorers[t]=YE[t](this.document,this,this.node,this.mml,i);this.setSecondaryHighlighter(),this.attach()}attach(){this.attached=[];const t=[],e=this.document.options.a11y;for(const[s,i]of Object.entries(this.explorers))i instanceof SE?(i.stoppable=!1,t.unshift(i),this.speechExplorerKeys.some((t=>this.document.options.a11y[t]))?(i.Attach(),this.attached.push(s)):i.Detach()):e[s]||"speech"===s&&(e.braille||e.keyMagnifier)?(i.Attach(),this.attached.push(s)):i.Detach();for(const e of t)if(e.attached){e.stoppable=!0;break}}reattach(){for(const t of this.attached){const e=this.explorers[t];e.active&&(this._restart.push(t),e.Stop())}}restart(){this._restart.forEach((t=>{this.explorers[t].Start()})),this._restart=[]}setPrimaryHighlighter(){const[t,e]=this.colorOptions();this._highlighter=KE(NE.priority.primary,e,t,this.document.outputJax.name)}setSecondaryHighlighter(){this.secondaryHighlighter=KE(NE.priority.secondary,{color:"red"},{color:"black"},this.document.outputJax.name),this.speech.region.highlighter=this.secondaryHighlighter}highlight(t){this.highlighter.highlight(t)}unhighlight(){this.secondaryHighlighter.unhighlight(),this.highlighter.unhighlight()}get speech(){return this.explorers.speech}colorOptions(){const t=this.document.options.a11y;return[{color:t.foregroundColor.toLowerCase(),alpha:t.foregroundOpacity/100},{color:t.backgroundColor.toLowerCase(),alpha:t.backgroundOpacity/100}]}}const ZE="Unix"===mi.os;function tx(t,e){var s;return s=class extends t{constructor(){super(...arguments),this.refocus=null}get ariaRole(){return this.constructor.ariaRole}get roleDescription(){const t=this.constructor;return"none"===t.roleDescription?t.none:t.roleDescription}get none(){return this.constructor.none}get brailleNone(){return this.constructor.brailleNone}attachSpeech(t){var e,s;super.attachSpeech(t),null===(s=null===(e=this.outputData.speechPromise)||void 0===e?void 0:e.then((()=>this.explorers.speech.attachSpeech())))||void 0===s||s.then((()=>{var t;(null===(t=this.explorers)||void 0===t?void 0:t.speech)&&(this.explorers.speech.restarted=this.refocus),this.refocus=null,this.explorers&&this.explorers.restart()}))}detachSpeech(t){super.detachSpeech(t),this.explorers.speech.detachSpeech()}explorable(t,s=!1){if(!(this.state()>=lr.EXPLORER)){if(!this.isEscaped&&(t.options.enableExplorer||s)){const s=this.typesetRoot,i=e(this.root);this.explorers||(this.explorers=new QE),this.explorers.init(t,s,i,this)}this.state(lr.EXPLORER)}}state(t=null,e=!1){if(t<lr.EXPLORER&&this.explorers)for(const t of Object.values(this.explorers.explorers))t.active&&t.Stop();return super.state(t,e)}rerender(t,e=lr.RERENDER){const s=this.setTemporaryFocus(t);super.rerender(t,e),this.clearTemporaryFocus(s)}setTemporaryFocus(t){var e;let s=null;if(this.explorers){const i=this.explorers.speech;if(s=(null==i?void 0:i.attached)?t.tmpFocus:null,s){this.refocus=null!==(e=i.semanticFocus())&&void 0!==e?e:null;const r=t.adaptor;r.append(r.body(),s)}this.explorers.reattach(),null==s||s.focus()}return s}clearTemporaryFocus(t){var e;if(t){(null!==(e=this.outputData.speechPromise)&&void 0!==e?e:Promise.resolve()).then((()=>setTimeout((()=>t.remove()),100)))}}},s.ariaRole=ZE?"tree":"application",s.roleDescription="math",s.none="\x91",s.brailleNone="\u2800",s}function ex(t){var e;return e=class extends t{constructor(...t){super(...t),this.explorerRegions=null,this.activeItem=null;const e=this.constructor.ProcessBits;e.has("explorer")||e.allocate("explorer");const s=new Qn(this.mmlFactory),i=this.options;i.a11y.speechRules||(i.a11y.speechRules=`${i.sre.domain}-${i.sre.style}`);const r=i.MathItem=tx(i.MathItem,(t=>s.visitTree(t)));r.roleDescription=i.roleDescription,this.explorerRegions=new $E(this),"addStyles"in this&&this.addStyles(this.constructor.speechStyles);const n=this.adaptor,o="http://www.w3.org/2000/svg";this.infoIcon=n.node("mjx-help",{},[n.node("svg",{viewBox:"0 0 18 18",xmlns:o,"aria-hidden":"true"},[n.node("circle",{stroke:"none"},[],o),n.node("circle",{},[],o),n.node("line",{x1:9,y1:9,x2:9,y2:13},[],o),n.node("line",{x1:9,y1:5.5,x2:9,y2:5.5},[],o)],o)]),this.tmpFocus=n.node("mjx-focus",{tabIndex:0,style:{outline:"none",display:"block",position:"absolute",top:0,left:"-10px",width:"1px",height:"1px",overflow:"hidden"},role:r.ariaRole,"aria-label":r.none,"aria-roledescription":r.none})}explorable(){if(!this.processed.isSet("explorer")){if(this.options.enableExplorer)for(const t of this.math)t.explorable(this);this.processed.set("explorer")}return this}rerender(t){const e=this.activeItem,s=null==e?void 0:e.setTemporaryFocus(this);return super.rerender(t),null==e||e.clearTemporaryFocus(s),this}state(t,e=!1){return super.state(t,e),t<lr.EXPLORER&&this.processed.clear("explorer"),this}},e.OPTIONS=Object.assign(Object.assign({},t.OPTIONS),{enableExplorer:pi,enableExplorerHelp:!0,renderActions:ki(Object.assign(Object.assign({},t.OPTIONS.renderActions),{explorable:[lr.EXPLORER]})),sre:ki(Object.assign(Object.assign({},t.OPTIONS.sre),{speech:"none"})),a11y:Object.assign(Object.assign({},t.OPTIONS.a11y),{align:"top",backgroundColor:"Blue",backgroundOpacity:20,flame:!1,foregroundColor:"Black",foregroundOpacity:100,highlight:"None",hover:!1,infoPrefix:!1,infoRole:!1,infoType:!1,keyMagnifier:!1,magnification:"None",magnify:"400%",mouseMagnifier:!1,subtitles:!1,treeColoring:!1,viewBraille:!1,voicing:!1,brailleSpeech:!1,brailleCombine:!1,help:!0,roleDescription:"math",tabSelects:"all"})}),e.speechStyles={'mjx-container[has-speech="true"]':{position:"relative",cursor:"default"},"mjx-speech":{position:"absolute","z-index":-1,left:0,top:0,bottom:0,right:0},"mjx-speech:focus":{outline:"none"},"mjx-container .mjx-selected":{outline:"2px solid black"},"mjx-container a[data-mjx-href]":{color:"LinkText",cursor:"pointer"},"mjx-container a[data-mjx-href].mjx-visited":{color:"VisitedText"},"mjx-container > mjx-help":{display:"none",position:"absolute",top:"-.3em",right:"-.5em",width:".6em",height:".6em",cursor:"pointer"},'mjx-container[display="true"] > mjx-help':{position:"sticky",inset:"-100% 0 100% 0",margin:"-.3em -.5em 0 -.1em",right:0,top:"initial"},"mjx-help > svg":{stroke:"black",width:"100%",height:"100%"},"mjx-help > svg > circle":{"stroke-width":"1.5px",cx:"9px",cy:"9px",r:"9px",fill:"white"},"mjx-help > svg > circle:nth-child(2)":{fill:"var(--mjx-bg1-color)",r:"7px"},"mjx-help > svg > line":{"stroke-width":"2.5px","stroke-linecap":"round"},"mjx-help:hover > svg > circle:nth-child(2)":{fill:"white"},"mjx-container.mjx-explorer-active > mjx-help":{display:"inline-flex","align-items":"center"},"@media (prefers-color-scheme: dark) /* explorer */":{"mjx-help > svg":{stroke:"#E0E0E0"},"mjx-help > svg > circle":{fill:"#404040"},"mjx-help > svg > circle:nth-child(2)":{fill:"rgba(132, 132, 255, .3)"},"mjx-help:hover > svg > circle:nth-child(2)":{stroke:"#AAAAAA",fill:"#404040"}}},e}function sx(t,e=null){return t.documentClass.prototype.attachSpeech||(t=fE(t,e)),t.documentClass=ex(t.documentClass),t}function ix(t,e){var s;const i=ub();for(const s in e)void 0!==t.options.a11y[s]?rx(t,s,e[s]):void 0!==i[s]&&(t.options.sre[s]=e[s]);e.roleDescription&&(t.options.MathItem.roleDescription=e.roleDescription);for(const e of t.math)null===(s=null==e?void 0:e.explorers)||void 0===s||s.attach()}function rx(t,e,s){switch(e){case"speechRules":{const[e,i]=s.split("-");t.options.sre.domain=e,t.options.sre.style=i;break}case"magnification":switch(s){case"None":t.options.a11y.magnification=s,t.options.a11y.keyMagnifier=!1,t.options.a11y.mouseMagnifier=!1;break;case"Keyboard":t.options.a11y.magnification=s,t.options.a11y.keyMagnifier=!0,t.options.a11y.mouseMagnifier=!1;break;case"Mouse":t.options.a11y.magnification=s,t.options.a11y.keyMagnifier=!1,t.options.a11y.mouseMagnifier=!0}break;case"highlight":switch(s){case"None":t.options.a11y.highlight=s,t.options.a11y.hover=!1,t.options.a11y.flame=!1;break;case"Hover":t.options.a11y.highlight=s,t.options.a11y.hover=!0,t.options.a11y.flame=!1;break;case"Flame":t.options.a11y.highlight=s,t.options.a11y.hover=!1,t.options.a11y.flame=!0}break;case"locale":t.options.sre.locale=s;break;default:t.options.a11y[e]=s}}cr("EXPLORER",lr.INSERTED+30),MathJax.loader&&MathJax.loader.checkVersion("a11y/explorer",ni,"a11y"),di({_:{a11y:{explorer_ts:ri,explorer:{Explorer:Qs,ExplorerPool:ii,Highlighter:si,KeyExplorer:Zs,MouseExplorer:ti,Region:Ys,TreeExplorer:ei}}}}),MathJax.startup&&pi&&MathJax.startup.extendHandler((t=>sx(t))),vi.preLoaded("a11y/sre","a11y/semantic-enrich","a11y/speech","a11y/explorer","input/mml"),vi.preLoaded("loader","startup","core","input/tex","input/mml","output/svg","ui/menu"),vi.saveVersion("tex-mml-svg-nofont"),function(t,e){ou.loadFont(t,"svg",tu,e)}((function(t){return vi.load(...wi.load).then((()=>(t||function(){})())).then((()=>wi.ready())).catch((t=>wi.failed(t)))}))})()})();
|