diff --git a/css/mathlive.less b/css/mathlive.less index 7c4ccb812..6aa906b96 100755 --- a/css/mathlive.less +++ b/css/mathlive.less @@ -66,8 +66,8 @@ .ML__mathit { font-family: @math_math; - /* The @math_math (KaTeX_Math) font is italic - by default, so the font-style below is only + /* The @math_math (KaTeX_Math) font is italic + by default, so the font-style below is only useful when a fallback font is used */ font-style: italic; @@ -84,7 +84,7 @@ font-weight: bold; } -/* lowercase greek symbols should stick to math font when \mathbf is applied +/* lowercase greek symbols should stick to math font when \mathbf is applied to match TeX idiosyncratic behavior */ .lcGreek.ML__mathbf { font-family: @math_math; @@ -294,14 +294,17 @@ content: ''; display: block; margin-top: -0.04em; - border-bottom-style: solid; - border-bottom-width: 0.04em; min-height: 0.04em; - /* There's a bug since Chrome 62 where - sub-pixel border lines don't draw at some zoom - levels (110%, 90%). Setting the min-height seems to work around it. + /* There's a bug since Chrome 62 where sub-pixel + border lines don't draw at some zoom + levels (110%, 90%). + Setting the min-height used to work around it, but + that workaround broke in Chrome 84 or so. + Setting the background (and the min-height) seems to + work for now. */ - box-sizing: content-box; /* Vuetify sets the box-sizing to inherit + background: currentColor; + box-sizing: content-box; /* Vuetify sets the box-sizing to inherit causes the fraction line to not draw at all sizes (see #26) */ } } @@ -443,8 +446,8 @@ &:after { border-bottom-style: solid; border-bottom-width: 0.04em; - min-height: thin; /* There's a bug since Chrome 62 where - sub-pixel border lines don't draw at some zoom + min-height: thin; /* There's a bug since Chrome 62 where + sub-pixel border lines don't draw at some zoom levels (110%, 90%). Setting the min-height seems to work around it. */ content: ''; @@ -542,13 +545,8 @@ content: ''; display: block; margin-top: -0.04em; - border-bottom-style: solid; - border-bottom-width: 0.04em; - min-height: 0.5px; - /* There's a bug since Chrome 62 where - sub-pixel border lines don't draw at some zoom - levels (110%, 90%). Setting the min-height seems to work around it. - */ + min-height: 0.04em; + background: currentColor; } &:after { @@ -743,7 +741,7 @@ padding-left: 0.25em; } -/* When using smartFence, the anticipated closing fence is displayed +/* When using smartFence, the anticipated closing fence is displayed with this style */ .ML__smart-fence__close { opacity: 0.5; @@ -786,9 +784,9 @@ body[theme='dark'] .ML__keystroke-caption { --keystroke-border: hsl(var(--hue), 50%, 25%); } -/* Add an attribute 'data-tooltip' to automatically show a - tooltip over a element on hover. - Use 'data-position="top"' to place the tooltip above the +/* Add an attribute 'data-tooltip' to automatically show a + tooltip over a element on hover. + Use 'data-position="top"' to place the tooltip above the element rather than below. Use 'data-delay' to delay the triggering of the tooltip. */ @@ -1959,14 +1957,14 @@ div.ML__popover.is-visible { padding-top: 0.25em; } -/* Style for the character that joins the modifiers of a keyboard shortcut +/* Style for the character that joins the modifiers of a keyboard shortcut (usually a "+" sign)*/ .ML__shortcut-join { opacity: 0.5; } -/* Styling for an element which is overlaid -to the left and right of the mathfield while +/* Styling for an element which is overlaid +to the left and right of the mathfield while scrolling to prevent the capture of hover events */ .ML__scroller { position: fixed; diff --git a/dist/commands.d.ts b/dist/commands.d.ts index 139ae68b4..acf14ff03 100644 --- a/dist/commands.d.ts +++ b/dist/commands.d.ts @@ -1,4 +1,4 @@ -/* 0.52.0 */ import type { Keys } from './types-utils'; +/* 0.52.1-soc */ import type { Keys } from './types-utils'; import type { ParseMode, Style } from './core'; import type { Mathfield, Model } from './mathfield'; /** diff --git a/dist/config.d.ts b/dist/config.d.ts index ac0d096f0..55c524996 100644 --- a/dist/config.d.ts +++ b/dist/config.d.ts @@ -1,4 +1,4 @@ -/* 0.52.0 */ import { ErrorListener, MacroDictionary, ParseMode } from './core'; +/* 0.52.1-soc */ import { ErrorListener, MacroDictionary, ParseMode } from './core'; import type { Mathfield } from './mathfield'; import type { Selector } from './commands'; /** diff --git a/dist/core.d.ts b/dist/core.d.ts index f198e4c4f..1c41c8412 100644 --- a/dist/core.d.ts +++ b/dist/core.d.ts @@ -1,4 +1,4 @@ -/* 0.52.0 */ /** +/* 0.52.1-soc */ /** * The mode that indicates how a portion of content is interpreted * * @deprecated The 'command'mode will be dropped in a future release diff --git a/dist/mathfield.d.ts b/dist/mathfield.d.ts index ff2e7acce..7f6b24ea1 100644 --- a/dist/mathfield.d.ts +++ b/dist/mathfield.d.ts @@ -1,4 +1,4 @@ -/* 0.52.0 */ import { Selector } from './commands'; +/* 0.52.1-soc */ import { Selector } from './commands'; import { MathfieldConfig } from './config'; import { ParseMode, MacroDictionary, Style } from './core'; /** diff --git a/dist/mathlive.core.css b/dist/mathlive.core.css index fbe357654..c5361c8fd 100644 --- a/dist/mathlive.core.css +++ b/dist/mathlive.core.css @@ -1 +1 @@ -/* 0.52.0 */.ML__mathlive{line-height:0;direction:ltr;text-align:left;text-indent:0;text-rendering:auto;font-style:normal;font-size-adjust:none;letter-spacing:normal;word-wrap:normal;word-spacing:normal;white-space:nowrap;display:inline-block;text-shadow:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:-webkit-min-content;width:-moz-min-content;width:min-content;transform:translateZ(0)}.ML__base{display:inline-block;position:relative;cursor:text}.ML__strut,.ML__strut--bottom{display:inline-block;min-height:.5em}.ML__caret:after{content:"";border:none;border-radius:2px;border-right:2px solid var(--caret);margin-right:-2px;position:relative;left:-1px;-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__text-caret:after{content:"";border:none;border-radius:1px;border-right:1px solid var(--caret);margin-right:-1px;position:relative;left:0;-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__command-caret:after{content:"_";border:none;margin-right:-1ex;position:relative;color:var(--caret);-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__text{white-space:pre}.ML__focused .ML__text{background:hsla(var(--hue),40%,50%,.1)}@-webkit-keyframes ML__caret-blink{0%,to{opacity:1}50%{opacity:0}}@keyframes ML__caret-blink{0%,to{opacity:1}50%{opacity:0}}.ML__textarea__textarea{transform:scale(0);resize:none;position:absolute;clip:rect(0 0 0 0);width:1px;height:1px;font-size:16px}.ML__fieldcontainer{display:flex;flex-flow:row;justify-content:space-between;align-items:flex-end;min-height:39px;touch-action:none;width:100%;--hue:212;--highlight:hsl(var(--hue),97%,85%);--caret:hsl(var(--hue),40%,49%);--highlight-inactive:#ccc;--primary:hsl(var(--hue),40%,50%);--secondary:hsl(var(--hue),19%,26%);--on-secondary:hsl(var(--hue),19%,26%)}@media (prefers-color-scheme:dark){body:not([theme=light]) .ML__fieldcontainer{--highlight:hsl(var(--hue),40%,49%);--highlight-inactive:hsl(var(--hue),10%,35%);--caret:hsl(var(--hue),97%,85%);--secondary:hsl(var(--hue),25%,35%);--on-secondary:#fafafa}}body[theme=dark] .ML__fieldcontainer{--highlight:hsl(var(--hue),40%,49%);--highlight-inactive:hsl(var(--hue),10%,35%);--caret:hsl(var(--hue),97%,85%);--secondary:hsl(var(--hue),25%,35%);--on-secondary:#fafafa}.ML__fieldcontainer:focus{outline:2px solid var(--primary);outline-offset:3px}.ML__fieldcontainer__field{align-self:center;position:relative;overflow:hidden;line-height:0;padding:2px;width:100%}.ML__virtual-keyboard-toggle{display:flex;align-self:center;align-items:center;flex-shrink:0;flex-direction:column;justify-content:center;width:34px;height:34px;padding:0;margin-right:4px;cursor:pointer;box-sizing:border-box;border-radius:50%;border:1px solid transparent;transition:background .2s cubic-bezier(.64,.09,.08,1);color:var(--primary);fill:currentColor;background:transparent}.ML__virtual-keyboard-toggle:hover{background:hsl(var(--hue),25%,35%);color:#fafafa;fill:currentColor;border-radius:50%;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)}.ML__popover{visibility:hidden;min-width:160px;background-color:rgba(97,97,97,.95);color:#fff;text-align:center;border-radius:6px;position:fixed;z-index:1;display:flex;flex-direction:column;justify-content:center;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22);transition:all .2s cubic-bezier(.64,.09,.08,1)}.ML__popover:after{content:"";position:absolute;top:-5px;left:calc(50% - 3px);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;font-size:1rem;border-bottom:5px solid rgba(97,97,97,.9)}.reverse-direction:after{top:auto;bottom:-5px;border-top:5px solid rgba(97,97,97,.9);border-bottom:0} +/* 0.52.1-soc */.ML__mathlive{line-height:0;direction:ltr;text-align:left;text-indent:0;text-rendering:auto;font-style:normal;font-size-adjust:none;letter-spacing:normal;word-wrap:normal;word-spacing:normal;white-space:nowrap;display:inline-block;text-shadow:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:-webkit-min-content;width:-moz-min-content;width:min-content;transform:translateZ(0)}.ML__base{display:inline-block;position:relative;cursor:text}.ML__strut,.ML__strut--bottom{display:inline-block;min-height:.5em}.ML__caret:after{content:"";border:none;border-radius:2px;border-right:2px solid var(--caret);margin-right:-2px;position:relative;left:-1px;-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__text-caret:after{content:"";border:none;border-radius:1px;border-right:1px solid var(--caret);margin-right:-1px;position:relative;left:0;-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__command-caret:after{content:"_";border:none;margin-right:-1ex;position:relative;color:var(--caret);-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__text{white-space:pre}.ML__focused .ML__text{background:hsla(var(--hue),40%,50%,.1)}@-webkit-keyframes ML__caret-blink{0%,to{opacity:1}50%{opacity:0}}@keyframes ML__caret-blink{0%,to{opacity:1}50%{opacity:0}}.ML__textarea__textarea{transform:scale(0);resize:none;position:absolute;clip:rect(0 0 0 0);width:1px;height:1px;font-size:16px}.ML__fieldcontainer{display:flex;flex-flow:row;justify-content:space-between;align-items:flex-end;min-height:39px;touch-action:none;width:100%;--hue:212;--highlight:hsl(var(--hue),97%,85%);--caret:hsl(var(--hue),40%,49%);--highlight-inactive:#ccc;--primary:hsl(var(--hue),40%,50%);--secondary:hsl(var(--hue),19%,26%);--on-secondary:hsl(var(--hue),19%,26%)}@media (prefers-color-scheme:dark){body:not([theme=light]) .ML__fieldcontainer{--highlight:hsl(var(--hue),40%,49%);--highlight-inactive:hsl(var(--hue),10%,35%);--caret:hsl(var(--hue),97%,85%);--secondary:hsl(var(--hue),25%,35%);--on-secondary:#fafafa}}body[theme=dark] .ML__fieldcontainer{--highlight:hsl(var(--hue),40%,49%);--highlight-inactive:hsl(var(--hue),10%,35%);--caret:hsl(var(--hue),97%,85%);--secondary:hsl(var(--hue),25%,35%);--on-secondary:#fafafa}.ML__fieldcontainer:focus{outline:2px solid var(--primary);outline-offset:3px}.ML__fieldcontainer__field{align-self:center;position:relative;overflow:hidden;line-height:0;padding:2px;width:100%}.ML__virtual-keyboard-toggle{display:flex;align-self:center;align-items:center;flex-shrink:0;flex-direction:column;justify-content:center;width:34px;height:34px;padding:0;margin-right:4px;cursor:pointer;box-sizing:border-box;border-radius:50%;border:1px solid transparent;transition:background .2s cubic-bezier(.64,.09,.08,1);color:var(--primary);fill:currentColor;background:transparent}.ML__virtual-keyboard-toggle:hover{background:hsl(var(--hue),25%,35%);color:#fafafa;fill:currentColor;border-radius:50%;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)}.ML__popover{visibility:hidden;min-width:160px;background-color:rgba(97,97,97,.95);color:#fff;text-align:center;border-radius:6px;position:fixed;z-index:1;display:flex;flex-direction:column;justify-content:center;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22);transition:all .2s cubic-bezier(.64,.09,.08,1)}.ML__popover:after{content:"";position:absolute;top:-5px;left:calc(50% - 3px);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;font-size:1rem;border-bottom:5px solid rgba(97,97,97,.9)}.reverse-direction:after{top:auto;bottom:-5px;border-top:5px solid rgba(97,97,97,.9);border-bottom:0} diff --git a/dist/mathlive.css b/dist/mathlive.css index f587cfefc..45972057d 100644 --- a/dist/mathlive.css +++ b/dist/mathlive.css @@ -1 +1 @@ -/* 0.52.0 */@font-face{font-family:KaTeX_AMS;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff");font-weight:700;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff");font-weight:700;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff");font-weight:700;font-style:italic;font-display:"swap"}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff");font-weight:700;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff");font-weight:400;font-style:italic;font-display:"swap"}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff");font-weight:700;font-style:italic;font-display:"swap"}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff");font-weight:700;font-style:normal;font-display:"swap"}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff");font-weight:400;font-style:italic;font-display:"swap"}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Script;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Size1;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Size2;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Size3;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Size4;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Typewriter;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff");font-weight:400;font-style:italic;font-display:"swap"}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.ML__small-delim{font-family:KaTeX_Main}.ML__mathit{font-family:KaTeX_Math;font-style:italic}.ML__cmr{font-style:normal}.ML__cmr,.ML__mathbf{font-family:KaTeX_Main}.ML__mathbf{font-weight:700}.lcGreek.ML__mathbf{font-family:KaTeX_Math;font-weight:400}.ML__mathbfit{font-family:KaTeX_Math;font-weight:700;font-style:italic}.ML__ams,.ML__bb{font-family:KaTeX_AMS}.ML__cal{font-family:KaTeX_Caligraphic}.ML__frak{font-family:KaTeX_Fraktur}.ML__tt{font-family:KaTeX_Typewriter}.ML__script{font-family:KaTeX_Script}.ML__sans{font-family:KaTeX_SansSerif}.ML__cmti{font-family:KaTeX_Main;font-style:italic}.ML__series_el,.ML__series_ul{font-weight:100}.ML__series_l{font-weight:200}.ML__series_sl{font-weight:300}.ML__series_sb{font-weight:500}.ML__bold,.ML__boldsymbol{font-weight:700}.ML__series_eb{font-weight:800}.ML__series_ub{font-weight:900}.ML__series_uc{font-stretch:ultra-condensed}.ML__series_ec{font-stretch:extra-condensed}.ML__series_c{font-stretch:condensed}.ML__series_sc{font-stretch:semi-condensed}.ML__series_sx{font-stretch:semi-expanded}.ML__series_x{font-stretch:expanded}.ML__series_ex{font-stretch:extra-expanded}.ML__series_ux{font-stretch:ultra-expanded}.ML__it{font-style:italic}.ML__shape_ol{-webkit-text-stroke:1px #000;text-stroke:1px #000;color:transparent}.ML__shape_sc{font-variant:small-caps}.ML__shape_sl{font-style:oblique}.ML__emph{color:#bc2612}.ML__emph .ML__emph{color:#0c7f99}.ML__mathlive .highlight{color:#007cb2;background:#edd1b0}.ML__mathlive .reset-textstyle.scriptstyle{font-size:.7em}.ML__mathlive .reset-textstyle.scriptscriptstyle{font-size:.5em}.ML__mathlive .reset-scriptstyle.textstyle{font-size:1.42857em}.ML__mathlive .reset-scriptstyle.scriptscriptstyle{font-size:.71429em}.ML__mathlive .reset-scriptscriptstyle.textstyle{font-size:2em}.ML__mathlive .reset-scriptscriptstyle.scriptstyle{font-size:1.4em}.ML__mathlive .style-wrap{position:relative}.ML__mathlive .vlist{display:inline-block}.ML__mathlive .vlist>span{display:block;height:0;position:relative;line-height:0}.ML__mathlive .vlist>span>span{display:inline-block}.ML__mathlive .msubsup{text-align:left}.ML__mathlive .mfrac>span{text-align:center}.ML__mathlive .mfrac .frac-line{width:100%}.ML__mathlive .mfrac .frac-line:after{content:"";display:block;margin-top:-.04em;border-bottom-style:solid;border-bottom-width:.04em;min-height:.04em;box-sizing:content-box}.ML__mathlive .rspace.negativethinspace{margin-right:-.16667em}.ML__mathlive .rspace.thinspace{margin-right:.16667em}.ML__mathlive .rspace.negativemediumspace{margin-right:-.22222em}.ML__mathlive .rspace.mediumspace{margin-right:.22222em}.ML__mathlive .rspace.thickspace{margin-right:.27778em}.ML__mathlive .rspace.sixmuspace{margin-right:.333333em}.ML__mathlive .rspace.eightmuspace{margin-right:.444444em}.ML__mathlive .rspace.enspace{margin-right:.5em}.ML__mathlive .rspace.twelvemuspace{margin-right:.666667em}.ML__mathlive .rspace.quad{margin-right:1em}.ML__mathlive .rspace.qquad{margin-right:2em}.ML__mathlive .mspace{display:inline-block}.ML__mathlive .mspace.negativethinspace{margin-left:-.16667em}.ML__mathlive .mspace.thinspace{width:.16667em}.ML__mathlive .mspace.negativemediumspace{margin-left:-.22222em}.ML__mathlive .mspace.mediumspace{width:.22222em}.ML__mathlive .mspace.thickspace{width:.27778em}.ML__mathlive .mspace.sixmuspace{width:.333333em}.ML__mathlive .mspace.eightmuspace{width:.444444em}.ML__mathlive .mspace.enspace{width:.5em}.ML__mathlive .mspace.twelvemuspace{width:.666667em}.ML__mathlive .mspace.quad{width:1em}.ML__mathlive .mspace.qquad{width:2em}.ML__mathlive .llap,.ML__mathlive .rlap{width:0;position:relative}.ML__mathlive .llap>.inner,.ML__mathlive .rlap>.inner{position:absolute}.ML__mathlive .llap>.fix,.ML__mathlive .rlap>.fix{display:inline-block}.ML__mathlive .llap>.inner{right:0}.ML__mathlive .rlap>.inner{left:0}.ML__mathlive .rule{display:inline-block;border:0 solid;position:relative}.ML__mathlive .overline .overline-line,.ML__mathlive .underline .underline-line{width:100%}.ML__mathlive .overline .overline-line:before,.ML__mathlive .underline .underline-line:before{border-bottom-style:solid;border-bottom-width:.04em;content:"";display:block}.ML__mathlive .overline .overline-line:after,.ML__mathlive .underline .underline-line:after{border-bottom-style:solid;border-bottom-width:.04em;min-height:thin;content:"";display:block;margin-top:-1px}.ML__mathlive .stretchy{width:100%;display:block;position:absolute;left:0;overflow:hidden}.ML__mathlive .stretchy:after,.ML__mathlive .stretchy:before{content:""}.ML__mathlive .stretchy svg{display:block;position:absolute;width:100%;height:inherit;fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.ML__mathlive .slice-1-of-2{left:0}.ML__mathlive .slice-1-of-2,.ML__mathlive .slice-2-of-2{display:inline-flex;position:absolute;width:50.2%;overflow:hidden}.ML__mathlive .slice-2-of-2{right:0}.ML__mathlive .slice-1-of-3{display:inline-flex;position:absolute;left:0;width:25.1%;overflow:hidden}.ML__mathlive .slice-2-of-3{display:inline-flex;position:absolute;left:25%;width:50%;overflow:hidden}.ML__mathlive .slice-3-of-3{display:inline-flex;position:absolute;right:0;width:25.1%;overflow:hidden}.ML__mathlive .slice-1-of-1{display:inline-flex;position:absolute;width:100%;left:0;overflow:hidden}.ML__mathlive .sqrt{display:inline-block}.ML__mathlive .sqrt>.sqrt-sign{font-family:KaTeX_Main;position:relative}.ML__mathlive .sqrt .sqrt-line{height:.04em;width:100%}.ML__mathlive .sqrt .sqrt-line:before{content:"";display:block;margin-top:-.04em;border-bottom-style:solid;border-bottom-width:.04em;min-height:.5px}.ML__mathlive .sqrt .sqrt-line:after{border-bottom-width:1px;content:" ";display:block;margin-top:-.1em}.ML__mathlive .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.ML__mathlive .fontsize-ensurer,.ML__mathlive .sizing{display:inline-block}.ML__mathlive .fontsize-ensurer.reset-size1.size1,.ML__mathlive .sizing.reset-size1.size1{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size1.size2,.ML__mathlive .sizing.reset-size1.size2{font-size:1.4em}.ML__mathlive .fontsize-ensurer.reset-size1.size3,.ML__mathlive .sizing.reset-size1.size3{font-size:1.6em}.ML__mathlive .fontsize-ensurer.reset-size1.size4,.ML__mathlive .sizing.reset-size1.size4{font-size:1.8em}.ML__mathlive .fontsize-ensurer.reset-size1.size5,.ML__mathlive .sizing.reset-size1.size5{font-size:2em}.ML__mathlive .fontsize-ensurer.reset-size1.size6,.ML__mathlive .sizing.reset-size1.size6{font-size:2.4em}.ML__mathlive .fontsize-ensurer.reset-size1.size7,.ML__mathlive .sizing.reset-size1.size7{font-size:2.88em}.ML__mathlive .fontsize-ensurer.reset-size1.size8,.ML__mathlive .sizing.reset-size1.size8{font-size:3.46em}.ML__mathlive .fontsize-ensurer.reset-size1.size9,.ML__mathlive .sizing.reset-size1.size9{font-size:4.14em}.ML__mathlive .fontsize-ensurer.reset-size1.size10,.ML__mathlive .sizing.reset-size1.size10{font-size:4.98em}.ML__mathlive .fontsize-ensurer.reset-size2.size1,.ML__mathlive .sizing.reset-size2.size1{font-size:.71428571em}.ML__mathlive .fontsize-ensurer.reset-size2.size2,.ML__mathlive .sizing.reset-size2.size2{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size2.size3,.ML__mathlive .sizing.reset-size2.size3{font-size:1.14285714em}.ML__mathlive .fontsize-ensurer.reset-size2.size4,.ML__mathlive .sizing.reset-size2.size4{font-size:1.28571429em}.ML__mathlive .fontsize-ensurer.reset-size2.size5,.ML__mathlive .sizing.reset-size2.size5{font-size:1.42857143em}.ML__mathlive .fontsize-ensurer.reset-size2.size6,.ML__mathlive .sizing.reset-size2.size6{font-size:1.71428571em}.ML__mathlive .fontsize-ensurer.reset-size2.size7,.ML__mathlive .sizing.reset-size2.size7{font-size:2.05714286em}.ML__mathlive .fontsize-ensurer.reset-size2.size8,.ML__mathlive .sizing.reset-size2.size8{font-size:2.47142857em}.ML__mathlive .fontsize-ensurer.reset-size2.size9,.ML__mathlive .sizing.reset-size2.size9{font-size:2.95714286em}.ML__mathlive .fontsize-ensurer.reset-size2.size10,.ML__mathlive .sizing.reset-size2.size10{font-size:3.55714286em}.ML__mathlive .fontsize-ensurer.reset-size3.size1,.ML__mathlive .sizing.reset-size3.size1{font-size:.625em}.ML__mathlive .fontsize-ensurer.reset-size3.size2,.ML__mathlive .sizing.reset-size3.size2{font-size:.875em}.ML__mathlive .fontsize-ensurer.reset-size3.size3,.ML__mathlive .sizing.reset-size3.size3{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size3.size4,.ML__mathlive .sizing.reset-size3.size4{font-size:1.125em}.ML__mathlive .fontsize-ensurer.reset-size3.size5,.ML__mathlive .sizing.reset-size3.size5{font-size:1.25em}.ML__mathlive .fontsize-ensurer.reset-size3.size6,.ML__mathlive .sizing.reset-size3.size6{font-size:1.5em}.ML__mathlive .fontsize-ensurer.reset-size3.size7,.ML__mathlive .sizing.reset-size3.size7{font-size:1.8em}.ML__mathlive .fontsize-ensurer.reset-size3.size8,.ML__mathlive .sizing.reset-size3.size8{font-size:2.1625em}.ML__mathlive .fontsize-ensurer.reset-size3.size9,.ML__mathlive .sizing.reset-size3.size9{font-size:2.5875em}.ML__mathlive .fontsize-ensurer.reset-size3.size10,.ML__mathlive .sizing.reset-size3.size10{font-size:3.1125em}.ML__mathlive .fontsize-ensurer.reset-size4.size1,.ML__mathlive .sizing.reset-size4.size1{font-size:.55555556em}.ML__mathlive .fontsize-ensurer.reset-size4.size2,.ML__mathlive .sizing.reset-size4.size2{font-size:.77777778em}.ML__mathlive .fontsize-ensurer.reset-size4.size3,.ML__mathlive .sizing.reset-size4.size3{font-size:.88888889em}.ML__mathlive .fontsize-ensurer.reset-size4.size4,.ML__mathlive .sizing.reset-size4.size4{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size4.size5,.ML__mathlive .sizing.reset-size4.size5{font-size:1.11111111em}.ML__mathlive .fontsize-ensurer.reset-size4.size6,.ML__mathlive .sizing.reset-size4.size6{font-size:1.33333333em}.ML__mathlive .fontsize-ensurer.reset-size4.size7,.ML__mathlive .sizing.reset-size4.size7{font-size:1.6em}.ML__mathlive .fontsize-ensurer.reset-size4.size8,.ML__mathlive .sizing.reset-size4.size8{font-size:1.92222222em}.ML__mathlive .fontsize-ensurer.reset-size4.size9,.ML__mathlive .sizing.reset-size4.size9{font-size:2.3em}.ML__mathlive .fontsize-ensurer.reset-size4.size10,.ML__mathlive .sizing.reset-size4.size10{font-size:2.76666667em}.ML__mathlive .fontsize-ensurer.reset-size5.size1,.ML__mathlive .sizing.reset-size5.size1{font-size:.5em}.ML__mathlive .fontsize-ensurer.reset-size5.size2,.ML__mathlive .sizing.reset-size5.size2{font-size:.7em}.ML__mathlive .fontsize-ensurer.reset-size5.size3,.ML__mathlive .sizing.reset-size5.size3{font-size:.8em}.ML__mathlive .fontsize-ensurer.reset-size5.size4,.ML__mathlive .sizing.reset-size5.size4{font-size:.9em}.ML__mathlive .fontsize-ensurer.reset-size5.size5,.ML__mathlive .sizing.reset-size5.size5{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size5.size6,.ML__mathlive .sizing.reset-size5.size6{font-size:1.2em}.ML__mathlive .fontsize-ensurer.reset-size5.size7,.ML__mathlive .sizing.reset-size5.size7{font-size:1.44em}.ML__mathlive .fontsize-ensurer.reset-size5.size8,.ML__mathlive .sizing.reset-size5.size8{font-size:1.73em}.ML__mathlive .fontsize-ensurer.reset-size5.size9,.ML__mathlive .sizing.reset-size5.size9{font-size:2.07em}.ML__mathlive .fontsize-ensurer.reset-size5.size10,.ML__mathlive .sizing.reset-size5.size10{font-size:2.49em}.ML__mathlive .fontsize-ensurer.reset-size6.size1,.ML__mathlive .sizing.reset-size6.size1{font-size:.41666667em}.ML__mathlive .fontsize-ensurer.reset-size6.size2,.ML__mathlive .sizing.reset-size6.size2{font-size:.58333333em}.ML__mathlive .fontsize-ensurer.reset-size6.size3,.ML__mathlive .sizing.reset-size6.size3{font-size:.66666667em}.ML__mathlive .fontsize-ensurer.reset-size6.size4,.ML__mathlive .sizing.reset-size6.size4{font-size:.75em}.ML__mathlive .fontsize-ensurer.reset-size6.size5,.ML__mathlive .sizing.reset-size6.size5{font-size:.83333333em}.ML__mathlive .fontsize-ensurer.reset-size6.size6,.ML__mathlive .sizing.reset-size6.size6{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size6.size7,.ML__mathlive .sizing.reset-size6.size7{font-size:1.2em}.ML__mathlive .fontsize-ensurer.reset-size6.size8,.ML__mathlive .sizing.reset-size6.size8{font-size:1.44166667em}.ML__mathlive .fontsize-ensurer.reset-size6.size9,.ML__mathlive .sizing.reset-size6.size9{font-size:1.725em}.ML__mathlive .fontsize-ensurer.reset-size6.size10,.ML__mathlive .sizing.reset-size6.size10{font-size:2.075em}.ML__mathlive .fontsize-ensurer.reset-size7.size1,.ML__mathlive .sizing.reset-size7.size1{font-size:.34722222em}.ML__mathlive .fontsize-ensurer.reset-size7.size2,.ML__mathlive .sizing.reset-size7.size2{font-size:.48611111em}.ML__mathlive .fontsize-ensurer.reset-size7.size3,.ML__mathlive .sizing.reset-size7.size3{font-size:.55555556em}.ML__mathlive .fontsize-ensurer.reset-size7.size4,.ML__mathlive .sizing.reset-size7.size4{font-size:.625em}.ML__mathlive .fontsize-ensurer.reset-size7.size5,.ML__mathlive .sizing.reset-size7.size5{font-size:.69444444em}.ML__mathlive .fontsize-ensurer.reset-size7.size6,.ML__mathlive .sizing.reset-size7.size6{font-size:.83333333em}.ML__mathlive .fontsize-ensurer.reset-size7.size7,.ML__mathlive .sizing.reset-size7.size7{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size7.size8,.ML__mathlive .sizing.reset-size7.size8{font-size:1.20138889em}.ML__mathlive .fontsize-ensurer.reset-size7.size9,.ML__mathlive .sizing.reset-size7.size9{font-size:1.4375em}.ML__mathlive .fontsize-ensurer.reset-size7.size10,.ML__mathlive .sizing.reset-size7.size10{font-size:1.72916667em}.ML__mathlive .fontsize-ensurer.reset-size8.size1,.ML__mathlive .sizing.reset-size8.size1{font-size:.28901734em}.ML__mathlive .fontsize-ensurer.reset-size8.size2,.ML__mathlive .sizing.reset-size8.size2{font-size:.40462428em}.ML__mathlive .fontsize-ensurer.reset-size8.size3,.ML__mathlive .sizing.reset-size8.size3{font-size:.46242775em}.ML__mathlive .fontsize-ensurer.reset-size8.size4,.ML__mathlive .sizing.reset-size8.size4{font-size:.52023121em}.ML__mathlive .fontsize-ensurer.reset-size8.size5,.ML__mathlive .sizing.reset-size8.size5{font-size:.57803468em}.ML__mathlive .fontsize-ensurer.reset-size8.size6,.ML__mathlive .sizing.reset-size8.size6{font-size:.69364162em}.ML__mathlive .fontsize-ensurer.reset-size8.size7,.ML__mathlive .sizing.reset-size8.size7{font-size:.83236994em}.ML__mathlive .fontsize-ensurer.reset-size8.size8,.ML__mathlive .sizing.reset-size8.size8{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size8.size9,.ML__mathlive .sizing.reset-size8.size9{font-size:1.19653179em}.ML__mathlive .fontsize-ensurer.reset-size8.size10,.ML__mathlive .sizing.reset-size8.size10{font-size:1.43930636em}.ML__mathlive .fontsize-ensurer.reset-size9.size1,.ML__mathlive .sizing.reset-size9.size1{font-size:.24154589em}.ML__mathlive .fontsize-ensurer.reset-size9.size2,.ML__mathlive .sizing.reset-size9.size2{font-size:.33816425em}.ML__mathlive .fontsize-ensurer.reset-size9.size3,.ML__mathlive .sizing.reset-size9.size3{font-size:.38647343em}.ML__mathlive .fontsize-ensurer.reset-size9.size4,.ML__mathlive .sizing.reset-size9.size4{font-size:.43478261em}.ML__mathlive .fontsize-ensurer.reset-size9.size5,.ML__mathlive .sizing.reset-size9.size5{font-size:.48309179em}.ML__mathlive .fontsize-ensurer.reset-size9.size6,.ML__mathlive .sizing.reset-size9.size6{font-size:.57971014em}.ML__mathlive .fontsize-ensurer.reset-size9.size7,.ML__mathlive .sizing.reset-size9.size7{font-size:.69565217em}.ML__mathlive .fontsize-ensurer.reset-size9.size8,.ML__mathlive .sizing.reset-size9.size8{font-size:.83574879em}.ML__mathlive .fontsize-ensurer.reset-size9.size9,.ML__mathlive .sizing.reset-size9.size9{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size9.size10,.ML__mathlive .sizing.reset-size9.size10{font-size:1.20289855em}.ML__mathlive .fontsize-ensurer.reset-size10.size1,.ML__mathlive .sizing.reset-size10.size1{font-size:.20080321em}.ML__mathlive .fontsize-ensurer.reset-size10.size2,.ML__mathlive .sizing.reset-size10.size2{font-size:.2811245em}.ML__mathlive .fontsize-ensurer.reset-size10.size3,.ML__mathlive .sizing.reset-size10.size3{font-size:.32128514em}.ML__mathlive .fontsize-ensurer.reset-size10.size4,.ML__mathlive .sizing.reset-size10.size4{font-size:.36144578em}.ML__mathlive .fontsize-ensurer.reset-size10.size5,.ML__mathlive .sizing.reset-size10.size5{font-size:.40160643em}.ML__mathlive .fontsize-ensurer.reset-size10.size6,.ML__mathlive .sizing.reset-size10.size6{font-size:.48192771em}.ML__mathlive .fontsize-ensurer.reset-size10.size7,.ML__mathlive .sizing.reset-size10.size7{font-size:.57831325em}.ML__mathlive .fontsize-ensurer.reset-size10.size8,.ML__mathlive .sizing.reset-size10.size8{font-size:.69477912em}.ML__mathlive .fontsize-ensurer.reset-size10.size9,.ML__mathlive .sizing.reset-size10.size9{font-size:.8313253em}.ML__mathlive .fontsize-ensurer.reset-size10.size10,.ML__mathlive .sizing.reset-size10.size10{font-size:1em}.ML__mathlive .delimsizing.size1{font-family:KaTeX_Size1}.ML__mathlive .delimsizing.size2{font-family:KaTeX_Size2}.ML__mathlive .delimsizing.size3{font-family:KaTeX_Size3}.ML__mathlive .delimsizing.size4{font-family:KaTeX_Size4}.ML__mathlive .delimsizing.mult .delim-size1{font-family:KaTeX_Size1;vertical-align:top}.ML__mathlive .delimsizing.mult .delim-size4{font-family:KaTeX_Size4;vertical-align:top}.ML__mathlive .nulldelimiter{width:.12em}.ML__mathlive .op-symbol{position:relative}.ML__mathlive .op-symbol.small-op{font-family:KaTeX_Size1}.ML__mathlive .op-symbol.large-op{font-family:KaTeX_Size2}.ML__mathlive .op-limits .vlist>span{text-align:center}.ML__mathlive .op-over-under>.vlist>span:first-child,.ML__mathlive .op-over-under>.vlist>span:last-child{text-align:center}.ML__mathlive .accent>.vlist>span{text-align:center}.ML__mathlive .accent .accent-body>span{width:0}.ML__mathlive .accent .accent-body.accent-vec>span{position:relative;left:.326em}.ML__mathlive .mtable .vertical-separator{display:inline-block;margin:0 -.025em;border-right:.05em solid}.ML__mathlive .mtable .arraycolsep{display:inline-block}.ML__mathlive .mtable .col-align-m>.vlist{text-align:center}.ML__mathlive .mtable .col-align-c>.vlist{text-align:center}.ML__mathlive .mtable .col-align-l>.vlist{text-align:left}.ML__mathlive .mtable .col-align-r>.vlist{text-align:right}.ML__selection{background:var(--highlight-inactive);box-sizing:border-box}.ML__focused .ML__selection{background:var(--highlight)!important;color:var(--on-highlight)}.ML__contains-caret.ML__close,.ML__contains-caret.ML__open,.ML__contains-caret>.ML__close,.ML__contains-caret>.ML__open,.sqrt.ML__contains-caret>.sqrt-sign,.sqrt.ML__contains-caret>.vlist>span>.sqrt-line{color:var(--caret)}.ML__command{font-family:IBM Plex Mono,Source Code Pro,Consolas,Roboto Mono,Menlo,Bitstream Vera Sans Mono,DejaVu Sans Mono,Monaco,Courier,monospace;letter-spacing:-1px;font-weight:400;line-height:1em;color:var(--primary)}:not(.ML__command)+.ML__command{margin-left:.25em}.ML__command+:not(.ML__command){padding-left:.25em}.ML__smart-fence__close{opacity:.5}.ML__keystroke-caption{visibility:hidden;background:var(--secondary);border-color:var(--secondary-border);box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);text-align:center;border-radius:6px;padding:16px;position:absolute;z-index:1;display:flex;flex-direction:row;justify-content:center;--keystroke:#fff;--on-keystroke:#555;--keystroke-border:#f7f7f7}@media (prefers-color-scheme:dark){body:not([theme=light]) .ML__keystroke-caption{--keystroke:hsl(var(--hue),50%,30%);--on-keystroke:#fafafa;--keystroke-border:hsl(var(--hue),50%,25%)}}body[theme=dark] .ML__keystroke-caption{--keystroke:hsl(var(--hue),50%,30%);--on-keystroke:#fafafa;--keystroke-border:hsl(var(--hue),50%,25%)}[data-tooltip]{position:relative}[data-tooltip][data-placement=top]:after{top:inherit;bottom:100%}[data-tooltip]:after{position:absolute;visibility:hidden;content:attr(data-tooltip);display:inline-table;top:110%;width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:200px;padding:8px;background:#616161;color:#fff;text-align:center;z-index:2;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);border-radius:2px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-weight:400;font-size:12px;opacity:0;transform:scale(.5);transition:all .15s cubic-bezier(.4,0,1,1)}@media only screen and (max-width:767px){[data-tooltip]:after{height:32px;padding:4px 16px;font-size:14px}}[data-tooltip]:hover{position:relative}[data-tooltip]:hover:after{visibility:visible;opacity:1;transform:scale(1)}[data-tooltip][data-delay]:after{transition-delay:0s}[data-tooltip][data-delay]:hover:after{transition-delay:1s}.ML__keyboard{--keyboard-background:rgba(209,213,217,0.97);--keyboard-text:#000;--keyboard-text-active:var(--primary);--keyboard-background-border:#ddd;--keycap-background:#fff;--keycap-background-active:#e5e5e5;--keycap-background-border:#e5e6e9;--keycap-background-border-bottom:#8d8f92;--keycap-text:#000;--keycap-text-active:#fff;--keycap-secondary-text:#000;--keycap-modifier-background:#b9bdc7;--keycap-modifier-border:#c5c9d0;--keycap-modifier-border-bottom:#989da6;--keyboard-alternate-background:#fff;--keyboard-alternate-background-active:#e5e5e5;--keyboard-alternate-text:#000;position:fixed;left:0;bottom:-267px;width:100vw;z-index:105;padding-top:5px;transform:translate(0);opacity:0;visibility:hidden;transition:.28s cubic-bezier(0,0,.2,1);transition-property:transform,opacity;-webkit-backdrop-filter:grayscale(50%);backdrop-filter:grayscale(50%);background-color:var(--keyboard-background);border:1px solid var(--keyboard-background-border);font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:16px;font-weight:400;margin:0;text-shadow:none;box-sizing:border-box;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23)}.ML__keyboard.is-visible{transform:translateY(-267px);opacity:1;visibility:visible;transition-timing-function:cubic-bezier(.4,0,1,1)}.ML__keyboard .tex{font-family:KaTeX_Main,Cambria Math,Asana Math,OpenSymbol,Symbola,STIX,Times,serif!important}.ML__keyboard .tex-math{font-family:KaTeX_Math,Cambria Math,Asana Math,OpenSymbol,Symbola,STIX,Times,serif!important}.ML__keyboard .tt{font-family:IBM Plex Mono,Source Code Pro,Consolas,Roboto Mono,Menlo,Bitstream Vera Sans Mono,DejaVu Sans Mono,Monaco,Courier,monospace!important;font-size:30px;font-weight:400}.ML__keyboard.alternate-keys{visibility:hidden;max-width:286px;background-color:var(--keyboard-alternate-background);text-align:center;border-radius:6px;position:fixed;bottom:auto;top:0;box-sizing:content-box;transform:none;z-index:106;display:flex;flex-direction:row;justify-content:center;align-content:center;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22);transition:none}@media only screen and (max-height:412px){.ML__keyboard.alternate-keys{max-width:320px}}.ML__keyboard.alternate-keys.is-visible{visibility:visible}.ML__keyboard.alternate-keys ul{list-style:none;margin:3px;padding:0;display:flex;flex-flow:row wrap-reverse;justify-content:center}.ML__keyboard.alternate-keys ul>li{display:flex;flex-flow:column;align-items:center;justify-content:center;font-size:30px;height:70px;width:70px;box-sizing:border-box;margin:0;background:transparent;border:1px solid transparent;border-radius:5px;pointer-events:all;color:var(--keyboard-alternate-text);fill:currentColor}@media only screen and (max-height:412px){.ML__keyboard.alternate-keys ul>li{font-size:24px;height:50px;width:50px}}.ML__keyboard.alternate-keys ul>li.active,.ML__keyboard.alternate-keys ul>li.pressed,.ML__keyboard.alternate-keys ul>li:hover{box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23);background:var(--keyboard-alternate-background-active);color:var(--keyboard-text-active)}.ML__keyboard.alternate-keys ul>li.small{font-size:18px}.ML__keyboard.alternate-keys ul>li.small-button{width:42px;height:42px;margin:2px;background:#fbfbfb}.ML__keyboard.alternate-keys ul>li.small-button:hover{background:var(--keyboard-alternate-background-active)}.ML__keyboard.alternate-keys ul>li.box>div,.ML__keyboard.alternate-keys ul>li.box>span{border:1px dashed rgba(0,0,0,.24)}.ML__keyboard.alternate-keys ul>li .warning{min-height:60px;min-width:60px;background:#cd0030;color:#fff;padding:5px;display:flex;align-items:center;justify-content:center;border-radius:5px}.ML__keyboard.alternate-keys ul>li .warning.active,.ML__keyboard.alternate-keys ul>li .warning.pressed,.ML__keyboard.alternate-keys ul>li .warning:hover{background:red}.ML__keyboard.alternate-keys ul>li .warning svg{width:50px;height:50px}.ML__keyboard.alternate-keys ul>li aside{font-size:12px;line-height:12px;opacity:.78;padding-top:2px}.ML__keyboard>div.keyboard-layer{display:none;outline:none}.ML__keyboard>div.keyboard-layer.is-visible{display:flex;flex-flow:column}.ML__keyboard>div>div.keyboard-toolbar{align-self:center;display:flex;flex-flow:row;justify-content:space-between;width:736px}@media only screen and (min-width:768px) and (max-width:1024px){.ML__keyboard>div>div.keyboard-toolbar{width:556px}}@media only screen and (max-width:767px){.ML__keyboard>div>div.keyboard-toolbar{width:365px;max-width:100vw}}.ML__keyboard>div>div.keyboard-toolbar svg{height:20px;width:20px}@media only screen and (max-width:767px){.ML__keyboard>div>div.keyboard-toolbar svg{height:13px;width:17px}}.ML__keyboard>div>div.keyboard-toolbar>.left{position:relative;display:flex;justify-content:flex-start;flex-flow:row}.ML__keyboard>div>div.keyboard-toolbar>.right{display:flex;justify-content:flex-end;flex-flow:row}.ML__keyboard>div>div.keyboard-toolbar>div>div{display:flex;align-items:baseline;justify-content:center;pointer-events:all;color:var(--keyboard-text);fill:currentColor;background:0;font-size:110%;cursor:pointer;min-height:0;padding:4px 10px;margin:7px 4px 6px;box-shadow:none;border:none;border-bottom:2px solid transparent}.ML__keyboard>div>div.keyboard-toolbar>div>div.disabled.pressed svg,.ML__keyboard>div>div.keyboard-toolbar>div>div.disabled:hover svg,.ML__keyboard>div>div.keyboard-toolbar>div>div.disabled svg{color:var(--keyboard-text);opacity:.2}@media only screen and (max-width:414px){.ML__keyboard>div>div.keyboard-toolbar>div>div{font-size:100%;padding:0 6px 0 0}}@media only screen and (max-width:767px){.ML__keyboard>div>div.keyboard-toolbar>div>div{padding-left:4px;padding-right:4px;font-size:90%}}.ML__keyboard>div>div.keyboard-toolbar>div>div.active,.ML__keyboard>div>div.keyboard-toolbar>div>div.pressed,.ML__keyboard>div>div.keyboard-toolbar>div>div:active,.ML__keyboard>div>div.keyboard-toolbar>div>div:hover{color:var(--keyboard-text-active)}.ML__keyboard>div>div.keyboard-toolbar>div>div.selected{color:var(--keyboard-text-active);border-bottom:2px solid var(--keyboard-text-active);margin-bottom:8px;padding-bottom:0}.ML__keyboard div .rows{border:0;border-collapse:separate;clear:both;margin:auto;display:flex;flex-flow:column;align-items:center}.ML__keyboard div .rows>ul{list-style:none;height:40px;margin:0 0 3px;padding:0}.ML__keyboard div .rows>ul>li{display:flex;flex-flow:column;align-items:center;justify-content:center;width:34px;margin-right:2px;height:40px;box-sizing:border-box;padding:8px 0;vertical-align:top;text-align:center;float:left;color:var(--keycap-text);fill:currentColor;font-size:20px;background:var(--keycap-background);border:1px solid var(--keycap-background-border);border-bottom-color:var(--keycap-background-border-bottom);border-radius:5px;pointer-events:all;position:relative;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ML__keyboard div .rows>ul>li:last-child{margin-right:0}.ML__keyboard div .rows>ul>li.small{font-size:16px}.ML__keyboard div .rows>ul>li.tt{color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.bottom{justify-content:flex-end}.ML__keyboard div .rows>ul>li.left{align-items:flex-start;padding-left:4px}.ML__keyboard div .rows>ul>li.right{align-items:flex-end;padding-right:4px}.ML__keyboard div .rows>ul>li svg{width:20px;height:20px}.ML__keyboard div .rows>ul>li .warning{height:25px;width:25px;min-height:25px;min-width:25px;background:#cd0030;color:#fff;border-radius:100%;padding:5px;display:flex;align-items:center;justify-content:center;margin-bottom:-2px}.ML__keyboard div .rows>ul>li .warning svg{width:16px;height:16px}@media only screen and (max-width:768px){.ML__keyboard div .rows>ul>li .warning{height:16px;width:16px;min-height:16px;min-width:16px}.ML__keyboard div .rows>ul>li .warning svg{width:14px;height:14px}}.ML__keyboard div .rows>ul>li>.w0{width:0}.ML__keyboard div .rows>ul>li>.w5{width:16px}.ML__keyboard div .rows>ul>li>.w15{width:52px}.ML__keyboard div .rows>ul>li>.w20{width:70px}.ML__keyboard div .rows>ul>li>.w50{width:178px}.ML__keyboard div .rows>ul>li.separator{background:transparent;border:none;pointer-events:none}@media only screen and (max-width:560px){.ML__keyboard div .rows>ul>li.if-wide{display:none}}.ML__keyboard div .rows>ul>li.tex-math{font-size:25px}.ML__keyboard div .rows>ul>li.pressed,.ML__keyboard div .rows>ul>li:hover{background:var(--keycap-background-active);color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.action.active,.ML__keyboard div .rows>ul>li.action:active,.ML__keyboard div .rows>ul>li.keycap.active,.ML__keyboard div .rows>ul>li.keycap:active{transform:translateY(-20px) scale(1.4);z-index:100;color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.modifier.active,.ML__keyboard div .rows>ul>li.modifier:active{background:var(--keyboard-text-active);color:var(--keycap-text-active)}.ML__keyboard div .rows>ul>li.action.font-glyph,.ML__keyboard div .rows>ul>li.modifier.font-glyph{font-size:18px}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li.action.font-glyph,.ML__keyboard div .rows>ul>li.modifier.font-glyph{font-size:16px}}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li.bigfnbutton,.ML__keyboard div .rows>ul>li.fnbutton{font-size:12px}}.ML__keyboard div .rows>ul>li.bigfnbutton{font-size:14px}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li.bigfnbutton{font-size:9px}}.ML__keyboard div .rows>ul>li.action,.ML__keyboard div .rows>ul>li.modifier{background-color:var(--keycap-modifier-background);border-bottom-color:var(--keycap-modifier-border);border-color:var(--keycap-modifier-border) var(--keycap-modifier-border) var(--keycap-modifier-border-bottom);font-size:65%;font-weight:100}.ML__keyboard div .rows>ul>li.action.selected,.ML__keyboard div .rows>ul>li.modifier.selected{color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.action.selected.active,.ML__keyboard div .rows>ul>li.action.selected.pressed,.ML__keyboard div .rows>ul>li.action.selected:active,.ML__keyboard div .rows>ul>li.action.selected:hover,.ML__keyboard div .rows>ul>li.modifier.selected.active,.ML__keyboard div .rows>ul>li.modifier.selected.pressed,.ML__keyboard div .rows>ul>li.modifier.selected:active,.ML__keyboard div .rows>ul>li.modifier.selected:hover{color:#fff}.ML__keyboard div .rows>ul>li.keycap.w50{font-size:80%;padding-top:10px;font-weight:100}.ML__keyboard div .rows>ul>li small{color:#555}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li small{font-size:9px}}.ML__keyboard div .rows>ul>li aside{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:10px;line-height:10px;color:#666}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li aside{display:none}}@media only screen and (max-width:414px){.ML__keyboard div .rows>ul>li{width:29px;margin-right:2px}.ML__keyboard div .rows>ul>.w5{width:13.5px}.ML__keyboard div .rows>ul>.w15{width:44.5px}.ML__keyboard div .rows>ul>.w20{width:60px}.ML__keyboard div .rows>ul>.w50{width:153px}}@media only screen and (min-width:415px) and (max-width:768px){.ML__keyboard div .rows>ul>li{width:37px;margin-right:3px}.ML__keyboard div .rows>ul>.w5{width:17px}.ML__keyboard div .rows>ul>.w15{width:57px}.ML__keyboard div .rows>ul>.w20{width:77px}.ML__keyboard div .rows>ul>.w50{width:197px}}@media only screen and (min-width:768px) and (max-width:1024px){.ML__keyboard div .rows>ul{height:52px}.ML__keyboard div .rows>ul>li{height:52px;width:51px;margin-right:4px}.ML__keyboard div .rows>ul>.w5{width:23.5px}.ML__keyboard div .rows>ul>.w15{width:78.5px}.ML__keyboard div .rows>ul>.w20{width:106px}.ML__keyboard div .rows>ul>.w50{width:271px}}@media only screen and (min-width:1025px){.ML__keyboard div .rows>ul{height:52px}.ML__keyboard div .rows>ul>li{height:52px;width:66px;margin-right:6px}.ML__keyboard div .rows>ul>.action,.ML__keyboard div .rows>ul>.modifier{font-size:80%}.ML__keyboard div .rows>ul>.w5{width:30px}.ML__keyboard div .rows>ul>.w15{width:102px}.ML__keyboard div .rows>ul>.w20{width:138px}.ML__keyboard div .rows>ul>.w50{width:354px}}@media (prefers-color-scheme:dark){body:not([theme=light]) .ML__keyboard{--hue:206;--keyboard-background:hsl(var(--hue),19%,38%);--keyboard-text:#f0f0f0;--keyboard-text-active:hsl(var(--hue),100%,60%);--keyboard-background-border:#333;--keycap-background:hsl(var(--hue),25%,39%);--keycap-background-active:hsl(var(--hue),35%,42%);--keycap-background-border:hsl(var(--hue),25%,35%);--keycap-background-border-bottom:#426b8a;--keycap-text:#d0d0d0;--keycap-text-active:#000;--keycap-secondary-text:#fff;--keycap-modifier-background:hsl(var(--hue),35%,40%);--keycap-modifier-border:hsl(var(--hue),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue),35%,42%);--keyboard-alternate-background:hsl(var(--hue),19%,38%);--keyboard-alternate-background-active:hsl(var(--hue),35%,42%);--keyboard-alternate-text:#d1d1d1}}body[theme=dark] .ML__keyboard{--hue:206;--keyboard-background:hsl(var(--hue),19%,38%);--keyboard-text:#f0f0f0;--keyboard-text-active:hsl(var(--hue),100%,60%);--keyboard-background-border:#333;--keycap-background:hsl(var(--hue),25%,39%);--keycap-background-active:hsl(var(--hue),35%,42%);--keycap-background-border:hsl(var(--hue),25%,35%);--keycap-background-border-bottom:#426b8a;--keycap-text:#d0d0d0;--keycap-text-active:#000;--keycap-secondary-text:#fff;--keycap-modifier-background:hsl(var(--hue),35%,40%);--keycap-modifier-border:hsl(var(--hue),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue),35%,42%);--keyboard-alternate-background:hsl(var(--hue),19%,38%);--keyboard-alternate-background-active:hsl(var(--hue),35%,42%);--keyboard-alternate-text:#d1d1d1}div.ML__keyboard.material{--keyboard-background:rgba(209,213,217,0.9);--keyboard-background-border:#ddd;--keycap-background:transparent;--keycap-background-active:#cccfd1;--keycap-background-border:transparent;--keyboard-alternate-background:#efefef;--keyboard-alternate-text:#000;font-family:Roboto,sans-serif}div.ML__keyboard.material.alternate-keys{background:var(--keyboard-alternate-background);border:1px solid transparent;border-radius:5px;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22)}div.ML__keyboard.material.alternate-keys ul li.active,div.ML__keyboard.material.alternate-keys ul li.pressed,div.ML__keyboard.material.alternate-keys ul li:active,div.ML__keyboard.material.alternate-keys ul li:hover{border:1px solid transparent;background:#5f97fc;color:#fff;fill:currentColor}div.ML__keyboard.material .keyboard-toolbar>div>div{font-size:16px}div.ML__keyboard.material .keyboard-toolbar div.div.active,div.ML__keyboard.material .keyboard-toolbar div.div.pressed,div.ML__keyboard.material .keyboard-toolbar div div:active,div.ML__keyboard.material .keyboard-toolbar div div:hover{color:#5f97fc;fill:currentColor}div.ML__keyboard.material .keyboard-toolbar>div>.selected{color:#5f97fc;fill:currentColor;border-bottom:2px solid #5f97fc;margin-bottom:8px;padding-bottom:0}div.ML__keyboard.material div>.rows>ul>.keycap{background:transparent;border:1px solid transparent;border-radius:5px;color:var(--keycap-text);fill:currentColor;transition:none}div.ML__keyboard.material div>.rows>ul>.keycap.tt{color:#5f97fc}div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "]{margin-top:10px;margin-bottom:10px;height:20px;background:#e0e0e0}div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "].active,div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "].pressed,div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "]:active,div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "]:hover{background:#d0d0d0;box-shadow:none;transform:none}div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):hover{border:1px solid transparent;background:var(--keycap-background-active);box-shadow:none}div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).active,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).pressed,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):active{background:var(--keyboard-alternate-background);color:var(--keyboard-alternate-text);box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23)}@media only screen and (max-width:767px){div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).active,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).pressed,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):active{box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23);font-size:10px;vertical-align:top;width:19.5px;margin-right:10px;margin-left:10px;transform:translateY(-20px) scale(2);transition:none;justify-content:flex-start;padding:2px 0 0;z-index:100}}@media only screen and (max-width:414px){div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).active,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).pressed,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):active{width:16.5px}}@media only screen and (max-width:767px){div.ML__keyboard.material div>.rows>ul>.keycap:last-child.active,div.ML__keyboard.material div>.rows>ul>.keycap:last-child:active{margin-right:0;margin-left:14px}}div.ML__keyboard.material div div.rows ul li.action,div.ML__keyboard.material div div.rows ul li.modifier{background:transparent;border:0;color:#869096;fill:currentColor;font-size:16px;transition:none}div.ML__keyboard.material div div.rows ul li.action.selected,div.ML__keyboard.material div div.rows ul li.modifier.selected{color:#5f97fc;border-radius:0;border-bottom:2px solid #5f97fc}div.ML__keyboard.material div div.rows ul li.action.active,div.ML__keyboard.material div div.rows ul li.action.pressed,div.ML__keyboard.material div div.rows ul li.action:active,div.ML__keyboard.material div div.rows ul li.action:hover,div.ML__keyboard.material div div.rows ul li.modifier.active,div.ML__keyboard.material div div.rows ul li.modifier.pressed,div.ML__keyboard.material div div.rows ul li.modifier:active,div.ML__keyboard.material div div.rows ul li.modifier:hover{border:0;color:var(--keycap-text);background:var(--keycap-background-active);box-shadow:none}div.ML__keyboard.material div div.rows ul li.bigfnbutton,div.ML__keyboard.material div div.rows ul li.fnbutton{background:transparent;border:0}div.ML__keyboard.material div div.rows ul li.bigfnbutton.selected,div.ML__keyboard.material div div.rows ul li.fnbutton.selected{color:#5f97fc;fill:currentColor;border-radius:0;border-bottom:2px solid #5f97fc}div.ML__keyboard.material div div.rows ul li.bigfnbutton.active,div.ML__keyboard.material div div.rows ul li.bigfnbutton.pressed,div.ML__keyboard.material div div.rows ul li.bigfnbutton:active,div.ML__keyboard.material div div.rows ul li.bigfnbutton:hover,div.ML__keyboard.material div div.rows ul li.fnbutton.active,div.ML__keyboard.material div div.rows ul li.fnbutton.pressed,div.ML__keyboard.material div div.rows ul li.fnbutton:active,div.ML__keyboard.material div div.rows ul li.fnbutton:hover{border:0;color:#5f97fc;fill:currentColor;background:var(--keycap-background-active);box-shadow:none}@media (prefers-color-scheme:dark){body:not([theme=light]) div.ML__keyboard.material{--hue:198;--keyboard-background:hsl(var(--hue),19%,18%);--keyboard-text:#d4d6d7;--keyboard-text-active:#5f97fc;--keyboard-background-border:#333;--keycap-background:hsl(var(--hue),25%,39%);--keycap-background-active:#5f97fc;--keycap-background-border:transparent;--keycap-background-border-bottom:transparent;--keycap-text:#d0d0d0;--keycap-text-active:#d4d6d7;--keycap-secondary-text:#5f97fc;--keycap-modifier-background:hsl(var(--hue),35%,40%);--keycap-modifier-border:hsl(var(--hue),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue),35%,42%);--keyboard-alternate-background:hsl(var(--hue),8%,2%);--keyboard-alternate-background-active:hsl(var(--hue),35%,42%);--keyboard-alternate-text:#d1d1d1}}body[theme=dark] div.ML__keyboard.material{--hue:198;--keyboard-background:hsl(var(--hue),19%,18%);--keyboard-text:#d4d6d7;--keyboard-text-active:#5f97fc;--keyboard-background-border:#333;--keycap-background:hsl(var(--hue),25%,39%);--keycap-background-active:#5f97fc;--keycap-background-border:transparent;--keycap-background-border-bottom:transparent;--keycap-text:#d0d0d0;--keycap-text-active:#d4d6d7;--keycap-secondary-text:#5f97fc;--keycap-modifier-background:hsl(var(--hue),35%,40%);--keycap-modifier-border:hsl(var(--hue),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue),35%,42%);--keyboard-alternate-background:hsl(var(--hue),8%,2%);--keyboard-alternate-background-active:hsl(var(--hue),35%,42%);--keyboard-alternate-text:#d1d1d1}.ML__error{background-image:radial-gradient(ellipse at center,#cc0041,transparent 70%);background-repeat:repeat-x;background-size:3px 3px;background-position:0 98%}.ML__suggestion{opacity:.5}.ML__placeholder{opacity:.7;padding-left:.4ex;padding-right:.4ex;padding-top:.4ex}.ML__keystroke-caption>span{min-width:14px;margin:0 8px 0 0;padding:4px;background-color:var(--keystroke);color:var(--on-keystroke);fill:currentColor;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:1em;border-radius:6px;border:2px solid var(--keystroke-border)}.ML__virtual-keyboard-toggle.pressed{background:hsla(0,0%,70%,.5)}.ML__virtual-keyboard-toggle:focus{outline:none;border-radius:50%;border:2px solid var(--primary)}.ML__virtual-keyboard-toggle.active,.ML__virtual-keyboard-toggle.active:hover{background:hsla(0,0%,70%,.5);color:#000;fill:currentColor}div.ML__popover.is-visible{visibility:visible;-webkit-animation:ML__fade-in .15s cubic-bezier(0,0,.2,1);animation:ML__fade-in .15s cubic-bezier(0,0,.2,1)}@-webkit-keyframes ML__fade-in{0%{opacity:0}to{opacity:1}}@keyframes ML__fade-in{0%{opacity:0}to{opacity:1}}.ML__popover__content{border-radius:6px;padding:2px;cursor:pointer;min-height:100px;display:flex;flex-direction:column;justify-content:center;margin-left:8px;margin-right:8px}.ML__popover__content a{color:#5ea6fd;padding-top:.3em;margin-top:.4em;display:block}.ML__popover__content a:hover{color:#5ea6fd;text-decoration:underline}.ML__popover__content.active,.ML__popover__content.pressed,.ML__popover__content:hover{background:hsla(0,0%,100%,.1)}.ML__popover__command{font-size:1.6rem}.ML__popover__prev-shortcut{height:31px;opacity:.1;cursor:pointer;margin-left:8px;margin-right:8px;padding-top:4px;padding-bottom:2px}.ML__popover__next-shortcut:hover,.ML__popover__prev-shortcut:hover{opacity:.3}.ML__popover__next-shortcut.active,.ML__popover__next-shortcut.pressed,.ML__popover__prev-shortcut.active,.ML__popover__prev-shortcut.pressed{opacity:1}.ML__popover__next-shortcut>span,.ML__popover__prev-shortcut>span{padding:5px;border-radius:50%;width:20px;height:20px;display:inline-block}.ML__popover__prev-shortcut>span>span{margin-top:-2px;display:block}.ML__popover__next-shortcut>span>span{margin-top:2px;display:block}.ML__popover__next-shortcut:hover>span,.ML__popover__prev-shortcut:hover>span{background:hsla(0,0%,100%,.1)}.ML__popover__next-shortcut{height:34px;opacity:.1;cursor:pointer;margin-left:8px;margin-right:8px;padding-top:2px;padding-bottom:4px}.ML__popover__shortcut{font-size:.8em;margin-top:.25em}.ML__popover__note,.ML__popover__shortcut{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;opacity:.7;padding-top:.25em}.ML__popover__note{font-size:.8rem;line-height:1em;padding-left:.5em;padding-right:.5em}.ML__shortcut-join{opacity:.5}.ML__scroller{position:fixed;z-index:1;top:0;height:100vh;width:200px} +/* 0.52.1-soc */@font-face{font-family:KaTeX_AMS;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff");font-weight:700;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff");font-weight:700;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff");font-weight:700;font-style:italic;font-display:"swap"}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff");font-weight:700;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff");font-weight:400;font-style:italic;font-display:"swap"}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff");font-weight:700;font-style:italic;font-display:"swap"}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff");font-weight:700;font-style:normal;font-display:"swap"}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff");font-weight:400;font-style:italic;font-display:"swap"}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Script;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Size1;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Size2;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Size3;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Size4;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Typewriter;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff");font-weight:400;font-style:italic;font-display:"swap"}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.ML__small-delim{font-family:KaTeX_Main}.ML__mathit{font-family:KaTeX_Math;font-style:italic}.ML__cmr{font-style:normal}.ML__cmr,.ML__mathbf{font-family:KaTeX_Main}.ML__mathbf{font-weight:700}.lcGreek.ML__mathbf{font-family:KaTeX_Math;font-weight:400}.ML__mathbfit{font-family:KaTeX_Math;font-weight:700;font-style:italic}.ML__ams,.ML__bb{font-family:KaTeX_AMS}.ML__cal{font-family:KaTeX_Caligraphic}.ML__frak{font-family:KaTeX_Fraktur}.ML__tt{font-family:KaTeX_Typewriter}.ML__script{font-family:KaTeX_Script}.ML__sans{font-family:KaTeX_SansSerif}.ML__cmti{font-family:KaTeX_Main;font-style:italic}.ML__series_el,.ML__series_ul{font-weight:100}.ML__series_l{font-weight:200}.ML__series_sl{font-weight:300}.ML__series_sb{font-weight:500}.ML__bold,.ML__boldsymbol{font-weight:700}.ML__series_eb{font-weight:800}.ML__series_ub{font-weight:900}.ML__series_uc{font-stretch:ultra-condensed}.ML__series_ec{font-stretch:extra-condensed}.ML__series_c{font-stretch:condensed}.ML__series_sc{font-stretch:semi-condensed}.ML__series_sx{font-stretch:semi-expanded}.ML__series_x{font-stretch:expanded}.ML__series_ex{font-stretch:extra-expanded}.ML__series_ux{font-stretch:ultra-expanded}.ML__it{font-style:italic}.ML__shape_ol{-webkit-text-stroke:1px #000;text-stroke:1px #000;color:transparent}.ML__shape_sc{font-variant:small-caps}.ML__shape_sl{font-style:oblique}.ML__emph{color:#bc2612}.ML__emph .ML__emph{color:#0c7f99}.ML__mathlive .highlight{color:#007cb2;background:#edd1b0}.ML__mathlive .reset-textstyle.scriptstyle{font-size:.7em}.ML__mathlive .reset-textstyle.scriptscriptstyle{font-size:.5em}.ML__mathlive .reset-scriptstyle.textstyle{font-size:1.42857em}.ML__mathlive .reset-scriptstyle.scriptscriptstyle{font-size:.71429em}.ML__mathlive .reset-scriptscriptstyle.textstyle{font-size:2em}.ML__mathlive .reset-scriptscriptstyle.scriptstyle{font-size:1.4em}.ML__mathlive .style-wrap{position:relative}.ML__mathlive .vlist{display:inline-block}.ML__mathlive .vlist>span{display:block;height:0;position:relative;line-height:0}.ML__mathlive .vlist>span>span{display:inline-block}.ML__mathlive .msubsup{text-align:left}.ML__mathlive .mfrac>span{text-align:center}.ML__mathlive .mfrac .frac-line{width:100%}.ML__mathlive .mfrac .frac-line:after{content:"";display:block;margin-top:-.04em;min-height:.04em;background:currentColor;box-sizing:content-box}.ML__mathlive .rspace.negativethinspace{margin-right:-.16667em}.ML__mathlive .rspace.thinspace{margin-right:.16667em}.ML__mathlive .rspace.negativemediumspace{margin-right:-.22222em}.ML__mathlive .rspace.mediumspace{margin-right:.22222em}.ML__mathlive .rspace.thickspace{margin-right:.27778em}.ML__mathlive .rspace.sixmuspace{margin-right:.333333em}.ML__mathlive .rspace.eightmuspace{margin-right:.444444em}.ML__mathlive .rspace.enspace{margin-right:.5em}.ML__mathlive .rspace.twelvemuspace{margin-right:.666667em}.ML__mathlive .rspace.quad{margin-right:1em}.ML__mathlive .rspace.qquad{margin-right:2em}.ML__mathlive .mspace{display:inline-block}.ML__mathlive .mspace.negativethinspace{margin-left:-.16667em}.ML__mathlive .mspace.thinspace{width:.16667em}.ML__mathlive .mspace.negativemediumspace{margin-left:-.22222em}.ML__mathlive .mspace.mediumspace{width:.22222em}.ML__mathlive .mspace.thickspace{width:.27778em}.ML__mathlive .mspace.sixmuspace{width:.333333em}.ML__mathlive .mspace.eightmuspace{width:.444444em}.ML__mathlive .mspace.enspace{width:.5em}.ML__mathlive .mspace.twelvemuspace{width:.666667em}.ML__mathlive .mspace.quad{width:1em}.ML__mathlive .mspace.qquad{width:2em}.ML__mathlive .llap,.ML__mathlive .rlap{width:0;position:relative}.ML__mathlive .llap>.inner,.ML__mathlive .rlap>.inner{position:absolute}.ML__mathlive .llap>.fix,.ML__mathlive .rlap>.fix{display:inline-block}.ML__mathlive .llap>.inner{right:0}.ML__mathlive .rlap>.inner{left:0}.ML__mathlive .rule{display:inline-block;border:0 solid;position:relative}.ML__mathlive .overline .overline-line,.ML__mathlive .underline .underline-line{width:100%}.ML__mathlive .overline .overline-line:before,.ML__mathlive .underline .underline-line:before{border-bottom-style:solid;border-bottom-width:.04em;content:"";display:block}.ML__mathlive .overline .overline-line:after,.ML__mathlive .underline .underline-line:after{border-bottom-style:solid;border-bottom-width:.04em;min-height:thin;content:"";display:block;margin-top:-1px}.ML__mathlive .stretchy{width:100%;display:block;position:absolute;left:0;overflow:hidden}.ML__mathlive .stretchy:after,.ML__mathlive .stretchy:before{content:""}.ML__mathlive .stretchy svg{display:block;position:absolute;width:100%;height:inherit;fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.ML__mathlive .slice-1-of-2{left:0}.ML__mathlive .slice-1-of-2,.ML__mathlive .slice-2-of-2{display:inline-flex;position:absolute;width:50.2%;overflow:hidden}.ML__mathlive .slice-2-of-2{right:0}.ML__mathlive .slice-1-of-3{display:inline-flex;position:absolute;left:0;width:25.1%;overflow:hidden}.ML__mathlive .slice-2-of-3{display:inline-flex;position:absolute;left:25%;width:50%;overflow:hidden}.ML__mathlive .slice-3-of-3{display:inline-flex;position:absolute;right:0;width:25.1%;overflow:hidden}.ML__mathlive .slice-1-of-1{display:inline-flex;position:absolute;width:100%;left:0;overflow:hidden}.ML__mathlive .sqrt{display:inline-block}.ML__mathlive .sqrt>.sqrt-sign{font-family:KaTeX_Main;position:relative}.ML__mathlive .sqrt .sqrt-line{height:.04em;width:100%}.ML__mathlive .sqrt .sqrt-line:before{content:"";display:block;margin-top:-.04em;min-height:.04em;background:currentColor}.ML__mathlive .sqrt .sqrt-line:after{border-bottom-width:1px;content:" ";display:block;margin-top:-.1em}.ML__mathlive .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.ML__mathlive .fontsize-ensurer,.ML__mathlive .sizing{display:inline-block}.ML__mathlive .fontsize-ensurer.reset-size1.size1,.ML__mathlive .sizing.reset-size1.size1{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size1.size2,.ML__mathlive .sizing.reset-size1.size2{font-size:1.4em}.ML__mathlive .fontsize-ensurer.reset-size1.size3,.ML__mathlive .sizing.reset-size1.size3{font-size:1.6em}.ML__mathlive .fontsize-ensurer.reset-size1.size4,.ML__mathlive .sizing.reset-size1.size4{font-size:1.8em}.ML__mathlive .fontsize-ensurer.reset-size1.size5,.ML__mathlive .sizing.reset-size1.size5{font-size:2em}.ML__mathlive .fontsize-ensurer.reset-size1.size6,.ML__mathlive .sizing.reset-size1.size6{font-size:2.4em}.ML__mathlive .fontsize-ensurer.reset-size1.size7,.ML__mathlive .sizing.reset-size1.size7{font-size:2.88em}.ML__mathlive .fontsize-ensurer.reset-size1.size8,.ML__mathlive .sizing.reset-size1.size8{font-size:3.46em}.ML__mathlive .fontsize-ensurer.reset-size1.size9,.ML__mathlive .sizing.reset-size1.size9{font-size:4.14em}.ML__mathlive .fontsize-ensurer.reset-size1.size10,.ML__mathlive .sizing.reset-size1.size10{font-size:4.98em}.ML__mathlive .fontsize-ensurer.reset-size2.size1,.ML__mathlive .sizing.reset-size2.size1{font-size:.71428571em}.ML__mathlive .fontsize-ensurer.reset-size2.size2,.ML__mathlive .sizing.reset-size2.size2{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size2.size3,.ML__mathlive .sizing.reset-size2.size3{font-size:1.14285714em}.ML__mathlive .fontsize-ensurer.reset-size2.size4,.ML__mathlive .sizing.reset-size2.size4{font-size:1.28571429em}.ML__mathlive .fontsize-ensurer.reset-size2.size5,.ML__mathlive .sizing.reset-size2.size5{font-size:1.42857143em}.ML__mathlive .fontsize-ensurer.reset-size2.size6,.ML__mathlive .sizing.reset-size2.size6{font-size:1.71428571em}.ML__mathlive .fontsize-ensurer.reset-size2.size7,.ML__mathlive .sizing.reset-size2.size7{font-size:2.05714286em}.ML__mathlive .fontsize-ensurer.reset-size2.size8,.ML__mathlive .sizing.reset-size2.size8{font-size:2.47142857em}.ML__mathlive .fontsize-ensurer.reset-size2.size9,.ML__mathlive .sizing.reset-size2.size9{font-size:2.95714286em}.ML__mathlive .fontsize-ensurer.reset-size2.size10,.ML__mathlive .sizing.reset-size2.size10{font-size:3.55714286em}.ML__mathlive .fontsize-ensurer.reset-size3.size1,.ML__mathlive .sizing.reset-size3.size1{font-size:.625em}.ML__mathlive .fontsize-ensurer.reset-size3.size2,.ML__mathlive .sizing.reset-size3.size2{font-size:.875em}.ML__mathlive .fontsize-ensurer.reset-size3.size3,.ML__mathlive .sizing.reset-size3.size3{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size3.size4,.ML__mathlive .sizing.reset-size3.size4{font-size:1.125em}.ML__mathlive .fontsize-ensurer.reset-size3.size5,.ML__mathlive .sizing.reset-size3.size5{font-size:1.25em}.ML__mathlive .fontsize-ensurer.reset-size3.size6,.ML__mathlive .sizing.reset-size3.size6{font-size:1.5em}.ML__mathlive .fontsize-ensurer.reset-size3.size7,.ML__mathlive .sizing.reset-size3.size7{font-size:1.8em}.ML__mathlive .fontsize-ensurer.reset-size3.size8,.ML__mathlive .sizing.reset-size3.size8{font-size:2.1625em}.ML__mathlive .fontsize-ensurer.reset-size3.size9,.ML__mathlive .sizing.reset-size3.size9{font-size:2.5875em}.ML__mathlive .fontsize-ensurer.reset-size3.size10,.ML__mathlive .sizing.reset-size3.size10{font-size:3.1125em}.ML__mathlive .fontsize-ensurer.reset-size4.size1,.ML__mathlive .sizing.reset-size4.size1{font-size:.55555556em}.ML__mathlive .fontsize-ensurer.reset-size4.size2,.ML__mathlive .sizing.reset-size4.size2{font-size:.77777778em}.ML__mathlive .fontsize-ensurer.reset-size4.size3,.ML__mathlive .sizing.reset-size4.size3{font-size:.88888889em}.ML__mathlive .fontsize-ensurer.reset-size4.size4,.ML__mathlive .sizing.reset-size4.size4{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size4.size5,.ML__mathlive .sizing.reset-size4.size5{font-size:1.11111111em}.ML__mathlive .fontsize-ensurer.reset-size4.size6,.ML__mathlive .sizing.reset-size4.size6{font-size:1.33333333em}.ML__mathlive .fontsize-ensurer.reset-size4.size7,.ML__mathlive .sizing.reset-size4.size7{font-size:1.6em}.ML__mathlive .fontsize-ensurer.reset-size4.size8,.ML__mathlive .sizing.reset-size4.size8{font-size:1.92222222em}.ML__mathlive .fontsize-ensurer.reset-size4.size9,.ML__mathlive .sizing.reset-size4.size9{font-size:2.3em}.ML__mathlive .fontsize-ensurer.reset-size4.size10,.ML__mathlive .sizing.reset-size4.size10{font-size:2.76666667em}.ML__mathlive .fontsize-ensurer.reset-size5.size1,.ML__mathlive .sizing.reset-size5.size1{font-size:.5em}.ML__mathlive .fontsize-ensurer.reset-size5.size2,.ML__mathlive .sizing.reset-size5.size2{font-size:.7em}.ML__mathlive .fontsize-ensurer.reset-size5.size3,.ML__mathlive .sizing.reset-size5.size3{font-size:.8em}.ML__mathlive .fontsize-ensurer.reset-size5.size4,.ML__mathlive .sizing.reset-size5.size4{font-size:.9em}.ML__mathlive .fontsize-ensurer.reset-size5.size5,.ML__mathlive .sizing.reset-size5.size5{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size5.size6,.ML__mathlive .sizing.reset-size5.size6{font-size:1.2em}.ML__mathlive .fontsize-ensurer.reset-size5.size7,.ML__mathlive .sizing.reset-size5.size7{font-size:1.44em}.ML__mathlive .fontsize-ensurer.reset-size5.size8,.ML__mathlive .sizing.reset-size5.size8{font-size:1.73em}.ML__mathlive .fontsize-ensurer.reset-size5.size9,.ML__mathlive .sizing.reset-size5.size9{font-size:2.07em}.ML__mathlive .fontsize-ensurer.reset-size5.size10,.ML__mathlive .sizing.reset-size5.size10{font-size:2.49em}.ML__mathlive .fontsize-ensurer.reset-size6.size1,.ML__mathlive .sizing.reset-size6.size1{font-size:.41666667em}.ML__mathlive .fontsize-ensurer.reset-size6.size2,.ML__mathlive .sizing.reset-size6.size2{font-size:.58333333em}.ML__mathlive .fontsize-ensurer.reset-size6.size3,.ML__mathlive .sizing.reset-size6.size3{font-size:.66666667em}.ML__mathlive .fontsize-ensurer.reset-size6.size4,.ML__mathlive .sizing.reset-size6.size4{font-size:.75em}.ML__mathlive .fontsize-ensurer.reset-size6.size5,.ML__mathlive .sizing.reset-size6.size5{font-size:.83333333em}.ML__mathlive .fontsize-ensurer.reset-size6.size6,.ML__mathlive .sizing.reset-size6.size6{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size6.size7,.ML__mathlive .sizing.reset-size6.size7{font-size:1.2em}.ML__mathlive .fontsize-ensurer.reset-size6.size8,.ML__mathlive .sizing.reset-size6.size8{font-size:1.44166667em}.ML__mathlive .fontsize-ensurer.reset-size6.size9,.ML__mathlive .sizing.reset-size6.size9{font-size:1.725em}.ML__mathlive .fontsize-ensurer.reset-size6.size10,.ML__mathlive .sizing.reset-size6.size10{font-size:2.075em}.ML__mathlive .fontsize-ensurer.reset-size7.size1,.ML__mathlive .sizing.reset-size7.size1{font-size:.34722222em}.ML__mathlive .fontsize-ensurer.reset-size7.size2,.ML__mathlive .sizing.reset-size7.size2{font-size:.48611111em}.ML__mathlive .fontsize-ensurer.reset-size7.size3,.ML__mathlive .sizing.reset-size7.size3{font-size:.55555556em}.ML__mathlive .fontsize-ensurer.reset-size7.size4,.ML__mathlive .sizing.reset-size7.size4{font-size:.625em}.ML__mathlive .fontsize-ensurer.reset-size7.size5,.ML__mathlive .sizing.reset-size7.size5{font-size:.69444444em}.ML__mathlive .fontsize-ensurer.reset-size7.size6,.ML__mathlive .sizing.reset-size7.size6{font-size:.83333333em}.ML__mathlive .fontsize-ensurer.reset-size7.size7,.ML__mathlive .sizing.reset-size7.size7{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size7.size8,.ML__mathlive .sizing.reset-size7.size8{font-size:1.20138889em}.ML__mathlive .fontsize-ensurer.reset-size7.size9,.ML__mathlive .sizing.reset-size7.size9{font-size:1.4375em}.ML__mathlive .fontsize-ensurer.reset-size7.size10,.ML__mathlive .sizing.reset-size7.size10{font-size:1.72916667em}.ML__mathlive .fontsize-ensurer.reset-size8.size1,.ML__mathlive .sizing.reset-size8.size1{font-size:.28901734em}.ML__mathlive .fontsize-ensurer.reset-size8.size2,.ML__mathlive .sizing.reset-size8.size2{font-size:.40462428em}.ML__mathlive .fontsize-ensurer.reset-size8.size3,.ML__mathlive .sizing.reset-size8.size3{font-size:.46242775em}.ML__mathlive .fontsize-ensurer.reset-size8.size4,.ML__mathlive .sizing.reset-size8.size4{font-size:.52023121em}.ML__mathlive .fontsize-ensurer.reset-size8.size5,.ML__mathlive .sizing.reset-size8.size5{font-size:.57803468em}.ML__mathlive .fontsize-ensurer.reset-size8.size6,.ML__mathlive .sizing.reset-size8.size6{font-size:.69364162em}.ML__mathlive .fontsize-ensurer.reset-size8.size7,.ML__mathlive .sizing.reset-size8.size7{font-size:.83236994em}.ML__mathlive .fontsize-ensurer.reset-size8.size8,.ML__mathlive .sizing.reset-size8.size8{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size8.size9,.ML__mathlive .sizing.reset-size8.size9{font-size:1.19653179em}.ML__mathlive .fontsize-ensurer.reset-size8.size10,.ML__mathlive .sizing.reset-size8.size10{font-size:1.43930636em}.ML__mathlive .fontsize-ensurer.reset-size9.size1,.ML__mathlive .sizing.reset-size9.size1{font-size:.24154589em}.ML__mathlive .fontsize-ensurer.reset-size9.size2,.ML__mathlive .sizing.reset-size9.size2{font-size:.33816425em}.ML__mathlive .fontsize-ensurer.reset-size9.size3,.ML__mathlive .sizing.reset-size9.size3{font-size:.38647343em}.ML__mathlive .fontsize-ensurer.reset-size9.size4,.ML__mathlive .sizing.reset-size9.size4{font-size:.43478261em}.ML__mathlive .fontsize-ensurer.reset-size9.size5,.ML__mathlive .sizing.reset-size9.size5{font-size:.48309179em}.ML__mathlive .fontsize-ensurer.reset-size9.size6,.ML__mathlive .sizing.reset-size9.size6{font-size:.57971014em}.ML__mathlive .fontsize-ensurer.reset-size9.size7,.ML__mathlive .sizing.reset-size9.size7{font-size:.69565217em}.ML__mathlive .fontsize-ensurer.reset-size9.size8,.ML__mathlive .sizing.reset-size9.size8{font-size:.83574879em}.ML__mathlive .fontsize-ensurer.reset-size9.size9,.ML__mathlive .sizing.reset-size9.size9{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size9.size10,.ML__mathlive .sizing.reset-size9.size10{font-size:1.20289855em}.ML__mathlive .fontsize-ensurer.reset-size10.size1,.ML__mathlive .sizing.reset-size10.size1{font-size:.20080321em}.ML__mathlive .fontsize-ensurer.reset-size10.size2,.ML__mathlive .sizing.reset-size10.size2{font-size:.2811245em}.ML__mathlive .fontsize-ensurer.reset-size10.size3,.ML__mathlive .sizing.reset-size10.size3{font-size:.32128514em}.ML__mathlive .fontsize-ensurer.reset-size10.size4,.ML__mathlive .sizing.reset-size10.size4{font-size:.36144578em}.ML__mathlive .fontsize-ensurer.reset-size10.size5,.ML__mathlive .sizing.reset-size10.size5{font-size:.40160643em}.ML__mathlive .fontsize-ensurer.reset-size10.size6,.ML__mathlive .sizing.reset-size10.size6{font-size:.48192771em}.ML__mathlive .fontsize-ensurer.reset-size10.size7,.ML__mathlive .sizing.reset-size10.size7{font-size:.57831325em}.ML__mathlive .fontsize-ensurer.reset-size10.size8,.ML__mathlive .sizing.reset-size10.size8{font-size:.69477912em}.ML__mathlive .fontsize-ensurer.reset-size10.size9,.ML__mathlive .sizing.reset-size10.size9{font-size:.8313253em}.ML__mathlive .fontsize-ensurer.reset-size10.size10,.ML__mathlive .sizing.reset-size10.size10{font-size:1em}.ML__mathlive .delimsizing.size1{font-family:KaTeX_Size1}.ML__mathlive .delimsizing.size2{font-family:KaTeX_Size2}.ML__mathlive .delimsizing.size3{font-family:KaTeX_Size3}.ML__mathlive .delimsizing.size4{font-family:KaTeX_Size4}.ML__mathlive .delimsizing.mult .delim-size1{font-family:KaTeX_Size1;vertical-align:top}.ML__mathlive .delimsizing.mult .delim-size4{font-family:KaTeX_Size4;vertical-align:top}.ML__mathlive .nulldelimiter{width:.12em}.ML__mathlive .op-symbol{position:relative}.ML__mathlive .op-symbol.small-op{font-family:KaTeX_Size1}.ML__mathlive .op-symbol.large-op{font-family:KaTeX_Size2}.ML__mathlive .op-limits .vlist>span{text-align:center}.ML__mathlive .op-over-under>.vlist>span:first-child,.ML__mathlive .op-over-under>.vlist>span:last-child{text-align:center}.ML__mathlive .accent>.vlist>span{text-align:center}.ML__mathlive .accent .accent-body>span{width:0}.ML__mathlive .accent .accent-body.accent-vec>span{position:relative;left:.326em}.ML__mathlive .mtable .vertical-separator{display:inline-block;margin:0 -.025em;border-right:.05em solid}.ML__mathlive .mtable .arraycolsep{display:inline-block}.ML__mathlive .mtable .col-align-m>.vlist{text-align:center}.ML__mathlive .mtable .col-align-c>.vlist{text-align:center}.ML__mathlive .mtable .col-align-l>.vlist{text-align:left}.ML__mathlive .mtable .col-align-r>.vlist{text-align:right}.ML__selection{background:var(--highlight-inactive);box-sizing:border-box}.ML__focused .ML__selection{background:var(--highlight)!important;color:var(--on-highlight)}.ML__contains-caret.ML__close,.ML__contains-caret.ML__open,.ML__contains-caret>.ML__close,.ML__contains-caret>.ML__open,.sqrt.ML__contains-caret>.sqrt-sign,.sqrt.ML__contains-caret>.vlist>span>.sqrt-line{color:var(--caret)}.ML__command{font-family:IBM Plex Mono,Source Code Pro,Consolas,Roboto Mono,Menlo,Bitstream Vera Sans Mono,DejaVu Sans Mono,Monaco,Courier,monospace;letter-spacing:-1px;font-weight:400;line-height:1em;color:var(--primary)}:not(.ML__command)+.ML__command{margin-left:.25em}.ML__command+:not(.ML__command){padding-left:.25em}.ML__smart-fence__close{opacity:.5}.ML__keystroke-caption{visibility:hidden;background:var(--secondary);border-color:var(--secondary-border);box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);text-align:center;border-radius:6px;padding:16px;position:absolute;z-index:1;display:flex;flex-direction:row;justify-content:center;--keystroke:#fff;--on-keystroke:#555;--keystroke-border:#f7f7f7}@media (prefers-color-scheme:dark){body:not([theme=light]) .ML__keystroke-caption{--keystroke:hsl(var(--hue),50%,30%);--on-keystroke:#fafafa;--keystroke-border:hsl(var(--hue),50%,25%)}}body[theme=dark] .ML__keystroke-caption{--keystroke:hsl(var(--hue),50%,30%);--on-keystroke:#fafafa;--keystroke-border:hsl(var(--hue),50%,25%)}[data-tooltip]{position:relative}[data-tooltip][data-placement=top]:after{top:inherit;bottom:100%}[data-tooltip]:after{position:absolute;visibility:hidden;content:attr(data-tooltip);display:inline-table;top:110%;width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:200px;padding:8px;background:#616161;color:#fff;text-align:center;z-index:2;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);border-radius:2px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-weight:400;font-size:12px;opacity:0;transform:scale(.5);transition:all .15s cubic-bezier(.4,0,1,1)}@media only screen and (max-width:767px){[data-tooltip]:after{height:32px;padding:4px 16px;font-size:14px}}[data-tooltip]:hover{position:relative}[data-tooltip]:hover:after{visibility:visible;opacity:1;transform:scale(1)}[data-tooltip][data-delay]:after{transition-delay:0s}[data-tooltip][data-delay]:hover:after{transition-delay:1s}.ML__keyboard{--keyboard-background:rgba(209,213,217,0.97);--keyboard-text:#000;--keyboard-text-active:var(--primary);--keyboard-background-border:#ddd;--keycap-background:#fff;--keycap-background-active:#e5e5e5;--keycap-background-border:#e5e6e9;--keycap-background-border-bottom:#8d8f92;--keycap-text:#000;--keycap-text-active:#fff;--keycap-secondary-text:#000;--keycap-modifier-background:#b9bdc7;--keycap-modifier-border:#c5c9d0;--keycap-modifier-border-bottom:#989da6;--keyboard-alternate-background:#fff;--keyboard-alternate-background-active:#e5e5e5;--keyboard-alternate-text:#000;position:fixed;left:0;bottom:-267px;width:100vw;z-index:105;padding-top:5px;transform:translate(0);opacity:0;visibility:hidden;transition:.28s cubic-bezier(0,0,.2,1);transition-property:transform,opacity;-webkit-backdrop-filter:grayscale(50%);backdrop-filter:grayscale(50%);background-color:var(--keyboard-background);border:1px solid var(--keyboard-background-border);font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:16px;font-weight:400;margin:0;text-shadow:none;box-sizing:border-box;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23)}.ML__keyboard.is-visible{transform:translateY(-267px);opacity:1;visibility:visible;transition-timing-function:cubic-bezier(.4,0,1,1)}.ML__keyboard .tex{font-family:KaTeX_Main,Cambria Math,Asana Math,OpenSymbol,Symbola,STIX,Times,serif!important}.ML__keyboard .tex-math{font-family:KaTeX_Math,Cambria Math,Asana Math,OpenSymbol,Symbola,STIX,Times,serif!important}.ML__keyboard .tt{font-family:IBM Plex Mono,Source Code Pro,Consolas,Roboto Mono,Menlo,Bitstream Vera Sans Mono,DejaVu Sans Mono,Monaco,Courier,monospace!important;font-size:30px;font-weight:400}.ML__keyboard.alternate-keys{visibility:hidden;max-width:286px;background-color:var(--keyboard-alternate-background);text-align:center;border-radius:6px;position:fixed;bottom:auto;top:0;box-sizing:content-box;transform:none;z-index:106;display:flex;flex-direction:row;justify-content:center;align-content:center;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22);transition:none}@media only screen and (max-height:412px){.ML__keyboard.alternate-keys{max-width:320px}}.ML__keyboard.alternate-keys.is-visible{visibility:visible}.ML__keyboard.alternate-keys ul{list-style:none;margin:3px;padding:0;display:flex;flex-flow:row wrap-reverse;justify-content:center}.ML__keyboard.alternate-keys ul>li{display:flex;flex-flow:column;align-items:center;justify-content:center;font-size:30px;height:70px;width:70px;box-sizing:border-box;margin:0;background:transparent;border:1px solid transparent;border-radius:5px;pointer-events:all;color:var(--keyboard-alternate-text);fill:currentColor}@media only screen and (max-height:412px){.ML__keyboard.alternate-keys ul>li{font-size:24px;height:50px;width:50px}}.ML__keyboard.alternate-keys ul>li.active,.ML__keyboard.alternate-keys ul>li.pressed,.ML__keyboard.alternate-keys ul>li:hover{box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23);background:var(--keyboard-alternate-background-active);color:var(--keyboard-text-active)}.ML__keyboard.alternate-keys ul>li.small{font-size:18px}.ML__keyboard.alternate-keys ul>li.small-button{width:42px;height:42px;margin:2px;background:#fbfbfb}.ML__keyboard.alternate-keys ul>li.small-button:hover{background:var(--keyboard-alternate-background-active)}.ML__keyboard.alternate-keys ul>li.box>div,.ML__keyboard.alternate-keys ul>li.box>span{border:1px dashed rgba(0,0,0,.24)}.ML__keyboard.alternate-keys ul>li .warning{min-height:60px;min-width:60px;background:#cd0030;color:#fff;padding:5px;display:flex;align-items:center;justify-content:center;border-radius:5px}.ML__keyboard.alternate-keys ul>li .warning.active,.ML__keyboard.alternate-keys ul>li .warning.pressed,.ML__keyboard.alternate-keys ul>li .warning:hover{background:red}.ML__keyboard.alternate-keys ul>li .warning svg{width:50px;height:50px}.ML__keyboard.alternate-keys ul>li aside{font-size:12px;line-height:12px;opacity:.78;padding-top:2px}.ML__keyboard>div.keyboard-layer{display:none;outline:none}.ML__keyboard>div.keyboard-layer.is-visible{display:flex;flex-flow:column}.ML__keyboard>div>div.keyboard-toolbar{align-self:center;display:flex;flex-flow:row;justify-content:space-between;width:736px}@media only screen and (min-width:768px) and (max-width:1024px){.ML__keyboard>div>div.keyboard-toolbar{width:556px}}@media only screen and (max-width:767px){.ML__keyboard>div>div.keyboard-toolbar{width:365px;max-width:100vw}}.ML__keyboard>div>div.keyboard-toolbar svg{height:20px;width:20px}@media only screen and (max-width:767px){.ML__keyboard>div>div.keyboard-toolbar svg{height:13px;width:17px}}.ML__keyboard>div>div.keyboard-toolbar>.left{position:relative;display:flex;justify-content:flex-start;flex-flow:row}.ML__keyboard>div>div.keyboard-toolbar>.right{display:flex;justify-content:flex-end;flex-flow:row}.ML__keyboard>div>div.keyboard-toolbar>div>div{display:flex;align-items:baseline;justify-content:center;pointer-events:all;color:var(--keyboard-text);fill:currentColor;background:0;font-size:110%;cursor:pointer;min-height:0;padding:4px 10px;margin:7px 4px 6px;box-shadow:none;border:none;border-bottom:2px solid transparent}.ML__keyboard>div>div.keyboard-toolbar>div>div.disabled.pressed svg,.ML__keyboard>div>div.keyboard-toolbar>div>div.disabled:hover svg,.ML__keyboard>div>div.keyboard-toolbar>div>div.disabled svg{color:var(--keyboard-text);opacity:.2}@media only screen and (max-width:414px){.ML__keyboard>div>div.keyboard-toolbar>div>div{font-size:100%;padding:0 6px 0 0}}@media only screen and (max-width:767px){.ML__keyboard>div>div.keyboard-toolbar>div>div{padding-left:4px;padding-right:4px;font-size:90%}}.ML__keyboard>div>div.keyboard-toolbar>div>div.active,.ML__keyboard>div>div.keyboard-toolbar>div>div.pressed,.ML__keyboard>div>div.keyboard-toolbar>div>div:active,.ML__keyboard>div>div.keyboard-toolbar>div>div:hover{color:var(--keyboard-text-active)}.ML__keyboard>div>div.keyboard-toolbar>div>div.selected{color:var(--keyboard-text-active);border-bottom:2px solid var(--keyboard-text-active);margin-bottom:8px;padding-bottom:0}.ML__keyboard div .rows{border:0;border-collapse:separate;clear:both;margin:auto;display:flex;flex-flow:column;align-items:center}.ML__keyboard div .rows>ul{list-style:none;height:40px;margin:0 0 3px;padding:0}.ML__keyboard div .rows>ul>li{display:flex;flex-flow:column;align-items:center;justify-content:center;width:34px;margin-right:2px;height:40px;box-sizing:border-box;padding:8px 0;vertical-align:top;text-align:center;float:left;color:var(--keycap-text);fill:currentColor;font-size:20px;background:var(--keycap-background);border:1px solid var(--keycap-background-border);border-bottom-color:var(--keycap-background-border-bottom);border-radius:5px;pointer-events:all;position:relative;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ML__keyboard div .rows>ul>li:last-child{margin-right:0}.ML__keyboard div .rows>ul>li.small{font-size:16px}.ML__keyboard div .rows>ul>li.tt{color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.bottom{justify-content:flex-end}.ML__keyboard div .rows>ul>li.left{align-items:flex-start;padding-left:4px}.ML__keyboard div .rows>ul>li.right{align-items:flex-end;padding-right:4px}.ML__keyboard div .rows>ul>li svg{width:20px;height:20px}.ML__keyboard div .rows>ul>li .warning{height:25px;width:25px;min-height:25px;min-width:25px;background:#cd0030;color:#fff;border-radius:100%;padding:5px;display:flex;align-items:center;justify-content:center;margin-bottom:-2px}.ML__keyboard div .rows>ul>li .warning svg{width:16px;height:16px}@media only screen and (max-width:768px){.ML__keyboard div .rows>ul>li .warning{height:16px;width:16px;min-height:16px;min-width:16px}.ML__keyboard div .rows>ul>li .warning svg{width:14px;height:14px}}.ML__keyboard div .rows>ul>li>.w0{width:0}.ML__keyboard div .rows>ul>li>.w5{width:16px}.ML__keyboard div .rows>ul>li>.w15{width:52px}.ML__keyboard div .rows>ul>li>.w20{width:70px}.ML__keyboard div .rows>ul>li>.w50{width:178px}.ML__keyboard div .rows>ul>li.separator{background:transparent;border:none;pointer-events:none}@media only screen and (max-width:560px){.ML__keyboard div .rows>ul>li.if-wide{display:none}}.ML__keyboard div .rows>ul>li.tex-math{font-size:25px}.ML__keyboard div .rows>ul>li.pressed,.ML__keyboard div .rows>ul>li:hover{background:var(--keycap-background-active);color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.action.active,.ML__keyboard div .rows>ul>li.action:active,.ML__keyboard div .rows>ul>li.keycap.active,.ML__keyboard div .rows>ul>li.keycap:active{transform:translateY(-20px) scale(1.4);z-index:100;color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.modifier.active,.ML__keyboard div .rows>ul>li.modifier:active{background:var(--keyboard-text-active);color:var(--keycap-text-active)}.ML__keyboard div .rows>ul>li.action.font-glyph,.ML__keyboard div .rows>ul>li.modifier.font-glyph{font-size:18px}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li.action.font-glyph,.ML__keyboard div .rows>ul>li.modifier.font-glyph{font-size:16px}}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li.bigfnbutton,.ML__keyboard div .rows>ul>li.fnbutton{font-size:12px}}.ML__keyboard div .rows>ul>li.bigfnbutton{font-size:14px}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li.bigfnbutton{font-size:9px}}.ML__keyboard div .rows>ul>li.action,.ML__keyboard div .rows>ul>li.modifier{background-color:var(--keycap-modifier-background);border-bottom-color:var(--keycap-modifier-border);border-color:var(--keycap-modifier-border) var(--keycap-modifier-border) var(--keycap-modifier-border-bottom);font-size:65%;font-weight:100}.ML__keyboard div .rows>ul>li.action.selected,.ML__keyboard div .rows>ul>li.modifier.selected{color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.action.selected.active,.ML__keyboard div .rows>ul>li.action.selected.pressed,.ML__keyboard div .rows>ul>li.action.selected:active,.ML__keyboard div .rows>ul>li.action.selected:hover,.ML__keyboard div .rows>ul>li.modifier.selected.active,.ML__keyboard div .rows>ul>li.modifier.selected.pressed,.ML__keyboard div .rows>ul>li.modifier.selected:active,.ML__keyboard div .rows>ul>li.modifier.selected:hover{color:#fff}.ML__keyboard div .rows>ul>li.keycap.w50{font-size:80%;padding-top:10px;font-weight:100}.ML__keyboard div .rows>ul>li small{color:#555}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li small{font-size:9px}}.ML__keyboard div .rows>ul>li aside{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:10px;line-height:10px;color:#666}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li aside{display:none}}@media only screen and (max-width:414px){.ML__keyboard div .rows>ul>li{width:29px;margin-right:2px}.ML__keyboard div .rows>ul>.w5{width:13.5px}.ML__keyboard div .rows>ul>.w15{width:44.5px}.ML__keyboard div .rows>ul>.w20{width:60px}.ML__keyboard div .rows>ul>.w50{width:153px}}@media only screen and (min-width:415px) and (max-width:768px){.ML__keyboard div .rows>ul>li{width:37px;margin-right:3px}.ML__keyboard div .rows>ul>.w5{width:17px}.ML__keyboard div .rows>ul>.w15{width:57px}.ML__keyboard div .rows>ul>.w20{width:77px}.ML__keyboard div .rows>ul>.w50{width:197px}}@media only screen and (min-width:768px) and (max-width:1024px){.ML__keyboard div .rows>ul{height:52px}.ML__keyboard div .rows>ul>li{height:52px;width:51px;margin-right:4px}.ML__keyboard div .rows>ul>.w5{width:23.5px}.ML__keyboard div .rows>ul>.w15{width:78.5px}.ML__keyboard div .rows>ul>.w20{width:106px}.ML__keyboard div .rows>ul>.w50{width:271px}}@media only screen and (min-width:1025px){.ML__keyboard div .rows>ul{height:52px}.ML__keyboard div .rows>ul>li{height:52px;width:66px;margin-right:6px}.ML__keyboard div .rows>ul>.action,.ML__keyboard div .rows>ul>.modifier{font-size:80%}.ML__keyboard div .rows>ul>.w5{width:30px}.ML__keyboard div .rows>ul>.w15{width:102px}.ML__keyboard div .rows>ul>.w20{width:138px}.ML__keyboard div .rows>ul>.w50{width:354px}}@media (prefers-color-scheme:dark){body:not([theme=light]) .ML__keyboard{--hue:206;--keyboard-background:hsl(var(--hue),19%,38%);--keyboard-text:#f0f0f0;--keyboard-text-active:hsl(var(--hue),100%,60%);--keyboard-background-border:#333;--keycap-background:hsl(var(--hue),25%,39%);--keycap-background-active:hsl(var(--hue),35%,42%);--keycap-background-border:hsl(var(--hue),25%,35%);--keycap-background-border-bottom:#426b8a;--keycap-text:#d0d0d0;--keycap-text-active:#000;--keycap-secondary-text:#fff;--keycap-modifier-background:hsl(var(--hue),35%,40%);--keycap-modifier-border:hsl(var(--hue),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue),35%,42%);--keyboard-alternate-background:hsl(var(--hue),19%,38%);--keyboard-alternate-background-active:hsl(var(--hue),35%,42%);--keyboard-alternate-text:#d1d1d1}}body[theme=dark] .ML__keyboard{--hue:206;--keyboard-background:hsl(var(--hue),19%,38%);--keyboard-text:#f0f0f0;--keyboard-text-active:hsl(var(--hue),100%,60%);--keyboard-background-border:#333;--keycap-background:hsl(var(--hue),25%,39%);--keycap-background-active:hsl(var(--hue),35%,42%);--keycap-background-border:hsl(var(--hue),25%,35%);--keycap-background-border-bottom:#426b8a;--keycap-text:#d0d0d0;--keycap-text-active:#000;--keycap-secondary-text:#fff;--keycap-modifier-background:hsl(var(--hue),35%,40%);--keycap-modifier-border:hsl(var(--hue),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue),35%,42%);--keyboard-alternate-background:hsl(var(--hue),19%,38%);--keyboard-alternate-background-active:hsl(var(--hue),35%,42%);--keyboard-alternate-text:#d1d1d1}div.ML__keyboard.material{--keyboard-background:rgba(209,213,217,0.9);--keyboard-background-border:#ddd;--keycap-background:transparent;--keycap-background-active:#cccfd1;--keycap-background-border:transparent;--keyboard-alternate-background:#efefef;--keyboard-alternate-text:#000;font-family:Roboto,sans-serif}div.ML__keyboard.material.alternate-keys{background:var(--keyboard-alternate-background);border:1px solid transparent;border-radius:5px;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22)}div.ML__keyboard.material.alternate-keys ul li.active,div.ML__keyboard.material.alternate-keys ul li.pressed,div.ML__keyboard.material.alternate-keys ul li:active,div.ML__keyboard.material.alternate-keys ul li:hover{border:1px solid transparent;background:#5f97fc;color:#fff;fill:currentColor}div.ML__keyboard.material .keyboard-toolbar>div>div{font-size:16px}div.ML__keyboard.material .keyboard-toolbar div.div.active,div.ML__keyboard.material .keyboard-toolbar div.div.pressed,div.ML__keyboard.material .keyboard-toolbar div div:active,div.ML__keyboard.material .keyboard-toolbar div div:hover{color:#5f97fc;fill:currentColor}div.ML__keyboard.material .keyboard-toolbar>div>.selected{color:#5f97fc;fill:currentColor;border-bottom:2px solid #5f97fc;margin-bottom:8px;padding-bottom:0}div.ML__keyboard.material div>.rows>ul>.keycap{background:transparent;border:1px solid transparent;border-radius:5px;color:var(--keycap-text);fill:currentColor;transition:none}div.ML__keyboard.material div>.rows>ul>.keycap.tt{color:#5f97fc}div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "]{margin-top:10px;margin-bottom:10px;height:20px;background:#e0e0e0}div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "].active,div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "].pressed,div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "]:active,div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "]:hover{background:#d0d0d0;box-shadow:none;transform:none}div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):hover{border:1px solid transparent;background:var(--keycap-background-active);box-shadow:none}div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).active,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).pressed,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):active{background:var(--keyboard-alternate-background);color:var(--keyboard-alternate-text);box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23)}@media only screen and (max-width:767px){div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).active,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).pressed,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):active{box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23);font-size:10px;vertical-align:top;width:19.5px;margin-right:10px;margin-left:10px;transform:translateY(-20px) scale(2);transition:none;justify-content:flex-start;padding:2px 0 0;z-index:100}}@media only screen and (max-width:414px){div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).active,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).pressed,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):active{width:16.5px}}@media only screen and (max-width:767px){div.ML__keyboard.material div>.rows>ul>.keycap:last-child.active,div.ML__keyboard.material div>.rows>ul>.keycap:last-child:active{margin-right:0;margin-left:14px}}div.ML__keyboard.material div div.rows ul li.action,div.ML__keyboard.material div div.rows ul li.modifier{background:transparent;border:0;color:#869096;fill:currentColor;font-size:16px;transition:none}div.ML__keyboard.material div div.rows ul li.action.selected,div.ML__keyboard.material div div.rows ul li.modifier.selected{color:#5f97fc;border-radius:0;border-bottom:2px solid #5f97fc}div.ML__keyboard.material div div.rows ul li.action.active,div.ML__keyboard.material div div.rows ul li.action.pressed,div.ML__keyboard.material div div.rows ul li.action:active,div.ML__keyboard.material div div.rows ul li.action:hover,div.ML__keyboard.material div div.rows ul li.modifier.active,div.ML__keyboard.material div div.rows ul li.modifier.pressed,div.ML__keyboard.material div div.rows ul li.modifier:active,div.ML__keyboard.material div div.rows ul li.modifier:hover{border:0;color:var(--keycap-text);background:var(--keycap-background-active);box-shadow:none}div.ML__keyboard.material div div.rows ul li.bigfnbutton,div.ML__keyboard.material div div.rows ul li.fnbutton{background:transparent;border:0}div.ML__keyboard.material div div.rows ul li.bigfnbutton.selected,div.ML__keyboard.material div div.rows ul li.fnbutton.selected{color:#5f97fc;fill:currentColor;border-radius:0;border-bottom:2px solid #5f97fc}div.ML__keyboard.material div div.rows ul li.bigfnbutton.active,div.ML__keyboard.material div div.rows ul li.bigfnbutton.pressed,div.ML__keyboard.material div div.rows ul li.bigfnbutton:active,div.ML__keyboard.material div div.rows ul li.bigfnbutton:hover,div.ML__keyboard.material div div.rows ul li.fnbutton.active,div.ML__keyboard.material div div.rows ul li.fnbutton.pressed,div.ML__keyboard.material div div.rows ul li.fnbutton:active,div.ML__keyboard.material div div.rows ul li.fnbutton:hover{border:0;color:#5f97fc;fill:currentColor;background:var(--keycap-background-active);box-shadow:none}@media (prefers-color-scheme:dark){body:not([theme=light]) div.ML__keyboard.material{--hue:198;--keyboard-background:hsl(var(--hue),19%,18%);--keyboard-text:#d4d6d7;--keyboard-text-active:#5f97fc;--keyboard-background-border:#333;--keycap-background:hsl(var(--hue),25%,39%);--keycap-background-active:#5f97fc;--keycap-background-border:transparent;--keycap-background-border-bottom:transparent;--keycap-text:#d0d0d0;--keycap-text-active:#d4d6d7;--keycap-secondary-text:#5f97fc;--keycap-modifier-background:hsl(var(--hue),35%,40%);--keycap-modifier-border:hsl(var(--hue),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue),35%,42%);--keyboard-alternate-background:hsl(var(--hue),8%,2%);--keyboard-alternate-background-active:hsl(var(--hue),35%,42%);--keyboard-alternate-text:#d1d1d1}}body[theme=dark] div.ML__keyboard.material{--hue:198;--keyboard-background:hsl(var(--hue),19%,18%);--keyboard-text:#d4d6d7;--keyboard-text-active:#5f97fc;--keyboard-background-border:#333;--keycap-background:hsl(var(--hue),25%,39%);--keycap-background-active:#5f97fc;--keycap-background-border:transparent;--keycap-background-border-bottom:transparent;--keycap-text:#d0d0d0;--keycap-text-active:#d4d6d7;--keycap-secondary-text:#5f97fc;--keycap-modifier-background:hsl(var(--hue),35%,40%);--keycap-modifier-border:hsl(var(--hue),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue),35%,42%);--keyboard-alternate-background:hsl(var(--hue),8%,2%);--keyboard-alternate-background-active:hsl(var(--hue),35%,42%);--keyboard-alternate-text:#d1d1d1}.ML__error{background-image:radial-gradient(ellipse at center,#cc0041,transparent 70%);background-repeat:repeat-x;background-size:3px 3px;background-position:0 98%}.ML__suggestion{opacity:.5}.ML__placeholder{opacity:.7;padding-left:.4ex;padding-right:.4ex;padding-top:.4ex}.ML__keystroke-caption>span{min-width:14px;margin:0 8px 0 0;padding:4px;background-color:var(--keystroke);color:var(--on-keystroke);fill:currentColor;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:1em;border-radius:6px;border:2px solid var(--keystroke-border)}.ML__virtual-keyboard-toggle.pressed{background:hsla(0,0%,70%,.5)}.ML__virtual-keyboard-toggle:focus{outline:none;border-radius:50%;border:2px solid var(--primary)}.ML__virtual-keyboard-toggle.active,.ML__virtual-keyboard-toggle.active:hover{background:hsla(0,0%,70%,.5);color:#000;fill:currentColor}div.ML__popover.is-visible{visibility:visible;-webkit-animation:ML__fade-in .15s cubic-bezier(0,0,.2,1);animation:ML__fade-in .15s cubic-bezier(0,0,.2,1)}@-webkit-keyframes ML__fade-in{0%{opacity:0}to{opacity:1}}@keyframes ML__fade-in{0%{opacity:0}to{opacity:1}}.ML__popover__content{border-radius:6px;padding:2px;cursor:pointer;min-height:100px;display:flex;flex-direction:column;justify-content:center;margin-left:8px;margin-right:8px}.ML__popover__content a{color:#5ea6fd;padding-top:.3em;margin-top:.4em;display:block}.ML__popover__content a:hover{color:#5ea6fd;text-decoration:underline}.ML__popover__content.active,.ML__popover__content.pressed,.ML__popover__content:hover{background:hsla(0,0%,100%,.1)}.ML__popover__command{font-size:1.6rem}.ML__popover__prev-shortcut{height:31px;opacity:.1;cursor:pointer;margin-left:8px;margin-right:8px;padding-top:4px;padding-bottom:2px}.ML__popover__next-shortcut:hover,.ML__popover__prev-shortcut:hover{opacity:.3}.ML__popover__next-shortcut.active,.ML__popover__next-shortcut.pressed,.ML__popover__prev-shortcut.active,.ML__popover__prev-shortcut.pressed{opacity:1}.ML__popover__next-shortcut>span,.ML__popover__prev-shortcut>span{padding:5px;border-radius:50%;width:20px;height:20px;display:inline-block}.ML__popover__prev-shortcut>span>span{margin-top:-2px;display:block}.ML__popover__next-shortcut>span>span{margin-top:2px;display:block}.ML__popover__next-shortcut:hover>span,.ML__popover__prev-shortcut:hover>span{background:hsla(0,0%,100%,.1)}.ML__popover__next-shortcut{height:34px;opacity:.1;cursor:pointer;margin-left:8px;margin-right:8px;padding-top:2px;padding-bottom:4px}.ML__popover__shortcut{font-size:.8em;margin-top:.25em}.ML__popover__note,.ML__popover__shortcut{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;opacity:.7;padding-top:.25em}.ML__popover__note{font-size:.8rem;line-height:1em;padding-left:.5em;padding-right:.5em}.ML__shortcut-join{opacity:.5}.ML__scroller{position:fixed;z-index:1;top:0;height:100vh;width:200px} diff --git a/dist/mathlive.d.ts b/dist/mathlive.d.ts index 43d6b3dd9..81909afdd 100644 --- a/dist/mathlive.d.ts +++ b/dist/mathlive.d.ts @@ -1,4 +1,4 @@ -/* 0.52.0 */ /** +/* 0.52.1-soc */ /** * * Use MathLive to render and edit mathematical formulas. * @@ -13,8 +13,8 @@ * console.log(MathLive.latexToAST('e^{i\\pi}+1=0')); * * - * @packageDocumentation MathLive SDK Reference 0.52.0 - * @version 0.52.0 + * @packageDocumentation MathLive SDK Reference 0.52.1-soc + * @version 0.52.1-soc * */ import { Mathfield } from './mathfield'; @@ -23,7 +23,7 @@ import { MacroDictionary, ErrorListener } from './core'; export { Mathfield }; export { MathfieldConfig }; /** - * Current version: `0.52.0` + * Current version: `0.52.1-soc` * * The version string of the SDK using the [semver](https://semver.org/) convention: * diff --git a/dist/mathlive.js b/dist/mathlive.js index 771f411c3..93bedf99a 100644 --- a/dist/mathlive.js +++ b/dist/mathlive.js @@ -1,2 +1,2 @@ -/* MathLive "0.52.0" */ -var global,factory;global=this,factory=function(){function e(e){return Array.isArray(e)}var t={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],184:[.17014,0,0,0],198:[0,.68611,0,0],215:[.13333,.63333,0,0],216:[.04861,.73472,0,0],223:[0,.69444,0,0],230:[0,.44444,0,0],247:[.13333,.63333,0,0],248:[.09722,.54167,0,0],305:[0,.44444,0,0],338:[0,.68611,0,0],339:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],733:[0,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0],57376:[.19444,.69444,0,0]},"Main-BoldItalic":{33:[0,.69444,.11417,0],34:[0,.69444,.07939,0],35:[.19444,.69444,.06833,0],37:[.05556,.75,.12861,0],38:[0,.69444,.08528,0],39:[0,.69444,.12945,0],40:[.25,.75,.15806,0],41:[.25,.75,.03306,0],42:[0,.75,.14333,0],43:[.10333,.60333,.03306,0],44:[.19444,.14722,0,0],45:[0,.44444,.02611,0],46:[0,.14722,0,0],47:[.25,.75,.15806,0],48:[0,.64444,.13167,0],49:[0,.64444,.13167,0],50:[0,.64444,.13167,0],51:[0,.64444,.13167,0],52:[.19444,.64444,.13167,0],53:[0,.64444,.13167,0],54:[0,.64444,.13167,0],55:[.19444,.64444,.13167,0],56:[0,.64444,.13167,0],57:[0,.64444,.13167,0],58:[0,.44444,.06695,0],59:[.19444,.44444,.06695,0],61:[-.10889,.39111,.06833,0],63:[0,.69444,.11472,0],64:[0,.69444,.09208,0],65:[0,.68611,0,0],66:[0,.68611,.0992,0],67:[0,.68611,.14208,0],68:[0,.68611,.09062,0],69:[0,.68611,.11431,0],70:[0,.68611,.12903,0],71:[0,.68611,.07347,0],72:[0,.68611,.17208,0],73:[0,.68611,.15681,0],74:[0,.68611,.145,0],75:[0,.68611,.14208,0],76:[0,.68611,0,0],77:[0,.68611,.17208,0],78:[0,.68611,.17208,0],79:[0,.68611,.09062,0],80:[0,.68611,.0992,0],81:[.19444,.68611,.09062,0],82:[0,.68611,.02559,0],83:[0,.68611,.11264,0],84:[0,.68611,.12903,0],85:[0,.68611,.17208,0],86:[0,.68611,.18625,0],87:[0,.68611,.18625,0],88:[0,.68611,.15681,0],89:[0,.68611,.19803,0],90:[0,.68611,.14208,0],91:[.25,.75,.1875,0],93:[.25,.75,.09972,0],94:[0,.69444,.06709,0],95:[.31,.13444,.09811,0],97:[0,.44444,.09426,0],98:[0,.69444,.07861,0],99:[0,.44444,.05222,0],100:[0,.69444,.10861,0],101:[0,.44444,.085,0],102:[.19444,.69444,.21778,0],103:[.19444,.44444,.105,0],104:[0,.69444,.09426,0],105:[0,.69326,.11387,0],106:[.19444,.69326,.1672,0],107:[0,.69444,.11111,0],108:[0,.69444,.10861,0],109:[0,.44444,.09426,0],110:[0,.44444,.09426,0],111:[0,.44444,.07861,0],112:[.19444,.44444,.07861,0],113:[.19444,.44444,.105,0],114:[0,.44444,.11111,0],115:[0,.44444,.08167,0],116:[0,.63492,.09639,0],117:[0,.44444,.09426,0],118:[0,.44444,.11111,0],119:[0,.44444,.11111,0],120:[0,.44444,.12583,0],121:[.19444,.44444,.105,0],122:[0,.44444,.13889,0],126:[.35,.34444,.11472,0],163:[0,.69444,0,0],168:[0,.69444,.11473,0],176:[0,.69444,0,0],184:[.17014,0,0,0],198:[0,.68611,.11431,0],216:[.04861,.73472,.09062,0],223:[.19444,.69444,.09736,0],230:[0,.44444,.085,0],248:[.09722,.54167,.09458,0],305:[0,.44444,.09426,0],338:[0,.68611,.11431,0],339:[0,.44444,.085,0],567:[.19444,.44444,.04611,0],710:[0,.69444,.06709,0],711:[0,.63194,.08271,0],713:[0,.59444,.10444,0],714:[0,.69444,.08528,0],715:[0,.69444,0,0],728:[0,.69444,.10333,0],729:[0,.69444,.12945,0],730:[0,.69444,0,0],732:[0,.69444,.11472,0],733:[0,.69444,.11472,0],915:[0,.68611,.12903,0],916:[0,.68611,0,0],920:[0,.68611,.09062,0],923:[0,.68611,0,0],926:[0,.68611,.15092,0],928:[0,.68611,.17208,0],931:[0,.68611,.11431,0],933:[0,.68611,.10778,0],934:[0,.68611,.05632,0],936:[0,.68611,.10778,0],937:[0,.68611,.0992,0],8211:[0,.44444,.09811,0],8212:[0,.44444,.09811,0],8216:[0,.69444,.12945,0],8217:[0,.69444,.12945,0],8220:[0,.69444,.16772,0],8221:[0,.69444,.07939,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],168:[0,.66786,.10474,0],176:[0,.69444,0,0],184:[.17014,0,0,0],198:[0,.68333,.12028,0],216:[.04861,.73194,.09403,0],223:[.19444,.69444,.10514,0],230:[0,.43056,.07514,0],248:[.09722,.52778,.09194,0],305:[0,.43056,0,.02778],338:[0,.68333,.12028,0],339:[0,.43056,.07514,0],567:[.19444,.43056,0,.08334],710:[0,.69444,.06646,0],711:[0,.62847,.08295,0],713:[0,.56167,.10333,0],714:[0,.69444,.09694,0],715:[0,.69444,0,0],728:[0,.69444,.10806,0],729:[0,.66786,.11752,0],730:[0,.69444,0,0],732:[0,.66786,.11585,0],733:[0,.69444,.1225,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],167:[.19444,.69444,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],182:[.19444,.69444,0,0],184:[.17014,0,0,0],198:[0,.68333,0,0],215:[.08333,.58333,0,0],216:[.04861,.73194,0,0],223:[0,.69444,0,0],230:[0,.43056,0,0],247:[.08333,.58333,0,0],248:[.09722,.52778,0,0],305:[0,.43056,0,0],338:[0,.68333,0,0],339:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],733:[0,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0],57376:[.19444,.69444,0,0]},"Math-BoldItalic":{65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.11667,.61667,0,0],44:[.10556,.13056,0,0],45:[0,.45833,0,0],46:[0,.13056,0,0],47:[.25,.75,0,0],48:[0,.69444,0,0],49:[0,.69444,0,0],50:[0,.69444,0,0],51:[0,.69444,0,0],52:[0,.69444,0,0],53:[0,.69444,0,0],54:[0,.69444,0,0],55:[0,.69444,0,0],56:[0,.69444,0,0],57:[0,.69444,0,0],58:[0,.45833,0,0],59:[.10556,.45833,0,0],61:[-.09375,.40625,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.10556,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01528,0],87:[0,.69444,.01528,0],88:[0,.69444,0,0],89:[0,.69444,.0275,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.10833,.03056,0],97:[0,.45833,0,0],98:[0,.69444,0,0],99:[0,.45833,0,0],100:[0,.69444,0,0],101:[0,.45833,0,0],102:[0,.69444,.07639,0],103:[.19444,.45833,.01528,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.45833,0,0],110:[0,.45833,0,0],111:[0,.45833,0,0],112:[.19444,.45833,0,0],113:[.19444,.45833,0,0],114:[0,.45833,.01528,0],115:[0,.45833,0,0],116:[0,.58929,0,0],117:[0,.45833,0,0],118:[0,.45833,.01528,0],119:[0,.45833,.01528,0],120:[0,.45833,0,0],121:[.19444,.45833,.01528,0],122:[0,.45833,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],176:[0,.69444,0,0],180:[0,.69444,0,0],184:[.17014,0,0,0],305:[0,.45833,0,0],567:[.19444,.45833,0,0],710:[0,.69444,0,0],711:[0,.63542,0,0],713:[0,.63778,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],733:[0,.69444,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.45833,.03056,0],8212:[0,.45833,.03056,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"SansSerif-Italic":{33:[0,.69444,.05733,0],34:[0,.69444,.00316,0],35:[.19444,.69444,.05087,0],36:[.05556,.75,.11156,0],37:[.05556,.75,.03126,0],38:[0,.69444,.03058,0],39:[0,.69444,.07816,0],40:[.25,.75,.13164,0],41:[.25,.75,.02536,0],42:[0,.75,.11775,0],43:[.08333,.58333,.02536,0],44:[.125,.08333,0,0],45:[0,.44444,.01946,0],46:[0,.08333,0,0],47:[.25,.75,.13164,0],48:[0,.65556,.11156,0],49:[0,.65556,.11156,0],50:[0,.65556,.11156,0],51:[0,.65556,.11156,0],52:[0,.65556,.11156,0],53:[0,.65556,.11156,0],54:[0,.65556,.11156,0],55:[0,.65556,.11156,0],56:[0,.65556,.11156,0],57:[0,.65556,.11156,0],58:[0,.44444,.02502,0],59:[.125,.44444,.02502,0],61:[-.13,.37,.05087,0],63:[0,.69444,.11809,0],64:[0,.69444,.07555,0],65:[0,.69444,0,0],66:[0,.69444,.08293,0],67:[0,.69444,.11983,0],68:[0,.69444,.07555,0],69:[0,.69444,.11983,0],70:[0,.69444,.13372,0],71:[0,.69444,.11983,0],72:[0,.69444,.08094,0],73:[0,.69444,.13372,0],74:[0,.69444,.08094,0],75:[0,.69444,.11983,0],76:[0,.69444,0,0],77:[0,.69444,.08094,0],78:[0,.69444,.08094,0],79:[0,.69444,.07555,0],80:[0,.69444,.08293,0],81:[.125,.69444,.07555,0],82:[0,.69444,.08293,0],83:[0,.69444,.09205,0],84:[0,.69444,.13372,0],85:[0,.69444,.08094,0],86:[0,.69444,.1615,0],87:[0,.69444,.1615,0],88:[0,.69444,.13372,0],89:[0,.69444,.17261,0],90:[0,.69444,.11983,0],91:[.25,.75,.15942,0],93:[.25,.75,.08719,0],94:[0,.69444,.0799,0],95:[.35,.09444,.08616,0],97:[0,.44444,.00981,0],98:[0,.69444,.03057,0],99:[0,.44444,.08336,0],100:[0,.69444,.09483,0],101:[0,.44444,.06778,0],102:[0,.69444,.21705,0],103:[.19444,.44444,.10836,0],104:[0,.69444,.01778,0],105:[0,.67937,.09718,0],106:[.19444,.67937,.09162,0],107:[0,.69444,.08336,0],108:[0,.69444,.09483,0],109:[0,.44444,.01778,0],110:[0,.44444,.01778,0],111:[0,.44444,.06613,0],112:[.19444,.44444,.0389,0],113:[.19444,.44444,.04169,0],114:[0,.44444,.10836,0],115:[0,.44444,.0778,0],116:[0,.57143,.07225,0],117:[0,.44444,.04169,0],118:[0,.44444,.10836,0],119:[0,.44444,.10836,0],120:[0,.44444,.09169,0],121:[.19444,.44444,.10836,0],122:[0,.44444,.08752,0],126:[.35,.32659,.08826,0],168:[0,.67937,.06385,0],176:[0,.69444,0,0],184:[.17014,0,0,0],305:[0,.44444,.04169,0],567:[.19444,.44444,.04169,0],710:[0,.69444,.0799,0],711:[0,.63194,.08432,0],713:[0,.60889,.08776,0],714:[0,.69444,.09205,0],715:[0,.69444,0,0],728:[0,.69444,.09483,0],729:[0,.67937,.07774,0],730:[0,.69444,0,0],732:[0,.67659,.08826,0],733:[0,.69444,.09205,0],915:[0,.69444,.13372,0],916:[0,.69444,0,0],920:[0,.69444,.07555,0],923:[0,.69444,0,0],926:[0,.69444,.12816,0],928:[0,.69444,.08094,0],931:[0,.69444,.11983,0],933:[0,.69444,.09031,0],934:[0,.69444,.04603,0],936:[0,.69444,.09031,0],937:[0,.69444,.08293,0],8211:[0,.44444,.08616,0],8212:[0,.44444,.08616,0],8216:[0,.69444,.07816,0],8217:[0,.69444,.07816,0],8220:[0,.69444,.14205,0],8221:[0,.69444,.00316,0]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],168:[0,.67937,0,0],176:[0,.69444,0,0],184:[.17014,0,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.60889,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.67937,0,0],730:[0,.69444,0,0],732:[0,.67659,0,0],733:[0,.69444,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{32:[0,0,0,0],33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],160:[0,0,0,0],176:[0,.61111,0,0],184:[.19445,0,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],711:[0,.56597,0,0],713:[0,.56555,0,0],714:[0,.61111,0,0],715:[0,.61111,0,0],728:[0,.61111,0,0],730:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],776:[0,.61111,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],8216:[0,.61111,0,0],8217:[0,.61111,0,0],8242:[0,.61111,0,0],9251:[.11111,.21944,0,0]}};const a=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,i={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},s={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function o(e,i){let o=e.charCodeAt(0);e[0]in s?o=s[e[0]].charCodeAt(0):a.test(e[0])&&(o=77);const r=t[i][o];return r?{defaultMetrics:!1,depth:r[0],height:r[1],italic:r[2],skew:r[3]}:11034===o?{defaultMetrics:!0,depth:0,height:1,italic:0,skew:0}:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}function r(e,t,a=NaN){if("string"==typeof e){const a=e.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);a?(e=parseFloat(a[1]),t=a[2].toLowerCase()):e=parseFloat(e)}const i={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:3/4,em:10,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[t]||1;if(isFinite(a)){const t=Math.pow(10,a);return Math.round(e/10*i*t)/t}return e/10*i}function n(e,t){return r(e,t)*(4/3)*10}class l{constructor(e,t,a,s){this.id=e,this.size=t,this.cramped=s,this.sizeMultiplier=a,this.metrics=Object.keys(i).reduce((e,t)=>({...e,[t]:i[t][this.size]}),{}),this.metrics.emPerEx=i.xHeight[this.size]/i.quad[this.size]}sup(){return c[[4,5,4,5,6,7,6,7][this.id]]}sub(){return c[[5,5,5,5,7,7,7,7][this.id]]}fracNum(){return c[[2,3,4,5,6,7,6,7][this.id]]}fracDen(){return c[[3,3,5,5,7,7,7,7][this.id]]}cramp(){return c[[1,1,3,3,5,5,7,7][this.id]]}cls(){return["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"][this.size]}adjustTo(e){let t=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]][this.size][e.size];return t.length>0&&(t=" "+t),t}isTight(){return this.size>=2}}const c={0:new l(0,0,1,!1),1:new l(1,0,1,!0),2:new l(2,1,1,!1),3:new l(3,1,1,!0),4:new l(4,2,.7,!1),5:new l(5,2,.7,!0),6:new l(6,3,.5,!1),7:new l(7,3,.5,!0)};c.displaystyle=c[0],c.textstyle=c[2],c.scriptstyle=c[4],c.scriptscriptstyle=c[6];class d{constructor(e){var t;this.macros=null!==(t=e.macros)&&void 0!==t?t:{},this.atomIdsSettings=e.atomIdsSettings,this.mathstyle=e.mathstyle||c.displaystyle,this.letterShapeStyle=e.letterShapeStyle||"tex",this.size=e.size||"size5",this.parentMathstyle=e.parentMathstyle||this.mathstyle,this.parentSize=e.parentSize||this.size,this.opacity=e.opacity,this.smartFence=e.smartFence}clone(e={}){const t=new d(this);return e&&(Object.assign(t,e),e.mathstyle?(t.parentMathstyle=this.mathstyle,t.parentSize=this.size,"string"==typeof e.mathstyle&&(t.mathstyle=c[e.mathstyle])):t.mathstyle=this.mathstyle),t}setMathstyle(e){e&&"auto"!==e&&(this.mathstyle=c[e])}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sub()})}}const m={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},p={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34]},h={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",widetilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",widetilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",widetilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",widetilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};function u(e){let t="",a="";for(const i of e)/[a-zA-Z*]/.test(i[0])&&(a+=t),t=/\\[a-zA-Z]+\*?$/.test(i)?" ":"",a+=i;return a}function f(e,t){const a=[];let i,s=[];return e.forEach(e=>{if("first"!==e.type){let o;"variant"===t?(o=e.variant,e.variantStyle&&"up"!==e.variantStyle&&(o+="-"+e.variantStyle)):o=e[t],o!==i?(s.length>0&&a.push(s),s=[e],i=o):s.push(e)}}),s.length>0&&a.push(s),a}const g={};function y(e,t){g[e]={...t}}const b=["","mord","mbin","mop","mrel","mopen","mclose","mpunct","minner","spacing","first","command","error","placeholder","textord","none"];function v(e){return b.includes(e)}const x={"mord+mop":3,"mord+mbin":4,"mord+mrel":5,"mord+minner":3,"mop+mord":3,"mop+mop":3,"mop+mbin":5,"mop+minner":3,"mbin+mord":4,"mbin+mop":4,"mbin+mopen":4,"mbin+minner":4,"mrel+mord":5,"mrel+mop":5,"mrel+mopen":5,"mrel+minner":5,"mclose+mop":3,"mclose+mbin":4,"mclose+mrel":5,"mclose+minner":3,"mpunct+mord":3,"mpunct+mop":3,"mpunct+mbin":4,"mpunct+mrel":5,"mpunct+mopen":3,"mpunct+mpunct":3,"mpunct+minner":3},k=["​"," ","  "," "," ","  "," ","",""," "],w=[""," ⁣",""," ⁣"," ⁣"," ⁣"],S={"mord+mop":3,"mop+mord":3,"mop+mop":3,"mclose+mop":3,"minner+mop":3};function M(t){if("string"==typeof t)return t;if("number"==typeof t)return Number(Math.ceil(100*t)/100).toString();if(void 0===t)return"";if(e(t)){let e="";for(const a of t)e+=M(a);return e}return""}class L{constructor(t,a="",i=""){this.classes=a,e(t)?this.children=[].concat(...t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.type=i,this.style=null,this.updateDimensions()}updateDimensions(){let e=0,t=0,a=1;this.children?this.children.forEach(i=>{i.height>e&&(e=i.height),i.depth>t&&(t=i.depth),i.maxFontSize>a&&(a=i.maxFontSize)}):"string"==typeof this.body&&(e=.7,t=.2),this.height=e,this.depth=t,this.maxFontSize=a}selected(e){e&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!e&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(t=>t.selected(e))}applyStyle(e){if(!e)return;if(e.color&&("none"!==e.color?this.setStyle("color",e.color):this.setStyle("color","")),e.backgroundColor&&("none"!==e.backgroundColor?this.setStyle("background-color",e.backgroundColor):this.setStyle("background-color","")),e.cssClass&&(this.classes+=" "+e.cssClass),!this.body)return;const t=function(e,t){return g[t.mode]&&g[t.mode].applyStyle?g[t.mode].applyStyle(e,t):""}(this,e);if(this.body&&t){this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[e.fontSize]||1,this.height=0,this.depth=0,this.skew=0,this.italic=0;for(let e=0;e0&&(this.style||(this.style={}),this.style[e]=a)}setTop(e){e&&0!==e&&(this.style||(this.style={}),this.style.top=M(e)+"em",this.height-=e,this.depth+=e)}setLeft(e){e&&0!==e&&(this.style||(this.style={}),this.style["margin-left"]=M(e)+"em")}setRight(e){e&&0!==e&&(this.style||(this.style={}),this.style["margin-right"]=M(e)+"em")}setWidth(e){e&&0!==e&&(this.style||(this.style={}),this.style.width=M(e)+"em")}toMarkup(e=1,t=1){var a;let i="",s=this.body||"";if(this.children){let e="none";for(const a of this.children){let i=0;if(e){let s=a.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),i=a.isTight?S[e+"+"+s]||0:x[e+"+"+s]||0,i=Math.floor(t*i))}s+=a.toMarkup(i,t),e=C(a)}}if("​"!==s&&(s||this.svgBody)||this.classes&&"ML__selected"!==this.classes||this.cssId||this.style||this.svgOverlay){i="`${e}="${this.attributes[e]}"`).join(" "));const t=this.classes.split(" ");t.push(null!==(a={command:"ML__command",placeholder:"ML__placeholder",error:"ML__error"}[this.type])&&void 0!==a?a:""),this.caret&&"command"===this.type&&t.push("ML__command-caret");let o="";if(o=t.length>1?t.filter((e,t,a)=>e.length>0&&a.indexOf(e)===t).join(" "):t[0],o.length>0&&(i+=` class="${o}"`),e&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=M(parseFloat(this.style["margin-left"])+e/18)+"em":e<0&&w[-e]?s=w[-e]+s:k[e]?s=k[e]+s:(this.style||(this.style={}),this.style["margin-left"]=M(e/18)+"em")),this.style){let e="";const t=/ML__selected/.test(this.classes);for(const a in this.style)Object.prototype.hasOwnProperty.call(this.style,a)&&("background-color"===a&&t||(e+=a+":"+this.style[a]+";"));e.length>0&&(i+=' style="'+e+'"')}i+=">",this.svgBody?i+=function(e){if(p[e]){const t=p[e][2];return``}const[t,a,i,s]=m[e];let o,r;const n=i/1e3;3===t.length?(o=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],r=["xMinYMin","xMidYMin","xMaxYMin"]):2===t.length?(o=["slice-1-of-2","slice-2-of-2"],r=["xMinYMin","xMaxYMin"]):(o=["slice-1-of-1"],r=[s]);const l=t.map((e,t)=>``).join("");return`${l}`}(this.svgBody):this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(e){if(this.type!==e.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;if(this.svgBody||!this.body)return!1;if(e.svgBody||!e.body)return!1;const t=this.children&&this.children.length>0,a=e.children&&e.children.length>0;if(t||a)return!1;if((this.style?this.style.length:0)!==(e.style?e.style.length:0))return!1;const i=this.classes.trim().replace(/\s+/g," ").split(" "),s=e.classes.trim().replace(/\s+/g," ").split(" ");if(i.length!==s.length)return!1;i.sort(),s.sort();for(let e=0;eMath.max(e,t.height),0):t.height:0}function $(t){return t?e(t)?t.reduce((e,t)=>Math.max(e,t.depth),0):t.depth:0}function z(t){return t?e(t)?t[t.length-1].italic:t.italic:0}function _(t,a="",i=""){if(e(t)){const e=t.filter(e=>!!e);return 1===e.length?new L(e[0],a,i):new L(e,a,i)}return new L(t,a,i)}function D(e,t,a="",i=""){const s=new L(t,a,i),r=o(t,e);return s.height=r.height,s.depth=r.depth,s.skew=r.skew,s.italic=r.italic,s.setRight(s.italic),s}function q(t,a="",i=""){const s=_("","ML__strut");let o,r;return s.setStyle("height",A(t),"em"),0!==$(t)&&(o=_("","ML__strut--bottom"),o.setStyle("height",A(t)+$(t),"em"),o.setStyle("vertical-align",-$(t),"em")),r=e(t)?[s,o,...t]:[s,o,t],_(r,a,i)}function T(e,t,a,i,s){s=s||"";const o=K(t,(s+=" style-wrap ")+a.adjustTo(i));o.type=e;const r=i.sizeMultiplier/a.sizeMultiplier;return o.height*=r,o.depth*=r,o.maxFontSize=i.sizeMultiplier,o}function K(t,a="",i=""){if(!a){if(t instanceof L)return t;if(e(t)&&1===t.length)return t[0]}const s=new L(t,a,i);let o=1;return o=t instanceof L?t.maxFontSize:t.reduce((e,t)=>Math.max(e,t.maxFontSize),0),s.height*=o,s.depth*=o,s}function E(t,a,i="shift",s=0){let o=0,r=0;i=i||"shift";for(let t=0;t0?"em":""),i.attributes={"aria-hidden":"true"}),"size5"!==e.size?new L(i,"fontsize-ensurer reset-"+e.size+" size5"):0!==a?i:null}(t,n),c=[];r=o;for(const e of a)if("number"==typeof e)r+=e;else if(e instanceof L){const t=_([l,e]);t.setTop(-e.depth-r),c.push(t),r+=e.height+e.depth}const d=_(c,"vlist");return d.depth=Math.max(o,$(d)||0),d.height=Math.max(-r,A(d)||0),d}function F(e){const t=new L(null);return t.svgBody=e,t.height=function(e){return m[e]?m[e][2]/1e3:p[e][2]}(e)/2,t.depth=t.height,t}const N={},B={"<":"<",">":">",o:"o","&":"\\&","{":"\\{","}":"\\}","[":"\\lbrack","]":"\\rbrack",":":"\\colon"," ":"~","¬":"\\neg","·":"\\cdot","¼":"\\frac{1}{4}","½":"\\frac{1}{2}","¾":"\\frac{3}{4}","⁰":"^{0}","ⁱ":"^{i}","¹":"^{1}","²":"^{2}","³":"^{3}","†":"\\dagger","‡":"\\ddagger","…":"\\ldots","⁴":"^{4}","⁵":"^{5}","⁶":"^{6}","⁷":"^{7}","⁸":"^{8}","⁹":"^{9}","⁺":"^{+}","⁻":"^{-}","⁼":"^{=}","ⁿ":"^{n}","₀":"_{0}","₁":"_{1}","₂":"_{2}","₃":"_{3}","₄":"_{4}","₅":"_{5}","₆":"_{6}","₇":"_{7}","₈":"_{8}","₉":"_{9}","₊":"_{+}","₋":"_{-}","₌":"_{=}","ₐ":"_{a}","ₑ":"_{e}","ₒ":"_{o}","ₓ":"_{x}","′":"\\prime","'":"\\prime","←":"\\gets","→":"\\to","△":"\\triangle","▽":"\\triangledown","∋":"\\owns","∗":"\\ast","∣":"\\vert","∥":"\\Vert","∧":"\\land","∨":"\\lor","⋅":"\\cdot","⋈":"\\bowtie","≠":"\\ne","≤":"\\le","≥":"\\ge","⊥":"\\bot","⟷":"\\biconditional","⟸":"\\impliedby","⟹":"\\implies","ℂ":"\\C","ℕ":"\\N","ℙ":"\\P","ℚ":"\\Q","ℝ":"\\R","ℤ":"\\Z"},O={},R={},P={iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace",rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}"},I={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},H={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","\\textdagger":"†","\\textdaggerdbl":"‡","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},W=/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,V="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),U="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");function j(e,t,a="mord",i=""){N[e]={type:a,variant:i,value:t},B[t]||i||(B[t]=e),H[e]=t}function G(e,t){for(let a=e;a<=t;a++){const e=String.fromCodePoint(a);j(e,e)}}function Z(e,t){return"math"===e?B[t]||t:"text"===e&&Object.keys(H).find(e=>H[e]===t)||t}const X={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},Y=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function J(e,t,a){if(!/[A-Za-z0-9]/.test(e))return e;if(!t&&!a)return e;const i=e.codePointAt(0);for(let e=0;e=Y[e].offset&&i120831)&&(e<8448||e>8527))return{char:String.fromCodePoint(e)};for(const t in X)if(Object.prototype.hasOwnProperty.call(X,t)&&X[t]===e){e=t.codePointAt(0);break}for(let t=0;t=Y[t].start&&e=1;)i.params.push({isOptional:!1,type:"math"}),s-=1}}}else"math"===t?i=N[e]:H[e]&&(i={value:H[e]});return!i||"mord"!==i.type||"f"!==i.value&&"g"!==i.value&&"h"!==i.value||(i.isFunction=!0),i}function oe(e){if(e.length<=1)return[];const t=[];for(const a in O)Object.prototype.hasOwnProperty.call(O,a)&&a.startsWith(e)&&!O[a].infix&&t.push({match:a,frequency:O[a].frequency});for(const a in N)Object.prototype.hasOwnProperty.call(N,a)&&a.startsWith(e)&&t.push({match:a,frequency:N[a].frequency});return t.sort((e,t)=>e.frequency===t.frequency?e.match.length-t.match.length:(t.frequency||0)-(e.frequency||0)),t}function re(e){let t="auto";const a=e.match(/:([^=]+)/);return a&&(t=a[1].trim()),t}function ne(e){if(!e)return[];let t=[],a=e.split("]");if("["===a[0].charAt(0)){t.push({isOptional:!0,type:re(a[0].slice(1))});for(let e=1;e<=a.length;e++)t=t.concat(ne(a[e]))}else if(a=e.split("}"),"{"===a[0].charAt(0)){t.push({isOptional:!1,type:re(a[0].slice(1))});for(let e=1;e<=a.length;e++)t=t.concat(ne(a[e]))}return t}function le(e){let t="",a=!0;return e.forEach(e=>{"string"==typeof e.body?t+=e.body:a=!1}),a?t:""}function ce(e,t,a,i=!1){"string"==typeof e&&(e=[e]);const s={tabular:i,params:ne(t),parser:a};for(const t of e)R[t]=s}function de(e,t,a){ce(e,t,a,!0)}function me(e,t,a,i,s){"string"==typeof e&&(e=[e]),a||(a={});const o={params:ne(t),mode:a.mode,infix:!!a.infix,parse:i,emit:s};e.forEach(e=>{O["\\"+e]=o})}const pe={acute:"ˊ",grave:"ˋ",dot:"˙",ddot:"¨",mathring:"˚",tilde:"~",bar:"ˉ",breve:"˘",check:"ˇ",hat:"^",vec:"⃗"};me(Object.keys(pe),"{body:auto}",null,(function(e,t){return{type:"accent",accent:pe[e.slice(1)],limits:"accent",skipBoundary:!0,body:t[0]}})),me(["widehat","widecheck","widetilde"],"{body:auto}",null,(e,t)=>{const a=le(t[0]);return{type:"accent",svgAccent:e.slice(1)+(a.length>5?"4":["1","1","2","2","3","3"][a.length]),limits:"accent",skipBoundary:!0,body:t[0]}}),me("utilde","{body:auto}",null,(e,t)=>{const a=le(t[0]),i="widetilde"+(a.length>5?"4":["1","1","2","2","3","3"][a.length]);return{type:"overunder",body:t[0],svgBelow:i,skipBoundary:!0}},(e,t,a,i)=>`\\utilde{${i(a,a.body)}}`),me("^","{:string}",{},(e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[t[0]]||"^"})),me("`","{:string}",{},(e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[t[0]]||"`"})),me("'","{:string}",{},(function(e,t){return{type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[t[0]]||"^"}})),me("~","{:string}",{},(e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[t[0]]||"´"})),me("c","{:string}",{},(e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{c:"ç",C:"Ç"}[t[0]]||""})),me("enclose","{notation:string}[style:string]{body:auto}",null,(e,t)=>{const a={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:t[2]};if(t[1]){const e=t[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const t of e){const e=t.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(e)a.strokeWidth=n(e[1],"px"),isFinite(a.strokeWidth)||(a.strokeWidth=1),a.strokeStyle=e[2],a.strokeColor=e[3];else{const e=t.match(/\s*([a-z]*)\s*=\s*"(.*)"/);e&&("mathbackground"===e[1]?a.backgroundcolor=e[2]:"mathcolor"===e[1]?a.strokeColor=e[2]:"padding"===e[1]?a.padding=n(e[2],"px"):"shadow"===e[1]&&(a.shadow=e[2]))}}"dashed"===a.strokeStyle?a.svgStrokeStyle="5,5":"dotted"===a.strokeStyle&&(a.svgStrokeStyle="1,5")}return a.borderStyle=a.strokeWidth+"px "+a.strokeStyle+" "+a.strokeColor,a.notation={},t[0].split(/[, ]/).filter(e=>e.length>0).forEach(e=>{a.notation[e.toLowerCase()]=!0}),a.notation.updiagonalarrow&&(a.notation.updiagonalstrike=!1),a.notation.box&&(a.notation.left=!1,a.notation.right=!1,a.notation.bottom=!1,a.notation.top=!1),a}),me("cancel","{body:auto}",null,(function(e,t){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:t[0]}})),me("bcancel","{body:auto}",null,(function(e,t){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:t[0]}})),me("xcancel","{body:auto}",null,(function(e,t){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:t[0]}})),ce("math","",()=>({mathstyle:"textstyle"})),ce("displaymath","",(function(){return{mathstyle:"displaystyle"}})),de("array","{columns:colspec}",(e,t)=>({colFormat:t[0],mathstyle:"textstyle"})),de(["equation","equation","subequations"],"",()=>({colFormat:[{align:"c"}]})),de("multline","",(function(){return{colFormat:[{align:"m"}]}})),de(["align","align*","aligned","eqnarray"],"",(e,t,a)=>{let i=0;for(const e of a)i=Math.max(i,e.length);const s=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({colFormat:[{align:"r"},{align:"l"}]})),de(["gather","gathered"],"",()=>({colFormat:[{gap:.25},{align:"c"},{gap:0}],jot:.3})),de(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","smallmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*","smallmatrix*"],"[columns:colspec]",(e,t)=>{var a;const i={mathstyle:"textstyle"};switch(e){case"pmatrix":case"pmatrix*":i.lFence="(",i.rFence=")";break;case"bmatrix":case"bmatrix*":i.lFence="[",i.rFence="]";break;case"Bmatrix":case"Bmatrix*":i.lFence="\\lbrace",i.rFence="\\rbrace";break;case"vmatrix":case"vmatrix*":i.lFence="\\vert",i.rFence="\\vert";break;case"Vmatrix":case"Vmatrix*":i.lFence="\\Vert",i.rFence="\\Vert";break;case"smallmatrix":case"smallmatrix*":i.mathstyle="scriptstyle";break;case"matrix":case"matrix*":i.lFence=".",i.rFence="."}return i.colFormat=null!==(a=t[0])&&void 0!==a?a:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}],i}),de("cases","",()=>({arraystretch:1.2,lFence:"\\lbrace",rFence:".",colFormat:[{align:"l"},{gap:1},{align:"l"}]})),ce("center","",(function(){return{colFormat:[{align:"c"}]}})),me(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overbrace","overlinesegment","overgroup"],"{:auto}",null,(e,t)=>({type:"overunder",body:t[0],svgAbove:e.slice(1),skipBoundary:!0,limits:"overunder"}),(e,t,a,i)=>`${e}{${i(a,a.body)}}`),me(["underrightarrow","underleftarrow","underleftrightarrow","underbrace","underlinesegment","undergroup"],"{:auto}",null,(e,t)=>({type:"overunder",body:t[0],svgBelow:e.slice(1),skipBoundary:!0,limits:"overunder"}),(e,t,a,i)=>`${e}{${i(a,a.body)}}`),me(["xrightarrow","xleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","xLeftrightarrow","xrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xrightleftarrows","xrightequilibrium","xleftequilibrium"],"[:auto]{:auto}",null,(e,t)=>({type:"overunder",mathtype:"mrel",svgBody:e.slice(1),overscript:t[1],underscript:t[0],skipBoundary:!0}),(e,t,a,i)=>e+(a.underscript?`[${i(a,a.underscript)}]`:"")+`{${i(a,a.overscript)}}`),me(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","coth","ctg","cth","cotg","csc","cosec","deg","dim","exp","hom","inf","ker","lg","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th"],"",null,(function(e){return{type:"mop",limits:"nolimits",isSymbol:!1,isFunction:!0,body:e.slice(1),variant:"main",variantStyle:"up"}})),me(["liminf","limsup"],"",null,e=>({type:"mop",limits:"limits",isSymbol:!1,body:{"\\liminf":"lim inf","\\limsup":"lim sup"}[e],variant:"main"})),me(["lim","mod"],"",null,(function(e){return{type:"mop",limits:"limits",isSymbol:!1,body:e.slice(1),variant:"main"}})),me(["det","max","min"],"",null,(function(e){return{type:"mop",limits:"limits",isSymbol:!1,isFunction:!0,body:e.slice(1),variant:"main"}})),me("sqrt","[index:auto]{radicand:auto}",null,(e,t)=>({type:"surd",body:t[1],index:t[0]}),(e,t,a,i)=>{let s="";return a.index&&(s+=`[${i(a,a.index)}]`),s+=`{${i(a,a.body)}}`,e+s}),me(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{numerator}{denominator}",null,(e,t)=>{const a={type:"genfrac",numer:t[0],denom:t[1],mathstyle:"auto"};switch(e){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":a.hasBarLine=!0;break;case"\\\\atopfrac":a.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a.hasBarLine=!1,a.leftDelim="(",a.rightDelim=")"}switch(e){case"\\dfrac":case"\\dbinom":a.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":a.mathstyle="textstyle"}return"\\cfrac"===e&&(a.continuousFraction=!0),a},(e,t,a,i)=>`${e}{${i(a,a.numer)}}{${i(a,a.denom)}}`),me(["over","atop","choose"],"",{infix:!0},(e,t)=>{const a=t[0],i=t[1];let s=!1,o=null,r=null;switch(e){case"\\atop":break;case"\\over":s=!0;break;case"\\choose":s=!1,o="(",r=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:a,denom:i,hasBarLine:s,leftDelim:o,rightDelim:r,mathstyle:"auto"}},(e,t,a,i)=>`{${i(a,a.numer)}${e} ${i(a,a.denom)}}`),me("pdiff","{numerator}{denominator}",null,(e,t)=>({type:"genfrac",numer:t[0],denom:t[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}),(e,t,a,i)=>`${e}{${i(a,a.numer)}}{${i(a,a.denom)}}`),me(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","smallint","intop"],"",null,e=>({type:"mop",limits:"auto",isSymbol:!0,variant:"main",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[e.slice(1)]}));const he={int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑",sqcup:"⊔",sqcap:"⊓",uplus:"⊎",wr:"≀",amalg:"⨿",Cap:"⋒",Cup:"⋓",doublecap:"⋒",doublecup:"⋓"};me(Object.keys(he),"",null,(function(e){return{type:"mop",limits:"nolimits",isSymbol:!0,body:he[e.slice(1)],variant:{"⋒":"ams","⋓":"ams"}[he[e.slice(1)]]}})),me(["Re","Im"],"",null,(function(e){return{type:"mop",limits:"nolimits",isSymbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[e],variant:"fraktur"}})),me("middle","{:delim}",null,(function(e,t){return{type:"delim",delim:t[0]}}));const ue={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},fe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ge=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"],ye={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};function be(e){var t;const a=e.toLowerCase().split("!");let i,s,o,r=255,n=255,l=255,c=-1;const d=a.length>0&&"-"===a[0].charAt(0);d&&(a[0]=a[0].slice(1));for(let e=0;e=0&&(r=(1-c)*r+c*i,n=(1-c)*n+c*s,l=(1-c)*l+c*o,c=-1),e+1=0&&(r=c*r+(1-c)*i,n=c*n+(1-c)*s,l=c*l+(1-c)*o),d&&(r=255-r,n=255-n,l=255-l),"#"+("00"+Math.round(r).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(l).toString(16)).slice(-2)}function ve(e){let t=e.toUpperCase();for(const e in ye)if(ye[e]===t){t=e;break}for(const e in ue)if(ue[e]===t){t=e;break}return t}me("ensuremath","{:math}",{},(e,t)=>({type:"group",mode:"math",body:t[0],skipBoundary:!0,latexOpen:"\\ensuremath{",latexClose:"}"}),(e,t,a,i)=>i(a,a.body)),me("color","{:color}",{},(e,t)=>({color:t[0]})),me("textcolor","{:color}{content:auto*}",{},(e,t)=>({color:t[0]})),me("boxed","{content:math}",null,(e,t)=>({type:"box",framecolor:"black",skipBoundary:!0,body:t[0]})),me("colorbox","{background-color:string}{content:auto}",{},(e,t)=>({type:"box",backgroundcolor:be(t[0]),skipBoundary:!0,body:t[1],verbatimBackgroundcolor:t[0]}),(e,t,a,i)=>`${e}{${a.verbatimBackgroundcolor||ve(a.backgroundcolor)}}{${i(a,a.body)}}`),me("fcolorbox","{frame-color:string}{background-color:string}{content:auto}",{},(e,t)=>({type:"box",framecolor:be(t[0]),backgroundcolor:be(t[1]),skipBoundary:!0,body:t[2],verbatimBackgroundcolor:t[1],verbatimFramecolor:t[0]}),(e,t,a,i)=>`${e}{${a.verbatimFramecolor||ve(a.framecolor)}{${a.verbatimBackgroundcolor||ve(a.backgroundcolor)}}{${i(a,a.body)}}`),me("bbox","[:bbox]{body:auto}",{},(e,t)=>{if(t[0]){const e=t[0];return{type:"box",padding:e.padding,border:e.border,backgroundcolor:e.backgroundcolor,skipBoundary:!0,body:t[1]}}return{type:"box",skipBoundary:!0,body:t[1]}},(e,t,a,i)=>{let s=e;if(isFinite(a.padding)||void 0!==a.border||void 0!==a.backgroundcolor){const e=[];isFinite(a.padding)&&e.push(Math.floor(100*a.padding)/100+"em"),a.border&&e.push("border:"+a.border),a.backgroundcolor&&e.push(ve(a.backgroundcolor)),s+=`[${e.join(",")}]`}return s+`{${i(a,a.body)}}`}),me(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{},(e,t)=>({fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[e.slice(1)]})),me("fontseries","{:string}",{mode:"text"},(e,t)=>({fontSeries:t[0]})),me("fontshape","{:string}",{mode:"text"},(e,t)=>({fontShape:t[0]})),me("fontfamily","{:string}",{mode:"text"},(e,t)=>({fontFamily:t[0]})),me("selectfont","",{mode:"text"},(e,t)=>({})),me("bf","",{},(e,t)=>({fontSeries:"b",fontShape:"n",fontFamily:"cmr"})),me(["boldsymbol","bm"],"{:math*}",{},(e,t)=>({mode:"math",cssClass:"ML__boldsymbol"})),me("bold","{:math*}",{},(e,t)=>({mode:"math",variantStyle:"bold"})),me("bfseries","",{mode:"text"},(e,t)=>({fontSeries:"b"})),me("mdseries","",{mode:"text"},(e,t)=>({fontSeries:"m"})),me("upshape","",{mode:"text"},(e,t)=>({fontShape:"n"})),me("slshape","",{mode:"text"},(e,t)=>({fontShape:"sl"})),me("scshape","",{mode:"text"},(e,t)=>({fontShape:"sc"})),me("textbf","{:text*}",{},(e,t)=>({mode:"text",fontSeries:"b"})),me("textmd","{:text*}",{},(e,t)=>({mode:"text",fontSeries:"m"})),me("textup","{:text*}",{},(e,t)=>({mode:"text",fontShape:"n"})),me("textnormal","{:text*}",{},(e,t)=>({mode:"text",fontShape:"n",fontSeries:"m"})),me("textsl","{:text*}",{},(e,t)=>({mode:"text",fontShape:"sl"})),me("textit","{:text*}",{},(e,t)=>({mode:"text",fontShape:"it"})),me("textsc","{:text*}",{},(e,t)=>({mode:"text",fontShape:"sc"})),me("textrm","{:text*}",{},(e,t)=>({mode:"text",fontFamily:"roman"})),me("textsf","{:text*}",{},(e,t)=>({mode:"text",fontFamily:"sans-serif"})),me("texttt","{:text*}",{},(e,t)=>({mode:"text",fontFamily:"monospace"})),me("mathbf","{:math*}",{},(e,t)=>({mode:"math",variant:"normal",variantStyle:"bold"})),me("mathit","{:math*}",{},(e,t)=>({mode:"math",variant:"normal",variantStyle:"italic"})),me("mathbfit","{:math*}",{},(e,t)=>({mode:"math",variant:"normal",variantStyle:"bolditalic"})),me("mathrm","{:math*}",{},(e,t)=>({mode:"math",variant:"normal",variantStyle:"up"})),me("mathsf","{:math*}",{},(e,t)=>({mode:"math",variant:"sans-serif",variantStyle:"up"})),me("mathtt","{:math*}",{},(e,t)=>({mode:"math",variant:"monospace",variantStyle:"up"})),me("it","",{},(e,t)=>({fontSeries:"m",fontShape:"it",fontFamily:"cmr",variantStyle:"italic"})),me("rmfamily","",{},(e,t)=>({fontFamily:"roman"})),me("sffamily","",{},(e,t)=>({fontFamily:"sans-serif"})),me("ttfamily","",{},(e,t)=>({fontFamily:"monospace"})),me(["Bbb","mathbb"],"{:math*}",{},(e,t)=>({variant:"double-struck",variantStyle:"up"})),me(["frak","mathfrak"],"{:math*}",{},(e,t)=>({variant:"fraktur",variantStyle:"up"})),me("mathcal","{:math*}",{},(e,t)=>({variant:"calligraphic",variantStyle:"up"})),me("mathscr","{:math*}",{},(e,t)=>({variant:"script",variantStyle:"up"})),me("mbox","{:text}",null,(e,t)=>({type:"group",mode:"math",body:t[0]})),me("text","{:text*}",null,(e,t)=>({mode:"text"})),me("class","{name:string}{content:auto*}",null,(e,t)=>({cssClass:t[0]})),me("cssId","{id:string}{content:auto}",null,(e,t)=>({type:"group",body:t[1],cssId:t[0]})),me("em","",null,(e,t)=>({cssClass:"ML__emph"})),me("emph","{:auto}",null,(e,t)=>({cssClass:"ML__emph",body:t[0],type:"group",skipBoundary:!0}));const xe={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function ke(e,t,a,i,s,o=""){const r=T(e,D("Size"+a+"-Regular",te("math",t),"delimsizing size"+a),s.mathstyle,c.textstyle,o);return i&&r.setTop((1-s.mathstyle.sizeMultiplier)*s.mathstyle.metrics.axisHeight),r.setStyle("color",s.color),"number"==typeof s.opacity&&r.setStyle("opacity",s.opacity),r}function we(e,t){let a="";return"Size1-Regular"===t?a=" delim-size1":"Size4-Regular"===t&&(a=" delim-size4"),D(t,te("math",e),"delimsizinginner"+a)}function Se(e,t,a,i,s,r=""){let n,l,d,m;n=d=m=te("math",t),l=null;let p="Size1-Regular";"\\vert"===t||"\\lvert"===t||"\\rvert"===t||"\\mvert"===t||"\\mid"===t?d=n=m="∣":"\\Vert"===t||"\\lVert"===t||"\\rVert"===t||"\\mVert"===t||"\\|"===t?d=n=m="∥":"\\uparrow"===t?d=m="⏐":"\\Uparrow"===t?d=m="‖":"\\downarrow"===t?n=d="⏐":"\\Downarrow"===t?n=d="‖":"\\updownarrow"===t?(n="↑",d="⏐",m="↓"):"\\Updownarrow"===t?(n="⇑",d="‖",m="⇓"):"["===t||"\\lbrack"===t?(n="⎡",d="⎢",m="⎣",p="Size4-Regular"):"]"===t||"\\rbrack"===t?(n="⎤",d="⎥",m="⎦",p="Size4-Regular"):"\\lfloor"===t?(d=n="⎢",m="⎣",p="Size4-Regular"):"\\lceil"===t?(n="⎡",d=m="⎢",p="Size4-Regular"):"\\rfloor"===t?(d=n="⎥",m="⎦",p="Size4-Regular"):"\\rceil"===t?(n="⎤",d=m="⎥",p="Size4-Regular"):"("===t?(n="⎛",d="⎜",m="⎝",p="Size4-Regular"):")"===t?(n="⎞",d="⎟",m="⎠",p="Size4-Regular"):"\\{"===t||"\\lbrace"===t?(n="⎧",l="⎨",m="⎩",d="⎪",p="Size4-Regular"):"\\}"===t||"\\rbrace"===t?(n="⎫",l="⎬",m="⎭",d="⎪",p="Size4-Regular"):"\\lgroup"===t?(n="⎧",m="⎩",d="⎪",p="Size4-Regular"):"\\rgroup"===t?(n="⎫",m="⎭",d="⎪",p="Size4-Regular"):"\\lmoustache"===t?(n="⎧",m="⎭",d="⎪",p="Size4-Regular"):"\\rmoustache"===t?(n="⎫",m="⎩",d="⎪",p="Size4-Regular"):"\\surd"===t?(n="",m="⎷",d="",p="Size4-Regular"):"\\ulcorner"===t?(n="┌",d=m=" "):"\\urcorner"===t?(n="┐",d=m=" "):"\\llcorner"===t?(m="└",d=n=" "):"\\lrcorner"===t&&(n="┘",d=n=" ");const h=o(te("math",n),p),u=h.height+h.depth,f=o(te("math",d),p),g=f.height+f.depth,y=o(te("math",m),p),b=y.height+y.depth;let v=0,x=1;if(null!==l){const e=o(te("math",l),p);v=e.height+e.depth,x=2}const k=u+b+v,w=Math.ceil((a-k)/(x*g)),S=k+w*x*g;let M=s.mathstyle.metrics.axisHeight;i&&(M*=s.mathstyle.sizeMultiplier);const L=S/2-M,C=[];if(C.push(we(m,p)),null===l)for(let e=0;e{const a={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[e],body:t[0],captureSelection:!0};return"\\mathop"===e&&(a.limits="limits",a.isFunction=!0),a},(e,t,a,i)=>`${e}{${i(a,a.body)}}`),me(["operatorname","operatorname*"],"{operator:math}",null,(function(e,t){const a={type:"mop",captureSelection:!0,body:t[0],isFunction:!0};return a.body.forEach(e=>{e.isFunction=!1,e.variant||e.variantStyle||(e.variant="main",e.variantStyle="up"),e.type="mord",e.body={"∗":"*","−":"-"}[e.body]||e.body}),"\\operatorname"===e?a.limits="nolimits":"\\operatorname*"===e&&(a.limits="limits"),a})),me("unicode","{charcode:number}",null,(e,t)=>{let a=parseInt(t[0]);return isFinite(a)||(a=10067),{type:"mord",body:String.fromCodePoint(a),codepoint:a}},(e,t,a,i)=>`${e}{"${("000000"+a.codepoint.toString(16)).toUpperCase().substr(-6)}}`),me("rule","[raise:dimen]{width:dimen}{thickness:dimen}",null,(function(e,t){return{type:"rule",shift:t[0],width:t[1],height:t[2]}})),me("overline","{:auto}",null,(e,t)=>({type:"line",position:"overline",skipBoundary:!0,body:t[0]})),me("underline","{:auto}",null,(e,t)=>({type:"line",position:"underline",skipBoundary:!0,body:t[0]})),me("overset","{annotation:auto}{symbol:auto}",null,(function(e,t){return{type:"overunder",overscript:t[0],skipBoundary:!0,body:t[1]}}),(e,t,a,i)=>`${e}{${i(a,a.overscript)}}{${i(a,a.body)}}`),me("underset","{annotation:auto}{symbol:auto}",null,(function(e,t){return{type:"overunder",underscript:t[0],skipBoundary:!0,body:t[1]}}),(e,t,a,i)=>`${e}{${i(a,a.overscript)}}{${i(a,a.body)}}`),me(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0},(function(e,t){return{type:"genfrac",numer:t[0],denom:t[1],hasBarLine:!1,leftDelim:t[2],rightDelim:t[3],mathstyle:"auto"}}),(e,t,a,i)=>`${i(a,a.numer)} ${e}${a.leftDelim}${a.rightDelim}${i(a,a.denom)}`),me(["stackrel","stackbin"],"{annotation:auto}{symbol:auto}",null,(function(e,t){return{type:"overunder",overscript:t[0],skipBoundary:!0,body:t[1],mathtype:"\\stackrel"===e?"mrel":"mbin"}}),(e,t,a,i)=>`${e}{${i(a,a.overscript)}}{${i(a,a.body)}}`),me("rlap","{:auto}",null,(function(e,t){return{type:"overlap",align:"right",skipBoundary:!0,body:t[0]}})),me("llap","{:auto}",null,(function(e,t){return{type:"overlap",align:"left",skipBoundary:!0,body:t[0]}})),me("mathrlap","{:auto}",null,(function(e,t){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:t[0]}})),me("mathllap","{:auto}",null,(function(e,t){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:t[0]}})),function(e){for(let e=0;e<"0123456789/@.?!".length;e++){const t="0123456789/@.?!".charAt(e);j(t,t)}}(),G(65,90),G(97,122),j("\\forall","∀"),j("\\exists","∃"),j("\\nexists","∄","mord","ams"),j("\\mid","∣","mrel"),j("\\top","⊤"),j("\\bot","⊥"),j("\\sharp","♯"),j("\\flat","♭"),j("\\natural","♮"),j("\\#","#"),j("\\&","&"),j("\\clubsuit","♣"),j("\\heartsuit","♡"),j("\\spadesuit","♠"),j("\\diamondsuit","♢"),j("\\differencedelta","∆","mrel"),j("\\backslash","\\"),j("\\nabla","∇"),j("\\partial","∂"),j("\\ell","ℓ"),j("\\hbar","ℏ"),j("\\hslash","ℏ","mord","ams"),j("\\Finv","Ⅎ","mord","ams"),j("\\Game","⅁","mord","ams"),j("\\wp","℘"),j("\\eth","ð","mord","ams"),j("\\mho","℧","mord","ams"),j("\\Bbbk","k","mord","ams"),j("\\N","N","mord","double-struck"),j("\\R","R","mord","double-struck"),j("\\Q","Q","mord","double-struck"),j("\\C","C","mord","double-struck"),j("\\Z","Z","mord","double-struck"),j("\\P","P","mord","double-struck"),j("\\pounds","£"),j("\\yen","¥","mord","ams"),j("\\euro","€"),j("\\dagger","†","mbin"),j("\\dag","†","mbin"),j("\\ddag","‡","mbin"),j("\\ddagger","‡","mbin"),j("\\maltese","✠","mord","ams"),j("\\rightarrow","→","mrel"),j("\\to","→","mrel"),j("\\leftarrow","←","mrel"),j("\\gets","←","mrel"),j("\\Rightarrow","⇒","mrel"),j("\\Leftarrow","⇐","mrel"),j("\\longrightarrow","⟶","mrel"),j("\\longleftarrow","⟵","mrel"),j("\\Longrightarrow","⟹","mrel"),j("\\implies","⟹","mrel"),j("\\Longleftarrow","⟸","mrel"),j("\\impliedby","⟸","mrel"),j("\\dashrightarrow","⇢","mrel","ams"),j("\\dashleftarrow","⇠","mrel","ams"),j("\\Rrightarrow","⇛","mrel","ams"),j("\\Lleftarrow","⇚","mrel","ams"),j("\\longleftrightarrow","⟷","mrel"),j("\\biconditional","⟷","mrel"),j("\\Longleftrightarrow","⟺","mrel"),j("\\leftrightarrows","⇆","mrel","ams"),j("\\rightleftarrows","⇄","mrel","ams"),j("\\mapsto","↦","mrel"),j("\\longmapsto","⟼","mrel"),j("\\uparrow","↑","mrel"),j("\\downarrow","↓","mrel"),j("\\Uparrow","⇑","mrel"),j("\\Downarrow","⇓","mrel"),j("\\updownarrow","↕","mrel"),j("\\Updownarrow","⇕","mrel"),j("\\curvearrowright","↷","mrel","ams"),j("\\curvearrowleft","↶","mrel","ams"),j("\\hookrightarrow","↪","mrel"),j("\\hookleftarrow","↩","mrel"),j("\\rightharpoonup","⇀","mrel"),j("\\leftharpoonup","↼","mrel"),j("\\rightharpoondown","⇁","mrel"),j("\\leftharpoondown","↽","mrel"),j("\\rightrightarrows","⇉","mrel","ams"),j("\\leftleftarrows","⇇","mrel","ams"),j("\\upuparrows","⇈","mrel","ams"),j("\\downdownarrows","⇊","mrel","ams"),j("\\leftarrowtail","↢","mrel","ams"),j("\\rightarrowtail","↣","mrel","ams"),j("\\looparrowright","↬","mrel","ams"),j("\\looparrowleft","↫","mrel","ams"),j("\\twoheadleftarrow","↞","mrel","ams"),j("\\twoheadrightarrow","↠","mrel","ams"),j("\\rightleftharpoons","⇌","mrel"),j("\\leftrightharpoons","⇋","mrel","ams"),j("\\Rsh","↱","mrel","ams"),j("\\Lsh","↰","mrel","ams"),j("\\searrow","↘","mrel"),j("\\nearrow","↗","mrel"),j("\\swarrow","↙","mrel"),j("\\nwarrow","↖","mrel"),j("\\circlearrowright","↻","mrel","ams"),j("\\circlearrowleft","↺","mrel","ams"),j("\\restriction","↾","mrel","ams"),j("\\upharpoonright","↾","mrel","ams"),j("\\upharpoonleft","↿","mrel","ams"),j("\\downharpoonright","⇂","mrel","ams"),j("\\downharpoonleft","⇃","mrel","ams"),j("\\rightsquigarrow","⇝","mrel","ams"),j("\\leadsto","⇝","mrel","ams"),j("\\leftrightsquigarrow","↭","mrel","ams"),j("\\originalof","⊶","mrel"),j("\\imageof","⊷","mrel"),j("\\multimap","⊸","mrel","ams"),j("\\nrightarrow","↛","mrel","ams"),j("\\nleftarrow","↚","mrel","ams"),j("\\nRightarrow","⇏","mrel","ams"),j("\\nLeftarrow","⇍","mrel","ams"),j("\\nleftrightarrow","↮","mrel","ams"),j("\\nLeftrightarrow","⇎","mrel","ams"),j("\\nless","≮","mrel","ams"),j("\\nleqslant","","mrel","ams"),j("\\lneq","⪇","mrel","ams"),j("\\lneqq","≨","mrel","ams"),j("\\nleqq","","mrel","ams"),j("\\unlhd","⊴","mbin","ams"),j("\\unrhd","⊵","mbin","ams"),j("\\lvertneqq","","mrel","ams"),j("\\lnsim","⋦","mrel","ams"),j("\\lnapprox","⪉","mrel","ams"),j("\\nprec","⊀","mrel","ams"),j("\\npreceq","⋠","mrel","ams"),j("\\precnsim","⋨","mrel","ams"),j("\\precnapprox","⪹","mrel","ams"),j("\\nsim","≁","mrel","ams"),j("\\nshortmid","","mrel","ams"),j("\\nmid","∤","mrel","ams"),j("\\nvdash","⊬","mrel","ams"),j("\\nvDash","⊭","mrel","ams"),j("\\ngtr","≯","mrel","ams"),j("\\ngeqslant","","mrel","ams"),j("\\ngeqq","","mrel","ams"),j("\\gneq","⪈","mrel","ams"),j("\\gneqq","≩","mrel","ams"),j("\\gvertneqq","","mrel","ams"),j("\\gnsim","⋧","mrel","ams"),j("\\gnapprox","⪊","mrel","ams"),j("\\nsucc","⊁","mrel","ams"),j("\\nsucceq","⋡","mrel","ams"),j("\\succnsim","⋩","mrel","ams"),j("\\succnapprox","⪺","mrel","ams"),j("\\ncong","≆","mrel","ams"),j("\\nshortparallel","","mrel","ams"),j("\\nparallel","∦","mrel","ams"),j("\\nVDash","⊯","mrel","ams"),j("\\nsupseteqq","","mrel","ams"),j("\\supsetneq","⊋","mrel","ams"),j("\\varsupsetneq","","mrel","ams"),j("\\supsetneqq","⫌","mrel","ams"),j("\\varsupsetneqq","","mrel","ams"),j("\\nVdash","⊮","mrel","ams"),j("\\precneqq","⪵","mrel","ams"),j("\\succneqq","⪶","mrel","ams"),j("\\nsubseteqq","","mrel","ams"),j("\\checkmark","✓","mord","ams"),j("\\diagup","╱","mord","ams"),j("\\diagdown","╲","mord","ams"),j("\\measuredangle","∡","mord","ams"),j("\\sphericalangle","∢","mord","ams"),j("\\backprime","‵","mord","ams"),j("\\backdoubleprime","‶","mord","ams"),j("\\ast","∗","mbin"),j("\\star","⋆","mbin"),j("\\diamond","⋄","mbin"),j("\\Diamond","◊","mord","ams"),j("\\lozenge","◊","mord","ams"),j("\\blacklozenge","⧫","mord","ams"),j("\\bigstar","★","mord","ams"),j("\\aleph","ℵ"),j("\\beth","ℶ","mord","ams"),j("\\daleth","ℸ","mord","ams"),j("\\gimel","ℷ","mord","ams"),j("\\lbrace","{","mopen"),j("\\rbrace","}","mclose"),j("\\langle","⟨","mopen"),j("\\rangle","⟩","mclose"),j("\\lfloor","⌊","mopen"),j("\\rfloor","⌋","mclose"),j("\\lceil","⌈","mopen"),j("\\rceil","⌉","mclose"),j("\\vert","∣"),j("\\mvert","∣","mrel"),j("\\lvert","∣","mopen"),j("\\rvert","∣","mclose"),j("\\|","∥"),j("\\Vert","∥"),j("\\mVert","∥"),j("\\lVert","∥","mopen"),j("\\rVert","∥","mclose"),j("\\parallel","∥","mrel"),j("\\shortparallel","∥","mrel","ams"),j("\\lbrack","[","mopen"),j("\\rbrack","]","mclose"),j("\\{","{","mopen"),j("\\}","}","mclose"),j("(","(","mopen"),j(")",")","mclose"),j("[","[","mopen"),j("]","]","mclose"),j("\\ulcorner","┌","mopen","ams"),j("\\urcorner","┐","mclose","ams"),j("\\llcorner","└","mopen","ams"),j("\\lrcorner","┘","mclose","ams"),j("\\lgroup","⟮","mopen"),j("\\rgroup","⟯","mclose"),j("\\lmoustache","⎰","mopen"),j("\\rmoustache","⎱","mclose"),j("=","=","mrel"),j("\\ne","≠","mrel"),j("\\neq","≠","mrel"),j("<","<","mrel"),j("\\lt","<","mrel"),j(">",">","mrel"),j("\\gt",">","mrel"),j("\\le","≤","mrel"),j("\\leq","≤","mrel"),j("\\ge","≥","mrel"),j("\\geq","≥","mrel"),j("\\leqslant","⩽","mrel","ams"),j("\\geqslant","⩾","mrel","ams"),j("\\ll","≪","mrel"),j("\\gg","≫","mrel"),j("\\coloneq","≔","mrel"),j("\\measeq","≝","mrel"),j("\\eqdef","≞","mrel"),j("\\questeq","≟","mrel"),j(":",":","mrel"),j("\\cong","≅","mrel"),j("\\equiv","≡","mrel"),j("\\prec","≺","mrel"),j("\\preceq","⪯","mrel"),j("\\succ","≻","mrel"),j("\\succeq","⪰","mrel"),j("\\perp","⊥","mrel"),j("\\propto","∝","mrel"),j("\\Colon","∷","mrel"),j("\\smile","⌣","mrel"),j("\\frown","⌢","mrel"),j("\\sim","∼","mrel"),j("\\gtrsim","≳","mrel","ams"),j("\\approx","≈","mrel"),j("\\approxeq","≊","mrel","ams"),j("\\thickapprox","≈","mrel","ams"),j("\\lessapprox","⪅","mrel","ams"),j("\\gtrapprox","⪆","mrel","ams"),j("\\precapprox","⪷","mrel","ams"),j("\\succapprox","⪸","mrel","ams"),j("\\thicksim","∼","mrel","ams"),j("\\succsim","≿","mrel","ams"),j("\\precsim","≾","mrel","ams"),j("\\backsim","∽","mrel","ams"),j("\\eqsim","≂","mrel","ams"),j("\\backsimeq","⋍","mrel","ams"),j("\\simeq","≃","mrel"),j("\\lesssim","≲","mrel","ams"),j("\\nleq","≰","mrel","ams"),j("\\ngeq","≱","mrel","ams"),j("\\smallsmile","⌣","mrel","ams"),j("\\smallfrown","⌢","mrel","ams"),j("\\bowtie","⋈","mrel"),j("\\Join","⋈","mrel"),j("\\asymp","≍","mrel"),j("\\sqsubseteq","⊑","mrel"),j("\\sqsupseteq","⊒","mrel"),j("\\leqq","≦","mrel","ams"),j("\\eqslantless","⪕","mrel","ams"),j("\\lll","⋘","mrel","ams"),j("\\lessgtr","≶","mrel","ams"),j("\\lesseqgtr","⋚","mrel","ams"),j("\\lesseqqgtr","⪋","mrel","ams"),j("\\risingdotseq","≓","mrel","ams"),j("\\fallingdotseq","≒","mrel","ams"),j("\\subseteqq","⫅","mrel","ams"),j("\\Subset","⋐","mrel","ams"),j("\\sqsubset","⊏","mrel","ams"),j("\\preccurlyeq","≼","mrel","ams"),j("\\curlyeqprec","⋞","mrel","ams"),j("\\vDash","⊨","mrel","ams"),j("\\Vvdash","⊪","mrel","ams"),j("\\bumpeq","≏","mrel","ams"),j("\\Bumpeq","≎","mrel","ams"),j("\\geqq","≧","mrel","ams"),j("\\eqslantgtr","⪖","mrel","ams"),j("\\ggg","⋙","mrel","ams"),j("\\gtrless","≷","mrel","ams"),j("\\gtreqless","⋛","mrel","ams"),j("\\gtreqqless","⪌","mrel","ams"),j("\\supseteqq","⫆","mrel","ams"),j("\\Supset","⋑","mrel","ams"),j("\\sqsupset","⊐","mrel","ams"),j("\\succcurlyeq","≽","mrel","ams"),j("\\curlyeqsucc","⋟","mrel","ams"),j("\\Vdash","⊩","mrel","ams"),j("\\shortmid","∣","mrel","ams"),j("\\between","≬","mrel","ams"),j("\\pitchfork","⋔","mrel","ams"),j("\\varpropto","∝","mrel","ams"),j("\\backepsilon","∍","mrel","ams"),j("\\llless","⋘","mrel","ams"),j("\\gggtr","⋙","mrel","ams"),j("\\lhd","⊲","mbin","ams"),j("\\rhd","⊳","mbin","ams"),j("\\doteq","≐","mrel"),j("\\doteqdot","≑","mrel","ams"),j("\\Doteq","≑","mrel","ams"),j("\\eqcirc","≖","mrel","ams"),j("\\circeq","≗","mrel","ams"),j("\\lessdot","⋖","mbin","ams"),j("\\gtrdot","⋗","mbin","ams"),j("\\~","~","mrel"),j("\\leftrightarrow","↔","mrel"),j("\\Leftrightarrow","⇔","mrel"),j("\\models","⊨","mrel"),j("\\vdash","⊢","mrel"),j("\\therefore","∴","mrel","ams"),j("\\because","∵","mrel","ams"),j("\\dashv","⊣","mrel"),j("\\roundimplies","⥰","mrel"),j("+","+","mbin"),j("-","−","mbin"),j("−","−","mbin"),j("\\pm","±","mbin"),j("\\mp","∓","mbin"),j("*","∗","mbin"),j("\\times","×","mbin"),j("\\div","÷","mbin"),j("\\surd","√"),j("\\divides","∣","mbin"),j("\\ltimes","⋉","mbin","ams"),j("\\rtimes","⋊","mbin","ams"),j("\\leftthreetimes","⋋","mbin","ams"),j("\\rightthreetimes","⋌","mbin","ams"),j("\\intercal","⊺","mbin","ams"),j("\\dotplus","∔","mbin","ams"),j("\\doublebarwedge","⩞","mbin","ams"),j("\\divideontimes","⋇","mbin","ams"),j("\\centerdot","⋅","mbin","ams"),j("\\cdot","⋅","mbin"),j("\\infty","∞"),j("\\prime","′"),j("\\doubleprime","″"),j("\\angle","∠"),j("`","‘"),j("\\$","$"),j("\\%","%"),j("\\_","_"),j("\\alpha","α"),j("\\beta","β"),j("\\gamma","γ"),j("\\delta","δ"),j("\\epsilon","ϵ"),j("\\varepsilon","ε"),j("\\zeta","ζ"),j("\\eta","η"),j("\\theta","θ"),j("\\vartheta","ϑ"),j("\\iota","ι"),j("\\kappa","κ"),j("\\varkappa","ϰ","mord","ams"),j("\\lambda","λ"),j("\\mu","μ"),j("\\nu","ν"),j("\\xi","ξ"),j("\\omicron","o"),j("\\pi","π"),j("\\varpi","ϖ"),j("\\rho","ρ"),j("\\varrho","ϱ"),j("\\sigma","σ"),j("\\varsigma","ς"),j("\\tau","τ"),j("\\phi","ϕ"),j("\\varphi","φ"),j("\\upsilon","υ"),j("\\chi","χ"),j("\\psi","ψ"),j("\\omega","ω"),j("\\Gamma","Γ"),j("\\Delta","Δ"),j("\\Theta","Θ"),j("\\Lambda","Λ"),j("\\Xi","Ξ"),j("\\Pi","Π"),j("\\Sigma","Σ"),j("\\Upsilon","Υ"),j("\\Phi","Φ"),j("\\Psi","Ψ"),j("\\Omega","Ω"),j("\\digamma","ϝ","mord","ams"),j("\\emptyset","∅"),j("\\varnothing","∅","mord","ams"),j("\\cap","∩","mbin"),j("\\cup","∪","mbin"),j("\\setminus","∖","mbin"),j("\\smallsetminus","∖","mbin","ams"),j("\\complement","∁","mord","ams"),j("\\in","∈","mrel"),j("\\notin","∉","mrel"),j("\\not","̸","mrel"),j("\\ni","∋","mrel"),j("\\owns","∋","mrel"),j("\\subset","⊂","mrel"),j("\\supset","⊃","mrel"),j("\\subseteq","⊆","mrel"),j("\\supseteq","⊇","mrel"),j("\\subsetneq","⊊","mrel","ams"),j("\\varsubsetneq","","mrel","ams"),j("\\subsetneqq","⫋","mrel","ams"),j("\\varsubsetneqq","","mrel","ams"),j("\\nsubset","⊄","mrel","ams"),j("\\nsupset","⊅","mrel","ams"),j("\\nsubseteq","⊈","mrel","ams"),j("\\nsupseteq","⊉","mrel","ams"),j("\\ "," ","spacing"),j("~"," ","spacing"),j("\\space"," ","spacing"),j("\\!",null,"spacing"),j("\\,",null,"spacing"),j("\\:",null,"spacing"),j("\\;",null,"spacing"),j("\\enskip",null,"spacing"),j("\\enspace",null,"spacing"),j("\\quad",null,"spacing"),j("\\qquad",null,"spacing"),j("\\colon",":","mpunct"),j("\\cdotp","⋅","mpunct"),j("\\cdots","⋯","minner"),j("\\ddots","⋱","minner"),j("\\ldots","…","minner"),j("\\mathellipsis","…","minner"),j("\\vdots","⋮"),j("\\ldotp",".","mpunct"),j(",",",","mpunct"),j(";",";","mpunct"),j("\\land","∧","mbin"),j("\\wedge","∧","mbin"),j("\\lor","∨","mbin"),j("\\vee","∨","mbin"),j("\\lnot","¬"),j("\\neg","¬"),j("\\barwedge","⊼","mbin","ams"),j("\\veebar","⊻","mbin","ams"),j("\\nor","⊻","mbin","ams"),j("\\curlywedge","⋏","mbin","ams"),j("\\curlyvee","⋎","mbin","ams"),j("\\square","□","mord","ams"),j("\\Box","□","mord","ams"),j("\\blacksquare","■","mord","ams"),j("\\boxminus","⊟","mbin","ams"),j("\\boxplus","⊞","mbin","ams"),j("\\boxtimes","⊠","mbin","ams"),j("\\boxdot","⊡","mbin","ams"),j("\\circ","∘","mbin"),j("\\bigcirc","◯","mbin"),j("\\bullet","∙","mbin"),j("\\circleddash","⊝","mbin","ams"),j("\\circledast","⊛","mbin","ams"),j("\\oplus","⊕","mbin"),j("\\ominus","⊖","mbin"),j("\\otimes","⊗","mbin"),j("\\odot","⊙","mbin"),j("\\circledcirc","⊚","mbin","ams"),j("\\oslash","⊘","mbin"),j("\\circledS","Ⓢ","mord","ams"),j("\\circledR","®","mord","ams"),j("\\triangle","△"),j("\\bigtriangleup","△","mbin"),j("\\vartriangle","△","mrel","ams"),j("\\triangleq","≜","mrel","ams"),j("\\triangledown","▽","mord","ams"),j("\\bigtriangledown","▽","mbin"),j("\\triangleleft","◃","mbin"),j("\\vartriangleleft","⊲","mrel","ams"),j("\\trianglelefteq","⊴","mrel","ams"),j("\\ntriangleleft","⋪","mrel","ams"),j("\\ntrianglelefteq","⋬","mrel","ams"),j("\\triangleright","▹","mbin"),j("\\vartriangleright","⊳","mrel","ams"),j("\\trianglerighteq","⊵","mrel","ams"),j("\\ntriangleright","⋫","mrel","ams"),j("\\ntrianglerighteq","⋭","mrel","ams"),j("\\blacktriangle","▲","mord","ams"),j("\\blacktriangledown","▼","mord","ams"),j("\\blacktriangleleft","◀","mrel","ams"),j("\\blacktriangleright","▶","mrel","ams"),j("\\/","/"),j("|","∣","textord"),j("\\And","&","mbin"),j("\\imath","ı"),j("\\jmath","ȷ"),j("\\degree","°"),j("'","′"),j('"',"”");const Me=["(",")","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd"],Le=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache"],Ce=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Ae=[0,1.2,1.8,2.4,3],$e=[{type:"small",mathstyle:c.scriptscriptstyle},{type:"small",mathstyle:c.scriptstyle},{type:"small",mathstyle:c.textstyle},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],ze=[{type:"small",mathstyle:c.scriptscriptstyle},{type:"small",mathstyle:c.scriptstyle},{type:"small",mathstyle:c.textstyle},{type:"stack"}],_e=[{type:"small",mathstyle:c.scriptscriptstyle},{type:"small",mathstyle:c.scriptstyle},{type:"small",mathstyle:c.textstyle},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function De(e,t,a,i,s,r=""){if(!t||0===t.length||"."===t)return Te(e,s,e);let n;"<"===t||"\\lt"===t?t="\\langle":">"!==t&&"\\gt"!==t||(t="\\rangle"),n=Ce.includes(t)?$e:Me.includes(t)?_e:ze;const l=function(e,t,a,i){for(let r=Math.min(2,3-i.mathstyle.size);rt)return a[r]}var s;return a[a.length-1]}(te("math",t),a,n,s);return"small"===l.type?function(e,t,a,i,s,o=""){const r=T(e,D("Main-Regular",te("math",t)),s.mathstyle,a,o);return i&&r.setTop((1-s.mathstyle.sizeMultiplier/a.sizeMultiplier)*s.mathstyle.metrics.axisHeight),r.setStyle("color",s.color),"number"==typeof s.opacity&&r.setStyle("opacity",s.opacity),r}(e,t,l.mathstyle,i,s,"ML__small-delim "+r):"large"===l.type?ke(e,t,l.size,i,s,r):Se(e,t,a,i,s,r)}function qe(e,t,a,i,s,o=""){if("."===t)return Te(e,s,o);const r=s.mathstyle.metrics.axisHeight*s.mathstyle.sizeMultiplier,n=Math.max(a-r,i+r);return De(e,t,Math.max(n/500*901,2*n-.5),!0,s,o)}function Te(e,t,a){return _("","sizing"+t.mathstyle.adjustTo(c.textstyle)+" nulldelimiter "+(a||""),e)}const Ke={},Ee={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};function Fe(e,t){Ke[e]={decompose:t}}function Ne(t,a){var i,s;function o(e){return"mord"===e.type&&!!e.symbol&&/^[0-9,.]$/.test(e.symbol)}function r(e){return"text"===e.mode}const n=t instanceof d?t:new d(t),l=!n.atomIdsSettings||!n.atomIdsSettings.groupNumbers;let c=[];if(e(a)){if(0===a.length)return[];if(1===a.length)c=a[0].decompose(n),c&&l&&a[0].isSelected&&c.forEach(e=>e.selected(!0));else{let e="none",t=a[1].type,d=[],m="",p=!0,h=null;for(let u=0;ue.selected(!0))):(d.length>0&&(c=[...c,...d],d=[]),c=c.concat(e))}e=a[u].getFinalBaseElement().type,t=a[u+1]?a[u+1].getInitialBaseElement().type:"none"}d.length>0&&(c=[...c,...d],d=[])}}else a&&(c=a.decompose(n),c&&l&&a.isSelected&&c.forEach(e=>e.selected(!0)));if(!c||0===c.length)return null;if(n.mathstyle!==n.parentMathstyle){const e=n.mathstyle.sizeMultiplier/n.parentMathstyle.sizeMultiplier;for(const t of c)t.height*=e,t.depth*=e}if(n.size!==n.parentSize){const e=Ee[n.size]/Ee[n.parentSize];for(const t of c)t.height*=e,t.depth*=e}return c}class Be{constructor(e,t,a="",i={}){this.mode=e,this.type=t,this.body=a,this.applyStyle(i)}toLatex(t=!1){return function(t,a){if(!(a=void 0!==a&&a)&&t.latex)return t.latex;let i="",s=0,o=0,r=0;const n=t.symbol,l=(t,i)=>function(t,a,i){let s="";return e(a)?s=function(e,t,a){if(0===t.length)return"";if("first"===t[0].type){if(1===t.length)return"";t=t.slice(1)}return 0===t.length?"":u(f(t,"cssClass").map(t=>{const i=u(f(t,"color").map(t=>u(function(e){const t=[];let a=[],i="NONE";return e.forEach(e=>{"first"!==e.type&&(e.mode!==i?(a.length>0&&t.push(a),a=[e],i=e.mode):a.push(e))}),a.length>0&&t.push(a),t}(t).map(t=>function(e,t,a){return g[t[0].mode]&&g[t[0].mode].emitLatexRun?g[t[0].mode].emitLatexRun(e,t,a):""}(e,t,a)))));return!t[0].cssClass||e&&e.cssClass===t[0].cssClass?i:"ML__boldsymbol"===t[0].cssClass?"\\boldsymbol{"+i+"}":"ML__emph"===t[0].cssClass?"\\emph{"+i+"}":"\\class{"+t[0].cssClass+"}{"+i+"}"}))}(t,a,i):"number"==typeof a||"boolean"==typeof a?s=a.toString():"string"==typeof a?s=a.replace(/\s/g,"~"):a&&"function"==typeof a.toLatex&&(s=a.toLatex(i)),s}(t,i,a);switch(t.type){case"group":n?i=a?l(t,t.body):t.latex:(i=t.latexOpen||(t.cssId||t.cssClass?"":"{"),t.cssId&&(i+="\\cssId{"+t.cssId+"}{"),"ML__emph"===t.cssClass?i+="\\emph{"+l(t,t.body):(t.cssClass&&(i+="\\class{"+t.cssClass+"}{"),i+=l(t,t.body),t.cssClass&&(i+="}")),t.cssId&&(i+="}"),i+=t.latexClose||(t.cssId||t.cssClass?"":"}"));break;case"array":if(i+="\\begin{"+t.environmentName+"}","array"===t.environmentName){if(i+="{",t.colFormat)for(r=0;r0&&(i+=" & "),i+=l(t,t.array[o][s]);o1&&(i+=" "),i+=l(t,t.body),i+="\\right"+(t.rightDelim||"."),t.rightDelim&&t.rightDelim.length>1&&(i+=" ")):a?(i+="."===t.leftDelim?"":t.leftDelim,i+=l(t,t.body),i+="."===t.rightDelim?"":t.rightDelim):(i+="\\mleft"+(t.leftDelim||"."),t.leftDelim&&t.leftDelim.length>1&&(i+=" "),i+=l(t,t.body),i+="\\mright"+(t.rightDelim||"."),t.rightDelim&&t.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+t.delim+"}";break;case"rule":i+=n,t.shift&&(i+=`[${l(t,t.shift)}em]`),i+=`{${l(t,t.width)}em}{${l(t,t.height)}em}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":i+='\\char"'===n?t.latex:ae(n,null,t,l);break;case"mop":"​"!==t.body&&("\\mathop"===n||"\\operatorname"===n?i+=n+"{"+l(t,t.body)+"}":(i+=n,/^\\.*[a-zA-Z0-9]$/.test(n)&&(i+=" "))),t.explicitLimits&&("limits"===t.limits&&(i+="\\limits "),"nolimits"===t.limits&&(i+="\\nolimits "));break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",t.width?i+=t.width+"em":i+="0em",i+="}"):(i+=" ",t.width&&(i+=t.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{"+Object.keys(t.notation).join(" ")+"}";let e="",a="";t.backgroundColor&&"transparent"!==t.backgroundColor&&(e+=a+'mathbackground="'+ve(t.backgroundColor)+'"',a=","),t.shadow&&"auto"!==t.shadow&&(e+=a+'shadow="'+t.shadow+'"',a=","),1!==t.strokeWidth||"solid"!==t.strokeStyle?(e+=a+t.borderStyle,a=","):t.strokeColor&&"currentColor"!==t.strokeColor&&(e+=a+'mathcolor="'+ve(t.strokeColor)+'"',a=","),e&&(i+=`[${e}]`)}i+=`{${l(t,t.body)}}`;break;case"mathstyle":i+="\\"+t.mathstyle;break;case"space":i+=t.symbol;break;case"placeholder":i+="\\placeholder{}";break;case"first":case"command":case"msubsup":break;case"error":i+=t.latex;break;case"":break;default:i=ae(n,parent,t,l),i||(i+=n)}if(t.superscript){let e=l(t,t.superscript);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(t.subscript){const e=l(t,t.subscript);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i}(this,t)}getStyle(){return{mode:this.mode,color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,variant:this.variant,variantStyle:this.variantStyle,fontFamily:this.fontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(e){Object.assign(this,e),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Ee[this.fontSize]),"text"===this.mode&&"root"!==this.type&&(this.type="")}getInitialBaseElement(){let t;return e(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t||this}getFinalBaseElement(){return e(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const e=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(e.type)}forEach(t){if(t(this),e(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const a of e)for(const e of a)e.forEach(t)}filter(t){let a=[];t(this)&&a.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(e(this[i]))for(const e of this[i])e&&(a=a.concat(e.filter(t)));if(e(this.array))for(const e of this.array)for(const i of e)i&&(a=a.concat(i.filter(t)));return a}decomposeGroup(e){const t=_(Ne(e.clone({mathstyle:this.mathstyle?c[this.mathstyle]:void 0}),this.body),"","mord");return this.cssId&&(t.cssId=this.cssId),t.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),t}decomposeOverlap(e){const t=_(Ne(e,this.body),"inner");return _([t,_(null,"fix")],"left"===this.align?"llap":"rlap","mord")}decomposeRule(e){const t=e.mathstyle,a=_("","rule","mord");let i=this.shift&&!isNaN(this.shift)?this.shift:0;i/=t.sizeMultiplier;const s=this.width/t.sizeMultiplier,o=this.height/t.sizeMultiplier;return a.setStyle("border-right-width",s,"em"),a.setStyle("border-top-width",o,"em"),a.setStyle("margin-top",-(o-i),"em"),a.setStyle("border-color",e.color),a.width=s,a.height=o+i,a.depth=-i,a}decompose(t,a=null){let i=null;if(!this.type||/mord|minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(this.type)?(i="string"==typeof this.body?this.makeSpan(t,this.body):this.makeSpan(t,Ne(t,this.body)),i.type=v(this.type)?this.type:""):"group"===this.type||"root"===this.type?i=this.decomposeGroup(t):"delim"===this.type?(i=_(null,""),i.delim=this.delim):"sizeddelim"===this.type?i=this.bind(t,function(e,t,a,i,s=""){return"."===t?Te(e,i,s):("<"===t||"\\lt"===t?t="\\langle":">"!==t&&"\\gt"!==t||(t="\\rangle"),Me.includes(t)||Ce.includes(t)?ke(e,t,a,!1,i,s):Le.includes(t)?Se(e,t,Ae[a],!1,i,s):null)}(this.cls,this.delim,this.size,t)):"overlap"===this.type?i=this.decomposeOverlap(t):"rule"===this.type?i=this.decomposeRule(t):"msubsup"===this.type?(i=_("​","","mord"),a&&(i.height=a[0].height,i.depth=a[0].depth)):"space"===this.type?i=this.makeSpan(t," "):"spacing"===this.type?"​"===this.body?i=this.makeSpan(t,"​"):" "===this.body?i="math"===this.mode?this.makeSpan(t," "):this.makeSpan(t," "):this.width?(i=_("​","mspace "),this.width>0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em")):i=_("​","mspace "+({qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad")):"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):i="placeholder"===this.type?this.makeSpan(t,"⬚"):"first"===this.type?this.makeSpan(t,"​"):Ke[this.type].decompose(t,this),!i)return null;if(this.caret&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(e(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),this.containsCaret&&(e(i)?(i[0].classes=(i[0].classes||"")+" ML__contains-caret",i[i.length-1].classes=(i[i.length-1].classes||"")+" ML__contains-caret"):i.classes=(i.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(e(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return e(i)?i:[i]}attachSupsub(e,t,a){if(!this.superscript&&!this.subscript)return t;const i=e.mathstyle;let s=null,o=null;this.superscript&&(s=_(Ne(e.sup(),this.superscript),i.adjustTo(i.sup()))),this.subscript&&(o=_(Ne(e.sub(),this.subscript),i.adjustTo(i.sub())));let r,n=0,l=0;this.isCharacterBox()||(n=A(t)-i.metrics.supDrop,l=$(t)+i.metrics.subDrop),r=i===c.displaystyle?i.metrics.sup1:i.cramped?i.metrics.sup3:i.metrics.sup2;const d=.05/(c.textstyle.sizeMultiplier*i.sizeMultiplier);let m=null;if(o&&s){n=Math.max(n,r,s.depth+.25*i.metrics.xHeight),l=Math.max(l,i.metrics.sub2);const a=.04;if(n-$(s)-(A(o)-l)<4*a){l=4*a-(n-s.depth)+A(o);const e=.8*i.metrics.xHeight-(n-$(s));e>0&&(n+=e,l-=e)}m=E(e,[o,l,s,-n],"individualShift"),this.isSymbol&&m.children[0].setLeft(-z(t))}else o&&!s?(l=Math.max(l,i.metrics.sub1,A(o)-.8*i.metrics.xHeight),m=E(e,[o],"shift",l),m.children[0].setRight(d),this.isCharacterBox()&&m.children[0].setLeft(-z(t))):!o&&s&&(n=Math.max(n,r,s.depth+.25*i.metrics.xHeight),m=E(e,[s],"shift",-n),m.children[0].setRight(d));const p=_(m,"msubsup");return this.caret&&(p.caret=this.caret,this.caret=""),_([t,p],"",a)}attachLimits(e,t,a,i){const s=this.superscript?_(Ne(e.sup(),this.superscript),e.mathstyle.adjustTo(e.mathstyle.sup())):null,o=this.subscript?_(Ne(e.sub(),this.subscript),e.mathstyle.adjustTo(e.mathstyle.sub())):null;return function(e,t,a,i,s,o){if(!s&&!o)return t;t=_(t);let r=0,n=0;s&&(r=Math.max(.111,.2-$(s))),o&&(n=Math.max(.166,.6-A(o)));let l=null;return o&&s?(l=E(e,[.1,o,n,t,r,s,.1],"bottom",.1+A(o)+$(o)+n+$(t)+a),l.children[0].setLeft(-i),l.children[2].setLeft(i)):o&&!s?(l=E(e,[.1,o,n,t],"top",A(t)-a),l.children[0].setLeft(-i)):!o&&s&&(l=E(e,[t,r,s,.1],"bottom",$(t)+a),l.children[1].setLeft(i)),_(l,"op-limits","mop")}(e,t,a,i,s,o)}bind(e,t){return"first"!==this.type&&"​"!==this.body&&(this.id=function(e){let t;return e.atomIdsSettings&&("number"==typeof e.atomIdsSettings.seed?(t=e.atomIdsSettings.overrideID?e.atomIdsSettings.overrideID:e.atomIdsSettings.seed.toString(36),e.atomIdsSettings.seed+=1):t=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36)),t}(e),this.id&&(t.attributes||(t.attributes={}),t.attributes["data-atom-id"]=this.id)),t}makeSpan(e,t){const a=_(t,"","textord"===this.type?"mord":v(this.type)?this.type:""),i=this.getStyle();i.letterShapeStyle=e.letterShapeStyle,a.applyStyle(i);const s=(null==i?void 0:i.fontSize)?i.fontSize:"size5";return s!==e.parentSize?(a.classes+=" sizing reset-"+e.parentSize,a.classes+=" "+s):e.parentSize!==e.size&&(a.classes+=" sizing reset-"+e.parentSize,a.classes+=" "+e.size),a.maxFontSize=Math.max(a.maxFontSize,e.mathstyle.sizeMultiplier||1),"text"===this.mode&&(a.classes+=" ML__text"),e.mathstyle.isTight()&&(a.isTight=!0),"math"!==this.mode&&(a.italic=0),a.setRight(a.italic),"number"==typeof e.opacity&&a.setStyle("opacity",e.opacity),this.bind(e,a),this.caret&&(this.superscript||this.subscript||(a.caret=this.caret,this.caret="",e.mathstyle.isTight()&&(a.isTight=!0))),a}}function Oe(t,a=[]){const i=new Be(t,"root",a||[]);return!e(i.body)||0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new Be("","first")),i}function Re(t){return e(t)}const Pe=[[8205,1],[65038,2],[127995,5],[129456,4],[917536,96]];let Ie;const He=[127462,127487];function We(e){var t;return Ie||(Ie={},Pe.forEach(e=>{for(let t=e[0];t<=e[0]+e[1]-1;t++)Ie[t]=!0})),null!==(t=Ie[e])&&void 0!==t&&t}function Ve(e){return e>=He[0]&&e<=He[1]}function Ue(e){if(/^[\x20-\xFF]*$/.test(e))return e;const t=[],a=function(e){const t=[];for(let a=0;a=55296&&i<=56319){const t=e.charCodeAt(a+1);if(t>=56320&&t<=57343){const e=i-55296,s=t-56320;i=Math.pow(2,16)+e*Math.pow(2,10)+s,a++}}t.push(i)}return t}(e);let i=0;for(;i=this.s.length}get(){return this.pos="0"&&a<="9"?parseInt(a):"?"):e=new je("literal","#")}}else"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),e=new je("$$")):e=new je("$")):e=new je("literal",this.get());return e}}function Ze(e){const t=_("​","arraycolsep");return t.setWidth(e),t}function Xe(e,t,a,i){const s=[];for(const o of t){const t=_(Ne(e,i));t.depth=o.depth,t.height=o.height,s.push(t),s.push(o.pos-a)}return E(e,s,"individualShift")}Fe("genfrac",(e,t)=>{const a="auto"===t.mathstyle?e.mathstyle:c[t.mathstyle],i=e.clone({mathstyle:a});let s=[];t.numerPrefix&&s.push(_(t.numerPrefix,"mord"));const o=t.continuousFraction?a:a.fracNum();s=s.concat(Ne(i.clone({mathstyle:o}),t.numer));const r=K(s,e.mathstyle.adjustTo(o));let n=[];t.denomPrefix&&n.push(_(t.denomPrefix,"mord"));const l=t.continuousFraction?a:a.fracDen();n=n.concat(Ne(i.clone({mathstyle:l}),t.denom));const d=K(n,e.mathstyle.adjustTo(l)),m=t.hasBarLine?.04/a.sizeMultiplier:0;let p,h,u=0;a.size===c.displaystyle.size?(p=a.metrics.num1,u=m>0?3*m:.28,h=a.metrics.denom1):(m>0?(p=a.metrics.num2,u=m):(p=a.metrics.num3,u=.12),h=a.metrics.denom2);const f=r?$(r):0,g=d?A(d):0;let y;if(0===m){const e=p-f-(g-h);e{let a=t.colFormat;a&&0===a.length&&(a=[{align:"l"}]),a||(a=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const e of a)e.align&&s++;for(const e of t.array){let t=0;for(;t0&&(l+=m,r0&&y.push(E(e,a,"individualShift"))}const b=[];let v=!1,x=!1,k=0,w=!t.lFence;for(const t of a){if(t.align&&k>=y.length)break;if(t.align&&k{const i=a.svgBody?F(a.svgBody):Ne(t,a.body),s=t.clone({mathstyle:c.scriptstyle});let o,r;a.svgAbove?o=F(a.svgAbove):a.overscript&&(o=_(Ne(s,a.overscript),t.mathstyle.adjustTo(s.mathstyle))),a.svgBelow?r=F(a.svgBelow):a.underscript&&(r=_(Ne(s,a.underscript),t.mathstyle.adjustTo(s.mathstyle))),o&&r&&(r.setLeft(.3),r.setRight(.3),o.setLeft(.3),o.setRight(.3));let n=function(t,a,i,s,o){if(!i&&!s)return e(a)?_(a):a;let r=0,n=0;i&&(r=Math.max(.111,.2-$(i))),s&&(n=Math.max(.166,.6-A(s)));let l=null;if(s&&i){const e=A(s)+$(s)+$(a);l=E(t,[0,s,.2+$(a),a,-r,i,.166],"bottom",e)}else s&&!i?l=E(t,[0,s,n,a],"top",A(a)):i&&!s&&(l=E(t,[a,Math.max(.166,r-$(i)),i,0],"bottom",$(a)));return _(l,"op-over-under",o)}(t,i,o,r,v(a.type)?a.type:"mord");return(a.superscript||a.subscript)&&(n=a.attachLimits(t,n,0,0)),[n]}),Fe("accent",(t,a)=>{const i=t.mathstyle;let s=Ne(t.cramp(),a.body);(a.superscript||a.subscript)&&(s=[a.attachSupsub(t,_(s,"","mord"),"mord")]);let o=0;e(a.body)&&1===a.body.length&&a.body[0].isCharacterBox()&&(o=function(t){if(!t)return 0;if(e(t)){let e=0;for(const a of t)e+=a.skew||0;return e}return t.skew}(s));let r,n=Math.min(A(s),i.metrics.xHeight);if(a.svgAccent)r=F(a.svgAccent),n=.111-n;else{const e=D("Main-Regular",a.accent,"math");e.italic=0;const t="⃗"===a.accent?" accent-vec":"";r=_(_(e),"accent-body"+t)}return r=E(t,[s,-n,r]),r.children[1].setLeft(2*o),[_([r],"accent","mord")]}),Fe("enclose",(e,t)=>{const a=_(Ne(e,t.body),"","mord"),i="number"==typeof t.padding?t.padding:.3,s=_("","ML__notation");s.setStyle("position","absolute"),s.setStyle("height",A(a)+$(a)+2*i,"em"),s.height=A(a)+i,s.depth=$(a)+i,0!==i?s.setStyle("width","calc(100% + "+2*i+"em)"):s.setStyle("width","100%"),s.setStyle("top","0"),s.setStyle("left",-i,"em"),s.setStyle("z-index","-1"),t.backgroundcolor&&s.setStyle("background-color",t.backgroundcolor),t.notation.box&&s.setStyle("border",t.borderStyle),t.notation.actuarial&&(s.setStyle("border-top",t.borderStyle),s.setStyle("border-right",t.borderStyle)),t.notation.madruwb&&(s.setStyle("border-bottom",t.borderStyle),s.setStyle("border-right",t.borderStyle)),t.notation.roundedbox&&(s.setStyle("border-radius",(A(a)+$(a))/2,"em"),s.setStyle("border",t.borderStyle)),t.notation.circle&&(s.setStyle("border-radius","50%"),s.setStyle("border",t.borderStyle)),t.notation.top&&s.setStyle("border-top",t.borderStyle),t.notation.left&&s.setStyle("border-left",t.borderStyle),t.notation.right&&s.setStyle("border-right",t.borderStyle),t.notation.bottom&&s.setStyle("border-bottom",t.borderStyle);let o="";if(t.notation.horizontalstrike&&(o+='{const a="number"==typeof t.padding?t.padding:.3,i=_(Ne(e,t.body),"","mord");i.setStyle("vertical-align",-$(i),"em"),i.setStyle("height",0);const s=_(i,"","mord"),o=_("","ML__box");o.setStyle("position","absolute"),o.setStyle("height",A(s)+$(s)+2*a,"em"),0!==a?o.setStyle("width","calc(100% + "+2*a+"em)"):o.setStyle("width","100%"),o.setStyle("top",-a,"em"),o.setStyle("left",-a,"em"),o.setStyle("z-index","-1"),o.setStyle("box-sizing","border-box"),t.backgroundcolor&&o.setStyle("background-color",t.backgroundcolor),t.framecolor&&o.setStyle("border","0.04em solid "+t.framecolor),t.border&&o.setStyle("border",t.border),s.setStyle("display","inline-block"),s.setStyle("height",A(s)+$(s),"em");const r=_([o,s]);return r.setStyle("position","relative"),r.setStyle("vertical-align",-a+$(s),"em"),r.height=A(s)+a,r.depth=$(s)+a,r.setLeft(a),r.setRight(a),r.setStyle("height",r.height+r.depth-2*a,"em"),r.setStyle("top",-a,"em"),r.setStyle("display","inline-block"),[r]}),Fe("mop",(t,a)=>{var i;const s=t.mathstyle;let o,r=0,n=0;if(a.isSymbol){const e=s.size===c.displaystyle.size&&"\\smallint"!==a.symbol;o=D(e?"Size2-Regular":"Size1-Regular",a.body,"op-symbol "+(e?"large-op":"small-op"),"mop"),r=(o.height-o.depth)/2-s.metrics.axisHeight*s.sizeMultiplier,n=o.italic,o.applyStyle({color:a.phantom?"transparent":a.color,backgroundColor:a.phantom?"transparent":a.backgroundColor,cssId:a.cssId,cssClass:a.cssClass,letterShapeStyle:t.letterShapeStyle})}else o=e(a.body)?_(Ne(t,a.body),"","mop"):a.makeSpan(t,a.body);a.bind(t,o),a.isSymbol&&o.setTop(r);let l=o;if(a.superscript||a.subscript){const e=null!==(i=a.limits)&&void 0!==i?i:"auto";l="limits"===e||"auto"===e&&s.size===c.displaystyle.size?a.attachLimits(t,o,r,n):a.attachSupsub(t,o,"mop")}return[l]}),Fe("line",(e,t)=>{const a=e.mathstyle,i=Ne(e.cramp(),t.body),s=.04/a.sizeMultiplier,o=_(null,e.mathstyle.adjustTo(c.textstyle)+" "+t.position+"-line");let r;if(o.height=s,o.maxFontSize=1,"overline"===t.position)r=E(e,[i,3*s,o,s]);else{const t=_(i);r=E(e,[s,o,3*s,t],"top",A(t))}return[_(r,t.position,"mord")]}),Fe("leftright",(e,t)=>{if(!t.body)return t.leftDelim?new Be("math","mopen",t.leftDelim).decompose(e):t.rightDelim?new Be("math","mclose",t.rightDelim).decompose(e):null;const a=e.clone(),i=Ne(a,t.body),s=a.mathstyle;let o=0,r=0,n=[];if(o=A(i)*s.sizeMultiplier,r=$(i)*s.sizeMultiplier,t.leftDelim&&(n.push(t.bind(e,qe("mopen",t.leftDelim,o,r,a,"ML__open"))),n[n.length-1].applyStyle(t.getStyle())),i){for(let s=0;s{const a=e.mathstyle,i=Ne(e.cramp(),t.body),s=.04/a.sizeMultiplier;let o=s;a.idA(i)+$(i)+r&&(r=(r+l-(A(i)+$(i)))/2),n.setTop(n.height-A(i)-(r+s));const d=_(null,e.mathstyle.adjustTo(c.textstyle)+" sqrt-line");d.applyStyle(t.getStyle()),d.height=s;const m=E(e,[i,r,d,s]);if(!t.index)return[t.bind(e,_([n,m],"sqrt","mord"))];const p=e.clone({mathstyle:c.scriptscriptstyle}),h=E(e,[_(Ne(p,t.index),a.adjustTo(c.scriptscriptstyle))],"shift",-.6*(Math.max(n.height,m.height)-Math.max(n.depth,m.depth)));return[t.bind(e,_([_(h,"root"),n,m],"sqrt","mord"))]});const Ye={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML_bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},Je={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[0-9A-Z ]$/,fraktur:/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/,monospace:/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9]$/,"sans-serif":/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9]$/},Qe=/^[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5]$/,et=[/^[a-z]$/,/^[A-Z]$/,Qe,/^[\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9]$/],tt={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]};y("math",{emitLatexRun:function(e,t,a){let i=e.variant;return e.variantStyle&&"up"!==e.variantStyle&&(i+="-"+e.variantStyle),u(f(t,"color").map(t=>{const s=u(f(t,"variant").map(t=>{let s=t[0].variant;if(t[0].variantStyle&&"up"!==t[0].variantStyle&&(s+="-"+t[0].variantStyle),t.every(t=>{const a=se(t.symbol,e.mode,null);if(!a||!a.variant&&!a.variantStyle)return!1;let i=t.variant;return t.variantStyle&&"up"!==t.variantStyle&&(i+="-"+t.variantStyle),i===s}))return u(t.map(e=>e.toLatex(a)));let o="";return s&&s!==i&&(o={calligraphic:"\\mathcal{",fraktur:"\\mathfrak{","double-struck":"\\mathbb{",script:"\\mathscr{",monospace:"\\mathtt{","sans-serif":"\\mathsf{",normal:"\\mathrm{","normal-italic":"\\mathit{","normal-bold":"\\mathbf{","normal-bolditalic":"\\mathbfit{",ams:"","ams-italic":"\\mathit{","ams-bold":"\\mathbf{","ams-bolditalic":"\\mathbfit{",main:"","main-italic":"\\mathit{","main-bold":"\\mathbf{","main-bolditalic":"\\mathbfit{"}[s]),o+u(t.map(e=>e.toLatex(a)))+(o?"}":"")}));return!t[0].color||e&&e.color===t[0].color?s:"\\textcolor{"+ve(t[0].color)+"}{"+s+"}"}))},applyStyle:function(e,t){const a="auto"!==t.letterShapeStyle&&t.letterShapeStyle?t.letterShapeStyle:"tex";let i=t.variant||"normal",s=t.variantStyle||"";"normal"===i&&!s&&/\u00a3|\u0131|\u0237/.test(e.body)&&(i="main",s="italic"),"normal"!==i||s||1!==e.body.length||et.forEach((t,i)=>{t.test(e.body)&&"it"===tt[a][i]&&(s="italic")}),"up"===s&&(s="");const o=s?i+"-"+s:i,[r,n]=Ye[o];return Je[i]&&!Je[i].test(e.body)?(e.body=J(e.body,i,s),e.variant="",e.variantStyle="",null):(Qe.test(e.body)&&(e.classes+=" lcGreek"),n&&(e.classes+=" "+n),r)}});const at={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"};function it(e){let t=!1;const a=e.map(e=>"literal"===e.type?e.value:"{"===e.type?"{":"}"===e.type?"}":"command"===e.type?"\\"+e.value:"placeholder"===e.type?"#?":"#"===e.type?(t=!0,"#"+e.value):"space"===e.type?" ":"$"===e.type?"$":"$$"===e.type?"$$":"").join("");return t?"":a}y("text",{emitLatexRun:function(e,t,a){const i=function(e,t,a){return u(f(t,"color").map(t=>{const a=function(e,t,a){return function(e,t,a){return u(f(t,"fontFamily").map(e=>{const t=function(e,t,a){return u(f(t,"fontSize").map(e=>{const t=function(e,t,a){return u(f(t,"fontSeries").map(e=>{const t=function(e,t,a){return u(f(t,"fontShape").map(e=>{const t=function(e,t,a){let i=!1;return u(t.map(e=>{let t="",a="";return e.latex?t=e.latex:"string"==typeof e.body?t=ee("text",e.body):e.symbol&&(t=e.symbol.replace(/\\/g,"\\backslash ")),!i||t&&!/^[a-zA-Z0-9*]/.test(t)||(a="{}"),i=/\\[a-zA-Z0-9]+\*?$/.test(t),a+t}))}(0,e);return"it"===e[0].fontShape?"\\textit{"+t+"}":"sl"===e[0].fontShape?"\\textsl{"+t+"}":"sc"===e[0].fontShape?"\\textsc{"+t+"}":"n"===e[0].fontShape?"\\textup{"+t+"}":e[0].fontShape?"\\fontshape{"+e[0].fontShape+"}"+t:t}))}(0,e);return"b"===e[0].fontSeries?"\\textbf{"+t+"}":"l"===e[0].fontSeries?"\\textlf{"+t+"}":"m"===e[0].fontSeries?"\\textmd{"+t+"}":e[0].fontSeries?"\\fontseries{"+e[0].fontSeries+"}"+t:t}))}(0,e),a={size1:"tiny",size2:"scriptsize",size3:"footnotesize",size4:"small",size5:"normalsize",size6:"large",size7:"Large",size8:"LARGE",size9:"huge",size10:"Huge"}[e[0].fontSize]||"";return a?"\\"+a+" "+t:t}))}(0,e),a={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[e[0].fontFamily]||"";return a?"\\"+a+"{"+t+"}":e[0].fontFamily?"\\fontfamily{"+e[0].fontFamily+"}"+t:t}))}(0,t)}(0,t);return!t[0].color||"none"===t[0].color||e&&e.color===t[0].color?a:"\\textcolor{"+ve(t[0].color)+"}{"+a+"}"}))}(e,t);return t.every(e=>e.fontSeries||e.fontShape||e.fontFamily)&&t[0].mode===e.mode?i:`\\text{${i}}`},applyStyle:function(e,t){const a=t.fontFamily;if(at[a]?e.classes+=" "+at[a]:a&&e.setStyle("font-family",a),t.fontShape&&(e.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const a=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);a&&(e.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[a[1]||""]||""),e.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[a[2]||""]||""))}return"Main-Regular"},parse:(e,t,a)=>function(e,t,a){var i;let s,o=[];for(;e.length>0;){const r=e.shift();if("space"===r.type)s=new Be("text",""," ",a.style),s.symbol=" ",o.push(s);else if("placeholder"===r.type)s=new Be("text","placeholder",r.value),s.captureSelection=!0,o.push(s);else if("command"===r.type){let t;e.unshift(r),[t,e]=a.parse("text",e,a),o=[...o,...t]}else if("literal"===r.type){const e=se(r.value,"text",a.macros);!e||e.mode&&!e.mode.includes("text")?t({code:"unexpected-token"}):(s=new Be("text",e?e.type:"",e?e.value:r.value,a.style),s.symbol=r.value,s.latex=Z("text",r.value),o.push(s))}else if("$"===r.type||"$$"===r.type){const t=e.slice(0,e.findIndex(e=>e.type===r.type));e=e.slice(t.length+1);const[i]=a.parse("math",t,a);o=[...o,...i]}else"{"===r.type||"}"===r.type||t({code:"unexpected-token",arg:r.type+(null!==(i=r.value)&&void 0!==i?i:"")})}return[o,e]}(e,t,a)[0]});class st{constructor(e,t,a,i){this.index=0,this.mathList=[],this.style={},this.parseMode="math",this.smartFence=!1,this.tabularMode=!1,this.endCount=0,this.tokens=e,this.args=t,this.macros=a,this.onError=e=>i({before:it(this.tokens.slice(this.index,this.index+10)),after:it(this.tokens.slice(Math.max(0,this.index-10),this.index)),...e})}swapMathList(e=[]){const t=this.mathList;return this.mathList=e,t}swapParseMode(e){const t=this.parseMode;return this.parseMode=e,t}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=e.length}const s=e.toUpperCase()===i.toUpperCase();return s||(this.index=t),s}scanString(){let e="",t=this.end();for(;!t;){if(this.hasLiteral("]"))t=!0;else if(this.hasToken("literal"))e+=this.get().value;else if(this.skipWhitespace())e+=" ";else if(this.hasToken("command")){const t=this.get();"space"===t.value?e+=" ":(this.onError({code:"unbalanced-braces"}),e+=t.value)}else t=!0;t=t||this.end()}return e}scanLiteralArg(){let e="";if(this.hasToken("{")){this.get();let t=1;for(;t>0&&!this.end();){const a=this.get();"space"===a.type?e+=" ":"#"===a.type?e+="#"+a.value:"command"===a.type?e+="\\"+a.value:"}"===a.type?(t-=1,t>0&&(e+="}")):"{"===a.type?(t+=1,e+="{"):e+=a.value}}return e}scanColor(){return be(this.scanString())}scanNumber(e=!0){const t=this.parseLiteral("-");t||this.parseLiteral("+"),this.skipWhitespace(),e=!!e;let a=10,i=/[0-9]/;this.parseLiteral("'")?(a=8,i=/[0-7]/,e=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(a=16,i=/[0-9A-F]/,e=!0);let s="";for(;this.hasLiteralPattern(i);)s+=this.get().value;if(!e&&(this.parseLiteral(".")||this.parseLiteral(",")))for(s+=".";this.hasLiteralPattern(i);)s+=this.get().value;const o=e?parseInt(s,a):parseFloat(s);return t?-o:o}scanDimen(){const e=this.scanNumber(!1);let t;return this.skipWhitespace(),this.parseKeyword("pt")?t=r(e,"pt"):this.parseKeyword("mm")?t=r(e,"mm"):this.parseKeyword("cm")?t=r(e,"cm"):this.parseKeyword("ex")?t=r(e,"ex"):this.parseKeyword("px")?t=r(e,"px"):this.parseKeyword("em")?t=r(e,"em"):this.parseKeyword("bp")?t=r(e,"bp"):this.parseKeyword("dd")?t=r(e,"dd"):this.parseKeyword("pc")?t=r(e,"pc"):this.parseKeyword("in")?t=r(e,"in"):this.parseKeyword("mu")?t=r(e,"mu"):(this.onError({code:"missing-unit"}),t=r(e,"pt")),t}scanSkip(){const e=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),e}scanColspec(){this.skipWhitespace();const e=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const t=this.get().value;if("lcr".includes(t))e.push({align:t});else if("|"===t)e.push({rule:!0});else if("@"===t){if(this.parseToken("{")){const t=this.swapParseMode("math");e.push({gap:this.scanImplicitGroup(e=>"}"===e.type)}),this.swapParseMode(t)}this.parseToken("}")}}return e}scanModeSet(){let e;if(this.parseCommand("(")&&(e=")"),!e&&this.parseCommand("[")&&(e="]"),!e)return null;const t=this.swapParseMode("math"),a=new Be("math","group");return a.mathstyle=")"===e?"textstyle":"displaystyle",a.body=this.scanImplicitGroup(t=>"command"===t.type&&t.value===e),this.parseCommand(e),this.swapParseMode(t),a.body&&0!==a.body.length?a:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const e=this.get().type,t=new Be("math","group");t.mathstyle="$"===e?"textstyle":"displaystyle",t.latexOpen="textstyle"===t.mathstyle?"$":"$$",t.latexClose=t.latexOpen;const a=this.swapParseMode("math");return t.body=this.scanImplicitGroup(t=>t.type===e),this.parseToken(e),this.swapParseMode(a),t.body&&0!==t.body.length?t:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const e=this.scanArg("string");if(!e)return null;const t=ie(e);if(!t)return null;const a=[];if(null==t?void 0:t.params)for(const i of t.params)if(i.isOptional)a.push(this.scanOptionalArg(i.type));else{const t=this.scanArg(i.type);t||this.onError({code:"missing-argument",arg:e}),a.push(t)}const i=this.parseMode,s=this.tabularMode,o=this.swapMathList([]);this.tabularMode=t.tabular;const r=[],n=[];let l=[],c=!1;do{if(this.end()&&(this.onError({code:"unbalanced-environment",arg:e}),c=!0),!c&&this.parseCommand("end")&&(this.scanArg("string")!==e&&this.onError({code:"unbalanced-environment",arg:e}),c=!0),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let e=0;this.skipWhitespace(),this.parseLiteral("[")&&(e=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),n.push(e||0),r.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup(e=>"}"===e.type||"literal"===e.type&&"&"===e.value||"command"===e.type&&/^(end|cr|\\)$/.test(e.value)))}while(!c);l.push(this.swapMathList([])),l.length>0&&r.push(l);const d=this.swapMathList(o);if(this.parseMode=i,this.tabularMode=s,!t.tabular&&0===d.length)return null;if(t.tabular&&0===r.length)return null;const m=new Be(this.parseMode,"array",d);return Object.assign(m,t.parser(e,a,r)),m.array=r,m.rowGaps=n,m.environmentName=e,m}scanImplicitGroup(e){const t=this.style;e||(e=e=>"}"===e.type);let a=null,i=null,s=[],o=null;const r=this.swapMathList([]);for(;!this.end()&&!e(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const e=new Be("math","mathstyle");e.mathstyle=this.get().value,this.mathList.push(e)}else this.hasInfixCommand()&&!a?(a=this.get(),i=se("\\"+a.value,"math",this.macros),i&&([,s]=this.parseArguments(i)),o=this.swapMathList([])):this.parseAtom();let n;return a?(s.unshift(this.swapMathList(r)),s.unshift(o),n=[new Be(this.parseMode,i.type,i.value||a.value,i.parse?i.parse("\\"+a.value,s):null)],n[0].symbol="\\"+a.value):n=this.swapMathList(r),this.style=t,n}scanGroup(){if(!this.parseToken("{"))return null;const e=new Be(this.parseMode,"group");return e.body=this.scanImplicitGroup(e=>"}"===e.type),this.parseToken("}"),e.latexOpen="{",e.latexClose="}",e}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const e=new Be(this.parseMode,"leftright");e.leftDelim="(",e.inner=!1;const t=this.swapMathList([]);let a=1;for(;!this.end()&&0!==a;)this.hasLiteral("(")&&(a+=1),this.hasLiteral(")")&&(a-=1),0!==a&&this.parseAtom();return 0===a&&this.parseLiteral(")"),e.rightDelim=0===a?")":"?",e.body=this.swapMathList(t),e}scanDelim(){this.skipWhitespace();const e=this.get();if(!e)return this.onError({code:"unexpected-end-of-string"}),null;let t=".";"command"===e.type?t="\\"+e.value:"literal"===e.type&&(t=e.value);const a=se(t,"math",this.macros);return a?a.mode&&!a.mode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:t}),null):"mopen"===a.type||"mclose"===a.type||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(t)?t:(this.onError({code:"unexpected-delimiter",arg:t}),null):(this.onError({code:"unknown-command",arg:t}),null)}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return this.onError({code:"unbalanced-braces"}),null;const e=this.style;let t="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;t="mright"}const a=this.scanDelim();if(!a)return null;const i=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(t);)this.parseAtom();this.style=e;const s=this.scanDelim(),o=new Be(this.parseMode,"leftright");return o.leftDelim=a,o.rightDelim=s,o.inner="right"===t,o.body=this.swapMathList(i),o}parseSupSub(){var e,t;if("math"!==this.parseMode)return!1;let a=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){const i=this.hasLiteral("_")?"subscript":"superscript";if(this.parseLiteral("^")||this.parseLiteral("_")){const t=this.scanArg();if(t){const s=this.lastSubsupAtom();s[i]=(null!==(e=s[i])&&void 0!==e?e:[]).concat(t),a=!0}}else if(this.parseLiteral("'")){const e=this.lastSubsupAtom(),i=new Be(e.mode,"mord","′");i.symbol="\\prime",e.superscript=null!==(t=e.superscript)&&void 0!==t?t:[],e.superscript.push(i),a=!0}}return a}parseLimits(){if(this.parseCommand("limits")){const e=this.lastSubsupAtom();return e.limits="limits",e.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const e=this.lastSubsupAtom();return e.limits="nolimits",e.explicitLimits=!0,!0}return!1}scanOptionalArg(e){if(e=e&&"auto"!==e?e:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const t=this.parseMode;this.parseMode=e;const a=this.swapMathList();let i;for(;!this.end()&&!this.parseLiteral("]");)if("string"===e)i=this.scanString();else if("number"===e)i=this.scanNumber();else if("dimen"===e)i=this.scanDimen();else if("skip"===e)i=this.scanSkip();else if("colspec"===e)i=this.scanColspec();else if("color"===e)i=this.scanColor()||"#ffffff";else if("bbox"===e){const e=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/),t={};for(const a of e){const e=be(a);if(e)t.backgroundcolor=e;else{const e=a.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(e)t.padding=r(e[1],e[2]);else{const e=a.match(/^\s*border\s*:\s*(.*)/);e&&(t.border=e[1])}}}i=t}else this.mathList=this.mathList.concat(this.scanImplicitGroup(e=>"literal"===e.type&&"]"===e.value));this.parseMode=t;const s=this.swapMathList(a);return i||s}scanArg(e){var t;let a;if(e=e&&"auto"!==e?e:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===e)return this.scanDelim()||".";if(/^(math|text)$/.test(e)){const t=this.parseMode;this.parseMode=e;const a=this.scanToken();return this.parseMode=t,a}}if(this.hasToken("#")){const e=this.get();return this.skipUntilToken("}"),"?"===e.value?this.placeholder():this.args?null===this.args[e.value]||void 0===this.args[e.value]?this.placeholder():"string"==typeof this.args[e.value]?ot(this.args[e.value],this.parseMode,null,this.macros,!1,this.onError):null!==(t=this.args[e.value])&&void 0!==t?t:null:null}const i=this.parseMode;this.parseMode=e;const s=this.swapMathList([]);if("string"===e)a=this.scanString(),this.skipUntilToken("}");else if("number"===e)a=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===e)a=this.scanDimen(),this.skipUntilToken("}");else if("skip"===e)a=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===e)a=this.scanColspec(),this.skipUntilToken("}");else if("color"===e)a=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===e)a=this.scanDelim()||".",this.skipUntilToken("}");else{const t=this.index;let i=1;do{const e=this.get();"}"===(null==e?void 0:e.type)&&(i-=1),"{"===(null==e?void 0:e.type)&&(i+=1)}while(i>0&&!this.end());if(a=function(e,t,a,i){return g[e]&&g[e].parse?g[e].parse(t,a,i):null}(e,this.tokens.slice(t,this.index-1),this.onError,{args:this.args,macros:this.macros,smartFence:this.smartFence,style:this.style,parse:(e,t,i)=>{const s=new st(t,i.args,i.macros,this.onError);return s.parseMode=e,s.style=i.style,a=s.scanImplicitGroup(),[a,t.slice(s.index)]}}),!a){this.index=t;do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end())}}this.parseMode=i;const o=this.swapMathList(s);return a||o}scanToken(){var t;const a=this.get();if(!a)return null;let i=null;if("space"===a.type)"text"===this.parseMode&&(i=new Be("text",""," ",this.style),i.symbol=" ");else if("placeholder"===a.type)i=new Be(this.parseMode,"placeholder",a.value),i.captureSelection=!0;else if("command"===a.type){if("placeholder"===a.value)i=new Be(this.parseMode,"placeholder",this.scanArg("string"),this.style),i.captureSelection=!0;else if("char"===a.value){const e=this.index;let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),i=new Be(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),i.symbol="\\char",i.latex="\\char"+it(this.tokens.slice(e))}else if("hskip"===a.value||"kern"===a.value){const e=this.scanSkip();isFinite(e)&&(i=new Be(this.parseMode,"spacing",null,this.style),i.width=e,i.symbol="\\"+a.value,i.latex="\\"+a.value)}else if(i=this.scanMacro(a.value),!i){const e=se("\\"+a.value,this.parseMode,{});if(!e)return this.onError({code:"unknown-command",arg:"\\"+a.value}),i=new Be("math","error","\\"+a.value),i.symbol="\\"+a.value,i.latex="\\"+a.value,[i];if(e.mode&&!e.mode.includes(this.parseMode))return this.onError({code:"invalid-command",arg:"\\"+a.value}),i=new Be("math","error","\\"+a.value),i.symbol="\\"+a.value,i.latex="\\"+a.value,[i];const t=this.index,[s,o]=this.parseArguments(e);if(!o)return null;if(e.infix)this.onError({code:"too-many-infix-commands",arg:"\\"+a.value});else{if(e.parse){const t=e.parse("\\"+a.value,o);if(t.type)i=new Be(this.parseMode,e.type,s?this.scanArg(s):null,{...this.style,...t});else{const e=this.parseMode;if(t.mode&&(this.parseMode=t.mode,delete t.mode),s){const e=this.style;this.style={...this.style,...t},i=this.scanArg(s),this.style=e}else this.style={...this.style,...t};this.parseMode=e}}else{const t={...this.style,variant:e.variant||this.style.variant,variantStyle:e.variantStyle||this.style.variantStyle};i=new Be(this.parseMode,e.type||"mop",e.value||a.value,t)}if(i instanceof Be&&!/^(llap|rlap|class|cssId)$/.test(a.value)){i.symbol="\\"+a.value;const e=it(this.tokens.slice(t,this.index));if(e&&(i.latex=i.symbol+e),i.isFunction&&this.smartFence){const e=this.scanSmartFence();e&&(i=[i,e])}}}}}else if("literal"===a.type&&"string"==typeof a.value){const e=se(a.value,this.parseMode,this.macros);if(e){const t={...this.style};i=new Be(this.parseMode,e.type,e.value||a.value,t),e.isFunction&&(i.isFunction=!0)}else i=new Be(this.parseMode,"math"===this.parseMode?"mord":"",a.value,this.style);if(i.symbol=a.value,i.latex=Q(this.parseMode,a.value),(null==e?void 0:e.isFunction)&&this.smartFence){const e=this.scanSmartFence();e&&(i=[i,e])}}else"#"===a.type?i="?"!==a.value&&this.args?null===this.args[a.value]||void 0===this.args[a.value]?this.placeholder():"string"==typeof this.args[a.value]?ot(this.args[a.value],this.parseMode,[],this.macros,!1,this.onError):this.args[a.value]:this.placeholder():"}"===a.type?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:a.type+(null!==(t=a.value)&&void 0!==t?t:"")});return i&&!e(i)?[i]:i}scanMacro(e){var t;if(!this.macros||!this.macros[e])return null;const a=this.index,i=[];let s,o=0;"string"==typeof this.macros[e]?(s=this.macros[e],/(^|[^\\])#1/.test(s)&&(o=1),/(^|[^\\])#2/.test(s)&&(o=2),/(^|[^\\])#3/.test(s)&&(o=3),/(^|[^\\])#4/.test(s)&&(o=4),/(^|[^\\])#5/.test(s)&&(o=5),/(^|[^\\])#6/.test(s)&&(o=6),/(^|[^\\])#7/.test(s)&&(o=7),/(^|[^\\])#8/.test(s)&&(o=8),/(^|[^\\])#9/.test(s)&&(o=9)):(s=this.macros[e].def,o=this.macros[e].args||0);for(let e=1;e<=o;e++)i[e]=this.scanLiteralArg();i["?"]=null===(t=this.args)||void 0===t?void 0:t["?"];const r=new Be(this.parseMode,"group",ot(s,this.parseMode,i,this.macros,!1,this.onError));return r.captureSelection=!0,r.symbol="\\"+e,r.latex="\\"+e+it(this.tokens.slice(a)),r}parseAtom(){let t=this.scanEnvironment()||this.scanModeShift()||this.scanModeSet()||this.scanGroup()||this.scanLeftRight();return!(t||!this.parseSupSub()&&!this.parseLimits())||(t||(t=this.scanToken()),e(t)?this.mathList=this.mathList.concat(t):t&&this.mathList.push(t),null!==t)}}function ot(e,t,a,i,s=!1,o){let r=[];const n=new st(function(e){const t=[],a=e.toString().split(/\r?\n/);let i="",s="";for(const e of a){i+=s,s=" ";const t=e.match(/((?:\\%)|[^%])*/);t&&(i+=t[0])}const o=new Ge(i);for(;!o.end();){const e=o.makeToken();e&&t.push(e)}return t}(e),a,i,t=>{o&&o({...t,latex:e})});for(n.parseMode=t||"math",s&&(n.smartFence=!0);!n.end();)r=r.concat(n.scanImplicitGroup());return r}function rt(e){return 0===e.length||1===e.length&&"first"===e[0].type}function nt(e){const t=e.siblings();for(let e=t.length-1;e>=0;e--)t[e].suggestion&&t.splice(e,1)}function lt(e){let t=1,a=e.ancestor(t);for(;a;)a.latex=void 0,t+=1,a=e.ancestor(t)}function ct(e,t){let a="";for(const t of e)a+=t.relation+":"+t.offset+"/";return t&&(a+="#"+t),a}function dt(e){const t={path:[],extent:0},a=e.split("#");a.length>1&&(t.extent=parseInt(a[1]));const i=a[0].split("/");for(const e of i){const a=e.match(/([^:]*):(.*)/);a&&t.path.push({relation:a[1],offset:parseInt(a[2])})}return t}function mt(e,t){let a=0,i=-1,s=!1;for(;!s;)i+=1,s=i>=e.length||i>=t.length,s=s||!(e[i].relation===t[i].relation&&e[i].offset===t[i].offset);return a=i===e.length&&i===t.length?0:i+1===e.length&&i+1===t.length&&e[i].relation===t[i].relation?1:2,a}function pt(e){return dt(ct(e)).path}function ht(e,t){let a=0;for(let i=0;i0;)i.col+=1,(!e[i.row]||i.col>=e[i.row].length)&&(i.col=0,i.row+=1),a-=1;return i}function ft(t,a){let i;return"object"!=typeof a&&(a=ut(t,a)),e(t[a.row])&&(i=t[a.row][a.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(new Be("","first")),i}function gt(e){let t=0,a=0,i=1;for(const t of e)a+=1,t.length>i&&(i=t.length);return t=a*i,t}function yt(e,t,a){const i={...t};if(i.row+=a,i.row<0){if(i.col+=a,i.row=e.length-1,i.col<0)return null;for(;i.row>=0&&!ft(e,i);)i.row-=1;if(i.row<0)return null}else if(i.row>=e.length){for(i.col+=a,i.row=0;i.rowe.length-1)return null}return i}class bt{constructor(e,t,a,i){this.options={mode:"math",removeExtraneousParentheses:!1,...e},this.root=Oe(this.options.mode),this.path=[{relation:"body",offset:0}],this.extent=0,this.setListeners(t),this.setHooks(a),this.mathfield=i,this.suppressChangeNotifications=!1}clone(){const e=new bt(this.options,this.listeners,this.hooks,this.mathfield);return e.root=this.root,e.path=pt(this.path),e}setListeners(e){this.listeners=e}setHooks(e){this.hooks={announce:(null==e?void 0:e.announce)?e.announce:(e,t,a,i)=>{},moveOut:(null==e?void 0:e.moveOut)?e.moveOut:()=>!0,tabOut:(null==e?void 0:e.tabOut)?e.tabOut:()=>!0}}announce(e,t,a=[]){this.hooks.announce(this.mathfield,e,t,a)}toString(){return ct(this.path,this.extent)}siblings(){if(0===this.path.length)return[];let e;return this.parent().array?e=ft(this.parent().array,this.relation()):(e=this.parent()[this.relation()]||[],"string"==typeof e&&(e=[])),0!==e.length&&"first"===e[0].type||e.unshift(new Be("","first")),e}anchorOffset(){return this.path.length>0?this.path[this.path.length-1].offset:0}focusOffset(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0}startOffset(){return Math.min(this.focusOffset(),this.anchorOffset())}endOffset(){return Math.max(this.focusOffset(),this.anchorOffset())}sibling(e){return this.siblings()[this.startOffset()+e]}ancestor(e){if(e>this.path.length)return null;let t=this.root;for(let a=0;a0?this.path[this.path.length-1].relation:""}insertFirstAtom(){this.siblings()}}function vt(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onSelectionWillChange)||e.suppressChangeNotifications||e.listeners.onSelectionWillChange(e)}function xt(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onSelectionDidChange)||e.suppressChangeNotifications||e.listeners.onSelectionDidChange(e)}function kt(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onContentWillChange)||e.suppressChangeNotifications||e.listeners.onContentWillChange(e)}function wt(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onContentDidChange)||e.suppressChangeNotifications||e.listeners.onContentDidChange(e)}function St(e){return!!e&&("mord"===e.type&&/[0-9.]/.test(e.body)||"mpunct"===e.type&&","===e.body)}function Mt(e){const t=e.siblings();if(t.length<=1)return null;let a=Math.min(e.endOffset(),t.length-1);if("command"!==t[a].type)return null;for(;a>0&&"command"===t[a].type;)a-=1;let i=e.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>a?{start:a+1,end:i}:null}function Lt(e){const t=Rt(e)?Vt(e):e.sibling(1);let a;if(t){if("command"===t.type)return"command";a=t.mode}let i=1,s=e.ancestor(i);for(;!a&&s;)s&&(a=s.mode),i+=1,s=e.ancestor(i);return a}function Ct(e){const t=Rt(e)?Vt(e):e.sibling(1);let a;if(t&&"first"!==t.type){if("command"===t.type)return{};a={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=e.ancestor(i);for(;!a&&s;)s&&(a={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=e.ancestor(i);return a}function At(e,t=1,a=!0){var i;const s=e.suppressChangeNotifications;e.suppressChangeNotifications=!0;const o=e.clone(),r=e.extent;Dt(e,t),"placeholder"===Vt(e).type&&Dt(e,t);const n=Yt(e,(t,a)=>"placeholder"===a.type||t.length>1&&1===e.siblings().length,t);if(0===n.length){if(jt(e,o,r),a&&(null===(i=e.hooks)||void 0===i?void 0:i.tabOut)&&e.hooks.tabOut(e,t>0?"forward":"backward")&&document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',a=Array.prototype.filter.call(document.querySelectorAll(e),e=>(e.offsetWidth>0||e.offsetHeight>0)&&!e.contains(document.activeElement)||e===document.activeElement);let i=a.indexOf(document.activeElement)+t;i<0&&(i=a.length-1),i>=a.length&&(i=0),a[i].focus()}return e.suppressChangeNotifications=s,!1}return vt(e),jt(e,n[0]),"placeholder"===Vt(e).type&&Pt(e,-1),e.announce("move",o),xt(e),e.suppressChangeNotifications=s,!0}function $t(e,t=0,a=0,i=""){const s=e.path[e.path.length-1].relation;i||(i=s);const o=e.parent();if(!o&&"body"!==i)return!1;const r=i.startsWith("cell");if(!r&&!o[i]||r&&!o.array)return!1;const n=i!==s;e.path[e.path.length-1].relation=i;const l=e.siblings().length;e.path[e.path.length-1].relation=s;const c=e.extent;"end"===a?a=l-t-1:"start"===a&&(a=-t),Pt(e,a);const d=e.extent!==c;Pt(e,c),t<0&&(t=l+t),t=Math.max(0,Math.min(t,l-1));const m=e.path[e.path.length-1].offset;return(n||m!==t||d)&&(n&&Zt(e),vt(e),e.path[e.path.length-1].relation=i,e.path[e.path.length-1].offset=t,Pt(e,a),xt(e)),!0}function zt(t,a){var i;a=null!=a?a:{};const s={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(t.anchorOffset()===t.siblings().length-1){Zt(t);let e=s[t.relation()];const o=t.parent();for(;e&&!o[e];)e=s[e];if(e)return void $t(t,0,0,e);if(t.parent().array){const e=gt(t.parent().array);let a=parseInt(t.relation().match(/cell([0-9]*)$/)[1])+1;for(;a=0;){if(ft(t.parent().array,e)&&$t(t,-1,0,"cell"+e))return void xt(t);e-=1}}return 1===t.path.length?(t.suppressChangeNotifications||!(null===(i=t.hooks)||void 0===i?void 0:i.moveOut)||t.hooks.moveOut(t,"backward"))&&(t.path[0].offset=t.root.body.length-1):(t.path.pop(),$t(t,t.anchorOffset()-1)),void xt(t)}const o=Vt(t);if(!o.captureSelection){let a;if(o.array){a="";const e=gt(o.array);let i=e-1;for(;!a&&i0)for(It(e)&&t--;t>0;)zt(e),t--;else if(t<0)for(Ht(e)&&t++;0!==t;)_t(e),t++;e.announce("move",a)}return!0}function qt(e,t){var a;const i=null!==(a=(t=null!=t?t:{extend:!1}).extend)&&void 0!==a&&a;Ht(e);const s=e.relation();if("denom"===s)i?(vt(e),e.path.pop(),e.path[e.path.length-1].offset-=1,Pt(e,1),xt(e)):$t(e,e.anchorOffset(),0,"numer"),e.announce("moveUp");else if(e.parent().array){let a=ut(e.parent().array,s);a=yt(e.parent().array,a,-1),a&&ft(e.parent().array,a)?(e.path[e.path.length-1].relation="cell"+ht(e.parent().array,a),$t(e,e.anchorOffset()),e.announce("moveUp")):Dt(e,-1,t)}else e.announce("line");return!0}function Tt(e,t){var a;const i=null!==(a=(t=null!=t?t:{extend:!1}).extend)&&void 0!==a&&a;It(e);const s=e.relation();if("numer"===s)i?(vt(e),e.path.pop(),e.path[e.path.length-1].offset-=1,Pt(e,1),xt(e)):$t(e,e.anchorOffset(),0,"denom"),e.announce("moveDown");else if(e.parent().array){let a=ut(e.parent().array,s);a=yt(e.parent().array,a,1),a&&ft(e.parent().array,a)?(e.path[e.path.length-1].relation="cell"+ht(e.parent().array,a),$t(e,e.anchorOffset()),e.announce("moveDown")):Dt(e,1,t)}else e.announce("line");return!0}function Kt(e,t){let a=e.path[e.path.length-1].offset,i=0;const s=e.clone();i=e.extent+t;const o=a+i;if(o<0&&0!==i){if(e.path.length>1)return vt(e),e.path.pop(),Pt(e,-1),xt(e),e.announce("move",s),!0;a=e.path[e.path.length-1].offset,i=e.extent}else if(o>=e.siblings().length){if(e.path.length>1)return vt(e),e.path.pop(),e.path[e.path.length-1].offset-=1,Pt(e,1),xt(e),e.announce("move",s),!0;Rt(e)&&(a-=1),i-=1}return $t(e,a,i),e.announce("move",s),!0}function Et(e,t,a){var i;const s=null!==(i=(a=null!=a?a:{extend:!1}).extend)&&void 0!==i&&i;t=t<0?-1:1;const o=e.clone(),r=e.siblings(),n=e.focusOffset();let l=n+t;if(s&&(l=Math.min(Math.max(0,l),r.length-1)),l<0||l>=r.length)Dt(e,t,a);else{if(r[l]&&"text"===r[l].mode){if(l=function(e,t,a){a=a<0?-1:1;const i=e.siblings();if(!i[t])return t;if("text"!==i[t].mode)return t;let s;if(U.test(i[t].body)){let e,o=t;do{e="text"===i[o].mode&&U.test(i[o].body),o+=a}while(i[o]&&e);s=i[o]?o-2*a:o-a}else if(/\s/.test(i[t].body)){let e=t;for(;i[e]&&"text"===i[e].mode&&/\s/.test(i[e].body);)e+=a;if(i[e]){let t=!0;do{t="text"===i[e].mode&&!/\s/.test(i[e].body),e+=a}while(i[e]&&t);s=i[e]?e-2*a:e-a}else s=e-a}else{let e=t;for(;i[e]&&"text"===i[e].mode&&!/\s/.test(i[e].body);)e+=a;s=i[e]?e:e-a;let o=!0;for(;i[e]&&o;)o="text"===i[e].mode&&/\s/.test(i[e].body),o&&(s=e),e+=a;s=i[e]?e-2*a:e-a}return s-(a>0?0:1)}(e,l,t),l<0&&!s)return void $t(e,0);if(l>r.length)return $t(e,r.length-1),void Dt(e,t,a)}else{const e=r[l]?r[l].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let a="mopen"===e?1:-1;for(l+=t>0?1:-1;l>=0&&l0&&(l-=1)}else{for(;r[l]&&"math"===r[l].mode&&r[l].type===e;)l+=t;l-=t>0?1:0}}if(s){const t=e.anchorOffset();$t(e,t,l-t)}else $t(e,l);e.announce("move",o)}}function Ft(e,t=1,a){var i;a=null!=a?a:{extend:!1},t=t<0?-1:1;const s=e.clone(),o=[{relation:"body",offset:e.path[0].offset}];let r;return null!==(i=!a.extend)&&void 0!==i&&i?(o[0].offset=t<0?0:e.root.body.length-1,r=0):t<0?o[0].offset>0&&(r=-o[0].offset):o[0].offset=i)return $t(e,e.endOffset()-1,1),!0;$t(e,a,i-a)}else if("mord"===e.sibling(0).type&&/[0-9,.]/.test(e.sibling(0).body)){let a=e.startOffset(),i=e.endOffset();for(;St(t[a]);)a-=1;for(;St(t[i]);)i+=1;i-=1,$t(e,a,i-a)}else $t(e,0,"end");return!0}function Ot(e){return e.path=[{relation:"body",offset:0}],$t(e,0,"end")}function Rt(e){return 0===e.extent}function Pt(e,t){return e.extent=t,!0}function It(e){return 0!==e.extent&&($t(e,e.endOffset()),!0)}function Ht(e){return 0!==e.extent&&($t(e,e.startOffset()),!0)}function Wt(e){if(e.path.length>1){const t=e.clone();return e.path.pop(),Pt(e,0),e.announce("move",t),!0}return e.announce("plonk"),!1}function Vt(e){if(e.parent().array)return ft(e.parent().array,e.relation())[e.anchorOffset()];const t=e.siblings();return t[Math.min(t.length-1,e.anchorOffset())]}function Ut(e,t,a,i={extendToWordBoundary:!1}){const s=mt(t,a);if(0===s)return i.extendToWordBoundary?Ut(e,t=Xt(e,t,-1),a=Xt(e,a,1)):jt(e,pt(t),0);if(1===s){const s=a[a.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?Ut(e,t=Xt(e,t,s<0?1:-1),a=Xt(e,a,s<0?-1:1)):jt(e,pt(t),s)}let o=function(e,t){const a=[],i=Math.min(e.length-1,t.length-1);let s=0;for(;s<=i&&e[s].relation===t[s].relation&&e[s].offset===t[s].offset;)a.push(e[s]),s+=1;return a}(t,a);const r=o.length;if(t.length===r||a.length===r||t[r].relation!==a[r].relation)return jt(e,o,-1);o.push(t[r]),o=pt(o);let n=a[r].offset-t[r].offset+1;return n<=0?a.length>r+1?(o[r].relation=a[r].relation,o[r].offset=a[r].offset,o[o.length-1].offset-=1,n=2-n):(o[r].relation=a[r].relation,o[r].offset=a[r].offset,n=1-n):a.length<=t.length?o[o.length-1].offset-=1:a.length>t.length&&(o[r].offset-=1),jt(e,o,n)}function jt(t,a,i=0){let s;if("string"==typeof a)s=dt(a);else if(e(a)){const e=pt(a),o=t.path;t.path=e,0===i&&"placeholder"===Vt(t).type&&(e[e.length-1].offset=t.anchorOffset()-1,i=1),s={path:e,extent:i||0},t.path=o}else s=a;const o=0!==mt(t.path,s.path),r=s.extent!==t.extent;return(o||r)&&(o&&Zt(t),vt(t),t.path=pt(s.path),t.siblings().length=0?It(s):(Ht(s),Dt(s,1));const o=Vt(s);do{t.bind(s)(s.path,Vt(s))&&i.push(s.toString()),a>=0?zt(s,{iterateAll:!0}):_t(s,{iterateAll:!0})}while(o!==Vt(s));return i}const Jt="apple"===aa()?{id:"apple.en-intl",displayName:"English (international)",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","∫","ı"],KeyC:["c","C","ç","Ç"],KeyD:["d","D","∂","Î"],KeyE:["e","E","´","´"],KeyF:["f","F","ƒ","Ï"],KeyG:["g","G","©","˝"],KeyH:["h","H","˙","Ó"],KeyI:["i","I","ˆ","ˆ"],KeyJ:["j","J","∆","Ô"],KeyK:["k","K","˚",""],KeyL:["l","L","¬","Ò"],KeyM:["m","M","µ","Â"],KeyN:["n","N","˜","˜"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","π","∏"],KeyQ:["q","Q","œ","Œ"],KeyR:["r","R","®","‰"],KeyS:["s","S","ß","Í"],KeyT:["t","T","†","ˇ"],KeyU:["u","U","¨","¨"],KeyV:["v","V","√","◊"],KeyW:["w","W","∑","„"],KeyX:["x","X","≈","˛"],KeyY:["y","Y","¥","Á"],KeyZ:["z","Z","Ω","¸"],Digit1:["1","!","¡","⁄"],Digit2:["2","@","™","€"],Digit3:["3","#","£","‹"],Digit4:["4","$","¢","›"],Digit5:["5","%","∞","fi"],Digit6:["6","ˆ","§","fl"],Digit7:["7","&","¶","‡"],Digit8:["8","*","•","°"],Digit9:["9","(","ª","·"],Digit0:["0",")","º","‚"],Space:[" "," "," "," "],Minus:["-","_","–","—"],Equal:["=","+","≠","±"],BracketLeft:["[","{","“","”"],BracketRight:["]","}","‘","’"],Backslash:["\\","|","«","»"],Semicolon:[";",":","…","Ú"],Quote:["'",'"',"æ","Æ"],Backquote:["`","˜","`","`"],Comma:[",","<","≤","¯"],Period:[".",">","≥","˘"],Slash:["/","?","÷","¿"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["§","±","§","±"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}}:"windows"===aa()?{id:"windows.en-intl",displayName:"English (international)",platform:"windows",locale:"en",score:0,mapping:{KeyA:["a","A","á","Á"],KeyB:["b","B","",""],KeyC:["c","C","©","¢"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","é","É"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","í","Í"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","ø","Ø"],KeyM:["m","M","µ",""],KeyN:["n","N","ñ","Ñ"],KeyO:["o","O","ó","Ó"],KeyP:["p","P","ö","Ö"],KeyQ:["q","Q","ä","Ä"],KeyR:["r","R","®",""],KeyS:["s","S","ß","§"],KeyT:["t","T","þ","Þ"],KeyU:["u","U","ú","Ú"],KeyV:["v","V","",""],KeyW:["w","W","å","Å"],KeyX:["x","X","",""],KeyY:["y","Y","ü","Ü"],KeyZ:["z","Z","æ","Æ"],Digit1:["1","!","¡","¹"],Digit2:["2","@","²",""],Digit3:["3","#","³",""],Digit4:["4","$","¤","£"],Digit5:["5","%","€",""],Digit6:["6","^","¼",""],Digit7:["7","&","½",""],Digit8:["8","*","¾",""],Digit9:["9","(","‘",""],Digit0:["0",")","’",""],Space:[" "," ","",""],Minus:["-","_","¥",""],Equal:["=","+","×","÷"],BracketLeft:["[","{","«",""],BracketRight:["]","}","»",""],Backslash:["\\","|","¬","¦"],Semicolon:[";",":","¶","°"],Quote:["'",'"',"´","¨"],Backquote:["`","~","",""],Comma:[",","<","ç","Ç"],Period:[".",">","",""],Slash:["/","?","¿",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}}:{id:"linux.en",displayName:"English",platform:"linux",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","¦"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},Qt={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},ea=[];let ta;function aa(){let e;return(null===navigator||void 0===navigator?void 0:navigator.platform)&&(null===navigator||void 0===navigator?void 0:navigator.userAgent)&&(/^(mac)/i.test(navigator.platform)?e="apple":/^(win)/i.test(navigator.platform)?e="windows":/(android)/i.test(navigator.userAgent)?e="linux":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="apple":/\bCrOS\b/i.test(navigator.userAgent)&&(e="linux")),e}function ia(e){e.platform===aa()&&ea.push(e)}function sa(e){ta=ea.find(t=>e.startsWith(t.locale))}function oa(){return null!=ta?ta:ea[0]}ia(Jt),ia({id:"apple.french",locale:"fr",displayName:"French",platform:"apple",score:0,mapping:{KeyA:["q","Q","‡","Ω"],KeyB:["b","B","ß","∫"],KeyC:["c","C","©","¢"],KeyD:["d","D","∂","∆"],KeyE:["e","E","ê","Ê"],KeyF:["f","F","ƒ","·"],KeyG:["g","G","fi","fl"],KeyH:["h","H","Ì","Î"],KeyI:["i","I","î","ï"],KeyJ:["j","J","Ï","Í"],KeyK:["k","K","È","Ë"],KeyL:["l","L","¬","|"],KeyM:[",","?","∞","¿"],KeyN:["n","N","~","ı"],KeyO:["o","O","œ","Œ"],KeyP:["p","P","π","∏"],KeyQ:["a","A","æ","Æ"],KeyR:["r","R","®","‚"],KeyS:["s","S","Ò","∑"],KeyT:["t","T","†","™"],KeyU:["u","U","º","ª"],KeyV:["v","V","◊","√"],KeyW:["z","Z","Â","Å"],KeyX:["x","X","≈","⁄"],KeyY:["y","Y","Ú","Ÿ"],KeyZ:["w","W","‹","›"],Digit1:["&","1","","´"],Digit2:["é","2","ë","„"],Digit3:['"',"3","“","”"],Digit4:["'","4","‘","’"],Digit5:["(","5","{","["],Digit6:["§","6","¶","å"],Digit7:["è","7","«","»"],Digit8:["!","8","¡","Û"],Digit9:["ç","9","Ç","Á"],Digit0:["à","0","ø","Ø"],Space:[" "," "," "," "],Minus:[")","°","}","]"],Equal:["-","_","—","–"],BracketLeft:["^","¨","ô","Ô"],BracketRight:["$","*","€","¥"],Backslash:["`","£","@","#"],Semicolon:["m","M","µ","Ó"],Quote:["ù","%","Ù","‰"],Backquote:["<",">","≤","≥"],Comma:[";",".","…","•"],Period:[":","/","÷","\\"],Slash:["=","+","≠","±"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","•","Ÿ"],NumpadEqual:["=","=","=","="]}}),ia({id:"linux.french",locale:"fr",displayName:"French",platform:"apple",score:0,mapping:{KeyA:["q","Q","@","Ω"],KeyB:["b","B","”","’"],KeyC:["c","C","¢","©"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","€","¢"],KeyF:["f","F","đ","ª"],KeyG:["g","G","ŋ","Ŋ"],KeyH:["h","H","ħ","Ħ"],KeyI:["i","I","→","ı"],KeyJ:["j","J","̉","̛"],KeyK:["k","K","ĸ","&"],KeyL:["l","L","ł","Ł"],KeyM:[",","?","́","̋"],KeyN:["n","N","n","N"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","þ","Þ"],KeyQ:["a","A","æ","Æ"],KeyR:["r","R","¶","®"],KeyS:["s","S","ß","§"],KeyT:["t","T","ŧ","Ŧ"],KeyU:["u","U","↓","↑"],KeyV:["v","V","“","‘"],KeyW:["z","Z","«","<"],KeyX:["x","X","»",">"],KeyY:["y","Y","←","¥"],KeyZ:["w","W","ł","Ł"],Digit1:["&","1","¹","¡"],Digit2:["é","2","~","⅛"],Digit3:['"',"3","#","£"],Digit4:["'","4","{","$"],Digit5:["(","5","[","⅜"],Digit6:["-","6","|","⅝"],Digit7:["è","7","`","⅞"],Digit8:["_","8","\\","™"],Digit9:["ç","9","^","±"],Digit0:["à","0","@","°"],Enter:["\r","\r","\r","\r"],Escape:["","","",""],Backspace:["\b","\b","\b","\b"],Tab:["\t","","\t",""],Space:[" "," "," "," "],Minus:[")","°","]","¿"],Equal:["=","+","}","̨"],BracketLeft:["̂","̈","̈","̊"],BracketRight:["$","£","¤","̄"],Backslash:["*","µ","̀","̆"],Semicolon:["m","M","µ","º"],Quote:["ù","%","̂","̌"],Backquote:["²","~","¬","¬"],Comma:[";",".","─","×"],Period:[":","/","·","÷"],Slash:["!","§","̣","̇"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","¦"]}}),ia({id:"windows.french",locale:"fr",displayName:"French",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","€",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["é","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["è","7","`",""],Digit8:["_","8","\\",""],Digit9:["ç","9","^",""],Digit0:["à","0","@",""],Space:[" "," ","",""],Minus:[")","°","]",""],Equal:["=","+","}",""],BracketLeft:["^","¨","",""],BracketRight:["$","£","¤",""],Backslash:["*","µ","",""],Semicolon:["m","M","",""],Quote:["ù","%","",""],Backquote:["²","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","§","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}}),ia({id:"windows.german",locale:"de",displayName:"German",platform:"windows",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","€",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","µ",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"²",""],Digit3:["3","§","³",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["ß","?","\\","ẞ"],Equal:["´","`","",""],BracketLeft:["ü","Ü","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["ö","Ö","",""],Quote:["ä","Ä","",""],Backquote:["^","°","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}}),ia({id:"apple.german",locale:"de",displayName:"German",platform:"apple",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","∫","‹"],KeyC:["c","C","ç","Ç"],KeyD:["d","D","∂","™"],KeyE:["e","E","€","‰"],KeyF:["f","F","ƒ","Ï"],KeyG:["g","G","©","Ì"],KeyH:["h","H","ª","Ó"],KeyI:["i","I","⁄","Û"],KeyJ:["j","J","º","ı"],KeyK:["k","K","∆","ˆ"],KeyL:["l","L","@","fl"],KeyM:["m","M","µ","˘"],KeyN:["n","N","~","›"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","π","∏"],KeyQ:["q","Q","«","»"],KeyR:["r","R","®","¸"],KeyS:["s","S","‚","Í"],KeyT:["t","T","†","˝"],KeyU:["u","U","¨","Á"],KeyV:["v","V","√","◊"],KeyW:["w","W","∑","„"],KeyX:["x","X","≈","Ù"],KeyY:["z","Z","Ω","ˇ"],KeyZ:["y","Y","¥","‡"],Digit1:["1","!","¡","¬"],Digit2:["2",'"',"“","”"],Digit3:["3","§","¶","#"],Digit4:["4","$","¢","£"],Digit5:["5","%","[","fi"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","˜"],Digit9:["9",")","}","·"],Digit0:["0","=","≠","¯"],Space:[" "," "," "," "],Minus:["ß","?","¿","˙"],Equal:["´","`","'","˚"],BracketLeft:["ü","Ü","•","°"],BracketRight:["+","*","±",""],Backslash:["#","'","‘","’"],Semicolon:["ö","Ö","œ","Œ"],Quote:["ä","Ä","æ","Æ"],Backquote:["<",">","≤","≥"],Comma:[",",";","∞","˛"],Period:[".",":","…","÷"],Slash:["-","_","–","—"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","°","„","“"],NumpadEqual:["=","=","=","="]}});const ra=[{key:"ctrl+alt+e",command:["insert","\\text{cmd+alt+e}"]},{key:"cmd+alt+a",command:["insert","\\text{cmd+alt+a}"]},{key:"ctrl+alt+a",command:["insert","\\text{ctrl+alt+a}"]},{key:"meta+alt+2",command:["insert","\\text{meta+alt+2}"]},{key:"ctrl+alt+shift+a",command:["insert","\\text{ctrl+alt+shift+a}"]},{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendToPreviousChar"},{key:"shift+[ArrowRight]",command:"extendToNextChar"},{key:"shift+[ArrowUp]",command:"extendUp"},{key:"shift+[ArrowDown]",command:"extendDown"},{key:"[Backspace]",command:"deletePreviousChar"},{key:"alt+[Delete]",command:"deletePreviousChar"},{key:"[Delete]",command:"deleteNextChar"},{key:"alt+[Backspace]",command:"deleteNextChar"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"alt+shift+[ArrowLeft]",command:"extendToPreviousWord"},{key:"alt+shift+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"ctrl+shift+[ArrowLeft]",command:"extendToGroupStart"},{key:"ctrl+shift+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Space]",ifMode:"math",command:"moveAfterParent"},{key:"shift+[Space]",ifMode:"math",command:"moveBeforeParent"},{key:"[Home]",command:"moveToMathFieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathFieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"cmd+shift+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathFieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathFieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"cmd+shift+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",ifMode:"math",command:"moveToNextPlaceholder"},{key:"shift+[Tab]",ifMode:"math",command:"moveToPreviousPlaceholder"},{key:"[Tab]",ifMode:"text",command:"moveToNextPlaceholder"},{key:"shift+[Tab]",ifMode:"text",command:"moveToPreviousPlaceholder"},{key:"[Escape]",ifMode:"math",command:["switch-mode","command"]},{key:"\\",ifMode:"math",command:["switch-mode","command"]},{key:"alt+[Equal]",ifMode:"math",command:["applyStyle",{mode:"text"}]},{key:"alt+[Equal]",ifMode:"text",command:["applyStyle",{mode:"math"}]},{key:"[Escape]",ifMode:"command",command:["complete",{discard:!0}]},{key:"[Tab]",ifMode:"command",command:["complete",{acceptSuggestion:!0}]},{key:"[Return]",ifMode:"command",command:"complete"},{key:"[Enter]",ifMode:"command",command:"complete"},{key:"shift+[Escape]",ifMode:"command",command:["complete",{discard:!0}]},{key:"[ArrowDown]",ifMode:"command",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"command",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deletePreviousChar"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"[Undo]",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"cmd+shift+y",command:"redo"},{key:"ctrl+shift+z",ifPlatform:"!macos",command:"redo"},{key:"cmd+shift+z",command:"redo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathFieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathFieldEnd"},{key:"ctrl+shift+b",ifPlatform:"macos",command:"extendToPreviousChar"},{key:"ctrl+shift+f",ifPlatform:"macos",command:"extendToNextChar"},{key:"ctrl+shift+p",ifPlatform:"macos",command:"extendUp"},{key:"ctrl+shift+n",ifPlatform:"macos",command:"extendDown"},{key:"ctrl+shift+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"ctrl+shift+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"ctrl+alt+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"ctrl+alt+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"ctrl+shift+alt+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"ctrl+shift+alt+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deletePreviousChar"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteNextChar"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"shift+[Quote]",ifMode:"math",command:["switchMode","text","","“"]},{key:"shift+[Quote]",ifMode:"text",command:["switch-mode","math","”",""]},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","$$\\sqrt{#0}$$"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Minus]",ifMode:"math",command:"moveToSubscript"},{key:"alt+[BracketLeft]",ifMode:"math",command:["insert","$$\\left\\lbrack #0 \\right\\rbrack$$"]},{key:"alt+shift+[BracketLeft]",ifMode:"math",command:["insert","$$\\left\\lbrace #0 \\right\\rbrace$$"]},{key:"[Return]",ifMode:"math",command:"addRowAfter"},{key:"[Enter]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Comma]",ifMode:"math",command:"addColumnAfter"},{key:"[Return]",ifMode:"text",command:"addRowAfter"},{key:"[Enter]",ifMode:"text",command:"addRowAfter"},{key:"ctrl+[Comma]",ifMode:"text",command:"addColumnAfter"},{key:"alt+p",ifMode:"math",command:["insert","$$\\pi$$"]},{key:"alt+v",ifMode:"math",command:["insert","$$\\sqrt{#0}$$"]},{key:"alt+w",ifMode:"math",command:["insert","$$\\sum_{i=#?}^{#?}$$"]},{key:"alt+u",ifMode:"math",command:["insert","$$\\cup$$"]},{key:"alt+n",ifMode:"math",command:["insert","$$\\cap$$"]},{key:"alt+o",ifMode:"math",command:["insert","$$\\emptyset$$"]},{key:"alt+d",ifMode:"math",command:["insert","$$\\differentialD$$"]},{key:"alt+shift+o",ifMode:"math",command:["insert","$$\\varnothing$$"]},{key:"alt+shift+d",ifMode:"math",command:["insert","$$\\partial$$"]},{key:"alt+shift+p",ifMode:"math",command:["insert","$$\\prod_{i=#?}^{#?}$$"]},{key:"alt+shift+u",ifMode:"math",command:["insert","$$\\bigcup$$"]},{key:"alt+shift+n",ifMode:"math",command:["insert","$$\\bigcap$$"]},{key:"alt+shift+a",ifMode:"math",command:["insert","$$\\forall$$"]},{key:"alt+shift+e",ifMode:"math",command:["insert","$$\\exists$$"]},{key:"alt+[Digit5]",ifMode:"math",command:["insert","$\\infty$$"]},{key:"alt+[Digit6]",ifMode:"math",command:["insert","$$\\wedge$$"]},{key:"alt+shift+[Digit6]",ifMode:"math",command:["insert","$$\\vee$$"]},{key:"alt+[Digit9]",ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifMode:"math",command:["insert",")"]},{key:"alt+shift+[Backslash]",ifMode:"math",command:["insert","|"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","$$\\backslash$$"]},{key:"[Slash]",ifMode:"math",command:["insert","$$\\frac{#@}{#?}$$"]},{key:"alt+[Slash]",ifMode:"math",command:["insert","$$\\frac{#?}{#@}$$"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","$$\\frac{#@}{#?}$$"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+[Backquote]",ifMode:"math",command:["insert","$$\\~$$"]},{key:"alt+shift+[Slash]",ifMode:"math",command:["insert","$$\\/$$"]},{key:"alt+shift+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleVirtualKeyboard"},{key:"ctrl+alt+[ArrowUp]",command:["speak","parent",{withHighlighting:!1}]},{key:"ctrl+alt+[ArrowDown]",command:["speak","all",{withHighlighting:!1}]}],na={"\\theta":"alt+q","\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\prod":"alt+shift+p","\\sum":"alt+w","\\int":"alt+b","\\cup":"alt+u","\\cap":"alt+n","\\bigcup":"alt+shift+u","\\bigcap":"alt+shift+n","\\forall":"alt+shift+a","\\exists":"alt+shift+e","\\infty":"alt+[Digit5]","\\wedge":"alt+[Digit5]","\\vee":"alt+shift+[Digit6]","\\differentialD":"alt+d","\\partial":"alt+shift+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"alt+shift+o","\\~":"~"};function la(e){if((null===navigator||void 0===navigator?void 0:navigator.platform)&&(null===navigator||void 0===navigator?void 0:navigator.userAgent)){let t;if(/^(mac)/i.test(navigator.platform)?t="macos":/^(win)/i.test(navigator.platform)?t="windows":/(android)/i.test(navigator.userAgent)?t="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?t="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(t="chromeos"),e.startsWith("!")&&!e.endsWith(t))return!0;if(e.endsWith(t))return!0}return!1}function ca(t){let a=t;return e(a)&&(a=a.length>0?a[0]+"("+a.slice(1).join("")+")":""),a}function da(e){const t=la("macos")||la("ios"),a=e.split("+");let i="";for(const e of a)!t&&i&&(i+='+'),e.startsWith("Key")?i+=e.substr(3,1):e.startsWith("Digit")?i+=e.substr(5,1):i+={cmd:"⌘",meta:t?"⌘":"command",shift:t?"⇧":"shift",alt:t?"⌥":"alt",ctrl:t?"⌃":"control","\n":t?"⏎":"return","[return]":t?"⏎":"return","[enter]":t?"⌤":"enter","[tab]":t?"⇥":"tab","[escape]":"esc","[backspace]":t?"⌫":"backspace","[delete]":t?"⌦":"del","[pageup]":t?"⇞":"page up","[pagedown]":t?"⇟":"page down","[home]":t?"⤒":"home","[end]":t?"⤓":"end","[space]":"space","[equal]":"=","[minus]":"-","[comma]":",","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",bracketLeft:"[",bracketRight:"]",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* 🔢",numpaddivide:"/ 🔢",numpadsubtract:"- 🔢",numpadadd:"+ 🔢",numpaddecimal:". 🔢",numpadcomma:", 🔢",help:"help",left:"⇠",up:"⇡",right:"⇢",down:"⇣","[arrowleft]":"⇠","[arrowup]":"⇡","[arrowright]":"⇢","[arrowdown]":"⇣","[digit0]":"0","[digit1]":"1","[digit2]":"2","[digit3]":"3","[digit4]":"4","[digit5]":"5","[digit6]":"6","[digit7]":"7","[digit8]":"8","[digit9]":"9"}[e.toLowerCase()]||e.toUpperCase();return i}function ma(e,t){const a=[],i=[];return e.forEach(e=>{try{const t=function(e){if(e.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(e.ifPlatform))throw new Error(`Unexpected platform "${e.ifPlatform}" for keybinding ${e.key}`);let t=e.key.split("+");const a=t.pop();let i=e.ifPlatform;if(t=t.map(e=>{const t=e.toLowerCase();if("cmd"===t){if(i&&"macos"!==i&&"ios"!==i)throw new Error('Unexpected "cmd" modifier with platform "'+i+'"');return i||(i=la("ios")?"ios":"macos"),"meta"}if("win"===t){if(i&&"windows"!==i)throw new Error('Unexpected "win" modifier with platform "'+i+'"');return i="windows","meta"}return t}),!i||la(i)){if(/^\[(.*)\]$/.test(a))t.push(a);else{const i=function(e){var t,a;const i=null!==(t=ea[0])&&void 0!==t?t:Jt;for(const[t,a]of Object.entries(i.mapping))if(a[0]===e)return"["+t+"]";return null!==(a=Qt[e])&&void 0!==a?a:""}(a);if(!i)throw new Error('Invalid keybinding key "'+e.key+'"');t.push(i)}return{...e,ifPlatform:i,key:t.join("+")}}}(e);t&&a.push(t)}catch(e){i.push(e.message)}}),i.length>0&&t(i),a}function pa(e,t,a,i){const s=t.split(" ");for(const t of s){const s=t.match(/(.*):(.*)/);if(s){const t=null!=i?i:{};"active"===s[2]?t.passive=!1:t[s[2]]=!0,e.addEventListener(s[1],a,t)}else e.addEventListener(t,a,i)}}function ha(e,t,a,i){const s=t.split(" ");for(const t of s){const s=t.match(/(.*):(.*)/);if(s){const t=null!=i?i:{};"active"===s[2]?t.passive=!1:t[s[2]]=!0,e.removeEventListener(s[1],a,t)}else e.removeEventListener(t,a,i)}}function ua(e,t){let a=document.getElementById(e);return a?a.setAttribute("data-refcount",Number(parseInt(a.getAttribute("data-refcount"))+1).toString()):(a=document.createElement("div"),a.setAttribute("aria-hidden","true"),a.setAttribute("data-refcount","1"),a.className=t,a.id=e,document.body.appendChild(a)),a}function fa(e){if(!e)return;const t=parseInt(e.getAttribute("data-refcount"));t<=1?e.remove():e.setAttribute("data-refcount",Number(t-1).toString())}function ga(e){return e.element&&e.element.mathfield===e}function ya(e){const t=function e(t){if(t.classList.contains("ML__caret")||t.classList.contains("ML__text-caret")||t.classList.contains("ML__command-caret"))return t;let a;for(const i of t.children)if(a=e(i),a)break;return a}(e);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}function ba(e){const t=e.querySelectorAll(".ML__selected");if(t&&t.length>0){const a={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(e=>{const t=e.getBoundingClientRect();t.lefta.right&&(a.right=t.right),t.bottom>a.bottom&&(a.bottom=t.bottom),t.top{if("mousedown"!==a.type||1===a.buttons){a.stopPropagation(),a.preventDefault(),t.classList.add("pressed"),i=Date.now(),"touchstart"===a.type&&(o=a.changedTouches[0].identifier);const r=t.getAttribute("data-"+e.config.namespace+"command-pressed");r&&e.$perform(JSON.parse(r));const l=t.getAttribute("data-"+e.config.namespace+"command-pressAndHoldStart");l&&(s=t,n&&clearTimeout(n),n=window.setTimeout((function(){t.classList.contains("pressed")&&e.$perform(JSON.parse(l))}),300))}}),pa(t,"mouseleave touchcancel",()=>{t.classList.remove("pressed")}),pa(t,"touchmove:passive",e=>{e.preventDefault();for(let t=0;t{1===e.buttons&&t.classList.add("pressed")}),pa(t,"mouseup touchend click",a=>{if(r){a.stopPropagation(),a.preventDefault();const e=r;return r=null,void e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0}))}if(t.classList.remove("pressed"),t.classList.add("active"),"click"===a.type&&0!==a.detail)return a.stopPropagation(),void a.preventDefault();window.setTimeout((function(){t.classList.remove("active")}),150);let o=t.getAttribute("data-"+e.config.namespace+"command-pressAndHoldEnd");const n=Date.now();(t!==s||nequal to","\\supseteq":"superset of or
equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
natural numbers","\\Z":"set of
integers","\\Q":"set of
rational numbers","\\C":"set of
complex numbers","\\R":"set of
real numbers","\\P":"set of
prime numbers","\\lesseqqgtr":"less than, equal to or
greater than","\\gnapprox":"greater than and
not approximately","\\lnapprox":"lesser than and
not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function ka(t,a,i){if(!a||0===a.length)return void Ma(t);const s=a,o=function(e,t){const a=ot(e,"math",null,t.config.macros);return q(_(Ne({mathstyle:c.displaystyle,macros:t.config.macros},a),"ML__base"),"ML__mathlive").toMarkup()}(a,t),r=function(t){let a=xa[t]||"";return e(a)&&(a=a.join("
")),a}(s),n=function(t,a){let i=[];if("string"==typeof a){const t=na[a];e(t)?i=t.slice():t&&i.push(t)}const s=ca(a),o=new RegExp("^"+s.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return t.forEach(e=>{o.test(ca(e.command))&&i.push(e)}),i.map(da)}(t.keybindings,s).join("
");let l=i?'
':"";l+='',l+='
'+o+"
",r&&(l+='
'+r+"
"),n&&(l+='
'+n+"
"),l+="
",l+=i?'
':"",function(e,t){e.popover.innerHTML=e.config.createHTML(t);const a=ya(e.field);a&&Sa(e,a),e.popover.classList.add("is-visible")}(t,l);let d=t.popover.getElementsByClassName("ML__popover__content");d&&d.length>0&&va(t,d[0],{default:["complete",{acceptSuggestion:!0}]}),d=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),d&&d.length>0&&va(t,d[0],"previousSuggestion"),d=t.popover.getElementsByClassName("ML__popover__next-shortcut"),d&&d.length>0&&va(t,d[0],"nextSuggestion")}function wa(e,t){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(null==t?void 0:t.deferred)window.requestAnimationFrame(()=>wa(e));else if(Vt(e.model)&&"command"===Vt(e.model).type){const t=ya(e.field);t&&Sa(e,t)}else Ma(e)}function Sa(e,t){const a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,s=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,r=e.virtualKeyboardVisible?e.virtualKeyboard.offsetHeight:0;t.x+e.popover.offsetWidth/2>i-s?e.popover.style.left=i-e.popover.offsetWidth-s+"px":t.x-e.popover.offsetWidth/2<0?e.popover.style.left=0:e.popover.style.left=t.x-e.popover.offsetWidth/2+"px",t.y+e.popover.offsetHeight+5>a-o-r?(e.popover.classList.add("reverse-direction"),e.popover.style.top=t.y-t.height-e.popover.offsetHeight-5+"px"):(e.popover.classList.remove("reverse-direction"),e.popover.style.top=t.y+5+"px")}function Ma(e){e.popover.classList.remove("is-visible")}function La(e,t=!1){let a="";const i=Mt(e);if(i){const s=t?e.anchorOffset()+1:i.end,o=e.siblings();for(let e=i.start;e"placeholder"===e.type));Pt(e,0),e.path[e.path.length-1].offset=a.start-1,0!==i.length&&At(e,1,!1)||$t(e,a.start+t.length-1)}else e.siblings().splice(a.start,a.end-a.start),$t(e,a.start-1,0);wt(e)}}const $a={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function za(e){return e.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function _a(e,t){return e&&t.generateID?' extid="'+e+'"':""}function Da(e,t,a){let i=!1;t=t||e.atoms.length;let s="",o="",r=-1,n=-1;const l=e.atoms[e.index];if(e.index0){if(i=!0,qa(e)&&(r=e.index,e.index+=1),Ta(e)&&(n=e.index,e.index+=1),r>=0&&n>=0)s=""+o,s+=Oa(e.atoms[n].subscript,0,0,a).mathML,s+=Oa(e.atoms[r].superscript,0,0,a).mathML,s+="";else if(r>=0){if(s=""+o,qa(e)){const t=Oa(e.atoms[r].superscript,0,0,a).mathML,i=Oa(e.atoms[r+1].superscript,0,0,a).mathML;s+=""!==t&&""!==t||""!==i&&""!==i?""===t||""===t?"":t:""}else s+=Oa(e.atoms[r].superscript,0,0,a).mathML;s+=""}else n>=0?(s=""+o,s+=Oa(e.atoms[n].subscript,0,0,a).mathML,s+=""):s=o;"mi"!==e.lastType&&"mn"!==e.lastType&&"mtext"!==e.lastType&&"fence"!==e.lastType||/^(.*)<\/mo>$/.test(s)||(s=""+s),o.endsWith(">f")||o.endsWith(">g")?(s+="&x2061;",e.lastType="applyfunction"):e.lastType=/^(.*)<\/mo>$/.test(s)?"mo":"mi",e.mathML+=s}return i}function qa(e){return e.index"+e,s+=Oa(o.subscript,0,0,a).mathML,s+=Oa(o.superscript,0,0,a).mathML,s+=""):o.superscript?(s=""+e,s+=Oa(o.superscript,0,0,a).mathML,s+=""):o.subscript&&(s=""+e,s+=Oa(o.subscript,0,0,a).mathML,s+=""),s.length>0&&(i=!0,t.mathML+=s,t.lastType=""),i))}function Ea(e,t,a){let i=!1;t=t||e.atoms.length;const s=e.index;let o="";for(;e.index0&&(i=!0,o=""+o+"",e.mathML+=o,e.lastType="mtext"),i}function Fa(e,t,a){let i=!1;t=t||e.atoms.length;const s=e.index;let o="",r=function(e){let t=-1,a=e.index,i=!1,s=!1;for(;a=0&&r=0;)o+=e.atoms[e.index].body,e.index+=1;return o.length>0&&(i=!0,o=""+o+"",r<0&&qa(e)&&(r=e.index,e.index+=1),r>=0&&(o=""+o,o+=Oa(e.atoms[r].superscript,0,0,a).mathML,o+=""),e.mathML+=o,e.lastType="mn"),i}function Na(e,t,a){let i=!1;t=t||e.atoms.length;let s="",o="";if(e.index",s+=Ra(e.atoms[l],a),s+=Oa(e.atoms,l+1,c,a).mathML,s+=Ra(e.atoms[c],a),s+="","mi"!==e.lastType&&"mn"!==e.lastType&&"mfrac"!==e.lastType&&"fence"!==e.lastType||(s=""+s),e.index=c+1,Ka(s,e,a)&&(i=!0,e.lastType="",s=""),o="fence")}return s.length>0&&(i=!0,e.mathML+=s,e.lastType=o),i}function Ba(e,t,a){let i=!1;t=t||e.atoms.length;let s="",o="";const r=e.atoms[e.index];if(e.index":"")+e,s+=Oa(r.subscript,0,0,a).mathML,s+=Oa(r.superscript,0,0,a).mathML,s+="nolimits"!==r.limits?"":""):r.superscript?(s+=("nolimits"!==r.limits?"":"")+e,s+=Oa(r.superscript,0,0,a).mathML,s+="nolimits"!==r.limits?"":""):(s+=("nolimits"!==r.limits?"":"")+e,s+=Oa(r.subscript,0,0,a).mathML,s+="nolimits"!==r.limits?"":""),o="mo"}else{const t=e.atoms[e.index],r="\\operatorname"===t.symbol,n=r?'"+Pa(t.body)+"":Ra(t,a);s+=n,e.index+=1,Ka(s,e,a)&&(i=!0,e.lastType="",s=""),e.index-=1,r||/^(.*)<\/mo>$/.test(n)?o=r?"mi":"mo":(s+="",o="applyfunction")}"mi"!==e.lastType&&"mn"!==e.lastType||/^(.*)<\/mo>$/.test(s)||(s=""+s),e.index+=1}return s.length>0&&(i=!0,e.mathML+=s,e.lastType=o),i}function Oa(e,t,a,i){const s={atoms:e,index:null!=t?t:0,mathML:"",lastType:""};if("number"==typeof e||"boolean"==typeof e)s.mathML=e.toString();else if("string"==typeof e)s.mathML=e;else if(e instanceof Be)s.mathML=Ia(e,i);else if(Array.isArray(e)){let t=0;for(a=null!=a?a:e?e.length:0;s.index0&&"genfrac"===s.atoms[s.index].type&&(e=""+e),"genfrac"===s.atoms[s.index].type?s.lastType="mfrac":s.lastType="",e.length>0&&(s.mathML+=e,t+=1),s.index+=1}t>1&&(s.mathML=""+s.mathML+"")}return s}function Ra(e,t){let a="";const i=Pa(e.body);return i&&(a=""+i+""),a}function Pa(e){if(!e)return"";if("string"==typeof e)return za(e);if(!Array.isArray(e)&&"string"==typeof e.body)return za(e.body);let t="";for(const a of e)"string"==typeof a.body&&(t+=a.body);return za(t)}function Ia(e,t){const a={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋"},i={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},s={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let o,r,n,l,c,d,m="",p="",h={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[e.fontFamily||e.font]||"";h&&(h=' mathvariant="'+h+'"');const u=e.symbol;if("text"===e.mode)m=""+e.body+"";else switch(e.type){case"first":break;case"group":case"root":m=Oa(e.body,0,0,t).mathML;break;case"array":if((e.lFence&&"."!==e.lFence||e.rFence&&"."!==e.rFence)&&(m+="",e.lFence&&"."!==e.lFence&&(m+=""+($a[e.lFence]||e.lFence)+"")),m+="",o=0;o"+Oa(e.array[r][o],0,0,t).mathML+"";m+=""}m+="",(e.lFence&&"."!==e.lFence||e.rFence&&"."!==e.rFence)&&(e.rFence&&"."!==e.rFence&&(m+=""+($a[e.lFence]||e.rFence)+""),m+="");break;case"genfrac":(e.leftDelim||e.rightDelim)&&(m+=""),e.leftDelim&&"."!==e.leftDelim&&(m+=""+($a[e.leftDelim]||e.leftDelim)+""),e.hasBarLine?(m+="",m+=Oa(e.numer,0,0,t).mathML||" ",m+=Oa(e.denom,0,0,t).mathML||" ",m+=""):(m+="",m+=""+Oa(e.numer,0,0,t).mathML+"",m+=""+Oa(e.denom,0,0,t).mathML+"",m+=""),e.rightDelim&&"."!==e.rightDelim&&(m+=""+($a[e.rightDelim]||e.rightDelim)+""),(e.leftDelim||e.rightDelim)&&(m+="");break;case"surd":e.index?(m+="",m+=Oa(e.body,0,0,t).mathML,m+=Oa(e.index,0,0,t).mathML,m+=""):(m+="",m+=Oa(e.body,0,0,t).mathML,m+="");break;case"leftright":m="",e.leftDelim&&"."!==e.leftDelim&&(m+=""+($a[e.leftDelim]||e.leftDelim)+""),e.body&&(m+=Oa(e.body,0,0,t).mathML),e.rightDelim&&"."!==e.rightDelim&&(m+=""+($a[e.rightDelim]||e.rightDelim)+""),m+="";break;case"sizeddelim":case"delim":m+='"+($a[e.delim]||e.delim)+"";break;case"accent":m+='",m+=Oa(e.body,0,0,t).mathML,m+=""+($a[u]||e.accent)+"",m+="";break;case"line":case"overlap":break;case"overunder":c=e.overscript,l=e.underscript,(e.svgAbove||c)&&(e.svgBelow||l)?d=e.body:c?(d=e.body,e.body&&e.body[0]&&e.body[0].underscript?(l=e.body[0].underscript,d=e.body[0].body):e.body&&e.body[0]&&"first"===e.body[0].type&&e.body[1]&&e.body[1].underscript&&(l=e.body[1].underscript,d=e.body[1].body)):l&&(d=e.body,e.body&&e.body[0]&&e.body[0].overscript?(c=e.body[0].overscript,d=e.body[0].body):e.body&&e.body[0]&&"first"===e.body[0].type&&e.body[1]&&e.body[1].overscript&&(c=e.body[1].overscript,d=e.body[1].body)),(e.svgAbove||c)&&(e.svgBelow||l)?(m+=``,m+=a[e.svgBody]||Oa(d,0,0,t).mathML,m+=a[e.svgBelow]||Oa(l,0,0,t).mathML,m+=a[e.svgAbove]||Oa(c,0,0,t).mathML,m+=""):e.svgAbove||c?(m+=``+(a[e.svgBody]||Oa(d,0,0,t).mathML),m+=a[e.svgAbove]||Oa(c,0,0,t).mathML,m+=""):(e.svgBelow||l)&&(m+=``+(a[e.svgBody]||Oa(d,0,0,t).mathML),m+=a[e.svgBelow]||Oa(l,0,0,t).mathML,m+="");break;case"placeholder":case"mord":{m=i[u]||u||("string"==typeof e.body?e.body:"");const a=u?u.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;a?m="&#x"+a[1]+";":m.length>0&&"\\"===m.charAt(0)&&(m="string"==typeof e.body&&e.body.charCodeAt(0)>255?"&#x"+("000000"+e.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof e.body?e.body.charAt(0):e.body);const s=/\d/.test(m)?"mn":"mi";m="<"+s+h+_a(e.id,t)+">"+za(m)+"";break}case"mbin":case"mrel":case"textord":case"minner":m=u&&i[u]?""+i[u]+"":u&&$a[u]?""+$a[u]+"":Ra(e,t);break;case"mpunct":m='"+($a[u]||u)+"";break;case"mop":"​"!==e.body&&(m="",m+="\\operatorname"===u?e.body:u||e.body,m+="");break;case"mathstyle":break;case"box":m='"+Oa(e.body,0,0,t).mathML+"";break;case"spacing":m+='';break;case"enclose":m=''+Oa(e.body,0,0,t).mathML+"";break;case"space":m+=" "}return m}function Ha(e,t){return Oa(e,0,0,t).mathML}function Wa(e){let t=0;for(let a=0;a{ga(e)&&e.dirty&&Ua(e)}))}function Ua(e,t){t=null!=t?t:{},e.dirty=!1,window.mathlive||(window.mathlive={}),Vt(e.model)||(e.model.path=[{relation:"body",offset:0}]),e.model.root.forEach(e=>{e.caret="",e.isSelected=!1,e.containsCaret=!1});const a=e.$hasFocus();if(Rt(e.model)?Vt(e.model).caret=a&&!e.config.readOnly?e.mode:"":Gt(e.model,e=>{e.isSelected=!0}),a&&!e.config.readOnly){let t=e.model.ancestor(1),a=1,i=!1;for(;t&&!i;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,i=!0),a+=1,t=e.model.ancestor(a)}const i=_(Ne({mathstyle:c.displaystyle,letterShapeStyle:e.config.letterShapeStyle,atomIdsSettings:{seed:Wa(e.model.root.toLatex(!1)),groupNumbers:t.forHighlighting},smartFence:e.config.smartFence,macros:e.config.macros},e.model.root),"ML__base");i.attributes={translate:"no","aria-hidden":"true"};const s=q(i,"ML__mathlive");e.field.innerHTML=e.config.createHTML(s.toMarkup(0,e.config.horizontalSpacingScale)),e.field.classList.toggle("ML__focused",a&&!e.config.readOnly),e.accessibleNode.innerHTML=e.config.createHTML(''+Ha(e.model.root,e.config)+"");const o=ba(e.field);if(o){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=o.left+"px",t.style.top=o.top+"px",t.style.width=Math.ceil(o.right-o.left)+"px",t.style.height=Math.ceil(o.bottom-o.top-1)+"px",e.field.insertBefore(t,e.field.childNodes[0])}}const ja={};function Ga(e,t){t=null!=t?t:{target:"mathfield",canUndo:!1},Object.keys(e).forEach(a=>{ja[a]={...t,fn:e[a]}})}function Za(e,t=",",a){if(!e)return[];let i,s=[];for(let o of e)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(i?s.push(i):i=new Be("math","mpunct",t,a),s=s.concat(o));return s}function Xa(t,a){const i=t.parent();if(i&&"array"===i.type&&e(i.array)){const e=t.relation();if(i.array){const s=ut(i.array,e);"after row"===a||"before row"===a?(s.col=0,s.row=s.row+("after row"===a?1:0),i.array.splice(s.row,0,[[]])):(s.col+="after column"===a?1:0,i.array[s.row].splice(s.col,0,[]));const o=ht(i.array,s);t.path.pop(),t.path.push({relation:"cell"+o.toString(),offset:0}),t.insertFirstAtom()}}}function Ya(e){var t;const a=e.parent();if("leftright"===a.type){a.type="array";const i=null!==(t={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[a.leftDelim])&&void 0!==t?t:"matrix",s=ie(i),o=[[a.body]];Object.assign(a,s.parser(i,[],o)),a.mode=Lt(e),a.environmentName=i,a.array=o,a.rowGaps=[0],delete a.body,e.path[e.path.length-1].relation="cell0"}}function Ja(e){return kt(e),Ya(e),Xa(e,"after row"),wt(e),!0}function Qa(e){return kt(e),Ya(e),Xa(e,"after column"),wt(e),!0}function ei(e,t=0){kt(e),vt(e);const a=e.suppressChangeNotifications;if(e.suppressChangeNotifications=!0,t=t<0?-1:t>0?1:t,nt(e),e.parent().array&&t<0&&0===e.startOffset()){const t=e.parent().array;if(function(e){const t={col:0,row:0};for(;t.row0){let e=t.length;"first"===t[0].type&&(e-=1),e>0&&(a+=1)}i.row+=1}return a}(t,a.col)&&(function(e,t){let a=0;for(;a"placeholder"!==e.type&&"first"!==e.type);e.parent()[t]=null,e.path.pop(),e.siblings().splice(e.anchorOffset(),0,...a),$t(e,e.anchorOffset()-1),e.announce("deleted: "+t)}else if("denom"===t){const t=e.parent().numer.filter(e=>"placeholder"!==e.type&&"first"!==e.type),a=e.parent().denom.filter(e=>"placeholder"!==e.type&&"first"!==e.type);e.path.pop(),e.siblings().splice(e.anchorOffset(),1,...a),e.siblings().splice(e.anchorOffset(),0,...t),$t(e,e.anchorOffset()+t.length-1),e.announce("deleted: denominator")}else if("body"===t){const t=e.siblings().filter(e=>"placeholder"!==e.type);e.path.length>1&&(t.shift(),e.path.pop(),e.siblings().splice(e.anchorOffset(),1,...t),$t(e,e.anchorOffset()-1),e.announce("deleted: root"))}else Dt(e,-1),ti(e,-1)}else if(t>0)if(a!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(e.sibling(1).type)?Dt(e,1):(e.announce("deleted",null,i.slice(a+1,a+2)),i.splice(a+1,1));else if("numer"===e.relation()){const t=e.parent().numer.filter(e=>"placeholder"!==e.type&&"first"!==e.type),a=e.parent().denom.filter(e=>"placeholder"!==e.type&&"first"!==e.type);e.path.pop(),e.siblings().splice(e.anchorOffset(),1,...a),e.siblings().splice(e.anchorOffset(),0,...t),$t(e,e.anchorOffset()+t.length-1),e.announce("deleted: numerator")}else Dt(e,1),ti(e,-1)}else{const t=e.startOffset()+1,a=e.endOffset()+1;e.announce("deleted",null,i.slice(t,a)),i.splice(t,a-t),$t(e,t-1)}lt(e),e.suppressChangeNotifications=a,xt(e),wt(e)}function ti(e,t=0){if(0===t)ei(e,0);else if(t>0)for(;t>0;)ei(e,1),t--;else for(;t<0;)ei(e,-1),t++;return!0}Ga({performWithFeedback:(e,t)=>function(e,t){return e.$focus(),e.config.keypressVibration&&(null===navigator||void 0===navigator?void 0:navigator.vibrate)&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,e=>e[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?e.returnKeypressSound?(e.returnKeypressSound.load(),e.returnKeypressSound.play().catch(e=>{})):e.keypressSound&&(e.keypressSound.load(),e.keypressSound.play().catch(e=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!e.deleteKeypressSound?e.keypressSound&&(e.keypressSound.load(),e.keypressSound.play().catch(e=>{})):(e.deleteKeypressSound.load(),e.deleteKeypressSound.play().catch(e=>{})),e.$perform(t)}(e,t)}),Ga({addRowAfter:Ja,addColumnAfter:Qa,addRowBefore:function(e){return kt(e),Ya(e),Xa(e,"before row"),wt(e),!0},addColumnBefore:function(e){return kt(e),Ya(e),Xa(e,"before column"),wt(e),!0}},{target:"model",category:"array-edit"});const ai={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},arcsin:{mode:"math",value:"\\arcsin"},arccos:{mode:"math",value:"\\arccos"},arctan:{mode:"math",value:"\\arctan"},sin:{mode:"math",value:"\\sin"},sinh:{mode:"math",value:"\\sinh"},cos:{mode:"math",value:"\\cos"},cosh:{mode:"math",value:"\\cosh"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},sec:{mode:"math",value:"\\sec"},csc:{mode:"math",value:"\\csc"},cot:{mode:"math",value:"\\cot"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ii(e,t,a){var i;return function(e,t){if(!t)return"";if("string"==typeof t)return t;if(!e)return t.value;let a=!1,i=!1,s=!1,o=!1,r=!1,n=!1,l=!1,c=!1,d=!1,m=!1,p=!1,h=!1,u=!1,f=!1,g=e[e.length-1],y=e.length-1;for(;g&&/msubsup|placeholder/.test(g.type);)y-=1,g=e[y];if(a=!g||"first"===g.type,g){if(void 0!==t.mode&&g.mode!==t.mode)return"";u="text"===g.mode,i=!u&&"mord"===g.type&&V.test(g.body),s=!u&&"mord"===g.type&&/[0-9]+$/.test(g.body),o=!u&&g.isFunction,r="genfrac"===g.type,n="surd"===g.type,l="mbin"===g.type,c="mrel"===g.type,d="mpunct"===g.type||"minner"===g.type,m=!!g.array,p="mopen"===g.type,h="mclose"===g.type||"leftright"===g.type,f="space"===g.type}return void 0!==t.after?/nothing/.test(t.after)&&a||/letter/.test(t.after)&&i||/digit/.test(t.after)&&s||/function/.test(t.after)&&o||/frac/.test(t.after)&&r||/surd/.test(t.after)&&n||/binop/.test(t.after)&&l||/relop/.test(t.after)&&c||/punct/.test(t.after)&&d||/array/.test(t.after)&&m||/openfence/.test(t.after)&&p||/closefence/.test(t.after)&&h||/text/.test(t.after)&&u||/space/.test(t.after)&&f?t.value:"":t.value}(e,null!==(i=null==a?void 0:a[t])&&void 0!==i?i:ai[t])}function si(e,t){if(!e)return["latex",""];if(e.length<=1)return["latex",e];if(!t||"ASCIIMath"!==t.format){const t=e.trim();if(t.startsWith("$$")&&t.endsWith("$$")||t.startsWith("\\[")&&t.endsWith("\\]")||t.startsWith("\\(")&&t.endsWith("\\)"))return["latex",t.substring(2,t.length-2)];if(t.startsWith("$")&&t.endsWith("$"))return["latex",t.substring(1,t.length-1)];if(e=e.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(e))return["latex",e]}return e=(e=(e=(e=(e=(e=e.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),[(null==t?void 0:t.format)||"ASCIIMath",oi(e,null!=t?t:{})]}function oi(e,t){var a,i,s,o,r,n,l;if(!e)return"";let c,d=!1;if(d||"^"!==e[0]&&"_"!==e[0]||(c=ri(e.substr(1),{inlineShortcuts:null!==(a=null==t?void 0:t.inlineShortcuts)&&void 0!==a?a:{},noWrap:!0}),e=e[0]+"{"+c.match+"}",e+=oi(c.rest,t),d=!0),d||(c=e.match(/^(sqrt|\u221a)(.*)/),c&&(c=ri(c[2],{inlineShortcuts:null!==(i=null==t?void 0:t.inlineShortcuts)&&void 0!==i?i:{},noWrap:!0}),e="\\sqrt{"+c.match+"}",e+=oi(c.rest,t),d=!0)),d||(c=e.match(/^(\\cbrt|\u221b)(.*)/),c&&(c=ri(c[2],{inlineShortcuts:null!==(s=null==t?void 0:t.inlineShortcuts)&&void 0!==s?s:{},noWrap:!0}),e="\\sqrt[3]{"+c.match+"}",e+=oi(c.rest,t),d=!0)),d||(c=e.match(/^abs(.*)/),c&&(c=ri(c[1],{inlineShortcuts:null!==(o=null==t?void 0:t.inlineShortcuts)&&void 0!==o?o:{},noWrap:!0}),e="\\left|"+c.match+"\\right|",e+=oi(c.rest,t),d=!0)),d||(c=e.match(/^["”“](.*?)["”“](.*)/),c&&(e="\\text{"+c[1]+"}",e+=oi(c[2],t),d=!0)),d||(c=e.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),c&&(e=ni(c[1],t),e+=oi(c[2],t),d=!0)),!d&&/^(f|g|h)[^a-zA-Z]/.test(e)&&(c=ri(e.substring(1),{inlineShortcuts:null!==(r=t.inlineShortcuts)&&void 0!==r?r:{},noWrap:!0}),e="("===e[1]?e[0]+"\\mleft("+c.match+"\\mright)":e[0]+c.match,e+=oi(c.rest,t),d=!0),d||(c=e.match(/^([a-zA-Z]+)(.*)/),c&&(e=ni(c[1],t),e+=oi(c[2],t),d=!0)),!d)if(c=ri(e,{inlineShortcuts:null!==(n=t.inlineShortcuts)&&void 0!==n?n:{},noWrap:!0}),c.match&&"/"===c.rest[0]){const a=ri(c.rest.substr(1),{inlineShortcuts:null!==(l=t.inlineShortcuts)&&void 0!==l?l:{},noWrap:!0});a.match&&(e="\\frac{"+c.match+"}{"+a.match+"}"+oi(a.rest,t)),d=!0}else c.match&&(e="("===e[0]?"\\left("+c.match+"\\right)"+oi(c.rest,t):c.match+oi(c.rest,t),d=!0);return d||(c=e.match(/^(\s+)(.*)$/),c&&(e=" "+oi(c[2],t),d=!0)),e}function ri(e,t){let a="",i=e=e.trim(),s=e.charAt(0),o={"(":")","{":"}","[":"]"}[s];if(o){let r=1,n=1;for(;n0;)e[n]===s&&r++,e[n]===o&&r--,n++;0===r?(t.noWrap&&"("===s?a=oi(e.substring(1,n-1),t):("{"===s&&"}"===o&&(s="\\{",o="\\}"),a="\\left"+s+oi(e.substring(1,n-1),t)+"\\right"+o),i=e.substring(n)):(a=e.substring(1,n),i="")}else{let s=e.match(/^([a-zA-Z]+)/);if(s){let a=ii(null,e,t.inlineShortcuts);if(a)return a=a.replace("_{#?}",""),a=a.replace("^{#?}",""),{match:a,rest:e.substring(a.length)}}if(s=e.match(/^([a-zA-Z])/),s)return{match:s[1],rest:e.substring(1)};if(s=e.match(/^(-)?\d+(\.\d*)?/),s)return{match:s[0],rest:e.substring(s[0].length)};/^\\(left|right)/.test(e)||(s=e.match(/^(\\[a-zA-Z]+)/),s&&(i=e.substring(s[1].length),a=s[1]))}return{match:a,rest:i}}function ni(e,t){let a=ii(null,e,t);return a?(a=a.replace("_{#?}",""),a=a.replace("^{#?}",""),a+=" "):a=e,a}function li(e,t,a){const i=e.parent();let s="leftright"===i.type?i.leftDelim+i.rightDelim:"";if("\\lbrace\\rbrace"===s&&(s="{}"),"\\{\\}"===s&&(s="{}"),"{}"===s&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return di(e,"\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:a}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrock");const o=I[t];if(o&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const s=Rt(e)||"placeholder"===Vt(e).type;i=e.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=s?"?":o;let r=[];return s&&(r=e.siblings().splice(e.anchorOffset()+1,e.siblings().length)),di(e,i,{mode:"math",format:"latex",style:a}),s&&(e.sibling(0).body=r,Dt(e,-1)),!0}let r;if(Object.keys(I).forEach(e=>{t===I[e]&&(r=e)}),r){if(i&&"leftright"===i.type&&e.endOffset()===e.siblings().length-1)return kt(e),i.rightDelim=t,Dt(e,1),wt(e),!0;const s=e.siblings();let o;for(o=e.endOffset();o>=0&&("leftright"!==s[o].type||"?"!==s[o].rightDelim);o--);if(o>=0)return kt(e),s[o].rightDelim=t,s[o].body=s[o].body.concat(s.slice(o+1,e.endOffset()+1)),s.splice(o+1,e.endOffset()-o),$t(e,o),wt(e),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){kt(e),i.rightDelim=t;const a=s.slice(e.endOffset()+1);return s.splice(e.endOffset()+1),e.path.pop(),e.siblings().splice(e.endOffset()+1,0,...a),wt(e),!0}const r=e.ancestor(2);return!(!r||"leftright"!==r.type||"?"!==r.rightDelim||e.endOffset()!==s.length-1)&&(Dt(e,1),li(e,t,a))}return!1}function ci(e,t){if(Rt(e))return!1;function a(t,a){let i=!0;return Gt(e,e=>{i=i&&e[t]===a},{recursive:!0}),i}return t.color&&a("color",t.color)&&(t.color="none"),t.backgroundColor&&a("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&a("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&a("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&a("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&a("fontSize",t.fontSize)&&(t.fontSize="size5"),kt(e),Gt(e,e=>e.applyStyle(t),{recursive:!0}),wt(e),!0}function di(e,t,a){var i,s,o,r;if(null!==(i=a.smartFence)&&void 0!==i&&i){if(li(e,t,a.style))return}else{const a=e.parent();if("leftright"===(null==a?void 0:a.type)&&"?"===a.rightDelim&&e.endOffset()===e.siblings().length-1&&/^[)}\]|]$/.test(t))return kt(e),a.rightDelim=t,Dt(e,1),void wt(e)}const n=e.suppressChangeNotifications;a.suppressChangeNotifications&&(e.suppressChangeNotifications=!0),kt(e);const l=e.suppressChangeNotifications;e.suppressChangeNotifications=!0,a.insertionMode||(a.insertionMode="replaceSelection"),a.selectionMode||(a.selectionMode="placeholder"),a.format||(a.format="auto"),a.macros=null!==(s=a.macros)&&void 0!==s?s:e.options.macros;const c=a.mode||Lt(e);let d;const m=[Nt(e)],p=null!==(o=a.placeholder)&&void 0!==o?o:"\\placeholder{}";m["?"]=p,"replaceSelection"!==a.insertionMode||Rt(e)?"replaceAll"===a.insertionMode?(e.root.body=[],e.root.latex="",e.path=[{relation:"body",offset:0}],e.extent=0):"insertBefore"===a.insertionMode?Ht(e):"insertAfter"===a.insertionMode&&It(e):ti(e);const h=e.siblings(),u=e.startOffset();if(u+10&&h[u]&&"placeholder"===h[u].type&&ti(e,-1),"math"===c&&"ASCIIMath"===a.format)[,t]=si(t,{format:"ASCIIMath"}),d=ot(t,"math",null,null==a?void 0:a.macros,!1,e.listeners.onError),pi(e,d);else if("text"===c||"auto"!==a.format&&"latex"!==a.format)"text"!==c&&"text"!==a.format||(d=ot(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),"text",m,a.macros,!1,e.listeners.onError));else if("command"===c){d=[];for(const e of t)W.test(e)&&d.push(new Be("command","command",e))}else if(""===t)d=[new Be("command","command","\\")];else{if("auto"===a.format&&([a.format,t]=si(t)),m[0])t=t.replace(/(^|[^\\])#@/g,"$1#0");else if(/(^|[^\\])#@/.test(t)){const a=function(e){const t=e.siblings();let a=e.startOffset();if("text"===t[a].mode)for(;a>=1&&"text"===t[a].mode;)a--;else for(;a>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[a].type);)a--;return a}(e);t=t.replace(/(^|[^\\])#@/g,"$1"+function(e,t,a){const i=e.siblings();if(rt(i))return"";if("first"===i[0].type&&0===t&&(t=1),"root"===e.parent().type&&1===t&&a===i.length-1)return e.parent().toLatex(!1);let s="",o=t;for(;o<=a;)s+=i[o].toLatex(!1),o++;return s}(e,a+1,e.startOffset())),function(e,t){t>0?e.siblings().splice(e.anchorOffset()+1,t):(e.siblings().splice(e.anchorOffset()+t+1,-t),$t(e,e.anchorOffset()+t))}(e,a-e.startOffset())}else t=t.replace(/(^|[^\\])#@/g,"$1#?");/^\$\$(.*)\$\$$/.test(t)&&(t=t.substring(2,t.length-2)),d=ot(t,c,m,a.macros,null!==(r=a.smartFence)&&void 0!==r&&r,e.listeners.onError),"latex"!==a.format&&pi(e,d)}lt(e),function e(t,a){t&&a&&(Re(t)?t.forEach(t=>e(t,a)):"object"==typeof t&&(t.color||t.backgroundColor||t.fontFamily||t.fontShape||t.fontSeries||t.fontSize||(t.applyStyle(a),e(t.body,a),e(t.numer,a),e(t.denom,a),e(t.index,a),e(t.overscript,a),e(t.underscript,a),e(t.subscript,a),e(t.superscript,a))))}(d,a.style);const f=e.parent();if("latex"!==a.format&&e.options.removeExtraneousParentheses&&f&&"leftright"===f.type&&"("===f.leftDelim&&rt(f.body)&&d&&1===d.length&&"genfrac"===d[0].type?(e.path.pop(),e.siblings()[e.anchorOffset()]=d[0]):("latex"!==a.format||1!==m.length||m[0]||"root"===f.type&&rt(f.body)&&(f.latex=t),Array.prototype.splice.apply(e.siblings(),[e.anchorOffset()+1,0].concat(d))),e.insertFirstAtom(),e.suppressChangeNotifications=l,"placeholder"===a.selectionMode){let t=[];for(const e of d)t=t.concat(e.filter(e=>"placeholder"===e.type));0!==t.length&&At(e,1,!1)?e.announce("move"):$t(e,e.anchorOffset()+d.length)}else"before"===a.selectionMode||("after"===a.selectionMode?$t(e,e.anchorOffset()+d.length):"item"===a.selectionMode&&$t(e,e.anchorOffset(),d.length));wt(e),e.suppressChangeNotifications=n}function mi(e){if(e)return 1===e.length&&"leftright"===e[0].type&&"("===e[0].leftDelim&&(e=e[0].body),e}function pi(e,t){if(t&&e.options.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Re(t[e].body)){let a=0,i=0,s=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(a++,i=o),"first"!==t[e].body[o].type&&s++;0===s&&1===a&&(t[e]=t[e].body[i])}t.forEach(t=>{if("genfrac"===t.type&&(pi(e,t.numer),pi(e,t.denom),t.numer=mi(t.numer),t.denom=mi(t.denom)),t.superscript&&(pi(e,t.superscript),t.superscript=mi(t.superscript)),t.subscript&&(pi(e,t.subscript),t.subscript=mi(t.subscript)),t.underscript&&(pi(e,t.underscript),t.underscript=mi(t.underscript)),t.overscript&&(pi(e,t.overscript),t.overscript=mi(t.overscript)),t.index&&(pi(e,t.index),t.index=mi(t.index)),"surd"===t.type?(pi(e,t.body),t.body=mi(t.body)):Re(t.body)&&pi(e,t.body),t.array)for(let a=gt(t.array);a>=0;a--)pi(e,ft(t.array,a))})}}function hi(e){if(It(e),!Vt(e).superscript)if(Vt(e).subscript)Vt(e).superscript=[new Be("","first")];else{const t=e.sibling(1);(null==t?void 0:t.superscript)?e.path[e.path.length-1].offset+=1:(null==t?void 0:t.subscript)?(e.path[e.path.length-1].offset+=1,Vt(e).superscript=[new Be("","first")]):("limits"!==Vt(e).limits&&(e.siblings().splice(e.anchorOffset()+1,0,new Be(e.parent().mode,"msubsup","​",Ct(e))),e.path[e.path.length-1].offset+=1),Vt(e).superscript=[new Be("","first")])}return e.path.push({relation:"superscript",offset:0}),Bt(e),!0}Ga({moveToOpposite:e=>{const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[e.relation()];return t||hi(e),e.parent()[t]||(e.parent()[t]=[new Be("","first")]),$t(e,0,"end",t),!0},moveBeforeParent:e=>e.path.length>1?(e.path.pop(),$t(e,e.anchorOffset()-1),!0):(e.announce("plonk"),!1),moveAfterParent:e=>Wt(e),moveToNextPlaceholder:e=>At(e,1),moveToPreviousPlaceholder:e=>At(e,-1),moveToNextChar:e=>Dt(e,1),moveToPreviousChar:e=>Dt(e,-1),moveUp:e=>qt(e),moveDown:e=>Tt(e),moveToNextWord:e=>Et(e,1),moveToPreviousWord:e=>Et(e,-1),moveToGroupStart:e=>$t(e,0),moveToGroupEnd:e=>$t(e,-1),moveToMathFieldStart:e=>Ft(e,-1),moveToMathFieldEnd:e=>Ft(e,1),moveToSuperscript:e=>hi(e),moveToSubscript:e=>function(e){if(It(e),!Vt(e).subscript)if(Vt(e).superscript)Vt(e).subscript=[new Be("","first")];else{const t=e.sibling(1);(null==t?void 0:t.subscript)?e.path[e.path.length-1].offset+=1:(null==t?void 0:t.superscript)?(e.path[e.path.length-1].offset+=1,Vt(e).subscript=[new Be("","first")]):("limits"!==Vt(e).limits&&(e.siblings().splice(e.anchorOffset()+1,0,new Be(e.parent().mode,"msubsup","​",Ct(e))),e.path[e.path.length-1].offset+=1),Vt(e).subscript=[new Be("","first")])}return e.path.push({relation:"subscript",offset:0}),Bt(e),!0}(e)},{target:"model",category:"selection-anchor"}),Ga({selectGroup:e=>Bt(e),selectAll:e=>Ot(e),extendToNextChar:e=>Kt(e,1),extendToPreviousChar:e=>Kt(e,-1),extendToNextWord:e=>Et(e,1,{extend:!0}),extendToPreviousWord:e=>Et(e,-1,{extend:!0}),extendUp:e=>qt(e,{extend:!0}),extendDown:e=>Tt(e,{extend:!0}),extendToNextBoundary:e=>Et(e,1,{extend:!0}),extendToPreviousBoundary:e=>Et(e,-1,{extend:!0}),extendToGroupStart:e=>Pt(e,-e.anchorOffset()),extendToGroupEnd:e=>Pt(e,e.siblings().length-e.anchorOffset()),extendToMathFieldStart:e=>Ft(e,-1,{extend:!0}),extendToMathFieldEnd:e=>Ft(e,1,{extend:!0})},{target:"model",category:"selection-extend"}),Ga({deleteAll:e=>(Ot(e),ti(e)),deleteNextChar:e=>ti(e,1),deletePreviousChar:e=>ti(e,-1),deleteNextWord:e=>(Et(e,1,{extend:!0}),ti(e)),deletePreviousWord:e=>(Et(e,-1,{extend:!0}),ti(e)),deleteToGroupStart:e=>(Pt(e,-e.anchorOffset()),ti(e)),deleteToGroupEnd:e=>(Ft(e,-1,{extend:!0}),ti(e)),deleteToMathFieldStart:e=>(Ft(e,-1,{extend:!0}),ti(e)),deleteToMathFieldEnd:e=>(Ft(e,1,{extend:!0}),ti(e))},{target:"model",category:"delete"});const ui=["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"];function fi(e){return!e.ctrlKey&&!e.metaKey&&"Dead"!==e.key&&ui.indexOf(e.code)>=0}function gi(e){const t=[];return(e=function(e){if(!e.code){const t=Object.entries(oa().mapping);let a,i=!1,s=!1;for(let o=0;o<4;o++){for(const[r,n]of t)if(n[o]===e.key){a=r,3===o?(i=!0,s=!0):2===o?i=!0:1===o&&(s=!0);break}if(a)break}return new KeyboardEvent(e.type,{...e,altKey:i,shiftKey:s,code:a})}return new KeyboardEvent(e.type,e)}(e)).ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),0===t.length?"["+e.code+"]":(t.push("["+e.code+"]"),t.join("+"))}function yi(e){var t;if(!e)return"";let a;return"Unidentified"===e.key&&e.target&&(a=e.target.value),a=null!==(t=null!=a?a:e.key)&&void 0!==t?t:e.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(a)&&(a=""),a}class bi{constructor(e){this.mathlist=e,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(e){this.canUndo()&&("function"==typeof(null==e?void 0:e.onUndoStateWillChange)&&e.onUndoStateWillChange(this.mathlist.mathfield,"undo"),this.restore(this.stack[this.index-1],e),this.index-=1,e&&"function"==typeof e.onUndoStateDidChange&&e.onUndoStateDidChange(this.mathlist.mathfield,"undo"),this.canCoalesce=!1)}redo(e){this.canRedo()&&("function"==typeof(null==e?void 0:e.onUndoStateWillChange)&&e.onUndoStateWillChange(this.mathlist.mathfield,"redo"),this.index+=1,this.restore(this.stack[this.index],e),e&&"function"==typeof e.onUndoStateDidChange&&e.onUndoStateDidChange(this.mathlist.mathfield,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(e){this.record&&("function"==typeof(null==e?void 0:e.onUndoStateWillChange)&&e.onUndoStateWillChange(this.mathlist.mathfield,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(!1),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),e&&"function"==typeof e.onUndoStateDidChange&&e.onUndoStateDidChange(this.mathlist.mathfield,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(e){this.canCoalesce&&this.pop(),this.snapshot(e),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(!1),selection:this.mathlist.toString()}}restore(e,t){const a=this.mathlist.suppressChangeNotifications;void 0!==t.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=t.suppressChangeNotifications),di(this.mathlist,e?e.latex:"",{...t,format:"latex",mode:"math",insertionMode:"replaceAll",selectionMode:"after",smartFence:!1}),jt(this.mathlist,e?e.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=a}}const vi={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},xi={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"};function ki(t){if(!t)return"";if(e(t)){let e="";if(0===t.length)return"";if("first"===t[0].type&&t.shift(),0===t.length)return"";if("text"===t[0].mode){let a=0;for(e='"';t[a]&&"text"===t[a].mode;)e+=t[a].body,a++;e+='"'+ki(t.slice(a))}else if("math"===t[0].mode){let a=0;for(;t[a]&&"math"===t[a].mode;)e+=ki(t[a]),a++;e+=ki(t.slice(a))}return e.trim()}if("text"===t.mode)return'"'+t.body+'"';let a="";const i=t.symbol;let s;switch(t.type){case"group":case"root":a=ki(t.body);break;case"array":break;case"genfrac":(t.leftDelim||t.rightDelim)&&(a+="."!==t.leftDelim&&t.leftDelim?t.leftDelim:"{:"),t.hasBarLine?(a+="(",a+=ki(t.numer),a+=")/(",a+=ki(t.denom),a+=")"):(a+="("+ki(t.numer)+"),",a+="("+ki(t.denom)+")"),(t.leftDelim||t.rightDelim)&&(a+="."!==t.rightDelim&&t.rightDelim?t.rightDelim:"{:");break;case"surd":t.index?a+="root("+ki(t.index)+")("+ki(t.body)+")":a+="sqrt("+ki(t.body)+")";break;case"leftright":a+="."!==t.leftDelim&&t.leftDelim?t.leftDelim:"{:",a+=ki(t.body),a+="."!==t.rightDelim&&t.rightDelim?t.rightDelim:":}";break;case"sizeddelim":case"delim":case"overlap":case"overunder":break;case"mord":a=vi[i]||i||("string"==typeof t.body?t.body:""),"\\"===a[0]&&(a+=""),s=i?i.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,s?a=String.fromCharCode(parseInt("0x"+s[1])):a.length>0&&"\\"===a.charAt(0)&&(a="string"==typeof t.body?t.body.charAt(0):t.symbol);break;case"mbin":case"mrel":case"textord":case"minner":a=i&&vi[i]?vi[i]:i&&xi[i]?xi[i]:t.body;break;case"mopen":case"mclose":a+=t.body;break;case"mpunct":a=xi[i]||i;break;case"mop":"​"!==t.body&&(a="",a+="\\operatorname"===i?ki(t.body):t.body||i,a+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":a=" "}if(t.subscript){a+="_";const e=ki(t.subscript);e.length>1&&!/^(-)?\d+(\.\d*)?$/.test(e)?a+="("+e+")":a+=e}if(t.superscript){a+="^";const e=ki(t.superscript);e.length>1&&!/^(-)?\d+(\.\d*)?$/.test(e)?a+="("+e+")":a+=e}return a}const wi={};function Si(e){const t=wi.locale.substring(0,2);let a="";return wi.strings[wi.locale]&&(a=wi.strings[wi.locale][e]),!a&&wi.strings[t]&&(a=wi.strings[t][e]),a||(a=wi.strings.en[e]),a||(a=e),a}function Mi(e,t,a){nt(e);const i=[],s=t.substr(a);for(const e of s){const t=new Be("command","command",e);t.suggestion=!0,i.push(t)}Array.prototype.splice.apply(e.siblings(),[e.anchorOffset()+1,0].concat(i))}function Li(e,t){if(t=t||{acceptSuggestion:!1},Ma(e),t.discard)return Aa(e.model,null),e.switchMode("math"),!0;const a=La(e.model,!t.acceptSuggestion);if(a){if("\\("===a||"\\)"===a)Aa(e.model,[]),di(e.model,a.slice(1),{mode:e.mode});else{e.switchMode("math");const t=ot(a,"math",null,e.config.macros);t?Aa(e.model,t):Ca(e.model,!0)}return e.snapshot(),e.model.announce("replacement"),!0}return!1}function Ci(e){!function(e){const t=e.siblings(),a=Mt(e);let i=a.start;for(;i1)}return Va(e),!0}wi.plural=function(e,t,a){(a=null!=a?a:{}).type=a.type||"cardinal";const i=wi.locale.substring(0,2),s="ordinal"===a.type?wi._ordinal:wi._cardinal;let o,r="ordinal"===a.type?wi._ordinalPluralCategories.indexOf(s.select(e)):wi._cardinalPluralCategories.indexOf(s.select(e));return wi.strings[wi.locale]&&(o=wi.strings[wi.locale][t]),!o&&wi.strings[i]&&(o=wi.strings[i][t]),o||(o=wi.strings.en[t],o||(o=t),r="ordinal"===a.type?wi._ordinalPluralCategories.indexOf(wi._ordinalEnglish.select(e)):wi._cardinalPluralCategories.indexOf(wi._cardinalEnglish.select(e))),o.split(";")[r]||o.split(";")[0]},wi.merge=function(e,t){if(e&&t){const a=wi._locale;wi.locale=e,wi.strings[e]={...wi.strings[e],...t},wi.locale=a}else e&&!t&&Object.keys(e).forEach(t=>wi.merge(t,e[t]))},Object.defineProperty(wi,"locale",{set(e){wi._locale=e,wi._ordinal=null,wi._cardinal=null},get(){var e;return wi._locale||(wi._locale=null!==(e=null===navigator||void 0===navigator?void 0:navigator.language.slice(0,5))&&void 0!==e?e:"en"),wi._locale}}),Object.defineProperty(wi,"ordinal",{get:()=>(wi._ordinal||(wi._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),wi._ordinalEnglishPluralCategories=wi._ordinalEnglish.resolvedOptions().pluralCategories,wi._ordinal=new Intl.PluralRules(wi.locale,{type:"ordinal"}),wi._ordinalPluralCategories=wi._ordinal.resolvedOptions().pluralCategories),wi._ordinal)}),Object.defineProperty(wi,"cardinal",{get:()=>(wi._cardinal||(wi._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),wi._cardinalEnglishPluralCategories=wi._cardinalEnglish.resolvedOptions().pluralCategories,wi._cardinal=new Intl.PluralRules(wi.locale,{type:"cardinal"}),wi._cardinalPluralCategories=wi._ordinal.resolvedOptions().pluralCategories),wi._cardinal)}),wi.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.symbols":"Symbols","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.symbols":"حرف او رمز","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.symbols":"Symbole","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.symbols":"σύμβολα","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.symbols":"Símbolos","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.symbols":"نمادها","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"حروف رومی","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.symbols":"Symboles","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres romaines","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.symbols":"Simboli","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.symbols":"シンボル","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"ローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.symbols":"Symbolika","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.symbols":"Символы","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Латинские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}},Ga({complete:Li,nextSuggestion:function(e){return e.suggestionIndex+=1,Ci(e),!1},previousSuggestion:function(e){if(e.suggestionIndex-=1,e.suggestionIndex<0){nt(e.model);const t=oe(La(e.model));e.suggestionIndex=t.length-1}return Ci(e),!1}},{target:"mathfield",category:"autocomplete"});const Ai={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"eye ","\\sum":"Summation ","\\prod":"Product ",a:'a',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function $i(e){let t=0;if(Re(e))for(const a of e)"first"!==a.type&&(t+=1);return 1===t}function zi(e){let t="";if(Re(e))for(const a of e)"first"!==a.type&&"string"==typeof a.body&&(t+=a.body);return t}function _i(e,t){var a;const i={...t,textToSpeechRulesOptions:{...t.textToSpeechRulesOptions}};if(window.sre&&"sre"===i.textToSpeechRules){const t=Ha(e,i);return t?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=null!==(a=i.textToSpeechRulesOptions)&&void 0!==a?a:{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(t)):""}let s=function e(t,a,i){function s(e){return""+e+""}if(!a)return"";let o="";if(Re(a)){let r=!1,n=!1;for(let l=0;l'),o+=a.body;else{a.id&&"math"===t&&(o+='');let r="",n="",l="",c=!1;switch(a.type){case"group":case"root":o+=e("math",a.body,i);break;case"genfrac":if(r=e("math",a.numer,i),n=e("math",a.denom,i),$i(a.numer)&&$i(a.denom)){const e={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[zi(a.numer)+"/"+zi(a.denom)];e?o=e:o+=r+" over "+n}else o+=' the fraction '+r+', over '+n+'. End fraction.';break;case"surd":if(l=e("math",a.body,i),a.index){let t=e("math",a.index,i);t=t.trim();const s=t.replace(//g,"");o+="3"===s?' the cube root of '+l+'. End cube root':"n"===s?' the nth root of '+l+'. End root':' the root with index: '+t+', of '+l+'. End root'}else $i(a.body)?o+=" the square root of "+l+" , ":o+=' the square root of '+l+'. End square root';break;case"leftright":o+=Ai[a.leftDelim]||a.leftDelim,o+=e("math",a.body,i),o+=Ai[a.rightDelim]||a.rightDelim;break;case"rule":case"overunder":case"overlap":break;case"placeholder":o+="placeholder "+a.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const s=a.symbol;if("\\mathbin"===s||"\\mathrel"===s||"\\mathopen"===s||"\\mathclose"===s||"\\mathpunct"===s||"\\mathord"===s||"\\mathinner"===s){o=e(t,a.body,i);break}let r=a.body,n=a.symbol;if("delim"!==a.type&&"sizeddelim"!==a.type||(r=n=a.delim),"text"===t)o+=r;else{if("mbin"===a.type&&(o+=''),r){const e=Ai[r]||(n?Ai[n.trim()]:"");if(e)o+=" "+e;else{const e=n?function(e){let t="";return"\\"===e.charAt(0)&&(t=" "+e.replace("\\","")+" "),t}(n.trim()):"";o+=e||function(e){let t="";return i.textToSpeechMarkup?/[a-z]/.test(e)?t+=' '+e+"":/[A-Z]/.test(e)?t+="capital "+e.toLowerCase():t+=e:/[a-z]/.test(e)?t+=" '"+e.toUpperCase()+"'":/[A-Z]/.test(e)?t+=" 'capital "+e.toUpperCase()+"'":t+=e,t}(r)}}else o+=e("math",a.body,i);"mbin"===a.type&&(o+='')}break}case"mop":if("​"!==a.body){const t=a.symbol;if("\\sum"===t)if(a.superscript&&a.subscript){let t=e("math",a.superscript,i);t=t.trim();let s=e("math",a.subscript,i);s=s.trim(),o+=' the summation from '+s+' to '+t+' of ',c=!0}else if(a.subscript){let t=e("math",a.subscript,i);t=t.trim(),o+=' the summation from '+t+' of ',c=!0}else o+=" the summation of";else if("\\prod"===t)if(a.superscript&&a.subscript){let t=e("math",a.superscript,i);t=t.trim();let s=e("math",a.subscript,i);s=s.trim(),o+=' the product from '+s+' to '+t+' of ',c=!0}else if(a.subscript){let t=e("math",a.subscript,i);t=t.trim(),o+=' the product from '+t+' of ',c=!0}else o+=" the product of ";else if("\\int"===t)if(a.superscript&&a.subscript){let t=e("math",a.superscript,i);t=t.trim();let r=e("math",a.subscript,i);r=r.trim(),o+=' the integral from '+s(r)+' to '+s(t)+' of ',c=!0}else o+=' the integral of ';else"string"==typeof a.body?o+=Ai[a.body]||Ai[a.symbol]||" "+a.body:a.symbol&&("\\"===a.symbol[0]?o+=" "+a.symbol.substr(1):o+=" "+a.symbol)}break;case"enclose":l=e("math",a.body,i),$i(a.body)?o+=" crossed out "+l+" , ":o+=" crossed out "+l+". End cross out"}if(!c&&a.superscript){let s=e(t,a.superscript,i);s=s.trim();const r=s.replace(/<[^>]*>/g,"");if($i(a.superscript)){if("math"===t){const e=function(e){if(Re(e))for(const t of e)if("first"!==t.type&&t.id)return t.id.toString();return""}(a.superscript);e&&(o+='')}"′"===r?o+=" prime ":"2"===r?o+=" squared ":"3"===r?o+=" cubed ":isNaN(parseInt(r))?o+=" to the "+s+"; ":o+=' to the '+r+" power; "}else isNaN(parseInt(r))?o+=" raised to the "+s+"; ":o+=' raised to the '+r+" power; "}if(!c&&a.subscript){let t=e("math",a.subscript,i);t=t.trim(),$i(a.subscript)?o+=" sub "+t:o+=" subscript "+t+". End subscript. "}}return o}("math",e,i);if("ssml"===i.textToSpeechMarkup){let e="";i.speechEngineRate&&(e=''),s=''+e+"

"+s+"

"+(e?"
":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(e){let t="other";return(null===navigator||void 0===navigator?void 0:navigator.platform)&&(null===navigator||void 0===navigator?void 0:navigator.userAgent)&&(/^(mac)/i.test(navigator.platform)?t="mac":/^(win)/i.test(navigator.platform)?t="win":/(android)/i.test(navigator.userAgent)?t="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?t="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(t="chromeos")),"mac"===t?"mac":"!mac"}()?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s}function Di(e,t,a){return t+_i(a,{...e,textToSpeechMarkup:"",textToSpeechRulesOptions:{...e.textToSpeechRulesOptions,markup:"none"}})}function qi(e,t){if(!t&&window&&window.mathlive&&(t=window.mathlive.config),(t=null!=t?t:{}).speechEngine&&"local"!==t.speechEngine)if("amazon"===t.speechEngine){if(window&&window.AWS){const a=new window.AWS.Polly({apiVersion:"2016-06-10"}),i={OutputFormat:"mp3",VoiceId:t.speechEngineVoice,Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes(t.speechEngineVoice)?"neural":"standard",Text:e,TextType:"ssml"};a.synthesizeSpeech(i,(function(e,t){if(e);else if(null==t?void 0:t.AudioStream){const e=new Uint8Array(t.AudioStream),a=new Blob([e.buffer],{type:"audio/mpeg"}),i=URL.createObjectURL(a);new Audio(i).play().catch(e=>{})}}))}}else t.speechEngine;else{const t=new SpeechSynthesisUtterance(e);window&&window.speechSynthesis.speak(t)}}function Ti(e,t,a,i){let s="";"plonk"===t?(e.plonkSound&&(e.plonkSound.load(),e.plonkSound.play().catch(e=>{})),e.resetKeystrokeBuffer()):"delete"===t?s=Di(e.config,"deleted: ",i):"focus"===t||/move/.test(t)?s=(Rt(e.model)?"":"selected: ")+function(e,t){function a(e,t){return"body"===t.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[e.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[t.relation]}const i=t?t.path:[],s=e.model.path,o=s[s.length-1];let r="";for(;i.length>s.length;)r+="out of "+a(t.parent(),i[i.length-1])+"; ",i.pop();if(!Rt(e.model))return Di(e.config,"",Nt(e.model));const n=a(e.model.parent(),o);0===o.offset&&(r+=(n?"start of "+n:"unknown")+": ");const l=e.model.sibling(Math.max(1,e.model.extent));return l?r+=Di(e.config,"",l):0!==o.offset&&(r+=n?"end of "+n:"unknown"),r}(e,a):"replacement"===t?s=Di(e.config,"",e.model.sibling(0)):"line"===t?(s=Di(e.config,"",e.model.root),e.accessibleNode.innerHTML=e.config.createHTML(''+Ha(e.model.root,e.config)+""),e.textarea.setAttribute("aria-label","after: "+s)):s=i?Di(e.config,t+" ",i):t;const o=/\u00a0/.test(e.ariaLiveText.textContent)?"   ":"   ";e.ariaLiveText.textContent=s+o}Ga({speak:(e,t,a)=>function(e,t,a){a=null!=a?a:{withHighlighting:!1};const i=function(e,t){let a=null;switch(t){case"all":a=e.model.root;break;case"selection":Rt(e.model)||(a=Nt(e.model));break;case"left":{const t=e.model.siblings(),i=e.model.startOffset();if(i>=1){a=[];for(let e=1;e<=i;e++)a.push(t[e])}break}case"right":{const t=e.model.siblings(),i=e.model.endOffset()+1;if(i<=t.length-1){a=[];for(let e=i;e<=t.length-1;e++)a.push(t[e])}break}case"group":a=e.model.siblings();break;case"parent":{const t=e.model.parent();t&&"root"!==t.type&&(a=e.model.parent());break}}return a}(e,t);if(null===i)return e.config.speakHook(function(e){let t="";switch(e){case"all":break;case"selection":t="no selection";break;case"left":t="at start";break;case"right":t="at end";break;case"group":break;case"parent":t="no parent"}return t}(t),e.config),!1;const s={...e.config};(a.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml");const o=_i(i,s);return a.withHighlighting?(window.mathlive.readAloudMathField=e,Ua(e,{forHighlighting:!0}),e.config.readAloudHook&&e.config.readAloudHook(e.field,o,e.config)):e.config.speakHook&&e.config.speakHook(o,s),!1}(e,t,a)},{target:"mathfield",category:"speech"});const Ki=()=>{};function Ei(e){if("string"==typeof e){const t=new Audio;return t.preload="none",t.src=e,t.volume=.5,t}return e}function Fi(e){e instanceof HTMLAudioElement&&(e.pause(),e.removeAttribute("src"),e.load())}function Ni(t,a){const i=Bi(t,Object.keys(t));return Object.keys(a).forEach(t=>{var s;switch(t){case"scriptDepth":if(e(a.scriptDepth))i.scriptDepth=[a.scriptDepth[0],a.scriptDepth[1]];else{if("number"!=typeof a.scriptDepth)throw Error("Unexpected value for scriptDepth");i.scriptDepth=[a.scriptDepth,a.scriptDepth]}break;case"namespace":if(!/^[a-z]*[-]?$/.test(a.namespace))throw Error("namespace must be a string of lowercase characters only");/-$/.test(a.namespace)?i.namespace=a.namespace:i.namespace=a.namespace+"-";break;case"locale":i.locale="auto"===a.locale?wi.locale:a.locale;break;case"strings":wi.merge(a.strings);break;case"virtualKeyboardLayout":"auto"===a.virtualKeyboardLayout?i.virtualKeyboardLayout={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[wi.locale.substring(0,2)]||"qwerty":i.virtualKeyboardLayout=a.virtualKeyboardLayout;break;case"virtualKeyboardMode":{const e=null===(s=window.matchMedia)||void 0===s?void 0:s.call(window,"(any-pointer: coarse)").matches;"auto"===a.virtualKeyboardMode?i.virtualKeyboardMode=e?"onfocus":"off":i.virtualKeyboardMode=a.virtualKeyboardMode}break;case"letterShapeStyle":"auto"===a.letterShapeStyle?"fr"===wi.locale.substring(0,2)?i.letterShapeStyle="french":i.letterShapeStyle="tex":i.letterShapeStyle=a.letterShapeStyle;break;case"plonkSound":Fi(i.plonkSound),i.plonkSound=Ei(a.plonkSound);break;case"keypressSound":if(Fi(i.keypressSound),"string"==typeof a.keypressSound){const e=Ei(a.keypressSound);i.keypressSound={delete:e,return:e,spacebar:e,default:e}}else if(a.keypressSound instanceof HTMLAudioElement)i.keypressSound={delete:a.keypressSound,return:a.keypressSound,spacebar:a.keypressSound,default:a.keypressSound};else{if(!a.keypressSound.default)throw Error("Missing keypressSound.default");i.keypressSound={...a.keypressSound},i.keypressSound.return||(i.keypressSound.return=a.keypressSound.default),i.keypressSound.spacebar||(i.keypressSound.spacebar=a.keypressSound.default),i.keypressSound.delete||(i.keypressSound.delete=a.keypressSound.default)}break;case"onBlur":case"onFocus":case"onContentWillChange":case"onContentDidChange":case"onSelectionWillChange":case"onSelectionDidChange":case"onUndoStateWillChange":case"onUndoStateDidChange":case"onModeChange":case"onVirtualKeyboardToggle":case"onReadAloudStatus":case"onError":if(null===a[t])i[t]=Ki;else if("function"!=typeof a[t])throw Error(t+" must be a function or null");i[t]=a[t];break;default:e(a[t])?i[t]=[...a[t]]:"object"==typeof a[t]?i[t]={...a[t]}:i[t]=a[t]}}),void 0!==a.overrideDefaultInlineShortcuts&&(a.overrideDefaultInlineShortcuts?i.inlineShortcuts=a.inlineShortcuts:i.inlineShortcuts={...ai,...a.inlineShortcuts}),i}function Bi(t,a){let i;i="string"==typeof a?[a]:void 0===a?Object.keys(t):a;const s={};return i.forEach(a=>{e(s[a])?s[a]=[...s[a]]:"object"==typeof s[a]?s[a]={...s[a]}:s[a]=t[a]}),"string"==typeof a?s[a]:s}function Oi(e,t,a){"function"==typeof t&&(a=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(kt(e.model);!s;){const o=e.model.sibling(i);s=0===t||!o||"math"!==o.mode||!(/mord|textord|mpunct/.test(o.type)||"mop"===o.type&&/[a-zA-Z]+/.test(o.body))||!!o.superscript||!!o.subscript||a&&!a(o),s||(o.applyStyle({mode:"text"}),o.symbol=o.body,o.latex=""),i-=1,t-=1}wt(e.model)}function Ri(e,t,a){"function"==typeof t&&(a=t,t=1/0),void 0===t&&(t=1/0),kt(e.model);let i=0,s=!1;for(;!s;){const o=e.model.sibling(i);s=0===t||!o||"text"!==o.mode||" "===o.body||a&&!a(o),s||o.applyStyle({mode:"math"}),i-=1,t-=1}Pi(e),wt(e.model)}function Pi(e){let t=0;for(;e.model.sibling(t)&&"math"===e.model.sibling(t).mode;)t-=1;if(e.model.sibling(t)&&"text"===e.model.sibling(t).mode&&" "===e.model.sibling(t).body&&(!e.model.sibling(t-1)||"math"===e.model.sibling(t-1).mode)){kt(e.model),e.model.siblings().splice(t-1,1),wt(e.model);const a=e.model.suppressChangeNotifications;e.model.suppressChangeNotifications=!0,$t(e.model,e.model.anchorOffset()-1),e.model.suppressChangeNotifications=a}}function Ii(e,t,a){!function(e){const t=e.shiftKey&&e.altKey?3:e.altKey?2:e.shiftKey?1:0;if("Unidentified"===e.key)return;if("Dead"===e.key)return;const a=ea.filter(a=>{var i;return(null===(i=a.mapping[e.code])||void 0===i?void 0:i[t])===e.key});0!==a.length&&(a.forEach(e=>{e.score+=1}),ea.sort((e,t)=>t.score-e.score))}(a);const i=oa();if(e.keyboardLayout!==i.id&&(e.keyboardLayout=i.id,e.keybindings=ma(e.config.keybindings,t=>{"function"==typeof e.config.onError&&e.config.onError({code:"invalid-keybinding",arg:t.join("\n")})})),function(e,t){const a=e.keystrokeCaption;if(a&&e.keystrokeCaptionVisible){const i=e.element.getBoundingClientRect();a.style.left=i.left+"px",a.style.top=i.top-64+"px",a.innerHTML=e.config.createHTML(""+(da(t)||t)+""+a.innerHTML),a.style.visibility="visible",setTimeout((function(){a.childNodes.length>0&&a.removeChild(a.childNodes[a.childNodes.length-1]),0===a.childNodes.length&&(a.style.visibility="hidden")}),3e3)}}(e,t),clearTimeout(e.keystrokeBufferResetTimer),e.config.onKeystroke&&!e.config.onKeystroke(e,t,a))return(null==a?void 0:a.preventDefault)&&(a.preventDefault(),a.stopPropagation()),!1;let s,o,r,n=!1;if("command"!==e.mode&&(!a||!a.ctrlKey&&!a.metaKey))if(fi(a)){const t=yi(a),i=e.keystrokeBuffer+t;let r=0;for(;!s&&r{e.startsWith(o)&&!a.includes(e)&&a.push(e)});const r=(null==t?void 0:t.inlineShortcuts)?t.inlineShortcuts:null;r&&Object.keys(r).forEach(e=>{e.startsWith(o)&&a.push(e)})}return a}(i,e.config).length<=1?n=!0:e.config.inlineShortcutTimeout&&(e.keystrokeBufferResetTimer=setTimeout(()=>{e.resetKeystrokeBuffer()},e.config.inlineShortcutTimeout))}else e.resetKeystrokeBuffer();if(e.config.smartMode){const i=e.mode;s?e.mode="math":function(e,t,a){if(e.smartModeSuppressed)return!1;if(e.model.endOffset()<*|]$/.test(i))return Pi(e),!0}else{if("[Space]"===t)return Oi(e,void 0,e=>/[a-z][:,;.]$/.test(e.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return Oi(e,void 0,e=>/[a-zA-Z]/.test(e.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return Oi(e,1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return Oi(e,void 0,e=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(e.body)),!0;if(/\?|\./.test(i))return!0}return!1}(e,t,a)&&(e.mode={math:"text",text:"math"}[e.mode],r=""),e.mode!==i&&"function"==typeof e.config.onModeChange&&e.config.onModeChange(e,e.mode)}if(s||r||(r=function(e,t,a){if(0===e.length)return"";for(let i=e.length-1;i--;i>=0)if(e[i].key===a&&(!e[i].ifMode||e[i].ifMode===t))return e[i].command;return""}(e.keybindings,e.mode,t)),!s&&!r)return!0;if(e.config.readOnly&&"insert"===r[0])return!0;Ca(e.model,!1);const l=e.model.parent();if("moveAfterParent"===r&&l&&"leftright"===l.type&&e.model.endOffset()===e.model.siblings().length-1&&e.config.smartFence&&li(e.model,".",e.style)&&(r="",Va(e)),"math"===e.mode&&"[Spacebar]"===t&&!s){const t=e.model.sibling(1),a=e.model.sibling(-1);(t&&"text"===t.mode||a&&"text"===a.mode)&&di(e.model," ",{mode:"text"})}if(r)e.$perform(r);else if(s){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(s)){const t={...Ct(e.model),...e.style};di(e.model,yi(a),{suppressChangeNotifications:!0,mode:e.mode,style:t});const i=e.mode;e.snapshotAndCoalesce(),e.restoreToUndoRecord(e.keystrokeBufferStates[o]),e.mode=i}kt(e.model);const t=e.model.suppressChangeNotifications;e.model.suppressChangeNotifications=!0;const i={...Ct(e.model),...e.style};di(e.model,s,{format:"latex",mode:e.mode,style:i,smartFence:!0}),Pi(e),s.endsWith(" ")&&(e.mode="text",di(e.model," ",{mode:"text",style:i})),e.model.suppressChangeNotifications=t,wt(e.model),e.snapshot(),Va(e),e.model.announce("replacement"),n&&e.resetKeystrokeBuffer()}return e.scrollIntoView(),(null==a?void 0:a.preventDefault)&&(a.preventDefault(),a.stopPropagation()),!1}function Hi(e,t,a){if(e.config.readOnly)return void e.model.announce("plonk");if((a=null!=a?a:{}).focus&&e.$focus(),a.feedback&&(e.config.keypressVibration&&(null===navigator||void 0===navigator?void 0:navigator.vibrate)&&navigator.vibrate(3),e.keypressSound&&(e.keypressSound.load(),e.keypressSound.play().catch(e=>{}))),a.commandMode&&"command"!==e.mode&&e.switchMode("command"),Ca(e.model,!1),a.simulateKeystroke){const a=t.charAt(0);if(!Ii(e,a,new KeyboardEvent("keypress",{key:a})))return}let i="",s=!1;if(e.pasteInProgress)e.pasteInProgress=!1,di(e.model,t,{smartFence:e.config.smartFence,mode:"math"});else{const a={...Ct(e.model),...e.style},o=Ue(t);for(const t of o)if("command"===e.mode){nt(e.model),e.suggestionIndex=0;const a=La(e.model),o=oe(a+t);s=o.length>1,0===o.length?(di(e.model,t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(a+t)&&Ca(e.model,!0),Ma(e)):(di(e.model,t,{mode:"command"}),o[0].match!==a+t&&Mi(e.model,o[0].match,-o[0].match.length+a.length+1),i=o[0].match)}else if("math"===e.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(Wi(e)>=e.config.scriptDepth[1])return void e.model.announce("plonk")}else if("moveToSubscript"===i&&Vi(e)>=e.config.scriptDepth[0])return void e.model.announce("plonk");e.$perform(i)}else e.config.smartSuperscript&&"superscript"===e.model.relation()&&/[0-9]/.test(t)&&0===e.model.siblings().filter(e=>"first"!==e.type).length?(di(e.model,t,{mode:"math",style:a}),Wt(e.model)):di(e.model,t,{mode:"math",style:a,smartFence:e.config.smartFence})}else"text"===e.mode&&di(e.model,t,{mode:"text",style:a})}"command"!==e.mode&&e.snapshotAndCoalesce(),e.dirty=!0,e.scrollIntoView(),ka(e,i,s)}function Wi(e){let t=0,a=0,i=e.model.ancestor(a),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),a+=1,i=e.model.ancestor(a);return s?t:0}function Vi(e){let t=0,a=0,i=e.model.ancestor(a),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),a+=1,i=e.model.ancestor(a);return s?t:0}function Ui(e){return e.pasteInProgress=!0,!0}let ji;Ga({undo:e=>(Li(e),e.undo(),!0),redo:e=>(Li(e),e.redo(),!0),scrollIntoView:e=>(e.scrollIntoView(),!0),scrollToStart:e=>(e.field.scroll(0,0),!0),scrollToEnd:e=>{const t=e.field.getBoundingClientRect();return e.field.scroll(t.left-window.scrollX,0),!0},enterCommandMode:e=>(e.switchMode("command"),!0),toggleKeystrokeCaption:e=>(e.keystrokeCaptionVisible=!e.keystrokeCaptionVisible,e.keystrokeCaption.innerHTML="",e.keystrokeCaptionVisible||(e.keystrokeCaption.style.visibility="hidden"),!1),switchMode:(e,t)=>(e.switchMode(t),!0),insert:(e,t,a)=>e.$insert(t,a),typedText:(e,t)=>(Hi(e,t),!0)}),Ga({applyStyle:function(e,t){e.resetKeystrokeBuffer();const a=function(e){const t={};return"string"==typeof e.mode&&(t.mode=e.mode.toLowerCase()),"string"==typeof e.color&&(t.color=e.color),"string"==typeof e.backgroundColor&&(t.backgroundColor=e.backgroundColor),"string"==typeof e.fontFamily&&(t.fontFamily=e.fontFamily),"string"==typeof e.series&&(t.fontSeries=e.series),"string"==typeof e.fontSeries&&(t.fontSeries=e.fontSeries.toLowerCase()),t.fontSeries&&(t.fontSeries={bold:"b",medium:"m",normal:"m"}[t.fontSeries]||t.fontSeries),"string"==typeof e.shape&&(t.fontShape=e.shape),"string"==typeof e.fontShape&&(t.fontShape=e.fontShape.toLowerCase()),t.fontShape&&(t.fontShape={italic:"it",up:"n",upright:"n",normal:"n"}[t.fontShape]||t.fontShape),"string"==typeof e.size?t.fontSize=e.size:"number"==typeof e.size&&(t.fontSize="size"+Math.min(0,Math.max(10,e.size))),"string"==typeof e.fontSize&&(t.fontSize=e.fontSize.toLowerCase()),t.fontSize&&(t.fontSize={tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normal:"size5",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.fontSize]||t.fontSize),t}(t);if(a.mode){if(Rt(e.model))e.switchMode(a.mode);else{const t=e.mode,a="math"===(Lt(e.model)||e.config.defaultMode)?"text":"math";let i=e.$selectedText("ASCIIMath");if("math"===a&&/^"[^"]+"$/.test(i)&&(i=i.slice(1,-1)),e.$insert(i,{mode:a,selectionMode:"item",format:"text"===a?"text":"ASCIIMath"}),e.mode=a,e.groupIsSelected()){const t=e.model.parent();!t||"group"!==t.type&&"root"!==t.type||(t.mode=a)}e.mode!==t&&"function"==typeof e.config.onModeChange&&e.config.onModeChange(e,e.mode)}delete a.mode}return Rt(e.model)?(e.style.fontSeries&&a.fontSeries===e.style.fontSeries&&(a.fontSeries="auto"),a.fontShape&&a.fontShape===e.style.fontShape&&(a.fontShape="auto"),a.color&&a.color===e.style.color&&(a.color="none"),a.backgroundColor&&a.backgroundColor===e.style.backgroundColor&&(a.backgroundColor="none"),a.fontSize&&a.fontSize===e.style.fontSize&&(a.fontSize="auto"),e.style={...e.style,...a}):(ci(e.model,a),e.snapshot()),!0}},{target:"mathfield"}),Ga({copyToClipboard:e=>(e.$focus(),Rt(e.model)&&e.$select(),document.execCommand("copy"),!1),cutToClipboard:e=>(e.$focus(),document.execCommand("cut"),!0),pasteFromClipboard:e=>(e.$focus(),document.execCommand("paste"),!0)},{target:"mathfield",category:"clipboard"});let Gi=0;function Zi(e,t,a,i){var s;let o;(i=null!=i?i:{}).bias=null!==(s=i.bias)&&void 0!==s?s:0;const r=function e(t,a,i){let s={element:null,distance:Number.POSITIVE_INFINITY},o=!0;if(t.getAttribute("data-atom-id")){s.element=t;const e=t.getBoundingClientRect(),r=a-(e.left+e.right)/2,n=i-(e.top+e.bottom)/2;s.distance=r*r+n*n,o=a>=e.left&&a<=e.right}if(o&&t.children)for(const o of t.children){const t=e(o,a,i);t.element&&t.distance<=s.distance&&(s=t)}return s}(e.field,t,a).element,n=r?r.getAttribute("data-atom-id"):null;if(n){const a=Yt(e.model,(e,t)=>t.captureSelection?t.filter(e=>e.id===n).length>0:t.id===n);if(a&&a.length>0)if(o=dt(a[0]).path,0===i.bias){const e=r.getBoundingClientRect();tf ()",classes:"tex",layers:["functions"]},symbols:{tooltip:"keyboard.tooltip.symbols",layer:"symbols",label:"∞≠∈",classes:"tex",layers:["symbols"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},Yi={"\\varphi ":["Φ","\\Phi "],"\\varsigma ":["Σ","\\Sigma "],"\\epsilon ":["Ɛ",'{\\char"0190}'],"\\rho ":["Ρ",'{\\char"3A1}'],"\\tau ":["Τ",'{\\char"3A4}'],"\\upsilon ":["Υ","\\Upsilon "],"\\theta ":["Θ","\\Theta "],"\\iota ":["Ι",'{\\char"399}'],"\\omicron ":["Ο",'{\\char"39F}'],"\\pi ":["Π","\\Pi "],"\\alpha ":["Α",'{\\char"391}'],"\\sigma ":["Σ","\\Sigma "],"\\delta ":["Δ","\\Delta "],"\\phi ":["Φ","\\Phi "],"\\gamma ":["Γ","\\Gamma "],"\\eta ":["Η",'{\\char"397}'],"\\xi ":["Ξ","\\Xi "],"\\kappa ":["Κ",'{\\char"39A}'],"\\lambda ":["Λ","\\Lambda "],"\\zeta ":["Ζ",'{\\char"396}'],"\\chi ":["Χ",'{\\char"3A7}'],"\\psi ":["Ψ","\\Psi "],"\\omega ":["Ω","\\Omega "],"\\beta ":["Β",'{\\char"392}'],"\\nu ":["Ν",'{\\char"39D}'],"\\mu ":["Μ",'{\\char"39C}']},Ji={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let Qi={};const es={math:"\n
\n
    \n
  • x
  • \n
  • n
  • \n
  • \n \n
  • \n
  • e
  • \n
  • i
  • \n
  • \n
\n
    \n
  • <
  • \n
  • >
  • \n
  • \n \n
  • \n
  • x ²
  • \n
  • x
  • \n
  • \n
\n
    \n
  • (
  • \n
  • )
  • \n
  • \n \n
  • \n
  • \n
  • \n
\n \n
    \n
  • \n
  • \n
  • \n \n
  • \n \n
\n
\n ","lower-roman":"\n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n
  • ;
  • \n
  • ,
  • \n
  •  
  • \n \n
\n
","upper-roman":"\n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n
  • ;
  • \n
  • ;
  • \n
  •  
  • \n \n
\n
",symbols:"\n
\n
    \n \n
  • {
  • \n
  • }
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • o
  • \n
  • \n
  • \n\n
\n
    \n \n
  • [
  • \n
  • ]
  • \n
  • \n
  • \n
  • \n
  • !
  • \n
  • o
  • \n
  • o
  • \n
  • \n
  • \n\n
\n
    \n \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n\n
  • \n
\n
    \n \n
  • ,
  • \n
  • \n
  • :
  • \n
  • \n
  • \n
  • \n
  • ±
  • \n \n
\n
","lower-greek":"\n
\n
  • φ
  • \n
  • ς
  • \n
  • ϵ
  • \n
  • ρ
  • \n
  • τ
  • \n
  • υ
  • \n
  • θ
  • \n
  • ι
  • \n
  • ο
  • \n
  • π
  • \n
\n
  • α
  • \n
  • σ
  • \n
  • δ
  • \n
  • ϕ
  • \n
  • γ
  • \n
  • η
  • \n
  • ξ
  • \n
  • κ
  • \n
  • λ
  • \n
\n
  • \n
  • ζ
  • \n
  • χ
  • \n
  • ψ
  • \n
  • ω
  • \n
  • β
  • \n
  • ν
  • \n
  • μ
  • \n
  • \n
\n
    \n
  •  
  • \n
  • ,
  • \n
  • ε
  • \n
  • ϑ
  • \n
  • ϰ
  • \n
  • ϖ
  • \n
  • ϱ
  • \n \n
\n
","upper-greek":"\n
\n
  • Φ
  • \n
  • Σ
  • \n
  • Ɛ
  • \n
  • Ρ
  • \n
  • Τ
  • \n
  • Υ
  • \n
  • Θ
  • \n
  • Ι
  • \n
  • Ο
  • \n
  • Π
\n
  • Α
  • \n
  • Σ
  • \n
  • Δ
  • \n
  • Φ
  • \n
  • Γ
  • \n
  • Η
  • \n
  • Ξ
  • \n
  • Κ
  • \n
  • Λ
\n
  • \n
  • Ζ
  • \n
  • Χ
  • \n
  • Ψ
  • \n
  • Ω
  • \n
  • Β
  • \n
  • Ν
  • \n
  • Μ
  • \n
\n
    \n
  •  
  • \n
  • .
  • \n
  •  
  • \n \n
\n
","lower-command":"\n
\n
\n
\n
\n
    \n
  • 01#
  • \n
  • {
  • \n
  • }
  • \n
  • ^
  • \n
  • _
  • \n
  •  
  • \n \n
\n
","upper-command":"\n
\n
\n
\n
\n
    \n
  • \n
  • [
  • \n
  • ]
  • \n
  • (
  • \n
  • )
  • \n
  •  
  • \n \n
\n
","symbols-command":"\n
\n
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 0
\n
  • !
  • @
  • #
  • $
  • %
  • ^
  • &
  • *
  • +
  • =
\n
    \n
  • \\
  • \n
  • |
  • \n
  • /
  • \n
  • `
  • \n
  • ;
  • \n
  • :
  • \n
  • ?
  • \n
  • '
  • \n
  • \"
  • \n
  • \n
\n
    \n
  • abc
  • \n
  • <
  • \n
  • >
  • \n
  • ~
  • \n
  • ,
  • \n
  • .
  • \n
  •  
  • \n \n
\n
",functions:"\n
\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
  • \n
  • (
  • \n
  • )
  • \n
  • \n
  • \n
  •  
  • \n \n
\n
",style:"\n
\n
    \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
    \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
    \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
    \n
  • \n
  • \n
  • \n\n
  • \n
  • \n
  • \n
  • \n
\n
"};function ts(e,t,a){return e=e.replace(/(^|[^\\])#@/g,"$1#?"),q(_(Ne({mathstyle:c.displaystyle,macros:a.config.macros},ot(e,"math",t,a.config.macros)),"ML__base"),"ML__mathlive").toMarkup()}function as(e,t,a){var i;let s="
";const o=t.replace(/\s+/g," ").split(" ");if(o.length>1){const t={...Xi,...null!==(i=e.config.customVirtualKeyboards)&&void 0!==i?i:{}};for(const e of o){if(!t[e])break;s+="
"+t[e].label+"
"}}return s+="
",s+=`\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n `,""}function is(e,t,a){var i;for(let s=0;s"+o.getAttribute("data-aside").replace(/"/g,'"')+""),void 0!==r&&(o.innerHTML=e.config.createHTML(r)),o.getAttribute("data-classes")&&o.classList.add(o.getAttribute("data-classes"));const n=null===(i=o.getAttribute("data-insert"))||void 0===i?void 0:i.replace(/"/g,'"');let l;if(n&&Yi[n]&&(o.setAttribute("data-shifted",Yi[n][0]),o.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",Yi[n][1]]))),l=o.getAttribute("data-command")?JSON.parse(o.getAttribute("data-command")):o.getAttribute("data-insert")?["insert",o.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:o.getAttribute("data-latex")?["insert",o.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:["typedText",o.getAttribute("data-key")||o.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],a&&(l=[a,l]),o.getAttribute("data-alt-keys")){const e=Qi[o.getAttribute("data-alt-keys")];e&&(l={default:l,pressAndHoldStart:["showAlternateKeys",o.getAttribute("data-alt-keys"),e],pressAndHoldEnd:"hideAlternateKeys"})}va(e,o,l)}}function ss(e,t){const a={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},i=a[e.config.virtualKeyboardLayout]?a[e.config.virtualKeyboardLayout]:a.qwerty;let s,o=t;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let r=o.match(/()/);for(;r;){s="";const e=r[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),t={};for(const a of e){const e=a.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);t[e[1]]=e[3]}let n=i[t.name];if(n||(n=a.qwerty[t.name]),n)for(const e of n){let a=t.class||"";a&&(a=" "+a),"~"===e?(s+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===e?s+="
  • ":"^"===e?s+="
  • ":"/"===e?s+="
  • ÷
  • ":"*"===e?s+="
  • ×
  • ":"-"===e?s+="
  • ":/tt/.test(a)?s+="
  • '+e+"
  • ":s+="
  • "+e+"
  • "}o=o.replace(new RegExp(r[1]+r[2]+r[3]),s),r=o.match(/()/)}return o}function os(e){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",fa(t)),!1}function rs(e){const t=e.virtualKeyboard.querySelectorAll("div.keyboard-layer.is-visible .rows .keycap, div.keyboard-layer.is-visible .rows .action");if(t)for(let a=0;a',command:'["applyStyle",{"color":"'+e+'"}]'});Ji["background-color"]=[];for(const e of fe)Ji["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+e+'"}]'});Qi={...Ji},Object.keys(Qi).forEach(e=>{Qi[e]=Qi[e].slice()});for(let e=0;e<26;e++){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[e];Qi[t]||(Qi[t]=[]),Qi[t].unshift({latex:"\\mathbb{"+t+"}",aside:"blackboard",insert:"\\mathbb{"+t+"}"}),Qi[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),Qi[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),Qi[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),Qi[t].unshift({latex:"\\mathcal{"+t+"}",aside:"calligraphy",insert:"\\mathcal{"+t+"}"}),Qi[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}for(let e=0;e<=26;e++){const t="abcdefghijklmnopqrstuvwxyz"[e];Qi[t]||(Qi[t]=[]),Qi[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),Qi[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),Qi[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),Qi[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}for(let e=0;e<10;e++){const t="0123456789"[e];Qi[t]||(Qi[t]=[]),Qi[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),Qi[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),Qi[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),Qi[t].unshift({latex:"\\mathcal{"+t+"}",aside:"script",insert:"\\mathcal{"+t+"}"}),Qi[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}let o=e.config.virtualKeyboards;o||(o="all"),o=o.replace(/\ball\b/i,"numeric functions symbols roman greek");const r={...es,...null!==(a=e.config.customVirtualKeyboardLayers)&&void 0!==a?a:{}},n={...Xi,...null!==(i=e.config.customVirtualKeyboards)&&void 0!==i?i:{}},l=o.replace(/\s+/g," ").split(" ");for(const t of l){if(!n[t])break;let a=n[t].layers||[];n[t].layer&&a.push(n[t].layer),a=Array.from(new Set(a));for(const i of a){if(!r[i])break;if("object"==typeof r[i]){let e="";if(r[i].styles&&(e+=``),r[i].backdrop&&(e+=`
    `),r[i].container&&(e+=`
    `),r[i].rows){e+="
    ";for(const t of r[i].rows){e+="
      ";for(const a of t)e+="${a.label?a.label:""}`;e+="
    "}e+="
    "}r[i].container&&(e+="
    "),r[i].backdrop&&(e+="
    "),r[i]=e}s+="
    ",s+=as(e,o,t);const a="function"==typeof r[i]?r[i]():r[i];s+=ss(e,a),s+="
    "}}const c=document.createElement("div");c.className="ML__keyboard",t?c.classList.add(t):e.config.virtualKeyboardTheme&&c.classList.add(e.config.virtualKeyboardTheme),c.innerHTML=e.config.createHTML(s),is(e,[].slice.call(c.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton")));const d=c.getElementsByClassName("layer-switch");for(let t=0;t{e.addEventListener("mousedown",e=>{e.preventDefault(),e.stopPropagation()}),e.addEventListener("touchstart",e=>{e.preventDefault(),e.stopPropagation()})}),m[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){os(),rs(e)})),window.addEventListener("blur",(function(){os(),rs(e)})),window.addEventListener("touchend",(function(){os(),rs(e)})),window.addEventListener("touchcancel",(function(){os(),rs(e)})),c}(e,t),pa(e.virtualKeyboard,"touchstart:passive mousedown",()=>{e.$focus()}),document.body.appendChild(e.virtualKeyboard)),window.setTimeout(()=>{e.virtualKeyboard.classList.add("is-visible")},1)):e.virtualKeyboard&&e.virtualKeyboard.classList.remove("is-visible"),"function"==typeof e.config.onVirtualKeyboardToggle&&e.config.onVirtualKeyboardToggle(e,e.virtualKeyboardVisible,e.virtualKeyboard),!1}Ga({showAlternateKeys:(e,t,a)=>{const i=ua("mathlive-alternate-keys-panel","ML__keyboard alternate-keys");e.virtualKeyboard.classList.contains("material")&&i.classList.add("material"),a.length>=7?i.style.width="286px":4===a.length||2===a.length?i.style.width="146px":1===a.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const e of a)s+="";s="
      "+s+"
    ",i.innerHTML=e.config.createHTML(s),is(e,[].slice.call(i.getElementsByTagName("li")),"performAlternateKeys");const o=e.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(o){o.top-i.clientHeight<0&&(i.style.width="auto",a.length<=6?i.style.height="56px":a.length<=12?i.style.height="108px":i.style.height="205px");const e=(o.top-i.clientHeight+5).toString()+"px",t=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(o.left+o.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+t+","+e+")",i.classList.add("is-visible")}return!1}},{target:"virtual-keyboard"}),Ga({shiftKeyboardLayer:t=>{const a=t.virtualKeyboard.querySelectorAll("div.keyboard-layer.is-visible .rows .keycap, div.keyboard-layer.is-visible .rows .action");if(a)for(let i=0;ios(),performAlternateKeys:(e,t)=>(os(),e.$perform(t)),switchKeyboardLayer:(e,t)=>ls(e,t),unshiftKeyboardLayer:e=>rs(e),insertAndUnshiftKeyboardLayer:(e,t)=>(e.$insert(t),rs(e),!0)},{target:"virtual-keyboard"}),Ga({toggleVirtualKeyboardAlt:e=>{let t=!1;return e.virtualKeyboard&&(t=e.virtualKeyboard.classList.contains("material"),e.virtualKeyboard.remove(),delete e.virtualKeyboard,e.virtualKeyboard=null),cs(e,t?"":"material"),!1},toggleVirtualKeyboardShift:e=>{var t,a;e.config.virtualKeyboardLayout={qwerty:"azerty",azerty:"qwertz",qwertz:"dvorak",dvorak:"colemak",colemak:"qwerty"}[e.config.virtualKeyboardLayout];const i=null!==(a=null===(t=e.virtualKeyboard)||void 0===t?void 0:t.querySelector("div.keyboard-layer.is-visible").id)&&void 0!==a?a:"";return e.virtualKeyboard&&(e.virtualKeyboard.remove(),delete e.virtualKeyboard,e.virtualKeyboard=null),cs(e),i&&ls(e,i),!1}},{target:"virtual-keyboard"}),Ga({toggleVirtualKeyboard:(e,t)=>ms(e,t),hideVirtualKeyboard:e=>ds(e),showVirtualKeyboard:(e,t)=>cs(e,t)},{target:"virtual-keyboard"});const ps={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},hs={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},us={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},fs={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function gs(t,a){return e(t.arg)?t.arg[a]:void 0}function ys(e){return e&&fs[e]||-1}function bs(e){return/=|=>/.test(e)?"right":"left"}function vs(e){if("f"===e||"g"===e)return!0;const t=us[e];return!!t&&!!/%[^01_^]?/.test(t)}function xs(e){e=(e||"").trim();let t=ps[e];if(!t)if(/^\\[^{}]+$/.test(e)){const a=se(e,"math",{});t=a&&a.value||e.slice(1)}else t=e;return t}function ks(e){if(!e)return null;const t=xs(As(e)),a=[ys(t),bs(t)];return a[0]<=0?null:a}function ws(e){return null!==ks(e)}const Ss={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Ms={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Ls={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Cs={",":"list",";":"list2"};function As(t){if("string"==typeof t)return t;if(e(t)){let e="";for(const a of t)e+=As(a);return e}if(t.symbol&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.symbol))return t.symbol;if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(e(t.body)){let e="";for(const a of t.body)e+=As(a);return e}return""}function $s(e){return"string"==typeof e.sym?function(e){let t=us[e];return t?t.replace("%1","").replace("%0","").replace("%",""):(e.length>1&&(t="\\"+e),t||(t=ee("math",e)),t)}(e.sym)||e.sym:""}function zs(e){return parseFloat(e.num)}function _s(e){return"object"==typeof e&&void 0!==e.num}function Ds(e){let t=0;return _s(e)&&(t="object"==typeof e.num?void 0!==e.num.re?Js(e.num.re):0:parseFloat(e.num)),t}function qs(e){let t=0;return _s(e)&&"object"==typeof e.num&&(t=void 0!==e.num.im?Js(e.num.im):0),t}function Ts(e){return e&&void 0!==e.sup}function Ks(e){return e&&void 0!==e.sub}function Es(e,t,a){let i=!1;const s=e.atoms[e.index];return s&&s.type===t&&(i=void 0===a||As(s)===a),i}function Fs(e,...t){const a={fn:e,arg:void 0};if(t){const e=[];for(const a of t)a&&e.push(a);e.length>0&&(a.arg=e)}return a}function Ns(e){return"number"==typeof e?{num:e.toString()}:"string"==typeof e||"object"==typeof e?{num:e}:void 0}function Bs(e){if(_s(e)){const t=Ds(e),a=qs(e);return 0!==a?(0!==t&&(e.num.re=(-t).toString()),e.num.im=(-a).toString()):e.num=(-t).toString(),e}return Fs("negate",e)}function Os(e){const t=e.atoms[e.index+1];return t&&"msubsup"===t.type}function Rs(e,t){let a=e.atoms[e.index];return!a||void 0===a.superscript&&void 0===a.subscript?a=null:e.index+=1,a||(a=e.atoms[e.index+1],a&&"msubsup"===a.type&&(a.superscript||a.subscript)?e.index+=2:a=null),a?(void 0!==a.subscript&&(e.ast.sub=Gs(a.subscript,t)),void 0!==a.superscript&&("msubsup"===a.type?/['\u2032]|\\prime/.test(As(a.superscript))?(e.index+=1,a=e.atoms[e.index+1],a&&"msubsup"===a.type&&/['\u2032]|\\prime/.test(As(a.superscript))?e.ast.sup={sym:"″"}:(e.ast.sup={sym:"′"},e.index-=1)):/['\u2033]|\\doubleprime/.test(As(a.superscript))?e.ast.sup={sym:"″"}:e.ast&&(e.ast.sup=Gs(a.superscript,t)):e.ast.sup=Gs(a.superscript,t))):e.index+=1,e}function Ps(e,t){const a=e.ast;if(Hs(e,"!!"))return e.index+=1,e.ast=Fs("factorial2",a),Ps(e=Rs(e,t),t);if(Hs(e,"++"))return e.index+=1,e.ast=Fs("increment",a),Ps(e=Rs(e,t),t);if(Hs(e,"--"))return e.index+=1,e.ast=Fs("decrement",a),Ps(e=Rs(e,t),t);const i=e.atoms[e.index];return(null==i?void 0:i.symbol)&&Ms[i.symbol]&&(e.ast=Fs(Ms[i.symbol],a),e=Ps(e=Rs(e,t),t)),e}function Is(e,t,a,i){if(e.index=e.index||0,0===e.atoms.length||e.index>=e.atoms.length)return e.ast=void 0,e;const s=e.minPrec;e.minPrec=0;let o=e.atoms[e.index];if(t){if("mopen"===o.type&&As(o)===t)e.index+=1,o=(e=Vs(e,i)).atoms[e.index],o&&"mclose"===o.type&&As(o)===a&&(Os(e)&&(e.ast={group:e.ast}),e=Ps(e=Rs(e,i),i));else if("textord"===o.type&&As(o)===t)e.index+=1,o=(e=Vs(e,i)).atoms[e.index],o&&"textord"===o.type&&As(o)===a&&(e.index+=1,e=Ps(e=Rs(e,i),i));else if("\\lVert"===t&&"textord"===o.type&&"|"===o.symbol){if(o=e.atoms[e.index+1],o&&"textord"===o.type&&"|"===o.symbol){e.index+=2,o=(e=Vs(e,i)).atoms[e.index];const t=e.atoms[e.index+1];o&&"textord"===o.type&&"|"===o.symbol&&t&&"textord"===t.type&&"|"===t.symbol&&(e.index+=2,e=Ps(e=Rs(e,i),i))}}else if("sizeddelim"===o.type&&o.delim===t)e.index+=1,o=(e=Vs(e,i)).atoms[e.index],o&&"sizeddelim"===o.type&&o.delim===a&&(e.index+=1,e=Ps(e=Rs(e,i),i));else{if("leftright"!==o.type||o.leftDelim!==t||"?"!==o.rightDelim&&o.rightDelim!==a)return;e.ast=Gs(o.body,i),Os(e)&&(e.ast={group:e.ast}),e=Ps(e=Rs(e,i),i)}return e.minPrec=s,e}{let r=!0;if("mopen"===o.type?(t=o.symbol,a=I[t]):"sizeddelim"===o.type?(t=o.delim,a=I[t]):"leftright"===o.type?(r=!1,t=o.leftDelim,"?"===(a=o.rightDelim)&&(a=I[t])):"textord"===o.type&&(t=o.symbol,a=I[t]),t&&a){if("|"===t&&"|"===a){const i=e.atoms[e.index+1];i&&"textord"===i.type&&"|"===i.symbol&&(t="\\lVert",a="\\rVert")}if(e=Is(e,t,a,i))return r&&(e.index+=1),e.ast={fn:Ss[t+a]||t+a,arg:[e.ast]},e.minPrec=s,e}}}function Hs(e,t){return e.index=e.index||0,!(e.atoms.length<=1||e.index>=e.atoms.length-1)&&t===As(e.atoms[e.index])+As(e.atoms[e.index+1])}function Ws(e){if(e.index=e.index||0,!(e.atoms.length<=1||e.index>=e.atoms.length-1)){if(!Es(e,"textord","\\nabla")){const t=e.atoms[e.index].symbol+e.atoms[e.index+1].symbol,a=/^(>=|<=|>>|<<|:=|!=)$/.test(t)?t:"";return a&&(e.index+=1),a}return e.index+=1,Es(e,"mbin","\\times")?(e.index+=1,e.ast="curl",e):Es(e,"mbin","\\cdot")?(e.index+=1,e.ast="div",e):void(e.index-=1)}}function Vs(t,a){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(a,i){if(a.index=a.index||0,a.ast=void 0,0===a.atoms.length||a.index>=a.atoms.length)return a;let s=a.atoms[a.index];if("text"===s.mode){let e="";for(;a.atoms[a.index]&&"text"===a.atoms[a.index].mode;)e+=a.atoms[a.index].body,a.index+=1;return a.ast={text:e},a}const o=xs(As(s));if(Ws(a))a.ast=Fs(a.ast,t(a,i).ast);else{if("root"===s.type)return a.index=0,a.atoms=s.body,t(a,i);if("mbin"===s.type&&"-"===o)a.index+=1,(a=t(a,i)).ast=Bs(a.ast);else if("mbin"===s.type&&"+"===o)a.index+=1,(a=t(a,i)).ast=Fs("add",a.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.symbol)){let e="",o=!1,r=/^[0-9.eEdD]$/;for(;a.index0&&"\\"===n.charAt(0)&&"string"==typeof e.body&&(n=e.body)),o=J(n,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),o!==n?(r={sym:o},l="normal"):r={sym:n};break;case"minner":case"mop":break;case"box":r=Gs(e.body,t);break;case"enclose":break;case"array":if("cardinality"===e.environmentName)r=Fs("card",Gs(e.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(e.environmentName)){r={fn:"array",args:[]};for(const a of e.array)r.args.push(a.map(e=>Gs(e,t)))}else if("cases"===e.environmentName){r={fn:"cases",args:[]};for(const a of e.array)if(a[0]){const e=[];e.push(Gs(a[0],t));let i=Gs(a[1],t);i&&"text"===i.fn&&i.arg&&/^(if|when|for)$/i.test(i.arg[0].trim())&&(i=i.arg.filter(e=>"string"!=typeof e)),e.push(null!=i?i:{}),r.args.push(e)}}break;case"spacing":case"space":case"mathstyle":break;default:r=void 0}return r&&l&&"normal"!==l&&(r.variant=l),r&&"string"==typeof e.cssClass&&(r.class=e.cssClass),r&&"string"==typeof e.cssId&&(r.id=e.cssId),r}function js(t){if(!t)return[];let a;if(e(t)){a=[];for(const e of t){const t=js(e);a=a.concat(t)}}else{if("spacing"===t.type||"first"===t.type)return[];"box"===t.type?a=js(t.body):(t.body&&e(t.body)&&(t.body=js(t.body)),t.superscript&&e(t.superscript)&&(t.superscript=js(t.superscript)),t.subscript&&e(t.subscript)&&(t.subscript=js(t.subscript)),t.index&&e(t.index)&&(t.index=js(t.index)),t.denom&&e(t.denom)&&(t.denom=js(t.denom)),t.numer&&e(t.numer)&&(t.numer=js(t.numer)),t.array&&e(t.array)&&(t.array=t.array.map(e=>e.map(e=>js(e)))),a=[t])}return a}function Gs(e,t){return function(e,t){e.index=e.index||0,e.ast=void 0;const a=[];for(;e.atoms[e.index];)if("text"===e.atoms[e.index].mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;a.push(Fs("text",t))}else{const i=Vs(e,t).ast;if(!i)return;a.push(i)}return a.length>1?Fs("sequence",...a):a[0]||void 0}({atoms:js(e)},t)}function Zs(e,t){return Gs(e,t)}function Xs(e,...t){e=e||".. ";let a="";if(t.length>0){"."!==e[0]&&(a+=e[0]);let i="";for(const s of t)a+=i+s,i=e[2];"."!==e[1]&&(a+=e[1])}return a}function Ys(e,t){const a=e.length;e=e.substr(0,t.precision-2);for(let a=0;a1&&(i+o.repeat(r+1)).startsWith(e))return"0"===o?i.replace(/(\d{3})/g,"$1"+t.groupSeparator):i.replace(/(\d{3})/g,"$1"+t.groupSeparator)+t.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+t.groupSeparator)+t.endRepeatingDigits}}return a!==e.length&&(e+="\\ldots"),e.replace(/(\d{3})/g,"$1"+t.groupSeparator)}function Js(e){return parseFloat(parseFloat(e).toPrecision(15))}function Qs(e,t){let a,i="";if("number"==typeof t.precision){if("number"!=typeof e){let a="",i="";if("-"===e[0]?(a="-",e=e.substr(1)):"+"===e[0]&&(e=e.substr(1)),e.indexOf(".")>=0){const s=e.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=s[1],r=s[2].substring(0,Math.min(t.precision-o.length,s[2].length));if(i=s[4]||"","0"===o){let i=0;for(;"0"===r[i]&&i=t.precision)s="0",a="";else{s=e[i];const a=Ys(e.substr(i+1),t);a&&(s+=t.decimalMarker+a)}"0"!==s&&(e.length-1>t.precision&&!s.endsWith("}")&&!s.endsWith("\\ldots")&&(s+="\\ldots"),i>4&&(s+=t.exponentProduct,t.exponentMarker?s+=t.exponentMarker+(1-i).toString():s+="10^{"+(1-i).toString()+"}")),e=s}else{e=o.replace(/\B(?=(\d{3})+(?!\d))/g,t.groupSeparator);const a=Ys(r,t);a&&(e+=t.decimalMarker+a)}}else if(e.length>t.precision){const a=e.length;let i=e[0];const s=Ys(e.substr(2),t);s&&(i+=t.decimalMarker+s,"}"!==i[i.length-1]&&(i+="\\ldots")),"1"!==i?i+=t.exponentProduct:i="",t.exponentMarker?i+=t.exponentMarker+(a-2).toString():i+="10^{"+(a-2).toString()+"}",e=i}else e=e.replace(/\B(?=(\d{3})+(?!\d))/g,t.groupSeparator);return i&&(i=t.exponentMarker?t.exponentMarker+i:t.exponentProduct+" 10^{"+i+"}"),a+e+i}a=Js(e)}if("engineering"===t.scientificNotation)if(0===a)i="0";else{const e=Math.abs(a);let s=Math.round(Math.log10(e));s-=s%3,e<1e3&&(s=0);const o=e/Math.pow(10,s);let r="";const n=o.toString().match(/^(.*)\.(.*)$/);(null==n?void 0:n[1])&&n[2]&&(r=n[1]+t.decimalMarker+n[2]),t.groupSeparator&&(r=Ys(o.toExponential(),t));let l="";l=0===s?"":t.exponentMarker?t.exponentMarker+s:t.exponentProduct+" 10^{"+s+"}",i=(a<0?"-":"")+r+l}else{const a="string"==typeof e?e:e.toString();let s,o,r,n=a.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);s=a,r="",(null==n?void 0:n[1])&&n[2]&&(s=n[1],o=t.exponentMarker?t.exponentMarker+n[2]:t.exponentProduct+" 10^{"+n[2]+"}"),n=s.match(/^(.*)\.(.*)$/),(null==n?void 0:n[1])&&n[2]&&(s=n[1],r=n[2]),t.groupSeparator&&(s=s.replace(/\B(?=(\d{3})+(?!\d))/g,t.groupSeparator),r=Ys(r,t)),r&&(r=t.decimalMarker+r),i=s+r+(o||"")}return i}class eo{constructor(e,t){this.config=Ni({namespace:"",substituteTextArea:void 0,readOnly:!1,createHTML:e=>e,defaultMode:"math",macros:P,horizontalSpacingScale:1,letterShapeStyle:"auto",smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,ignoreSpacebarInMathMode:!0,locale:"auto",strings:{},keybindings:ra,overrideDefaultInlineShortcuts:!1,inlineShortcuts:{},inlineShortcutTimeout:0,virtualKeyboardToggleGlyph:'',virtualKeyboardMode:"auto",virtualKeyboards:"all",virtualKeyboardLayout:"auto",customVirtualKeyboardLayers:{},customVirtualKeyboards:{},virtualKeyboardTheme:/android|cros/i.test(null===navigator||void 0===navigator?void 0:navigator.userAgent)?"material":"apple",keypressVibration:!0,keypressSound:null,plonkSound:null,textToSpeechRules:"mathlive",textToSpeechMarkup:"",textToSpeechRulesOptions:{},speechEngine:"local",speechEngineVoice:"Joanna",speechEngineRate:"100%",speakHook:Ki,readAloudHook:Ki,onAnnounce:Ti,onKeystroke:()=>!0,onMoveOutOf:()=>!0,onTabOutOf:()=>!0,onBlur:Ki,onFocus:Ki,onContentWillChange:Ki,onContentDidChange:Ki,onSelectionWillChange:Ki,onSelectionDidChange:Ki,onUndoStateWillChange:Ki,onUndoStateDidChange:Ki,onModeChange:Ki,onVirtualKeyboardToggle:Ki,onReadAloudStatus:Ki,onError:()=>{}},t),this.element=e,e.mathfield=this,this.originalContent=e.innerHTML;let a=this.element.textContent;a&&(a=a.trim());let i="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?i+=this.config.substituteTextArea:i+="":/android|ipad|ipod|iphone/i.test(null===navigator||void 0===navigator?void 0:navigator.userAgent)?i+="\n \n \n ":i+='',i+='',"manual"===this.config.virtualKeyboardMode?(i+=`
    `,this.config.virtualKeyboardToggleGlyph?i+=this.config.virtualKeyboardToggleGlyph:i+='',i+="
    "):i+="",i+="
    ",i+='\n
    \n \n \n
    \n ',this.element.innerHTML=this.config.createHTML(i);let s=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[s++].firstElementChild,this.field=this.element.children[s].children[0],this.field.addEventListener("wheel",e=>{e.preventDefault(),e.stopPropagation();const t=void 0===e.deltaX?e.detail:-e.deltaX;isFinite(t)&&this.field.scroll({top:0,left:this.field.scrollLeft-5*t})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[s++].children[1],va(this,this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[s].children[0],this.accessibleNode=this.element.children[s++].children[1],this.popover=ua("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=ua("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=this.config.defaultMode,this.smartModeSuppressed=!1,this.style={},this.blurred=!0,pa(this.element,"focus",this),pa(this.element,"blur",this),pa(this.textarea,"cut",this),pa(this.textarea,"copy",this),pa(this.textarea,"paste",this),function(e,t){let a,i=null,s=null,o=!1,r=!1;function n(e){clearTimeout(a),a=setTimeout((function(){clearTimeout(a),e()}))}function l(){if(function(e){return e.selectionStart!==e.selectionEnd}(e))return;const a=e.value;e.value="",a.length>0&&t.typedText(a)}const c=e;c.addEventListener("keydown",a=>{if(t.allowDeadKey()||"Dead"!==a.key&&"Unidentified"!==a.key&&229!==a.keyCode)r=!1;else{r=!0,o=!1;const a=t.blur,i=t.focus;t.blur=null,t.focus=null,"function"==typeof e.blur&&(e.blur(),e.focus()),t.blur=a,t.focus=i}return!(!o&&"CapsLock"!==a.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(a.code))||(i=a,s=null,t.keystroke(gi(a),a))},!0),c.addEventListener("keypress",e=>{o||(i&&s&&t.keystroke(gi(i),i),s=e,n(l))},!0),c.addEventListener("keyup",()=>{o||!i||s||l()},!0),c.addEventListener("paste",()=>{e.focus();const a=e.value;e.value="",a.length>0&&t.paste(a)},!0),c.addEventListener("blur",()=>{i=null,s=null,t.blur&&t.blur()},!0),c.addEventListener("focus",()=>{t.focus&&t.focus()},!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r&&t.allowDeadKey()&&n(l)},!0),c.addEventListener("input",()=>{if(r){const a=t.blur,i=t.focus;t.blur=null,t.focus=null,e.blur(),e.focus(),t.blur=a,t.focus=i,r=!1,o=!1,t.allowDeadKey()&&n(l)}else o||n(l)})}(this.textarea,{allowDeadKey:()=>"text"===this.mode,typedText:e=>Hi(this,e),paste:()=>Ui(this),keystroke:(e,t)=>Ii(this,e,t),focus:()=>this._onFocus(),blur:()=>this._onBlur()}),window.PointerEvent?pa(this.field,"pointerdown",this):pa(this.field,"touchstart:active mousedown",this),pa(window,"resize",this),this.model=new bt({mode:this.config.defaultMode,macros:this.config.macros,removeExtraneousParentheses:this.config.removeExtraneousParentheses},{onContentDidChange:e=>this.config.onContentDidChange(this),onSelectionDidChange:e=>this._onSelectionDidChange(),onContentWillChange:()=>this.config.onContentWillChange(this),onSelectionWillChange:()=>this.config.onSelectionWillChange(this),onError:this.config.onError},{announce:(e,t,a,i)=>{var s,o;return null===(o=(s=this.config).onAnnounce)||void 0===o?void 0:o.call(s,this,t,a,i)},moveOut:(e,t)=>this.config.onMoveOutOf(this,t),tabOut:(e,t)=>this.config.onTabOutOf(this,t)},this),this.undoManager=new bi(this.model),di(this.model,a,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:!0,macros:this.config.macros}),this.undoManager.startRecording(),this.undoManager.snapshot(this.config),this.model.setListeners({onContentDidChange:e=>this.config.onContentDidChange(this),onSelectionDidChange:e=>this._onSelectionDidChange(),onContentWillChange:()=>this.config.onContentWillChange(this),onSelectionWillChange:()=>this.config.onSelectionWillChange(this),onError:this.config.onError}),this.model.setHooks({announce:(e,t,a,i)=>{var s,o;return null===(o=(s=this.config).onAnnounce)||void 0===o?void 0:o.call(s,this,t,a,i)},moveOut:(e,t)=>this.config.onMoveOutOf(this,t),tabOut:(e,t)=>this.config.onTabOutOf(this,t)}),this.config.locale.startsWith(oa().locale)||sa(this.config.locale),this.keybindings=ma(this.config.keybindings,e=>{"function"==typeof this.config.onError&&this.config.onError({code:"invalid-keybinding",arg:e.join("\n")})}),Va(this)}$setConfig(e){this.config=Ni(this.config,e),this.model.setListeners({onContentDidChange:e=>this.config.onContentDidChange(this),onSelectionDidChange:e=>this._onSelectionDidChange(),onContentWillChange:()=>this.config.onContentWillChange(this),onSelectionWillChange:()=>this.config.onSelectionWillChange(this),onError:this.config.onError}),this.model.setHooks({announce:(e,t,a,i)=>{var s,o;return null===(o=(s=this.config).onAnnounce)||void 0===o?void 0:o.call(s,this,t,a,i)},moveOut:(e,t)=>this.config.onMoveOutOf(this,t),tabOut:(e,t)=>this.config.onTabOutOf(this,t)}),this.config.locale.startsWith(oa().locale)||sa(this.config.locale),this.keybindings=ma(this.config.keybindings,e=>{"function"==typeof this.config.onError&&this.config.onError({code:"invalid-keybinding",arg:e.join("\n")})}),this.config.readOnly||this._onBlur(),Va(this)}getConfig(e){return Bi(this.config,e)}handleEvent(e){switch(e.type){case"focus":this._onFocus();break;case"blur":this._onBlur();break;case"touchstart":case"mousedown":case"pointerdown":!function(e,t){const a=e;let i,s=!1,o=!1,r=!1;if(1!==t.buttons&&0!==t.buttons)return;let n=!1,l=!1;const c=t.touches?t.touches[0].clientX:t.clientX,d=t.touches?t.touches[0].clientY:t.clientY,m=Date.now(),p=setInterval(()=>{n?a.field.scroll({top:0,left:a.field.scrollLeft-16}):l&&a.field.scroll({top:0,left:a.field.scrollLeft+16})},32);function h(e){window.PointerEvent?(ha(a.field,"pointermove",u),ha(a.field,"pointerup pointercancel",h),a.field.releasePointerCapture(e.pointerId)):(ha(a.field,"touchmove",u),ha(a.field,"touchcancel touchend",h),ha(window,"mousemove",u),ha(window,"mouseup blur",h)),s=!1,clearInterval(p),a.element.querySelectorAll(".ML__scroller").forEach(e=>e.parentNode.removeChild(e)),e.preventDefault(),e.stopPropagation()}function u(t){const s=t.touches?t.touches[0].clientX:t.clientX,r=t.touches?t.touches[0].clientY:t.clientY,p="touch"===t.pointerType?20:5;if(Date.now()h.right,n=s=f.left&&c<=f.right&&d>=f.top&&d<=f.bottom){e.$hasFocus()||(r=!0,e.textarea.focus&&e.textarea.focus()),e.resetKeystrokeBuffer(),e.smartModeSuppressed=!1;const n=e.field.querySelector(".ML__mathlive").getBoundingClientRect();if(i=c>n.right?[{relation:"body",offset:e.model.root.body.length-1}]:Zi(e,c,d,{bias:0}),i){let n=document.createElement("div");n.className="ML__scroller",e.element.appendChild(n),n.style.left=f.left-200+"px",n=document.createElement("div"),n.className="ML__scroller",e.element.appendChild(n),n.style.left=f.right+"px",t.shiftKey?(Ut(e.model,e.model.path,i),i=pt(e.model.path),i[i.length-1].offset-=1):jt(e.model,i,0),r=!0,e.style={},3===t.detail||Gi>2?(h(t),3!==t.detail&&3!==Gi||Ot(e.model)):s||(s=!0,window.PointerEvent?(pa(a.field,"pointermove",u),pa(a.field,"pointerup pointercancel",h),a.field.setPointerCapture(t.pointerId)):(pa(window,"blur",h),t.touches?(pa(t.target,"touchmove",u),pa(t.target,"touchcancel touchend",h)):(pa(window,"mousemove",u),pa(window,"mouseup",h))),2!==t.detail&&2!==Gi||(o=!0,Bt(e.model)))}}else ji=null;r&&Va(e),t.preventDefault()}(this,e);break;case"resize":this.resizeTimer&&window.cancelAnimationFrame(this.resizeTimer),this.resizeTimer=window.requestAnimationFrame(()=>ga(this)&&this._onResize());break;case"cut":t=this,setTimeout(function(){t.$clearSelection(),Va(t)}.bind(t),0);break;case"copy":!function(e,t){Rt(e.model)?(t.clipboardData.setData("text/plain","$$"+e.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",e.$text("json")),t.clipboardData.setData("application/xml",e.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+e.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",e.$selectedText("json")),t.clipboardData.setData("application/xml",e.$selectedText("mathML"))),t.preventDefault()}(this,e);break;case"paste":Ui(this)}var t}$revertToOriginalContent(){this.element.innerHTML=this.config.createHTML(this.originalContent),delete this.element.mathfield,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,ha(this.textarea,"cut",this),ha(this.textarea,"copy",this),ha(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,fa(this.popover),delete this.popover,fa(this.keystrokeCaption),delete this.keystrokeCaption,fa(this.virtualKeyboard),delete this.virtualKeyboard,fa(document.getElementById("mathlive-alternate-keys-panel")),ha(this.element,"pointerdown",this),ha(this.element,"touchstart:active mousedown",this),ha(this.element,"focus",this),ha(this.element,"blur",this),ha(window,"resize",this),delete this.element}resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_onSelectionDidChange(){!function(e){const t=Mt(e);if(t){const a=e.siblings(),i=e.anchorOffset()+1;for(let e=t.start;e=0;e--)"command"===a[e].type?a.splice(e,1):t(a[e]);else if(t(a.body),t(a.superscript),t(a.subscript),t(a.underscript),t(a.overscript),t(a.numer),t(a.denom),t(a.index),a.array)for(let e=gt(a.array);e>=0;e--)t(ft(a.array,e))}(t.root.body),t.suppressChangeNotifications=a,wt(t)}(this.model))}wa(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&cs(this),wa(this),this.config.onFocus&&this.config.onFocus(this),Va(this))}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&ds(this),Li(this,{discard:!0}),Va(this),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),wa(this)}$perform(t){return function(t,a){var i;if(!a)return!1;let s,o=[],r=!1,n=!1;if(e(a)?(s=a[0],o=a.slice(1)):s=a,s=s.replace(/-\w/g,e=>e[1].toUpperCase()),"model"===(null===(i=ja[s])||void 0===i?void 0:i.target)){if(/^(delete|transpose|add)/.test(s)&&t.resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(s)&&"command"!==t.mode&&(t.popUndoStack(),t.snapshot()),ja[s].fn(t.model,...o),/^(delete|transpose|add)/.test(s)&&"command"!==t.mode&&t.snapshot(),/^(delete)/.test(s)&&"command"===t.mode){const e=oe(La(t.model));0===e.length?Ma(t):ka(t,e[0].match,e.length>1)}n=!0,r=!0}else{if(!ja[s])throw Error('Unknown command "'+s+'"');n=ja[s].fn(t,...o),r=!0}return Rt(t.model)&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(s)||(t.resetKeystrokeBuffer(),t.style={}),n&&Va(t),r}(this,t)}formatMathlist(e,t){let a="";if("latex"===(t=t||"latex")||"latex-expanded"===t)a=e.toLatex("latex-expanded"===t);else if("mathML"===t)a=Ha(e,this.config);else if("spoken"===t)a=_i(e,this.config);else if("spoken-text"===t){const t=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",a=_i(e,this.config),this.config.textToSpeechMarkup=t}else if("spoken-ssml"===t||"spoken-ssml-withHighlighting"===t){const t=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="ssml",a=_i(e,this.config),this.config.textToSpeechMarkup=t}else if("json"===t){const t=Zs(e);a=JSON.stringify(t)}else if("json-2"===t){const t=Zs(e);a=JSON.stringify(t,null,2)}else"ASCIIMath"===t&&(a=ki(e));return a}$text(e){return this.formatMathlist(this.model.root,e)}$selectedText(e){const t=Nt(this.model);if(!t)return"";const a=Oe("math",t);return this.formatMathlist(a,e)}$selectionIsCollapsed(){return Rt(this.model)}$selectionDepth(){return this.model.path.length}$selectionAtStart(){return 0===this.model.startOffset()}$selectionAtEnd(){return this.model.endOffset()>=this.model.siblings().length-1}groupIsSelected(){return 0===this.model.startOffset()&&this.model.endOffset()>=this.model.siblings().length-1}$latex(e,t){return"string"==typeof e?(e!==this.model.root.toLatex()&&(t=null!=t?t:{mode:"math"},di(this.model,e,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:t.suppressChangeNotifications,macros:this.config.macros}),this.undoManager.snapshot(this.config),Va(this)),e):this.model.root.toLatex()}$el(){return this.element}scrollIntoView(){var e;this.dirty&&Ua(this);let t=null===(e=ya(this.field))||void 0===e?void 0:e.x;const a=this.field.getBoundingClientRect();if(void 0===t){const e=ba(this.field);e&&(t=e.right+a.left-this.field.scrollLeft)}if(void 0!==t){const e=t-window.scrollX;ea.right&&this.field.scroll({top:0,left:e-a.right+this.field.scrollLeft+20,behavior:"smooth"})}}$insert(e,t){if("string"==typeof e&&e.length>0){if((t=null!=t?t:{mode:"math"}).focus&&this.$focus(),t.feedback&&(this.config.keypressVibration&&(null===navigator||void 0===navigator?void 0:navigator.vibrate)&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===e)Ja(this.model);else if("&"===e)Qa(this.model);else{const a=this.style;di(this.model,e,{mode:this.mode,style:Ct(this.model),...t}),t.resetStyle&&(this.style=a)}return this.undoManager.snapshot(this.config),Va(this),!0}return!1}switchMode(e,t="",a=""){this.resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(e),t&&this.$insert(t,{format:"latex",mode:{math:"text",text:"math"}[e]}),Ca(this.model,!1),"command"===e?(nt(this.model),Ma(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&ls(this,"lower-command"),di(this.model,"",{mode:"math"})):this.mode=e,a&&this.$insert(a,{format:"latex",mode:e}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),Va(this)}$hasFocus(){return document.hasFocus()&&function e(t=document){var a,i;return(null===(i=null===(a=t.activeElement)||void 0===a?void 0:a.shadowRoot)||void 0===i?void 0:i.activeElement)?e(t.activeElement.shadowRoot):t.activeElement}(document)===this.textarea}$focus(){this.$hasFocus()||("function"==typeof this.textarea.focus&&this.textarea.focus(),this.model.announce("line"))}$blur(){this.$hasFocus()&&this.textarea.blur&&this.textarea.blur()}$select(){Ot(this.model)}$clearSelection(){ti(this.model)}$applyStyle(e){ci(this.model,e)}$keystroke(e,t){return Ii(this,e,t)}$typedText(e){Hi(this,e)}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(){this.undoManager.snapshot({...this.config,onUndoStateDidChange:(e,t)=>{ns(this),this.config.onUndoStateDidChange(e,t)}})}snapshotAndCoalesce(){this.undoManager.snapshotAndCoalesce({...this.config,onUndoStateDidChange:(e,t)=>{ns(this),this.config.onUndoStateDidChange(e,t)}})}getUndoRecord(){return this.undoManager.save()}restoreToUndoRecord(e){this.undoManager.restore(e,{...this.config,suppressChangeNotifications:!0})}undo(){return this.undoManager.undo({...this.config,onUndoStateDidChange:(e,t)=>{ns(this),this.config.onUndoStateDidChange(e,t)}})}redo(){return this.undoManager.redo({...this.config,onUndoStateDidChange:(e,t)=>{ns(this),this.config.onUndoStateDidChange(e,t)}})}}function to(e,t,a){let i=a,s=0;const o=e.length;for(;i0&&s.push({type:"text",data:r.slice(0,c)}),l=!1);let d=!1;for(;!d;){if(l){if(n=r.indexOf(t,c),-1===n){d=!0;break}c!==n&&s.push({type:"text",data:r.slice(c,n)}),c=n}else{if(n=to(a,r,c+t.length),-1===n){d=!0;break}s.push({type:"math",data:r.slice(c+t.length,n),rawData:r.slice(c,n+a.length),mathstyle:i}),c=n+a.length}l=!l}c";a.innerHTML=t.createHTML?t.createHTML(i):i}catch(t){a.textContent=e}return a.className="sr-only",a}(e,a)),/\bspeakable-text\b/i.test(a.renderAccessibleContent)&&a.renderToSpeakableText){const i=document.createElement("span"),s=a.renderToSpeakableText(e,a);i.innerHTML=a.createHTML?a.createHTML(s):s,i.className="sr-only",t.appendChild(i)}return t.appendChild(s),t}return s}function oo(e,t){let a=null;if(t.TeX.processEnvironments&&/^\s*\\begin/.test(e))a=document.createDocumentFragment(),a.appendChild(so(e,void 0,t,!0));else{const i=io(e,t.TeX.delimiters);if(1===i.length&&"text"===i[0].type)return null;a=document.createDocumentFragment();for(let e=0;e0?no(e[t].children,a):e[t];if("string"==typeof t){for(let s=0;s0?no(e[s].children,a):e[s];if(i=no(e[s].children,t),i)return i}return i}return null}function lo(e,t){var a;const i=no(e,t);return i?null!==(a=i.classes)&&void 0!==a?a:"":null}function co(e,t){let a="";return e[t]&&(a+=''+t+"=",a+='',a+=e[t],a+='" '),a}var mo={mathlistToMarkup:function e(t,a=""){if(!t)return"";let i="";if(Array.isArray(t))for(let s=0;s"),"string"==typeof t.body&&t.body.length>0&&(i+=' ',i+=t.body,(t.body.charCodeAt(0)<32||t.body.charCodeAt(0)>127)&&(i+=" U+"+("000000"+t.body.charCodeAt(0).toString(16)).substr(-6)),i+=" "),"mathrm"===t.fontFamily?(i+='',i+=co(t,"fontFamily"),i+=""):i+=co(t,"fontFamily"),i+=co(t,"hasBarLine"),i+=co(t,"leftDelim"),i+=co(t,"rightDelim"),i+=co(t,"continuousFraction"),i+=co(t,"limits"),i+=co(t,"symbol"),i+=function(e,t){let a="";return e.framecolor&&(a+='framecolor=',a+='',a+='',a+=e.framecolor,a+=""),a}(t),i+=co(t,"mathstyle"),i+=co(t,"size"),i+=co(t,"cls"),i+=co(t,"delim"),i+=co(t,"shift"),i+=co(t,"width"),i+=co(t,"height"),i+=co(t,"position"),i+=e(t.overscript,a+"↑"),i+=e(t.underscript,a+"↓"),i+=e(t.superscript,a+"↑"),i+=e(t.subscript,a+"↓"),i+=e(t.body,a+"▶"),i+=e(t.numer,a+"▲"),i+=e(t.denom,a+"▼"),t.array)for(let s=0;s"+a+"⌗ row "+(s+1)+"/"+t.array.length;for(let o=0;o"),t.body&&t.body.length>0&&(i+=''+t.body+""),t.classes&&t.classes.length>0&&(i+=' '+t.classes+""),t.isTight&&(i+='  tight '),t.caret&&(i+='  caret '),t.style)for(const e in t.style)Object.prototype.hasOwnProperty.call(t.style,e)&&(i+=' '+e+":",i+=' '+t.style[e]+"; ");t.children&&(i+=t.children.map(t=>e(t,a+"▷")).join("; "))}return i},spanToString:function e(t,a=""){let i="";if(Array.isArray(t))if(0===t.length)i+="[]\n";else{i+="[\n";for(let s=0;s0&&(i+=a+'body:"'+t.body+'",\n'),t.classes&&t.classes.length>0&&(i+=a+'classes:"'+t.classes+'",\n'),t.style)for(const e in t.style)Object.prototype.hasOwnProperty.call(t.style,e)&&(i+=a+e+':"',i+=t.style[e]+'",\n');t.children&&t.children.length>0&&(i+=a+"children:"+t.children.map(t=>e(t,a)).join("; ")),i+=a+"}"}return i},hasClass:function(e,t,a){const i=lo(e,t);if(!i)return!1;const s=i.split(" ");for(let e=0;e{if(e)return;if(!t||!t.AudioStream)return;const a=new TextDecoder("utf-8").decode(new Uint8Array(t.AudioStream));window.mathlive.readAloudMarks=a.split("\n").map(e=>e?JSON.parse(e):{}),window.mathlive.readAloudTokens=[];for(const e of window.mathlive.readAloudMarks)e.value&&window.mathlive.readAloudTokens.push(e.value);window.mathlive.readAloudCurrentMark="",o.OutputFormat="mp3",o.SpeechMarkTypes=[],s.synthesizeSpeech(o,(function(e,t){if(e)return;if(!t||!t.AudioStream)return;const a=new Uint8Array(t.AudioStream),i=new Blob([a.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{const e=window.mathlive.readAloudMathField;r&&r(e,"ended"),e?(Ua(e),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function e(t){if(t.classList.remove("highlight"),t.children)for(const a of t.children)e(a)}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let e="";const t=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const a of window.mathlive.readAloudMarks)a.time0&&Array.from(t.children).forEach(t=>{e(t,a)})):(t.classList.add("highlight"),t.children&&t.children.length>0&&Array.from(t.children).forEach(t=>{e(t)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,r&&r(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}))})}function ho(e,t,a=3e3,i="$0"){t.forEach(t=>{N[t]&&(N[t].frequency=a,N[t].category=e,N[t].template=i.replace(/\$0/g,t)),O[t]&&(O[t]={...O[t],frequency:a,category:e,template:i.replace(/\$0/g,t)})})}function uo(e,t){(t=null!=t?t:{}).mathstyle=t.mathstyle||"displaystyle",t.letterShapeStyle=t.letterShapeStyle||"auto";const a=ot(e,"math",null,t.macros,!1,t.onError);let i=Ne({mathstyle:c[t.mathstyle],letterShapeStyle:t.letterShapeStyle},a);return i=function e(t){if(!t||0===t.length)return[];t[0].children=e(t[0].children);const a=[t[0]];for(let i=1;i0\\right\\}"),ho("Layout",["\\overset","\\underset","\\stackrel","\\stackbin"],1200,"$0{arg}{x=0}"),ho("Layout",["\\rlap","\\mathrlap"],1200,"$0{/}0"),ho("Layout",["\\llap","\\mathllap"],1200,"o$0{/}"),ho("Fractions",["\\frac"],4e3,"$0{\\placeholder{}}{\\placeholder{}}"),ho("Fractions",["\\binom","\\dfrac","\\tfrac","\\dbinom","\\tbinom","\\pdiff","\\cfrac"],1200,"$0{\\placeholder{}}{\\placeholder{}}"),ho("Fractions",["\\over","\\atop","\\choose"],1200,'\\unicode{"2B1A} $0 \\unicode{"2B1A}'),ho("Fractions",["\\overwithdelims","\\atopwithdelims"],1200,'{\\unicode{"2B1A} $0{\\lbrace}{\\rbrace} \\unicode{"2B1A}}'),ho("Extensible Operators",["\\sum","\\prod","\\bigcap","\\bigcup","\\int"],4e3),ho("Extensible Operators",["\\bigoplus","\\smallint","\\iint","\\oint"],3e3),ho("Extensible Operators",["\\bigwedge","\\bigvee","\\coprod","\\bigsqcup","\\bigotimes","\\bigodot","\\biguplus","\\intop","\\sqcup","\\sqcap","\\uplus","\\wr","\\Cap","\\Cup","\\doublecap","\\doublecup","\\amalg","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],1200),ho("Accents",["\\vec"],4e3),ho("Accents",["\\bar","\\ddot","\\acute","\\tilde","\\check"],3e3,"$0{\\placeholder{}}"),ho("Accents",["\\^","\\`","\\'"],1200,"$0{e}"),ho("Accents",["\\c"],1200,"$0{c}"),ho("Accents",["\\~"],1200,"$0{n}"),ho("Accents",["\\mathring","\\hat","\\dot","\\breve","\\grave"],1200,"$0{\\placeholder{}}"),ho("Extensible Symbols",["\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftharpoon","\\overrightharpoon","\\overleftrightarrow","\\overbrace","\\overlinesegment","\\overgroup","\\widehat","\\widecheck","\\widetilde"],3e3,"$0{ABC}"),ho("Extensible Symbols",["\\underrightarrow","\\underleftarrow","\\underleftrightarrow","\\underbrace","\\underlinesegment","\\undergroup","\\utilde"],3e3,"$0{ABC}"),ho("Sizing",["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],1200,"$0{x=0}"),ho("Sizing",["\\big","\\Big","\\bigg","\\Bigg"],1200,"$0($0)"),ho("Sizing",["\\bigl","\\Bigl","\\biggl","\\Biggl"],1200,"$0("),ho("Sizing",["\\bigr","\\Bigr","\\biggr","\\Biggr"],1200,"$0)"),ho("Sizing",["\\bigm","\\Bigm","\\biggm","\\Biggm"],1200,"$0|"),ho("Letterlike Symbols",["\\nabla","\\partial","\\doubleStruckCapitalN","\\N","\\doubleStruckCapitalR","\\R","\\doubleStruckCapitalQ","\\Q","\\doubleStruckCapitalC","\\C","\\doubleStruckCapitalZ","\\Z","\\exponentialE","\\forall","\\exists","\\nexists","\\$","\\%","\\And","\\degree"],4e3),ho("Letterlike Symbols",["\\doubleStruckCapitalP","\\P","\\ell","\\hbar","\\hslash","\\imath","\\jmath","\\imaginaryI","\\imaginaryJ","\\differentialD","\\rd","\\capitalDifferentialD","\\rD","\\differencedelta","\\mid","@","\\Re","\\Im"],3e3),ho("Letterlike Symbols",["\\top","\\bot","\\scriptCapitalE","\\scriptCapitalH","\\scriptCapitalL","\\gothicCapitalC","\\gothicCapitalH","\\gothicCapitalI","\\gothicCapitalR","\\Bbbk","\\Finv","\\Game","\\wp","\\eth","\\mho","\\pounds","\\yen","\\euro"],1200),ho("Crosses",["\\dagger","\\dag"],4e3),ho("Crosses",["\\ddag","\\ddagger","\\maltese","\\textdagger","\\textdaggerdbl"],1200),ho("Various",["\\checkmark","\\diagup","\\diagdown","\\angle","\\measuredangle","\\sphericalangle","\\prime","\\doubleprime","\\backprime","\\backdoubleprime","\\sharp","\\flat","\\natural","\\&","\\#","\\clubsuit","\\spadesuit","\\diamondsuit","\\heartsuit","\\backslash","\\infty","/","\\_","\\/","|","'"],1200),ho("Various",["\\unicode"],1200,'$0{"2B1A}'),ho("Arrows",["\\longrightarrow","\\rightarrow","\\Longrightarrow","\\Rightarrow"],4e3),ho("Arrows",["\\longmapsto","\\mapsto","\\Longleftrightarrow","\\rightleftarrows","\\leftarrow","\\curvearrowleft","\\uparrow","\\downarrow","\\hookrightarrow","\\rightharpoonup","\\rightleftharpoons"],3e3),ho("Arrows",["\\Leftarrow","\\longleftrightarrow","\\longleftarrow","\\Longleftarrow","\\searrow","\\nearrow","\\swarrow","\\nwarrow","\\Uparrow","\\Downarrow","\\updownarrow","\\Updownarrow","\\hookleftarrow","\\leftharpoonup","\\leftharpoondown","\\rightharpoondown","\\leftrightarrows","\\dashrightarrow","\\dashleftarrow","\\leftleftarrows","\\Lleftarrow","\\twoheadleftarrow","\\leftarrowtail","\\looparrowleft","\\leftrightharpoons","\\circlearrowleft","\\Lsh","\\upuparrows","\\downharpoonleft","\\multimap","\\leftrightsquigarrow","\\twoheadrightarrow","\\rightarrowtail","\\looparrowright","\\curvearrowright","\\circlearrowright","\\Rsh","\\downdownarrows","\\upharpoonright","\\downharpoonright","\\rightsquigarrow","\\leadsto","\\Rrightarrow","\\restriction"],1200),ho("Arrows",["\\upharpoonleft","\\rightrightarrows"],0),ho("Negated Arrows",["\\nrightarrow","\\nRightarrow","\\nleftrightarrow","\\nLeftrightarrow","\\nleftarrow","\\nLeftarrow"],1200),ho("Extensible Symbols",["\\xrightarrow","\\xleftarrow","\\xRightarrow","\\xLeftarrow","\\xleftharpoonup","\\xleftharpoondown","\\xrightharpoonup","\\xrightharpoondown","\\xlongequal","\\xtwoheadleftarrow","\\xtwoheadrightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xrightleftharpoons","\\xleftrightharpoons","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium"],1200,"$0[below]{above}=0"),ho("Negated Relations",["\\nless","\\nleqslant","\\lneq","\\lneqq","\\nleqq","\\unlhd","\\unrhd","\\lvertneqq","\\lnsim","\\lnapprox","\\nprec","\\npreceq","\\precnsim","\\precnapprox","\\nsim","\\nshortmid","\\nmid","\\nvdash","\\nvDash","\\ngtr","\\ngeqslant","\\ngeqq","\\gneq","\\gneqq","\\gvertneqq","\\gnsim","\\nsucc","\\succnsim","\\ncong","\\nshortparallel","\\nparallel","\\nVDash","\\nVdash","\\precneqq","\\succneqq","\\gnapprox","\\succnapprox","\\nsucceq"],1200),ho("Hebrew",["\\aleph","\\beth","\\daleth","\\gimel"],1200),ho("Fences",["\\lbrace","\\rbrace","\\vert","\\Vert","\\{","\\}","(",")","[","]"],4e3),ho("Fences",["\\langle","\\rangle","\\lfloor","\\rfloor","\\lceil","\\rceil","\\mvert","\\|","\\mVert"],3e3),ho("Fences",["\\lvert","\\rvert","\\lVert","\\rVert","\\lbrack","\\rbrack","\\ulcorner","\\urcorner","\\llcorner","\\lrcorner","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache"],1200),ho("Relations",["=","\\ne","\\neq","<",">","\\leqslant","\\geqslant","\\approx"],4e3),ho("Relations",["\\lt","\\gt","\\le","\\ge","\\leq","\\geq","\\gg","\\cong","\\equiv","\\prec","\\preceq","\\succ","\\perp","\\parallel","\\propto","\\smile","\\frown","\\sim","\\gtrsim"],3e3),ho("Relations",["\\coloneq","\\succeq","\\approxeq","\\thickapprox","\\lessapprox","\\gtrapprox","\\precapprox","\\succapprox","\\thicksim","\\succsim","\\precsim","\\backsim","\\eqsim","\\backsimeq","\\simeq","\\lesssim","\\nleq","\\ngeq","\\smallsmile","\\smallfrown","\\bowtie","\\asymp","\\leqq","\\eqslantless","\\ll","\\lll","\\lessgtr","\\lesseqgtr","\\lesseqqgtr","\\risingdotseq","\\fallingdotseq","\\preccurlyeq","\\curlyeqprec","\\vDash","\\Vvdash","\\bumpeq","\\Bumpeq","\\geqq","\\eqslantgtr","\\ggg","\\gtrless","\\gtreqless","\\gtreqqless","\\succcurlyeq","\\curlyeqsucc","\\Vdash","\\shortmid","\\shortparallel","\\between","\\pitchfork","\\varpropto","\\backepsilon","\\llless","\\gggtr","\\lhd","\\rhd","\\Join","\\doteq","\\doteqdot","\\Doteq","\\eqcirc","\\circeq","\\lessdot","\\gtrdot","\\measeq","\\eqdef","\\questeq"],1200),ho("Logic",["\\leftrightarrow","\\Leftrightarrow","\\to"],4e3),ho("Logic",["\\models","\\vdash"],3e3),ho("Logic",["\\therefore","\\because","\\implies","\\gets","\\dashv","\\impliedby","\\biconditional","\\roundimplies"],1200),ho("Operators",["+","-","*","\\cdot"],4e3),ho("Operators",["\\sqrt"],4e3,"$0{\\placeholder{}}"),ho("Operators",["\\pm","\\mp","\\times","\\div","\\surd"],3e3),ho("Operators",["\\ltimes","\\rtimes","\\leftthreetimes","\\rightthreetimes","\\intercal","\\dotplus","\\centerdot","\\doublebarwedge","\\divideontimes","\\divides"],1200),ho("Logic",["\\wedge","\\vee","\\neg"],4e3),ho("Logic",["\\lnot"],3e3),ho("Logic",["\\land","\\lor","\\barwedge","\\veebar","\\nor","\\curlywedge","\\curlyvee"],1200),ho("Greek",["\\alpha","\\beta","\\gamma","\\delta","\\epsilon","\\varepsilon","\\zeta","\\eta","\\theta","\\vartheta","\\iota","\\kappa","\\varkappa","\\lambda","\\mu","\\nu","\\xi","\\pi","\\varpi","\\rho","\\varrho","\\sigma","\\varsigma","\\tau","\\phi","\\varphi","\\upsilon","\\chi","\\psi","\\omega","\\Gamma","\\Delta","\\Theta","\\Lambda","\\Xi","\\Pi","\\Sigma","\\Upsilon","\\Phi","\\Psi","\\Omega","\\digamma","\\omicron"],3e3),ho("Sets",["\\emptyset","\\varnothing","\\cap","\\cup","\\in","\\notin","\\subset","\\supset","\\subseteq","\\supseteq","\\sqsubseteq"],4e3),ho("Sets",["\\setminus","\\not","\\ni","\\sqsupseteq","\\nsupseteqq","\\supsetneq","\\varsupsetneq","\\supsetneqq","\\varsupsetneqq"],3e3),ho("Sets",["\\smallsetminus","\\complement","\\owns","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\varsubsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq","\\nsubseteqq","\\subseteqq","\\Subset","\\sqsubset","\\supseteqq","\\Supset","\\sqsupset"],1200),ho("Spacing",["\\space, \\quad","\\qquad"],3e3,'\\unicode{"203A}$0\\unicode{"2039}'),ho("Spacing",["\\!","\\,","\\:","\\;","\\enskip","\\enspace"],1200,'\\unicode{"203A}$0\\unicode{"2039}'),ho("Spacing",["\\hspace","\\hspace*"],1200,'\\unicode{"203A}$0{1em}\\unicode{"2039}'),ho("Punctuation",["\\colon","\\cdotp","\\ldots","\\cdots","\\ddots","\\vdots","?","!",":",'"',",",".",";"],3e3),ho("Punctuation",["\\mathellipsis","\\ldotp","\\Colon"],1200),ho("Boxes",["\\square","\\Box"],3e3),ho("Boxes",["\\blacksquare","\\boxminus","\\boxplus","\\boxtimes","\\boxdot"],1200),ho("Circles",["\\circ","\\bullet","\\circleddash","\\oplus","\\otimes"],3e3),ho("Circles",["\\bigcirc","\\circledast","\\ominus","\\circledcirc","\\oslash","\\circledS","\\circledR","\\odot"],1200),ho("Triangles",["\\triangle","\\triangleq"],3e3),ho("Triangles",["\\bigtriangleup","\\vartriangle","\\triangledown","\\bigtriangledown","\\triangleleft","\\vartriangleleft","\\trianglelefteq","\\ntriangleleft","\\ntrianglelefteq","\\triangleright","\\vartriangleright","\\trianglerighteq","\\ntriangleright","\\ntrianglerighteq","\\blacktriangle","\\blacktriangledown","\\blacktriangleleft","\\blacktriangleright"],1200),ho("Shapes",["\\ast","\\star"],3e3),ho("Shapes",["\\diamond","\\Diamond","\\lozenge","\\blacklozenge","\\bigstar"],1200),{version:"0.52.0",latexToMarkup:uo,latexToMathML:fo,latexToSpeakableText:go,latexToAST:function(e,t){var a;return(t=null!=t?t:{}).macros={...P,...null!==(a=t.macros)&&void 0!==a?a:{}},Zs(ot(e,"math",null,t.macros,!1,t.onError),t)},astToLatex:function(t,a){return function t(a,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let o="";if(void 0===a)return"";if("string"==typeof a)o=a;else if(a.latex)o=a.latex;else if(_s(a)){const e=zs(a);if(e===-1/0)o="-\\infty ";else if(e===1/0)o="\\infty ";else if("object"!=typeof a.num||"string"!=typeof a.num.re&&"string"!=typeof a.num.im)o=isNaN(e)?"\\text{NaN}":Qs(a.num,s);else{const e=Ds(a),t=qs(a);isNaN(e)||isNaN(t)?o="\\text{NaN}":Math.abs(t)<=Number.EPSILON&&Math.abs(e)<=Number.EPSILON?o="0":(Math.abs(e)>Number.EPSILON&&(o=Qs(e,s)),Math.abs(t)>Number.EPSILON&&(Math.abs(e)>Number.EPSILON&&(o+=t>0?"+":""),o+=(1!==Math.abs(t)?Qs(t,s):"")+"\\imaginaryI "))}Ts(a)&&(o+="^{"+t(a.sup,s)+"}"),Ks(a)&&(o+="_{"+t(a.sub,s)+"}")}else if(a.group)o=t(a.group,s),_s(a.group)||$s(a.group)?0!==qs(a.group)&&(o=Xs(a.fence||"(),",o)):o=Xs(a.fence||"(),",o),Ts(a)&&(o+="^{"+t(a.sup,s)+"}"),Ks(a)&&(o+="_{"+t(a.sub,s)+"}");else if(a.fn)if("bind"===a.fn){if(o=t(gs(a,0),s)+"|_{",a.arg&&2===a.arg.length)o+=t(gs(a,1));else{let e="";for(let i=1;it(e,s)));else if("text"===a.fn)o="\\text{"+(a.arg[0]||"")+"}";else if("pow"===a.fn&&e(a.arg)&&a.arg.length>=2)o=t(gs(a,0),s),_s(gs(a,0))||$s(gs(a,0))||(o=Xs(a.fence||"(),",o)),o+="^{"+t(gs(a,1),s)+"}";else if("equal"===a.fn&&a.arg&&a.arg.length>2)o=a.arg.map(e=>t(e,s)).join(" = ");else{const i=function(e){let t=us[e];return t||(t=e.length>1?"\\operatorname{"+e+"}%^%_ %":e+"%^%_ %"),t}(a.fn);o=i;let r="";if(/%(?![01_^])/.test(i)&&e(a.arg)&&a.arg.length>1)o+=Xs(a.fence||"(),",...a.arg.map(e=>t(e,s)));else if(e(a.arg)&&a.arg.length>0){const e=t(gs(a,0),s),n=t(gs(a,1),s),l=[...a.arg];/%0/.test(i)&&(o=o.replace("%0",e),l.shift()),/%1/.test(i)&&(o=o.replace("%1",n),l.shift()),l.length>0&&(r=Xs(a.fence||"(),",...l.map(e=>t(e,s))))}else r=Xs(a.fence||"(),","");o=Ts(a)?o.replace("%^","^{"+t(a.sup,s)+"}"):o.replace("%^",""),o=Ks(a)?o.replace("%_","_{"+t(a.sub,s)+"}"):o.replace("%_",""),o=o.replace(/%(?![01_^])/,r),o=o.replace("%0","").replace("%1","")}else{const e=[];for(const i of a.arg)"add"===i.fn||"subtract"===i.fn||0!==Ds(r=i)&&0!==qs(r)||Ts(a)&&0!==qs(i)&&1!==qs(i)?e.push(Xs("() ",t(i,s))):e.push(t(i,s));if("multiply"===a.fn)o=!a.arg||2!==a.arg.length||!_s(a.arg[0])&&"divide"!==a.arg[0].fn||_s(a.arg[1])&&(0!==Ds(a.arg[1])||1!==qs(a.arg[1]))?e.join(" \\times "):e[0]+e[1];else if(a.arg&&1===a.arg.length)o="negate"===a.arg[0].fn||_s(a.arg[0])&&zs(a.arg[0])<0?e[0]:"+"+e[0];else{o=e[0];for(let t=1;t=0&&(i+=t,i({...e,[t]:i[t][this.size]}),{}),this.metrics.emPerEx=i.xHeight[this.size]/i.quad[this.size]}sup(){return c[[4,5,4,5,6,7,6,7][this.id]]}sub(){return c[[5,5,5,5,7,7,7,7][this.id]]}fracNum(){return c[[2,3,4,5,6,7,6,7][this.id]]}fracDen(){return c[[3,3,5,5,7,7,7,7][this.id]]}cramp(){return c[[1,1,3,3,5,5,7,7][this.id]]}cls(){return["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"][this.size]}adjustTo(e){let t=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]][this.size][e.size];return t.length>0&&(t=" "+t),t}isTight(){return this.size>=2}}const c={0:new l(0,0,1,!1),1:new l(1,0,1,!0),2:new l(2,1,1,!1),3:new l(3,1,1,!0),4:new l(4,2,.7,!1),5:new l(5,2,.7,!0),6:new l(6,3,.5,!1),7:new l(7,3,.5,!0)};c.displaystyle=c[0],c.textstyle=c[2],c.scriptstyle=c[4],c.scriptscriptstyle=c[6];class d{constructor(e){var t;this.macros=null!==(t=e.macros)&&void 0!==t?t:{},this.atomIdsSettings=e.atomIdsSettings,this.mathstyle=e.mathstyle||c.displaystyle,this.letterShapeStyle=e.letterShapeStyle||"tex",this.size=e.size||"size5",this.parentMathstyle=e.parentMathstyle||this.mathstyle,this.parentSize=e.parentSize||this.size,this.opacity=e.opacity,this.smartFence=e.smartFence}clone(e={}){const t=new d(this);return e&&(Object.assign(t,e),e.mathstyle?(t.parentMathstyle=this.mathstyle,t.parentSize=this.size,"string"==typeof e.mathstyle&&(t.mathstyle=c[e.mathstyle])):t.mathstyle=this.mathstyle),t}setMathstyle(e){e&&"auto"!==e&&(this.mathstyle=c[e])}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sub()})}}const m={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},p={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34]},h={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",widetilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",widetilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",widetilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",widetilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};function u(e){let t="",a="";for(const i of e)/[a-zA-Z*]/.test(i[0])&&(a+=t),t=/\\[a-zA-Z]+\*?$/.test(i)?" ":"",a+=i;return a}function f(e,t){const a=[];let i,s=[];return e.forEach(e=>{if("first"!==e.type){let o;"variant"===t?(o=e.variant,e.variantStyle&&"up"!==e.variantStyle&&(o+="-"+e.variantStyle)):o=e[t],o!==i?(s.length>0&&a.push(s),s=[e],i=o):s.push(e)}}),s.length>0&&a.push(s),a}const g={};function y(e,t){g[e]={...t}}const b=["","mord","mbin","mop","mrel","mopen","mclose","mpunct","minner","spacing","first","command","error","placeholder","textord","none"];function v(e){return b.includes(e)}const x={"mord+mop":3,"mord+mbin":4,"mord+mrel":5,"mord+minner":3,"mop+mord":3,"mop+mop":3,"mop+mbin":5,"mop+minner":3,"mbin+mord":4,"mbin+mop":4,"mbin+mopen":4,"mbin+minner":4,"mrel+mord":5,"mrel+mop":5,"mrel+mopen":5,"mrel+minner":5,"mclose+mop":3,"mclose+mbin":4,"mclose+mrel":5,"mclose+minner":3,"mpunct+mord":3,"mpunct+mop":3,"mpunct+mbin":4,"mpunct+mrel":5,"mpunct+mopen":3,"mpunct+mpunct":3,"mpunct+minner":3},k=["​"," ","  "," "," ","  "," ","",""," "],w=[""," ⁣",""," ⁣"," ⁣"," ⁣"],S={"mord+mop":3,"mop+mord":3,"mop+mop":3,"mclose+mop":3,"minner+mop":3};function M(t){if("string"==typeof t)return t;if("number"==typeof t)return Number(Math.ceil(100*t)/100).toString();if(void 0===t)return"";if(e(t)){let e="";for(const a of t)e+=M(a);return e}return""}class L{constructor(t,a="",i=""){this.classes=a,e(t)?this.children=[].concat(...t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.type=i,this.style=null,this.updateDimensions()}updateDimensions(){let e=0,t=0,a=1;this.children?this.children.forEach(i=>{i.height>e&&(e=i.height),i.depth>t&&(t=i.depth),i.maxFontSize>a&&(a=i.maxFontSize)}):"string"==typeof this.body&&(e=.7,t=.2),this.height=e,this.depth=t,this.maxFontSize=a}selected(e){e&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!e&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(t=>t.selected(e))}applyStyle(e){if(!e)return;if(e.color&&("none"!==e.color?this.setStyle("color",e.color):this.setStyle("color","")),e.backgroundColor&&("none"!==e.backgroundColor?this.setStyle("background-color",e.backgroundColor):this.setStyle("background-color","")),e.cssClass&&(this.classes+=" "+e.cssClass),!this.body)return;const t=function(e,t){return g[t.mode]&&g[t.mode].applyStyle?g[t.mode].applyStyle(e,t):""}(this,e);if(this.body&&t){this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[e.fontSize]||1,this.height=0,this.depth=0,this.skew=0,this.italic=0;for(let e=0;e0&&(this.style||(this.style={}),this.style[e]=a)}setTop(e){e&&0!==e&&(this.style||(this.style={}),this.style.top=M(e)+"em",this.height-=e,this.depth+=e)}setLeft(e){e&&0!==e&&(this.style||(this.style={}),this.style["margin-left"]=M(e)+"em")}setRight(e){e&&0!==e&&(this.style||(this.style={}),this.style["margin-right"]=M(e)+"em")}setWidth(e){e&&0!==e&&(this.style||(this.style={}),this.style.width=M(e)+"em")}toMarkup(e=1,t=1){var a;let i="",s=this.body||"";if(this.children){let e="none";for(const a of this.children){let i=0;if(e){let s=a.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),i=a.isTight?S[e+"+"+s]||0:x[e+"+"+s]||0,i=Math.floor(t*i))}s+=a.toMarkup(i,t),e=C(a)}}if("​"!==s&&(s||this.svgBody)||this.classes&&"ML__selected"!==this.classes||this.cssId||this.style||this.svgOverlay){i="`${e}="${this.attributes[e]}"`).join(" "));const t=this.classes.split(" ");t.push(null!==(a={command:"ML__command",placeholder:"ML__placeholder",error:"ML__error"}[this.type])&&void 0!==a?a:""),this.caret&&"command"===this.type&&t.push("ML__command-caret");let o="";if(o=t.length>1?t.filter((e,t,a)=>e.length>0&&a.indexOf(e)===t).join(" "):t[0],o.length>0&&(i+=` class="${o}"`),e&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=M(parseFloat(this.style["margin-left"])+e/18)+"em":e<0&&w[-e]?s=w[-e]+s:k[e]?s=k[e]+s:(this.style||(this.style={}),this.style["margin-left"]=M(e/18)+"em")),this.style){let e="";const t=/ML__selected/.test(this.classes);for(const a in this.style)Object.prototype.hasOwnProperty.call(this.style,a)&&("background-color"===a&&t||(e+=a+":"+this.style[a]+";"));e.length>0&&(i+=' style="'+e+'"')}i+=">",this.svgBody?i+=function(e){if(p[e]){const t=p[e][2];return``}const[t,a,i,s]=m[e];let o,r;const n=i/1e3;3===t.length?(o=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],r=["xMinYMin","xMidYMin","xMaxYMin"]):2===t.length?(o=["slice-1-of-2","slice-2-of-2"],r=["xMinYMin","xMaxYMin"]):(o=["slice-1-of-1"],r=[s]);const l=t.map((e,t)=>``).join("");return`${l}`}(this.svgBody):this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(e){if(this.type!==e.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;if(this.svgBody||!this.body)return!1;if(e.svgBody||!e.body)return!1;const t=this.children&&this.children.length>0,a=e.children&&e.children.length>0;if(t||a)return!1;if((this.style?this.style.length:0)!==(e.style?e.style.length:0))return!1;const i=this.classes.trim().replace(/\s+/g," ").split(" "),s=e.classes.trim().replace(/\s+/g," ").split(" ");if(i.length!==s.length)return!1;i.sort(),s.sort();for(let e=0;eMath.max(e,t.height),0):t.height:0}function $(t){return t?e(t)?t.reduce((e,t)=>Math.max(e,t.depth),0):t.depth:0}function z(t){return t?e(t)?t[t.length-1].italic:t.italic:0}function _(t,a="",i=""){if(e(t)){const e=t.filter(e=>!!e);return 1===e.length?new L(e[0],a,i):new L(e,a,i)}return new L(t,a,i)}function D(e,t,a="",i=""){const s=new L(t,a,i),r=o(t,e);return s.height=r.height,s.depth=r.depth,s.skew=r.skew,s.italic=r.italic,s.setRight(s.italic),s}function q(t,a="",i=""){const s=_("","ML__strut");let o,r;return s.setStyle("height",A(t),"em"),0!==$(t)&&(o=_("","ML__strut--bottom"),o.setStyle("height",A(t)+$(t),"em"),o.setStyle("vertical-align",-$(t),"em")),r=e(t)?[s,o,...t]:[s,o,t],_(r,a,i)}function T(e,t,a,i,s){s=s||"";const o=K(t,(s+=" style-wrap ")+a.adjustTo(i));o.type=e;const r=i.sizeMultiplier/a.sizeMultiplier;return o.height*=r,o.depth*=r,o.maxFontSize=i.sizeMultiplier,o}function K(t,a="",i=""){if(!a){if(t instanceof L)return t;if(e(t)&&1===t.length)return t[0]}const s=new L(t,a,i);let o=1;return o=t instanceof L?t.maxFontSize:t.reduce((e,t)=>Math.max(e,t.maxFontSize),0),s.height*=o,s.depth*=o,s}function E(t,a,i="shift",s=0){let o=0,r=0;i=i||"shift";for(let t=0;t0?"em":""),i.attributes={"aria-hidden":"true"}),"size5"!==e.size?new L(i,"fontsize-ensurer reset-"+e.size+" size5"):0!==a?i:null}(t,n),c=[];r=o;for(const e of a)if("number"==typeof e)r+=e;else if(e instanceof L){const t=_([l,e]);t.setTop(-e.depth-r),c.push(t),r+=e.height+e.depth}const d=_(c,"vlist");return d.depth=Math.max(o,$(d)||0),d.height=Math.max(-r,A(d)||0),d}function F(e){const t=new L(null);return t.svgBody=e,t.height=function(e){return m[e]?m[e][2]/1e3:p[e][2]}(e)/2,t.depth=t.height,t}const N={},B={"<":"<",">":">",o:"o","&":"\\&","{":"\\{","}":"\\}","[":"\\lbrack","]":"\\rbrack",":":"\\colon"," ":"~","¬":"\\neg","·":"\\cdot","¼":"\\frac{1}{4}","½":"\\frac{1}{2}","¾":"\\frac{3}{4}","⁰":"^{0}","ⁱ":"^{i}","¹":"^{1}","²":"^{2}","³":"^{3}","†":"\\dagger","‡":"\\ddagger","…":"\\ldots","⁴":"^{4}","⁵":"^{5}","⁶":"^{6}","⁷":"^{7}","⁸":"^{8}","⁹":"^{9}","⁺":"^{+}","⁻":"^{-}","⁼":"^{=}","ⁿ":"^{n}","₀":"_{0}","₁":"_{1}","₂":"_{2}","₃":"_{3}","₄":"_{4}","₅":"_{5}","₆":"_{6}","₇":"_{7}","₈":"_{8}","₉":"_{9}","₊":"_{+}","₋":"_{-}","₌":"_{=}","ₐ":"_{a}","ₑ":"_{e}","ₒ":"_{o}","ₓ":"_{x}","′":"\\prime","'":"\\prime","←":"\\gets","→":"\\to","△":"\\triangle","▽":"\\triangledown","∋":"\\owns","∗":"\\ast","∣":"\\vert","∥":"\\Vert","∧":"\\land","∨":"\\lor","⋅":"\\cdot","⋈":"\\bowtie","≠":"\\ne","≤":"\\le","≥":"\\ge","⊥":"\\bot","⟷":"\\biconditional","⟸":"\\impliedby","⟹":"\\implies","ℂ":"\\C","ℕ":"\\N","ℙ":"\\P","ℚ":"\\Q","ℝ":"\\R","ℤ":"\\Z"},O={},R={},P={iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace",rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}"},I={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},H={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","\\textdagger":"†","\\textdaggerdbl":"‡","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},W=/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,V=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/,U=/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/;function j(e,t,a="mord",i=""){N[e]={type:a,variant:i,value:t},B[t]||i||(B[t]=e),H[e]=t}function G(e,t){for(let a=e;a<=t;a++){const e=String.fromCodePoint(a);j(e,e)}}function Z(e,t){return"math"===e?B[t]||t:"text"===e&&Object.keys(H).find(e=>H[e]===t)||t}const X={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},Y=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function J(e,t,a){if(!/[A-Za-z0-9]/.test(e))return e;if(!t&&!a)return e;const i=e.codePointAt(0);for(let e=0;e=Y[e].offset&&i120831)&&(e<8448||e>8527))return{char:String.fromCodePoint(e)};for(const t in X)if(Object.prototype.hasOwnProperty.call(X,t)&&X[t]===e){e=t.codePointAt(0);break}for(let t=0;t=Y[t].start&&e=1;)i.params.push({isOptional:!1,type:"math"}),s-=1}}}else"math"===t?i=N[e]:H[e]&&(i={value:H[e]});return!i||"mord"!==i.type||"f"!==i.value&&"g"!==i.value&&"h"!==i.value||(i.isFunction=!0),i}function oe(e){if(e.length<=1)return[];const t=[];for(const a in O)Object.prototype.hasOwnProperty.call(O,a)&&a.startsWith(e)&&!O[a].infix&&t.push({match:a,frequency:O[a].frequency});for(const a in N)Object.prototype.hasOwnProperty.call(N,a)&&a.startsWith(e)&&t.push({match:a,frequency:N[a].frequency});return t.sort((e,t)=>e.frequency===t.frequency?e.match.length-t.match.length:(t.frequency||0)-(e.frequency||0)),t}function re(e){let t="auto";const a=e.match(/:([^=]+)/);return a&&(t=a[1].trim()),t}function ne(e){if(!e)return[];let t=[],a=e.split("]");if("["===a[0].charAt(0)){t.push({isOptional:!0,type:re(a[0].slice(1))});for(let e=1;e<=a.length;e++)t=t.concat(ne(a[e]))}else if(a=e.split("}"),"{"===a[0].charAt(0)){t.push({isOptional:!1,type:re(a[0].slice(1))});for(let e=1;e<=a.length;e++)t=t.concat(ne(a[e]))}return t}function le(e){let t="",a=!0;return e.forEach(e=>{"string"==typeof e.body?t+=e.body:a=!1}),a?t:""}function ce(e,t,a,i=!1){"string"==typeof e&&(e=[e]);const s={tabular:i,params:ne(t),parser:a};for(const t of e)R[t]=s}function de(e,t,a){ce(e,t,a,!0)}function me(e,t,a,i,s){"string"==typeof e&&(e=[e]),a||(a={});const o={params:ne(t),mode:a.mode,infix:!!a.infix,parse:i,emit:s};e.forEach(e=>{O["\\"+e]=o})}const pe={acute:"ˊ",grave:"ˋ",dot:"˙",ddot:"¨",mathring:"˚",tilde:"~",bar:"ˉ",breve:"˘",check:"ˇ",hat:"^",vec:"⃗"};me(Object.keys(pe),"{body:auto}",null,(function(e,t){return{type:"accent",accent:pe[e.slice(1)],limits:"accent",skipBoundary:!0,body:t[0]}})),me(["widehat","widecheck","widetilde"],"{body:auto}",null,(e,t)=>{const a=le(t[0]);return{type:"accent",svgAccent:e.slice(1)+(a.length>5?"4":["1","1","2","2","3","3"][a.length]),limits:"accent",skipBoundary:!0,body:t[0]}}),me("utilde","{body:auto}",null,(e,t)=>{const a=le(t[0]),i="widetilde"+(a.length>5?"4":["1","1","2","2","3","3"][a.length]);return{type:"overunder",body:t[0],svgBelow:i,skipBoundary:!0}},(e,t,a,i)=>`\\utilde{${i(a,a.body)}}`),me("^","{:string}",{},(e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[t[0]]||"^"})),me("`","{:string}",{},(e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[t[0]]||"`"})),me("'","{:string}",{},(function(e,t){return{type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[t[0]]||"^"}})),me("~","{:string}",{},(e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[t[0]]||"´"})),me("c","{:string}",{},(e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{c:"ç",C:"Ç"}[t[0]]||""})),me("enclose","{notation:string}[style:string]{body:auto}",null,(e,t)=>{const a={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:t[2]};if(t[1]){const e=t[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const t of e){const e=t.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(e)a.strokeWidth=n(e[1],"px"),isFinite(a.strokeWidth)||(a.strokeWidth=1),a.strokeStyle=e[2],a.strokeColor=e[3];else{const e=t.match(/\s*([a-z]*)\s*=\s*"(.*)"/);e&&("mathbackground"===e[1]?a.backgroundcolor=e[2]:"mathcolor"===e[1]?a.strokeColor=e[2]:"padding"===e[1]?a.padding=n(e[2],"px"):"shadow"===e[1]&&(a.shadow=e[2]))}}"dashed"===a.strokeStyle?a.svgStrokeStyle="5,5":"dotted"===a.strokeStyle&&(a.svgStrokeStyle="1,5")}return a.borderStyle=a.strokeWidth+"px "+a.strokeStyle+" "+a.strokeColor,a.notation={},t[0].split(/[, ]/).filter(e=>e.length>0).forEach(e=>{a.notation[e.toLowerCase()]=!0}),a.notation.updiagonalarrow&&(a.notation.updiagonalstrike=!1),a.notation.box&&(a.notation.left=!1,a.notation.right=!1,a.notation.bottom=!1,a.notation.top=!1),a}),me("cancel","{body:auto}",null,(function(e,t){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:t[0]}})),me("bcancel","{body:auto}",null,(function(e,t){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:t[0]}})),me("xcancel","{body:auto}",null,(function(e,t){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:t[0]}})),ce("math","",()=>({mathstyle:"textstyle"})),ce("displaymath","",(function(){return{mathstyle:"displaystyle"}})),de("array","{columns:colspec}",(e,t)=>({colFormat:t[0],mathstyle:"textstyle"})),de(["equation","equation","subequations"],"",()=>({colFormat:[{align:"c"}]})),de("multline","",(function(){return{colFormat:[{align:"m"}]}})),de(["align","align*","aligned","eqnarray"],"",(e,t,a)=>{let i=0;for(const e of a)i=Math.max(i,e.length);const s=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({colFormat:[{align:"r"},{align:"l"}]})),de(["gather","gathered"],"",()=>({colFormat:[{gap:.25},{align:"c"},{gap:0}],jot:.3})),de(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","smallmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*","smallmatrix*"],"[columns:colspec]",(e,t)=>{var a;const i={mathstyle:"textstyle"};switch(e){case"pmatrix":case"pmatrix*":i.lFence="(",i.rFence=")";break;case"bmatrix":case"bmatrix*":i.lFence="[",i.rFence="]";break;case"Bmatrix":case"Bmatrix*":i.lFence="\\lbrace",i.rFence="\\rbrace";break;case"vmatrix":case"vmatrix*":i.lFence="\\vert",i.rFence="\\vert";break;case"Vmatrix":case"Vmatrix*":i.lFence="\\Vert",i.rFence="\\Vert";break;case"smallmatrix":case"smallmatrix*":i.mathstyle="scriptstyle";break;case"matrix":case"matrix*":i.lFence=".",i.rFence="."}return i.colFormat=null!==(a=t[0])&&void 0!==a?a:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}],i}),de("cases","",()=>({arraystretch:1.2,lFence:"\\lbrace",rFence:".",colFormat:[{align:"l"},{gap:1},{align:"l"}]})),ce("center","",(function(){return{colFormat:[{align:"c"}]}})),me(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overbrace","overlinesegment","overgroup"],"{:auto}",null,(e,t)=>({type:"overunder",body:t[0],svgAbove:e.slice(1),skipBoundary:!0,limits:"overunder"}),(e,t,a,i)=>`${e}{${i(a,a.body)}}`),me(["underrightarrow","underleftarrow","underleftrightarrow","underbrace","underlinesegment","undergroup"],"{:auto}",null,(e,t)=>({type:"overunder",body:t[0],svgBelow:e.slice(1),skipBoundary:!0,limits:"overunder"}),(e,t,a,i)=>`${e}{${i(a,a.body)}}`),me(["xrightarrow","xleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","xLeftrightarrow","xrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xrightleftarrows","xrightequilibrium","xleftequilibrium"],"[:auto]{:auto}",null,(e,t)=>({type:"overunder",mathtype:"mrel",svgBody:e.slice(1),overscript:t[1],underscript:t[0],skipBoundary:!0}),(e,t,a,i)=>e+(a.underscript?`[${i(a,a.underscript)}]`:"")+`{${i(a,a.overscript)}}`),me(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","coth","ctg","cth","cotg","csc","cosec","deg","dim","exp","hom","inf","ker","lg","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th"],"",null,(function(e){return{type:"mop",limits:"nolimits",isSymbol:!1,isFunction:!0,body:e.slice(1),variant:"main",variantStyle:"up"}})),me(["liminf","limsup"],"",null,e=>({type:"mop",limits:"limits",isSymbol:!1,body:{"\\liminf":"lim inf","\\limsup":"lim sup"}[e],variant:"main"})),me(["lim","mod"],"",null,(function(e){return{type:"mop",limits:"limits",isSymbol:!1,body:e.slice(1),variant:"main"}})),me(["det","max","min"],"",null,(function(e){return{type:"mop",limits:"limits",isSymbol:!1,isFunction:!0,body:e.slice(1),variant:"main"}})),me("sqrt","[index:auto]{radicand:auto}",null,(e,t)=>({type:"surd",body:t[1],index:t[0]}),(e,t,a,i)=>{let s="";return a.index&&(s+=`[${i(a,a.index)}]`),s+=`{${i(a,a.body)}}`,e+s}),me(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{numerator}{denominator}",null,(e,t)=>{const a={type:"genfrac",numer:t[0],denom:t[1],mathstyle:"auto"};switch(e){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":a.hasBarLine=!0;break;case"\\\\atopfrac":a.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a.hasBarLine=!1,a.leftDelim="(",a.rightDelim=")"}switch(e){case"\\dfrac":case"\\dbinom":a.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":a.mathstyle="textstyle"}return"\\cfrac"===e&&(a.continuousFraction=!0),a},(e,t,a,i)=>`${e}{${i(a,a.numer)}}{${i(a,a.denom)}}`),me(["over","atop","choose"],"",{infix:!0},(e,t)=>{const a=t[0],i=t[1];let s=!1,o=null,r=null;switch(e){case"\\atop":break;case"\\over":s=!0;break;case"\\choose":s=!1,o="(",r=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:a,denom:i,hasBarLine:s,leftDelim:o,rightDelim:r,mathstyle:"auto"}},(e,t,a,i)=>`{${i(a,a.numer)}${e} ${i(a,a.denom)}}`),me("pdiff","{numerator}{denominator}",null,(e,t)=>({type:"genfrac",numer:t[0],denom:t[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}),(e,t,a,i)=>`${e}{${i(a,a.numer)}}{${i(a,a.denom)}}`),me(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","smallint","intop"],"",null,e=>({type:"mop",limits:"auto",isSymbol:!0,variant:"main",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[e.slice(1)]}));const he={int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑",sqcup:"⊔",sqcap:"⊓",uplus:"⊎",wr:"≀",amalg:"⨿",Cap:"⋒",Cup:"⋓",doublecap:"⋒",doublecup:"⋓"};me(Object.keys(he),"",null,(function(e){return{type:"mop",limits:"nolimits",isSymbol:!0,body:he[e.slice(1)],variant:{"⋒":"ams","⋓":"ams"}[he[e.slice(1)]]}})),me(["Re","Im"],"",null,(function(e){return{type:"mop",limits:"nolimits",isSymbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[e],variant:"fraktur"}})),me("middle","{:delim}",null,(function(e,t){return{type:"delim",delim:t[0]}}));const ue={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},fe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ge=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"],ye={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};function be(e){var t;const a=e.toLowerCase().split("!");let i,s,o,r=255,n=255,l=255,c=-1;const d=a.length>0&&"-"===a[0].charAt(0);d&&(a[0]=a[0].slice(1));for(let e=0;e=0&&(r=(1-c)*r+c*i,n=(1-c)*n+c*s,l=(1-c)*l+c*o,c=-1),e+1=0&&(r=c*r+(1-c)*i,n=c*n+(1-c)*s,l=c*l+(1-c)*o),d&&(r=255-r,n=255-n,l=255-l),"#"+("00"+Math.round(r).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(l).toString(16)).slice(-2)}function ve(e){let t=e.toUpperCase();for(const e in ye)if(ye[e]===t){t=e;break}for(const e in ue)if(ue[e]===t){t=e;break}return t}me("ensuremath","{:math}",{},(e,t)=>({type:"group",mode:"math",body:t[0],skipBoundary:!0,latexOpen:"\\ensuremath{",latexClose:"}"}),(e,t,a,i)=>i(a,a.body)),me("color","{:color}",{},(e,t)=>({color:t[0]})),me("textcolor","{:color}{content:auto*}",{},(e,t)=>({color:t[0]})),me("boxed","{content:math}",null,(e,t)=>({type:"box",framecolor:"black",skipBoundary:!0,body:t[0]})),me("colorbox","{background-color:string}{content:auto}",{},(e,t)=>({type:"box",backgroundcolor:be(t[0]),skipBoundary:!0,body:t[1],verbatimBackgroundcolor:t[0]}),(e,t,a,i)=>`${e}{${a.verbatimBackgroundcolor||ve(a.backgroundcolor)}}{${i(a,a.body)}}`),me("fcolorbox","{frame-color:string}{background-color:string}{content:auto}",{},(e,t)=>({type:"box",framecolor:be(t[0]),backgroundcolor:be(t[1]),skipBoundary:!0,body:t[2],verbatimBackgroundcolor:t[1],verbatimFramecolor:t[0]}),(e,t,a,i)=>`${e}{${a.verbatimFramecolor||ve(a.framecolor)}{${a.verbatimBackgroundcolor||ve(a.backgroundcolor)}}{${i(a,a.body)}}`),me("bbox","[:bbox]{body:auto}",{},(e,t)=>{if(t[0]){const e=t[0];return{type:"box",padding:e.padding,border:e.border,backgroundcolor:e.backgroundcolor,skipBoundary:!0,body:t[1]}}return{type:"box",skipBoundary:!0,body:t[1]}},(e,t,a,i)=>{let s=e;if(isFinite(a.padding)||void 0!==a.border||void 0!==a.backgroundcolor){const e=[];isFinite(a.padding)&&e.push(Math.floor(100*a.padding)/100+"em"),a.border&&e.push("border:"+a.border),a.backgroundcolor&&e.push(ve(a.backgroundcolor)),s+=`[${e.join(",")}]`}return s+`{${i(a,a.body)}}`}),me(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{},(e,t)=>({fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[e.slice(1)]})),me("fontseries","{:string}",{mode:"text"},(e,t)=>({fontSeries:t[0]})),me("fontshape","{:string}",{mode:"text"},(e,t)=>({fontShape:t[0]})),me("fontfamily","{:string}",{mode:"text"},(e,t)=>({fontFamily:t[0]})),me("selectfont","",{mode:"text"},(e,t)=>({})),me("bf","",{},(e,t)=>({fontSeries:"b",fontShape:"n",fontFamily:"cmr"})),me(["boldsymbol","bm"],"{:math*}",{},(e,t)=>({mode:"math",cssClass:"ML__boldsymbol"})),me("bold","{:math*}",{},(e,t)=>({mode:"math",variantStyle:"bold"})),me("bfseries","",{mode:"text"},(e,t)=>({fontSeries:"b"})),me("mdseries","",{mode:"text"},(e,t)=>({fontSeries:"m"})),me("upshape","",{mode:"text"},(e,t)=>({fontShape:"n"})),me("slshape","",{mode:"text"},(e,t)=>({fontShape:"sl"})),me("scshape","",{mode:"text"},(e,t)=>({fontShape:"sc"})),me("textbf","{:text*}",{},(e,t)=>({mode:"text",fontSeries:"b"})),me("textmd","{:text*}",{},(e,t)=>({mode:"text",fontSeries:"m"})),me("textup","{:text*}",{},(e,t)=>({mode:"text",fontShape:"n"})),me("textnormal","{:text*}",{},(e,t)=>({mode:"text",fontShape:"n",fontSeries:"m"})),me("textsl","{:text*}",{},(e,t)=>({mode:"text",fontShape:"sl"})),me("textit","{:text*}",{},(e,t)=>({mode:"text",fontShape:"it"})),me("textsc","{:text*}",{},(e,t)=>({mode:"text",fontShape:"sc"})),me("textrm","{:text*}",{},(e,t)=>({mode:"text",fontFamily:"roman"})),me("textsf","{:text*}",{},(e,t)=>({mode:"text",fontFamily:"sans-serif"})),me("texttt","{:text*}",{},(e,t)=>({mode:"text",fontFamily:"monospace"})),me("mathbf","{:math*}",{},(e,t)=>({mode:"math",variant:"normal",variantStyle:"bold"})),me("mathit","{:math*}",{},(e,t)=>({mode:"math",variant:"normal",variantStyle:"italic"})),me("mathbfit","{:math*}",{},(e,t)=>({mode:"math",variant:"normal",variantStyle:"bolditalic"})),me("mathrm","{:math*}",{},(e,t)=>({mode:"math",variant:"normal",variantStyle:"up"})),me("mathsf","{:math*}",{},(e,t)=>({mode:"math",variant:"sans-serif",variantStyle:"up"})),me("mathtt","{:math*}",{},(e,t)=>({mode:"math",variant:"monospace",variantStyle:"up"})),me("it","",{},(e,t)=>({fontSeries:"m",fontShape:"it",fontFamily:"cmr",variantStyle:"italic"})),me("rmfamily","",{},(e,t)=>({fontFamily:"roman"})),me("sffamily","",{},(e,t)=>({fontFamily:"sans-serif"})),me("ttfamily","",{},(e,t)=>({fontFamily:"monospace"})),me(["Bbb","mathbb"],"{:math*}",{},(e,t)=>({variant:"double-struck",variantStyle:"up"})),me(["frak","mathfrak"],"{:math*}",{},(e,t)=>({variant:"fraktur",variantStyle:"up"})),me("mathcal","{:math*}",{},(e,t)=>({variant:"calligraphic",variantStyle:"up"})),me("mathscr","{:math*}",{},(e,t)=>({variant:"script",variantStyle:"up"})),me("mbox","{:text}",null,(e,t)=>({type:"group",mode:"math",body:t[0]})),me("text","{:text*}",null,(e,t)=>({mode:"text"})),me("class","{name:string}{content:auto*}",null,(e,t)=>({cssClass:t[0]})),me("cssId","{id:string}{content:auto}",null,(e,t)=>({type:"group",body:t[1],cssId:t[0]})),me("em","",null,(e,t)=>({cssClass:"ML__emph"})),me("emph","{:auto}",null,(e,t)=>({cssClass:"ML__emph",body:t[0],type:"group",skipBoundary:!0}));const xe={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function ke(e,t,a,i,s,o=""){const r=T(e,D("Size"+a+"-Regular",te("math",t),"delimsizing size"+a),s.mathstyle,c.textstyle,o);return i&&r.setTop((1-s.mathstyle.sizeMultiplier)*s.mathstyle.metrics.axisHeight),r.setStyle("color",s.color),"number"==typeof s.opacity&&r.setStyle("opacity",s.opacity),r}function we(e,t){let a="";return"Size1-Regular"===t?a=" delim-size1":"Size4-Regular"===t&&(a=" delim-size4"),D(t,te("math",e),"delimsizinginner"+a)}function Se(e,t,a,i,s,r=""){let n,l,d,m;n=d=m=te("math",t),l=null;let p="Size1-Regular";"\\vert"===t||"\\lvert"===t||"\\rvert"===t||"\\mvert"===t||"\\mid"===t?d=n=m="∣":"\\Vert"===t||"\\lVert"===t||"\\rVert"===t||"\\mVert"===t||"\\|"===t?d=n=m="∥":"\\uparrow"===t?d=m="⏐":"\\Uparrow"===t?d=m="‖":"\\downarrow"===t?n=d="⏐":"\\Downarrow"===t?n=d="‖":"\\updownarrow"===t?(n="↑",d="⏐",m="↓"):"\\Updownarrow"===t?(n="⇑",d="‖",m="⇓"):"["===t||"\\lbrack"===t?(n="⎡",d="⎢",m="⎣",p="Size4-Regular"):"]"===t||"\\rbrack"===t?(n="⎤",d="⎥",m="⎦",p="Size4-Regular"):"\\lfloor"===t?(d=n="⎢",m="⎣",p="Size4-Regular"):"\\lceil"===t?(n="⎡",d=m="⎢",p="Size4-Regular"):"\\rfloor"===t?(d=n="⎥",m="⎦",p="Size4-Regular"):"\\rceil"===t?(n="⎤",d=m="⎥",p="Size4-Regular"):"("===t?(n="⎛",d="⎜",m="⎝",p="Size4-Regular"):")"===t?(n="⎞",d="⎟",m="⎠",p="Size4-Regular"):"\\{"===t||"\\lbrace"===t?(n="⎧",l="⎨",m="⎩",d="⎪",p="Size4-Regular"):"\\}"===t||"\\rbrace"===t?(n="⎫",l="⎬",m="⎭",d="⎪",p="Size4-Regular"):"\\lgroup"===t?(n="⎧",m="⎩",d="⎪",p="Size4-Regular"):"\\rgroup"===t?(n="⎫",m="⎭",d="⎪",p="Size4-Regular"):"\\lmoustache"===t?(n="⎧",m="⎭",d="⎪",p="Size4-Regular"):"\\rmoustache"===t?(n="⎫",m="⎩",d="⎪",p="Size4-Regular"):"\\surd"===t?(n="",m="⎷",d="",p="Size4-Regular"):"\\ulcorner"===t?(n="┌",d=m=" "):"\\urcorner"===t?(n="┐",d=m=" "):"\\llcorner"===t?(m="└",d=n=" "):"\\lrcorner"===t&&(n="┘",d=n=" ");const h=o(te("math",n),p),u=h.height+h.depth,f=o(te("math",d),p),g=f.height+f.depth,y=o(te("math",m),p),b=y.height+y.depth;let v=0,x=1;if(null!==l){const e=o(te("math",l),p);v=e.height+e.depth,x=2}const k=u+b+v,w=Math.ceil((a-k)/(x*g)),S=k+w*x*g;let M=s.mathstyle.metrics.axisHeight;i&&(M*=s.mathstyle.sizeMultiplier);const L=S/2-M,C=[];if(C.push(we(m,p)),null===l)for(let e=0;e{const a={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[e],body:t[0],captureSelection:!0};return"\\mathop"===e&&(a.limits="limits",a.isFunction=!0),a},(e,t,a,i)=>`${e}{${i(a,a.body)}}`),me(["operatorname","operatorname*"],"{operator:math}",null,(function(e,t){const a={type:"mop",captureSelection:!0,body:t[0],isFunction:!0};return a.body.forEach(e=>{e.isFunction=!1,e.variant||e.variantStyle||(e.variant="main",e.variantStyle="up"),e.type="mord",e.body={"∗":"*","−":"-"}[e.body]||e.body}),"\\operatorname"===e?a.limits="nolimits":"\\operatorname*"===e&&(a.limits="limits"),a})),me("unicode","{charcode:number}",null,(e,t)=>{let a=parseInt(t[0]);return isFinite(a)||(a=10067),{type:"mord",body:String.fromCodePoint(a),codepoint:a}},(e,t,a,i)=>`${e}{"${("000000"+a.codepoint.toString(16)).toUpperCase().substr(-6)}}`),me("rule","[raise:dimen]{width:dimen}{thickness:dimen}",null,(function(e,t){return{type:"rule",shift:t[0],width:t[1],height:t[2]}})),me("overline","{:auto}",null,(e,t)=>({type:"line",position:"overline",skipBoundary:!0,body:t[0]})),me("underline","{:auto}",null,(e,t)=>({type:"line",position:"underline",skipBoundary:!0,body:t[0]})),me("overset","{annotation:auto}{symbol:auto}",null,(function(e,t){return{type:"overunder",overscript:t[0],skipBoundary:!0,body:t[1]}}),(e,t,a,i)=>`${e}{${i(a,a.overscript)}}{${i(a,a.body)}}`),me("underset","{annotation:auto}{symbol:auto}",null,(function(e,t){return{type:"overunder",underscript:t[0],skipBoundary:!0,body:t[1]}}),(e,t,a,i)=>`${e}{${i(a,a.overscript)}}{${i(a,a.body)}}`),me(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0},(function(e,t){return{type:"genfrac",numer:t[0],denom:t[1],hasBarLine:!1,leftDelim:t[2],rightDelim:t[3],mathstyle:"auto"}}),(e,t,a,i)=>`${i(a,a.numer)} ${e}${a.leftDelim}${a.rightDelim}${i(a,a.denom)}`),me(["stackrel","stackbin"],"{annotation:auto}{symbol:auto}",null,(function(e,t){return{type:"overunder",overscript:t[0],skipBoundary:!0,body:t[1],mathtype:"\\stackrel"===e?"mrel":"mbin"}}),(e,t,a,i)=>`${e}{${i(a,a.overscript)}}{${i(a,a.body)}}`),me("rlap","{:auto}",null,(function(e,t){return{type:"overlap",align:"right",skipBoundary:!0,body:t[0]}})),me("llap","{:auto}",null,(function(e,t){return{type:"overlap",align:"left",skipBoundary:!0,body:t[0]}})),me("mathrlap","{:auto}",null,(function(e,t){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:t[0]}})),me("mathllap","{:auto}",null,(function(e,t){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:t[0]}})),function(e){for(let e=0;e<"0123456789/@.?!".length;e++){const t="0123456789/@.?!".charAt(e);j(t,t)}}(),G(65,90),G(97,122),j("\\forall","∀"),j("\\exists","∃"),j("\\nexists","∄","mord","ams"),j("\\mid","∣","mrel"),j("\\top","⊤"),j("\\bot","⊥"),j("\\sharp","♯"),j("\\flat","♭"),j("\\natural","♮"),j("\\#","#"),j("\\&","&"),j("\\clubsuit","♣"),j("\\heartsuit","♡"),j("\\spadesuit","♠"),j("\\diamondsuit","♢"),j("\\differencedelta","∆","mrel"),j("\\backslash","\\"),j("\\nabla","∇"),j("\\partial","∂"),j("\\ell","ℓ"),j("\\hbar","ℏ"),j("\\hslash","ℏ","mord","ams"),j("\\Finv","Ⅎ","mord","ams"),j("\\Game","⅁","mord","ams"),j("\\wp","℘"),j("\\eth","ð","mord","ams"),j("\\mho","℧","mord","ams"),j("\\Bbbk","k","mord","ams"),j("\\N","N","mord","double-struck"),j("\\R","R","mord","double-struck"),j("\\Q","Q","mord","double-struck"),j("\\C","C","mord","double-struck"),j("\\Z","Z","mord","double-struck"),j("\\P","P","mord","double-struck"),j("\\pounds","£"),j("\\yen","¥","mord","ams"),j("\\euro","€"),j("\\dagger","†","mbin"),j("\\dag","†","mbin"),j("\\ddag","‡","mbin"),j("\\ddagger","‡","mbin"),j("\\maltese","✠","mord","ams"),j("\\rightarrow","→","mrel"),j("\\to","→","mrel"),j("\\leftarrow","←","mrel"),j("\\gets","←","mrel"),j("\\Rightarrow","⇒","mrel"),j("\\Leftarrow","⇐","mrel"),j("\\longrightarrow","⟶","mrel"),j("\\longleftarrow","⟵","mrel"),j("\\Longrightarrow","⟹","mrel"),j("\\implies","⟹","mrel"),j("\\Longleftarrow","⟸","mrel"),j("\\impliedby","⟸","mrel"),j("\\dashrightarrow","⇢","mrel","ams"),j("\\dashleftarrow","⇠","mrel","ams"),j("\\Rrightarrow","⇛","mrel","ams"),j("\\Lleftarrow","⇚","mrel","ams"),j("\\longleftrightarrow","⟷","mrel"),j("\\biconditional","⟷","mrel"),j("\\Longleftrightarrow","⟺","mrel"),j("\\leftrightarrows","⇆","mrel","ams"),j("\\rightleftarrows","⇄","mrel","ams"),j("\\mapsto","↦","mrel"),j("\\longmapsto","⟼","mrel"),j("\\uparrow","↑","mrel"),j("\\downarrow","↓","mrel"),j("\\Uparrow","⇑","mrel"),j("\\Downarrow","⇓","mrel"),j("\\updownarrow","↕","mrel"),j("\\Updownarrow","⇕","mrel"),j("\\curvearrowright","↷","mrel","ams"),j("\\curvearrowleft","↶","mrel","ams"),j("\\hookrightarrow","↪","mrel"),j("\\hookleftarrow","↩","mrel"),j("\\rightharpoonup","⇀","mrel"),j("\\leftharpoonup","↼","mrel"),j("\\rightharpoondown","⇁","mrel"),j("\\leftharpoondown","↽","mrel"),j("\\rightrightarrows","⇉","mrel","ams"),j("\\leftleftarrows","⇇","mrel","ams"),j("\\upuparrows","⇈","mrel","ams"),j("\\downdownarrows","⇊","mrel","ams"),j("\\leftarrowtail","↢","mrel","ams"),j("\\rightarrowtail","↣","mrel","ams"),j("\\looparrowright","↬","mrel","ams"),j("\\looparrowleft","↫","mrel","ams"),j("\\twoheadleftarrow","↞","mrel","ams"),j("\\twoheadrightarrow","↠","mrel","ams"),j("\\rightleftharpoons","⇌","mrel"),j("\\leftrightharpoons","⇋","mrel","ams"),j("\\Rsh","↱","mrel","ams"),j("\\Lsh","↰","mrel","ams"),j("\\searrow","↘","mrel"),j("\\nearrow","↗","mrel"),j("\\swarrow","↙","mrel"),j("\\nwarrow","↖","mrel"),j("\\circlearrowright","↻","mrel","ams"),j("\\circlearrowleft","↺","mrel","ams"),j("\\restriction","↾","mrel","ams"),j("\\upharpoonright","↾","mrel","ams"),j("\\upharpoonleft","↿","mrel","ams"),j("\\downharpoonright","⇂","mrel","ams"),j("\\downharpoonleft","⇃","mrel","ams"),j("\\rightsquigarrow","⇝","mrel","ams"),j("\\leadsto","⇝","mrel","ams"),j("\\leftrightsquigarrow","↭","mrel","ams"),j("\\originalof","⊶","mrel"),j("\\imageof","⊷","mrel"),j("\\multimap","⊸","mrel","ams"),j("\\nrightarrow","↛","mrel","ams"),j("\\nleftarrow","↚","mrel","ams"),j("\\nRightarrow","⇏","mrel","ams"),j("\\nLeftarrow","⇍","mrel","ams"),j("\\nleftrightarrow","↮","mrel","ams"),j("\\nLeftrightarrow","⇎","mrel","ams"),j("\\nless","≮","mrel","ams"),j("\\nleqslant","","mrel","ams"),j("\\lneq","⪇","mrel","ams"),j("\\lneqq","≨","mrel","ams"),j("\\nleqq","","mrel","ams"),j("\\unlhd","⊴","mbin","ams"),j("\\unrhd","⊵","mbin","ams"),j("\\lvertneqq","","mrel","ams"),j("\\lnsim","⋦","mrel","ams"),j("\\lnapprox","⪉","mrel","ams"),j("\\nprec","⊀","mrel","ams"),j("\\npreceq","⋠","mrel","ams"),j("\\precnsim","⋨","mrel","ams"),j("\\precnapprox","⪹","mrel","ams"),j("\\nsim","≁","mrel","ams"),j("\\nshortmid","","mrel","ams"),j("\\nmid","∤","mrel","ams"),j("\\nvdash","⊬","mrel","ams"),j("\\nvDash","⊭","mrel","ams"),j("\\ngtr","≯","mrel","ams"),j("\\ngeqslant","","mrel","ams"),j("\\ngeqq","","mrel","ams"),j("\\gneq","⪈","mrel","ams"),j("\\gneqq","≩","mrel","ams"),j("\\gvertneqq","","mrel","ams"),j("\\gnsim","⋧","mrel","ams"),j("\\gnapprox","⪊","mrel","ams"),j("\\nsucc","⊁","mrel","ams"),j("\\nsucceq","⋡","mrel","ams"),j("\\succnsim","⋩","mrel","ams"),j("\\succnapprox","⪺","mrel","ams"),j("\\ncong","≆","mrel","ams"),j("\\nshortparallel","","mrel","ams"),j("\\nparallel","∦","mrel","ams"),j("\\nVDash","⊯","mrel","ams"),j("\\nsupseteqq","","mrel","ams"),j("\\supsetneq","⊋","mrel","ams"),j("\\varsupsetneq","","mrel","ams"),j("\\supsetneqq","⫌","mrel","ams"),j("\\varsupsetneqq","","mrel","ams"),j("\\nVdash","⊮","mrel","ams"),j("\\precneqq","⪵","mrel","ams"),j("\\succneqq","⪶","mrel","ams"),j("\\nsubseteqq","","mrel","ams"),j("\\checkmark","✓","mord","ams"),j("\\diagup","╱","mord","ams"),j("\\diagdown","╲","mord","ams"),j("\\measuredangle","∡","mord","ams"),j("\\sphericalangle","∢","mord","ams"),j("\\backprime","‵","mord","ams"),j("\\backdoubleprime","‶","mord","ams"),j("\\ast","∗","mbin"),j("\\star","⋆","mbin"),j("\\diamond","⋄","mbin"),j("\\Diamond","◊","mord","ams"),j("\\lozenge","◊","mord","ams"),j("\\blacklozenge","⧫","mord","ams"),j("\\bigstar","★","mord","ams"),j("\\aleph","ℵ"),j("\\beth","ℶ","mord","ams"),j("\\daleth","ℸ","mord","ams"),j("\\gimel","ℷ","mord","ams"),j("\\lbrace","{","mopen"),j("\\rbrace","}","mclose"),j("\\langle","⟨","mopen"),j("\\rangle","⟩","mclose"),j("\\lfloor","⌊","mopen"),j("\\rfloor","⌋","mclose"),j("\\lceil","⌈","mopen"),j("\\rceil","⌉","mclose"),j("\\vert","∣"),j("\\mvert","∣","mrel"),j("\\lvert","∣","mopen"),j("\\rvert","∣","mclose"),j("\\|","∥"),j("\\Vert","∥"),j("\\mVert","∥"),j("\\lVert","∥","mopen"),j("\\rVert","∥","mclose"),j("\\parallel","∥","mrel"),j("\\shortparallel","∥","mrel","ams"),j("\\lbrack","[","mopen"),j("\\rbrack","]","mclose"),j("\\{","{","mopen"),j("\\}","}","mclose"),j("(","(","mopen"),j(")",")","mclose"),j("[","[","mopen"),j("]","]","mclose"),j("\\ulcorner","┌","mopen","ams"),j("\\urcorner","┐","mclose","ams"),j("\\llcorner","└","mopen","ams"),j("\\lrcorner","┘","mclose","ams"),j("\\lgroup","⟮","mopen"),j("\\rgroup","⟯","mclose"),j("\\lmoustache","⎰","mopen"),j("\\rmoustache","⎱","mclose"),j("=","=","mrel"),j("\\ne","≠","mrel"),j("\\neq","≠","mrel"),j("<","<","mrel"),j("\\lt","<","mrel"),j(">",">","mrel"),j("\\gt",">","mrel"),j("\\le","≤","mrel"),j("\\leq","≤","mrel"),j("\\ge","≥","mrel"),j("\\geq","≥","mrel"),j("\\leqslant","⩽","mrel","ams"),j("\\geqslant","⩾","mrel","ams"),j("\\ll","≪","mrel"),j("\\gg","≫","mrel"),j("\\coloneq","≔","mrel"),j("\\measeq","≝","mrel"),j("\\eqdef","≞","mrel"),j("\\questeq","≟","mrel"),j(":",":","mrel"),j("\\cong","≅","mrel"),j("\\equiv","≡","mrel"),j("\\prec","≺","mrel"),j("\\preceq","⪯","mrel"),j("\\succ","≻","mrel"),j("\\succeq","⪰","mrel"),j("\\perp","⊥","mrel"),j("\\propto","∝","mrel"),j("\\Colon","∷","mrel"),j("\\smile","⌣","mrel"),j("\\frown","⌢","mrel"),j("\\sim","∼","mrel"),j("\\gtrsim","≳","mrel","ams"),j("\\approx","≈","mrel"),j("\\approxeq","≊","mrel","ams"),j("\\thickapprox","≈","mrel","ams"),j("\\lessapprox","⪅","mrel","ams"),j("\\gtrapprox","⪆","mrel","ams"),j("\\precapprox","⪷","mrel","ams"),j("\\succapprox","⪸","mrel","ams"),j("\\thicksim","∼","mrel","ams"),j("\\succsim","≿","mrel","ams"),j("\\precsim","≾","mrel","ams"),j("\\backsim","∽","mrel","ams"),j("\\eqsim","≂","mrel","ams"),j("\\backsimeq","⋍","mrel","ams"),j("\\simeq","≃","mrel"),j("\\lesssim","≲","mrel","ams"),j("\\nleq","≰","mrel","ams"),j("\\ngeq","≱","mrel","ams"),j("\\smallsmile","⌣","mrel","ams"),j("\\smallfrown","⌢","mrel","ams"),j("\\bowtie","⋈","mrel"),j("\\Join","⋈","mrel"),j("\\asymp","≍","mrel"),j("\\sqsubseteq","⊑","mrel"),j("\\sqsupseteq","⊒","mrel"),j("\\leqq","≦","mrel","ams"),j("\\eqslantless","⪕","mrel","ams"),j("\\lll","⋘","mrel","ams"),j("\\lessgtr","≶","mrel","ams"),j("\\lesseqgtr","⋚","mrel","ams"),j("\\lesseqqgtr","⪋","mrel","ams"),j("\\risingdotseq","≓","mrel","ams"),j("\\fallingdotseq","≒","mrel","ams"),j("\\subseteqq","⫅","mrel","ams"),j("\\Subset","⋐","mrel","ams"),j("\\sqsubset","⊏","mrel","ams"),j("\\preccurlyeq","≼","mrel","ams"),j("\\curlyeqprec","⋞","mrel","ams"),j("\\vDash","⊨","mrel","ams"),j("\\Vvdash","⊪","mrel","ams"),j("\\bumpeq","≏","mrel","ams"),j("\\Bumpeq","≎","mrel","ams"),j("\\geqq","≧","mrel","ams"),j("\\eqslantgtr","⪖","mrel","ams"),j("\\ggg","⋙","mrel","ams"),j("\\gtrless","≷","mrel","ams"),j("\\gtreqless","⋛","mrel","ams"),j("\\gtreqqless","⪌","mrel","ams"),j("\\supseteqq","⫆","mrel","ams"),j("\\Supset","⋑","mrel","ams"),j("\\sqsupset","⊐","mrel","ams"),j("\\succcurlyeq","≽","mrel","ams"),j("\\curlyeqsucc","⋟","mrel","ams"),j("\\Vdash","⊩","mrel","ams"),j("\\shortmid","∣","mrel","ams"),j("\\between","≬","mrel","ams"),j("\\pitchfork","⋔","mrel","ams"),j("\\varpropto","∝","mrel","ams"),j("\\backepsilon","∍","mrel","ams"),j("\\llless","⋘","mrel","ams"),j("\\gggtr","⋙","mrel","ams"),j("\\lhd","⊲","mbin","ams"),j("\\rhd","⊳","mbin","ams"),j("\\doteq","≐","mrel"),j("\\doteqdot","≑","mrel","ams"),j("\\Doteq","≑","mrel","ams"),j("\\eqcirc","≖","mrel","ams"),j("\\circeq","≗","mrel","ams"),j("\\lessdot","⋖","mbin","ams"),j("\\gtrdot","⋗","mbin","ams"),j("\\~","~","mrel"),j("\\leftrightarrow","↔","mrel"),j("\\Leftrightarrow","⇔","mrel"),j("\\models","⊨","mrel"),j("\\vdash","⊢","mrel"),j("\\therefore","∴","mrel","ams"),j("\\because","∵","mrel","ams"),j("\\dashv","⊣","mrel"),j("\\roundimplies","⥰","mrel"),j("+","+","mbin"),j("-","−","mbin"),j("−","−","mbin"),j("\\pm","±","mbin"),j("\\mp","∓","mbin"),j("*","∗","mbin"),j("\\times","×","mbin"),j("\\div","÷","mbin"),j("\\surd","√"),j("\\divides","∣","mbin"),j("\\ltimes","⋉","mbin","ams"),j("\\rtimes","⋊","mbin","ams"),j("\\leftthreetimes","⋋","mbin","ams"),j("\\rightthreetimes","⋌","mbin","ams"),j("\\intercal","⊺","mbin","ams"),j("\\dotplus","∔","mbin","ams"),j("\\doublebarwedge","⩞","mbin","ams"),j("\\divideontimes","⋇","mbin","ams"),j("\\centerdot","⋅","mbin","ams"),j("\\cdot","⋅","mbin"),j("\\infty","∞"),j("\\prime","′"),j("\\doubleprime","″"),j("\\angle","∠"),j("`","‘"),j("\\$","$"),j("\\%","%"),j("\\_","_"),j("\\alpha","α"),j("\\beta","β"),j("\\gamma","γ"),j("\\delta","δ"),j("\\epsilon","ϵ"),j("\\varepsilon","ε"),j("\\zeta","ζ"),j("\\eta","η"),j("\\theta","θ"),j("\\vartheta","ϑ"),j("\\iota","ι"),j("\\kappa","κ"),j("\\varkappa","ϰ","mord","ams"),j("\\lambda","λ"),j("\\mu","μ"),j("\\nu","ν"),j("\\xi","ξ"),j("\\omicron","o"),j("\\pi","π"),j("\\varpi","ϖ"),j("\\rho","ρ"),j("\\varrho","ϱ"),j("\\sigma","σ"),j("\\varsigma","ς"),j("\\tau","τ"),j("\\phi","ϕ"),j("\\varphi","φ"),j("\\upsilon","υ"),j("\\chi","χ"),j("\\psi","ψ"),j("\\omega","ω"),j("\\Gamma","Γ"),j("\\Delta","Δ"),j("\\Theta","Θ"),j("\\Lambda","Λ"),j("\\Xi","Ξ"),j("\\Pi","Π"),j("\\Sigma","Σ"),j("\\Upsilon","Υ"),j("\\Phi","Φ"),j("\\Psi","Ψ"),j("\\Omega","Ω"),j("\\digamma","ϝ","mord","ams"),j("\\emptyset","∅"),j("\\varnothing","∅","mord","ams"),j("\\cap","∩","mbin"),j("\\cup","∪","mbin"),j("\\setminus","∖","mbin"),j("\\smallsetminus","∖","mbin","ams"),j("\\complement","∁","mord","ams"),j("\\in","∈","mrel"),j("\\notin","∉","mrel"),j("\\not","̸","mrel"),j("\\ni","∋","mrel"),j("\\owns","∋","mrel"),j("\\subset","⊂","mrel"),j("\\supset","⊃","mrel"),j("\\subseteq","⊆","mrel"),j("\\supseteq","⊇","mrel"),j("\\subsetneq","⊊","mrel","ams"),j("\\varsubsetneq","","mrel","ams"),j("\\subsetneqq","⫋","mrel","ams"),j("\\varsubsetneqq","","mrel","ams"),j("\\nsubset","⊄","mrel","ams"),j("\\nsupset","⊅","mrel","ams"),j("\\nsubseteq","⊈","mrel","ams"),j("\\nsupseteq","⊉","mrel","ams"),j("\\ "," ","spacing"),j("~"," ","spacing"),j("\\space"," ","spacing"),j("\\!",null,"spacing"),j("\\,",null,"spacing"),j("\\:",null,"spacing"),j("\\;",null,"spacing"),j("\\enskip",null,"spacing"),j("\\enspace",null,"spacing"),j("\\quad",null,"spacing"),j("\\qquad",null,"spacing"),j("\\colon",":","mpunct"),j("\\cdotp","⋅","mpunct"),j("\\cdots","⋯","minner"),j("\\ddots","⋱","minner"),j("\\ldots","…","minner"),j("\\mathellipsis","…","minner"),j("\\vdots","⋮"),j("\\ldotp",".","mpunct"),j(",",",","mpunct"),j(";",";","mpunct"),j("\\land","∧","mbin"),j("\\wedge","∧","mbin"),j("\\lor","∨","mbin"),j("\\vee","∨","mbin"),j("\\lnot","¬"),j("\\neg","¬"),j("\\barwedge","⊼","mbin","ams"),j("\\veebar","⊻","mbin","ams"),j("\\nor","⊻","mbin","ams"),j("\\curlywedge","⋏","mbin","ams"),j("\\curlyvee","⋎","mbin","ams"),j("\\square","□","mord","ams"),j("\\Box","□","mord","ams"),j("\\blacksquare","■","mord","ams"),j("\\boxminus","⊟","mbin","ams"),j("\\boxplus","⊞","mbin","ams"),j("\\boxtimes","⊠","mbin","ams"),j("\\boxdot","⊡","mbin","ams"),j("\\circ","∘","mbin"),j("\\bigcirc","◯","mbin"),j("\\bullet","∙","mbin"),j("\\circleddash","⊝","mbin","ams"),j("\\circledast","⊛","mbin","ams"),j("\\oplus","⊕","mbin"),j("\\ominus","⊖","mbin"),j("\\otimes","⊗","mbin"),j("\\odot","⊙","mbin"),j("\\circledcirc","⊚","mbin","ams"),j("\\oslash","⊘","mbin"),j("\\circledS","Ⓢ","mord","ams"),j("\\circledR","®","mord","ams"),j("\\triangle","△"),j("\\bigtriangleup","△","mbin"),j("\\vartriangle","△","mrel","ams"),j("\\triangleq","≜","mrel","ams"),j("\\triangledown","▽","mord","ams"),j("\\bigtriangledown","▽","mbin"),j("\\triangleleft","◃","mbin"),j("\\vartriangleleft","⊲","mrel","ams"),j("\\trianglelefteq","⊴","mrel","ams"),j("\\ntriangleleft","⋪","mrel","ams"),j("\\ntrianglelefteq","⋬","mrel","ams"),j("\\triangleright","▹","mbin"),j("\\vartriangleright","⊳","mrel","ams"),j("\\trianglerighteq","⊵","mrel","ams"),j("\\ntriangleright","⋫","mrel","ams"),j("\\ntrianglerighteq","⋭","mrel","ams"),j("\\blacktriangle","▲","mord","ams"),j("\\blacktriangledown","▼","mord","ams"),j("\\blacktriangleleft","◀","mrel","ams"),j("\\blacktriangleright","▶","mrel","ams"),j("\\/","/"),j("|","∣","textord"),j("\\And","&","mbin"),j("\\imath","ı"),j("\\jmath","ȷ"),j("\\degree","°"),j("'","′"),j('"',"”");const Me=["(",")","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd"],Le=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache"],Ce=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Ae=[0,1.2,1.8,2.4,3],$e=[{type:"small",mathstyle:c.scriptscriptstyle},{type:"small",mathstyle:c.scriptstyle},{type:"small",mathstyle:c.textstyle},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],ze=[{type:"small",mathstyle:c.scriptscriptstyle},{type:"small",mathstyle:c.scriptstyle},{type:"small",mathstyle:c.textstyle},{type:"stack"}],_e=[{type:"small",mathstyle:c.scriptscriptstyle},{type:"small",mathstyle:c.scriptstyle},{type:"small",mathstyle:c.textstyle},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function De(e,t,a,i,s,r=""){if(!t||0===t.length||"."===t)return Te(e,s,e);let n;"<"===t||"\\lt"===t?t="\\langle":">"!==t&&"\\gt"!==t||(t="\\rangle"),n=Ce.includes(t)?$e:Me.includes(t)?_e:ze;const l=function(e,t,a,i){for(let r=Math.min(2,3-i.mathstyle.size);rt)return a[r]}var s;return a[a.length-1]}(te("math",t),a,n,s);return"small"===l.type?function(e,t,a,i,s,o=""){const r=T(e,D("Main-Regular",te("math",t)),s.mathstyle,a,o);return i&&r.setTop((1-s.mathstyle.sizeMultiplier/a.sizeMultiplier)*s.mathstyle.metrics.axisHeight),r.setStyle("color",s.color),"number"==typeof s.opacity&&r.setStyle("opacity",s.opacity),r}(e,t,l.mathstyle,i,s,"ML__small-delim "+r):"large"===l.type?ke(e,t,l.size,i,s,r):Se(e,t,a,i,s,r)}function qe(e,t,a,i,s,o=""){if("."===t)return Te(e,s,o);const r=s.mathstyle.metrics.axisHeight*s.mathstyle.sizeMultiplier,n=Math.max(a-r,i+r);return De(e,t,Math.max(n/500*901,2*n-.5),!0,s,o)}function Te(e,t,a){return _("","sizing"+t.mathstyle.adjustTo(c.textstyle)+" nulldelimiter "+(a||""),e)}const Ke={},Ee={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};function Fe(e,t){Ke[e]={decompose:t}}function Ne(t,a){var i,s;function o(e){return"mord"===e.type&&!!e.symbol&&/^[0-9,.]$/.test(e.symbol)}function r(e){return"text"===e.mode}const n=t instanceof d?t:new d(t),l=!n.atomIdsSettings||!n.atomIdsSettings.groupNumbers;let c=[];if(e(a)){if(0===a.length)return[];if(1===a.length)c=a[0].decompose(n),c&&l&&a[0].isSelected&&c.forEach(e=>e.selected(!0));else{let e="none",t=a[1].type,d=[],m="",p=!0,h=null;for(let u=0;ue.selected(!0))):(d.length>0&&(c=[...c,...d],d=[]),c=c.concat(e))}e=a[u].getFinalBaseElement().type,t=a[u+1]?a[u+1].getInitialBaseElement().type:"none"}d.length>0&&(c=[...c,...d],d=[])}}else a&&(c=a.decompose(n),c&&l&&a.isSelected&&c.forEach(e=>e.selected(!0)));if(!c||0===c.length)return null;if(n.mathstyle!==n.parentMathstyle){const e=n.mathstyle.sizeMultiplier/n.parentMathstyle.sizeMultiplier;for(const t of c)t.height*=e,t.depth*=e}if(n.size!==n.parentSize){const e=Ee[n.size]/Ee[n.parentSize];for(const t of c)t.height*=e,t.depth*=e}return c}class Be{constructor(e,t,a="",i={}){this.mode=e,this.type=t,this.body=a,this.applyStyle(i)}toLatex(t=!1){return function(t,a){if(!(a=void 0!==a&&a)&&t.latex)return t.latex;let i="",s=0,o=0,r=0;const n=t.symbol,l=(t,i)=>function(t,a,i){let s="";return e(a)?s=function(e,t,a){if(0===t.length)return"";if("first"===t[0].type){if(1===t.length)return"";t=t.slice(1)}return 0===t.length?"":u(f(t,"cssClass").map(t=>{const i=u(f(t,"color").map(t=>u(function(e){const t=[];let a=[],i="NONE";return e.forEach(e=>{"first"!==e.type&&(e.mode!==i?(a.length>0&&t.push(a),a=[e],i=e.mode):a.push(e))}),a.length>0&&t.push(a),t}(t).map(t=>function(e,t,a){return g[t[0].mode]&&g[t[0].mode].emitLatexRun?g[t[0].mode].emitLatexRun(e,t,a):""}(e,t,a)))));return!t[0].cssClass||e&&e.cssClass===t[0].cssClass?i:"ML__boldsymbol"===t[0].cssClass?"\\boldsymbol{"+i+"}":"ML__emph"===t[0].cssClass?"\\emph{"+i+"}":"\\class{"+t[0].cssClass+"}{"+i+"}"}))}(t,a,i):"number"==typeof a||"boolean"==typeof a?s=a.toString():"string"==typeof a?s=a.replace(/\s/g,"~"):a&&"function"==typeof a.toLatex&&(s=a.toLatex(i)),s}(t,i,a);switch(t.type){case"group":n?i=a?l(t,t.body):t.latex:(i=t.latexOpen||(t.cssId||t.cssClass?"":"{"),t.cssId&&(i+="\\cssId{"+t.cssId+"}{"),"ML__emph"===t.cssClass?i+="\\emph{"+l(t,t.body):(t.cssClass&&(i+="\\class{"+t.cssClass+"}{"),i+=l(t,t.body),t.cssClass&&(i+="}")),t.cssId&&(i+="}"),i+=t.latexClose||(t.cssId||t.cssClass?"":"}"));break;case"array":if(i+="\\begin{"+t.environmentName+"}","array"===t.environmentName){if(i+="{",t.colFormat)for(r=0;r0&&(i+=" & "),i+=l(t,t.array[o][s]);o1&&(i+=" "),i+=l(t,t.body),i+="\\right"+(t.rightDelim||"."),t.rightDelim&&t.rightDelim.length>1&&(i+=" ")):a?(i+="."===t.leftDelim?"":t.leftDelim,i+=l(t,t.body),i+="."===t.rightDelim?"":t.rightDelim):(i+="\\mleft"+(t.leftDelim||"."),t.leftDelim&&t.leftDelim.length>1&&(i+=" "),i+=l(t,t.body),i+="\\mright"+(t.rightDelim||"."),t.rightDelim&&t.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+t.delim+"}";break;case"rule":i+=n,t.shift&&(i+=`[${l(t,t.shift)}em]`),i+=`{${l(t,t.width)}em}{${l(t,t.height)}em}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":i+='\\char"'===n?t.latex:ae(n,null,t,l);break;case"mop":"​"!==t.body&&("\\mathop"===n||"\\operatorname"===n?i+=n+"{"+l(t,t.body)+"}":(i+=n,/^\\.*[a-zA-Z0-9]$/.test(n)&&(i+=" "))),t.explicitLimits&&("limits"===t.limits&&(i+="\\limits "),"nolimits"===t.limits&&(i+="\\nolimits "));break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",t.width?i+=t.width+"em":i+="0em",i+="}"):(i+=" ",t.width&&(i+=t.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{"+Object.keys(t.notation).join(" ")+"}";let e="",a="";t.backgroundColor&&"transparent"!==t.backgroundColor&&(e+=a+'mathbackground="'+ve(t.backgroundColor)+'"',a=","),t.shadow&&"auto"!==t.shadow&&(e+=a+'shadow="'+t.shadow+'"',a=","),1!==t.strokeWidth||"solid"!==t.strokeStyle?(e+=a+t.borderStyle,a=","):t.strokeColor&&"currentColor"!==t.strokeColor&&(e+=a+'mathcolor="'+ve(t.strokeColor)+'"',a=","),e&&(i+=`[${e}]`)}i+=`{${l(t,t.body)}}`;break;case"mathstyle":i+="\\"+t.mathstyle;break;case"space":i+=t.symbol;break;case"placeholder":i+="\\placeholder{}";break;case"first":case"command":case"msubsup":break;case"error":i+=t.latex;break;case"":break;default:i=ae(n,parent,t,l),i||(i+=n)}if(t.superscript){let e=l(t,t.superscript);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(t.subscript){const e=l(t,t.subscript);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i}(this,t)}getStyle(){return{mode:this.mode,color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,variant:this.variant,variantStyle:this.variantStyle,fontFamily:this.fontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(e){Object.assign(this,e),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Ee[this.fontSize]),"text"===this.mode&&"root"!==this.type&&(this.type="")}getInitialBaseElement(){let t;return e(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t||this}getFinalBaseElement(){return e(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const e=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(e.type)}forEach(t){if(t(this),e(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const a of e)for(const e of a)e.forEach(t)}filter(t){let a=[];t(this)&&a.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(e(this[i]))for(const e of this[i])e&&(a=a.concat(e.filter(t)));if(e(this.array))for(const e of this.array)for(const i of e)i&&(a=a.concat(i.filter(t)));return a}decomposeGroup(e){const t=_(Ne(e.clone({mathstyle:this.mathstyle?c[this.mathstyle]:void 0}),this.body),"","mord");return this.cssId&&(t.cssId=this.cssId),t.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),t}decomposeOverlap(e){const t=_(Ne(e,this.body),"inner");return _([t,_(null,"fix")],"left"===this.align?"llap":"rlap","mord")}decomposeRule(e){const t=e.mathstyle,a=_("","rule","mord");let i=this.shift&&!isNaN(this.shift)?this.shift:0;i/=t.sizeMultiplier;const s=this.width/t.sizeMultiplier,o=this.height/t.sizeMultiplier;return a.setStyle("border-right-width",s,"em"),a.setStyle("border-top-width",o,"em"),a.setStyle("margin-top",-(o-i),"em"),a.setStyle("border-color",e.color),a.width=s,a.height=o+i,a.depth=-i,a}decompose(t,a=null){let i=null;if(!this.type||/mord|minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(this.type)?(i="string"==typeof this.body?this.makeSpan(t,this.body):this.makeSpan(t,Ne(t,this.body)),i.type=v(this.type)?this.type:""):"group"===this.type||"root"===this.type?i=this.decomposeGroup(t):"delim"===this.type?(i=_(null,""),i.delim=this.delim):"sizeddelim"===this.type?i=this.bind(t,function(e,t,a,i,s=""){return"."===t?Te(e,i,s):("<"===t||"\\lt"===t?t="\\langle":">"!==t&&"\\gt"!==t||(t="\\rangle"),Me.includes(t)||Ce.includes(t)?ke(e,t,a,!1,i,s):Le.includes(t)?Se(e,t,Ae[a],!1,i,s):null)}(this.cls,this.delim,this.size,t)):"overlap"===this.type?i=this.decomposeOverlap(t):"rule"===this.type?i=this.decomposeRule(t):"msubsup"===this.type?(i=_("​","","mord"),a&&(i.height=a[0].height,i.depth=a[0].depth)):"space"===this.type?i=this.makeSpan(t," "):"spacing"===this.type?"​"===this.body?i=this.makeSpan(t,"​"):" "===this.body?i="math"===this.mode?this.makeSpan(t," "):this.makeSpan(t," "):this.width?(i=_("​","mspace "),this.width>0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em")):i=_("​","mspace "+({qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad")):"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):i="placeholder"===this.type?this.makeSpan(t,"⬚"):"first"===this.type?this.makeSpan(t,"​"):Ke[this.type].decompose(t,this),!i)return null;if(this.caret&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(e(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),this.containsCaret&&(e(i)?(i[0].classes=(i[0].classes||"")+" ML__contains-caret",i[i.length-1].classes=(i[i.length-1].classes||"")+" ML__contains-caret"):i.classes=(i.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(e(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return e(i)?i:[i]}attachSupsub(e,t,a){if(!this.superscript&&!this.subscript)return t;const i=e.mathstyle;let s=null,o=null;this.superscript&&(s=_(Ne(e.sup(),this.superscript),i.adjustTo(i.sup()))),this.subscript&&(o=_(Ne(e.sub(),this.subscript),i.adjustTo(i.sub())));let r,n=0,l=0;this.isCharacterBox()||(n=A(t)-i.metrics.supDrop,l=$(t)+i.metrics.subDrop),r=i===c.displaystyle?i.metrics.sup1:i.cramped?i.metrics.sup3:i.metrics.sup2;const d=.05/(c.textstyle.sizeMultiplier*i.sizeMultiplier);let m=null;if(o&&s){n=Math.max(n,r,s.depth+.25*i.metrics.xHeight),l=Math.max(l,i.metrics.sub2);const a=.04;if(n-$(s)-(A(o)-l)<4*a){l=4*a-(n-s.depth)+A(o);const e=.8*i.metrics.xHeight-(n-$(s));e>0&&(n+=e,l-=e)}m=E(e,[o,l,s,-n],"individualShift"),this.isSymbol&&m.children[0].setLeft(-z(t))}else o&&!s?(l=Math.max(l,i.metrics.sub1,A(o)-.8*i.metrics.xHeight),m=E(e,[o],"shift",l),m.children[0].setRight(d),this.isCharacterBox()&&m.children[0].setLeft(-z(t))):!o&&s&&(n=Math.max(n,r,s.depth+.25*i.metrics.xHeight),m=E(e,[s],"shift",-n),m.children[0].setRight(d));const p=_(m,"msubsup");return this.caret&&(p.caret=this.caret,this.caret=""),_([t,p],"",a)}attachLimits(e,t,a,i){const s=this.superscript?_(Ne(e.sup(),this.superscript),e.mathstyle.adjustTo(e.mathstyle.sup())):null,o=this.subscript?_(Ne(e.sub(),this.subscript),e.mathstyle.adjustTo(e.mathstyle.sub())):null;return function(e,t,a,i,s,o){if(!s&&!o)return t;t=_(t);let r=0,n=0;s&&(r=Math.max(.111,.2-$(s))),o&&(n=Math.max(.166,.6-A(o)));let l=null;return o&&s?(l=E(e,[.1,o,n,t,r,s,.1],"bottom",.1+A(o)+$(o)+n+$(t)+a),l.children[0].setLeft(-i),l.children[2].setLeft(i)):o&&!s?(l=E(e,[.1,o,n,t],"top",A(t)-a),l.children[0].setLeft(-i)):!o&&s&&(l=E(e,[t,r,s,.1],"bottom",$(t)+a),l.children[1].setLeft(i)),_(l,"op-limits","mop")}(e,t,a,i,s,o)}bind(e,t){return"first"!==this.type&&"​"!==this.body&&(this.id=function(e){let t;return e.atomIdsSettings&&("number"==typeof e.atomIdsSettings.seed?(t=e.atomIdsSettings.overrideID?e.atomIdsSettings.overrideID:e.atomIdsSettings.seed.toString(36),e.atomIdsSettings.seed+=1):t=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36)),t}(e),this.id&&(t.attributes||(t.attributes={}),t.attributes["data-atom-id"]=this.id)),t}makeSpan(e,t){const a=_(t,"","textord"===this.type?"mord":v(this.type)?this.type:""),i=this.getStyle();i.letterShapeStyle=e.letterShapeStyle,a.applyStyle(i);const s=(null==i?void 0:i.fontSize)?i.fontSize:"size5";return s!==e.parentSize?(a.classes+=" sizing reset-"+e.parentSize,a.classes+=" "+s):e.parentSize!==e.size&&(a.classes+=" sizing reset-"+e.parentSize,a.classes+=" "+e.size),a.maxFontSize=Math.max(a.maxFontSize,e.mathstyle.sizeMultiplier||1),"text"===this.mode&&(a.classes+=" ML__text"),e.mathstyle.isTight()&&(a.isTight=!0),"math"!==this.mode&&(a.italic=0),a.setRight(a.italic),"number"==typeof e.opacity&&a.setStyle("opacity",e.opacity),this.bind(e,a),this.caret&&(this.superscript||this.subscript||(a.caret=this.caret,this.caret="",e.mathstyle.isTight()&&(a.isTight=!0))),a}}function Oe(t,a=[]){const i=new Be(t,"root",a||[]);return!e(i.body)||0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new Be("","first")),i}function Re(t){return e(t)}const Pe=[[8205,1],[65038,2],[127995,5],[129456,4],[917536,96]];let Ie;const He=[127462,127487];function We(e){var t;return Ie||(Ie={},Pe.forEach(e=>{for(let t=e[0];t<=e[0]+e[1]-1;t++)Ie[t]=!0})),null!==(t=Ie[e])&&void 0!==t&&t}function Ve(e){return e>=He[0]&&e<=He[1]}function Ue(e){if(/^[\x20-\xFF]*$/.test(e))return e;const t=[],a=function(e){const t=[];for(let a=0;a=55296&&i<=56319){const t=e.charCodeAt(a+1);if(t>=56320&&t<=57343){const e=i-55296,s=t-56320;i=Math.pow(2,16)+e*Math.pow(2,10)+s,a++}}t.push(i)}return t}(e);let i=0;for(;i=this.s.length}get(){return this.pos="0"&&a<="9"?parseInt(a):"?"):e=new je("literal","#")}}else"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),e=new je("$$")):e=new je("$")):e=new je("literal",this.get());return e}}function Ze(e){const t=_("​","arraycolsep");return t.setWidth(e),t}function Xe(e,t,a,i){const s=[];for(const o of t){const t=_(Ne(e,i));t.depth=o.depth,t.height=o.height,s.push(t),s.push(o.pos-a)}return E(e,s,"individualShift")}Fe("genfrac",(e,t)=>{const a="auto"===t.mathstyle?e.mathstyle:c[t.mathstyle],i=e.clone({mathstyle:a});let s=[];t.numerPrefix&&s.push(_(t.numerPrefix,"mord"));const o=t.continuousFraction?a:a.fracNum();s=s.concat(Ne(i.clone({mathstyle:o}),t.numer));const r=K(s,e.mathstyle.adjustTo(o));let n=[];t.denomPrefix&&n.push(_(t.denomPrefix,"mord"));const l=t.continuousFraction?a:a.fracDen();n=n.concat(Ne(i.clone({mathstyle:l}),t.denom));const d=K(n,e.mathstyle.adjustTo(l)),m=t.hasBarLine?.04/a.sizeMultiplier:0;let p,h,u=0;a.size===c.displaystyle.size?(p=a.metrics.num1,u=m>0?3*m:.28,h=a.metrics.denom1):(m>0?(p=a.metrics.num2,u=m):(p=a.metrics.num3,u=.12),h=a.metrics.denom2);const f=r?$(r):0,g=d?A(d):0;let y;if(0===m){const e=p-f-(g-h);e{let a=t.colFormat;a&&0===a.length&&(a=[{align:"l"}]),a||(a=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const e of a)e.align&&s++;for(const e of t.array){let t=0;for(;t0&&(l+=m,r0&&y.push(E(e,a,"individualShift"))}const b=[];let v=!1,x=!1,k=0,w=!t.lFence;for(const t of a){if(t.align&&k>=y.length)break;if(t.align&&k{const i=a.svgBody?F(a.svgBody):Ne(t,a.body),s=t.clone({mathstyle:c.scriptstyle});let o,r;a.svgAbove?o=F(a.svgAbove):a.overscript&&(o=_(Ne(s,a.overscript),t.mathstyle.adjustTo(s.mathstyle))),a.svgBelow?r=F(a.svgBelow):a.underscript&&(r=_(Ne(s,a.underscript),t.mathstyle.adjustTo(s.mathstyle))),o&&r&&(r.setLeft(.3),r.setRight(.3),o.setLeft(.3),o.setRight(.3));let n=function(t,a,i,s,o){if(!i&&!s)return e(a)?_(a):a;let r=0,n=0;i&&(r=Math.max(.111,.2-$(i))),s&&(n=Math.max(.166,.6-A(s)));let l=null;if(s&&i){const e=A(s)+$(s)+$(a);l=E(t,[0,s,.2+$(a),a,-r,i,.166],"bottom",e)}else s&&!i?l=E(t,[0,s,n,a],"top",A(a)):i&&!s&&(l=E(t,[a,Math.max(.166,r-$(i)),i,0],"bottom",$(a)));return _(l,"op-over-under",o)}(t,i,o,r,v(a.type)?a.type:"mord");return(a.superscript||a.subscript)&&(n=a.attachLimits(t,n,0,0)),[n]}),Fe("accent",(t,a)=>{const i=t.mathstyle;let s=Ne(t.cramp(),a.body);(a.superscript||a.subscript)&&(s=[a.attachSupsub(t,_(s,"","mord"),"mord")]);let o=0;e(a.body)&&1===a.body.length&&a.body[0].isCharacterBox()&&(o=function(t){if(!t)return 0;if(e(t)){let e=0;for(const a of t)e+=a.skew||0;return e}return t.skew}(s));let r,n=Math.min(A(s),i.metrics.xHeight);if(a.svgAccent)r=F(a.svgAccent),n=.111-n;else{const e=D("Main-Regular",a.accent,"math");e.italic=0;const t="⃗"===a.accent?" accent-vec":"";r=_(_(e),"accent-body"+t)}return r=E(t,[s,-n,r]),r.children[1].setLeft(2*o),[_([r],"accent","mord")]}),Fe("enclose",(e,t)=>{const a=_(Ne(e,t.body),"","mord"),i="number"==typeof t.padding?t.padding:.3,s=_("","ML__notation");s.setStyle("position","absolute"),s.setStyle("height",A(a)+$(a)+2*i,"em"),s.height=A(a)+i,s.depth=$(a)+i,0!==i?s.setStyle("width","calc(100% + "+2*i+"em)"):s.setStyle("width","100%"),s.setStyle("top","0"),s.setStyle("left",-i,"em"),s.setStyle("z-index","-1"),t.backgroundcolor&&s.setStyle("background-color",t.backgroundcolor),t.notation.box&&s.setStyle("border",t.borderStyle),t.notation.actuarial&&(s.setStyle("border-top",t.borderStyle),s.setStyle("border-right",t.borderStyle)),t.notation.madruwb&&(s.setStyle("border-bottom",t.borderStyle),s.setStyle("border-right",t.borderStyle)),t.notation.roundedbox&&(s.setStyle("border-radius",(A(a)+$(a))/2,"em"),s.setStyle("border",t.borderStyle)),t.notation.circle&&(s.setStyle("border-radius","50%"),s.setStyle("border",t.borderStyle)),t.notation.top&&s.setStyle("border-top",t.borderStyle),t.notation.left&&s.setStyle("border-left",t.borderStyle),t.notation.right&&s.setStyle("border-right",t.borderStyle),t.notation.bottom&&s.setStyle("border-bottom",t.borderStyle);let o="";if(t.notation.horizontalstrike&&(o+='{const a="number"==typeof t.padding?t.padding:.3,i=_(Ne(e,t.body),"","mord");i.setStyle("vertical-align",-$(i),"em"),i.setStyle("height",0);const s=_(i,"","mord"),o=_("","ML__box");o.setStyle("position","absolute"),o.setStyle("height",A(s)+$(s)+2*a,"em"),0!==a?o.setStyle("width","calc(100% + "+2*a+"em)"):o.setStyle("width","100%"),o.setStyle("top",-a,"em"),o.setStyle("left",-a,"em"),o.setStyle("z-index","-1"),o.setStyle("box-sizing","border-box"),t.backgroundcolor&&o.setStyle("background-color",t.backgroundcolor),t.framecolor&&o.setStyle("border","0.04em solid "+t.framecolor),t.border&&o.setStyle("border",t.border),s.setStyle("display","inline-block"),s.setStyle("height",A(s)+$(s),"em");const r=_([o,s]);return r.setStyle("position","relative"),r.setStyle("vertical-align",-a+$(s),"em"),r.height=A(s)+a,r.depth=$(s)+a,r.setLeft(a),r.setRight(a),r.setStyle("height",r.height+r.depth-2*a,"em"),r.setStyle("top",-a,"em"),r.setStyle("display","inline-block"),[r]}),Fe("mop",(t,a)=>{var i;const s=t.mathstyle;let o,r=0,n=0;if(a.isSymbol){const e=s.size===c.displaystyle.size&&"\\smallint"!==a.symbol;o=D(e?"Size2-Regular":"Size1-Regular",a.body,"op-symbol "+(e?"large-op":"small-op"),"mop"),r=(o.height-o.depth)/2-s.metrics.axisHeight*s.sizeMultiplier,n=o.italic,o.applyStyle({color:a.phantom?"transparent":a.color,backgroundColor:a.phantom?"transparent":a.backgroundColor,cssId:a.cssId,cssClass:a.cssClass,letterShapeStyle:t.letterShapeStyle})}else o=e(a.body)?_(Ne(t,a.body),"","mop"):a.makeSpan(t,a.body);a.bind(t,o),a.isSymbol&&o.setTop(r);let l=o;if(a.superscript||a.subscript){const e=null!==(i=a.limits)&&void 0!==i?i:"auto";l="limits"===e||"auto"===e&&s.size===c.displaystyle.size?a.attachLimits(t,o,r,n):a.attachSupsub(t,o,"mop")}return[l]}),Fe("line",(e,t)=>{const a=e.mathstyle,i=Ne(e.cramp(),t.body),s=.04/a.sizeMultiplier,o=_(null,e.mathstyle.adjustTo(c.textstyle)+" "+t.position+"-line");let r;if(o.height=s,o.maxFontSize=1,"overline"===t.position)r=E(e,[i,3*s,o,s]);else{const t=_(i);r=E(e,[s,o,3*s,t],"top",A(t))}return[_(r,t.position,"mord")]}),Fe("leftright",(e,t)=>{if(!t.body)return t.leftDelim?new Be("math","mopen",t.leftDelim).decompose(e):t.rightDelim?new Be("math","mclose",t.rightDelim).decompose(e):null;const a=e.clone(),i=Ne(a,t.body),s=a.mathstyle;let o=0,r=0,n=[];if(o=A(i)*s.sizeMultiplier,r=$(i)*s.sizeMultiplier,t.leftDelim&&(n.push(t.bind(e,qe("mopen",t.leftDelim,o,r,a,"ML__open"))),n[n.length-1].applyStyle(t.getStyle())),i){for(let s=0;s{const a=e.mathstyle,i=Ne(e.cramp(),t.body),s=.04/a.sizeMultiplier;let o=s;a.idA(i)+$(i)+r&&(r=(r+l-(A(i)+$(i)))/2),n.setTop(n.height-A(i)-(r+s));const d=_(null,e.mathstyle.adjustTo(c.textstyle)+" sqrt-line");d.applyStyle(t.getStyle()),d.height=s;const m=E(e,[i,r,d,s]);if(!t.index)return[t.bind(e,_([n,m],"sqrt","mord"))];const p=e.clone({mathstyle:c.scriptscriptstyle}),h=E(e,[_(Ne(p,t.index),a.adjustTo(c.scriptscriptstyle))],"shift",-.6*(Math.max(n.height,m.height)-Math.max(n.depth,m.depth)));return[t.bind(e,_([_(h,"root"),n,m],"sqrt","mord"))]});const Ye={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML_bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},Je={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[0-9A-Z ]$/,fraktur:/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/,monospace:/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9]$/,"sans-serif":/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9]$/},Qe=/^[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5]$/,et=[/^[a-z]$/,/^[A-Z]$/,Qe,/^[\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9]$/],tt={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]};y("math",{emitLatexRun:function(e,t,a){let i=e.variant;return e.variantStyle&&"up"!==e.variantStyle&&(i+="-"+e.variantStyle),u(f(t,"color").map(t=>{const s=u(f(t,"variant").map(t=>{let s=t[0].variant;if(t[0].variantStyle&&"up"!==t[0].variantStyle&&(s+="-"+t[0].variantStyle),t.every(t=>{const a=se(t.symbol,e.mode,null);if(!a||!a.variant&&!a.variantStyle)return!1;let i=t.variant;return t.variantStyle&&"up"!==t.variantStyle&&(i+="-"+t.variantStyle),i===s}))return u(t.map(e=>e.toLatex(a)));let o="";return s&&s!==i&&(o={calligraphic:"\\mathcal{",fraktur:"\\mathfrak{","double-struck":"\\mathbb{",script:"\\mathscr{",monospace:"\\mathtt{","sans-serif":"\\mathsf{",normal:"\\mathrm{","normal-italic":"\\mathit{","normal-bold":"\\mathbf{","normal-bolditalic":"\\mathbfit{",ams:"","ams-italic":"\\mathit{","ams-bold":"\\mathbf{","ams-bolditalic":"\\mathbfit{",main:"","main-italic":"\\mathit{","main-bold":"\\mathbf{","main-bolditalic":"\\mathbfit{"}[s]),o+u(t.map(e=>e.toLatex(a)))+(o?"}":"")}));return!t[0].color||e&&e.color===t[0].color?s:"\\textcolor{"+ve(t[0].color)+"}{"+s+"}"}))},applyStyle:function(e,t){const a="auto"!==t.letterShapeStyle&&t.letterShapeStyle?t.letterShapeStyle:"tex";let i=t.variant||"normal",s=t.variantStyle||"";"normal"===i&&!s&&/\u00a3|\u0131|\u0237/.test(e.body)&&(i="main",s="italic"),"normal"!==i||s||1!==e.body.length||et.forEach((t,i)=>{t.test(e.body)&&"it"===tt[a][i]&&(s="italic")}),"up"===s&&(s="");const o=s?i+"-"+s:i,[r,n]=Ye[o];return Je[i]&&!Je[i].test(e.body)?(e.body=J(e.body,i,s),e.variant="",e.variantStyle="",null):(Qe.test(e.body)&&(e.classes+=" lcGreek"),n&&(e.classes+=" "+n),r)}});const at={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"};function it(e){let t=!1;const a=e.map(e=>"literal"===e.type?e.value:"{"===e.type?"{":"}"===e.type?"}":"command"===e.type?"\\"+e.value:"placeholder"===e.type?"#?":"#"===e.type?(t=!0,"#"+e.value):"space"===e.type?" ":"$"===e.type?"$":"$$"===e.type?"$$":"").join("");return t?"":a}y("text",{emitLatexRun:function(e,t,a){const i=function(e,t,a){return u(f(t,"color").map(t=>{const a=function(e,t,a){return function(e,t,a){return u(f(t,"fontFamily").map(e=>{const t=function(e,t,a){return u(f(t,"fontSize").map(e=>{const t=function(e,t,a){return u(f(t,"fontSeries").map(e=>{const t=function(e,t,a){return u(f(t,"fontShape").map(e=>{const t=function(e,t,a){let i=!1;return u(t.map(e=>{let t="",a="";return e.latex?t=e.latex:"string"==typeof e.body?t=ee("text",e.body):e.symbol&&(t=e.symbol.replace(/\\/g,"\\backslash ")),!i||t&&!/^[a-zA-Z0-9*]/.test(t)||(a="{}"),i=/\\[a-zA-Z0-9]+\*?$/.test(t),a+t}))}(0,e);return"it"===e[0].fontShape?"\\textit{"+t+"}":"sl"===e[0].fontShape?"\\textsl{"+t+"}":"sc"===e[0].fontShape?"\\textsc{"+t+"}":"n"===e[0].fontShape?"\\textup{"+t+"}":e[0].fontShape?"\\fontshape{"+e[0].fontShape+"}"+t:t}))}(0,e);return"b"===e[0].fontSeries?"\\textbf{"+t+"}":"l"===e[0].fontSeries?"\\textlf{"+t+"}":"m"===e[0].fontSeries?"\\textmd{"+t+"}":e[0].fontSeries?"\\fontseries{"+e[0].fontSeries+"}"+t:t}))}(0,e),a={size1:"tiny",size2:"scriptsize",size3:"footnotesize",size4:"small",size5:"normalsize",size6:"large",size7:"Large",size8:"LARGE",size9:"huge",size10:"Huge"}[e[0].fontSize]||"";return a?"\\"+a+" "+t:t}))}(0,e),a={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[e[0].fontFamily]||"";return a?"\\"+a+"{"+t+"}":e[0].fontFamily?"\\fontfamily{"+e[0].fontFamily+"}"+t:t}))}(0,t)}(0,t);return!t[0].color||"none"===t[0].color||e&&e.color===t[0].color?a:"\\textcolor{"+ve(t[0].color)+"}{"+a+"}"}))}(e,t);return t.every(e=>e.fontSeries||e.fontShape||e.fontFamily)&&t[0].mode===e.mode?i:`\\text{${i}}`},applyStyle:function(e,t){const a=t.fontFamily;if(at[a]?e.classes+=" "+at[a]:a&&e.setStyle("font-family",a),t.fontShape&&(e.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const a=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);a&&(e.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[a[1]||""]||""),e.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[a[2]||""]||""))}return"Main-Regular"},parse:(e,t,a)=>function(e,t,a){var i;let s,o=[];for(;e.length>0;){const r=e.shift();if("space"===r.type)s=new Be("text",""," ",a.style),s.symbol=" ",o.push(s);else if("placeholder"===r.type)s=new Be("text","placeholder",r.value),s.captureSelection=!0,o.push(s);else if("command"===r.type){let t;e.unshift(r),[t,e]=a.parse("text",e,a),o=[...o,...t]}else if("literal"===r.type){const e=se(r.value,"text",a.macros);!e||e.mode&&!e.mode.includes("text")?t({code:"unexpected-token"}):(s=new Be("text",e?e.type:"",e?e.value:r.value,a.style),s.symbol=r.value,s.latex=Z("text",r.value),o.push(s))}else if("$"===r.type||"$$"===r.type){const t=e.slice(0,e.findIndex(e=>e.type===r.type));e=e.slice(t.length+1);const[i]=a.parse("math",t,a);o=[...o,...i]}else"{"===r.type||"}"===r.type||t({code:"unexpected-token",arg:r.type+(null!==(i=r.value)&&void 0!==i?i:"")})}return[o,e]}(e,t,a)[0]});class st{constructor(e,t,a,i){this.index=0,this.mathList=[],this.style={},this.parseMode="math",this.smartFence=!1,this.tabularMode=!1,this.endCount=0,this.tokens=e,this.args=t,this.macros=a,this.onError=e=>i({before:it(this.tokens.slice(this.index,this.index+10)),after:it(this.tokens.slice(Math.max(0,this.index-10),this.index)),...e})}swapMathList(e=[]){const t=this.mathList;return this.mathList=e,t}swapParseMode(e){const t=this.parseMode;return this.parseMode=e,t}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=e.length}const s=e.toUpperCase()===i.toUpperCase();return s||(this.index=t),s}scanString(){let e="",t=this.end();for(;!t;){if(this.hasLiteral("]"))t=!0;else if(this.hasToken("literal"))e+=this.get().value;else if(this.skipWhitespace())e+=" ";else if(this.hasToken("command")){const t=this.get();"space"===t.value?e+=" ":(this.onError({code:"unbalanced-braces"}),e+=t.value)}else t=!0;t=t||this.end()}return e}scanLiteralArg(){let e="";if(this.hasToken("{")){this.get();let t=1;for(;t>0&&!this.end();){const a=this.get();"space"===a.type?e+=" ":"#"===a.type?e+="#"+a.value:"command"===a.type?e+="\\"+a.value:"}"===a.type?(t-=1,t>0&&(e+="}")):"{"===a.type?(t+=1,e+="{"):e+=a.value}}return e}scanColor(){return be(this.scanString())}scanNumber(e=!0){const t=this.parseLiteral("-");t||this.parseLiteral("+"),this.skipWhitespace(),e=!!e;let a=10,i=/[0-9]/;this.parseLiteral("'")?(a=8,i=/[0-7]/,e=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(a=16,i=/[0-9A-F]/,e=!0);let s="";for(;this.hasLiteralPattern(i);)s+=this.get().value;if(!e&&(this.parseLiteral(".")||this.parseLiteral(",")))for(s+=".";this.hasLiteralPattern(i);)s+=this.get().value;const o=e?parseInt(s,a):parseFloat(s);return t?-o:o}scanDimen(){const e=this.scanNumber(!1);let t;return this.skipWhitespace(),this.parseKeyword("pt")?t=r(e,"pt"):this.parseKeyword("mm")?t=r(e,"mm"):this.parseKeyword("cm")?t=r(e,"cm"):this.parseKeyword("ex")?t=r(e,"ex"):this.parseKeyword("px")?t=r(e,"px"):this.parseKeyword("em")?t=r(e,"em"):this.parseKeyword("bp")?t=r(e,"bp"):this.parseKeyword("dd")?t=r(e,"dd"):this.parseKeyword("pc")?t=r(e,"pc"):this.parseKeyword("in")?t=r(e,"in"):this.parseKeyword("mu")?t=r(e,"mu"):(this.onError({code:"missing-unit"}),t=r(e,"pt")),t}scanSkip(){const e=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),e}scanColspec(){this.skipWhitespace();const e=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const t=this.get().value;if("lcr".includes(t))e.push({align:t});else if("|"===t)e.push({rule:!0});else if("@"===t){if(this.parseToken("{")){const t=this.swapParseMode("math");e.push({gap:this.scanImplicitGroup(e=>"}"===e.type)}),this.swapParseMode(t)}this.parseToken("}")}}return e}scanModeSet(){let e;if(this.parseCommand("(")&&(e=")"),!e&&this.parseCommand("[")&&(e="]"),!e)return null;const t=this.swapParseMode("math"),a=new Be("math","group");return a.mathstyle=")"===e?"textstyle":"displaystyle",a.body=this.scanImplicitGroup(t=>"command"===t.type&&t.value===e),this.parseCommand(e),this.swapParseMode(t),a.body&&0!==a.body.length?a:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const e=this.get().type,t=new Be("math","group");t.mathstyle="$"===e?"textstyle":"displaystyle",t.latexOpen="textstyle"===t.mathstyle?"$":"$$",t.latexClose=t.latexOpen;const a=this.swapParseMode("math");return t.body=this.scanImplicitGroup(t=>t.type===e),this.parseToken(e),this.swapParseMode(a),t.body&&0!==t.body.length?t:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const e=this.scanArg("string");if(!e)return null;const t=ie(e);if(!t)return null;const a=[];if(null==t?void 0:t.params)for(const i of t.params)if(i.isOptional)a.push(this.scanOptionalArg(i.type));else{const t=this.scanArg(i.type);t||this.onError({code:"missing-argument",arg:e}),a.push(t)}const i=this.parseMode,s=this.tabularMode,o=this.swapMathList([]);this.tabularMode=t.tabular;const r=[],n=[];let l=[],c=!1;do{if(this.end()&&(this.onError({code:"unbalanced-environment",arg:e}),c=!0),!c&&this.parseCommand("end")&&(this.scanArg("string")!==e&&this.onError({code:"unbalanced-environment",arg:e}),c=!0),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let e=0;this.skipWhitespace(),this.parseLiteral("[")&&(e=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),n.push(e||0),r.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup(e=>"}"===e.type||"literal"===e.type&&"&"===e.value||"command"===e.type&&/^(end|cr|\\)$/.test(e.value)))}while(!c);l.push(this.swapMathList([])),l.length>0&&r.push(l);const d=this.swapMathList(o);if(this.parseMode=i,this.tabularMode=s,!t.tabular&&0===d.length)return null;if(t.tabular&&0===r.length)return null;const m=new Be(this.parseMode,"array",d);return Object.assign(m,t.parser(e,a,r)),m.array=r,m.rowGaps=n,m.environmentName=e,m}scanImplicitGroup(e){const t=this.style;e||(e=e=>"}"===e.type);let a=null,i=null,s=[],o=null;const r=this.swapMathList([]);for(;!this.end()&&!e(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const e=new Be("math","mathstyle");e.mathstyle=this.get().value,this.mathList.push(e)}else this.hasInfixCommand()&&!a?(a=this.get(),i=se("\\"+a.value,"math",this.macros),i&&([,s]=this.parseArguments(i)),o=this.swapMathList([])):this.parseAtom();let n;return a?(s.unshift(this.swapMathList(r)),s.unshift(o),n=[new Be(this.parseMode,i.type,i.value||a.value,i.parse?i.parse("\\"+a.value,s):null)],n[0].symbol="\\"+a.value):n=this.swapMathList(r),this.style=t,n}scanGroup(){if(!this.parseToken("{"))return null;const e=new Be(this.parseMode,"group");return e.body=this.scanImplicitGroup(e=>"}"===e.type),this.parseToken("}"),e.latexOpen="{",e.latexClose="}",e}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const e=new Be(this.parseMode,"leftright");e.leftDelim="(",e.inner=!1;const t=this.swapMathList([]);let a=1;for(;!this.end()&&0!==a;)this.hasLiteral("(")&&(a+=1),this.hasLiteral(")")&&(a-=1),0!==a&&this.parseAtom();return 0===a&&this.parseLiteral(")"),e.rightDelim=0===a?")":"?",e.body=this.swapMathList(t),e}scanDelim(){this.skipWhitespace();const e=this.get();if(!e)return this.onError({code:"unexpected-end-of-string"}),null;let t=".";"command"===e.type?t="\\"+e.value:"literal"===e.type&&(t=e.value);const a=se(t,"math",this.macros);return a?a.mode&&!a.mode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:t}),null):"mopen"===a.type||"mclose"===a.type||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(t)?t:(this.onError({code:"unexpected-delimiter",arg:t}),null):(this.onError({code:"unknown-command",arg:t}),null)}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return this.onError({code:"unbalanced-braces"}),null;const e=this.style;let t="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;t="mright"}const a=this.scanDelim();if(!a)return null;const i=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(t);)this.parseAtom();this.style=e;const s=this.scanDelim(),o=new Be(this.parseMode,"leftright");return o.leftDelim=a,o.rightDelim=s,o.inner="right"===t,o.body=this.swapMathList(i),o}parseSupSub(){var e,t;if("math"!==this.parseMode)return!1;let a=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){const i=this.hasLiteral("_")?"subscript":"superscript";if(this.parseLiteral("^")||this.parseLiteral("_")){const t=this.scanArg();if(t){const s=this.lastSubsupAtom();s[i]=(null!==(e=s[i])&&void 0!==e?e:[]).concat(t),a=!0}}else if(this.parseLiteral("'")){const e=this.lastSubsupAtom(),i=new Be(e.mode,"mord","′");i.symbol="\\prime",e.superscript=null!==(t=e.superscript)&&void 0!==t?t:[],e.superscript.push(i),a=!0}}return a}parseLimits(){if(this.parseCommand("limits")){const e=this.lastSubsupAtom();return e.limits="limits",e.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const e=this.lastSubsupAtom();return e.limits="nolimits",e.explicitLimits=!0,!0}return!1}scanOptionalArg(e){if(e=e&&"auto"!==e?e:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const t=this.parseMode;this.parseMode=e;const a=this.swapMathList();let i;for(;!this.end()&&!this.parseLiteral("]");)if("string"===e)i=this.scanString();else if("number"===e)i=this.scanNumber();else if("dimen"===e)i=this.scanDimen();else if("skip"===e)i=this.scanSkip();else if("colspec"===e)i=this.scanColspec();else if("color"===e)i=this.scanColor()||"#ffffff";else if("bbox"===e){const e=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/),t={};for(const a of e){const e=be(a);if(e)t.backgroundcolor=e;else{const e=a.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(e)t.padding=r(e[1],e[2]);else{const e=a.match(/^\s*border\s*:\s*(.*)/);e&&(t.border=e[1])}}}i=t}else this.mathList=this.mathList.concat(this.scanImplicitGroup(e=>"literal"===e.type&&"]"===e.value));this.parseMode=t;const s=this.swapMathList(a);return i||s}scanArg(e){var t;let a;if(e=e&&"auto"!==e?e:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===e)return this.scanDelim()||".";if(/^(math|text)$/.test(e)){const t=this.parseMode;this.parseMode=e;const a=this.scanToken();return this.parseMode=t,a}}if(this.hasToken("#")){const e=this.get();return this.skipUntilToken("}"),"?"===e.value?this.placeholder():this.args?null===this.args[e.value]||void 0===this.args[e.value]?this.placeholder():"string"==typeof this.args[e.value]?ot(this.args[e.value],this.parseMode,null,this.macros,!1,this.onError):null!==(t=this.args[e.value])&&void 0!==t?t:null:null}const i=this.parseMode;this.parseMode=e;const s=this.swapMathList([]);if("string"===e)a=this.scanString(),this.skipUntilToken("}");else if("number"===e)a=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===e)a=this.scanDimen(),this.skipUntilToken("}");else if("skip"===e)a=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===e)a=this.scanColspec(),this.skipUntilToken("}");else if("color"===e)a=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===e)a=this.scanDelim()||".",this.skipUntilToken("}");else{const t=this.index;let i=1;do{const e=this.get();"}"===(null==e?void 0:e.type)&&(i-=1),"{"===(null==e?void 0:e.type)&&(i+=1)}while(i>0&&!this.end());if(o=e,r=this.tokens.slice(t,this.index-1),n=this.onError,l={args:this.args,macros:this.macros,smartFence:this.smartFence,style:this.style,parse:(e,t,i)=>{const s=new st(t,i.args,i.macros,this.onError);return s.parseMode=e,s.style=i.style,a=s.scanImplicitGroup(),[a,t.slice(s.index)]}},a=g[o]&&g[o].parse?g[o].parse(r,n,l):null,!a){this.index=t;do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end())}}var o,r,n,l;this.parseMode=i;const c=this.swapMathList(s);return a||c}scanToken(){var t;const a=this.get();if(!a)return null;let i=null;if("space"===a.type)"text"===this.parseMode&&(i=new Be("text",""," ",this.style),i.symbol=" ");else if("placeholder"===a.type)i=new Be(this.parseMode,"placeholder",a.value),i.captureSelection=!0;else if("command"===a.type){if("placeholder"===a.value)i=new Be(this.parseMode,"placeholder",this.scanArg("string"),this.style),i.captureSelection=!0;else if("char"===a.value){const e=this.index;let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),i=new Be(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),i.symbol="\\char",i.latex="\\char"+it(this.tokens.slice(e))}else if("hskip"===a.value||"kern"===a.value){const e=this.scanSkip();isFinite(e)&&(i=new Be(this.parseMode,"spacing",null,this.style),i.width=e,i.symbol="\\"+a.value,i.latex="\\"+a.value)}else if(i=this.scanMacro(a.value),!i){const e=se("\\"+a.value,this.parseMode,{});if(!e)return this.onError({code:"unknown-command",arg:"\\"+a.value}),i=new Be("math","error","\\"+a.value),i.symbol="\\"+a.value,i.latex="\\"+a.value,[i];if(e.mode&&!e.mode.includes(this.parseMode))return this.onError({code:"invalid-command",arg:"\\"+a.value}),i=new Be("math","error","\\"+a.value),i.symbol="\\"+a.value,i.latex="\\"+a.value,[i];const t=this.index,[s,o]=this.parseArguments(e);if(!o)return null;if(e.infix)this.onError({code:"too-many-infix-commands",arg:"\\"+a.value});else{if(e.parse){const t=e.parse("\\"+a.value,o);if(t.type)i=new Be(this.parseMode,e.type,s?this.scanArg(s):null,{...this.style,...t});else{const e=this.parseMode;if(t.mode&&(this.parseMode=t.mode,delete t.mode),s){const e=this.style;this.style={...this.style,...t},i=this.scanArg(s),this.style=e}else this.style={...this.style,...t};this.parseMode=e}}else{const t={...this.style,variant:e.variant||this.style.variant,variantStyle:e.variantStyle||this.style.variantStyle};i=new Be(this.parseMode,e.type||"mop",e.value||a.value,t)}if(i instanceof Be&&!/^(llap|rlap|class|cssId)$/.test(a.value)){i.symbol="\\"+a.value;const e=it(this.tokens.slice(t,this.index));if(e&&(i.latex=i.symbol+e),i.isFunction&&this.smartFence){const e=this.scanSmartFence();e&&(i=[i,e])}}}}}else if("literal"===a.type&&"string"==typeof a.value){const e=se(a.value,this.parseMode,this.macros);if(e){const t={...this.style};i=new Be(this.parseMode,e.type,e.value||a.value,t),e.isFunction&&(i.isFunction=!0)}else i=new Be(this.parseMode,"math"===this.parseMode?"mord":"",a.value,this.style);if(i.symbol=a.value,i.latex=Q(this.parseMode,a.value),(null==e?void 0:e.isFunction)&&this.smartFence){const e=this.scanSmartFence();e&&(i=[i,e])}}else"#"===a.type?i="?"!==a.value&&this.args?null===this.args[a.value]||void 0===this.args[a.value]?this.placeholder():"string"==typeof this.args[a.value]?ot(this.args[a.value],this.parseMode,[],this.macros,!1,this.onError):this.args[a.value]:this.placeholder():"}"===a.type?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:a.type+(null!==(t=a.value)&&void 0!==t?t:"")});return i&&!e(i)?[i]:i}scanMacro(e){var t;if(!this.macros||!this.macros[e])return null;const a=this.index,i=[];let s,o=0;"string"==typeof this.macros[e]?(s=this.macros[e],/(^|[^\\])#1/.test(s)&&(o=1),/(^|[^\\])#2/.test(s)&&(o=2),/(^|[^\\])#3/.test(s)&&(o=3),/(^|[^\\])#4/.test(s)&&(o=4),/(^|[^\\])#5/.test(s)&&(o=5),/(^|[^\\])#6/.test(s)&&(o=6),/(^|[^\\])#7/.test(s)&&(o=7),/(^|[^\\])#8/.test(s)&&(o=8),/(^|[^\\])#9/.test(s)&&(o=9)):(s=this.macros[e].def,o=this.macros[e].args||0);for(let e=1;e<=o;e++)i[e]=this.scanLiteralArg();i["?"]=null===(t=this.args)||void 0===t?void 0:t["?"];const r=new Be(this.parseMode,"group",ot(s,this.parseMode,i,this.macros,!1,this.onError));return r.captureSelection=!0,r.symbol="\\"+e,r.latex="\\"+e+it(this.tokens.slice(a)),r}parseAtom(){let t=this.scanEnvironment()||this.scanModeShift()||this.scanModeSet()||this.scanGroup()||this.scanLeftRight();return!(t||!this.parseSupSub()&&!this.parseLimits())||(t||(t=this.scanToken()),e(t)?this.mathList=this.mathList.concat(t):t&&this.mathList.push(t),null!==t)}}function ot(e,t,a,i,s=!1,o){let r=[];const n=new st(function(e){const t=[],a=e.toString().split(/\r?\n/);let i="",s="";for(const e of a){i+=s,s=" ";const t=e.match(/((?:\\%)|[^%])*/);t&&(i+=t[0])}const o=new Ge(i);for(;!o.end();){const e=o.makeToken();e&&t.push(e)}return t}(e),a,i,t=>{o&&o({...t,latex:e})});for(n.parseMode=t||"math",s&&(n.smartFence=!0);!n.end();)r=r.concat(n.scanImplicitGroup());return r}function rt(e){return 0===e.length||1===e.length&&"first"===e[0].type}function nt(e){const t=e.siblings();for(let e=t.length-1;e>=0;e--)t[e].suggestion&&t.splice(e,1)}function lt(e){let t=1,a=e.ancestor(t);for(;a;)a.latex=void 0,t+=1,a=e.ancestor(t)}function ct(e,t){let a="";for(const t of e)a+=t.relation+":"+t.offset+"/";return t&&(a+="#"+t),a}function dt(e){const t={path:[],extent:0},a=e.split("#");a.length>1&&(t.extent=parseInt(a[1]));const i=a[0].split("/");for(const e of i){const a=e.match(/([^:]*):(.*)/);a&&t.path.push({relation:a[1],offset:parseInt(a[2])})}return t}function mt(e,t){let a=0,i=-1,s=!1;for(;!s;)i+=1,s=i>=e.length||i>=t.length,s=s||!(e[i].relation===t[i].relation&&e[i].offset===t[i].offset);return a=i===e.length&&i===t.length?0:i+1===e.length&&i+1===t.length&&e[i].relation===t[i].relation?1:2,a}function pt(e){return dt(ct(e)).path}function ht(e,t){let a=0;for(let i=0;i0;)i.col+=1,(!e[i.row]||i.col>=e[i.row].length)&&(i.col=0,i.row+=1),a-=1;return i}function ft(t,a){let i;return"object"!=typeof a&&(a=ut(t,a)),e(t[a.row])&&(i=t[a.row][a.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(new Be("","first")),i}function gt(e){let t=0,a=0,i=1;for(const t of e)a+=1,t.length>i&&(i=t.length);return t=a*i,t}function yt(e,t,a){const i={...t};if(i.row+=a,i.row<0){if(i.col+=a,i.row=e.length-1,i.col<0)return null;for(;i.row>=0&&!ft(e,i);)i.row-=1;if(i.row<0)return null}else if(i.row>=e.length){for(i.col+=a,i.row=0;i.rowe.length-1)return null}return i}class bt{constructor(e,t,a,i){this.options={mode:"math",removeExtraneousParentheses:!1,...e},this.root=Oe(this.options.mode),this.path=[{relation:"body",offset:0}],this.extent=0,this.setListeners(t),this.setHooks(a),this.mathfield=i,this.suppressChangeNotifications=!1}clone(){const e=new bt(this.options,this.listeners,this.hooks,this.mathfield);return e.root=this.root,e.path=pt(this.path),e}setListeners(e){this.listeners=e}setHooks(e){this.hooks={announce:(null==e?void 0:e.announce)?e.announce:(e,t,a,i)=>{},moveOut:(null==e?void 0:e.moveOut)?e.moveOut:()=>!0,tabOut:(null==e?void 0:e.tabOut)?e.tabOut:()=>!0}}announce(e,t,a=[]){this.hooks.announce(this.mathfield,e,t,a)}toString(){return ct(this.path,this.extent)}siblings(){if(0===this.path.length)return[];let e;return this.parent().array?e=ft(this.parent().array,this.relation()):(e=this.parent()[this.relation()]||[],"string"==typeof e&&(e=[])),0!==e.length&&"first"===e[0].type||e.unshift(new Be("","first")),e}anchorOffset(){return this.path.length>0?this.path[this.path.length-1].offset:0}focusOffset(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0}startOffset(){return Math.min(this.focusOffset(),this.anchorOffset())}endOffset(){return Math.max(this.focusOffset(),this.anchorOffset())}sibling(e){return this.siblings()[this.startOffset()+e]}ancestor(e){if(e>this.path.length)return null;let t=this.root;for(let a=0;a0?this.path[this.path.length-1].relation:""}insertFirstAtom(){this.siblings()}}function vt(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onSelectionWillChange)||e.suppressChangeNotifications||e.listeners.onSelectionWillChange(e)}function xt(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onSelectionDidChange)||e.suppressChangeNotifications||e.listeners.onSelectionDidChange(e)}function kt(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onContentWillChange)||e.suppressChangeNotifications||e.listeners.onContentWillChange(e)}function wt(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onContentDidChange)||e.suppressChangeNotifications||e.listeners.onContentDidChange(e)}function St(e){return!!e&&("mord"===e.type&&/[0-9.]/.test(e.body)||"mpunct"===e.type&&","===e.body)}function Mt(e){const t=e.siblings();if(t.length<=1)return null;let a=Math.min(e.endOffset(),t.length-1);if("command"!==t[a].type)return null;for(;a>0&&"command"===t[a].type;)a-=1;let i=e.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>a?{start:a+1,end:i}:null}function Lt(e){const t=Rt(e)?Vt(e):e.sibling(1);let a;if(t){if("command"===t.type)return"command";a=t.mode}let i=1,s=e.ancestor(i);for(;!a&&s;)s&&(a=s.mode),i+=1,s=e.ancestor(i);return a}function Ct(e){const t=Rt(e)?Vt(e):e.sibling(1);let a;if(t&&"first"!==t.type){if("command"===t.type)return{};a={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=e.ancestor(i);for(;!a&&s;)s&&(a={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=e.ancestor(i);return a}function At(e,t=1,a=!0){var i;const s=e.suppressChangeNotifications;e.suppressChangeNotifications=!0;const o=e.clone(),r=e.extent;Dt(e,t),"placeholder"===Vt(e).type&&Dt(e,t);const n=Yt(e,(t,a)=>"placeholder"===a.type||t.length>1&&1===e.siblings().length,t);if(0===n.length){if(jt(e,o,r),a&&(null===(i=e.hooks)||void 0===i?void 0:i.tabOut)&&e.hooks.tabOut(e,t>0?"forward":"backward")&&document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',a=Array.prototype.filter.call(document.querySelectorAll(e),e=>(e.offsetWidth>0||e.offsetHeight>0)&&!e.contains(document.activeElement)||e===document.activeElement);let i=a.indexOf(document.activeElement)+t;i<0&&(i=a.length-1),i>=a.length&&(i=0),a[i].focus()}return e.suppressChangeNotifications=s,!1}return vt(e),jt(e,n[0]),"placeholder"===Vt(e).type&&Pt(e,-1),e.announce("move",o),xt(e),e.suppressChangeNotifications=s,!0}function $t(e,t=0,a=0,i=""){const s=e.path[e.path.length-1].relation;i||(i=s);const o=e.parent();if(!o&&"body"!==i)return!1;const r=i.startsWith("cell");if(!r&&!o[i]||r&&!o.array)return!1;const n=i!==s;e.path[e.path.length-1].relation=i;const l=e.siblings().length;e.path[e.path.length-1].relation=s;const c=e.extent;"end"===a?a=l-t-1:"start"===a&&(a=-t),Pt(e,a);const d=e.extent!==c;Pt(e,c),t<0&&(t=l+t),t=Math.max(0,Math.min(t,l-1));const m=e.path[e.path.length-1].offset;return(n||m!==t||d)&&(n&&Zt(e),vt(e),e.path[e.path.length-1].relation=i,e.path[e.path.length-1].offset=t,Pt(e,a),xt(e)),!0}function zt(t,a){var i;a=null!=a?a:{};const s={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(t.anchorOffset()===t.siblings().length-1){Zt(t);let e=s[t.relation()];const o=t.parent();for(;e&&!o[e];)e=s[e];if(e)return void $t(t,0,0,e);if(t.parent().array){const e=gt(t.parent().array);let a=parseInt(t.relation().match(/cell([0-9]*)$/)[1])+1;for(;a=0;){if(ft(t.parent().array,e)&&$t(t,-1,0,"cell"+e))return void xt(t);e-=1}}return 1===t.path.length?(t.suppressChangeNotifications||!(null===(i=t.hooks)||void 0===i?void 0:i.moveOut)||t.hooks.moveOut(t,"backward"))&&(t.path[0].offset=t.root.body.length-1):(t.path.pop(),$t(t,t.anchorOffset()-1)),void xt(t)}const o=Vt(t);if(!o.captureSelection){let a;if(o.array){a="";const e=gt(o.array);let i=e-1;for(;!a&&i0)for(It(e)&&t--;t>0;)zt(e),t--;else if(t<0)for(Ht(e)&&t++;0!==t;)_t(e),t++;e.announce("move",a)}return!0}function qt(e,t){var a;const i=null!==(a=(t=null!=t?t:{extend:!1}).extend)&&void 0!==a&&a;Ht(e);const s=e.relation();if("denom"===s)i?(vt(e),e.path.pop(),e.path[e.path.length-1].offset-=1,Pt(e,1),xt(e)):$t(e,e.anchorOffset(),0,"numer"),e.announce("moveUp");else if(e.parent().array){let a=ut(e.parent().array,s);a=yt(e.parent().array,a,-1),a&&ft(e.parent().array,a)?(e.path[e.path.length-1].relation="cell"+ht(e.parent().array,a),$t(e,e.anchorOffset()),e.announce("moveUp")):Dt(e,-1,t)}else e.announce("line");return!0}function Tt(e,t){var a;const i=null!==(a=(t=null!=t?t:{extend:!1}).extend)&&void 0!==a&&a;It(e);const s=e.relation();if("numer"===s)i?(vt(e),e.path.pop(),e.path[e.path.length-1].offset-=1,Pt(e,1),xt(e)):$t(e,e.anchorOffset(),0,"denom"),e.announce("moveDown");else if(e.parent().array){let a=ut(e.parent().array,s);a=yt(e.parent().array,a,1),a&&ft(e.parent().array,a)?(e.path[e.path.length-1].relation="cell"+ht(e.parent().array,a),$t(e,e.anchorOffset()),e.announce("moveDown")):Dt(e,1,t)}else e.announce("line");return!0}function Kt(e,t){let a=e.path[e.path.length-1].offset,i=0;const s=e.clone();i=e.extent+t;const o=a+i;if(o<0&&0!==i){if(e.path.length>1)return vt(e),e.path.pop(),Pt(e,-1),xt(e),e.announce("move",s),!0;a=e.path[e.path.length-1].offset,i=e.extent}else if(o>=e.siblings().length){if(e.path.length>1)return vt(e),e.path.pop(),e.path[e.path.length-1].offset-=1,Pt(e,1),xt(e),e.announce("move",s),!0;Rt(e)&&(a-=1),i-=1}return $t(e,a,i),e.announce("move",s),!0}function Et(e,t,a){var i;const s=null!==(i=(a=null!=a?a:{extend:!1}).extend)&&void 0!==i&&i;t=t<0?-1:1;const o=e.clone(),r=e.siblings(),n=e.focusOffset();let l=n+t;if(s&&(l=Math.min(Math.max(0,l),r.length-1)),l<0||l>=r.length)Dt(e,t,a);else{if(r[l]&&"text"===r[l].mode){if(l=function(e,t,a){a=a<0?-1:1;const i=e.siblings();if(!i[t])return t;if("text"!==i[t].mode)return t;let s;if(U.test(i[t].body)){let e,o=t;do{e="text"===i[o].mode&&U.test(i[o].body),o+=a}while(i[o]&&e);s=i[o]?o-2*a:o-a}else if(/\s/.test(i[t].body)){let e=t;for(;i[e]&&"text"===i[e].mode&&/\s/.test(i[e].body);)e+=a;if(i[e]){let t=!0;do{t="text"===i[e].mode&&!/\s/.test(i[e].body),e+=a}while(i[e]&&t);s=i[e]?e-2*a:e-a}else s=e-a}else{let e=t;for(;i[e]&&"text"===i[e].mode&&!/\s/.test(i[e].body);)e+=a;s=i[e]?e:e-a;let o=!0;for(;i[e]&&o;)o="text"===i[e].mode&&/\s/.test(i[e].body),o&&(s=e),e+=a;s=i[e]?e-2*a:e-a}return s-(a>0?0:1)}(e,l,t),l<0&&!s)return void $t(e,0);if(l>r.length)return $t(e,r.length-1),void Dt(e,t,a)}else{const e=r[l]?r[l].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let a="mopen"===e?1:-1;for(l+=t>0?1:-1;l>=0&&l0&&(l-=1)}else{for(;r[l]&&"math"===r[l].mode&&r[l].type===e;)l+=t;l-=t>0?1:0}}if(s){const t=e.anchorOffset();$t(e,t,l-t)}else $t(e,l);e.announce("move",o)}}function Ft(e,t=1,a){var i;a=null!=a?a:{extend:!1},t=t<0?-1:1;const s=e.clone(),o=[{relation:"body",offset:e.path[0].offset}];let r;return null!==(i=!a.extend)&&void 0!==i&&i?(o[0].offset=t<0?0:e.root.body.length-1,r=0):t<0?o[0].offset>0&&(r=-o[0].offset):o[0].offset=i)return $t(e,e.endOffset()-1,1),!0;$t(e,a,i-a)}else if("mord"===e.sibling(0).type&&/[0-9,.]/.test(e.sibling(0).body)){let a=e.startOffset(),i=e.endOffset();for(;St(t[a]);)a-=1;for(;St(t[i]);)i+=1;i-=1,$t(e,a,i-a)}else $t(e,0,"end");return!0}function Ot(e){return e.path=[{relation:"body",offset:0}],$t(e,0,"end")}function Rt(e){return 0===e.extent}function Pt(e,t){return e.extent=t,!0}function It(e){return 0!==e.extent&&($t(e,e.endOffset()),!0)}function Ht(e){return 0!==e.extent&&($t(e,e.startOffset()),!0)}function Wt(e){if(e.path.length>1){const t=e.clone();return e.path.pop(),Pt(e,0),e.announce("move",t),!0}return e.announce("plonk"),!1}function Vt(e){if(e.parent().array)return ft(e.parent().array,e.relation())[e.anchorOffset()];const t=e.siblings();return t[Math.min(t.length-1,e.anchorOffset())]}function Ut(e,t,a,i={extendToWordBoundary:!1}){const s=mt(t,a);if(0===s)return i.extendToWordBoundary?Ut(e,t=Xt(e,t,-1),a=Xt(e,a,1)):jt(e,pt(t),0);if(1===s){const s=a[a.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?Ut(e,t=Xt(e,t,s<0?1:-1),a=Xt(e,a,s<0?-1:1)):jt(e,pt(t),s)}let o=function(e,t){const a=[],i=Math.min(e.length-1,t.length-1);let s=0;for(;s<=i&&e[s].relation===t[s].relation&&e[s].offset===t[s].offset;)a.push(e[s]),s+=1;return a}(t,a);const r=o.length;if(t.length===r||a.length===r||t[r].relation!==a[r].relation)return jt(e,o,-1);o.push(t[r]),o=pt(o);let n=a[r].offset-t[r].offset+1;return n<=0?a.length>r+1?(o[r].relation=a[r].relation,o[r].offset=a[r].offset,o[o.length-1].offset-=1,n=2-n):(o[r].relation=a[r].relation,o[r].offset=a[r].offset,n=1-n):a.length<=t.length?o[o.length-1].offset-=1:a.length>t.length&&(o[r].offset-=1),jt(e,o,n)}function jt(t,a,i=0){let s;if("string"==typeof a)s=dt(a);else if(e(a)){const e=pt(a),o=t.path;t.path=e,0===i&&"placeholder"===Vt(t).type&&(e[e.length-1].offset=t.anchorOffset()-1,i=1),s={path:e,extent:i||0},t.path=o}else s=a;const o=0!==mt(t.path,s.path),r=s.extent!==t.extent;return(o||r)&&(o&&Zt(t),vt(t),t.path=pt(s.path),t.siblings().length=0?It(s):(Ht(s),Dt(s,1));const o=Vt(s);do{t.bind(s)(s.path,Vt(s))&&i.push(s.toString()),a>=0?zt(s,{iterateAll:!0}):_t(s,{iterateAll:!0})}while(o!==Vt(s));return i}const Jt="apple"===aa()?{id:"apple.en-intl",displayName:"English (international)",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","∫","ı"],KeyC:["c","C","ç","Ç"],KeyD:["d","D","∂","Î"],KeyE:["e","E","´","´"],KeyF:["f","F","ƒ","Ï"],KeyG:["g","G","©","˝"],KeyH:["h","H","˙","Ó"],KeyI:["i","I","ˆ","ˆ"],KeyJ:["j","J","∆","Ô"],KeyK:["k","K","˚",""],KeyL:["l","L","¬","Ò"],KeyM:["m","M","µ","Â"],KeyN:["n","N","˜","˜"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","π","∏"],KeyQ:["q","Q","œ","Œ"],KeyR:["r","R","®","‰"],KeyS:["s","S","ß","Í"],KeyT:["t","T","†","ˇ"],KeyU:["u","U","¨","¨"],KeyV:["v","V","√","◊"],KeyW:["w","W","∑","„"],KeyX:["x","X","≈","˛"],KeyY:["y","Y","¥","Á"],KeyZ:["z","Z","Ω","¸"],Digit1:["1","!","¡","⁄"],Digit2:["2","@","™","€"],Digit3:["3","#","£","‹"],Digit4:["4","$","¢","›"],Digit5:["5","%","∞","fi"],Digit6:["6","ˆ","§","fl"],Digit7:["7","&","¶","‡"],Digit8:["8","*","•","°"],Digit9:["9","(","ª","·"],Digit0:["0",")","º","‚"],Space:[" "," "," "," "],Minus:["-","_","–","—"],Equal:["=","+","≠","±"],BracketLeft:["[","{","“","”"],BracketRight:["]","}","‘","’"],Backslash:["\\","|","«","»"],Semicolon:[";",":","…","Ú"],Quote:["'",'"',"æ","Æ"],Backquote:["`","˜","`","`"],Comma:[",","<","≤","¯"],Period:[".",">","≥","˘"],Slash:["/","?","÷","¿"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["§","±","§","±"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}}:"windows"===aa()?{id:"windows.en-intl",displayName:"English (international)",platform:"windows",locale:"en",score:0,mapping:{KeyA:["a","A","á","Á"],KeyB:["b","B","",""],KeyC:["c","C","©","¢"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","é","É"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","í","Í"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","ø","Ø"],KeyM:["m","M","µ",""],KeyN:["n","N","ñ","Ñ"],KeyO:["o","O","ó","Ó"],KeyP:["p","P","ö","Ö"],KeyQ:["q","Q","ä","Ä"],KeyR:["r","R","®",""],KeyS:["s","S","ß","§"],KeyT:["t","T","þ","Þ"],KeyU:["u","U","ú","Ú"],KeyV:["v","V","",""],KeyW:["w","W","å","Å"],KeyX:["x","X","",""],KeyY:["y","Y","ü","Ü"],KeyZ:["z","Z","æ","Æ"],Digit1:["1","!","¡","¹"],Digit2:["2","@","²",""],Digit3:["3","#","³",""],Digit4:["4","$","¤","£"],Digit5:["5","%","€",""],Digit6:["6","^","¼",""],Digit7:["7","&","½",""],Digit8:["8","*","¾",""],Digit9:["9","(","‘",""],Digit0:["0",")","’",""],Space:[" "," ","",""],Minus:["-","_","¥",""],Equal:["=","+","×","÷"],BracketLeft:["[","{","«",""],BracketRight:["]","}","»",""],Backslash:["\\","|","¬","¦"],Semicolon:[";",":","¶","°"],Quote:["'",'"',"´","¨"],Backquote:["`","~","",""],Comma:[",","<","ç","Ç"],Period:[".",">","",""],Slash:["/","?","¿",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}}:{id:"linux.en",displayName:"English",platform:"linux",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","¦"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},Qt={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},ea=[];let ta;function aa(){let e;return(null===navigator||void 0===navigator?void 0:navigator.platform)&&(null===navigator||void 0===navigator?void 0:navigator.userAgent)&&(/^(mac)/i.test(navigator.platform)?e="apple":/^(win)/i.test(navigator.platform)?e="windows":/(android)/i.test(navigator.userAgent)?e="linux":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="apple":/\bCrOS\b/i.test(navigator.userAgent)&&(e="linux")),e}function ia(e){e.platform===aa()&&ea.push(e)}function sa(e){ta=ea.find(t=>e.startsWith(t.locale))}function oa(){return null!=ta?ta:ea[0]}ia(Jt),ia({id:"apple.french",locale:"fr",displayName:"French",platform:"apple",score:0,mapping:{KeyA:["q","Q","‡","Ω"],KeyB:["b","B","ß","∫"],KeyC:["c","C","©","¢"],KeyD:["d","D","∂","∆"],KeyE:["e","E","ê","Ê"],KeyF:["f","F","ƒ","·"],KeyG:["g","G","fi","fl"],KeyH:["h","H","Ì","Î"],KeyI:["i","I","î","ï"],KeyJ:["j","J","Ï","Í"],KeyK:["k","K","È","Ë"],KeyL:["l","L","¬","|"],KeyM:[",","?","∞","¿"],KeyN:["n","N","~","ı"],KeyO:["o","O","œ","Œ"],KeyP:["p","P","π","∏"],KeyQ:["a","A","æ","Æ"],KeyR:["r","R","®","‚"],KeyS:["s","S","Ò","∑"],KeyT:["t","T","†","™"],KeyU:["u","U","º","ª"],KeyV:["v","V","◊","√"],KeyW:["z","Z","Â","Å"],KeyX:["x","X","≈","⁄"],KeyY:["y","Y","Ú","Ÿ"],KeyZ:["w","W","‹","›"],Digit1:["&","1","","´"],Digit2:["é","2","ë","„"],Digit3:['"',"3","“","”"],Digit4:["'","4","‘","’"],Digit5:["(","5","{","["],Digit6:["§","6","¶","å"],Digit7:["è","7","«","»"],Digit8:["!","8","¡","Û"],Digit9:["ç","9","Ç","Á"],Digit0:["à","0","ø","Ø"],Space:[" "," "," "," "],Minus:[")","°","}","]"],Equal:["-","_","—","–"],BracketLeft:["^","¨","ô","Ô"],BracketRight:["$","*","€","¥"],Backslash:["`","£","@","#"],Semicolon:["m","M","µ","Ó"],Quote:["ù","%","Ù","‰"],Backquote:["<",">","≤","≥"],Comma:[";",".","…","•"],Period:[":","/","÷","\\"],Slash:["=","+","≠","±"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","•","Ÿ"],NumpadEqual:["=","=","=","="]}}),ia({id:"linux.french",locale:"fr",displayName:"French",platform:"apple",score:0,mapping:{KeyA:["q","Q","@","Ω"],KeyB:["b","B","”","’"],KeyC:["c","C","¢","©"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","€","¢"],KeyF:["f","F","đ","ª"],KeyG:["g","G","ŋ","Ŋ"],KeyH:["h","H","ħ","Ħ"],KeyI:["i","I","→","ı"],KeyJ:["j","J","̉","̛"],KeyK:["k","K","ĸ","&"],KeyL:["l","L","ł","Ł"],KeyM:[",","?","́","̋"],KeyN:["n","N","n","N"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","þ","Þ"],KeyQ:["a","A","æ","Æ"],KeyR:["r","R","¶","®"],KeyS:["s","S","ß","§"],KeyT:["t","T","ŧ","Ŧ"],KeyU:["u","U","↓","↑"],KeyV:["v","V","“","‘"],KeyW:["z","Z","«","<"],KeyX:["x","X","»",">"],KeyY:["y","Y","←","¥"],KeyZ:["w","W","ł","Ł"],Digit1:["&","1","¹","¡"],Digit2:["é","2","~","⅛"],Digit3:['"',"3","#","£"],Digit4:["'","4","{","$"],Digit5:["(","5","[","⅜"],Digit6:["-","6","|","⅝"],Digit7:["è","7","`","⅞"],Digit8:["_","8","\\","™"],Digit9:["ç","9","^","±"],Digit0:["à","0","@","°"],Enter:["\r","\r","\r","\r"],Escape:["","","",""],Backspace:["\b","\b","\b","\b"],Tab:["\t","","\t",""],Space:[" "," "," "," "],Minus:[")","°","]","¿"],Equal:["=","+","}","̨"],BracketLeft:["̂","̈","̈","̊"],BracketRight:["$","£","¤","̄"],Backslash:["*","µ","̀","̆"],Semicolon:["m","M","µ","º"],Quote:["ù","%","̂","̌"],Backquote:["²","~","¬","¬"],Comma:[";",".","─","×"],Period:[":","/","·","÷"],Slash:["!","§","̣","̇"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","¦"]}}),ia({id:"windows.french",locale:"fr",displayName:"French",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","€",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["é","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["è","7","`",""],Digit8:["_","8","\\",""],Digit9:["ç","9","^",""],Digit0:["à","0","@",""],Space:[" "," ","",""],Minus:[")","°","]",""],Equal:["=","+","}",""],BracketLeft:["^","¨","",""],BracketRight:["$","£","¤",""],Backslash:["*","µ","",""],Semicolon:["m","M","",""],Quote:["ù","%","",""],Backquote:["²","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","§","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}}),ia({id:"windows.german",locale:"de",displayName:"German",platform:"windows",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","€",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","µ",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"²",""],Digit3:["3","§","³",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["ß","?","\\","ẞ"],Equal:["´","`","",""],BracketLeft:["ü","Ü","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["ö","Ö","",""],Quote:["ä","Ä","",""],Backquote:["^","°","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}}),ia({id:"apple.german",locale:"de",displayName:"German",platform:"apple",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","∫","‹"],KeyC:["c","C","ç","Ç"],KeyD:["d","D","∂","™"],KeyE:["e","E","€","‰"],KeyF:["f","F","ƒ","Ï"],KeyG:["g","G","©","Ì"],KeyH:["h","H","ª","Ó"],KeyI:["i","I","⁄","Û"],KeyJ:["j","J","º","ı"],KeyK:["k","K","∆","ˆ"],KeyL:["l","L","@","fl"],KeyM:["m","M","µ","˘"],KeyN:["n","N","~","›"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","π","∏"],KeyQ:["q","Q","«","»"],KeyR:["r","R","®","¸"],KeyS:["s","S","‚","Í"],KeyT:["t","T","†","˝"],KeyU:["u","U","¨","Á"],KeyV:["v","V","√","◊"],KeyW:["w","W","∑","„"],KeyX:["x","X","≈","Ù"],KeyY:["z","Z","Ω","ˇ"],KeyZ:["y","Y","¥","‡"],Digit1:["1","!","¡","¬"],Digit2:["2",'"',"“","”"],Digit3:["3","§","¶","#"],Digit4:["4","$","¢","£"],Digit5:["5","%","[","fi"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","˜"],Digit9:["9",")","}","·"],Digit0:["0","=","≠","¯"],Space:[" "," "," "," "],Minus:["ß","?","¿","˙"],Equal:["´","`","'","˚"],BracketLeft:["ü","Ü","•","°"],BracketRight:["+","*","±",""],Backslash:["#","'","‘","’"],Semicolon:["ö","Ö","œ","Œ"],Quote:["ä","Ä","æ","Æ"],Backquote:["<",">","≤","≥"],Comma:[",",";","∞","˛"],Period:[".",":","…","÷"],Slash:["-","_","–","—"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","°","„","“"],NumpadEqual:["=","=","=","="]}});const ra=[{key:"ctrl+alt+e",command:["insert","\\text{cmd+alt+e}"]},{key:"cmd+alt+a",command:["insert","\\text{cmd+alt+a}"]},{key:"ctrl+alt+a",command:["insert","\\text{ctrl+alt+a}"]},{key:"meta+alt+2",command:["insert","\\text{meta+alt+2}"]},{key:"ctrl+alt+shift+a",command:["insert","\\text{ctrl+alt+shift+a}"]},{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendToPreviousChar"},{key:"shift+[ArrowRight]",command:"extendToNextChar"},{key:"shift+[ArrowUp]",command:"extendUp"},{key:"shift+[ArrowDown]",command:"extendDown"},{key:"[Backspace]",command:"deletePreviousChar"},{key:"alt+[Delete]",command:"deletePreviousChar"},{key:"[Delete]",command:"deleteNextChar"},{key:"alt+[Backspace]",command:"deleteNextChar"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"alt+shift+[ArrowLeft]",command:"extendToPreviousWord"},{key:"alt+shift+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"ctrl+shift+[ArrowLeft]",command:"extendToGroupStart"},{key:"ctrl+shift+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Space]",ifMode:"math",command:"moveAfterParent"},{key:"shift+[Space]",ifMode:"math",command:"moveBeforeParent"},{key:"[Home]",command:"moveToMathFieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathFieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"cmd+shift+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathFieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathFieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"cmd+shift+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",ifMode:"math",command:"moveToNextPlaceholder"},{key:"shift+[Tab]",ifMode:"math",command:"moveToPreviousPlaceholder"},{key:"[Tab]",ifMode:"text",command:"moveToNextPlaceholder"},{key:"shift+[Tab]",ifMode:"text",command:"moveToPreviousPlaceholder"},{key:"[Escape]",ifMode:"math",command:["switch-mode","command"]},{key:"\\",ifMode:"math",command:["switch-mode","command"]},{key:"alt+[Equal]",ifMode:"math",command:["applyStyle",{mode:"text"}]},{key:"alt+[Equal]",ifMode:"text",command:["applyStyle",{mode:"math"}]},{key:"[Escape]",ifMode:"command",command:["complete",{discard:!0}]},{key:"[Tab]",ifMode:"command",command:["complete",{acceptSuggestion:!0}]},{key:"[Return]",ifMode:"command",command:"complete"},{key:"[Enter]",ifMode:"command",command:"complete"},{key:"shift+[Escape]",ifMode:"command",command:["complete",{discard:!0}]},{key:"[ArrowDown]",ifMode:"command",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"command",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deletePreviousChar"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"[Undo]",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"cmd+shift+y",command:"redo"},{key:"ctrl+shift+z",ifPlatform:"!macos",command:"redo"},{key:"cmd+shift+z",command:"redo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathFieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathFieldEnd"},{key:"ctrl+shift+b",ifPlatform:"macos",command:"extendToPreviousChar"},{key:"ctrl+shift+f",ifPlatform:"macos",command:"extendToNextChar"},{key:"ctrl+shift+p",ifPlatform:"macos",command:"extendUp"},{key:"ctrl+shift+n",ifPlatform:"macos",command:"extendDown"},{key:"ctrl+shift+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"ctrl+shift+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"ctrl+alt+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"ctrl+alt+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"ctrl+shift+alt+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"ctrl+shift+alt+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deletePreviousChar"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteNextChar"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"shift+[Quote]",ifMode:"math",command:["switchMode","text","","“"]},{key:"shift+[Quote]",ifMode:"text",command:["switch-mode","math","”",""]},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","$$\\sqrt{#0}$$"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Minus]",ifMode:"math",command:"moveToSubscript"},{key:"alt+[BracketLeft]",ifMode:"math",command:["insert","$$\\left\\lbrack #0 \\right\\rbrack$$"]},{key:"alt+shift+[BracketLeft]",ifMode:"math",command:["insert","$$\\left\\lbrace #0 \\right\\rbrace$$"]},{key:"[Return]",ifMode:"math",command:"addRowAfter"},{key:"[Enter]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Comma]",ifMode:"math",command:"addColumnAfter"},{key:"[Return]",ifMode:"text",command:"addRowAfter"},{key:"[Enter]",ifMode:"text",command:"addRowAfter"},{key:"ctrl+[Comma]",ifMode:"text",command:"addColumnAfter"},{key:"alt+p",ifMode:"math",command:["insert","$$\\pi$$"]},{key:"alt+v",ifMode:"math",command:["insert","$$\\sqrt{#0}$$"]},{key:"alt+w",ifMode:"math",command:["insert","$$\\sum_{i=#?}^{#?}$$"]},{key:"alt+u",ifMode:"math",command:["insert","$$\\cup$$"]},{key:"alt+n",ifMode:"math",command:["insert","$$\\cap$$"]},{key:"alt+o",ifMode:"math",command:["insert","$$\\emptyset$$"]},{key:"alt+d",ifMode:"math",command:["insert","$$\\differentialD$$"]},{key:"alt+shift+o",ifMode:"math",command:["insert","$$\\varnothing$$"]},{key:"alt+shift+d",ifMode:"math",command:["insert","$$\\partial$$"]},{key:"alt+shift+p",ifMode:"math",command:["insert","$$\\prod_{i=#?}^{#?}$$"]},{key:"alt+shift+u",ifMode:"math",command:["insert","$$\\bigcup$$"]},{key:"alt+shift+n",ifMode:"math",command:["insert","$$\\bigcap$$"]},{key:"alt+shift+a",ifMode:"math",command:["insert","$$\\forall$$"]},{key:"alt+shift+e",ifMode:"math",command:["insert","$$\\exists$$"]},{key:"alt+[Digit5]",ifMode:"math",command:["insert","$\\infty$$"]},{key:"alt+[Digit6]",ifMode:"math",command:["insert","$$\\wedge$$"]},{key:"alt+shift+[Digit6]",ifMode:"math",command:["insert","$$\\vee$$"]},{key:"alt+[Digit9]",ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifMode:"math",command:["insert",")"]},{key:"alt+shift+[Backslash]",ifMode:"math",command:["insert","|"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","$$\\backslash$$"]},{key:"[Slash]",ifMode:"math",command:["insert","$$\\frac{#@}{#?}$$"]},{key:"alt+[Slash]",ifMode:"math",command:["insert","$$\\frac{#?}{#@}$$"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","$$\\frac{#@}{#?}$$"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+[Backquote]",ifMode:"math",command:["insert","$$\\~$$"]},{key:"alt+shift+[Slash]",ifMode:"math",command:["insert","$$\\/$$"]},{key:"alt+shift+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleVirtualKeyboard"},{key:"ctrl+alt+[ArrowUp]",command:["speak","parent",{withHighlighting:!1}]},{key:"ctrl+alt+[ArrowDown]",command:["speak","all",{withHighlighting:!1}]}],na={"\\theta":"alt+q","\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\prod":"alt+shift+p","\\sum":"alt+w","\\int":"alt+b","\\cup":"alt+u","\\cap":"alt+n","\\bigcup":"alt+shift+u","\\bigcap":"alt+shift+n","\\forall":"alt+shift+a","\\exists":"alt+shift+e","\\infty":"alt+[Digit5]","\\wedge":"alt+[Digit5]","\\vee":"alt+shift+[Digit6]","\\differentialD":"alt+d","\\partial":"alt+shift+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"alt+shift+o","\\~":"~"};function la(e){if((null===navigator||void 0===navigator?void 0:navigator.platform)&&(null===navigator||void 0===navigator?void 0:navigator.userAgent)){let t;if(/^(mac)/i.test(navigator.platform)?t="macos":/^(win)/i.test(navigator.platform)?t="windows":/(android)/i.test(navigator.userAgent)?t="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?t="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(t="chromeos"),e.startsWith("!")&&!e.endsWith(t))return!0;if(e.endsWith(t))return!0}return!1}function ca(t){let a=t;return e(a)&&(a=a.length>0?a[0]+"("+a.slice(1).join("")+")":""),a}function da(e){const t=la("macos")||la("ios"),a=e.split("+");let i="";for(const e of a)!t&&i&&(i+='+'),e.startsWith("Key")?i+=e.substr(3,1):e.startsWith("Digit")?i+=e.substr(5,1):i+={cmd:"⌘",meta:t?"⌘":"command",shift:t?"⇧":"shift",alt:t?"⌥":"alt",ctrl:t?"⌃":"control","\n":t?"⏎":"return","[return]":t?"⏎":"return","[enter]":t?"⌤":"enter","[tab]":t?"⇥":"tab","[escape]":"esc","[backspace]":t?"⌫":"backspace","[delete]":t?"⌦":"del","[pageup]":t?"⇞":"page up","[pagedown]":t?"⇟":"page down","[home]":t?"⤒":"home","[end]":t?"⤓":"end","[space]":"space","[equal]":"=","[minus]":"-","[comma]":",","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",bracketLeft:"[",bracketRight:"]",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* 🔢",numpaddivide:"/ 🔢",numpadsubtract:"- 🔢",numpadadd:"+ 🔢",numpaddecimal:". 🔢",numpadcomma:", 🔢",help:"help",left:"⇠",up:"⇡",right:"⇢",down:"⇣","[arrowleft]":"⇠","[arrowup]":"⇡","[arrowright]":"⇢","[arrowdown]":"⇣","[digit0]":"0","[digit1]":"1","[digit2]":"2","[digit3]":"3","[digit4]":"4","[digit5]":"5","[digit6]":"6","[digit7]":"7","[digit8]":"8","[digit9]":"9"}[e.toLowerCase()]||e.toUpperCase();return i}function ma(e,t){const a=[],i=[];return e.forEach(e=>{try{const t=function(e){if(e.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(e.ifPlatform))throw new Error(`Unexpected platform "${e.ifPlatform}" for keybinding ${e.key}`);let t=e.key.split("+");const a=t.pop();let i=e.ifPlatform;if(t=t.map(e=>{const t=e.toLowerCase();if("cmd"===t){if(i&&"macos"!==i&&"ios"!==i)throw new Error('Unexpected "cmd" modifier with platform "'+i+'"');return i||(i=la("ios")?"ios":"macos"),"meta"}if("win"===t){if(i&&"windows"!==i)throw new Error('Unexpected "win" modifier with platform "'+i+'"');return i="windows","meta"}return t}),!i||la(i)){if(/^\[(.*)\]$/.test(a))t.push(a);else{const i=function(e){var t,a;const i=null!==(t=ea[0])&&void 0!==t?t:Jt;for(const[t,a]of Object.entries(i.mapping))if(a[0]===e)return"["+t+"]";return null!==(a=Qt[e])&&void 0!==a?a:""}(a);if(!i)throw new Error('Invalid keybinding key "'+e.key+'"');t.push(i)}return{...e,ifPlatform:i,key:t.join("+")}}}(e);t&&a.push(t)}catch(e){i.push(e.message)}}),i.length>0&&t(i),a}function pa(e,t,a,i){const s=t.split(" ");for(const t of s){const s=t.match(/(.*):(.*)/);if(s){const t=null!=i?i:{};"active"===s[2]?t.passive=!1:t[s[2]]=!0,e.addEventListener(s[1],a,t)}else e.addEventListener(t,a,i)}}function ha(e,t,a,i){const s=t.split(" ");for(const t of s){const s=t.match(/(.*):(.*)/);if(s){const t=null!=i?i:{};"active"===s[2]?t.passive=!1:t[s[2]]=!0,e.removeEventListener(s[1],a,t)}else e.removeEventListener(t,a,i)}}function ua(e,t){let a=document.getElementById(e);return a?a.setAttribute("data-refcount",Number(parseInt(a.getAttribute("data-refcount"))+1).toString()):(a=document.createElement("div"),a.setAttribute("aria-hidden","true"),a.setAttribute("data-refcount","1"),a.className=t,a.id=e,document.body.appendChild(a)),a}function fa(e){if(!e)return;const t=parseInt(e.getAttribute("data-refcount"));t<=1?e.remove():e.setAttribute("data-refcount",Number(t-1).toString())}function ga(e){return e.element&&e.element.mathfield===e}function ya(e){const t=function e(t){if(t.classList.contains("ML__caret")||t.classList.contains("ML__text-caret")||t.classList.contains("ML__command-caret"))return t;let a;for(const i of t.children)if(a=e(i),a)break;return a}(e);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}function ba(e){const t=e.querySelectorAll(".ML__selected");if(t&&t.length>0){const a={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(e=>{const t=e.getBoundingClientRect();t.lefta.right&&(a.right=t.right),t.bottom>a.bottom&&(a.bottom=t.bottom),t.top{if("mousedown"!==a.type||1===a.buttons){a.stopPropagation(),a.preventDefault(),t.classList.add("pressed"),i=Date.now(),"touchstart"===a.type&&(o=a.changedTouches[0].identifier);const r=t.getAttribute("data-"+e.config.namespace+"command-pressed");r&&e.$perform(JSON.parse(r));const l=t.getAttribute("data-"+e.config.namespace+"command-pressAndHoldStart");l&&(s=t,n&&clearTimeout(n),n=window.setTimeout((function(){t.classList.contains("pressed")&&e.$perform(JSON.parse(l))}),300))}}),pa(t,"mouseleave touchcancel",()=>{t.classList.remove("pressed")}),pa(t,"touchmove:passive",e=>{e.preventDefault();for(let t=0;t{1===e.buttons&&t.classList.add("pressed")}),pa(t,"mouseup touchend click",a=>{if(r){a.stopPropagation(),a.preventDefault();const e=r;return r=null,void e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0}))}if(t.classList.remove("pressed"),t.classList.add("active"),"click"===a.type&&0!==a.detail)return a.stopPropagation(),void a.preventDefault();window.setTimeout((function(){t.classList.remove("active")}),150);let o=t.getAttribute("data-"+e.config.namespace+"command-pressAndHoldEnd");const n=Date.now();(t!==s||nequal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function ka(t,a,i){if(!a||0===a.length)return void Ma(t);const s=a,o=function(e,t){const a=ot(e,"math",null,t.config.macros);return q(_(Ne({mathstyle:c.displaystyle,macros:t.config.macros},a),"ML__base"),"ML__mathlive").toMarkup()}(a,t),r=function(t){let a=xa[t]||"";return e(a)&&(a=a.join("
    ")),a}(s),n=function(t,a){let i=[];if("string"==typeof a){const t=na[a];e(t)?i=t.slice():t&&i.push(t)}const s=ca(a),o=new RegExp("^"+s.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return t.forEach(e=>{o.test(ca(e.command))&&i.push(e)}),i.map(da)}(t.keybindings,s).join("
    ");let l=i?'
    ':"";l+='',l+='
    '+o+"
    ",r&&(l+='
    '+r+"
    "),n&&(l+='
    '+n+"
    "),l+="
    ",l+=i?'
    ':"",function(e,t){e.popover.innerHTML=e.config.createHTML(t);const a=ya(e.field);a&&Sa(e,a),e.popover.classList.add("is-visible")}(t,l);let d=t.popover.getElementsByClassName("ML__popover__content");d&&d.length>0&&va(t,d[0],{default:["complete",{acceptSuggestion:!0}]}),d=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),d&&d.length>0&&va(t,d[0],"previousSuggestion"),d=t.popover.getElementsByClassName("ML__popover__next-shortcut"),d&&d.length>0&&va(t,d[0],"nextSuggestion")}function wa(e,t){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(null==t?void 0:t.deferred)window.requestAnimationFrame(()=>wa(e));else if(Vt(e.model)&&"command"===Vt(e.model).type){const t=ya(e.field);t&&Sa(e,t)}else Ma(e)}function Sa(e,t){const a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,s=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,r=e.virtualKeyboardVisible?e.virtualKeyboard.offsetHeight:0;t.x+e.popover.offsetWidth/2>i-s?e.popover.style.left=i-e.popover.offsetWidth-s+"px":t.x-e.popover.offsetWidth/2<0?e.popover.style.left=0:e.popover.style.left=t.x-e.popover.offsetWidth/2+"px",t.y+e.popover.offsetHeight+5>a-o-r?(e.popover.classList.add("reverse-direction"),e.popover.style.top=t.y-t.height-e.popover.offsetHeight-5+"px"):(e.popover.classList.remove("reverse-direction"),e.popover.style.top=t.y+5+"px")}function Ma(e){e.popover.classList.remove("is-visible")}function La(e,t=!1){let a="";const i=Mt(e);if(i){const s=t?e.anchorOffset()+1:i.end,o=e.siblings();for(let e=i.start;e"placeholder"===e.type));Pt(e,0),e.path[e.path.length-1].offset=a.start-1,0!==i.length&&At(e,1,!1)||$t(e,a.start+t.length-1)}else e.siblings().splice(a.start,a.end-a.start),$t(e,a.start-1,0);wt(e)}}const $a={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function za(e){return e.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function _a(e,t){return e&&t.generateID?' extid="'+e+'"':""}function Da(e,t,a){let i=!1;t=t||e.atoms.length;let s="",o="",r=-1,n=-1;const l=e.atoms[e.index];if(e.index0){if(i=!0,qa(e)&&(r=e.index,e.index+=1),Ta(e)&&(n=e.index,e.index+=1),r>=0&&n>=0)s=""+o,s+=Oa(e.atoms[n].subscript,0,0,a).mathML,s+=Oa(e.atoms[r].superscript,0,0,a).mathML,s+="";else if(r>=0){if(s=""+o,qa(e)){const t=Oa(e.atoms[r].superscript,0,0,a).mathML,i=Oa(e.atoms[r+1].superscript,0,0,a).mathML;s+=""!==t&&""!==t||""!==i&&""!==i?""===t||""===t?"":t:""}else s+=Oa(e.atoms[r].superscript,0,0,a).mathML;s+=""}else n>=0?(s=""+o,s+=Oa(e.atoms[n].subscript,0,0,a).mathML,s+=""):s=o;"mi"!==e.lastType&&"mn"!==e.lastType&&"mtext"!==e.lastType&&"fence"!==e.lastType||/^(.*)<\/mo>$/.test(s)||(s=""+s),o.endsWith(">f")||o.endsWith(">g")?(s+="&x2061;",e.lastType="applyfunction"):e.lastType=/^(.*)<\/mo>$/.test(s)?"mo":"mi",e.mathML+=s}return i}function qa(e){return e.index"+e,s+=Oa(o.subscript,0,0,a).mathML,s+=Oa(o.superscript,0,0,a).mathML,s+=""):o.superscript?(s=""+e,s+=Oa(o.superscript,0,0,a).mathML,s+=""):o.subscript&&(s=""+e,s+=Oa(o.subscript,0,0,a).mathML,s+=""),s.length>0&&(i=!0,t.mathML+=s,t.lastType=""),i))}function Ea(e,t,a){let i=!1;t=t||e.atoms.length;const s=e.index;let o="";for(;e.index0&&(i=!0,o=""+o+"",e.mathML+=o,e.lastType="mtext"),i}function Fa(e,t,a){let i=!1;t=t||e.atoms.length;const s=e.index;let o="",r=function(e){let t=-1,a=e.index,i=!1,s=!1;for(;a=0&&r=0;)o+=e.atoms[e.index].body,e.index+=1;return o.length>0&&(i=!0,o=""+o+"",r<0&&qa(e)&&(r=e.index,e.index+=1),r>=0&&(o=""+o,o+=Oa(e.atoms[r].superscript,0,0,a).mathML,o+=""),e.mathML+=o,e.lastType="mn"),i}function Na(e,t,a){let i=!1;t=t||e.atoms.length;let s="",o="";if(e.index",s+=Ra(e.atoms[l],a),s+=Oa(e.atoms,l+1,c,a).mathML,s+=Ra(e.atoms[c],a),s+="","mi"!==e.lastType&&"mn"!==e.lastType&&"mfrac"!==e.lastType&&"fence"!==e.lastType||(s=""+s),e.index=c+1,Ka(s,e,a)&&(i=!0,e.lastType="",s=""),o="fence")}return s.length>0&&(i=!0,e.mathML+=s,e.lastType=o),i}function Ba(e,t,a){let i=!1;t=t||e.atoms.length;let s="",o="";const r=e.atoms[e.index];if(e.index":"")+e,s+=Oa(r.subscript,0,0,a).mathML,s+=Oa(r.superscript,0,0,a).mathML,s+="nolimits"!==r.limits?"":""):r.superscript?(s+=("nolimits"!==r.limits?"":"")+e,s+=Oa(r.superscript,0,0,a).mathML,s+="nolimits"!==r.limits?"":""):(s+=("nolimits"!==r.limits?"":"")+e,s+=Oa(r.subscript,0,0,a).mathML,s+="nolimits"!==r.limits?"":""),o="mo"}else{const t=e.atoms[e.index],r="\\operatorname"===t.symbol,n=r?'"+Pa(t.body)+"":Ra(t,a);s+=n,e.index+=1,Ka(s,e,a)&&(i=!0,e.lastType="",s=""),e.index-=1,r||/^(.*)<\/mo>$/.test(n)?o=r?"mi":"mo":(s+="",o="applyfunction")}"mi"!==e.lastType&&"mn"!==e.lastType||/^(.*)<\/mo>$/.test(s)||(s=""+s),e.index+=1}return s.length>0&&(i=!0,e.mathML+=s,e.lastType=o),i}function Oa(e,t,a,i){const s={atoms:e,index:null!=t?t:0,mathML:"",lastType:""};if("number"==typeof e||"boolean"==typeof e)s.mathML=e.toString();else if("string"==typeof e)s.mathML=e;else if(e instanceof Be)s.mathML=Ia(e,i);else if(Array.isArray(e)){let t=0;for(a=null!=a?a:e?e.length:0;s.index0&&"genfrac"===s.atoms[s.index].type&&(e=""+e),"genfrac"===s.atoms[s.index].type?s.lastType="mfrac":s.lastType="",e.length>0&&(s.mathML+=e,t+=1),s.index+=1}t>1&&(s.mathML=""+s.mathML+"")}return s}function Ra(e,t){let a="";const i=Pa(e.body);return i&&(a=""+i+""),a}function Pa(e){if(!e)return"";if("string"==typeof e)return za(e);if(!Array.isArray(e)&&"string"==typeof e.body)return za(e.body);let t="";for(const a of e)"string"==typeof a.body&&(t+=a.body);return za(t)}function Ia(e,t){const a={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋"},i={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},s={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let o,r,n,l,c,d,m="",p="",h={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[e.fontFamily||e.font]||"";h&&(h=' mathvariant="'+h+'"');const u=e.symbol;if("text"===e.mode)m=""+e.body+"";else switch(e.type){case"first":break;case"group":case"root":m=Oa(e.body,0,0,t).mathML;break;case"array":if((e.lFence&&"."!==e.lFence||e.rFence&&"."!==e.rFence)&&(m+="",e.lFence&&"."!==e.lFence&&(m+=""+($a[e.lFence]||e.lFence)+"")),m+="",o=0;o"+Oa(e.array[r][o],0,0,t).mathML+"";m+=""}m+="",(e.lFence&&"."!==e.lFence||e.rFence&&"."!==e.rFence)&&(e.rFence&&"."!==e.rFence&&(m+=""+($a[e.lFence]||e.rFence)+""),m+="");break;case"genfrac":(e.leftDelim||e.rightDelim)&&(m+=""),e.leftDelim&&"."!==e.leftDelim&&(m+=""+($a[e.leftDelim]||e.leftDelim)+""),e.hasBarLine?(m+="",m+=Oa(e.numer,0,0,t).mathML||" ",m+=Oa(e.denom,0,0,t).mathML||" ",m+=""):(m+="",m+=""+Oa(e.numer,0,0,t).mathML+"",m+=""+Oa(e.denom,0,0,t).mathML+"",m+=""),e.rightDelim&&"."!==e.rightDelim&&(m+=""+($a[e.rightDelim]||e.rightDelim)+""),(e.leftDelim||e.rightDelim)&&(m+="");break;case"surd":e.index?(m+="",m+=Oa(e.body,0,0,t).mathML,m+=Oa(e.index,0,0,t).mathML,m+=""):(m+="",m+=Oa(e.body,0,0,t).mathML,m+="");break;case"leftright":m="",e.leftDelim&&"."!==e.leftDelim&&(m+=""+($a[e.leftDelim]||e.leftDelim)+""),e.body&&(m+=Oa(e.body,0,0,t).mathML),e.rightDelim&&"."!==e.rightDelim&&(m+=""+($a[e.rightDelim]||e.rightDelim)+""),m+="";break;case"sizeddelim":case"delim":m+='"+($a[e.delim]||e.delim)+"";break;case"accent":m+='",m+=Oa(e.body,0,0,t).mathML,m+=""+($a[u]||e.accent)+"",m+="";break;case"line":case"overlap":break;case"overunder":c=e.overscript,l=e.underscript,(e.svgAbove||c)&&(e.svgBelow||l)?d=e.body:c?(d=e.body,e.body&&e.body[0]&&e.body[0].underscript?(l=e.body[0].underscript,d=e.body[0].body):e.body&&e.body[0]&&"first"===e.body[0].type&&e.body[1]&&e.body[1].underscript&&(l=e.body[1].underscript,d=e.body[1].body)):l&&(d=e.body,e.body&&e.body[0]&&e.body[0].overscript?(c=e.body[0].overscript,d=e.body[0].body):e.body&&e.body[0]&&"first"===e.body[0].type&&e.body[1]&&e.body[1].overscript&&(c=e.body[1].overscript,d=e.body[1].body)),(e.svgAbove||c)&&(e.svgBelow||l)?(m+=``,m+=a[e.svgBody]||Oa(d,0,0,t).mathML,m+=a[e.svgBelow]||Oa(l,0,0,t).mathML,m+=a[e.svgAbove]||Oa(c,0,0,t).mathML,m+=""):e.svgAbove||c?(m+=``+(a[e.svgBody]||Oa(d,0,0,t).mathML),m+=a[e.svgAbove]||Oa(c,0,0,t).mathML,m+=""):(e.svgBelow||l)&&(m+=``+(a[e.svgBody]||Oa(d,0,0,t).mathML),m+=a[e.svgBelow]||Oa(l,0,0,t).mathML,m+="");break;case"placeholder":case"mord":{m=i[u]||u||("string"==typeof e.body?e.body:"");const a=u?u.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;a?m="&#x"+a[1]+";":m.length>0&&"\\"===m.charAt(0)&&(m="string"==typeof e.body&&e.body.charCodeAt(0)>255?"&#x"+("000000"+e.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof e.body?e.body.charAt(0):e.body);const s=/\d/.test(m)?"mn":"mi";m="<"+s+h+_a(e.id,t)+">"+za(m)+"";break}case"mbin":case"mrel":case"textord":case"minner":m=u&&i[u]?""+i[u]+"":u&&$a[u]?""+$a[u]+"":Ra(e,t);break;case"mpunct":m='"+($a[u]||u)+"";break;case"mop":"​"!==e.body&&(m="",m+="\\operatorname"===u?e.body:u||e.body,m+="");break;case"mathstyle":break;case"box":m='"+Oa(e.body,0,0,t).mathML+"";break;case"spacing":m+='';break;case"enclose":m=''+Oa(e.body,0,0,t).mathML+"";break;case"space":m+=" "}return m}function Ha(e,t){return Oa(e,0,0,t).mathML}function Wa(e){let t=0;for(let a=0;a{ga(e)&&e.dirty&&Ua(e)}))}function Ua(e,t){t=null!=t?t:{},e.dirty=!1,window.mathlive||(window.mathlive={}),Vt(e.model)||(e.model.path=[{relation:"body",offset:0}]),e.model.root.forEach(e=>{e.caret="",e.isSelected=!1,e.containsCaret=!1});const a=e.$hasFocus();if(Rt(e.model)?Vt(e.model).caret=a&&!e.config.readOnly?e.mode:"":Gt(e.model,e=>{e.isSelected=!0}),a&&!e.config.readOnly){let t=e.model.ancestor(1),a=1,i=!1;for(;t&&!i;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,i=!0),a+=1,t=e.model.ancestor(a)}const i=_(Ne({mathstyle:c.displaystyle,letterShapeStyle:e.config.letterShapeStyle,atomIdsSettings:{seed:Wa(e.model.root.toLatex(!1)),groupNumbers:t.forHighlighting},smartFence:e.config.smartFence,macros:e.config.macros},e.model.root),"ML__base");i.attributes={translate:"no","aria-hidden":"true"};const s=q(i,"ML__mathlive");e.field.innerHTML=e.config.createHTML(s.toMarkup(0,e.config.horizontalSpacingScale)),e.field.classList.toggle("ML__focused",a&&!e.config.readOnly),e.accessibleNode.innerHTML=e.config.createHTML(''+Ha(e.model.root,e.config)+"");const o=ba(e.field);if(o){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=o.left+"px",t.style.top=o.top+"px",t.style.width=Math.ceil(o.right-o.left)+"px",t.style.height=Math.ceil(o.bottom-o.top-1)+"px",e.field.insertBefore(t,e.field.childNodes[0])}}const ja={};function Ga(e,t){t=null!=t?t:{target:"mathfield",canUndo:!1},Object.keys(e).forEach(a=>{ja[a]={...t,fn:e[a]}})}function Za(e,t=",",a){if(!e)return[];let i,s=[];for(let o of e)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(i?s.push(i):i=new Be("math","mpunct",t,a),s=s.concat(o));return s}function Xa(t,a){const i=t.parent();if(i&&"array"===i.type&&e(i.array)){const e=t.relation();if(i.array){const s=ut(i.array,e);"after row"===a||"before row"===a?(s.col=0,s.row=s.row+("after row"===a?1:0),i.array.splice(s.row,0,[[]])):(s.col+="after column"===a?1:0,i.array[s.row].splice(s.col,0,[]));const o=ht(i.array,s);t.path.pop(),t.path.push({relation:"cell"+o.toString(),offset:0}),t.insertFirstAtom()}}}function Ya(e){var t;const a=e.parent();if("leftright"===a.type){a.type="array";const i=null!==(t={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[a.leftDelim])&&void 0!==t?t:"matrix",s=ie(i),o=[[a.body]];Object.assign(a,s.parser(i,[],o)),a.mode=Lt(e),a.environmentName=i,a.array=o,a.rowGaps=[0],delete a.body,e.path[e.path.length-1].relation="cell0"}}function Ja(e){return kt(e),Ya(e),Xa(e,"after row"),wt(e),!0}function Qa(e){return kt(e),Ya(e),Xa(e,"after column"),wt(e),!0}function ei(e,t=0){kt(e),vt(e);const a=e.suppressChangeNotifications;if(e.suppressChangeNotifications=!0,t=t<0?-1:t>0?1:t,nt(e),e.parent().array&&t<0&&0===e.startOffset()){const t=e.parent().array;if(function(e){const t={col:0,row:0};for(;t.row0){let e=t.length;"first"===t[0].type&&(e-=1),e>0&&(a+=1)}i.row+=1}return a}(t,a.col)&&(function(e,t){let a=0;for(;a"placeholder"!==e.type&&"first"!==e.type);e.parent()[t]=null,e.path.pop(),e.siblings().splice(e.anchorOffset(),0,...a),$t(e,e.anchorOffset()-1),e.announce("deleted: "+t)}else if("denom"===t){const t=e.parent().numer.filter(e=>"placeholder"!==e.type&&"first"!==e.type),a=e.parent().denom.filter(e=>"placeholder"!==e.type&&"first"!==e.type);e.path.pop(),e.siblings().splice(e.anchorOffset(),1,...a),e.siblings().splice(e.anchorOffset(),0,...t),$t(e,e.anchorOffset()+t.length-1),e.announce("deleted: denominator")}else if("body"===t){const t=e.siblings().filter(e=>"placeholder"!==e.type);e.path.length>1&&(t.shift(),e.path.pop(),e.siblings().splice(e.anchorOffset(),1,...t),$t(e,e.anchorOffset()-1),e.announce("deleted: root"))}else Dt(e,-1),ti(e,-1)}else if(t>0)if(a!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(e.sibling(1).type)?Dt(e,1):(e.announce("deleted",null,i.slice(a+1,a+2)),i.splice(a+1,1));else if("numer"===e.relation()){const t=e.parent().numer.filter(e=>"placeholder"!==e.type&&"first"!==e.type),a=e.parent().denom.filter(e=>"placeholder"!==e.type&&"first"!==e.type);e.path.pop(),e.siblings().splice(e.anchorOffset(),1,...a),e.siblings().splice(e.anchorOffset(),0,...t),$t(e,e.anchorOffset()+t.length-1),e.announce("deleted: numerator")}else Dt(e,1),ti(e,-1)}else{const t=e.startOffset()+1,a=e.endOffset()+1;e.announce("deleted",null,i.slice(t,a)),i.splice(t,a-t),$t(e,t-1)}lt(e),e.suppressChangeNotifications=a,xt(e),wt(e)}function ti(e,t=0){if(0===t)ei(e,0);else if(t>0)for(;t>0;)ei(e,1),t--;else for(;t<0;)ei(e,-1),t++;return!0}Ga({performWithFeedback:(e,t)=>function(e,t){return e.$focus(),e.config.keypressVibration&&(null===navigator||void 0===navigator?void 0:navigator.vibrate)&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,e=>e[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?e.returnKeypressSound?(e.returnKeypressSound.load(),e.returnKeypressSound.play().catch(e=>{})):e.keypressSound&&(e.keypressSound.load(),e.keypressSound.play().catch(e=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!e.deleteKeypressSound?e.keypressSound&&(e.keypressSound.load(),e.keypressSound.play().catch(e=>{})):(e.deleteKeypressSound.load(),e.deleteKeypressSound.play().catch(e=>{})),e.$perform(t)}(e,t)}),Ga({addRowAfter:Ja,addColumnAfter:Qa,addRowBefore:function(e){return kt(e),Ya(e),Xa(e,"before row"),wt(e),!0},addColumnBefore:function(e){return kt(e),Ya(e),Xa(e,"before column"),wt(e),!0}},{target:"model",category:"array-edit"});const ai={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},arcsin:{mode:"math",value:"\\arcsin"},arccos:{mode:"math",value:"\\arccos"},arctan:{mode:"math",value:"\\arctan"},sin:{mode:"math",value:"\\sin"},sinh:{mode:"math",value:"\\sinh"},cos:{mode:"math",value:"\\cos"},cosh:{mode:"math",value:"\\cosh"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},sec:{mode:"math",value:"\\sec"},csc:{mode:"math",value:"\\csc"},cot:{mode:"math",value:"\\cot"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ii(e,t,a){var i;return function(e,t){if(!t)return"";if("string"==typeof t)return t;if(!e)return t.value;let a=!1,i=!1,s=!1,o=!1,r=!1,n=!1,l=!1,c=!1,d=!1,m=!1,p=!1,h=!1,u=!1,f=!1,g=e[e.length-1],y=e.length-1;for(;g&&/msubsup|placeholder/.test(g.type);)y-=1,g=e[y];if(a=!g||"first"===g.type,g){if(void 0!==t.mode&&g.mode!==t.mode)return"";u="text"===g.mode,i=!u&&"mord"===g.type&&V.test(g.body),s=!u&&"mord"===g.type&&/[0-9]+$/.test(g.body),o=!u&&g.isFunction,r="genfrac"===g.type,n="surd"===g.type,l="mbin"===g.type,c="mrel"===g.type,d="mpunct"===g.type||"minner"===g.type,m=!!g.array,p="mopen"===g.type,h="mclose"===g.type||"leftright"===g.type,f="space"===g.type}return void 0!==t.after?/nothing/.test(t.after)&&a||/letter/.test(t.after)&&i||/digit/.test(t.after)&&s||/function/.test(t.after)&&o||/frac/.test(t.after)&&r||/surd/.test(t.after)&&n||/binop/.test(t.after)&&l||/relop/.test(t.after)&&c||/punct/.test(t.after)&&d||/array/.test(t.after)&&m||/openfence/.test(t.after)&&p||/closefence/.test(t.after)&&h||/text/.test(t.after)&&u||/space/.test(t.after)&&f?t.value:"":t.value}(e,null!==(i=null==a?void 0:a[t])&&void 0!==i?i:ai[t])}function si(e,t){if(!e)return["latex",""];if(e.length<=1)return["latex",e];if(!t||"ASCIIMath"!==t.format){const t=e.trim();if(t.startsWith("$$")&&t.endsWith("$$")||t.startsWith("\\[")&&t.endsWith("\\]")||t.startsWith("\\(")&&t.endsWith("\\)"))return["latex",t.substring(2,t.length-2)];if(t.startsWith("$")&&t.endsWith("$"))return["latex",t.substring(1,t.length-1)];if(e=e.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(e))return["latex",e]}return e=(e=(e=(e=(e=(e=e.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),[(null==t?void 0:t.format)||"ASCIIMath",oi(e,null!=t?t:{})]}function oi(e,t){var a,i,s,o,r,n,l;if(!e)return"";let c,d=!1;if(d||"^"!==e[0]&&"_"!==e[0]||(c=ri(e.substr(1),{inlineShortcuts:null!==(a=null==t?void 0:t.inlineShortcuts)&&void 0!==a?a:{},noWrap:!0}),e=e[0]+"{"+c.match+"}",e+=oi(c.rest,t),d=!0),d||(c=e.match(/^(sqrt|\u221a)(.*)/),c&&(c=ri(c[2],{inlineShortcuts:null!==(i=null==t?void 0:t.inlineShortcuts)&&void 0!==i?i:{},noWrap:!0}),e="\\sqrt{"+c.match+"}",e+=oi(c.rest,t),d=!0)),d||(c=e.match(/^(\\cbrt|\u221b)(.*)/),c&&(c=ri(c[2],{inlineShortcuts:null!==(s=null==t?void 0:t.inlineShortcuts)&&void 0!==s?s:{},noWrap:!0}),e="\\sqrt[3]{"+c.match+"}",e+=oi(c.rest,t),d=!0)),d||(c=e.match(/^abs(.*)/),c&&(c=ri(c[1],{inlineShortcuts:null!==(o=null==t?void 0:t.inlineShortcuts)&&void 0!==o?o:{},noWrap:!0}),e="\\left|"+c.match+"\\right|",e+=oi(c.rest,t),d=!0)),d||(c=e.match(/^["”“](.*?)["”“](.*)/),c&&(e="\\text{"+c[1]+"}",e+=oi(c[2],t),d=!0)),d||(c=e.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),c&&(e=ni(c[1],t),e+=oi(c[2],t),d=!0)),!d&&/^(f|g|h)[^a-zA-Z]/.test(e)&&(c=ri(e.substring(1),{inlineShortcuts:null!==(r=t.inlineShortcuts)&&void 0!==r?r:{},noWrap:!0}),e="("===e[1]?e[0]+"\\mleft("+c.match+"\\mright)":e[0]+c.match,e+=oi(c.rest,t),d=!0),d||(c=e.match(/^([a-zA-Z]+)(.*)/),c&&(e=ni(c[1],t),e+=oi(c[2],t),d=!0)),!d)if(c=ri(e,{inlineShortcuts:null!==(n=t.inlineShortcuts)&&void 0!==n?n:{},noWrap:!0}),c.match&&"/"===c.rest[0]){const a=ri(c.rest.substr(1),{inlineShortcuts:null!==(l=t.inlineShortcuts)&&void 0!==l?l:{},noWrap:!0});a.match&&(e="\\frac{"+c.match+"}{"+a.match+"}"+oi(a.rest,t)),d=!0}else c.match&&(e="("===e[0]?"\\left("+c.match+"\\right)"+oi(c.rest,t):c.match+oi(c.rest,t),d=!0);return d||(c=e.match(/^(\s+)(.*)$/),c&&(e=" "+oi(c[2],t),d=!0)),e}function ri(e,t){let a="",i=e=e.trim(),s=e.charAt(0),o={"(":")","{":"}","[":"]"}[s];if(o){let r=1,n=1;for(;n0;)e[n]===s&&r++,e[n]===o&&r--,n++;0===r?(t.noWrap&&"("===s?a=oi(e.substring(1,n-1),t):("{"===s&&"}"===o&&(s="\\{",o="\\}"),a="\\left"+s+oi(e.substring(1,n-1),t)+"\\right"+o),i=e.substring(n)):(a=e.substring(1,n),i="")}else{let s=e.match(/^([a-zA-Z]+)/);if(s){let a=ii(null,e,t.inlineShortcuts);if(a)return a=a.replace("_{#?}",""),a=a.replace("^{#?}",""),{match:a,rest:e.substring(a.length)}}if(s=e.match(/^([a-zA-Z])/),s)return{match:s[1],rest:e.substring(1)};if(s=e.match(/^(-)?\d+(\.\d*)?/),s)return{match:s[0],rest:e.substring(s[0].length)};/^\\(left|right)/.test(e)||(s=e.match(/^(\\[a-zA-Z]+)/),s&&(i=e.substring(s[1].length),a=s[1]))}return{match:a,rest:i}}function ni(e,t){let a=ii(null,e,t);return a?(a=a.replace("_{#?}",""),a=a.replace("^{#?}",""),a+=" "):a=e,a}function li(e,t,a){const i=e.parent();let s="leftright"===i.type?i.leftDelim+i.rightDelim:"";if("\\lbrace\\rbrace"===s&&(s="{}"),"\\{\\}"===s&&(s="{}"),"{}"===s&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return di(e,"\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:a}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrock");const o=I[t];if(o&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const s=Rt(e)||"placeholder"===Vt(e).type;i=e.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=s?"?":o;let r=[];return s&&(r=e.siblings().splice(e.anchorOffset()+1,e.siblings().length)),di(e,i,{mode:"math",format:"latex",style:a}),s&&(e.sibling(0).body=r,Dt(e,-1)),!0}let r;if(Object.keys(I).forEach(e=>{t===I[e]&&(r=e)}),r){if(i&&"leftright"===i.type&&e.endOffset()===e.siblings().length-1)return kt(e),i.rightDelim=t,Dt(e,1),wt(e),!0;const s=e.siblings();let o;for(o=e.endOffset();o>=0&&("leftright"!==s[o].type||"?"!==s[o].rightDelim);o--);if(o>=0)return kt(e),s[o].rightDelim=t,s[o].body=s[o].body.concat(s.slice(o+1,e.endOffset()+1)),s.splice(o+1,e.endOffset()-o),$t(e,o),wt(e),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){kt(e),i.rightDelim=t;const a=s.slice(e.endOffset()+1);return s.splice(e.endOffset()+1),e.path.pop(),e.siblings().splice(e.endOffset()+1,0,...a),wt(e),!0}const r=e.ancestor(2);return!(!r||"leftright"!==r.type||"?"!==r.rightDelim||e.endOffset()!==s.length-1)&&(Dt(e,1),li(e,t,a))}return!1}function ci(e,t){if(Rt(e))return!1;function a(t,a){let i=!0;return Gt(e,e=>{i=i&&e[t]===a},{recursive:!0}),i}return t.color&&a("color",t.color)&&(t.color="none"),t.backgroundColor&&a("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&a("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&a("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&a("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&a("fontSize",t.fontSize)&&(t.fontSize="size5"),kt(e),Gt(e,e=>e.applyStyle(t),{recursive:!0}),wt(e),!0}function di(e,t,a){var i,s,o,r;if(null!==(i=a.smartFence)&&void 0!==i&&i){if(li(e,t,a.style))return}else{const a=e.parent();if("leftright"===(null==a?void 0:a.type)&&"?"===a.rightDelim&&e.endOffset()===e.siblings().length-1&&/^[)}\]|]$/.test(t))return kt(e),a.rightDelim=t,Dt(e,1),void wt(e)}const n=e.suppressChangeNotifications;a.suppressChangeNotifications&&(e.suppressChangeNotifications=!0),kt(e);const l=e.suppressChangeNotifications;e.suppressChangeNotifications=!0,a.insertionMode||(a.insertionMode="replaceSelection"),a.selectionMode||(a.selectionMode="placeholder"),a.format||(a.format="auto"),a.macros=null!==(s=a.macros)&&void 0!==s?s:e.options.macros;const c=a.mode||Lt(e);let d;const m=[Nt(e)],p=null!==(o=a.placeholder)&&void 0!==o?o:"\\placeholder{}";m["?"]=p,"replaceSelection"!==a.insertionMode||Rt(e)?"replaceAll"===a.insertionMode?(e.root.body=[],e.root.latex="",e.path=[{relation:"body",offset:0}],e.extent=0):"insertBefore"===a.insertionMode?Ht(e):"insertAfter"===a.insertionMode&&It(e):ti(e);const h=e.siblings(),u=e.startOffset();if(u+10&&h[u]&&"placeholder"===h[u].type&&ti(e,-1),"math"===c&&"ASCIIMath"===a.format)[,t]=si(t,{format:"ASCIIMath"}),d=ot(t,"math",null,null==a?void 0:a.macros,!1,e.listeners.onError),pi(e,d);else if("text"===c||"auto"!==a.format&&"latex"!==a.format)"text"!==c&&"text"!==a.format||(d=ot(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),"text",m,a.macros,!1,e.listeners.onError));else if("command"===c){d=[];for(const e of t)W.test(e)&&d.push(new Be("command","command",e))}else if(""===t)d=[new Be("command","command","\\")];else{if("auto"===a.format&&([a.format,t]=si(t)),m[0])t=t.replace(/(^|[^\\])#@/g,"$1#0");else if(/(^|[^\\])#@/.test(t)){const a=function(e){const t=e.siblings();let a=e.startOffset();if("text"===t[a].mode)for(;a>=1&&"text"===t[a].mode;)a--;else for(;a>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[a].type);)a--;return a}(e);t=t.replace(/(^|[^\\])#@/g,"$1"+function(e,t,a){const i=e.siblings();if(rt(i))return"";if("first"===i[0].type&&0===t&&(t=1),"root"===e.parent().type&&1===t&&a===i.length-1)return e.parent().toLatex(!1);let s="",o=t;for(;o<=a;)s+=i[o].toLatex(!1),o++;return s}(e,a+1,e.startOffset())),function(e,t){t>0?e.siblings().splice(e.anchorOffset()+1,t):(e.siblings().splice(e.anchorOffset()+t+1,-t),$t(e,e.anchorOffset()+t))}(e,a-e.startOffset())}else t=t.replace(/(^|[^\\])#@/g,"$1#?");/^\$\$(.*)\$\$$/.test(t)&&(t=t.substring(2,t.length-2)),d=ot(t,c,m,a.macros,null!==(r=a.smartFence)&&void 0!==r&&r,e.listeners.onError),"latex"!==a.format&&pi(e,d)}lt(e),function e(t,a){t&&a&&(Re(t)?t.forEach(t=>e(t,a)):"object"==typeof t&&(t.color||t.backgroundColor||t.fontFamily||t.fontShape||t.fontSeries||t.fontSize||(t.applyStyle(a),e(t.body,a),e(t.numer,a),e(t.denom,a),e(t.index,a),e(t.overscript,a),e(t.underscript,a),e(t.subscript,a),e(t.superscript,a))))}(d,a.style);const f=e.parent();if("latex"!==a.format&&e.options.removeExtraneousParentheses&&f&&"leftright"===f.type&&"("===f.leftDelim&&rt(f.body)&&d&&1===d.length&&"genfrac"===d[0].type?(e.path.pop(),e.siblings()[e.anchorOffset()]=d[0]):("latex"!==a.format||1!==m.length||m[0]||"root"===f.type&&rt(f.body)&&(f.latex=t),Array.prototype.splice.apply(e.siblings(),[e.anchorOffset()+1,0].concat(d))),e.insertFirstAtom(),e.suppressChangeNotifications=l,"placeholder"===a.selectionMode){let t=[];for(const e of d)t=t.concat(e.filter(e=>"placeholder"===e.type));0!==t.length&&At(e,1,!1)?e.announce("move"):$t(e,e.anchorOffset()+d.length)}else"before"===a.selectionMode||("after"===a.selectionMode?$t(e,e.anchorOffset()+d.length):"item"===a.selectionMode&&$t(e,e.anchorOffset(),d.length));wt(e),e.suppressChangeNotifications=n}function mi(e){if(e)return 1===e.length&&"leftright"===e[0].type&&"("===e[0].leftDelim&&(e=e[0].body),e}function pi(e,t){if(t&&e.options.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Re(t[e].body)){let a=0,i=0,s=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(a++,i=o),"first"!==t[e].body[o].type&&s++;0===s&&1===a&&(t[e]=t[e].body[i])}t.forEach(t=>{if("genfrac"===t.type&&(pi(e,t.numer),pi(e,t.denom),t.numer=mi(t.numer),t.denom=mi(t.denom)),t.superscript&&(pi(e,t.superscript),t.superscript=mi(t.superscript)),t.subscript&&(pi(e,t.subscript),t.subscript=mi(t.subscript)),t.underscript&&(pi(e,t.underscript),t.underscript=mi(t.underscript)),t.overscript&&(pi(e,t.overscript),t.overscript=mi(t.overscript)),t.index&&(pi(e,t.index),t.index=mi(t.index)),"surd"===t.type?(pi(e,t.body),t.body=mi(t.body)):Re(t.body)&&pi(e,t.body),t.array)for(let a=gt(t.array);a>=0;a--)pi(e,ft(t.array,a))})}}function hi(e){if(It(e),!Vt(e).superscript)if(Vt(e).subscript)Vt(e).superscript=[new Be("","first")];else{const t=e.sibling(1);(null==t?void 0:t.superscript)?e.path[e.path.length-1].offset+=1:(null==t?void 0:t.subscript)?(e.path[e.path.length-1].offset+=1,Vt(e).superscript=[new Be("","first")]):("limits"!==Vt(e).limits&&(e.siblings().splice(e.anchorOffset()+1,0,new Be(e.parent().mode,"msubsup","​",Ct(e))),e.path[e.path.length-1].offset+=1),Vt(e).superscript=[new Be("","first")])}return e.path.push({relation:"superscript",offset:0}),Bt(e),!0}Ga({moveToOpposite:e=>{const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[e.relation()];return t||hi(e),e.parent()[t]||(e.parent()[t]=[new Be("","first")]),$t(e,0,"end",t),!0},moveBeforeParent:e=>e.path.length>1?(e.path.pop(),$t(e,e.anchorOffset()-1),!0):(e.announce("plonk"),!1),moveAfterParent:e=>Wt(e),moveToNextPlaceholder:e=>At(e,1),moveToPreviousPlaceholder:e=>At(e,-1),moveToNextChar:e=>Dt(e,1),moveToPreviousChar:e=>Dt(e,-1),moveUp:e=>qt(e),moveDown:e=>Tt(e),moveToNextWord:e=>Et(e,1),moveToPreviousWord:e=>Et(e,-1),moveToGroupStart:e=>$t(e,0),moveToGroupEnd:e=>$t(e,-1),moveToMathFieldStart:e=>Ft(e,-1),moveToMathFieldEnd:e=>Ft(e,1),moveToSuperscript:e=>hi(e),moveToSubscript:e=>function(e){if(It(e),!Vt(e).subscript)if(Vt(e).superscript)Vt(e).subscript=[new Be("","first")];else{const t=e.sibling(1);(null==t?void 0:t.subscript)?e.path[e.path.length-1].offset+=1:(null==t?void 0:t.superscript)?(e.path[e.path.length-1].offset+=1,Vt(e).subscript=[new Be("","first")]):("limits"!==Vt(e).limits&&(e.siblings().splice(e.anchorOffset()+1,0,new Be(e.parent().mode,"msubsup","​",Ct(e))),e.path[e.path.length-1].offset+=1),Vt(e).subscript=[new Be("","first")])}return e.path.push({relation:"subscript",offset:0}),Bt(e),!0}(e)},{target:"model",category:"selection-anchor"}),Ga({selectGroup:e=>Bt(e),selectAll:e=>Ot(e),extendToNextChar:e=>Kt(e,1),extendToPreviousChar:e=>Kt(e,-1),extendToNextWord:e=>Et(e,1,{extend:!0}),extendToPreviousWord:e=>Et(e,-1,{extend:!0}),extendUp:e=>qt(e,{extend:!0}),extendDown:e=>Tt(e,{extend:!0}),extendToNextBoundary:e=>Et(e,1,{extend:!0}),extendToPreviousBoundary:e=>Et(e,-1,{extend:!0}),extendToGroupStart:e=>Pt(e,-e.anchorOffset()),extendToGroupEnd:e=>Pt(e,e.siblings().length-e.anchorOffset()),extendToMathFieldStart:e=>Ft(e,-1,{extend:!0}),extendToMathFieldEnd:e=>Ft(e,1,{extend:!0})},{target:"model",category:"selection-extend"}),Ga({deleteAll:e=>(Ot(e),ti(e)),deleteNextChar:e=>ti(e,1),deletePreviousChar:e=>ti(e,-1),deleteNextWord:e=>(Et(e,1,{extend:!0}),ti(e)),deletePreviousWord:e=>(Et(e,-1,{extend:!0}),ti(e)),deleteToGroupStart:e=>(Pt(e,-e.anchorOffset()),ti(e)),deleteToGroupEnd:e=>(Ft(e,-1,{extend:!0}),ti(e)),deleteToMathFieldStart:e=>(Ft(e,-1,{extend:!0}),ti(e)),deleteToMathFieldEnd:e=>(Ft(e,1,{extend:!0}),ti(e))},{target:"model",category:"delete"});const ui=["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"];function fi(e){return!e.ctrlKey&&!e.metaKey&&"Dead"!==e.key&&ui.indexOf(e.code)>=0}function gi(e){const t=[];return(e=function(e){if(!e.code){const t=Object.entries(oa().mapping);let a,i=!1,s=!1;for(let o=0;o<4;o++){for(const[r,n]of t)if(n[o]===e.key){a=r,3===o?(i=!0,s=!0):2===o?i=!0:1===o&&(s=!0);break}if(a)break}return new KeyboardEvent(e.type,{...e,altKey:i,shiftKey:s,code:a})}return new KeyboardEvent(e.type,e)}(e)).ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),0===t.length?"["+e.code+"]":(t.push("["+e.code+"]"),t.join("+"))}function yi(e){var t;if(!e)return"";let a;return"Unidentified"===e.key&&e.target&&(a=e.target.value),a=null!==(t=null!=a?a:e.key)&&void 0!==t?t:e.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(a)&&(a=""),a}class bi{constructor(e){this.mathlist=e,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(e){this.canUndo()&&("function"==typeof(null==e?void 0:e.onUndoStateWillChange)&&e.onUndoStateWillChange(this.mathlist.mathfield,"undo"),this.restore(this.stack[this.index-1],e),this.index-=1,e&&"function"==typeof e.onUndoStateDidChange&&e.onUndoStateDidChange(this.mathlist.mathfield,"undo"),this.canCoalesce=!1)}redo(e){this.canRedo()&&("function"==typeof(null==e?void 0:e.onUndoStateWillChange)&&e.onUndoStateWillChange(this.mathlist.mathfield,"redo"),this.index+=1,this.restore(this.stack[this.index],e),e&&"function"==typeof e.onUndoStateDidChange&&e.onUndoStateDidChange(this.mathlist.mathfield,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(e){this.record&&("function"==typeof(null==e?void 0:e.onUndoStateWillChange)&&e.onUndoStateWillChange(this.mathlist.mathfield,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(!1),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),e&&"function"==typeof e.onUndoStateDidChange&&e.onUndoStateDidChange(this.mathlist.mathfield,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(e){this.canCoalesce&&this.pop(),this.snapshot(e),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(!1),selection:this.mathlist.toString()}}restore(e,t){const a=this.mathlist.suppressChangeNotifications;void 0!==t.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=t.suppressChangeNotifications),di(this.mathlist,e?e.latex:"",{...t,format:"latex",mode:"math",insertionMode:"replaceAll",selectionMode:"after",smartFence:!1}),jt(this.mathlist,e?e.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=a}}const vi={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},xi={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"};function ki(t){if(!t)return"";if(e(t)){let e="";if(0===t.length)return"";if("first"===t[0].type&&t.shift(),0===t.length)return"";if("text"===t[0].mode){let a=0;for(e='"';t[a]&&"text"===t[a].mode;)e+=t[a].body,a++;e+='"'+ki(t.slice(a))}else if("math"===t[0].mode){let a=0;for(;t[a]&&"math"===t[a].mode;)e+=ki(t[a]),a++;e+=ki(t.slice(a))}return e.trim()}if("text"===t.mode)return'"'+t.body+'"';let a="";const i=t.symbol;let s;switch(t.type){case"group":case"root":a=ki(t.body);break;case"array":break;case"genfrac":(t.leftDelim||t.rightDelim)&&(a+="."!==t.leftDelim&&t.leftDelim?t.leftDelim:"{:"),t.hasBarLine?(a+="(",a+=ki(t.numer),a+=")/(",a+=ki(t.denom),a+=")"):(a+="("+ki(t.numer)+"),",a+="("+ki(t.denom)+")"),(t.leftDelim||t.rightDelim)&&(a+="."!==t.rightDelim&&t.rightDelim?t.rightDelim:"{:");break;case"surd":t.index?a+="root("+ki(t.index)+")("+ki(t.body)+")":a+="sqrt("+ki(t.body)+")";break;case"leftright":a+="."!==t.leftDelim&&t.leftDelim?t.leftDelim:"{:",a+=ki(t.body),a+="."!==t.rightDelim&&t.rightDelim?t.rightDelim:":}";break;case"sizeddelim":case"delim":case"overlap":case"overunder":break;case"mord":a=vi[i]||i||("string"==typeof t.body?t.body:""),"\\"===a[0]&&(a+=""),s=i?i.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,s?a=String.fromCharCode(parseInt("0x"+s[1])):a.length>0&&"\\"===a.charAt(0)&&(a="string"==typeof t.body?t.body.charAt(0):t.symbol);break;case"mbin":case"mrel":case"textord":case"minner":a=i&&vi[i]?vi[i]:i&&xi[i]?xi[i]:t.body;break;case"mopen":case"mclose":a+=t.body;break;case"mpunct":a=xi[i]||i;break;case"mop":"​"!==t.body&&(a="",a+="\\operatorname"===i?ki(t.body):t.body||i,a+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":a=" "}if(t.subscript){a+="_";const e=ki(t.subscript);e.length>1&&!/^(-)?\d+(\.\d*)?$/.test(e)?a+="("+e+")":a+=e}if(t.superscript){a+="^";const e=ki(t.superscript);e.length>1&&!/^(-)?\d+(\.\d*)?$/.test(e)?a+="("+e+")":a+=e}return a}const wi={};function Si(e){const t=wi.locale.substring(0,2);let a="";return wi.strings[wi.locale]&&(a=wi.strings[wi.locale][e]),!a&&wi.strings[t]&&(a=wi.strings[t][e]),a||(a=wi.strings.en[e]),a||(a=e),a}function Mi(e,t,a){nt(e);const i=[],s=t.substr(a);for(const e of s){const t=new Be("command","command",e);t.suggestion=!0,i.push(t)}Array.prototype.splice.apply(e.siblings(),[e.anchorOffset()+1,0].concat(i))}function Li(e,t){if(t=t||{acceptSuggestion:!1},Ma(e),t.discard)return Aa(e.model,null),e.switchMode("math"),!0;const a=La(e.model,!t.acceptSuggestion);if(a){if("\\("===a||"\\)"===a)Aa(e.model,[]),di(e.model,a.slice(1),{mode:e.mode});else{e.switchMode("math");const t=ot(a,"math",null,e.config.macros);t?Aa(e.model,t):Ca(e.model,!0)}return e.snapshot(),e.model.announce("replacement"),!0}return!1}function Ci(e){!function(e){const t=e.siblings(),a=Mt(e);let i=a.start;for(;i1)}return Va(e),!0}wi.plural=function(e,t,a){(a=null!=a?a:{}).type=a.type||"cardinal";const i=wi.locale.substring(0,2),s="ordinal"===a.type?wi._ordinal:wi._cardinal;let o,r="ordinal"===a.type?wi._ordinalPluralCategories.indexOf(s.select(e)):wi._cardinalPluralCategories.indexOf(s.select(e));return wi.strings[wi.locale]&&(o=wi.strings[wi.locale][t]),!o&&wi.strings[i]&&(o=wi.strings[i][t]),o||(o=wi.strings.en[t],o||(o=t),r="ordinal"===a.type?wi._ordinalPluralCategories.indexOf(wi._ordinalEnglish.select(e)):wi._cardinalPluralCategories.indexOf(wi._cardinalEnglish.select(e))),o.split(";")[r]||o.split(";")[0]},wi.merge=function(e,t){if(e&&t){const a=wi._locale;wi.locale=e,wi.strings[e]={...wi.strings[e],...t},wi.locale=a}else e&&!t&&Object.keys(e).forEach(t=>wi.merge(t,e[t]))},Object.defineProperty(wi,"locale",{set(e){wi._locale=e,wi._ordinal=null,wi._cardinal=null},get(){var e;return wi._locale||(wi._locale=null!==(e=null===navigator||void 0===navigator?void 0:navigator.language.slice(0,5))&&void 0!==e?e:"en"),wi._locale}}),Object.defineProperty(wi,"ordinal",{get:()=>(wi._ordinal||(wi._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),wi._ordinalEnglishPluralCategories=wi._ordinalEnglish.resolvedOptions().pluralCategories,wi._ordinal=new Intl.PluralRules(wi.locale,{type:"ordinal"}),wi._ordinalPluralCategories=wi._ordinal.resolvedOptions().pluralCategories),wi._ordinal)}),Object.defineProperty(wi,"cardinal",{get:()=>(wi._cardinal||(wi._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),wi._cardinalEnglishPluralCategories=wi._cardinalEnglish.resolvedOptions().pluralCategories,wi._cardinal=new Intl.PluralRules(wi.locale,{type:"cardinal"}),wi._cardinalPluralCategories=wi._ordinal.resolvedOptions().pluralCategories),wi._cardinal)}),wi.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.symbols":"Symbols","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.symbols":"حرف او رمز","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.symbols":"Symbole","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.symbols":"σύμβολα","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.symbols":"Símbolos","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.symbols":"نمادها","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"حروف رومی","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.symbols":"Symboles","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres romaines","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.symbols":"Simboli","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.symbols":"シンボル","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"ローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.symbols":"Symbolika","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.symbols":"Символы","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Латинские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}},Ga({complete:Li,nextSuggestion:function(e){return e.suggestionIndex+=1,Ci(e),!1},previousSuggestion:function(e){if(e.suggestionIndex-=1,e.suggestionIndex<0){nt(e.model);const t=oe(La(e.model));e.suggestionIndex=t.length-1}return Ci(e),!1}},{target:"mathfield",category:"autocomplete"});const Ai={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"eye ","\\sum":"Summation ","\\prod":"Product ",a:'a',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function $i(e){let t=0;if(Re(e))for(const a of e)"first"!==a.type&&(t+=1);return 1===t}function zi(e){let t="";if(Re(e))for(const a of e)"first"!==a.type&&"string"==typeof a.body&&(t+=a.body);return t}function _i(e,t){var a;const i={...t,textToSpeechRulesOptions:{...t.textToSpeechRulesOptions}};if(window.sre&&"sre"===i.textToSpeechRules){const t=Ha(e,i);return t?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=null!==(a=i.textToSpeechRulesOptions)&&void 0!==a?a:{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(t)):""}let s=function e(t,a,i){function s(e){return""+e+""}if(!a)return"";let o="";if(Re(a)){let r=!1,n=!1;for(let l=0;l'),o+=a.body;else{a.id&&"math"===t&&(o+='');let r="",n="",l="",c=!1;switch(a.type){case"group":case"root":o+=e("math",a.body,i);break;case"genfrac":if(r=e("math",a.numer,i),n=e("math",a.denom,i),$i(a.numer)&&$i(a.denom)){const e={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[zi(a.numer)+"/"+zi(a.denom)];e?o=e:o+=r+" over "+n}else o+=' the fraction '+r+', over '+n+'. End fraction.';break;case"surd":if(l=e("math",a.body,i),a.index){let t=e("math",a.index,i);t=t.trim();const s=t.replace(//g,"");o+="3"===s?' the cube root of '+l+'. End cube root':"n"===s?' the nth root of '+l+'. End root':' the root with index: '+t+', of '+l+'. End root'}else $i(a.body)?o+=" the square root of "+l+" , ":o+=' the square root of '+l+'. End square root';break;case"leftright":o+=Ai[a.leftDelim]||a.leftDelim,o+=e("math",a.body,i),o+=Ai[a.rightDelim]||a.rightDelim;break;case"rule":case"overunder":case"overlap":break;case"placeholder":o+="placeholder "+a.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const s=a.symbol;if("\\mathbin"===s||"\\mathrel"===s||"\\mathopen"===s||"\\mathclose"===s||"\\mathpunct"===s||"\\mathord"===s||"\\mathinner"===s){o=e(t,a.body,i);break}let r=a.body,n=a.symbol;if("delim"!==a.type&&"sizeddelim"!==a.type||(r=n=a.delim),"text"===t)o+=r;else{if("mbin"===a.type&&(o+=''),r){const e=Ai[r]||(n?Ai[n.trim()]:"");if(e)o+=" "+e;else{const e=n?function(e){let t="";return"\\"===e.charAt(0)&&(t=" "+e.replace("\\","")+" "),t}(n.trim()):"";o+=e||function(e){let t="";return i.textToSpeechMarkup?/[a-z]/.test(e)?t+=' '+e+"":/[A-Z]/.test(e)?t+="capital "+e.toLowerCase():t+=e:/[a-z]/.test(e)?t+=" '"+e.toUpperCase()+"'":/[A-Z]/.test(e)?t+=" 'capital "+e.toUpperCase()+"'":t+=e,t}(r)}}else o+=e("math",a.body,i);"mbin"===a.type&&(o+='')}break}case"mop":if("​"!==a.body){const t=a.symbol;if("\\sum"===t)if(a.superscript&&a.subscript){let t=e("math",a.superscript,i);t=t.trim();let s=e("math",a.subscript,i);s=s.trim(),o+=' the summation from '+s+' to '+t+' of ',c=!0}else if(a.subscript){let t=e("math",a.subscript,i);t=t.trim(),o+=' the summation from '+t+' of ',c=!0}else o+=" the summation of";else if("\\prod"===t)if(a.superscript&&a.subscript){let t=e("math",a.superscript,i);t=t.trim();let s=e("math",a.subscript,i);s=s.trim(),o+=' the product from '+s+' to '+t+' of ',c=!0}else if(a.subscript){let t=e("math",a.subscript,i);t=t.trim(),o+=' the product from '+t+' of ',c=!0}else o+=" the product of ";else if("\\int"===t)if(a.superscript&&a.subscript){let t=e("math",a.superscript,i);t=t.trim();let r=e("math",a.subscript,i);r=r.trim(),o+=' the integral from '+s(r)+' to '+s(t)+' of ',c=!0}else o+=' the integral of ';else"string"==typeof a.body?o+=Ai[a.body]||Ai[a.symbol]||" "+a.body:a.symbol&&("\\"===a.symbol[0]?o+=" "+a.symbol.substr(1):o+=" "+a.symbol)}break;case"enclose":l=e("math",a.body,i),$i(a.body)?o+=" crossed out "+l+" , ":o+=" crossed out "+l+". End cross out"}if(!c&&a.superscript){let s=e(t,a.superscript,i);s=s.trim();const r=s.replace(/<[^>]*>/g,"");if($i(a.superscript)){if("math"===t){const e=function(e){if(Re(e))for(const t of e)if("first"!==t.type&&t.id)return t.id.toString();return""}(a.superscript);e&&(o+='')}"′"===r?o+=" prime ":"2"===r?o+=" squared ":"3"===r?o+=" cubed ":isNaN(parseInt(r))?o+=" to the "+s+"; ":o+=' to the '+r+" power; "}else isNaN(parseInt(r))?o+=" raised to the "+s+"; ":o+=' raised to the '+r+" power; "}if(!c&&a.subscript){let t=e("math",a.subscript,i);t=t.trim(),$i(a.subscript)?o+=" sub "+t:o+=" subscript "+t+". End subscript. "}}return o}("math",e,i);if("ssml"===i.textToSpeechMarkup){let e="";i.speechEngineRate&&(e=''),s=''+e+"

    "+s+"

    "+(e?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(e){let t="other";return(null===navigator||void 0===navigator?void 0:navigator.platform)&&(null===navigator||void 0===navigator?void 0:navigator.userAgent)&&(/^(mac)/i.test(navigator.platform)?t="mac":/^(win)/i.test(navigator.platform)?t="win":/(android)/i.test(navigator.userAgent)?t="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?t="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(t="chromeos")),"mac"===t?"mac":"!mac"}()?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s}function Di(e,t,a){return t+_i(a,{...e,textToSpeechMarkup:"",textToSpeechRulesOptions:{...e.textToSpeechRulesOptions,markup:"none"}})}function qi(e,t){if(!t&&window&&window.mathlive&&(t=window.mathlive.config),(t=null!=t?t:{}).speechEngine&&"local"!==t.speechEngine)if("amazon"===t.speechEngine){if(window&&window.AWS){const a=new window.AWS.Polly({apiVersion:"2016-06-10"}),i={OutputFormat:"mp3",VoiceId:t.speechEngineVoice,Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes(t.speechEngineVoice)?"neural":"standard",Text:e,TextType:"ssml"};a.synthesizeSpeech(i,(function(e,t){if(e);else if(null==t?void 0:t.AudioStream){const e=new Uint8Array(t.AudioStream),a=new Blob([e.buffer],{type:"audio/mpeg"}),i=URL.createObjectURL(a);new Audio(i).play().catch(e=>{})}}))}}else t.speechEngine;else{const t=new SpeechSynthesisUtterance(e);window&&window.speechSynthesis.speak(t)}}function Ti(e,t,a,i){let s="";"plonk"===t?(e.plonkSound&&(e.plonkSound.load(),e.plonkSound.play().catch(e=>{})),e.resetKeystrokeBuffer()):"delete"===t?s=Di(e.config,"deleted: ",i):"focus"===t||/move/.test(t)?s=(Rt(e.model)?"":"selected: ")+function(e,t){function a(e,t){return"body"===t.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[e.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[t.relation]}const i=t?t.path:[],s=e.model.path,o=s[s.length-1];let r="";for(;i.length>s.length;)r+="out of "+a(t.parent(),i[i.length-1])+"; ",i.pop();if(!Rt(e.model))return Di(e.config,"",Nt(e.model));const n=a(e.model.parent(),o);0===o.offset&&(r+=(n?"start of "+n:"unknown")+": ");const l=e.model.sibling(Math.max(1,e.model.extent));return l?r+=Di(e.config,"",l):0!==o.offset&&(r+=n?"end of "+n:"unknown"),r}(e,a):"replacement"===t?s=Di(e.config,"",e.model.sibling(0)):"line"===t?(s=Di(e.config,"",e.model.root),e.accessibleNode.innerHTML=e.config.createHTML(''+Ha(e.model.root,e.config)+""),e.textarea.setAttribute("aria-label","after: "+s)):s=i?Di(e.config,t+" ",i):t;const o=/\u00a0/.test(e.ariaLiveText.textContent)?"   ":"   ";e.ariaLiveText.textContent=s+o}Ga({speak:(e,t,a)=>function(e,t,a){a=null!=a?a:{withHighlighting:!1};const i=function(e,t){let a=null;switch(t){case"all":a=e.model.root;break;case"selection":Rt(e.model)||(a=Nt(e.model));break;case"left":{const t=e.model.siblings(),i=e.model.startOffset();if(i>=1){a=[];for(let e=1;e<=i;e++)a.push(t[e])}break}case"right":{const t=e.model.siblings(),i=e.model.endOffset()+1;if(i<=t.length-1){a=[];for(let e=i;e<=t.length-1;e++)a.push(t[e])}break}case"group":a=e.model.siblings();break;case"parent":{const t=e.model.parent();t&&"root"!==t.type&&(a=e.model.parent());break}}return a}(e,t);if(null===i)return e.config.speakHook(function(e){let t="";switch(e){case"all":break;case"selection":t="no selection";break;case"left":t="at start";break;case"right":t="at end";break;case"group":break;case"parent":t="no parent"}return t}(t),e.config),!1;const s={...e.config};(a.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml");const o=_i(i,s);return a.withHighlighting?(window.mathlive.readAloudMathField=e,Ua(e,{forHighlighting:!0}),e.config.readAloudHook&&e.config.readAloudHook(e.field,o,e.config)):e.config.speakHook&&e.config.speakHook(o,s),!1}(e,t,a)},{target:"mathfield",category:"speech"});const Ki=()=>{};function Ei(e){if("string"==typeof e){const t=new Audio;return t.preload="none",t.src=e,t.volume=.5,t}return e}function Fi(e){e instanceof HTMLAudioElement&&(e.pause(),e.removeAttribute("src"),e.load())}function Ni(t,a){const i=Bi(t,Object.keys(t));return Object.keys(a).forEach(t=>{var s;switch(t){case"scriptDepth":if(e(a.scriptDepth))i.scriptDepth=[a.scriptDepth[0],a.scriptDepth[1]];else{if("number"!=typeof a.scriptDepth)throw Error("Unexpected value for scriptDepth");i.scriptDepth=[a.scriptDepth,a.scriptDepth]}break;case"namespace":if(!/^[a-z]*[-]?$/.test(a.namespace))throw Error("namespace must be a string of lowercase characters only");/-$/.test(a.namespace)?i.namespace=a.namespace:i.namespace=a.namespace+"-";break;case"locale":i.locale="auto"===a.locale?wi.locale:a.locale;break;case"strings":wi.merge(a.strings);break;case"virtualKeyboardLayout":"auto"===a.virtualKeyboardLayout?i.virtualKeyboardLayout={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[wi.locale.substring(0,2)]||"qwerty":i.virtualKeyboardLayout=a.virtualKeyboardLayout;break;case"virtualKeyboardMode":{const e=null===(s=window.matchMedia)||void 0===s?void 0:s.call(window,"(any-pointer: coarse)").matches;"auto"===a.virtualKeyboardMode?i.virtualKeyboardMode=e?"onfocus":"off":i.virtualKeyboardMode=a.virtualKeyboardMode}break;case"letterShapeStyle":"auto"===a.letterShapeStyle?"fr"===wi.locale.substring(0,2)?i.letterShapeStyle="french":i.letterShapeStyle="tex":i.letterShapeStyle=a.letterShapeStyle;break;case"plonkSound":Fi(i.plonkSound),i.plonkSound=Ei(a.plonkSound);break;case"keypressSound":if(Fi(i.keypressSound),"string"==typeof a.keypressSound){const e=Ei(a.keypressSound);i.keypressSound={delete:e,return:e,spacebar:e,default:e}}else if(a.keypressSound instanceof HTMLAudioElement)i.keypressSound={delete:a.keypressSound,return:a.keypressSound,spacebar:a.keypressSound,default:a.keypressSound};else{if(!a.keypressSound.default)throw Error("Missing keypressSound.default");i.keypressSound={...a.keypressSound},i.keypressSound.return||(i.keypressSound.return=a.keypressSound.default),i.keypressSound.spacebar||(i.keypressSound.spacebar=a.keypressSound.default),i.keypressSound.delete||(i.keypressSound.delete=a.keypressSound.default)}break;case"onBlur":case"onFocus":case"onContentWillChange":case"onContentDidChange":case"onSelectionWillChange":case"onSelectionDidChange":case"onUndoStateWillChange":case"onUndoStateDidChange":case"onModeChange":case"onVirtualKeyboardToggle":case"onReadAloudStatus":case"onError":if(null===a[t])i[t]=Ki;else if("function"!=typeof a[t])throw Error(t+" must be a function or null");i[t]=a[t];break;default:e(a[t])?i[t]=[...a[t]]:"object"==typeof a[t]?i[t]={...a[t]}:i[t]=a[t]}}),void 0!==a.overrideDefaultInlineShortcuts&&(a.overrideDefaultInlineShortcuts?i.inlineShortcuts=a.inlineShortcuts:i.inlineShortcuts={...ai,...a.inlineShortcuts}),i}function Bi(t,a){let i;i="string"==typeof a?[a]:void 0===a?Object.keys(t):a;const s={};return i.forEach(a=>{e(s[a])?s[a]=[...s[a]]:"object"==typeof s[a]?s[a]={...s[a]}:s[a]=t[a]}),"string"==typeof a?s[a]:s}function Oi(e,t,a){"function"==typeof t&&(a=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(kt(e.model);!s;){const o=e.model.sibling(i);s=0===t||!o||"math"!==o.mode||!(/mord|textord|mpunct/.test(o.type)||"mop"===o.type&&/[a-zA-Z]+/.test(o.body))||!!o.superscript||!!o.subscript||a&&!a(o),s||(o.applyStyle({mode:"text"}),o.symbol=o.body,o.latex=""),i-=1,t-=1}wt(e.model)}function Ri(e,t,a){"function"==typeof t&&(a=t,t=1/0),void 0===t&&(t=1/0),kt(e.model);let i=0,s=!1;for(;!s;){const o=e.model.sibling(i);s=0===t||!o||"text"!==o.mode||" "===o.body||a&&!a(o),s||o.applyStyle({mode:"math"}),i-=1,t-=1}Pi(e),wt(e.model)}function Pi(e){let t=0;for(;e.model.sibling(t)&&"math"===e.model.sibling(t).mode;)t-=1;if(e.model.sibling(t)&&"text"===e.model.sibling(t).mode&&" "===e.model.sibling(t).body&&(!e.model.sibling(t-1)||"math"===e.model.sibling(t-1).mode)){kt(e.model),e.model.siblings().splice(t-1,1),wt(e.model);const a=e.model.suppressChangeNotifications;e.model.suppressChangeNotifications=!0,$t(e.model,e.model.anchorOffset()-1),e.model.suppressChangeNotifications=a}}function Ii(e,t,a){!function(e){const t=e.shiftKey&&e.altKey?3:e.altKey?2:e.shiftKey?1:0;if("Unidentified"===e.key)return;if("Dead"===e.key)return;const a=ea.filter(a=>{var i;return(null===(i=a.mapping[e.code])||void 0===i?void 0:i[t])===e.key});0!==a.length&&(a.forEach(e=>{e.score+=1}),ea.sort((e,t)=>t.score-e.score))}(a);const i=oa();if(e.keyboardLayout!==i.id&&(e.keyboardLayout=i.id,e.keybindings=ma(e.config.keybindings,t=>{"function"==typeof e.config.onError&&e.config.onError({code:"invalid-keybinding",arg:t.join("\n")})})),function(e,t){const a=e.keystrokeCaption;if(a&&e.keystrokeCaptionVisible){const i=e.element.getBoundingClientRect();a.style.left=i.left+"px",a.style.top=i.top-64+"px",a.innerHTML=e.config.createHTML(""+(da(t)||t)+""+a.innerHTML),a.style.visibility="visible",setTimeout((function(){a.childNodes.length>0&&a.removeChild(a.childNodes[a.childNodes.length-1]),0===a.childNodes.length&&(a.style.visibility="hidden")}),3e3)}}(e,t),clearTimeout(e.keystrokeBufferResetTimer),e.config.onKeystroke&&!e.config.onKeystroke(e,t,a))return(null==a?void 0:a.preventDefault)&&(a.preventDefault(),a.stopPropagation()),!1;let s,o,r,n=!1;if("command"!==e.mode&&(!a||!a.ctrlKey&&!a.metaKey))if(fi(a)){const t=yi(a),i=e.keystrokeBuffer+t;let r=0;for(;!s&&r{e.startsWith(o)&&!a.includes(e)&&a.push(e)});const r=(null==t?void 0:t.inlineShortcuts)?t.inlineShortcuts:null;r&&Object.keys(r).forEach(e=>{e.startsWith(o)&&a.push(e)})}return a}(i,e.config).length<=1?n=!0:e.config.inlineShortcutTimeout&&(e.keystrokeBufferResetTimer=setTimeout(()=>{e.resetKeystrokeBuffer()},e.config.inlineShortcutTimeout))}else e.resetKeystrokeBuffer();if(e.config.smartMode){const i=e.mode;s?e.mode="math":function(e,t,a){if(e.smartModeSuppressed)return!1;if(e.model.endOffset()<*|]$/.test(i))return Pi(e),!0}else{if("[Space]"===t)return Oi(e,void 0,e=>/[a-z][:,;.]$/.test(e.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return Oi(e,void 0,e=>/[a-zA-Z]/.test(e.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return Oi(e,1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return Oi(e,void 0,e=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(e.body)),!0;if(/\?|\./.test(i))return!0}return!1}(e,t,a)&&(e.mode={math:"text",text:"math"}[e.mode],r=""),e.mode!==i&&"function"==typeof e.config.onModeChange&&e.config.onModeChange(e,e.mode)}if(s||r||(r=function(e,t,a){if(0===e.length)return"";for(let i=e.length-1;i--;i>=0)if(e[i].key===a&&(!e[i].ifMode||e[i].ifMode===t))return e[i].command;return""}(e.keybindings,e.mode,t)),!s&&!r)return!0;if(e.config.readOnly&&"insert"===r[0])return!0;Ca(e.model,!1);const l=e.model.parent();if("moveAfterParent"===r&&l&&"leftright"===l.type&&e.model.endOffset()===e.model.siblings().length-1&&e.config.smartFence&&li(e.model,".",e.style)&&(r="",Va(e)),"math"===e.mode&&"[Spacebar]"===t&&!s){const t=e.model.sibling(1),a=e.model.sibling(-1);(t&&"text"===t.mode||a&&"text"===a.mode)&&di(e.model," ",{mode:"text"})}if(r)e.$perform(r);else if(s){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(s)){const t={...Ct(e.model),...e.style};di(e.model,yi(a),{suppressChangeNotifications:!0,mode:e.mode,style:t});const i=e.mode;e.snapshotAndCoalesce(),e.restoreToUndoRecord(e.keystrokeBufferStates[o]),e.mode=i}kt(e.model);const t=e.model.suppressChangeNotifications;e.model.suppressChangeNotifications=!0;const i={...Ct(e.model),...e.style};di(e.model,s,{format:"latex",mode:e.mode,style:i,smartFence:!0}),Pi(e),s.endsWith(" ")&&(e.mode="text",di(e.model," ",{mode:"text",style:i})),e.model.suppressChangeNotifications=t,wt(e.model),e.snapshot(),Va(e),e.model.announce("replacement"),n&&e.resetKeystrokeBuffer()}return e.scrollIntoView(),(null==a?void 0:a.preventDefault)&&(a.preventDefault(),a.stopPropagation()),!1}function Hi(e,t,a){if(e.config.readOnly)return void e.model.announce("plonk");if((a=null!=a?a:{}).focus&&e.$focus(),a.feedback&&(e.config.keypressVibration&&(null===navigator||void 0===navigator?void 0:navigator.vibrate)&&navigator.vibrate(3),e.keypressSound&&(e.keypressSound.load(),e.keypressSound.play().catch(e=>{}))),a.commandMode&&"command"!==e.mode&&e.switchMode("command"),Ca(e.model,!1),a.simulateKeystroke){const a=t.charAt(0);if(!Ii(e,a,new KeyboardEvent("keypress",{key:a})))return}let i="",s=!1;if(e.pasteInProgress)e.pasteInProgress=!1,di(e.model,t,{smartFence:e.config.smartFence,mode:"math"});else{const a={...Ct(e.model),...e.style},o=Ue(t);for(const t of o)if("command"===e.mode){nt(e.model),e.suggestionIndex=0;const a=La(e.model),o=oe(a+t);s=o.length>1,0===o.length?(di(e.model,t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(a+t)&&Ca(e.model,!0),Ma(e)):(di(e.model,t,{mode:"command"}),o[0].match!==a+t&&Mi(e.model,o[0].match,-o[0].match.length+a.length+1),i=o[0].match)}else if("math"===e.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(Wi(e)>=e.config.scriptDepth[1])return void e.model.announce("plonk")}else if("moveToSubscript"===i&&Vi(e)>=e.config.scriptDepth[0])return void e.model.announce("plonk");e.$perform(i)}else e.config.smartSuperscript&&"superscript"===e.model.relation()&&/[0-9]/.test(t)&&0===e.model.siblings().filter(e=>"first"!==e.type).length?(di(e.model,t,{mode:"math",style:a}),Wt(e.model)):di(e.model,t,{mode:"math",style:a,smartFence:e.config.smartFence})}else"text"===e.mode&&di(e.model,t,{mode:"text",style:a})}"command"!==e.mode&&e.snapshotAndCoalesce(),e.dirty=!0,e.scrollIntoView(),ka(e,i,s)}function Wi(e){let t=0,a=0,i=e.model.ancestor(a),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),a+=1,i=e.model.ancestor(a);return s?t:0}function Vi(e){let t=0,a=0,i=e.model.ancestor(a),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),a+=1,i=e.model.ancestor(a);return s?t:0}function Ui(e){return e.pasteInProgress=!0,!0}let ji;Ga({undo:e=>(Li(e),e.undo(),!0),redo:e=>(Li(e),e.redo(),!0),scrollIntoView:e=>(e.scrollIntoView(),!0),scrollToStart:e=>(e.field.scroll(0,0),!0),scrollToEnd:e=>{const t=e.field.getBoundingClientRect();return e.field.scroll(t.left-window.scrollX,0),!0},enterCommandMode:e=>(e.switchMode("command"),!0),toggleKeystrokeCaption:e=>(e.keystrokeCaptionVisible=!e.keystrokeCaptionVisible,e.keystrokeCaption.innerHTML="",e.keystrokeCaptionVisible||(e.keystrokeCaption.style.visibility="hidden"),!1),switchMode:(e,t)=>(e.switchMode(t),!0),insert:(e,t,a)=>e.$insert(t,a),typedText:(e,t)=>(Hi(e,t),!0)}),Ga({applyStyle:function(e,t){e.resetKeystrokeBuffer();const a=function(e){const t={};return"string"==typeof e.mode&&(t.mode=e.mode.toLowerCase()),"string"==typeof e.color&&(t.color=e.color),"string"==typeof e.backgroundColor&&(t.backgroundColor=e.backgroundColor),"string"==typeof e.fontFamily&&(t.fontFamily=e.fontFamily),"string"==typeof e.series&&(t.fontSeries=e.series),"string"==typeof e.fontSeries&&(t.fontSeries=e.fontSeries.toLowerCase()),t.fontSeries&&(t.fontSeries={bold:"b",medium:"m",normal:"m"}[t.fontSeries]||t.fontSeries),"string"==typeof e.shape&&(t.fontShape=e.shape),"string"==typeof e.fontShape&&(t.fontShape=e.fontShape.toLowerCase()),t.fontShape&&(t.fontShape={italic:"it",up:"n",upright:"n",normal:"n"}[t.fontShape]||t.fontShape),"string"==typeof e.size?t.fontSize=e.size:"number"==typeof e.size&&(t.fontSize="size"+Math.min(0,Math.max(10,e.size))),"string"==typeof e.fontSize&&(t.fontSize=e.fontSize.toLowerCase()),t.fontSize&&(t.fontSize={tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normal:"size5",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.fontSize]||t.fontSize),t}(t);if(a.mode){if(Rt(e.model))e.switchMode(a.mode);else{const t=e.mode,a="math"===(Lt(e.model)||e.config.defaultMode)?"text":"math";let i=e.$selectedText("ASCIIMath");if("math"===a&&/^"[^"]+"$/.test(i)&&(i=i.slice(1,-1)),e.$insert(i,{mode:a,selectionMode:"item",format:"text"===a?"text":"ASCIIMath"}),e.mode=a,e.groupIsSelected()){const t=e.model.parent();!t||"group"!==t.type&&"root"!==t.type||(t.mode=a)}e.mode!==t&&"function"==typeof e.config.onModeChange&&e.config.onModeChange(e,e.mode)}delete a.mode}return Rt(e.model)?(e.style.fontSeries&&a.fontSeries===e.style.fontSeries&&(a.fontSeries="auto"),a.fontShape&&a.fontShape===e.style.fontShape&&(a.fontShape="auto"),a.color&&a.color===e.style.color&&(a.color="none"),a.backgroundColor&&a.backgroundColor===e.style.backgroundColor&&(a.backgroundColor="none"),a.fontSize&&a.fontSize===e.style.fontSize&&(a.fontSize="auto"),e.style={...e.style,...a}):(ci(e.model,a),e.snapshot()),!0}},{target:"mathfield"}),Ga({copyToClipboard:e=>(e.$focus(),Rt(e.model)&&e.$select(),document.execCommand("copy"),!1),cutToClipboard:e=>(e.$focus(),document.execCommand("cut"),!0),pasteFromClipboard:e=>(e.$focus(),document.execCommand("paste"),!0)},{target:"mathfield",category:"clipboard"});let Gi=0;function Zi(e,t,a,i){var s;let o;(i=null!=i?i:{}).bias=null!==(s=i.bias)&&void 0!==s?s:0;const r=function e(t,a,i){let s={element:null,distance:Number.POSITIVE_INFINITY},o=!0;if(t.getAttribute("data-atom-id")){s.element=t;const e=t.getBoundingClientRect(),r=a-(e.left+e.right)/2,n=i-(e.top+e.bottom)/2;s.distance=r*r+n*n,o=a>=e.left&&a<=e.right}if(o&&t.children)for(const o of t.children){const t=e(o,a,i);t.element&&t.distance<=s.distance&&(s=t)}return s}(e.field,t,a).element,n=r?r.getAttribute("data-atom-id"):null;if(n){const a=Yt(e.model,(e,t)=>t.captureSelection?t.filter(e=>e.id===n).length>0:t.id===n);if(a&&a.length>0)if(o=dt(a[0]).path,0===i.bias){const e=r.getBoundingClientRect();tf ()",classes:"tex",layers:["functions"]},symbols:{tooltip:"keyboard.tooltip.symbols",layer:"symbols",label:"∞≠∈",classes:"tex",layers:["symbols"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},Yi={"\\varphi ":["Φ","\\Phi "],"\\varsigma ":["Σ","\\Sigma "],"\\epsilon ":["Ɛ",'{\\char"0190}'],"\\rho ":["Ρ",'{\\char"3A1}'],"\\tau ":["Τ",'{\\char"3A4}'],"\\upsilon ":["Υ","\\Upsilon "],"\\theta ":["Θ","\\Theta "],"\\iota ":["Ι",'{\\char"399}'],"\\omicron ":["Ο",'{\\char"39F}'],"\\pi ":["Π","\\Pi "],"\\alpha ":["Α",'{\\char"391}'],"\\sigma ":["Σ","\\Sigma "],"\\delta ":["Δ","\\Delta "],"\\phi ":["Φ","\\Phi "],"\\gamma ":["Γ","\\Gamma "],"\\eta ":["Η",'{\\char"397}'],"\\xi ":["Ξ","\\Xi "],"\\kappa ":["Κ",'{\\char"39A}'],"\\lambda ":["Λ","\\Lambda "],"\\zeta ":["Ζ",'{\\char"396}'],"\\chi ":["Χ",'{\\char"3A7}'],"\\psi ":["Ψ","\\Psi "],"\\omega ":["Ω","\\Omega "],"\\beta ":["Β",'{\\char"392}'],"\\nu ":["Ν",'{\\char"39D}'],"\\mu ":["Μ",'{\\char"39C}']},Ji={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let Qi={};const es={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ;
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ;
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • ,
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function ts(e,t,a){return e=e.replace(/(^|[^\\])#@/g,"$1#?"),q(_(Ne({mathstyle:c.displaystyle,macros:a.config.macros},ot(e,"math",t,a.config.macros)),"ML__base"),"ML__mathlive").toMarkup()}function as(e,t,a){var i;let s="
    ";const o=t.replace(/\s+/g," ").split(" ");if(o.length>1){const t={...Xi,...null!==(i=e.config.customVirtualKeyboards)&&void 0!==i?i:{}};for(const e of o){if(!t[e])break;s+="
    "+t[e].label+"
    "}}return s+="
    ",s+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function is(e,t,a){var i;for(let s=0;s"+o.getAttribute("data-aside").replace(/"/g,'"')+""),void 0!==r&&(o.innerHTML=e.config.createHTML(r)),o.getAttribute("data-classes")&&o.classList.add(o.getAttribute("data-classes"));const n=null===(i=o.getAttribute("data-insert"))||void 0===i?void 0:i.replace(/"/g,'"');let l;if(n&&Yi[n]&&(o.setAttribute("data-shifted",Yi[n][0]),o.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",Yi[n][1]]))),l=o.getAttribute("data-command")?JSON.parse(o.getAttribute("data-command")):o.getAttribute("data-insert")?["insert",o.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:o.getAttribute("data-latex")?["insert",o.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:["typedText",o.getAttribute("data-key")||o.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],a&&(l=[a,l]),o.getAttribute("data-alt-keys")){const e=Qi[o.getAttribute("data-alt-keys")];e&&(l={default:l,pressAndHoldStart:["showAlternateKeys",o.getAttribute("data-alt-keys"),e],pressAndHoldEnd:"hideAlternateKeys"})}va(e,o,l)}}function ss(e,t){const a={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},i=a[e.config.virtualKeyboardLayout]?a[e.config.virtualKeyboardLayout]:a.qwerty;let s,o=t;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let r=o.match(/()/);for(;r;){s="";const e=r[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),t={};for(const a of e){const e=a.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);t[e[1]]=e[3]}let n=i[t.name];if(n||(n=a.qwerty[t.name]),n)for(const e of n){let a=t.class||"";a&&(a=" "+a),"~"===e?(s+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===e?s+="
  • ":"^"===e?s+="
  • ":"/"===e?s+="
  • ÷
  • ":"*"===e?s+="
  • ×
  • ":"-"===e?s+="
  • ":/tt/.test(a)?s+="
  • '+e+"
  • ":s+="
  • "+e+"
  • "}o=o.replace(new RegExp(r[1]+r[2]+r[3]),s),r=o.match(/()/)}return o}function os(e){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",fa(t)),!1}function rs(e){const t=e.virtualKeyboard.querySelectorAll("div.keyboard-layer.is-visible .rows .keycap, div.keyboard-layer.is-visible .rows .action");if(t)for(let a=0;a',command:'["applyStyle",{"color":"'+e+'"}]'});Ji["background-color"]=[];for(const e of fe)Ji["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+e+'"}]'});Qi={...Ji},Object.keys(Qi).forEach(e=>{Qi[e]=Qi[e].slice()});for(let e=0;e<26;e++){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[e];Qi[t]||(Qi[t]=[]),Qi[t].unshift({latex:"\\mathbb{"+t+"}",aside:"blackboard",insert:"\\mathbb{"+t+"}"}),Qi[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),Qi[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),Qi[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),Qi[t].unshift({latex:"\\mathcal{"+t+"}",aside:"calligraphy",insert:"\\mathcal{"+t+"}"}),Qi[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}for(let e=0;e<=26;e++){const t="abcdefghijklmnopqrstuvwxyz"[e];Qi[t]||(Qi[t]=[]),Qi[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),Qi[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),Qi[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),Qi[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}for(let e=0;e<10;e++){const t="0123456789"[e];Qi[t]||(Qi[t]=[]),Qi[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),Qi[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),Qi[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),Qi[t].unshift({latex:"\\mathcal{"+t+"}",aside:"script",insert:"\\mathcal{"+t+"}"}),Qi[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}let o=e.config.virtualKeyboards;o||(o="all"),o=o.replace(/\ball\b/i,"numeric functions symbols roman greek");const r={...es,...null!==(a=e.config.customVirtualKeyboardLayers)&&void 0!==a?a:{}},n={...Xi,...null!==(i=e.config.customVirtualKeyboards)&&void 0!==i?i:{}},l=o.replace(/\s+/g," ").split(" ");for(const t of l){if(!n[t])break;let a=n[t].layers||[];n[t].layer&&a.push(n[t].layer),a=Array.from(new Set(a));for(const i of a){if(!r[i])break;if("object"==typeof r[i]){let e="";if(r[i].styles&&(e+=``),r[i].backdrop&&(e+=`
    `),r[i].container&&(e+=`
    `),r[i].rows){e+="
    ";for(const t of r[i].rows){e+="
      ";for(const a of t)e+="${a.label?a.label:""}`;e+="
    "}e+="
    "}r[i].container&&(e+="
    "),r[i].backdrop&&(e+="
    "),r[i]=e}s+="
    ",s+=as(e,o,t);const a="function"==typeof r[i]?r[i]():r[i];s+=ss(e,a),s+="
    "}}const c=document.createElement("div");c.className="ML__keyboard",t?c.classList.add(t):e.config.virtualKeyboardTheme&&c.classList.add(e.config.virtualKeyboardTheme),c.innerHTML=e.config.createHTML(s),is(e,[].slice.call(c.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton")));const d=c.getElementsByClassName("layer-switch");for(let t=0;t{e.addEventListener("mousedown",e=>{e.preventDefault(),e.stopPropagation()}),e.addEventListener("touchstart",e=>{e.preventDefault(),e.stopPropagation()})}),m[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){os(),rs(e)})),window.addEventListener("blur",(function(){os(),rs(e)})),window.addEventListener("touchend",(function(){os(),rs(e)})),window.addEventListener("touchcancel",(function(){os(),rs(e)})),c}(e,t),pa(e.virtualKeyboard,"touchstart:passive mousedown",()=>{e.$focus()}),document.body.appendChild(e.virtualKeyboard)),window.setTimeout(()=>{e.virtualKeyboard.classList.add("is-visible")},1)):e.virtualKeyboard&&e.virtualKeyboard.classList.remove("is-visible"),"function"==typeof e.config.onVirtualKeyboardToggle&&e.config.onVirtualKeyboardToggle(e,e.virtualKeyboardVisible,e.virtualKeyboard),!1}Ga({showAlternateKeys:(e,t,a)=>{const i=ua("mathlive-alternate-keys-panel","ML__keyboard alternate-keys");e.virtualKeyboard.classList.contains("material")&&i.classList.add("material"),a.length>=7?i.style.width="286px":4===a.length||2===a.length?i.style.width="146px":1===a.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const e of a)s+="";s="
      "+s+"
    ",i.innerHTML=e.config.createHTML(s),is(e,[].slice.call(i.getElementsByTagName("li")),"performAlternateKeys");const o=e.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(o){o.top-i.clientHeight<0&&(i.style.width="auto",a.length<=6?i.style.height="56px":a.length<=12?i.style.height="108px":i.style.height="205px");const e=(o.top-i.clientHeight+5).toString()+"px",t=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(o.left+o.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+t+","+e+")",i.classList.add("is-visible")}return!1}},{target:"virtual-keyboard"}),Ga({shiftKeyboardLayer:t=>{const a=t.virtualKeyboard.querySelectorAll("div.keyboard-layer.is-visible .rows .keycap, div.keyboard-layer.is-visible .rows .action");if(a)for(let i=0;ios(),performAlternateKeys:(e,t)=>(os(),e.$perform(t)),switchKeyboardLayer:(e,t)=>ls(e,t),unshiftKeyboardLayer:e=>rs(e),insertAndUnshiftKeyboardLayer:(e,t)=>(e.$insert(t),rs(e),!0)},{target:"virtual-keyboard"}),Ga({toggleVirtualKeyboardAlt:e=>{let t=!1;return e.virtualKeyboard&&(t=e.virtualKeyboard.classList.contains("material"),e.virtualKeyboard.remove(),delete e.virtualKeyboard,e.virtualKeyboard=null),cs(e,t?"":"material"),!1},toggleVirtualKeyboardShift:e=>{var t,a;e.config.virtualKeyboardLayout={qwerty:"azerty",azerty:"qwertz",qwertz:"dvorak",dvorak:"colemak",colemak:"qwerty"}[e.config.virtualKeyboardLayout];const i=null!==(a=null===(t=e.virtualKeyboard)||void 0===t?void 0:t.querySelector("div.keyboard-layer.is-visible").id)&&void 0!==a?a:"";return e.virtualKeyboard&&(e.virtualKeyboard.remove(),delete e.virtualKeyboard,e.virtualKeyboard=null),cs(e),i&&ls(e,i),!1}},{target:"virtual-keyboard"}),Ga({toggleVirtualKeyboard:(e,t)=>ms(e,t),hideVirtualKeyboard:e=>ds(e),showVirtualKeyboard:(e,t)=>cs(e,t)},{target:"virtual-keyboard"});const ps={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},hs={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},us={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},fs={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function gs(t,a){return e(t.arg)?t.arg[a]:void 0}function ys(e){return e&&fs[e]||-1}function bs(e){return/=|=>/.test(e)?"right":"left"}function vs(e){if("f"===e||"g"===e)return!0;const t=us[e];return!!t&&!!/%[^01_^]?/.test(t)}function xs(e){e=(e||"").trim();let t=ps[e];if(!t)if(/^\\[^{}]+$/.test(e)){const a=se(e,"math",{});t=a&&a.value||e.slice(1)}else t=e;return t}function ks(e){if(!e)return null;const t=xs(As(e)),a=[ys(t),bs(t)];return a[0]<=0?null:a}function ws(e){return null!==ks(e)}const Ss={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Ms={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Ls={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Cs={",":"list",";":"list2"};function As(t){if("string"==typeof t)return t;if(e(t)){let e="";for(const a of t)e+=As(a);return e}if(t.symbol&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.symbol))return t.symbol;if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(e(t.body)){let e="";for(const a of t.body)e+=As(a);return e}return""}function $s(e){return"string"==typeof e.sym?function(e){let t=us[e];return t?t.replace("%1","").replace("%0","").replace("%",""):(e.length>1&&(t="\\"+e),t||(t=ee("math",e)),t)}(e.sym)||e.sym:""}function zs(e){return parseFloat(e.num)}function _s(e){return"object"==typeof e&&void 0!==e.num}function Ds(e){let t=0;return _s(e)&&(t="object"==typeof e.num?void 0!==e.num.re?Js(e.num.re):0:parseFloat(e.num)),t}function qs(e){let t=0;return _s(e)&&"object"==typeof e.num&&(t=void 0!==e.num.im?Js(e.num.im):0),t}function Ts(e){return e&&void 0!==e.sup}function Ks(e){return e&&void 0!==e.sub}function Es(e,t,a){let i=!1;const s=e.atoms[e.index];return s&&s.type===t&&(i=void 0===a||As(s)===a),i}function Fs(e,...t){const a={fn:e,arg:void 0};if(t){const e=[];for(const a of t)a&&e.push(a);e.length>0&&(a.arg=e)}return a}function Ns(e){return"number"==typeof e?{num:e.toString()}:"string"==typeof e||"object"==typeof e?{num:e}:void 0}function Bs(e){if(_s(e)){const t=Ds(e),a=qs(e);return 0!==a?(0!==t&&(e.num.re=(-t).toString()),e.num.im=(-a).toString()):e.num=(-t).toString(),e}return Fs("negate",e)}function Os(e){const t=e.atoms[e.index+1];return t&&"msubsup"===t.type}function Rs(e,t){let a=e.atoms[e.index];return!a||void 0===a.superscript&&void 0===a.subscript?a=null:e.index+=1,a||(a=e.atoms[e.index+1],a&&"msubsup"===a.type&&(a.superscript||a.subscript)?e.index+=2:a=null),a?(void 0!==a.subscript&&(e.ast.sub=Gs(a.subscript,t)),void 0!==a.superscript&&("msubsup"===a.type?/['\u2032]|\\prime/.test(As(a.superscript))?(e.index+=1,a=e.atoms[e.index+1],a&&"msubsup"===a.type&&/['\u2032]|\\prime/.test(As(a.superscript))?e.ast.sup={sym:"″"}:(e.ast.sup={sym:"′"},e.index-=1)):/['\u2033]|\\doubleprime/.test(As(a.superscript))?e.ast.sup={sym:"″"}:e.ast&&(e.ast.sup=Gs(a.superscript,t)):e.ast.sup=Gs(a.superscript,t))):e.index+=1,e}function Ps(e,t){const a=e.ast;if(Hs(e,"!!"))return e.index+=1,e.ast=Fs("factorial2",a),Ps(e=Rs(e,t),t);if(Hs(e,"++"))return e.index+=1,e.ast=Fs("increment",a),Ps(e=Rs(e,t),t);if(Hs(e,"--"))return e.index+=1,e.ast=Fs("decrement",a),Ps(e=Rs(e,t),t);const i=e.atoms[e.index];return(null==i?void 0:i.symbol)&&Ms[i.symbol]&&(e.ast=Fs(Ms[i.symbol],a),e=Ps(e=Rs(e,t),t)),e}function Is(e,t,a,i){if(e.index=e.index||0,0===e.atoms.length||e.index>=e.atoms.length)return e.ast=void 0,e;const s=e.minPrec;e.minPrec=0;let o=e.atoms[e.index];if(t){if("mopen"===o.type&&As(o)===t)e.index+=1,o=(e=Vs(e,i)).atoms[e.index],o&&"mclose"===o.type&&As(o)===a&&(Os(e)&&(e.ast={group:e.ast}),e=Ps(e=Rs(e,i),i));else if("textord"===o.type&&As(o)===t)e.index+=1,o=(e=Vs(e,i)).atoms[e.index],o&&"textord"===o.type&&As(o)===a&&(e.index+=1,e=Ps(e=Rs(e,i),i));else if("\\lVert"===t&&"textord"===o.type&&"|"===o.symbol){if(o=e.atoms[e.index+1],o&&"textord"===o.type&&"|"===o.symbol){e.index+=2,o=(e=Vs(e,i)).atoms[e.index];const t=e.atoms[e.index+1];o&&"textord"===o.type&&"|"===o.symbol&&t&&"textord"===t.type&&"|"===t.symbol&&(e.index+=2,e=Ps(e=Rs(e,i),i))}}else if("sizeddelim"===o.type&&o.delim===t)e.index+=1,o=(e=Vs(e,i)).atoms[e.index],o&&"sizeddelim"===o.type&&o.delim===a&&(e.index+=1,e=Ps(e=Rs(e,i),i));else{if("leftright"!==o.type||o.leftDelim!==t||"?"!==o.rightDelim&&o.rightDelim!==a)return;e.ast=Gs(o.body,i),Os(e)&&(e.ast={group:e.ast}),e=Ps(e=Rs(e,i),i)}return e.minPrec=s,e}{let r=!0;if("mopen"===o.type?(t=o.symbol,a=I[t]):"sizeddelim"===o.type?(t=o.delim,a=I[t]):"leftright"===o.type?(r=!1,t=o.leftDelim,"?"===(a=o.rightDelim)&&(a=I[t])):"textord"===o.type&&(t=o.symbol,a=I[t]),t&&a){if("|"===t&&"|"===a){const i=e.atoms[e.index+1];i&&"textord"===i.type&&"|"===i.symbol&&(t="\\lVert",a="\\rVert")}if(e=Is(e,t,a,i))return r&&(e.index+=1),e.ast={fn:Ss[t+a]||t+a,arg:[e.ast]},e.minPrec=s,e}}}function Hs(e,t){return e.index=e.index||0,!(e.atoms.length<=1||e.index>=e.atoms.length-1)&&t===As(e.atoms[e.index])+As(e.atoms[e.index+1])}function Ws(e){if(e.index=e.index||0,!(e.atoms.length<=1||e.index>=e.atoms.length-1)){if(!Es(e,"textord","\\nabla")){const t=e.atoms[e.index].symbol+e.atoms[e.index+1].symbol,a=/^(>=|<=|>>|<<|:=|!=)$/.test(t)?t:"";return a&&(e.index+=1),a}return e.index+=1,Es(e,"mbin","\\times")?(e.index+=1,e.ast="curl",e):Es(e,"mbin","\\cdot")?(e.index+=1,e.ast="div",e):void(e.index-=1)}}function Vs(t,a){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(a,i){if(a.index=a.index||0,a.ast=void 0,0===a.atoms.length||a.index>=a.atoms.length)return a;let s=a.atoms[a.index];if("text"===s.mode){let e="";for(;a.atoms[a.index]&&"text"===a.atoms[a.index].mode;)e+=a.atoms[a.index].body,a.index+=1;return a.ast={text:e},a}const o=xs(As(s));if(Ws(a))a.ast=Fs(a.ast,t(a,i).ast);else{if("root"===s.type)return a.index=0,a.atoms=s.body,t(a,i);if("mbin"===s.type&&"-"===o)a.index+=1,(a=t(a,i)).ast=Bs(a.ast);else if("mbin"===s.type&&"+"===o)a.index+=1,(a=t(a,i)).ast=Fs("add",a.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.symbol)){let e="",o=!1,r=/^[0-9.eEdD]$/;for(;a.index0&&"\\"===n.charAt(0)&&"string"==typeof e.body&&(n=e.body)),o=J(n,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),o!==n?(r={sym:o},l="normal"):r={sym:n};break;case"minner":case"mop":break;case"box":r=Gs(e.body,t);break;case"enclose":break;case"array":if("cardinality"===e.environmentName)r=Fs("card",Gs(e.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(e.environmentName)){r={fn:"array",args:[]};for(const a of e.array)r.args.push(a.map(e=>Gs(e,t)))}else if("cases"===e.environmentName){r={fn:"cases",args:[]};for(const a of e.array)if(a[0]){const e=[];e.push(Gs(a[0],t));let i=Gs(a[1],t);i&&"text"===i.fn&&i.arg&&/^(if|when|for)$/i.test(i.arg[0].trim())&&(i=i.arg.filter(e=>"string"!=typeof e)),e.push(null!=i?i:{}),r.args.push(e)}}break;case"spacing":case"space":case"mathstyle":break;default:r=void 0}return r&&l&&"normal"!==l&&(r.variant=l),r&&"string"==typeof e.cssClass&&(r.class=e.cssClass),r&&"string"==typeof e.cssId&&(r.id=e.cssId),r}function js(t){if(!t)return[];let a;if(e(t)){a=[];for(const e of t){const t=js(e);a=a.concat(t)}}else{if("spacing"===t.type||"first"===t.type)return[];"box"===t.type?a=js(t.body):(t.body&&e(t.body)&&(t.body=js(t.body)),t.superscript&&e(t.superscript)&&(t.superscript=js(t.superscript)),t.subscript&&e(t.subscript)&&(t.subscript=js(t.subscript)),t.index&&e(t.index)&&(t.index=js(t.index)),t.denom&&e(t.denom)&&(t.denom=js(t.denom)),t.numer&&e(t.numer)&&(t.numer=js(t.numer)),t.array&&e(t.array)&&(t.array=t.array.map(e=>e.map(e=>js(e)))),a=[t])}return a}function Gs(e,t){return function(e,t){e.index=e.index||0,e.ast=void 0;const a=[];for(;e.atoms[e.index];)if("text"===e.atoms[e.index].mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;a.push(Fs("text",t))}else{const i=Vs(e,t).ast;if(!i)return;a.push(i)}return a.length>1?Fs("sequence",...a):a[0]||void 0}({atoms:js(e)},t)}function Zs(e,t){return Gs(e,t)}function Xs(e,...t){e=e||".. ";let a="";if(t.length>0){"."!==e[0]&&(a+=e[0]);let i="";for(const s of t)a+=i+s,i=e[2];"."!==e[1]&&(a+=e[1])}return a}function Ys(e,t){const a=e.length;e=e.substr(0,t.precision-2);for(let a=0;a1&&(i+o.repeat(r+1)).startsWith(e))return"0"===o?i.replace(/(\d{3})/g,"$1"+t.groupSeparator):i.replace(/(\d{3})/g,"$1"+t.groupSeparator)+t.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+t.groupSeparator)+t.endRepeatingDigits}}return a!==e.length&&(e+="\\ldots"),e.replace(/(\d{3})/g,"$1"+t.groupSeparator)}function Js(e){return parseFloat(parseFloat(e).toPrecision(15))}function Qs(e,t){let a,i="";if("number"==typeof t.precision){if("number"!=typeof e){let a="",i="";if("-"===e[0]?(a="-",e=e.substr(1)):"+"===e[0]&&(e=e.substr(1)),e.indexOf(".")>=0){const s=e.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=s[1],r=s[2].substring(0,Math.min(t.precision-o.length,s[2].length));if(i=s[4]||"","0"===o){let i=0;for(;"0"===r[i]&&i=t.precision)s="0",a="";else{s=e[i];const a=Ys(e.substr(i+1),t);a&&(s+=t.decimalMarker+a)}"0"!==s&&(e.length-1>t.precision&&!s.endsWith("}")&&!s.endsWith("\\ldots")&&(s+="\\ldots"),i>4&&(s+=t.exponentProduct,t.exponentMarker?s+=t.exponentMarker+(1-i).toString():s+="10^{"+(1-i).toString()+"}")),e=s}else{e=o.replace(/\B(?=(\d{3})+(?!\d))/g,t.groupSeparator);const a=Ys(r,t);a&&(e+=t.decimalMarker+a)}}else if(e.length>t.precision){const a=e.length;let i=e[0];const s=Ys(e.substr(2),t);s&&(i+=t.decimalMarker+s,"}"!==i[i.length-1]&&(i+="\\ldots")),"1"!==i?i+=t.exponentProduct:i="",t.exponentMarker?i+=t.exponentMarker+(a-2).toString():i+="10^{"+(a-2).toString()+"}",e=i}else e=e.replace(/\B(?=(\d{3})+(?!\d))/g,t.groupSeparator);return i&&(i=t.exponentMarker?t.exponentMarker+i:t.exponentProduct+" 10^{"+i+"}"),a+e+i}a=Js(e)}if("engineering"===t.scientificNotation)if(0===a)i="0";else{const e=Math.abs(a);let s=Math.round(Math.log10(e));s-=s%3,e<1e3&&(s=0);const o=e/Math.pow(10,s);let r="";const n=o.toString().match(/^(.*)\.(.*)$/);(null==n?void 0:n[1])&&n[2]&&(r=n[1]+t.decimalMarker+n[2]),t.groupSeparator&&(r=Ys(o.toExponential(),t));let l="";l=0===s?"":t.exponentMarker?t.exponentMarker+s:t.exponentProduct+" 10^{"+s+"}",i=(a<0?"-":"")+r+l}else{const a="string"==typeof e?e:e.toString();let s,o,r,n=a.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);s=a,r="",(null==n?void 0:n[1])&&n[2]&&(s=n[1],o=t.exponentMarker?t.exponentMarker+n[2]:t.exponentProduct+" 10^{"+n[2]+"}"),n=s.match(/^(.*)\.(.*)$/),(null==n?void 0:n[1])&&n[2]&&(s=n[1],r=n[2]),t.groupSeparator&&(s=s.replace(/\B(?=(\d{3})+(?!\d))/g,t.groupSeparator),r=Ys(r,t)),r&&(r=t.decimalMarker+r),i=s+r+(o||"")}return i}class eo{constructor(e,t){this.config=Ni({namespace:"",substituteTextArea:void 0,readOnly:!1,createHTML:e=>e,defaultMode:"math",macros:P,horizontalSpacingScale:1,letterShapeStyle:"auto",smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,ignoreSpacebarInMathMode:!0,locale:"auto",strings:{},keybindings:ra,overrideDefaultInlineShortcuts:!1,inlineShortcuts:{},inlineShortcutTimeout:0,virtualKeyboardToggleGlyph:'',virtualKeyboardMode:"auto",virtualKeyboards:"all",virtualKeyboardLayout:"auto",customVirtualKeyboardLayers:{},customVirtualKeyboards:{},virtualKeyboardTheme:/android|cros/i.test(null===navigator||void 0===navigator?void 0:navigator.userAgent)?"material":"apple",keypressVibration:!0,keypressSound:null,plonkSound:null,textToSpeechRules:"mathlive",textToSpeechMarkup:"",textToSpeechRulesOptions:{},speechEngine:"local",speechEngineVoice:"Joanna",speechEngineRate:"100%",speakHook:Ki,readAloudHook:Ki,onAnnounce:Ti,onKeystroke:()=>!0,onMoveOutOf:()=>!0,onTabOutOf:()=>!0,onBlur:Ki,onFocus:Ki,onContentWillChange:Ki,onContentDidChange:Ki,onSelectionWillChange:Ki,onSelectionDidChange:Ki,onUndoStateWillChange:Ki,onUndoStateDidChange:Ki,onModeChange:Ki,onVirtualKeyboardToggle:Ki,onReadAloudStatus:Ki,onError:()=>{}},t),this.element=e,e.mathfield=this,this.originalContent=e.innerHTML;let a=this.element.textContent;a&&(a=a.trim());let i="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?i+=this.config.substituteTextArea:i+="":/android|ipad|ipod|iphone/i.test(null===navigator||void 0===navigator?void 0:navigator.userAgent)?i+="\n \n \n ":i+='',i+='',"manual"===this.config.virtualKeyboardMode?(i+=`
    `,this.config.virtualKeyboardToggleGlyph?i+=this.config.virtualKeyboardToggleGlyph:i+='',i+="
    "):i+="",i+="
    ",i+='\n
    \n \n \n
    \n ',this.element.innerHTML=this.config.createHTML(i);let s=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[s++].firstElementChild,this.field=this.element.children[s].children[0],this.field.addEventListener("wheel",e=>{e.preventDefault(),e.stopPropagation();const t=void 0===e.deltaX?e.detail:-e.deltaX;isFinite(t)&&this.field.scroll({top:0,left:this.field.scrollLeft-5*t})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[s++].children[1],va(this,this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[s].children[0],this.accessibleNode=this.element.children[s++].children[1],this.popover=ua("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=ua("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=this.config.defaultMode,this.smartModeSuppressed=!1,this.style={},this.blurred=!0,pa(this.element,"focus",this),pa(this.element,"blur",this),pa(this.textarea,"cut",this),pa(this.textarea,"copy",this),pa(this.textarea,"paste",this),function(e,t){let a,i=null,s=null,o=!1,r=!1;function n(e){clearTimeout(a),a=setTimeout((function(){clearTimeout(a),e()}))}function l(){if(function(e){return e.selectionStart!==e.selectionEnd}(e))return;const a=e.value;e.value="",a.length>0&&t.typedText(a)}const c=e;c.addEventListener("keydown",a=>{if(t.allowDeadKey()||"Dead"!==a.key&&"Unidentified"!==a.key&&229!==a.keyCode)r=!1;else{r=!0,o=!1;const a=t.blur,i=t.focus;t.blur=null,t.focus=null,"function"==typeof e.blur&&(e.blur(),e.focus()),t.blur=a,t.focus=i}return!(!o&&"CapsLock"!==a.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(a.code))||(i=a,s=null,t.keystroke(gi(a),a))},!0),c.addEventListener("keypress",e=>{o||(i&&s&&t.keystroke(gi(i),i),s=e,n(l))},!0),c.addEventListener("keyup",()=>{o||!i||s||l()},!0),c.addEventListener("paste",()=>{e.focus();const a=e.value;e.value="",a.length>0&&t.paste(a)},!0),c.addEventListener("blur",()=>{i=null,s=null,t.blur&&t.blur()},!0),c.addEventListener("focus",()=>{t.focus&&t.focus()},!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r&&t.allowDeadKey()&&n(l)},!0),c.addEventListener("input",()=>{if(r){const a=t.blur,i=t.focus;t.blur=null,t.focus=null,e.blur(),e.focus(),t.blur=a,t.focus=i,r=!1,o=!1,t.allowDeadKey()&&n(l)}else o||n(l)})}(this.textarea,{allowDeadKey:()=>"text"===this.mode,typedText:e=>Hi(this,e),paste:()=>Ui(this),keystroke:(e,t)=>Ii(this,e,t),focus:()=>this._onFocus(),blur:()=>this._onBlur()}),window.PointerEvent?pa(this.field,"pointerdown",this):pa(this.field,"touchstart:active mousedown",this),pa(window,"resize",this),this.model=new bt({mode:this.config.defaultMode,macros:this.config.macros,removeExtraneousParentheses:this.config.removeExtraneousParentheses},{onContentDidChange:e=>this.config.onContentDidChange(this),onSelectionDidChange:e=>this._onSelectionDidChange(),onContentWillChange:()=>this.config.onContentWillChange(this),onSelectionWillChange:()=>this.config.onSelectionWillChange(this),onError:this.config.onError},{announce:(e,t,a,i)=>{var s,o;return null===(o=(s=this.config).onAnnounce)||void 0===o?void 0:o.call(s,this,t,a,i)},moveOut:(e,t)=>this.config.onMoveOutOf(this,t),tabOut:(e,t)=>this.config.onTabOutOf(this,t)},this),this.undoManager=new bi(this.model),di(this.model,a,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:!0,macros:this.config.macros}),this.undoManager.startRecording(),this.undoManager.snapshot(this.config),this.model.setListeners({onContentDidChange:e=>this.config.onContentDidChange(this),onSelectionDidChange:e=>this._onSelectionDidChange(),onContentWillChange:()=>this.config.onContentWillChange(this),onSelectionWillChange:()=>this.config.onSelectionWillChange(this),onError:this.config.onError}),this.model.setHooks({announce:(e,t,a,i)=>{var s,o;return null===(o=(s=this.config).onAnnounce)||void 0===o?void 0:o.call(s,this,t,a,i)},moveOut:(e,t)=>this.config.onMoveOutOf(this,t),tabOut:(e,t)=>this.config.onTabOutOf(this,t)}),this.config.locale.startsWith(oa().locale)||sa(this.config.locale),this.keybindings=ma(this.config.keybindings,e=>{"function"==typeof this.config.onError&&this.config.onError({code:"invalid-keybinding",arg:e.join("\n")})}),Va(this)}$setConfig(e){this.config=Ni(this.config,e),this.model.setListeners({onContentDidChange:e=>this.config.onContentDidChange(this),onSelectionDidChange:e=>this._onSelectionDidChange(),onContentWillChange:()=>this.config.onContentWillChange(this),onSelectionWillChange:()=>this.config.onSelectionWillChange(this),onError:this.config.onError}),this.model.setHooks({announce:(e,t,a,i)=>{var s,o;return null===(o=(s=this.config).onAnnounce)||void 0===o?void 0:o.call(s,this,t,a,i)},moveOut:(e,t)=>this.config.onMoveOutOf(this,t),tabOut:(e,t)=>this.config.onTabOutOf(this,t)}),this.config.locale.startsWith(oa().locale)||sa(this.config.locale),this.keybindings=ma(this.config.keybindings,e=>{"function"==typeof this.config.onError&&this.config.onError({code:"invalid-keybinding",arg:e.join("\n")})}),this.config.readOnly||this._onBlur(),Va(this)}getConfig(e){return Bi(this.config,e)}handleEvent(e){switch(e.type){case"focus":this._onFocus();break;case"blur":this._onBlur();break;case"touchstart":case"mousedown":case"pointerdown":!function(e,t){const a=e;let i,s=!1,o=!1,r=!1;if(1!==t.buttons&&0!==t.buttons)return;let n=!1,l=!1;const c=t.touches?t.touches[0].clientX:t.clientX,d=t.touches?t.touches[0].clientY:t.clientY,m=Date.now(),p=setInterval(()=>{n?a.field.scroll({top:0,left:a.field.scrollLeft-16}):l&&a.field.scroll({top:0,left:a.field.scrollLeft+16})},32);function h(e){window.PointerEvent?(ha(a.field,"pointermove",u),ha(a.field,"pointerup pointercancel",h),a.field.releasePointerCapture(e.pointerId)):(ha(a.field,"touchmove",u),ha(a.field,"touchcancel touchend",h),ha(window,"mousemove",u),ha(window,"mouseup blur",h)),s=!1,clearInterval(p),a.element.querySelectorAll(".ML__scroller").forEach(e=>e.parentNode.removeChild(e)),e.preventDefault(),e.stopPropagation()}function u(t){const s=t.touches?t.touches[0].clientX:t.clientX,r=t.touches?t.touches[0].clientY:t.clientY,p="touch"===t.pointerType?20:5;if(Date.now()h.right,n=s=f.left&&c<=f.right&&d>=f.top&&d<=f.bottom){e.$hasFocus()||(r=!0,e.textarea.focus&&e.textarea.focus()),e.resetKeystrokeBuffer(),e.smartModeSuppressed=!1;const n=e.field.querySelector(".ML__mathlive").getBoundingClientRect();if(i=c>n.right?[{relation:"body",offset:e.model.root.body.length-1}]:Zi(e,c,d,{bias:0}),i){let n=document.createElement("div");n.className="ML__scroller",e.element.appendChild(n),n.style.left=f.left-200+"px",n=document.createElement("div"),n.className="ML__scroller",e.element.appendChild(n),n.style.left=f.right+"px",t.shiftKey?(Ut(e.model,e.model.path,i),i=pt(e.model.path),i[i.length-1].offset-=1):jt(e.model,i,0),r=!0,e.style={},3===t.detail||Gi>2?(h(t),3!==t.detail&&3!==Gi||Ot(e.model)):s||(s=!0,window.PointerEvent?(pa(a.field,"pointermove",u),pa(a.field,"pointerup pointercancel",h),a.field.setPointerCapture(t.pointerId)):(pa(window,"blur",h),t.touches?(pa(t.target,"touchmove",u),pa(t.target,"touchcancel touchend",h)):(pa(window,"mousemove",u),pa(window,"mouseup",h))),2!==t.detail&&2!==Gi||(o=!0,Bt(e.model)))}}else ji=null;r&&Va(e),t.preventDefault()}(this,e);break;case"resize":this.resizeTimer&&window.cancelAnimationFrame(this.resizeTimer),this.resizeTimer=window.requestAnimationFrame(()=>ga(this)&&this._onResize());break;case"cut":t=this,setTimeout(function(){t.$clearSelection(),Va(t)}.bind(t),0);break;case"copy":!function(e,t){Rt(e.model)?(t.clipboardData.setData("text/plain","$$"+e.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",e.$text("json")),t.clipboardData.setData("application/xml",e.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+e.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",e.$selectedText("json")),t.clipboardData.setData("application/xml",e.$selectedText("mathML"))),t.preventDefault()}(this,e);break;case"paste":Ui(this)}var t}$revertToOriginalContent(){this.element.innerHTML=this.config.createHTML(this.originalContent),delete this.element.mathfield,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,ha(this.textarea,"cut",this),ha(this.textarea,"copy",this),ha(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,fa(this.popover),delete this.popover,fa(this.keystrokeCaption),delete this.keystrokeCaption,fa(this.virtualKeyboard),delete this.virtualKeyboard,fa(document.getElementById("mathlive-alternate-keys-panel")),ha(this.element,"pointerdown",this),ha(this.element,"touchstart:active mousedown",this),ha(this.element,"focus",this),ha(this.element,"blur",this),ha(window,"resize",this),delete this.element}resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_onSelectionDidChange(){!function(e){const t=Mt(e);if(t){const a=e.siblings(),i=e.anchorOffset()+1;for(let e=t.start;e=0;e--)"command"===a[e].type?a.splice(e,1):t(a[e]);else if(t(a.body),t(a.superscript),t(a.subscript),t(a.underscript),t(a.overscript),t(a.numer),t(a.denom),t(a.index),a.array)for(let e=gt(a.array);e>=0;e--)t(ft(a.array,e))}(t.root.body),t.suppressChangeNotifications=a,wt(t)}(this.model))}wa(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&cs(this),wa(this),this.config.onFocus&&this.config.onFocus(this),Va(this))}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&ds(this),Li(this,{discard:!0}),Va(this),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),wa(this)}$perform(t){return function(t,a){var i;if(!a)return!1;let s,o=[],r=!1,n=!1;if(e(a)?(s=a[0],o=a.slice(1)):s=a,s=s.replace(/-\w/g,e=>e[1].toUpperCase()),"model"===(null===(i=ja[s])||void 0===i?void 0:i.target)){if(/^(delete|transpose|add)/.test(s)&&t.resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(s)&&"command"!==t.mode&&(t.popUndoStack(),t.snapshot()),ja[s].fn(t.model,...o),/^(delete|transpose|add)/.test(s)&&"command"!==t.mode&&t.snapshot(),/^(delete)/.test(s)&&"command"===t.mode){const e=oe(La(t.model));0===e.length?Ma(t):ka(t,e[0].match,e.length>1)}n=!0,r=!0}else{if(!ja[s])throw Error('Unknown command "'+s+'"');n=ja[s].fn(t,...o),r=!0}return Rt(t.model)&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(s)||(t.resetKeystrokeBuffer(),t.style={}),n&&Va(t),r}(this,t)}formatMathlist(e,t){let a="";if("latex"===(t=t||"latex")||"latex-expanded"===t)a=e.toLatex("latex-expanded"===t);else if("mathML"===t)a=Ha(e,this.config);else if("spoken"===t)a=_i(e,this.config);else if("spoken-text"===t){const t=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",a=_i(e,this.config),this.config.textToSpeechMarkup=t}else if("spoken-ssml"===t||"spoken-ssml-withHighlighting"===t){const t=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="ssml",a=_i(e,this.config),this.config.textToSpeechMarkup=t}else if("json"===t){const t=Zs(e);a=JSON.stringify(t)}else if("json-2"===t){const t=Zs(e);a=JSON.stringify(t,null,2)}else"ASCIIMath"===t&&(a=ki(e));return a}$text(e){return this.formatMathlist(this.model.root,e)}$selectedText(e){const t=Nt(this.model);if(!t)return"";const a=Oe("math",t);return this.formatMathlist(a,e)}$selectionIsCollapsed(){return Rt(this.model)}$selectionDepth(){return this.model.path.length}$selectionAtStart(){return 0===this.model.startOffset()}$selectionAtEnd(){return this.model.endOffset()>=this.model.siblings().length-1}groupIsSelected(){return 0===this.model.startOffset()&&this.model.endOffset()>=this.model.siblings().length-1}$latex(e,t){return"string"==typeof e?(e!==this.model.root.toLatex()&&(t=null!=t?t:{mode:"math"},di(this.model,e,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:t.suppressChangeNotifications,macros:this.config.macros}),this.undoManager.snapshot(this.config),Va(this)),e):this.model.root.toLatex()}$el(){return this.element}scrollIntoView(){var e;this.dirty&&Ua(this);let t=null===(e=ya(this.field))||void 0===e?void 0:e.x;const a=this.field.getBoundingClientRect();if(void 0===t){const e=ba(this.field);e&&(t=e.right+a.left-this.field.scrollLeft)}if(void 0!==t){const e=t-window.scrollX;ea.right&&this.field.scroll({top:0,left:e-a.right+this.field.scrollLeft+20,behavior:"smooth"})}}$insert(e,t){if("string"==typeof e&&e.length>0){if((t=null!=t?t:{mode:"math"}).focus&&this.$focus(),t.feedback&&(this.config.keypressVibration&&(null===navigator||void 0===navigator?void 0:navigator.vibrate)&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===e)Ja(this.model);else if("&"===e)Qa(this.model);else{const a=this.style;di(this.model,e,{mode:this.mode,style:Ct(this.model),...t}),t.resetStyle&&(this.style=a)}return this.undoManager.snapshot(this.config),Va(this),!0}return!1}switchMode(e,t="",a=""){this.resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(e),t&&this.$insert(t,{format:"latex",mode:{math:"text",text:"math"}[e]}),Ca(this.model,!1),"command"===e?(nt(this.model),Ma(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&ls(this,"lower-command"),di(this.model,"",{mode:"math"})):this.mode=e,a&&this.$insert(a,{format:"latex",mode:e}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),Va(this)}$hasFocus(){return document.hasFocus()&&function e(t=document){var a,i;return(null===(i=null===(a=t.activeElement)||void 0===a?void 0:a.shadowRoot)||void 0===i?void 0:i.activeElement)?e(t.activeElement.shadowRoot):t.activeElement}(document)===this.textarea}$focus(){this.$hasFocus()||("function"==typeof this.textarea.focus&&this.textarea.focus(),this.model.announce("line"))}$blur(){this.$hasFocus()&&this.textarea.blur&&this.textarea.blur()}$select(){Ot(this.model)}$clearSelection(){ti(this.model)}$applyStyle(e){ci(this.model,e)}$keystroke(e,t){return Ii(this,e,t)}$typedText(e){Hi(this,e)}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(){this.undoManager.snapshot({...this.config,onUndoStateDidChange:(e,t)=>{ns(this),this.config.onUndoStateDidChange(e,t)}})}snapshotAndCoalesce(){this.undoManager.snapshotAndCoalesce({...this.config,onUndoStateDidChange:(e,t)=>{ns(this),this.config.onUndoStateDidChange(e,t)}})}getUndoRecord(){return this.undoManager.save()}restoreToUndoRecord(e){this.undoManager.restore(e,{...this.config,suppressChangeNotifications:!0})}undo(){return this.undoManager.undo({...this.config,onUndoStateDidChange:(e,t)=>{ns(this),this.config.onUndoStateDidChange(e,t)}})}redo(){return this.undoManager.redo({...this.config,onUndoStateDidChange:(e,t)=>{ns(this),this.config.onUndoStateDidChange(e,t)}})}}function to(e,t,a){let i=a,s=0;const o=e.length;for(;i0&&s.push({type:"text",data:r.slice(0,c)}),l=!1);let d=!1;for(;!d;){if(l){if(n=r.indexOf(t,c),-1===n){d=!0;break}c!==n&&s.push({type:"text",data:r.slice(c,n)}),c=n}else{if(n=to(a,r,c+t.length),-1===n){d=!0;break}s.push({type:"math",data:r.slice(c+t.length,n),rawData:r.slice(c,n+a.length),mathstyle:i}),c=n+a.length}l=!l}c";a.innerHTML=t.createHTML?t.createHTML(i):i}catch(t){a.textContent=e}return a.className="sr-only",a}(e,a)),/\bspeakable-text\b/i.test(a.renderAccessibleContent)&&a.renderToSpeakableText){const i=document.createElement("span"),s=a.renderToSpeakableText(e,a);i.innerHTML=a.createHTML?a.createHTML(s):s,i.className="sr-only",t.appendChild(i)}return t.appendChild(s),t}return s}function oo(e,t){let a=null;if(t.TeX.processEnvironments&&/^\s*\\begin/.test(e))a=document.createDocumentFragment(),a.appendChild(so(e,void 0,t,!0));else{const i=io(e,t.TeX.delimiters);if(1===i.length&&"text"===i[0].type)return null;a=document.createDocumentFragment();for(let e=0;e0?no(e[t].children,a):e[t];if("string"==typeof t){for(let s=0;s0?no(e[s].children,a):e[s];if(i=no(e[s].children,t),i)return i}return i}return null}function lo(e,t){var a;const i=no(e,t);return i?null!==(a=i.classes)&&void 0!==a?a:"":null}function co(e,t){let a="";return e[t]&&(a+=''+t+"=",a+='',a+=e[t],a+='" '),a}var mo={mathlistToMarkup:function e(t,a=""){if(!t)return"";let i="";if(Array.isArray(t))for(let s=0;s"),"string"==typeof t.body&&t.body.length>0&&(i+=' ',i+=t.body,(t.body.charCodeAt(0)<32||t.body.charCodeAt(0)>127)&&(i+=" U+"+("000000"+t.body.charCodeAt(0).toString(16)).substr(-6)),i+=" "),"mathrm"===t.fontFamily?(i+='',i+=co(t,"fontFamily"),i+=""):i+=co(t,"fontFamily"),i+=co(t,"hasBarLine"),i+=co(t,"leftDelim"),i+=co(t,"rightDelim"),i+=co(t,"continuousFraction"),i+=co(t,"limits"),i+=co(t,"symbol"),i+=function(e,t){let a="";return e.framecolor&&(a+='framecolor=',a+='',a+='',a+=e.framecolor,a+=""),a}(t),i+=co(t,"mathstyle"),i+=co(t,"size"),i+=co(t,"cls"),i+=co(t,"delim"),i+=co(t,"shift"),i+=co(t,"width"),i+=co(t,"height"),i+=co(t,"position"),i+=e(t.overscript,a+"↑"),i+=e(t.underscript,a+"↓"),i+=e(t.superscript,a+"↑"),i+=e(t.subscript,a+"↓"),i+=e(t.body,a+"▶"),i+=e(t.numer,a+"▲"),i+=e(t.denom,a+"▼"),t.array)for(let s=0;s"+a+"⌗ row "+(s+1)+"/"+t.array.length;for(let o=0;o"),t.body&&t.body.length>0&&(i+=''+t.body+""),t.classes&&t.classes.length>0&&(i+=' '+t.classes+""),t.isTight&&(i+='  tight '),t.caret&&(i+='  caret '),t.style)for(const e in t.style)Object.prototype.hasOwnProperty.call(t.style,e)&&(i+=' '+e+":",i+=' '+t.style[e]+"; ");t.children&&(i+=t.children.map(t=>e(t,a+"▷")).join("; "))}return i},spanToString:function e(t,a=""){let i="";if(Array.isArray(t))if(0===t.length)i+="[]\n";else{i+="[\n";for(let s=0;s0&&(i+=a+'body:"'+t.body+'",\n'),t.classes&&t.classes.length>0&&(i+=a+'classes:"'+t.classes+'",\n'),t.style)for(const e in t.style)Object.prototype.hasOwnProperty.call(t.style,e)&&(i+=a+e+':"',i+=t.style[e]+'",\n');t.children&&t.children.length>0&&(i+=a+"children:"+t.children.map(t=>e(t,a)).join("; ")),i+=a+"}"}return i},hasClass:function(e,t,a){const i=lo(e,t);if(!i)return!1;const s=i.split(" ");for(let e=0;e{if(e)return;if(!t||!t.AudioStream)return;const a=new TextDecoder("utf-8").decode(new Uint8Array(t.AudioStream));window.mathlive.readAloudMarks=a.split("\n").map(e=>e?JSON.parse(e):{}),window.mathlive.readAloudTokens=[];for(const e of window.mathlive.readAloudMarks)e.value&&window.mathlive.readAloudTokens.push(e.value);window.mathlive.readAloudCurrentMark="",o.OutputFormat="mp3",o.SpeechMarkTypes=[],s.synthesizeSpeech(o,(function(e,t){if(e)return;if(!t||!t.AudioStream)return;const a=new Uint8Array(t.AudioStream),i=new Blob([a.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{const e=window.mathlive.readAloudMathField;r&&r(e,"ended"),e?(Ua(e),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function e(t){if(t.classList.remove("highlight"),t.children)for(const a of t.children)e(a)}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let e="";const t=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const a of window.mathlive.readAloudMarks)a.time0&&Array.from(t.children).forEach(t=>{e(t,a)})):(t.classList.add("highlight"),t.children&&t.children.length>0&&Array.from(t.children).forEach(t=>{e(t)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,r&&r(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}))})}function ho(e,t,a=3e3,i="$0"){t.forEach(t=>{N[t]&&(N[t].frequency=a,N[t].category=e,N[t].template=i.replace(/\$0/g,t)),O[t]&&(O[t]={...O[t],frequency:a,category:e,template:i.replace(/\$0/g,t)})})}function uo(e,t){(t=null!=t?t:{}).mathstyle=t.mathstyle||"displaystyle",t.letterShapeStyle=t.letterShapeStyle||"auto";const a=ot(e,"math",null,t.macros,!1,t.onError);let i=Ne({mathstyle:c[t.mathstyle],letterShapeStyle:t.letterShapeStyle},a);return i=function e(t){if(!t||0===t.length)return[];t[0].children=e(t[0].children);const a=[t[0]];for(let i=1;i0\\right\\}"),ho("Layout",["\\overset","\\underset","\\stackrel","\\stackbin"],1200,"$0{arg}{x=0}"),ho("Layout",["\\rlap","\\mathrlap"],1200,"$0{/}0"),ho("Layout",["\\llap","\\mathllap"],1200,"o$0{/}"),ho("Fractions",["\\frac"],4e3,"$0{\\placeholder{}}{\\placeholder{}}"),ho("Fractions",["\\binom","\\dfrac","\\tfrac","\\dbinom","\\tbinom","\\pdiff","\\cfrac"],1200,"$0{\\placeholder{}}{\\placeholder{}}"),ho("Fractions",["\\over","\\atop","\\choose"],1200,'\\unicode{"2B1A} $0 \\unicode{"2B1A}'),ho("Fractions",["\\overwithdelims","\\atopwithdelims"],1200,'{\\unicode{"2B1A} $0{\\lbrace}{\\rbrace} \\unicode{"2B1A}}'),ho("Extensible Operators",["\\sum","\\prod","\\bigcap","\\bigcup","\\int"],4e3),ho("Extensible Operators",["\\bigoplus","\\smallint","\\iint","\\oint"],3e3),ho("Extensible Operators",["\\bigwedge","\\bigvee","\\coprod","\\bigsqcup","\\bigotimes","\\bigodot","\\biguplus","\\intop","\\sqcup","\\sqcap","\\uplus","\\wr","\\Cap","\\Cup","\\doublecap","\\doublecup","\\amalg","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],1200),ho("Accents",["\\vec"],4e3),ho("Accents",["\\bar","\\ddot","\\acute","\\tilde","\\check"],3e3,"$0{\\placeholder{}}"),ho("Accents",["\\^","\\`","\\'"],1200,"$0{e}"),ho("Accents",["\\c"],1200,"$0{c}"),ho("Accents",["\\~"],1200,"$0{n}"),ho("Accents",["\\mathring","\\hat","\\dot","\\breve","\\grave"],1200,"$0{\\placeholder{}}"),ho("Extensible Symbols",["\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftharpoon","\\overrightharpoon","\\overleftrightarrow","\\overbrace","\\overlinesegment","\\overgroup","\\widehat","\\widecheck","\\widetilde"],3e3,"$0{ABC}"),ho("Extensible Symbols",["\\underrightarrow","\\underleftarrow","\\underleftrightarrow","\\underbrace","\\underlinesegment","\\undergroup","\\utilde"],3e3,"$0{ABC}"),ho("Sizing",["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],1200,"$0{x=0}"),ho("Sizing",["\\big","\\Big","\\bigg","\\Bigg"],1200,"$0($0)"),ho("Sizing",["\\bigl","\\Bigl","\\biggl","\\Biggl"],1200,"$0("),ho("Sizing",["\\bigr","\\Bigr","\\biggr","\\Biggr"],1200,"$0)"),ho("Sizing",["\\bigm","\\Bigm","\\biggm","\\Biggm"],1200,"$0|"),ho("Letterlike Symbols",["\\nabla","\\partial","\\doubleStruckCapitalN","\\N","\\doubleStruckCapitalR","\\R","\\doubleStruckCapitalQ","\\Q","\\doubleStruckCapitalC","\\C","\\doubleStruckCapitalZ","\\Z","\\exponentialE","\\forall","\\exists","\\nexists","\\$","\\%","\\And","\\degree"],4e3),ho("Letterlike Symbols",["\\doubleStruckCapitalP","\\P","\\ell","\\hbar","\\hslash","\\imath","\\jmath","\\imaginaryI","\\imaginaryJ","\\differentialD","\\rd","\\capitalDifferentialD","\\rD","\\differencedelta","\\mid","@","\\Re","\\Im"],3e3),ho("Letterlike Symbols",["\\top","\\bot","\\scriptCapitalE","\\scriptCapitalH","\\scriptCapitalL","\\gothicCapitalC","\\gothicCapitalH","\\gothicCapitalI","\\gothicCapitalR","\\Bbbk","\\Finv","\\Game","\\wp","\\eth","\\mho","\\pounds","\\yen","\\euro"],1200),ho("Crosses",["\\dagger","\\dag"],4e3),ho("Crosses",["\\ddag","\\ddagger","\\maltese","\\textdagger","\\textdaggerdbl"],1200),ho("Various",["\\checkmark","\\diagup","\\diagdown","\\angle","\\measuredangle","\\sphericalangle","\\prime","\\doubleprime","\\backprime","\\backdoubleprime","\\sharp","\\flat","\\natural","\\&","\\#","\\clubsuit","\\spadesuit","\\diamondsuit","\\heartsuit","\\backslash","\\infty","/","\\_","\\/","|","'"],1200),ho("Various",["\\unicode"],1200,'$0{"2B1A}'),ho("Arrows",["\\longrightarrow","\\rightarrow","\\Longrightarrow","\\Rightarrow"],4e3),ho("Arrows",["\\longmapsto","\\mapsto","\\Longleftrightarrow","\\rightleftarrows","\\leftarrow","\\curvearrowleft","\\uparrow","\\downarrow","\\hookrightarrow","\\rightharpoonup","\\rightleftharpoons"],3e3),ho("Arrows",["\\Leftarrow","\\longleftrightarrow","\\longleftarrow","\\Longleftarrow","\\searrow","\\nearrow","\\swarrow","\\nwarrow","\\Uparrow","\\Downarrow","\\updownarrow","\\Updownarrow","\\hookleftarrow","\\leftharpoonup","\\leftharpoondown","\\rightharpoondown","\\leftrightarrows","\\dashrightarrow","\\dashleftarrow","\\leftleftarrows","\\Lleftarrow","\\twoheadleftarrow","\\leftarrowtail","\\looparrowleft","\\leftrightharpoons","\\circlearrowleft","\\Lsh","\\upuparrows","\\downharpoonleft","\\multimap","\\leftrightsquigarrow","\\twoheadrightarrow","\\rightarrowtail","\\looparrowright","\\curvearrowright","\\circlearrowright","\\Rsh","\\downdownarrows","\\upharpoonright","\\downharpoonright","\\rightsquigarrow","\\leadsto","\\Rrightarrow","\\restriction"],1200),ho("Arrows",["\\upharpoonleft","\\rightrightarrows"],0),ho("Negated Arrows",["\\nrightarrow","\\nRightarrow","\\nleftrightarrow","\\nLeftrightarrow","\\nleftarrow","\\nLeftarrow"],1200),ho("Extensible Symbols",["\\xrightarrow","\\xleftarrow","\\xRightarrow","\\xLeftarrow","\\xleftharpoonup","\\xleftharpoondown","\\xrightharpoonup","\\xrightharpoondown","\\xlongequal","\\xtwoheadleftarrow","\\xtwoheadrightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xrightleftharpoons","\\xleftrightharpoons","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium"],1200,"$0[below]{above}=0"),ho("Negated Relations",["\\nless","\\nleqslant","\\lneq","\\lneqq","\\nleqq","\\unlhd","\\unrhd","\\lvertneqq","\\lnsim","\\lnapprox","\\nprec","\\npreceq","\\precnsim","\\precnapprox","\\nsim","\\nshortmid","\\nmid","\\nvdash","\\nvDash","\\ngtr","\\ngeqslant","\\ngeqq","\\gneq","\\gneqq","\\gvertneqq","\\gnsim","\\nsucc","\\succnsim","\\ncong","\\nshortparallel","\\nparallel","\\nVDash","\\nVdash","\\precneqq","\\succneqq","\\gnapprox","\\succnapprox","\\nsucceq"],1200),ho("Hebrew",["\\aleph","\\beth","\\daleth","\\gimel"],1200),ho("Fences",["\\lbrace","\\rbrace","\\vert","\\Vert","\\{","\\}","(",")","[","]"],4e3),ho("Fences",["\\langle","\\rangle","\\lfloor","\\rfloor","\\lceil","\\rceil","\\mvert","\\|","\\mVert"],3e3),ho("Fences",["\\lvert","\\rvert","\\lVert","\\rVert","\\lbrack","\\rbrack","\\ulcorner","\\urcorner","\\llcorner","\\lrcorner","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache"],1200),ho("Relations",["=","\\ne","\\neq","<",">","\\leqslant","\\geqslant","\\approx"],4e3),ho("Relations",["\\lt","\\gt","\\le","\\ge","\\leq","\\geq","\\gg","\\cong","\\equiv","\\prec","\\preceq","\\succ","\\perp","\\parallel","\\propto","\\smile","\\frown","\\sim","\\gtrsim"],3e3),ho("Relations",["\\coloneq","\\succeq","\\approxeq","\\thickapprox","\\lessapprox","\\gtrapprox","\\precapprox","\\succapprox","\\thicksim","\\succsim","\\precsim","\\backsim","\\eqsim","\\backsimeq","\\simeq","\\lesssim","\\nleq","\\ngeq","\\smallsmile","\\smallfrown","\\bowtie","\\asymp","\\leqq","\\eqslantless","\\ll","\\lll","\\lessgtr","\\lesseqgtr","\\lesseqqgtr","\\risingdotseq","\\fallingdotseq","\\preccurlyeq","\\curlyeqprec","\\vDash","\\Vvdash","\\bumpeq","\\Bumpeq","\\geqq","\\eqslantgtr","\\ggg","\\gtrless","\\gtreqless","\\gtreqqless","\\succcurlyeq","\\curlyeqsucc","\\Vdash","\\shortmid","\\shortparallel","\\between","\\pitchfork","\\varpropto","\\backepsilon","\\llless","\\gggtr","\\lhd","\\rhd","\\Join","\\doteq","\\doteqdot","\\Doteq","\\eqcirc","\\circeq","\\lessdot","\\gtrdot","\\measeq","\\eqdef","\\questeq"],1200),ho("Logic",["\\leftrightarrow","\\Leftrightarrow","\\to"],4e3),ho("Logic",["\\models","\\vdash"],3e3),ho("Logic",["\\therefore","\\because","\\implies","\\gets","\\dashv","\\impliedby","\\biconditional","\\roundimplies"],1200),ho("Operators",["+","-","*","\\cdot"],4e3),ho("Operators",["\\sqrt"],4e3,"$0{\\placeholder{}}"),ho("Operators",["\\pm","\\mp","\\times","\\div","\\surd"],3e3),ho("Operators",["\\ltimes","\\rtimes","\\leftthreetimes","\\rightthreetimes","\\intercal","\\dotplus","\\centerdot","\\doublebarwedge","\\divideontimes","\\divides"],1200),ho("Logic",["\\wedge","\\vee","\\neg"],4e3),ho("Logic",["\\lnot"],3e3),ho("Logic",["\\land","\\lor","\\barwedge","\\veebar","\\nor","\\curlywedge","\\curlyvee"],1200),ho("Greek",["\\alpha","\\beta","\\gamma","\\delta","\\epsilon","\\varepsilon","\\zeta","\\eta","\\theta","\\vartheta","\\iota","\\kappa","\\varkappa","\\lambda","\\mu","\\nu","\\xi","\\pi","\\varpi","\\rho","\\varrho","\\sigma","\\varsigma","\\tau","\\phi","\\varphi","\\upsilon","\\chi","\\psi","\\omega","\\Gamma","\\Delta","\\Theta","\\Lambda","\\Xi","\\Pi","\\Sigma","\\Upsilon","\\Phi","\\Psi","\\Omega","\\digamma","\\omicron"],3e3),ho("Sets",["\\emptyset","\\varnothing","\\cap","\\cup","\\in","\\notin","\\subset","\\supset","\\subseteq","\\supseteq","\\sqsubseteq"],4e3),ho("Sets",["\\setminus","\\not","\\ni","\\sqsupseteq","\\nsupseteqq","\\supsetneq","\\varsupsetneq","\\supsetneqq","\\varsupsetneqq"],3e3),ho("Sets",["\\smallsetminus","\\complement","\\owns","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\varsubsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq","\\nsubseteqq","\\subseteqq","\\Subset","\\sqsubset","\\supseteqq","\\Supset","\\sqsupset"],1200),ho("Spacing",["\\space, \\quad","\\qquad"],3e3,'\\unicode{"203A}$0\\unicode{"2039}'),ho("Spacing",["\\!","\\,","\\:","\\;","\\enskip","\\enspace"],1200,'\\unicode{"203A}$0\\unicode{"2039}'),ho("Spacing",["\\hspace","\\hspace*"],1200,'\\unicode{"203A}$0{1em}\\unicode{"2039}'),ho("Punctuation",["\\colon","\\cdotp","\\ldots","\\cdots","\\ddots","\\vdots","?","!",":",'"',",",".",";"],3e3),ho("Punctuation",["\\mathellipsis","\\ldotp","\\Colon"],1200),ho("Boxes",["\\square","\\Box"],3e3),ho("Boxes",["\\blacksquare","\\boxminus","\\boxplus","\\boxtimes","\\boxdot"],1200),ho("Circles",["\\circ","\\bullet","\\circleddash","\\oplus","\\otimes"],3e3),ho("Circles",["\\bigcirc","\\circledast","\\ominus","\\circledcirc","\\oslash","\\circledS","\\circledR","\\odot"],1200),ho("Triangles",["\\triangle","\\triangleq"],3e3),ho("Triangles",["\\bigtriangleup","\\vartriangle","\\triangledown","\\bigtriangledown","\\triangleleft","\\vartriangleleft","\\trianglelefteq","\\ntriangleleft","\\ntrianglelefteq","\\triangleright","\\vartriangleright","\\trianglerighteq","\\ntriangleright","\\ntrianglerighteq","\\blacktriangle","\\blacktriangledown","\\blacktriangleleft","\\blacktriangleright"],1200),ho("Shapes",["\\ast","\\star"],3e3),ho("Shapes",["\\diamond","\\Diamond","\\lozenge","\\blacklozenge","\\bigstar"],1200),{version:"0.52.1-soc",latexToMarkup:uo,latexToMathML:fo,latexToSpeakableText:go,latexToAST:function(e,t){var a;return(t=null!=t?t:{}).macros={...P,...null!==(a=t.macros)&&void 0!==a?a:{}},Zs(ot(e,"math",null,t.macros,!1,t.onError),t)},astToLatex:function(t,a){return function t(a,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let o="";if(void 0===a)return"";if("string"==typeof a)o=a;else if(a.latex)o=a.latex;else if(_s(a)){const e=zs(a);if(e===-1/0)o="-\\infty ";else if(e===1/0)o="\\infty ";else if("object"!=typeof a.num||"string"!=typeof a.num.re&&"string"!=typeof a.num.im)o=isNaN(e)?"\\text{NaN}":Qs(a.num,s);else{const e=Ds(a),t=qs(a);isNaN(e)||isNaN(t)?o="\\text{NaN}":Math.abs(t)<=Number.EPSILON&&Math.abs(e)<=Number.EPSILON?o="0":(Math.abs(e)>Number.EPSILON&&(o=Qs(e,s)),Math.abs(t)>Number.EPSILON&&(Math.abs(e)>Number.EPSILON&&(o+=t>0?"+":""),o+=(1!==Math.abs(t)?Qs(t,s):"")+"\\imaginaryI "))}Ts(a)&&(o+="^{"+t(a.sup,s)+"}"),Ks(a)&&(o+="_{"+t(a.sub,s)+"}")}else if(a.group)o=t(a.group,s),_s(a.group)||$s(a.group)?0!==qs(a.group)&&(o=Xs(a.fence||"(),",o)):o=Xs(a.fence||"(),",o),Ts(a)&&(o+="^{"+t(a.sup,s)+"}"),Ks(a)&&(o+="_{"+t(a.sub,s)+"}");else if(a.fn)if("bind"===a.fn){if(o=t(gs(a,0),s)+"|_{",a.arg&&2===a.arg.length)o+=t(gs(a,1));else{let e="";for(let i=1;it(e,s)));else if("text"===a.fn)o="\\text{"+(a.arg[0]||"")+"}";else if("pow"===a.fn&&e(a.arg)&&a.arg.length>=2)o=t(gs(a,0),s),_s(gs(a,0))||$s(gs(a,0))||(o=Xs(a.fence||"(),",o)),o+="^{"+t(gs(a,1),s)+"}";else if("equal"===a.fn&&a.arg&&a.arg.length>2)o=a.arg.map(e=>t(e,s)).join(" = ");else{const i=function(e){let t=us[e];return t||(t=e.length>1?"\\operatorname{"+e+"}%^%_ %":e+"%^%_ %"),t}(a.fn);o=i;let r="";if(/%(?![01_^])/.test(i)&&e(a.arg)&&a.arg.length>1)o+=Xs(a.fence||"(),",...a.arg.map(e=>t(e,s)));else if(e(a.arg)&&a.arg.length>0){const e=t(gs(a,0),s),n=t(gs(a,1),s),l=[...a.arg];/%0/.test(i)&&(o=o.replace("%0",e),l.shift()),/%1/.test(i)&&(o=o.replace("%1",n),l.shift()),l.length>0&&(r=Xs(a.fence||"(),",...l.map(e=>t(e,s))))}else r=Xs(a.fence||"(),","");o=Ts(a)?o.replace("%^","^{"+t(a.sup,s)+"}"):o.replace("%^",""),o=Ks(a)?o.replace("%_","_{"+t(a.sub,s)+"}"):o.replace("%_",""),o=o.replace(/%(?![01_^])/,r),o=o.replace("%0","").replace("%1","")}else{const e=[];for(const i of a.arg)"add"===i.fn||"subtract"===i.fn||0!==Ds(r=i)&&0!==qs(r)||Ts(a)&&0!==qs(i)&&1!==qs(i)?e.push(Xs("() ",t(i,s))):e.push(t(i,s));if("multiply"===a.fn)o=!a.arg||2!==a.arg.length||!_s(a.arg[0])&&"divide"!==a.arg[0].fn||_s(a.arg[1])&&(0!==Ds(a.arg[1])||1!==qs(a.arg[1]))?e.join(" \\times "):e[0]+e[1];else if(a.arg&&1===a.arg.length)o="negate"===a.arg[0].fn||_s(a.arg[0])&&zs(a.arg[0])<0?e[0]:"+"+e[0];else{o=e[0];for(let t=1;t=0&&(i+=t,i({...e,[t]:i[t][this.size]}),{}),this.metrics.emPerEx=i.xHeight[this.size]/i.quad[this.size]}sup(){return c[[4,5,4,5,6,7,6,7][this.id]]}sub(){return c[[5,5,5,5,7,7,7,7][this.id]]}fracNum(){return c[[2,3,4,5,6,7,6,7][this.id]]}fracDen(){return c[[3,3,5,5,7,7,7,7][this.id]]}cramp(){return c[[1,1,3,3,5,5,7,7][this.id]]}cls(){return["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"][this.size]}adjustTo(e){let t=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]][this.size][e.size];return t.length>0&&(t=" "+t),t}isTight(){return this.size>=2}}const c={0:new l(0,0,1,!1),1:new l(1,0,1,!0),2:new l(2,1,1,!1),3:new l(3,1,1,!0),4:new l(4,2,.7,!1),5:new l(5,2,.7,!0),6:new l(6,3,.5,!1),7:new l(7,3,.5,!0)};c.displaystyle=c[0],c.textstyle=c[2],c.scriptstyle=c[4],c.scriptscriptstyle=c[6];class d{constructor(e){var t;this.macros=null!==(t=e.macros)&&void 0!==t?t:{},this.atomIdsSettings=e.atomIdsSettings,this.mathstyle=e.mathstyle||c.displaystyle,this.letterShapeStyle=e.letterShapeStyle||"tex",this.size=e.size||"size5",this.parentMathstyle=e.parentMathstyle||this.mathstyle,this.parentSize=e.parentSize||this.size,this.opacity=e.opacity,this.smartFence=e.smartFence}clone(e={}){const t=new d(this);return e&&(Object.assign(t,e),e.mathstyle?(t.parentMathstyle=this.mathstyle,t.parentSize=this.size,"string"==typeof e.mathstyle&&(t.mathstyle=c[e.mathstyle])):t.mathstyle=this.mathstyle),t}setMathstyle(e){e&&"auto"!==e&&(this.mathstyle=c[e])}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sub()})}}const m={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},p={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34]},h={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",widetilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",widetilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",widetilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",widetilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};function u(e){let t="",a="";for(const i of e)/[a-zA-Z*]/.test(i[0])&&(a+=t),t=/\\[a-zA-Z]+\*?$/.test(i)?" ":"",a+=i;return a}function f(e,t){const a=[];let i,s=[];return e.forEach(e=>{if("first"!==e.type){let o;"variant"===t?(o=e.variant,e.variantStyle&&"up"!==e.variantStyle&&(o+="-"+e.variantStyle)):o=e[t],o!==i?(s.length>0&&a.push(s),s=[e],i=o):s.push(e)}}),s.length>0&&a.push(s),a}const g={};function y(e,t){g[e]={...t}}const b=["","mord","mbin","mop","mrel","mopen","mclose","mpunct","minner","spacing","first","command","error","placeholder","textord","none"];function v(e){return b.includes(e)}const x={"mord+mop":3,"mord+mbin":4,"mord+mrel":5,"mord+minner":3,"mop+mord":3,"mop+mop":3,"mop+mbin":5,"mop+minner":3,"mbin+mord":4,"mbin+mop":4,"mbin+mopen":4,"mbin+minner":4,"mrel+mord":5,"mrel+mop":5,"mrel+mopen":5,"mrel+minner":5,"mclose+mop":3,"mclose+mbin":4,"mclose+mrel":5,"mclose+minner":3,"mpunct+mord":3,"mpunct+mop":3,"mpunct+mbin":4,"mpunct+mrel":5,"mpunct+mopen":3,"mpunct+mpunct":3,"mpunct+minner":3},k=["​"," ","  "," "," ","  "," ","",""," "],w=[""," ⁣",""," ⁣"," ⁣"," ⁣"],S={"mord+mop":3,"mop+mord":3,"mop+mop":3,"mclose+mop":3,"minner+mop":3};function M(t){if("string"==typeof t)return t;if("number"==typeof t)return Number(Math.ceil(100*t)/100).toString();if(void 0===t)return"";if(e(t)){let e="";for(const a of t)e+=M(a);return e}return""}class L{constructor(t,a="",i=""){this.classes=a,e(t)?this.children=[].concat(...t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.type=i,this.style=null,this.updateDimensions()}updateDimensions(){let e=0,t=0,a=1;this.children?this.children.forEach(i=>{i.height>e&&(e=i.height),i.depth>t&&(t=i.depth),i.maxFontSize>a&&(a=i.maxFontSize)}):"string"==typeof this.body&&(e=.7,t=.2),this.height=e,this.depth=t,this.maxFontSize=a}selected(e){e&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!e&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(t=>t.selected(e))}applyStyle(e){if(!e)return;if(e.color&&("none"!==e.color?this.setStyle("color",e.color):this.setStyle("color","")),e.backgroundColor&&("none"!==e.backgroundColor?this.setStyle("background-color",e.backgroundColor):this.setStyle("background-color","")),e.cssClass&&(this.classes+=" "+e.cssClass),!this.body)return;const t=function(e,t){return g[t.mode]&&g[t.mode].applyStyle?g[t.mode].applyStyle(e,t):""}(this,e);if(this.body&&t){this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[e.fontSize]||1,this.height=0,this.depth=0,this.skew=0,this.italic=0;for(let e=0;e0&&(this.style||(this.style={}),this.style[e]=a)}setTop(e){e&&0!==e&&(this.style||(this.style={}),this.style.top=M(e)+"em",this.height-=e,this.depth+=e)}setLeft(e){e&&0!==e&&(this.style||(this.style={}),this.style["margin-left"]=M(e)+"em")}setRight(e){e&&0!==e&&(this.style||(this.style={}),this.style["margin-right"]=M(e)+"em")}setWidth(e){e&&0!==e&&(this.style||(this.style={}),this.style.width=M(e)+"em")}toMarkup(e=1,t=1){var a;let i="",s=this.body||"";if(this.children){let e="none";for(const a of this.children){let i=0;if(e){let s=a.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),i=a.isTight?S[e+"+"+s]||0:x[e+"+"+s]||0,i=Math.floor(t*i))}s+=a.toMarkup(i,t),e=C(a)}}if("​"!==s&&(s||this.svgBody)||this.classes&&"ML__selected"!==this.classes||this.cssId||this.style||this.svgOverlay){i="`${e}="${this.attributes[e]}"`).join(" "));const t=this.classes.split(" ");t.push(null!==(a={command:"ML__command",placeholder:"ML__placeholder",error:"ML__error"}[this.type])&&void 0!==a?a:""),this.caret&&"command"===this.type&&t.push("ML__command-caret");let o="";if(o=t.length>1?t.filter((e,t,a)=>e.length>0&&a.indexOf(e)===t).join(" "):t[0],o.length>0&&(i+=` class="${o}"`),e&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=M(parseFloat(this.style["margin-left"])+e/18)+"em":e<0&&w[-e]?s=w[-e]+s:k[e]?s=k[e]+s:(this.style||(this.style={}),this.style["margin-left"]=M(e/18)+"em")),this.style){let e="";const t=/ML__selected/.test(this.classes);for(const a in this.style)Object.prototype.hasOwnProperty.call(this.style,a)&&("background-color"===a&&t||(e+=a+":"+this.style[a]+";"));e.length>0&&(i+=' style="'+e+'"')}i+=">",this.svgBody?i+=function(e){if(p[e]){const t=p[e][2];return``}const[t,a,i,s]=m[e];let o,r;const n=i/1e3;3===t.length?(o=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],r=["xMinYMin","xMidYMin","xMaxYMin"]):2===t.length?(o=["slice-1-of-2","slice-2-of-2"],r=["xMinYMin","xMaxYMin"]):(o=["slice-1-of-1"],r=[s]);const l=t.map((e,t)=>``).join("");return`${l}`}(this.svgBody):this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(e){if(this.type!==e.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;if(this.svgBody||!this.body)return!1;if(e.svgBody||!e.body)return!1;const t=this.children&&this.children.length>0,a=e.children&&e.children.length>0;if(t||a)return!1;if((this.style?this.style.length:0)!==(e.style?e.style.length:0))return!1;const i=this.classes.trim().replace(/\s+/g," ").split(" "),s=e.classes.trim().replace(/\s+/g," ").split(" ");if(i.length!==s.length)return!1;i.sort(),s.sort();for(let e=0;eMath.max(e,t.height),0):t.height:0}function $(t){return t?e(t)?t.reduce((e,t)=>Math.max(e,t.depth),0):t.depth:0}function z(t){return t?e(t)?t[t.length-1].italic:t.italic:0}function _(t,a="",i=""){if(e(t)){const e=t.filter(e=>!!e);return 1===e.length?new L(e[0],a,i):new L(e,a,i)}return new L(t,a,i)}function D(e,t,a="",i=""){const s=new L(t,a,i),r=o(t,e);return s.height=r.height,s.depth=r.depth,s.skew=r.skew,s.italic=r.italic,s.setRight(s.italic),s}function q(t,a="",i=""){const s=_("","ML__strut");let o,r;return s.setStyle("height",A(t),"em"),0!==$(t)&&(o=_("","ML__strut--bottom"),o.setStyle("height",A(t)+$(t),"em"),o.setStyle("vertical-align",-$(t),"em")),r=e(t)?[s,o,...t]:[s,o,t],_(r,a,i)}function T(e,t,a,i,s){s=s||"";const o=K(t,(s+=" style-wrap ")+a.adjustTo(i));o.type=e;const r=i.sizeMultiplier/a.sizeMultiplier;return o.height*=r,o.depth*=r,o.maxFontSize=i.sizeMultiplier,o}function K(t,a="",i=""){if(!a){if(t instanceof L)return t;if(e(t)&&1===t.length)return t[0]}const s=new L(t,a,i);let o=1;return o=t instanceof L?t.maxFontSize:t.reduce((e,t)=>Math.max(e,t.maxFontSize),0),s.height*=o,s.depth*=o,s}function E(t,a,i="shift",s=0){let o=0,r=0;i=i||"shift";for(let t=0;t0?"em":""),i.attributes={"aria-hidden":"true"}),"size5"!==e.size?new L(i,"fontsize-ensurer reset-"+e.size+" size5"):0!==a?i:null}(t,n),c=[];r=o;for(const e of a)if("number"==typeof e)r+=e;else if(e instanceof L){const t=_([l,e]);t.setTop(-e.depth-r),c.push(t),r+=e.height+e.depth}const d=_(c,"vlist");return d.depth=Math.max(o,$(d)||0),d.height=Math.max(-r,A(d)||0),d}function F(e){const t=new L(null);return t.svgBody=e,t.height=function(e){return m[e]?m[e][2]/1e3:p[e][2]}(e)/2,t.depth=t.height,t}const N={},B={"<":"<",">":">",o:"o","&":"\\&","{":"\\{","}":"\\}","[":"\\lbrack","]":"\\rbrack",":":"\\colon"," ":"~","¬":"\\neg","·":"\\cdot","¼":"\\frac{1}{4}","½":"\\frac{1}{2}","¾":"\\frac{3}{4}","⁰":"^{0}","ⁱ":"^{i}","¹":"^{1}","²":"^{2}","³":"^{3}","†":"\\dagger","‡":"\\ddagger","…":"\\ldots","⁴":"^{4}","⁵":"^{5}","⁶":"^{6}","⁷":"^{7}","⁸":"^{8}","⁹":"^{9}","⁺":"^{+}","⁻":"^{-}","⁼":"^{=}","ⁿ":"^{n}","₀":"_{0}","₁":"_{1}","₂":"_{2}","₃":"_{3}","₄":"_{4}","₅":"_{5}","₆":"_{6}","₇":"_{7}","₈":"_{8}","₉":"_{9}","₊":"_{+}","₋":"_{-}","₌":"_{=}","ₐ":"_{a}","ₑ":"_{e}","ₒ":"_{o}","ₓ":"_{x}","′":"\\prime","'":"\\prime","←":"\\gets","→":"\\to","△":"\\triangle","▽":"\\triangledown","∋":"\\owns","∗":"\\ast","∣":"\\vert","∥":"\\Vert","∧":"\\land","∨":"\\lor","⋅":"\\cdot","⋈":"\\bowtie","≠":"\\ne","≤":"\\le","≥":"\\ge","⊥":"\\bot","⟷":"\\biconditional","⟸":"\\impliedby","⟹":"\\implies","ℂ":"\\C","ℕ":"\\N","ℙ":"\\P","ℚ":"\\Q","ℝ":"\\R","ℤ":"\\Z"},O={},R={},P={iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace",rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}"},I={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},H={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","\\textdagger":"†","\\textdaggerdbl":"‡","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},W=/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,V="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),U="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");function j(e,t,a="mord",i=""){N[e]={type:a,variant:i,value:t},B[t]||i||(B[t]=e),H[e]=t}function G(e,t){for(let a=e;a<=t;a++){const e=String.fromCodePoint(a);j(e,e)}}function Z(e,t){return"math"===e?B[t]||t:"text"===e&&Object.keys(H).find(e=>H[e]===t)||t}const X={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},Y=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function J(e,t,a){if(!/[A-Za-z0-9]/.test(e))return e;if(!t&&!a)return e;const i=e.codePointAt(0);for(let e=0;e=Y[e].offset&&i120831)&&(e<8448||e>8527))return{char:String.fromCodePoint(e)};for(const t in X)if(Object.prototype.hasOwnProperty.call(X,t)&&X[t]===e){e=t.codePointAt(0);break}for(let t=0;t=Y[t].start&&e=1;)i.params.push({isOptional:!1,type:"math"}),s-=1}}}else"math"===t?i=N[e]:H[e]&&(i={value:H[e]});return!i||"mord"!==i.type||"f"!==i.value&&"g"!==i.value&&"h"!==i.value||(i.isFunction=!0),i}function oe(e){if(e.length<=1)return[];const t=[];for(const a in O)Object.prototype.hasOwnProperty.call(O,a)&&a.startsWith(e)&&!O[a].infix&&t.push({match:a,frequency:O[a].frequency});for(const a in N)Object.prototype.hasOwnProperty.call(N,a)&&a.startsWith(e)&&t.push({match:a,frequency:N[a].frequency});return t.sort((e,t)=>e.frequency===t.frequency?e.match.length-t.match.length:(t.frequency||0)-(e.frequency||0)),t}function re(e){let t="auto";const a=e.match(/:([^=]+)/);return a&&(t=a[1].trim()),t}function ne(e){if(!e)return[];let t=[],a=e.split("]");if("["===a[0].charAt(0)){t.push({isOptional:!0,type:re(a[0].slice(1))});for(let e=1;e<=a.length;e++)t=t.concat(ne(a[e]))}else if(a=e.split("}"),"{"===a[0].charAt(0)){t.push({isOptional:!1,type:re(a[0].slice(1))});for(let e=1;e<=a.length;e++)t=t.concat(ne(a[e]))}return t}function le(e){let t="",a=!0;return e.forEach(e=>{"string"==typeof e.body?t+=e.body:a=!1}),a?t:""}function ce(e,t,a,i=!1){"string"==typeof e&&(e=[e]);const s={tabular:i,params:ne(t),parser:a};for(const t of e)R[t]=s}function de(e,t,a){ce(e,t,a,!0)}function me(e,t,a,i,s){"string"==typeof e&&(e=[e]),a||(a={});const o={params:ne(t),mode:a.mode,infix:!!a.infix,parse:i,emit:s};e.forEach(e=>{O["\\"+e]=o})}const pe={acute:"ˊ",grave:"ˋ",dot:"˙",ddot:"¨",mathring:"˚",tilde:"~",bar:"ˉ",breve:"˘",check:"ˇ",hat:"^",vec:"⃗"};me(Object.keys(pe),"{body:auto}",null,(function(e,t){return{type:"accent",accent:pe[e.slice(1)],limits:"accent",skipBoundary:!0,body:t[0]}})),me(["widehat","widecheck","widetilde"],"{body:auto}",null,(e,t)=>{const a=le(t[0]);return{type:"accent",svgAccent:e.slice(1)+(a.length>5?"4":["1","1","2","2","3","3"][a.length]),limits:"accent",skipBoundary:!0,body:t[0]}}),me("utilde","{body:auto}",null,(e,t)=>{const a=le(t[0]),i="widetilde"+(a.length>5?"4":["1","1","2","2","3","3"][a.length]);return{type:"overunder",body:t[0],svgBelow:i,skipBoundary:!0}},(e,t,a,i)=>`\\utilde{${i(a,a.body)}}`),me("^","{:string}",{},(e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[t[0]]||"^"})),me("`","{:string}",{},(e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[t[0]]||"`"})),me("'","{:string}",{},(function(e,t){return{type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[t[0]]||"^"}})),me("~","{:string}",{},(e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[t[0]]||"´"})),me("c","{:string}",{},(e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{c:"ç",C:"Ç"}[t[0]]||""})),me("enclose","{notation:string}[style:string]{body:auto}",null,(e,t)=>{const a={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:t[2]};if(t[1]){const e=t[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const t of e){const e=t.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(e)a.strokeWidth=n(e[1],"px"),isFinite(a.strokeWidth)||(a.strokeWidth=1),a.strokeStyle=e[2],a.strokeColor=e[3];else{const e=t.match(/\s*([a-z]*)\s*=\s*"(.*)"/);e&&("mathbackground"===e[1]?a.backgroundcolor=e[2]:"mathcolor"===e[1]?a.strokeColor=e[2]:"padding"===e[1]?a.padding=n(e[2],"px"):"shadow"===e[1]&&(a.shadow=e[2]))}}"dashed"===a.strokeStyle?a.svgStrokeStyle="5,5":"dotted"===a.strokeStyle&&(a.svgStrokeStyle="1,5")}return a.borderStyle=a.strokeWidth+"px "+a.strokeStyle+" "+a.strokeColor,a.notation={},t[0].split(/[, ]/).filter(e=>e.length>0).forEach(e=>{a.notation[e.toLowerCase()]=!0}),a.notation.updiagonalarrow&&(a.notation.updiagonalstrike=!1),a.notation.box&&(a.notation.left=!1,a.notation.right=!1,a.notation.bottom=!1,a.notation.top=!1),a}),me("cancel","{body:auto}",null,(function(e,t){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:t[0]}})),me("bcancel","{body:auto}",null,(function(e,t){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:t[0]}})),me("xcancel","{body:auto}",null,(function(e,t){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:t[0]}})),ce("math","",()=>({mathstyle:"textstyle"})),ce("displaymath","",(function(){return{mathstyle:"displaystyle"}})),de("array","{columns:colspec}",(e,t)=>({colFormat:t[0],mathstyle:"textstyle"})),de(["equation","equation","subequations"],"",()=>({colFormat:[{align:"c"}]})),de("multline","",(function(){return{colFormat:[{align:"m"}]}})),de(["align","align*","aligned","eqnarray"],"",(e,t,a)=>{let i=0;for(const e of a)i=Math.max(i,e.length);const s=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({colFormat:[{align:"r"},{align:"l"}]})),de(["gather","gathered"],"",()=>({colFormat:[{gap:.25},{align:"c"},{gap:0}],jot:.3})),de(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","smallmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*","smallmatrix*"],"[columns:colspec]",(e,t)=>{var a;const i={mathstyle:"textstyle"};switch(e){case"pmatrix":case"pmatrix*":i.lFence="(",i.rFence=")";break;case"bmatrix":case"bmatrix*":i.lFence="[",i.rFence="]";break;case"Bmatrix":case"Bmatrix*":i.lFence="\\lbrace",i.rFence="\\rbrace";break;case"vmatrix":case"vmatrix*":i.lFence="\\vert",i.rFence="\\vert";break;case"Vmatrix":case"Vmatrix*":i.lFence="\\Vert",i.rFence="\\Vert";break;case"smallmatrix":case"smallmatrix*":i.mathstyle="scriptstyle";break;case"matrix":case"matrix*":i.lFence=".",i.rFence="."}return i.colFormat=null!==(a=t[0])&&void 0!==a?a:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}],i}),de("cases","",()=>({arraystretch:1.2,lFence:"\\lbrace",rFence:".",colFormat:[{align:"l"},{gap:1},{align:"l"}]})),ce("center","",(function(){return{colFormat:[{align:"c"}]}})),me(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overbrace","overlinesegment","overgroup"],"{:auto}",null,(e,t)=>({type:"overunder",body:t[0],svgAbove:e.slice(1),skipBoundary:!0,limits:"overunder"}),(e,t,a,i)=>`${e}{${i(a,a.body)}}`),me(["underrightarrow","underleftarrow","underleftrightarrow","underbrace","underlinesegment","undergroup"],"{:auto}",null,(e,t)=>({type:"overunder",body:t[0],svgBelow:e.slice(1),skipBoundary:!0,limits:"overunder"}),(e,t,a,i)=>`${e}{${i(a,a.body)}}`),me(["xrightarrow","xleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","xLeftrightarrow","xrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xrightleftarrows","xrightequilibrium","xleftequilibrium"],"[:auto]{:auto}",null,(e,t)=>({type:"overunder",mathtype:"mrel",svgBody:e.slice(1),overscript:t[1],underscript:t[0],skipBoundary:!0}),(e,t,a,i)=>e+(a.underscript?`[${i(a,a.underscript)}]`:"")+`{${i(a,a.overscript)}}`),me(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","coth","ctg","cth","cotg","csc","cosec","deg","dim","exp","hom","inf","ker","lg","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th"],"",null,(function(e){return{type:"mop",limits:"nolimits",isSymbol:!1,isFunction:!0,body:e.slice(1),variant:"main",variantStyle:"up"}})),me(["liminf","limsup"],"",null,e=>({type:"mop",limits:"limits",isSymbol:!1,body:{"\\liminf":"lim inf","\\limsup":"lim sup"}[e],variant:"main"})),me(["lim","mod"],"",null,(function(e){return{type:"mop",limits:"limits",isSymbol:!1,body:e.slice(1),variant:"main"}})),me(["det","max","min"],"",null,(function(e){return{type:"mop",limits:"limits",isSymbol:!1,isFunction:!0,body:e.slice(1),variant:"main"}})),me("sqrt","[index:auto]{radicand:auto}",null,(e,t)=>({type:"surd",body:t[1],index:t[0]}),(e,t,a,i)=>{let s="";return a.index&&(s+=`[${i(a,a.index)}]`),s+=`{${i(a,a.body)}}`,e+s}),me(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{numerator}{denominator}",null,(e,t)=>{const a={type:"genfrac",numer:t[0],denom:t[1],mathstyle:"auto"};switch(e){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":a.hasBarLine=!0;break;case"\\\\atopfrac":a.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a.hasBarLine=!1,a.leftDelim="(",a.rightDelim=")"}switch(e){case"\\dfrac":case"\\dbinom":a.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":a.mathstyle="textstyle"}return"\\cfrac"===e&&(a.continuousFraction=!0),a},(e,t,a,i)=>`${e}{${i(a,a.numer)}}{${i(a,a.denom)}}`),me(["over","atop","choose"],"",{infix:!0},(e,t)=>{const a=t[0],i=t[1];let s=!1,o=null,r=null;switch(e){case"\\atop":break;case"\\over":s=!0;break;case"\\choose":s=!1,o="(",r=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:a,denom:i,hasBarLine:s,leftDelim:o,rightDelim:r,mathstyle:"auto"}},(e,t,a,i)=>`{${i(a,a.numer)}${e} ${i(a,a.denom)}}`),me("pdiff","{numerator}{denominator}",null,(e,t)=>({type:"genfrac",numer:t[0],denom:t[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}),(e,t,a,i)=>`${e}{${i(a,a.numer)}}{${i(a,a.denom)}}`),me(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","smallint","intop"],"",null,e=>({type:"mop",limits:"auto",isSymbol:!0,variant:"main",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[e.slice(1)]}));const he={int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑",sqcup:"⊔",sqcap:"⊓",uplus:"⊎",wr:"≀",amalg:"⨿",Cap:"⋒",Cup:"⋓",doublecap:"⋒",doublecup:"⋓"};me(Object.keys(he),"",null,(function(e){return{type:"mop",limits:"nolimits",isSymbol:!0,body:he[e.slice(1)],variant:{"⋒":"ams","⋓":"ams"}[he[e.slice(1)]]}})),me(["Re","Im"],"",null,(function(e){return{type:"mop",limits:"nolimits",isSymbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[e],variant:"fraktur"}})),me("middle","{:delim}",null,(function(e,t){return{type:"delim",delim:t[0]}}));const ue={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},fe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ge=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"],ye={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};function be(e){var t;const a=e.toLowerCase().split("!");let i,s,o,r=255,n=255,l=255,c=-1;const d=a.length>0&&"-"===a[0].charAt(0);d&&(a[0]=a[0].slice(1));for(let e=0;e=0&&(r=(1-c)*r+c*i,n=(1-c)*n+c*s,l=(1-c)*l+c*o,c=-1),e+1=0&&(r=c*r+(1-c)*i,n=c*n+(1-c)*s,l=c*l+(1-c)*o),d&&(r=255-r,n=255-n,l=255-l),"#"+("00"+Math.round(r).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(l).toString(16)).slice(-2)}function ve(e){let t=e.toUpperCase();for(const e in ye)if(ye[e]===t){t=e;break}for(const e in ue)if(ue[e]===t){t=e;break}return t}me("ensuremath","{:math}",{},(e,t)=>({type:"group",mode:"math",body:t[0],skipBoundary:!0,latexOpen:"\\ensuremath{",latexClose:"}"}),(e,t,a,i)=>i(a,a.body)),me("color","{:color}",{},(e,t)=>({color:t[0]})),me("textcolor","{:color}{content:auto*}",{},(e,t)=>({color:t[0]})),me("boxed","{content:math}",null,(e,t)=>({type:"box",framecolor:"black",skipBoundary:!0,body:t[0]})),me("colorbox","{background-color:string}{content:auto}",{},(e,t)=>({type:"box",backgroundcolor:be(t[0]),skipBoundary:!0,body:t[1],verbatimBackgroundcolor:t[0]}),(e,t,a,i)=>`${e}{${a.verbatimBackgroundcolor||ve(a.backgroundcolor)}}{${i(a,a.body)}}`),me("fcolorbox","{frame-color:string}{background-color:string}{content:auto}",{},(e,t)=>({type:"box",framecolor:be(t[0]),backgroundcolor:be(t[1]),skipBoundary:!0,body:t[2],verbatimBackgroundcolor:t[1],verbatimFramecolor:t[0]}),(e,t,a,i)=>`${e}{${a.verbatimFramecolor||ve(a.framecolor)}{${a.verbatimBackgroundcolor||ve(a.backgroundcolor)}}{${i(a,a.body)}}`),me("bbox","[:bbox]{body:auto}",{},(e,t)=>{if(t[0]){const e=t[0];return{type:"box",padding:e.padding,border:e.border,backgroundcolor:e.backgroundcolor,skipBoundary:!0,body:t[1]}}return{type:"box",skipBoundary:!0,body:t[1]}},(e,t,a,i)=>{let s=e;if(isFinite(a.padding)||void 0!==a.border||void 0!==a.backgroundcolor){const e=[];isFinite(a.padding)&&e.push(Math.floor(100*a.padding)/100+"em"),a.border&&e.push("border:"+a.border),a.backgroundcolor&&e.push(ve(a.backgroundcolor)),s+=`[${e.join(",")}]`}return s+`{${i(a,a.body)}}`}),me(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{},(e,t)=>({fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[e.slice(1)]})),me("fontseries","{:string}",{mode:"text"},(e,t)=>({fontSeries:t[0]})),me("fontshape","{:string}",{mode:"text"},(e,t)=>({fontShape:t[0]})),me("fontfamily","{:string}",{mode:"text"},(e,t)=>({fontFamily:t[0]})),me("selectfont","",{mode:"text"},(e,t)=>({})),me("bf","",{},(e,t)=>({fontSeries:"b",fontShape:"n",fontFamily:"cmr"})),me(["boldsymbol","bm"],"{:math*}",{},(e,t)=>({mode:"math",cssClass:"ML__boldsymbol"})),me("bold","{:math*}",{},(e,t)=>({mode:"math",variantStyle:"bold"})),me("bfseries","",{mode:"text"},(e,t)=>({fontSeries:"b"})),me("mdseries","",{mode:"text"},(e,t)=>({fontSeries:"m"})),me("upshape","",{mode:"text"},(e,t)=>({fontShape:"n"})),me("slshape","",{mode:"text"},(e,t)=>({fontShape:"sl"})),me("scshape","",{mode:"text"},(e,t)=>({fontShape:"sc"})),me("textbf","{:text*}",{},(e,t)=>({mode:"text",fontSeries:"b"})),me("textmd","{:text*}",{},(e,t)=>({mode:"text",fontSeries:"m"})),me("textup","{:text*}",{},(e,t)=>({mode:"text",fontShape:"n"})),me("textnormal","{:text*}",{},(e,t)=>({mode:"text",fontShape:"n",fontSeries:"m"})),me("textsl","{:text*}",{},(e,t)=>({mode:"text",fontShape:"sl"})),me("textit","{:text*}",{},(e,t)=>({mode:"text",fontShape:"it"})),me("textsc","{:text*}",{},(e,t)=>({mode:"text",fontShape:"sc"})),me("textrm","{:text*}",{},(e,t)=>({mode:"text",fontFamily:"roman"})),me("textsf","{:text*}",{},(e,t)=>({mode:"text",fontFamily:"sans-serif"})),me("texttt","{:text*}",{},(e,t)=>({mode:"text",fontFamily:"monospace"})),me("mathbf","{:math*}",{},(e,t)=>({mode:"math",variant:"normal",variantStyle:"bold"})),me("mathit","{:math*}",{},(e,t)=>({mode:"math",variant:"normal",variantStyle:"italic"})),me("mathbfit","{:math*}",{},(e,t)=>({mode:"math",variant:"normal",variantStyle:"bolditalic"})),me("mathrm","{:math*}",{},(e,t)=>({mode:"math",variant:"normal",variantStyle:"up"})),me("mathsf","{:math*}",{},(e,t)=>({mode:"math",variant:"sans-serif",variantStyle:"up"})),me("mathtt","{:math*}",{},(e,t)=>({mode:"math",variant:"monospace",variantStyle:"up"})),me("it","",{},(e,t)=>({fontSeries:"m",fontShape:"it",fontFamily:"cmr",variantStyle:"italic"})),me("rmfamily","",{},(e,t)=>({fontFamily:"roman"})),me("sffamily","",{},(e,t)=>({fontFamily:"sans-serif"})),me("ttfamily","",{},(e,t)=>({fontFamily:"monospace"})),me(["Bbb","mathbb"],"{:math*}",{},(e,t)=>({variant:"double-struck",variantStyle:"up"})),me(["frak","mathfrak"],"{:math*}",{},(e,t)=>({variant:"fraktur",variantStyle:"up"})),me("mathcal","{:math*}",{},(e,t)=>({variant:"calligraphic",variantStyle:"up"})),me("mathscr","{:math*}",{},(e,t)=>({variant:"script",variantStyle:"up"})),me("mbox","{:text}",null,(e,t)=>({type:"group",mode:"math",body:t[0]})),me("text","{:text*}",null,(e,t)=>({mode:"text"})),me("class","{name:string}{content:auto*}",null,(e,t)=>({cssClass:t[0]})),me("cssId","{id:string}{content:auto}",null,(e,t)=>({type:"group",body:t[1],cssId:t[0]})),me("em","",null,(e,t)=>({cssClass:"ML__emph"})),me("emph","{:auto}",null,(e,t)=>({cssClass:"ML__emph",body:t[0],type:"group",skipBoundary:!0}));const xe={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function ke(e,t,a,i,s,o=""){const r=T(e,D("Size"+a+"-Regular",te("math",t),"delimsizing size"+a),s.mathstyle,c.textstyle,o);return i&&r.setTop((1-s.mathstyle.sizeMultiplier)*s.mathstyle.metrics.axisHeight),r.setStyle("color",s.color),"number"==typeof s.opacity&&r.setStyle("opacity",s.opacity),r}function we(e,t){let a="";return"Size1-Regular"===t?a=" delim-size1":"Size4-Regular"===t&&(a=" delim-size4"),D(t,te("math",e),"delimsizinginner"+a)}function Se(e,t,a,i,s,r=""){let n,l,d,m;n=d=m=te("math",t),l=null;let p="Size1-Regular";"\\vert"===t||"\\lvert"===t||"\\rvert"===t||"\\mvert"===t||"\\mid"===t?d=n=m="∣":"\\Vert"===t||"\\lVert"===t||"\\rVert"===t||"\\mVert"===t||"\\|"===t?d=n=m="∥":"\\uparrow"===t?d=m="⏐":"\\Uparrow"===t?d=m="‖":"\\downarrow"===t?n=d="⏐":"\\Downarrow"===t?n=d="‖":"\\updownarrow"===t?(n="↑",d="⏐",m="↓"):"\\Updownarrow"===t?(n="⇑",d="‖",m="⇓"):"["===t||"\\lbrack"===t?(n="⎡",d="⎢",m="⎣",p="Size4-Regular"):"]"===t||"\\rbrack"===t?(n="⎤",d="⎥",m="⎦",p="Size4-Regular"):"\\lfloor"===t?(d=n="⎢",m="⎣",p="Size4-Regular"):"\\lceil"===t?(n="⎡",d=m="⎢",p="Size4-Regular"):"\\rfloor"===t?(d=n="⎥",m="⎦",p="Size4-Regular"):"\\rceil"===t?(n="⎤",d=m="⎥",p="Size4-Regular"):"("===t?(n="⎛",d="⎜",m="⎝",p="Size4-Regular"):")"===t?(n="⎞",d="⎟",m="⎠",p="Size4-Regular"):"\\{"===t||"\\lbrace"===t?(n="⎧",l="⎨",m="⎩",d="⎪",p="Size4-Regular"):"\\}"===t||"\\rbrace"===t?(n="⎫",l="⎬",m="⎭",d="⎪",p="Size4-Regular"):"\\lgroup"===t?(n="⎧",m="⎩",d="⎪",p="Size4-Regular"):"\\rgroup"===t?(n="⎫",m="⎭",d="⎪",p="Size4-Regular"):"\\lmoustache"===t?(n="⎧",m="⎭",d="⎪",p="Size4-Regular"):"\\rmoustache"===t?(n="⎫",m="⎩",d="⎪",p="Size4-Regular"):"\\surd"===t?(n="",m="⎷",d="",p="Size4-Regular"):"\\ulcorner"===t?(n="┌",d=m=" "):"\\urcorner"===t?(n="┐",d=m=" "):"\\llcorner"===t?(m="└",d=n=" "):"\\lrcorner"===t&&(n="┘",d=n=" ");const h=o(te("math",n),p),u=h.height+h.depth,f=o(te("math",d),p),g=f.height+f.depth,y=o(te("math",m),p),b=y.height+y.depth;let v=0,x=1;if(null!==l){const e=o(te("math",l),p);v=e.height+e.depth,x=2}const k=u+b+v,w=Math.ceil((a-k)/(x*g)),S=k+w*x*g;let M=s.mathstyle.metrics.axisHeight;i&&(M*=s.mathstyle.sizeMultiplier);const L=S/2-M,C=[];if(C.push(we(m,p)),null===l)for(let e=0;e{const a={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[e],body:t[0],captureSelection:!0};return"\\mathop"===e&&(a.limits="limits",a.isFunction=!0),a},(e,t,a,i)=>`${e}{${i(a,a.body)}}`),me(["operatorname","operatorname*"],"{operator:math}",null,(function(e,t){const a={type:"mop",captureSelection:!0,body:t[0],isFunction:!0};return a.body.forEach(e=>{e.isFunction=!1,e.variant||e.variantStyle||(e.variant="main",e.variantStyle="up"),e.type="mord",e.body={"∗":"*","−":"-"}[e.body]||e.body}),"\\operatorname"===e?a.limits="nolimits":"\\operatorname*"===e&&(a.limits="limits"),a})),me("unicode","{charcode:number}",null,(e,t)=>{let a=parseInt(t[0]);return isFinite(a)||(a=10067),{type:"mord",body:String.fromCodePoint(a),codepoint:a}},(e,t,a,i)=>`${e}{"${("000000"+a.codepoint.toString(16)).toUpperCase().substr(-6)}}`),me("rule","[raise:dimen]{width:dimen}{thickness:dimen}",null,(function(e,t){return{type:"rule",shift:t[0],width:t[1],height:t[2]}})),me("overline","{:auto}",null,(e,t)=>({type:"line",position:"overline",skipBoundary:!0,body:t[0]})),me("underline","{:auto}",null,(e,t)=>({type:"line",position:"underline",skipBoundary:!0,body:t[0]})),me("overset","{annotation:auto}{symbol:auto}",null,(function(e,t){return{type:"overunder",overscript:t[0],skipBoundary:!0,body:t[1]}}),(e,t,a,i)=>`${e}{${i(a,a.overscript)}}{${i(a,a.body)}}`),me("underset","{annotation:auto}{symbol:auto}",null,(function(e,t){return{type:"overunder",underscript:t[0],skipBoundary:!0,body:t[1]}}),(e,t,a,i)=>`${e}{${i(a,a.overscript)}}{${i(a,a.body)}}`),me(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0},(function(e,t){return{type:"genfrac",numer:t[0],denom:t[1],hasBarLine:!1,leftDelim:t[2],rightDelim:t[3],mathstyle:"auto"}}),(e,t,a,i)=>`${i(a,a.numer)} ${e}${a.leftDelim}${a.rightDelim}${i(a,a.denom)}`),me(["stackrel","stackbin"],"{annotation:auto}{symbol:auto}",null,(function(e,t){return{type:"overunder",overscript:t[0],skipBoundary:!0,body:t[1],mathtype:"\\stackrel"===e?"mrel":"mbin"}}),(e,t,a,i)=>`${e}{${i(a,a.overscript)}}{${i(a,a.body)}}`),me("rlap","{:auto}",null,(function(e,t){return{type:"overlap",align:"right",skipBoundary:!0,body:t[0]}})),me("llap","{:auto}",null,(function(e,t){return{type:"overlap",align:"left",skipBoundary:!0,body:t[0]}})),me("mathrlap","{:auto}",null,(function(e,t){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:t[0]}})),me("mathllap","{:auto}",null,(function(e,t){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:t[0]}})),function(e){for(let e=0;e<"0123456789/@.?!".length;e++){const t="0123456789/@.?!".charAt(e);j(t,t)}}(),G(65,90),G(97,122),j("\\forall","∀"),j("\\exists","∃"),j("\\nexists","∄","mord","ams"),j("\\mid","∣","mrel"),j("\\top","⊤"),j("\\bot","⊥"),j("\\sharp","♯"),j("\\flat","♭"),j("\\natural","♮"),j("\\#","#"),j("\\&","&"),j("\\clubsuit","♣"),j("\\heartsuit","♡"),j("\\spadesuit","♠"),j("\\diamondsuit","♢"),j("\\differencedelta","∆","mrel"),j("\\backslash","\\"),j("\\nabla","∇"),j("\\partial","∂"),j("\\ell","ℓ"),j("\\hbar","ℏ"),j("\\hslash","ℏ","mord","ams"),j("\\Finv","Ⅎ","mord","ams"),j("\\Game","⅁","mord","ams"),j("\\wp","℘"),j("\\eth","ð","mord","ams"),j("\\mho","℧","mord","ams"),j("\\Bbbk","k","mord","ams"),j("\\N","N","mord","double-struck"),j("\\R","R","mord","double-struck"),j("\\Q","Q","mord","double-struck"),j("\\C","C","mord","double-struck"),j("\\Z","Z","mord","double-struck"),j("\\P","P","mord","double-struck"),j("\\pounds","£"),j("\\yen","¥","mord","ams"),j("\\euro","€"),j("\\dagger","†","mbin"),j("\\dag","†","mbin"),j("\\ddag","‡","mbin"),j("\\ddagger","‡","mbin"),j("\\maltese","✠","mord","ams"),j("\\rightarrow","→","mrel"),j("\\to","→","mrel"),j("\\leftarrow","←","mrel"),j("\\gets","←","mrel"),j("\\Rightarrow","⇒","mrel"),j("\\Leftarrow","⇐","mrel"),j("\\longrightarrow","⟶","mrel"),j("\\longleftarrow","⟵","mrel"),j("\\Longrightarrow","⟹","mrel"),j("\\implies","⟹","mrel"),j("\\Longleftarrow","⟸","mrel"),j("\\impliedby","⟸","mrel"),j("\\dashrightarrow","⇢","mrel","ams"),j("\\dashleftarrow","⇠","mrel","ams"),j("\\Rrightarrow","⇛","mrel","ams"),j("\\Lleftarrow","⇚","mrel","ams"),j("\\longleftrightarrow","⟷","mrel"),j("\\biconditional","⟷","mrel"),j("\\Longleftrightarrow","⟺","mrel"),j("\\leftrightarrows","⇆","mrel","ams"),j("\\rightleftarrows","⇄","mrel","ams"),j("\\mapsto","↦","mrel"),j("\\longmapsto","⟼","mrel"),j("\\uparrow","↑","mrel"),j("\\downarrow","↓","mrel"),j("\\Uparrow","⇑","mrel"),j("\\Downarrow","⇓","mrel"),j("\\updownarrow","↕","mrel"),j("\\Updownarrow","⇕","mrel"),j("\\curvearrowright","↷","mrel","ams"),j("\\curvearrowleft","↶","mrel","ams"),j("\\hookrightarrow","↪","mrel"),j("\\hookleftarrow","↩","mrel"),j("\\rightharpoonup","⇀","mrel"),j("\\leftharpoonup","↼","mrel"),j("\\rightharpoondown","⇁","mrel"),j("\\leftharpoondown","↽","mrel"),j("\\rightrightarrows","⇉","mrel","ams"),j("\\leftleftarrows","⇇","mrel","ams"),j("\\upuparrows","⇈","mrel","ams"),j("\\downdownarrows","⇊","mrel","ams"),j("\\leftarrowtail","↢","mrel","ams"),j("\\rightarrowtail","↣","mrel","ams"),j("\\looparrowright","↬","mrel","ams"),j("\\looparrowleft","↫","mrel","ams"),j("\\twoheadleftarrow","↞","mrel","ams"),j("\\twoheadrightarrow","↠","mrel","ams"),j("\\rightleftharpoons","⇌","mrel"),j("\\leftrightharpoons","⇋","mrel","ams"),j("\\Rsh","↱","mrel","ams"),j("\\Lsh","↰","mrel","ams"),j("\\searrow","↘","mrel"),j("\\nearrow","↗","mrel"),j("\\swarrow","↙","mrel"),j("\\nwarrow","↖","mrel"),j("\\circlearrowright","↻","mrel","ams"),j("\\circlearrowleft","↺","mrel","ams"),j("\\restriction","↾","mrel","ams"),j("\\upharpoonright","↾","mrel","ams"),j("\\upharpoonleft","↿","mrel","ams"),j("\\downharpoonright","⇂","mrel","ams"),j("\\downharpoonleft","⇃","mrel","ams"),j("\\rightsquigarrow","⇝","mrel","ams"),j("\\leadsto","⇝","mrel","ams"),j("\\leftrightsquigarrow","↭","mrel","ams"),j("\\originalof","⊶","mrel"),j("\\imageof","⊷","mrel"),j("\\multimap","⊸","mrel","ams"),j("\\nrightarrow","↛","mrel","ams"),j("\\nleftarrow","↚","mrel","ams"),j("\\nRightarrow","⇏","mrel","ams"),j("\\nLeftarrow","⇍","mrel","ams"),j("\\nleftrightarrow","↮","mrel","ams"),j("\\nLeftrightarrow","⇎","mrel","ams"),j("\\nless","≮","mrel","ams"),j("\\nleqslant","","mrel","ams"),j("\\lneq","⪇","mrel","ams"),j("\\lneqq","≨","mrel","ams"),j("\\nleqq","","mrel","ams"),j("\\unlhd","⊴","mbin","ams"),j("\\unrhd","⊵","mbin","ams"),j("\\lvertneqq","","mrel","ams"),j("\\lnsim","⋦","mrel","ams"),j("\\lnapprox","⪉","mrel","ams"),j("\\nprec","⊀","mrel","ams"),j("\\npreceq","⋠","mrel","ams"),j("\\precnsim","⋨","mrel","ams"),j("\\precnapprox","⪹","mrel","ams"),j("\\nsim","≁","mrel","ams"),j("\\nshortmid","","mrel","ams"),j("\\nmid","∤","mrel","ams"),j("\\nvdash","⊬","mrel","ams"),j("\\nvDash","⊭","mrel","ams"),j("\\ngtr","≯","mrel","ams"),j("\\ngeqslant","","mrel","ams"),j("\\ngeqq","","mrel","ams"),j("\\gneq","⪈","mrel","ams"),j("\\gneqq","≩","mrel","ams"),j("\\gvertneqq","","mrel","ams"),j("\\gnsim","⋧","mrel","ams"),j("\\gnapprox","⪊","mrel","ams"),j("\\nsucc","⊁","mrel","ams"),j("\\nsucceq","⋡","mrel","ams"),j("\\succnsim","⋩","mrel","ams"),j("\\succnapprox","⪺","mrel","ams"),j("\\ncong","≆","mrel","ams"),j("\\nshortparallel","","mrel","ams"),j("\\nparallel","∦","mrel","ams"),j("\\nVDash","⊯","mrel","ams"),j("\\nsupseteqq","","mrel","ams"),j("\\supsetneq","⊋","mrel","ams"),j("\\varsupsetneq","","mrel","ams"),j("\\supsetneqq","⫌","mrel","ams"),j("\\varsupsetneqq","","mrel","ams"),j("\\nVdash","⊮","mrel","ams"),j("\\precneqq","⪵","mrel","ams"),j("\\succneqq","⪶","mrel","ams"),j("\\nsubseteqq","","mrel","ams"),j("\\checkmark","✓","mord","ams"),j("\\diagup","╱","mord","ams"),j("\\diagdown","╲","mord","ams"),j("\\measuredangle","∡","mord","ams"),j("\\sphericalangle","∢","mord","ams"),j("\\backprime","‵","mord","ams"),j("\\backdoubleprime","‶","mord","ams"),j("\\ast","∗","mbin"),j("\\star","⋆","mbin"),j("\\diamond","⋄","mbin"),j("\\Diamond","◊","mord","ams"),j("\\lozenge","◊","mord","ams"),j("\\blacklozenge","⧫","mord","ams"),j("\\bigstar","★","mord","ams"),j("\\aleph","ℵ"),j("\\beth","ℶ","mord","ams"),j("\\daleth","ℸ","mord","ams"),j("\\gimel","ℷ","mord","ams"),j("\\lbrace","{","mopen"),j("\\rbrace","}","mclose"),j("\\langle","⟨","mopen"),j("\\rangle","⟩","mclose"),j("\\lfloor","⌊","mopen"),j("\\rfloor","⌋","mclose"),j("\\lceil","⌈","mopen"),j("\\rceil","⌉","mclose"),j("\\vert","∣"),j("\\mvert","∣","mrel"),j("\\lvert","∣","mopen"),j("\\rvert","∣","mclose"),j("\\|","∥"),j("\\Vert","∥"),j("\\mVert","∥"),j("\\lVert","∥","mopen"),j("\\rVert","∥","mclose"),j("\\parallel","∥","mrel"),j("\\shortparallel","∥","mrel","ams"),j("\\lbrack","[","mopen"),j("\\rbrack","]","mclose"),j("\\{","{","mopen"),j("\\}","}","mclose"),j("(","(","mopen"),j(")",")","mclose"),j("[","[","mopen"),j("]","]","mclose"),j("\\ulcorner","┌","mopen","ams"),j("\\urcorner","┐","mclose","ams"),j("\\llcorner","└","mopen","ams"),j("\\lrcorner","┘","mclose","ams"),j("\\lgroup","⟮","mopen"),j("\\rgroup","⟯","mclose"),j("\\lmoustache","⎰","mopen"),j("\\rmoustache","⎱","mclose"),j("=","=","mrel"),j("\\ne","≠","mrel"),j("\\neq","≠","mrel"),j("<","<","mrel"),j("\\lt","<","mrel"),j(">",">","mrel"),j("\\gt",">","mrel"),j("\\le","≤","mrel"),j("\\leq","≤","mrel"),j("\\ge","≥","mrel"),j("\\geq","≥","mrel"),j("\\leqslant","⩽","mrel","ams"),j("\\geqslant","⩾","mrel","ams"),j("\\ll","≪","mrel"),j("\\gg","≫","mrel"),j("\\coloneq","≔","mrel"),j("\\measeq","≝","mrel"),j("\\eqdef","≞","mrel"),j("\\questeq","≟","mrel"),j(":",":","mrel"),j("\\cong","≅","mrel"),j("\\equiv","≡","mrel"),j("\\prec","≺","mrel"),j("\\preceq","⪯","mrel"),j("\\succ","≻","mrel"),j("\\succeq","⪰","mrel"),j("\\perp","⊥","mrel"),j("\\propto","∝","mrel"),j("\\Colon","∷","mrel"),j("\\smile","⌣","mrel"),j("\\frown","⌢","mrel"),j("\\sim","∼","mrel"),j("\\gtrsim","≳","mrel","ams"),j("\\approx","≈","mrel"),j("\\approxeq","≊","mrel","ams"),j("\\thickapprox","≈","mrel","ams"),j("\\lessapprox","⪅","mrel","ams"),j("\\gtrapprox","⪆","mrel","ams"),j("\\precapprox","⪷","mrel","ams"),j("\\succapprox","⪸","mrel","ams"),j("\\thicksim","∼","mrel","ams"),j("\\succsim","≿","mrel","ams"),j("\\precsim","≾","mrel","ams"),j("\\backsim","∽","mrel","ams"),j("\\eqsim","≂","mrel","ams"),j("\\backsimeq","⋍","mrel","ams"),j("\\simeq","≃","mrel"),j("\\lesssim","≲","mrel","ams"),j("\\nleq","≰","mrel","ams"),j("\\ngeq","≱","mrel","ams"),j("\\smallsmile","⌣","mrel","ams"),j("\\smallfrown","⌢","mrel","ams"),j("\\bowtie","⋈","mrel"),j("\\Join","⋈","mrel"),j("\\asymp","≍","mrel"),j("\\sqsubseteq","⊑","mrel"),j("\\sqsupseteq","⊒","mrel"),j("\\leqq","≦","mrel","ams"),j("\\eqslantless","⪕","mrel","ams"),j("\\lll","⋘","mrel","ams"),j("\\lessgtr","≶","mrel","ams"),j("\\lesseqgtr","⋚","mrel","ams"),j("\\lesseqqgtr","⪋","mrel","ams"),j("\\risingdotseq","≓","mrel","ams"),j("\\fallingdotseq","≒","mrel","ams"),j("\\subseteqq","⫅","mrel","ams"),j("\\Subset","⋐","mrel","ams"),j("\\sqsubset","⊏","mrel","ams"),j("\\preccurlyeq","≼","mrel","ams"),j("\\curlyeqprec","⋞","mrel","ams"),j("\\vDash","⊨","mrel","ams"),j("\\Vvdash","⊪","mrel","ams"),j("\\bumpeq","≏","mrel","ams"),j("\\Bumpeq","≎","mrel","ams"),j("\\geqq","≧","mrel","ams"),j("\\eqslantgtr","⪖","mrel","ams"),j("\\ggg","⋙","mrel","ams"),j("\\gtrless","≷","mrel","ams"),j("\\gtreqless","⋛","mrel","ams"),j("\\gtreqqless","⪌","mrel","ams"),j("\\supseteqq","⫆","mrel","ams"),j("\\Supset","⋑","mrel","ams"),j("\\sqsupset","⊐","mrel","ams"),j("\\succcurlyeq","≽","mrel","ams"),j("\\curlyeqsucc","⋟","mrel","ams"),j("\\Vdash","⊩","mrel","ams"),j("\\shortmid","∣","mrel","ams"),j("\\between","≬","mrel","ams"),j("\\pitchfork","⋔","mrel","ams"),j("\\varpropto","∝","mrel","ams"),j("\\backepsilon","∍","mrel","ams"),j("\\llless","⋘","mrel","ams"),j("\\gggtr","⋙","mrel","ams"),j("\\lhd","⊲","mbin","ams"),j("\\rhd","⊳","mbin","ams"),j("\\doteq","≐","mrel"),j("\\doteqdot","≑","mrel","ams"),j("\\Doteq","≑","mrel","ams"),j("\\eqcirc","≖","mrel","ams"),j("\\circeq","≗","mrel","ams"),j("\\lessdot","⋖","mbin","ams"),j("\\gtrdot","⋗","mbin","ams"),j("\\~","~","mrel"),j("\\leftrightarrow","↔","mrel"),j("\\Leftrightarrow","⇔","mrel"),j("\\models","⊨","mrel"),j("\\vdash","⊢","mrel"),j("\\therefore","∴","mrel","ams"),j("\\because","∵","mrel","ams"),j("\\dashv","⊣","mrel"),j("\\roundimplies","⥰","mrel"),j("+","+","mbin"),j("-","−","mbin"),j("−","−","mbin"),j("\\pm","±","mbin"),j("\\mp","∓","mbin"),j("*","∗","mbin"),j("\\times","×","mbin"),j("\\div","÷","mbin"),j("\\surd","√"),j("\\divides","∣","mbin"),j("\\ltimes","⋉","mbin","ams"),j("\\rtimes","⋊","mbin","ams"),j("\\leftthreetimes","⋋","mbin","ams"),j("\\rightthreetimes","⋌","mbin","ams"),j("\\intercal","⊺","mbin","ams"),j("\\dotplus","∔","mbin","ams"),j("\\doublebarwedge","⩞","mbin","ams"),j("\\divideontimes","⋇","mbin","ams"),j("\\centerdot","⋅","mbin","ams"),j("\\cdot","⋅","mbin"),j("\\infty","∞"),j("\\prime","′"),j("\\doubleprime","″"),j("\\angle","∠"),j("`","‘"),j("\\$","$"),j("\\%","%"),j("\\_","_"),j("\\alpha","α"),j("\\beta","β"),j("\\gamma","γ"),j("\\delta","δ"),j("\\epsilon","ϵ"),j("\\varepsilon","ε"),j("\\zeta","ζ"),j("\\eta","η"),j("\\theta","θ"),j("\\vartheta","ϑ"),j("\\iota","ι"),j("\\kappa","κ"),j("\\varkappa","ϰ","mord","ams"),j("\\lambda","λ"),j("\\mu","μ"),j("\\nu","ν"),j("\\xi","ξ"),j("\\omicron","o"),j("\\pi","π"),j("\\varpi","ϖ"),j("\\rho","ρ"),j("\\varrho","ϱ"),j("\\sigma","σ"),j("\\varsigma","ς"),j("\\tau","τ"),j("\\phi","ϕ"),j("\\varphi","φ"),j("\\upsilon","υ"),j("\\chi","χ"),j("\\psi","ψ"),j("\\omega","ω"),j("\\Gamma","Γ"),j("\\Delta","Δ"),j("\\Theta","Θ"),j("\\Lambda","Λ"),j("\\Xi","Ξ"),j("\\Pi","Π"),j("\\Sigma","Σ"),j("\\Upsilon","Υ"),j("\\Phi","Φ"),j("\\Psi","Ψ"),j("\\Omega","Ω"),j("\\digamma","ϝ","mord","ams"),j("\\emptyset","∅"),j("\\varnothing","∅","mord","ams"),j("\\cap","∩","mbin"),j("\\cup","∪","mbin"),j("\\setminus","∖","mbin"),j("\\smallsetminus","∖","mbin","ams"),j("\\complement","∁","mord","ams"),j("\\in","∈","mrel"),j("\\notin","∉","mrel"),j("\\not","̸","mrel"),j("\\ni","∋","mrel"),j("\\owns","∋","mrel"),j("\\subset","⊂","mrel"),j("\\supset","⊃","mrel"),j("\\subseteq","⊆","mrel"),j("\\supseteq","⊇","mrel"),j("\\subsetneq","⊊","mrel","ams"),j("\\varsubsetneq","","mrel","ams"),j("\\subsetneqq","⫋","mrel","ams"),j("\\varsubsetneqq","","mrel","ams"),j("\\nsubset","⊄","mrel","ams"),j("\\nsupset","⊅","mrel","ams"),j("\\nsubseteq","⊈","mrel","ams"),j("\\nsupseteq","⊉","mrel","ams"),j("\\ "," ","spacing"),j("~"," ","spacing"),j("\\space"," ","spacing"),j("\\!",null,"spacing"),j("\\,",null,"spacing"),j("\\:",null,"spacing"),j("\\;",null,"spacing"),j("\\enskip",null,"spacing"),j("\\enspace",null,"spacing"),j("\\quad",null,"spacing"),j("\\qquad",null,"spacing"),j("\\colon",":","mpunct"),j("\\cdotp","⋅","mpunct"),j("\\cdots","⋯","minner"),j("\\ddots","⋱","minner"),j("\\ldots","…","minner"),j("\\mathellipsis","…","minner"),j("\\vdots","⋮"),j("\\ldotp",".","mpunct"),j(",",",","mpunct"),j(";",";","mpunct"),j("\\land","∧","mbin"),j("\\wedge","∧","mbin"),j("\\lor","∨","mbin"),j("\\vee","∨","mbin"),j("\\lnot","¬"),j("\\neg","¬"),j("\\barwedge","⊼","mbin","ams"),j("\\veebar","⊻","mbin","ams"),j("\\nor","⊻","mbin","ams"),j("\\curlywedge","⋏","mbin","ams"),j("\\curlyvee","⋎","mbin","ams"),j("\\square","□","mord","ams"),j("\\Box","□","mord","ams"),j("\\blacksquare","■","mord","ams"),j("\\boxminus","⊟","mbin","ams"),j("\\boxplus","⊞","mbin","ams"),j("\\boxtimes","⊠","mbin","ams"),j("\\boxdot","⊡","mbin","ams"),j("\\circ","∘","mbin"),j("\\bigcirc","◯","mbin"),j("\\bullet","∙","mbin"),j("\\circleddash","⊝","mbin","ams"),j("\\circledast","⊛","mbin","ams"),j("\\oplus","⊕","mbin"),j("\\ominus","⊖","mbin"),j("\\otimes","⊗","mbin"),j("\\odot","⊙","mbin"),j("\\circledcirc","⊚","mbin","ams"),j("\\oslash","⊘","mbin"),j("\\circledS","Ⓢ","mord","ams"),j("\\circledR","®","mord","ams"),j("\\triangle","△"),j("\\bigtriangleup","△","mbin"),j("\\vartriangle","△","mrel","ams"),j("\\triangleq","≜","mrel","ams"),j("\\triangledown","▽","mord","ams"),j("\\bigtriangledown","▽","mbin"),j("\\triangleleft","◃","mbin"),j("\\vartriangleleft","⊲","mrel","ams"),j("\\trianglelefteq","⊴","mrel","ams"),j("\\ntriangleleft","⋪","mrel","ams"),j("\\ntrianglelefteq","⋬","mrel","ams"),j("\\triangleright","▹","mbin"),j("\\vartriangleright","⊳","mrel","ams"),j("\\trianglerighteq","⊵","mrel","ams"),j("\\ntriangleright","⋫","mrel","ams"),j("\\ntrianglerighteq","⋭","mrel","ams"),j("\\blacktriangle","▲","mord","ams"),j("\\blacktriangledown","▼","mord","ams"),j("\\blacktriangleleft","◀","mrel","ams"),j("\\blacktriangleright","▶","mrel","ams"),j("\\/","/"),j("|","∣","textord"),j("\\And","&","mbin"),j("\\imath","ı"),j("\\jmath","ȷ"),j("\\degree","°"),j("'","′"),j('"',"”");const Me=["(",")","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd"],Le=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache"],Ce=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Ae=[0,1.2,1.8,2.4,3],$e=[{type:"small",mathstyle:c.scriptscriptstyle},{type:"small",mathstyle:c.scriptstyle},{type:"small",mathstyle:c.textstyle},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],ze=[{type:"small",mathstyle:c.scriptscriptstyle},{type:"small",mathstyle:c.scriptstyle},{type:"small",mathstyle:c.textstyle},{type:"stack"}],_e=[{type:"small",mathstyle:c.scriptscriptstyle},{type:"small",mathstyle:c.scriptstyle},{type:"small",mathstyle:c.textstyle},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function De(e,t,a,i,s,r=""){if(!t||0===t.length||"."===t)return Te(e,s,e);let n;"<"===t||"\\lt"===t?t="\\langle":">"!==t&&"\\gt"!==t||(t="\\rangle"),n=Ce.includes(t)?$e:Me.includes(t)?_e:ze;const l=function(e,t,a,i){for(let r=Math.min(2,3-i.mathstyle.size);rt)return a[r]}var s;return a[a.length-1]}(te("math",t),a,n,s);return"small"===l.type?function(e,t,a,i,s,o=""){const r=T(e,D("Main-Regular",te("math",t)),s.mathstyle,a,o);return i&&r.setTop((1-s.mathstyle.sizeMultiplier/a.sizeMultiplier)*s.mathstyle.metrics.axisHeight),r.setStyle("color",s.color),"number"==typeof s.opacity&&r.setStyle("opacity",s.opacity),r}(e,t,l.mathstyle,i,s,"ML__small-delim "+r):"large"===l.type?ke(e,t,l.size,i,s,r):Se(e,t,a,i,s,r)}function qe(e,t,a,i,s,o=""){if("."===t)return Te(e,s,o);const r=s.mathstyle.metrics.axisHeight*s.mathstyle.sizeMultiplier,n=Math.max(a-r,i+r);return De(e,t,Math.max(n/500*901,2*n-.5),!0,s,o)}function Te(e,t,a){return _("","sizing"+t.mathstyle.adjustTo(c.textstyle)+" nulldelimiter "+(a||""),e)}const Ke={},Ee={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};function Fe(e,t){Ke[e]={decompose:t}}function Ne(t,a){var i,s;function o(e){return"mord"===e.type&&!!e.symbol&&/^[0-9,.]$/.test(e.symbol)}function r(e){return"text"===e.mode}const n=t instanceof d?t:new d(t),l=!n.atomIdsSettings||!n.atomIdsSettings.groupNumbers;let c=[];if(e(a)){if(0===a.length)return[];if(1===a.length)c=a[0].decompose(n),c&&l&&a[0].isSelected&&c.forEach(e=>e.selected(!0));else{let e="none",t=a[1].type,d=[],m="",p=!0,h=null;for(let u=0;ue.selected(!0))):(d.length>0&&(c=[...c,...d],d=[]),c=c.concat(e))}e=a[u].getFinalBaseElement().type,t=a[u+1]?a[u+1].getInitialBaseElement().type:"none"}d.length>0&&(c=[...c,...d],d=[])}}else a&&(c=a.decompose(n),c&&l&&a.isSelected&&c.forEach(e=>e.selected(!0)));if(!c||0===c.length)return null;if(n.mathstyle!==n.parentMathstyle){const e=n.mathstyle.sizeMultiplier/n.parentMathstyle.sizeMultiplier;for(const t of c)t.height*=e,t.depth*=e}if(n.size!==n.parentSize){const e=Ee[n.size]/Ee[n.parentSize];for(const t of c)t.height*=e,t.depth*=e}return c}class Be{constructor(e,t,a="",i={}){this.mode=e,this.type=t,this.body=a,this.applyStyle(i)}toLatex(t=!1){return function(t,a){if(!(a=void 0!==a&&a)&&t.latex)return t.latex;let i="",s=0,o=0,r=0;const n=t.symbol,l=(t,i)=>function(t,a,i){let s="";return e(a)?s=function(e,t,a){if(0===t.length)return"";if("first"===t[0].type){if(1===t.length)return"";t=t.slice(1)}return 0===t.length?"":u(f(t,"cssClass").map(t=>{const i=u(f(t,"color").map(t=>u(function(e){const t=[];let a=[],i="NONE";return e.forEach(e=>{"first"!==e.type&&(e.mode!==i?(a.length>0&&t.push(a),a=[e],i=e.mode):a.push(e))}),a.length>0&&t.push(a),t}(t).map(t=>function(e,t,a){return g[t[0].mode]&&g[t[0].mode].emitLatexRun?g[t[0].mode].emitLatexRun(e,t,a):""}(e,t,a)))));return!t[0].cssClass||e&&e.cssClass===t[0].cssClass?i:"ML__boldsymbol"===t[0].cssClass?"\\boldsymbol{"+i+"}":"ML__emph"===t[0].cssClass?"\\emph{"+i+"}":"\\class{"+t[0].cssClass+"}{"+i+"}"}))}(t,a,i):"number"==typeof a||"boolean"==typeof a?s=a.toString():"string"==typeof a?s=a.replace(/\s/g,"~"):a&&"function"==typeof a.toLatex&&(s=a.toLatex(i)),s}(t,i,a);switch(t.type){case"group":n?i=a?l(t,t.body):t.latex:(i=t.latexOpen||(t.cssId||t.cssClass?"":"{"),t.cssId&&(i+="\\cssId{"+t.cssId+"}{"),"ML__emph"===t.cssClass?i+="\\emph{"+l(t,t.body):(t.cssClass&&(i+="\\class{"+t.cssClass+"}{"),i+=l(t,t.body),t.cssClass&&(i+="}")),t.cssId&&(i+="}"),i+=t.latexClose||(t.cssId||t.cssClass?"":"}"));break;case"array":if(i+="\\begin{"+t.environmentName+"}","array"===t.environmentName){if(i+="{",t.colFormat)for(r=0;r0&&(i+=" & "),i+=l(t,t.array[o][s]);o1&&(i+=" "),i+=l(t,t.body),i+="\\right"+(t.rightDelim||"."),t.rightDelim&&t.rightDelim.length>1&&(i+=" ")):a?(i+="."===t.leftDelim?"":t.leftDelim,i+=l(t,t.body),i+="."===t.rightDelim?"":t.rightDelim):(i+="\\mleft"+(t.leftDelim||"."),t.leftDelim&&t.leftDelim.length>1&&(i+=" "),i+=l(t,t.body),i+="\\mright"+(t.rightDelim||"."),t.rightDelim&&t.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+t.delim+"}";break;case"rule":i+=n,t.shift&&(i+=`[${l(t,t.shift)}em]`),i+=`{${l(t,t.width)}em}{${l(t,t.height)}em}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":i+='\\char"'===n?t.latex:ae(n,null,t,l);break;case"mop":"​"!==t.body&&("\\mathop"===n||"\\operatorname"===n?i+=n+"{"+l(t,t.body)+"}":(i+=n,/^\\.*[a-zA-Z0-9]$/.test(n)&&(i+=" "))),t.explicitLimits&&("limits"===t.limits&&(i+="\\limits "),"nolimits"===t.limits&&(i+="\\nolimits "));break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",t.width?i+=t.width+"em":i+="0em",i+="}"):(i+=" ",t.width&&(i+=t.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{"+Object.keys(t.notation).join(" ")+"}";let e="",a="";t.backgroundColor&&"transparent"!==t.backgroundColor&&(e+=a+'mathbackground="'+ve(t.backgroundColor)+'"',a=","),t.shadow&&"auto"!==t.shadow&&(e+=a+'shadow="'+t.shadow+'"',a=","),1!==t.strokeWidth||"solid"!==t.strokeStyle?(e+=a+t.borderStyle,a=","):t.strokeColor&&"currentColor"!==t.strokeColor&&(e+=a+'mathcolor="'+ve(t.strokeColor)+'"',a=","),e&&(i+=`[${e}]`)}i+=`{${l(t,t.body)}}`;break;case"mathstyle":i+="\\"+t.mathstyle;break;case"space":i+=t.symbol;break;case"placeholder":i+="\\placeholder{}";break;case"first":case"command":case"msubsup":break;case"error":i+=t.latex;break;case"":break;default:i=ae(n,parent,t,l),i||(i+=n)}if(t.superscript){let e=l(t,t.superscript);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(t.subscript){const e=l(t,t.subscript);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i}(this,t)}getStyle(){return{mode:this.mode,color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,variant:this.variant,variantStyle:this.variantStyle,fontFamily:this.fontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(e){Object.assign(this,e),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Ee[this.fontSize]),"text"===this.mode&&"root"!==this.type&&(this.type="")}getInitialBaseElement(){let t;return e(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t||this}getFinalBaseElement(){return e(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const e=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(e.type)}forEach(t){if(t(this),e(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const a of e)for(const e of a)e.forEach(t)}filter(t){let a=[];t(this)&&a.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(e(this[i]))for(const e of this[i])e&&(a=a.concat(e.filter(t)));if(e(this.array))for(const e of this.array)for(const i of e)i&&(a=a.concat(i.filter(t)));return a}decomposeGroup(e){const t=_(Ne(e.clone({mathstyle:this.mathstyle?c[this.mathstyle]:void 0}),this.body),"","mord");return this.cssId&&(t.cssId=this.cssId),t.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),t}decomposeOverlap(e){const t=_(Ne(e,this.body),"inner");return _([t,_(null,"fix")],"left"===this.align?"llap":"rlap","mord")}decomposeRule(e){const t=e.mathstyle,a=_("","rule","mord");let i=this.shift&&!isNaN(this.shift)?this.shift:0;i/=t.sizeMultiplier;const s=this.width/t.sizeMultiplier,o=this.height/t.sizeMultiplier;return a.setStyle("border-right-width",s,"em"),a.setStyle("border-top-width",o,"em"),a.setStyle("margin-top",-(o-i),"em"),a.setStyle("border-color",e.color),a.width=s,a.height=o+i,a.depth=-i,a}decompose(t,a=null){let i=null;if(!this.type||/mord|minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(this.type)?(i="string"==typeof this.body?this.makeSpan(t,this.body):this.makeSpan(t,Ne(t,this.body)),i.type=v(this.type)?this.type:""):"group"===this.type||"root"===this.type?i=this.decomposeGroup(t):"delim"===this.type?(i=_(null,""),i.delim=this.delim):"sizeddelim"===this.type?i=this.bind(t,function(e,t,a,i,s=""){return"."===t?Te(e,i,s):("<"===t||"\\lt"===t?t="\\langle":">"!==t&&"\\gt"!==t||(t="\\rangle"),Me.includes(t)||Ce.includes(t)?ke(e,t,a,!1,i,s):Le.includes(t)?Se(e,t,Ae[a],!1,i,s):null)}(this.cls,this.delim,this.size,t)):"overlap"===this.type?i=this.decomposeOverlap(t):"rule"===this.type?i=this.decomposeRule(t):"msubsup"===this.type?(i=_("​","","mord"),a&&(i.height=a[0].height,i.depth=a[0].depth)):"space"===this.type?i=this.makeSpan(t," "):"spacing"===this.type?"​"===this.body?i=this.makeSpan(t,"​"):" "===this.body?i="math"===this.mode?this.makeSpan(t," "):this.makeSpan(t," "):this.width?(i=_("​","mspace "),this.width>0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em")):i=_("​","mspace "+({qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad")):"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):i="placeholder"===this.type?this.makeSpan(t,"⬚"):"first"===this.type?this.makeSpan(t,"​"):Ke[this.type].decompose(t,this),!i)return null;if(this.caret&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(e(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),this.containsCaret&&(e(i)?(i[0].classes=(i[0].classes||"")+" ML__contains-caret",i[i.length-1].classes=(i[i.length-1].classes||"")+" ML__contains-caret"):i.classes=(i.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(e(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return e(i)?i:[i]}attachSupsub(e,t,a){if(!this.superscript&&!this.subscript)return t;const i=e.mathstyle;let s=null,o=null;this.superscript&&(s=_(Ne(e.sup(),this.superscript),i.adjustTo(i.sup()))),this.subscript&&(o=_(Ne(e.sub(),this.subscript),i.adjustTo(i.sub())));let r,n=0,l=0;this.isCharacterBox()||(n=A(t)-i.metrics.supDrop,l=$(t)+i.metrics.subDrop),r=i===c.displaystyle?i.metrics.sup1:i.cramped?i.metrics.sup3:i.metrics.sup2;const d=.05/(c.textstyle.sizeMultiplier*i.sizeMultiplier);let m=null;if(o&&s){n=Math.max(n,r,s.depth+.25*i.metrics.xHeight),l=Math.max(l,i.metrics.sub2);const a=.04;if(n-$(s)-(A(o)-l)<4*a){l=4*a-(n-s.depth)+A(o);const e=.8*i.metrics.xHeight-(n-$(s));e>0&&(n+=e,l-=e)}m=E(e,[o,l,s,-n],"individualShift"),this.isSymbol&&m.children[0].setLeft(-z(t))}else o&&!s?(l=Math.max(l,i.metrics.sub1,A(o)-.8*i.metrics.xHeight),m=E(e,[o],"shift",l),m.children[0].setRight(d),this.isCharacterBox()&&m.children[0].setLeft(-z(t))):!o&&s&&(n=Math.max(n,r,s.depth+.25*i.metrics.xHeight),m=E(e,[s],"shift",-n),m.children[0].setRight(d));const p=_(m,"msubsup");return this.caret&&(p.caret=this.caret,this.caret=""),_([t,p],"",a)}attachLimits(e,t,a,i){const s=this.superscript?_(Ne(e.sup(),this.superscript),e.mathstyle.adjustTo(e.mathstyle.sup())):null,o=this.subscript?_(Ne(e.sub(),this.subscript),e.mathstyle.adjustTo(e.mathstyle.sub())):null;return function(e,t,a,i,s,o){if(!s&&!o)return t;t=_(t);let r=0,n=0;s&&(r=Math.max(.111,.2-$(s))),o&&(n=Math.max(.166,.6-A(o)));let l=null;return o&&s?(l=E(e,[.1,o,n,t,r,s,.1],"bottom",.1+A(o)+$(o)+n+$(t)+a),l.children[0].setLeft(-i),l.children[2].setLeft(i)):o&&!s?(l=E(e,[.1,o,n,t],"top",A(t)-a),l.children[0].setLeft(-i)):!o&&s&&(l=E(e,[t,r,s,.1],"bottom",$(t)+a),l.children[1].setLeft(i)),_(l,"op-limits","mop")}(e,t,a,i,s,o)}bind(e,t){return"first"!==this.type&&"​"!==this.body&&(this.id=function(e){let t;return e.atomIdsSettings&&("number"==typeof e.atomIdsSettings.seed?(t=e.atomIdsSettings.overrideID?e.atomIdsSettings.overrideID:e.atomIdsSettings.seed.toString(36),e.atomIdsSettings.seed+=1):t=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36)),t}(e),this.id&&(t.attributes||(t.attributes={}),t.attributes["data-atom-id"]=this.id)),t}makeSpan(e,t){const a=_(t,"","textord"===this.type?"mord":v(this.type)?this.type:""),i=this.getStyle();i.letterShapeStyle=e.letterShapeStyle,a.applyStyle(i);const s=(null==i?void 0:i.fontSize)?i.fontSize:"size5";return s!==e.parentSize?(a.classes+=" sizing reset-"+e.parentSize,a.classes+=" "+s):e.parentSize!==e.size&&(a.classes+=" sizing reset-"+e.parentSize,a.classes+=" "+e.size),a.maxFontSize=Math.max(a.maxFontSize,e.mathstyle.sizeMultiplier||1),"text"===this.mode&&(a.classes+=" ML__text"),e.mathstyle.isTight()&&(a.isTight=!0),"math"!==this.mode&&(a.italic=0),a.setRight(a.italic),"number"==typeof e.opacity&&a.setStyle("opacity",e.opacity),this.bind(e,a),this.caret&&(this.superscript||this.subscript||(a.caret=this.caret,this.caret="",e.mathstyle.isTight()&&(a.isTight=!0))),a}}function Oe(t,a=[]){const i=new Be(t,"root",a||[]);return!e(i.body)||0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new Be("","first")),i}function Re(t){return e(t)}const Pe=[[8205,1],[65038,2],[127995,5],[129456,4],[917536,96]];let Ie;const He=[127462,127487];function We(e){var t;return Ie||(Ie={},Pe.forEach(e=>{for(let t=e[0];t<=e[0]+e[1]-1;t++)Ie[t]=!0})),null!==(t=Ie[e])&&void 0!==t&&t}function Ve(e){return e>=He[0]&&e<=He[1]}function Ue(e){if(/^[\x20-\xFF]*$/.test(e))return e;const t=[],a=function(e){const t=[];for(let a=0;a=55296&&i<=56319){const t=e.charCodeAt(a+1);if(t>=56320&&t<=57343){const e=i-55296,s=t-56320;i=Math.pow(2,16)+e*Math.pow(2,10)+s,a++}}t.push(i)}return t}(e);let i=0;for(;i=this.s.length}get(){return this.pos="0"&&a<="9"?parseInt(a):"?"):e=new je("literal","#")}}else"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),e=new je("$$")):e=new je("$")):e=new je("literal",this.get());return e}}function Ze(e){const t=_("​","arraycolsep");return t.setWidth(e),t}function Xe(e,t,a,i){const s=[];for(const o of t){const t=_(Ne(e,i));t.depth=o.depth,t.height=o.height,s.push(t),s.push(o.pos-a)}return E(e,s,"individualShift")}Fe("genfrac",(e,t)=>{const a="auto"===t.mathstyle?e.mathstyle:c[t.mathstyle],i=e.clone({mathstyle:a});let s=[];t.numerPrefix&&s.push(_(t.numerPrefix,"mord"));const o=t.continuousFraction?a:a.fracNum();s=s.concat(Ne(i.clone({mathstyle:o}),t.numer));const r=K(s,e.mathstyle.adjustTo(o));let n=[];t.denomPrefix&&n.push(_(t.denomPrefix,"mord"));const l=t.continuousFraction?a:a.fracDen();n=n.concat(Ne(i.clone({mathstyle:l}),t.denom));const d=K(n,e.mathstyle.adjustTo(l)),m=t.hasBarLine?.04/a.sizeMultiplier:0;let p,h,u=0;a.size===c.displaystyle.size?(p=a.metrics.num1,u=m>0?3*m:.28,h=a.metrics.denom1):(m>0?(p=a.metrics.num2,u=m):(p=a.metrics.num3,u=.12),h=a.metrics.denom2);const f=r?$(r):0,g=d?A(d):0;let y;if(0===m){const e=p-f-(g-h);e{let a=t.colFormat;a&&0===a.length&&(a=[{align:"l"}]),a||(a=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const e of a)e.align&&s++;for(const e of t.array){let t=0;for(;t0&&(l+=m,r0&&y.push(E(e,a,"individualShift"))}const b=[];let v=!1,x=!1,k=0,w=!t.lFence;for(const t of a){if(t.align&&k>=y.length)break;if(t.align&&k{const i=a.svgBody?F(a.svgBody):Ne(t,a.body),s=t.clone({mathstyle:c.scriptstyle});let o,r;a.svgAbove?o=F(a.svgAbove):a.overscript&&(o=_(Ne(s,a.overscript),t.mathstyle.adjustTo(s.mathstyle))),a.svgBelow?r=F(a.svgBelow):a.underscript&&(r=_(Ne(s,a.underscript),t.mathstyle.adjustTo(s.mathstyle))),o&&r&&(r.setLeft(.3),r.setRight(.3),o.setLeft(.3),o.setRight(.3));let n=function(t,a,i,s,o){if(!i&&!s)return e(a)?_(a):a;let r=0,n=0;i&&(r=Math.max(.111,.2-$(i))),s&&(n=Math.max(.166,.6-A(s)));let l=null;if(s&&i){const e=A(s)+$(s)+$(a);l=E(t,[0,s,.2+$(a),a,-r,i,.166],"bottom",e)}else s&&!i?l=E(t,[0,s,n,a],"top",A(a)):i&&!s&&(l=E(t,[a,Math.max(.166,r-$(i)),i,0],"bottom",$(a)));return _(l,"op-over-under",o)}(t,i,o,r,v(a.type)?a.type:"mord");return(a.superscript||a.subscript)&&(n=a.attachLimits(t,n,0,0)),[n]}),Fe("accent",(t,a)=>{const i=t.mathstyle;let s=Ne(t.cramp(),a.body);(a.superscript||a.subscript)&&(s=[a.attachSupsub(t,_(s,"","mord"),"mord")]);let o=0;e(a.body)&&1===a.body.length&&a.body[0].isCharacterBox()&&(o=function(t){if(!t)return 0;if(e(t)){let e=0;for(const a of t)e+=a.skew||0;return e}return t.skew}(s));let r,n=Math.min(A(s),i.metrics.xHeight);if(a.svgAccent)r=F(a.svgAccent),n=.111-n;else{const e=D("Main-Regular",a.accent,"math");e.italic=0;const t="⃗"===a.accent?" accent-vec":"";r=_(_(e),"accent-body"+t)}return r=E(t,[s,-n,r]),r.children[1].setLeft(2*o),[_([r],"accent","mord")]}),Fe("enclose",(e,t)=>{const a=_(Ne(e,t.body),"","mord"),i="number"==typeof t.padding?t.padding:.3,s=_("","ML__notation");s.setStyle("position","absolute"),s.setStyle("height",A(a)+$(a)+2*i,"em"),s.height=A(a)+i,s.depth=$(a)+i,0!==i?s.setStyle("width","calc(100% + "+2*i+"em)"):s.setStyle("width","100%"),s.setStyle("top","0"),s.setStyle("left",-i,"em"),s.setStyle("z-index","-1"),t.backgroundcolor&&s.setStyle("background-color",t.backgroundcolor),t.notation.box&&s.setStyle("border",t.borderStyle),t.notation.actuarial&&(s.setStyle("border-top",t.borderStyle),s.setStyle("border-right",t.borderStyle)),t.notation.madruwb&&(s.setStyle("border-bottom",t.borderStyle),s.setStyle("border-right",t.borderStyle)),t.notation.roundedbox&&(s.setStyle("border-radius",(A(a)+$(a))/2,"em"),s.setStyle("border",t.borderStyle)),t.notation.circle&&(s.setStyle("border-radius","50%"),s.setStyle("border",t.borderStyle)),t.notation.top&&s.setStyle("border-top",t.borderStyle),t.notation.left&&s.setStyle("border-left",t.borderStyle),t.notation.right&&s.setStyle("border-right",t.borderStyle),t.notation.bottom&&s.setStyle("border-bottom",t.borderStyle);let o="";if(t.notation.horizontalstrike&&(o+='{const a="number"==typeof t.padding?t.padding:.3,i=_(Ne(e,t.body),"","mord");i.setStyle("vertical-align",-$(i),"em"),i.setStyle("height",0);const s=_(i,"","mord"),o=_("","ML__box");o.setStyle("position","absolute"),o.setStyle("height",A(s)+$(s)+2*a,"em"),0!==a?o.setStyle("width","calc(100% + "+2*a+"em)"):o.setStyle("width","100%"),o.setStyle("top",-a,"em"),o.setStyle("left",-a,"em"),o.setStyle("z-index","-1"),o.setStyle("box-sizing","border-box"),t.backgroundcolor&&o.setStyle("background-color",t.backgroundcolor),t.framecolor&&o.setStyle("border","0.04em solid "+t.framecolor),t.border&&o.setStyle("border",t.border),s.setStyle("display","inline-block"),s.setStyle("height",A(s)+$(s),"em");const r=_([o,s]);return r.setStyle("position","relative"),r.setStyle("vertical-align",-a+$(s),"em"),r.height=A(s)+a,r.depth=$(s)+a,r.setLeft(a),r.setRight(a),r.setStyle("height",r.height+r.depth-2*a,"em"),r.setStyle("top",-a,"em"),r.setStyle("display","inline-block"),[r]}),Fe("mop",(t,a)=>{var i;const s=t.mathstyle;let o,r=0,n=0;if(a.isSymbol){const e=s.size===c.displaystyle.size&&"\\smallint"!==a.symbol;o=D(e?"Size2-Regular":"Size1-Regular",a.body,"op-symbol "+(e?"large-op":"small-op"),"mop"),r=(o.height-o.depth)/2-s.metrics.axisHeight*s.sizeMultiplier,n=o.italic,o.applyStyle({color:a.phantom?"transparent":a.color,backgroundColor:a.phantom?"transparent":a.backgroundColor,cssId:a.cssId,cssClass:a.cssClass,letterShapeStyle:t.letterShapeStyle})}else o=e(a.body)?_(Ne(t,a.body),"","mop"):a.makeSpan(t,a.body);a.bind(t,o),a.isSymbol&&o.setTop(r);let l=o;if(a.superscript||a.subscript){const e=null!==(i=a.limits)&&void 0!==i?i:"auto";l="limits"===e||"auto"===e&&s.size===c.displaystyle.size?a.attachLimits(t,o,r,n):a.attachSupsub(t,o,"mop")}return[l]}),Fe("line",(e,t)=>{const a=e.mathstyle,i=Ne(e.cramp(),t.body),s=.04/a.sizeMultiplier,o=_(null,e.mathstyle.adjustTo(c.textstyle)+" "+t.position+"-line");let r;if(o.height=s,o.maxFontSize=1,"overline"===t.position)r=E(e,[i,3*s,o,s]);else{const t=_(i);r=E(e,[s,o,3*s,t],"top",A(t))}return[_(r,t.position,"mord")]}),Fe("leftright",(e,t)=>{if(!t.body)return t.leftDelim?new Be("math","mopen",t.leftDelim).decompose(e):t.rightDelim?new Be("math","mclose",t.rightDelim).decompose(e):null;const a=e.clone(),i=Ne(a,t.body),s=a.mathstyle;let o=0,r=0,n=[];if(o=A(i)*s.sizeMultiplier,r=$(i)*s.sizeMultiplier,t.leftDelim&&(n.push(t.bind(e,qe("mopen",t.leftDelim,o,r,a,"ML__open"))),n[n.length-1].applyStyle(t.getStyle())),i){for(let s=0;s{const a=e.mathstyle,i=Ne(e.cramp(),t.body),s=.04/a.sizeMultiplier;let o=s;a.idA(i)+$(i)+r&&(r=(r+l-(A(i)+$(i)))/2),n.setTop(n.height-A(i)-(r+s));const d=_(null,e.mathstyle.adjustTo(c.textstyle)+" sqrt-line");d.applyStyle(t.getStyle()),d.height=s;const m=E(e,[i,r,d,s]);if(!t.index)return[t.bind(e,_([n,m],"sqrt","mord"))];const p=e.clone({mathstyle:c.scriptscriptstyle}),h=E(e,[_(Ne(p,t.index),a.adjustTo(c.scriptscriptstyle))],"shift",-.6*(Math.max(n.height,m.height)-Math.max(n.depth,m.depth)));return[t.bind(e,_([_(h,"root"),n,m],"sqrt","mord"))]});const Ye={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML_bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},Je={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[0-9A-Z ]$/,fraktur:/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/,monospace:/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9]$/,"sans-serif":/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9]$/},Qe=/^[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5]$/,et=[/^[a-z]$/,/^[A-Z]$/,Qe,/^[\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9]$/],tt={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]};y("math",{emitLatexRun:function(e,t,a){let i=e.variant;return e.variantStyle&&"up"!==e.variantStyle&&(i+="-"+e.variantStyle),u(f(t,"color").map(t=>{const s=u(f(t,"variant").map(t=>{let s=t[0].variant;if(t[0].variantStyle&&"up"!==t[0].variantStyle&&(s+="-"+t[0].variantStyle),t.every(t=>{const a=se(t.symbol,e.mode,null);if(!a||!a.variant&&!a.variantStyle)return!1;let i=t.variant;return t.variantStyle&&"up"!==t.variantStyle&&(i+="-"+t.variantStyle),i===s}))return u(t.map(e=>e.toLatex(a)));let o="";return s&&s!==i&&(o={calligraphic:"\\mathcal{",fraktur:"\\mathfrak{","double-struck":"\\mathbb{",script:"\\mathscr{",monospace:"\\mathtt{","sans-serif":"\\mathsf{",normal:"\\mathrm{","normal-italic":"\\mathit{","normal-bold":"\\mathbf{","normal-bolditalic":"\\mathbfit{",ams:"","ams-italic":"\\mathit{","ams-bold":"\\mathbf{","ams-bolditalic":"\\mathbfit{",main:"","main-italic":"\\mathit{","main-bold":"\\mathbf{","main-bolditalic":"\\mathbfit{"}[s]),o+u(t.map(e=>e.toLatex(a)))+(o?"}":"")}));return!t[0].color||e&&e.color===t[0].color?s:"\\textcolor{"+ve(t[0].color)+"}{"+s+"}"}))},applyStyle:function(e,t){const a="auto"!==t.letterShapeStyle&&t.letterShapeStyle?t.letterShapeStyle:"tex";let i=t.variant||"normal",s=t.variantStyle||"";"normal"===i&&!s&&/\u00a3|\u0131|\u0237/.test(e.body)&&(i="main",s="italic"),"normal"!==i||s||1!==e.body.length||et.forEach((t,i)=>{t.test(e.body)&&"it"===tt[a][i]&&(s="italic")}),"up"===s&&(s="");const o=s?i+"-"+s:i,[r,n]=Ye[o];return Je[i]&&!Je[i].test(e.body)?(e.body=J(e.body,i,s),e.variant="",e.variantStyle="",null):(Qe.test(e.body)&&(e.classes+=" lcGreek"),n&&(e.classes+=" "+n),r)}});const at={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"};function it(e){let t=!1;const a=e.map(e=>"literal"===e.type?e.value:"{"===e.type?"{":"}"===e.type?"}":"command"===e.type?"\\"+e.value:"placeholder"===e.type?"#?":"#"===e.type?(t=!0,"#"+e.value):"space"===e.type?" ":"$"===e.type?"$":"$$"===e.type?"$$":"").join("");return t?"":a}y("text",{emitLatexRun:function(e,t,a){const i=function(e,t,a){return u(f(t,"color").map(t=>{const a=function(e,t,a){return function(e,t,a){return u(f(t,"fontFamily").map(e=>{const t=function(e,t,a){return u(f(t,"fontSize").map(e=>{const t=function(e,t,a){return u(f(t,"fontSeries").map(e=>{const t=function(e,t,a){return u(f(t,"fontShape").map(e=>{const t=function(e,t,a){let i=!1;return u(t.map(e=>{let t="",a="";return e.latex?t=e.latex:"string"==typeof e.body?t=ee("text",e.body):e.symbol&&(t=e.symbol.replace(/\\/g,"\\backslash ")),!i||t&&!/^[a-zA-Z0-9*]/.test(t)||(a="{}"),i=/\\[a-zA-Z0-9]+\*?$/.test(t),a+t}))}(0,e);return"it"===e[0].fontShape?"\\textit{"+t+"}":"sl"===e[0].fontShape?"\\textsl{"+t+"}":"sc"===e[0].fontShape?"\\textsc{"+t+"}":"n"===e[0].fontShape?"\\textup{"+t+"}":e[0].fontShape?"\\fontshape{"+e[0].fontShape+"}"+t:t}))}(0,e);return"b"===e[0].fontSeries?"\\textbf{"+t+"}":"l"===e[0].fontSeries?"\\textlf{"+t+"}":"m"===e[0].fontSeries?"\\textmd{"+t+"}":e[0].fontSeries?"\\fontseries{"+e[0].fontSeries+"}"+t:t}))}(0,e),a={size1:"tiny",size2:"scriptsize",size3:"footnotesize",size4:"small",size5:"normalsize",size6:"large",size7:"Large",size8:"LARGE",size9:"huge",size10:"Huge"}[e[0].fontSize]||"";return a?"\\"+a+" "+t:t}))}(0,e),a={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[e[0].fontFamily]||"";return a?"\\"+a+"{"+t+"}":e[0].fontFamily?"\\fontfamily{"+e[0].fontFamily+"}"+t:t}))}(0,t)}(0,t);return!t[0].color||"none"===t[0].color||e&&e.color===t[0].color?a:"\\textcolor{"+ve(t[0].color)+"}{"+a+"}"}))}(e,t);return t.every(e=>e.fontSeries||e.fontShape||e.fontFamily)&&t[0].mode===e.mode?i:`\\text{${i}}`},applyStyle:function(e,t){const a=t.fontFamily;if(at[a]?e.classes+=" "+at[a]:a&&e.setStyle("font-family",a),t.fontShape&&(e.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const a=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);a&&(e.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[a[1]||""]||""),e.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[a[2]||""]||""))}return"Main-Regular"},parse:(e,t,a)=>function(e,t,a){var i;let s,o=[];for(;e.length>0;){const r=e.shift();if("space"===r.type)s=new Be("text",""," ",a.style),s.symbol=" ",o.push(s);else if("placeholder"===r.type)s=new Be("text","placeholder",r.value),s.captureSelection=!0,o.push(s);else if("command"===r.type){let t;e.unshift(r),[t,e]=a.parse("text",e,a),o=[...o,...t]}else if("literal"===r.type){const e=se(r.value,"text",a.macros);!e||e.mode&&!e.mode.includes("text")?t({code:"unexpected-token"}):(s=new Be("text",e?e.type:"",e?e.value:r.value,a.style),s.symbol=r.value,s.latex=Z("text",r.value),o.push(s))}else if("$"===r.type||"$$"===r.type){const t=e.slice(0,e.findIndex(e=>e.type===r.type));e=e.slice(t.length+1);const[i]=a.parse("math",t,a);o=[...o,...i]}else"{"===r.type||"}"===r.type||t({code:"unexpected-token",arg:r.type+(null!==(i=r.value)&&void 0!==i?i:"")})}return[o,e]}(e,t,a)[0]});class st{constructor(e,t,a,i){this.index=0,this.mathList=[],this.style={},this.parseMode="math",this.smartFence=!1,this.tabularMode=!1,this.endCount=0,this.tokens=e,this.args=t,this.macros=a,this.onError=e=>i({before:it(this.tokens.slice(this.index,this.index+10)),after:it(this.tokens.slice(Math.max(0,this.index-10),this.index)),...e})}swapMathList(e=[]){const t=this.mathList;return this.mathList=e,t}swapParseMode(e){const t=this.parseMode;return this.parseMode=e,t}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=e.length}const s=e.toUpperCase()===i.toUpperCase();return s||(this.index=t),s}scanString(){let e="",t=this.end();for(;!t;){if(this.hasLiteral("]"))t=!0;else if(this.hasToken("literal"))e+=this.get().value;else if(this.skipWhitespace())e+=" ";else if(this.hasToken("command")){const t=this.get();"space"===t.value?e+=" ":(this.onError({code:"unbalanced-braces"}),e+=t.value)}else t=!0;t=t||this.end()}return e}scanLiteralArg(){let e="";if(this.hasToken("{")){this.get();let t=1;for(;t>0&&!this.end();){const a=this.get();"space"===a.type?e+=" ":"#"===a.type?e+="#"+a.value:"command"===a.type?e+="\\"+a.value:"}"===a.type?(t-=1,t>0&&(e+="}")):"{"===a.type?(t+=1,e+="{"):e+=a.value}}return e}scanColor(){return be(this.scanString())}scanNumber(e=!0){const t=this.parseLiteral("-");t||this.parseLiteral("+"),this.skipWhitespace(),e=!!e;let a=10,i=/[0-9]/;this.parseLiteral("'")?(a=8,i=/[0-7]/,e=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(a=16,i=/[0-9A-F]/,e=!0);let s="";for(;this.hasLiteralPattern(i);)s+=this.get().value;if(!e&&(this.parseLiteral(".")||this.parseLiteral(",")))for(s+=".";this.hasLiteralPattern(i);)s+=this.get().value;const o=e?parseInt(s,a):parseFloat(s);return t?-o:o}scanDimen(){const e=this.scanNumber(!1);let t;return this.skipWhitespace(),this.parseKeyword("pt")?t=r(e,"pt"):this.parseKeyword("mm")?t=r(e,"mm"):this.parseKeyword("cm")?t=r(e,"cm"):this.parseKeyword("ex")?t=r(e,"ex"):this.parseKeyword("px")?t=r(e,"px"):this.parseKeyword("em")?t=r(e,"em"):this.parseKeyword("bp")?t=r(e,"bp"):this.parseKeyword("dd")?t=r(e,"dd"):this.parseKeyword("pc")?t=r(e,"pc"):this.parseKeyword("in")?t=r(e,"in"):this.parseKeyword("mu")?t=r(e,"mu"):(this.onError({code:"missing-unit"}),t=r(e,"pt")),t}scanSkip(){const e=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),e}scanColspec(){this.skipWhitespace();const e=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const t=this.get().value;if("lcr".includes(t))e.push({align:t});else if("|"===t)e.push({rule:!0});else if("@"===t){if(this.parseToken("{")){const t=this.swapParseMode("math");e.push({gap:this.scanImplicitGroup(e=>"}"===e.type)}),this.swapParseMode(t)}this.parseToken("}")}}return e}scanModeSet(){let e;if(this.parseCommand("(")&&(e=")"),!e&&this.parseCommand("[")&&(e="]"),!e)return null;const t=this.swapParseMode("math"),a=new Be("math","group");return a.mathstyle=")"===e?"textstyle":"displaystyle",a.body=this.scanImplicitGroup(t=>"command"===t.type&&t.value===e),this.parseCommand(e),this.swapParseMode(t),a.body&&0!==a.body.length?a:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const e=this.get().type,t=new Be("math","group");t.mathstyle="$"===e?"textstyle":"displaystyle",t.latexOpen="textstyle"===t.mathstyle?"$":"$$",t.latexClose=t.latexOpen;const a=this.swapParseMode("math");return t.body=this.scanImplicitGroup(t=>t.type===e),this.parseToken(e),this.swapParseMode(a),t.body&&0!==t.body.length?t:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const e=this.scanArg("string");if(!e)return null;const t=ie(e);if(!t)return null;const a=[];if(null==t?void 0:t.params)for(const i of t.params)if(i.isOptional)a.push(this.scanOptionalArg(i.type));else{const t=this.scanArg(i.type);t||this.onError({code:"missing-argument",arg:e}),a.push(t)}const i=this.parseMode,s=this.tabularMode,o=this.swapMathList([]);this.tabularMode=t.tabular;const r=[],n=[];let l=[],c=!1;do{if(this.end()&&(this.onError({code:"unbalanced-environment",arg:e}),c=!0),!c&&this.parseCommand("end")&&(this.scanArg("string")!==e&&this.onError({code:"unbalanced-environment",arg:e}),c=!0),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let e=0;this.skipWhitespace(),this.parseLiteral("[")&&(e=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),n.push(e||0),r.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup(e=>"}"===e.type||"literal"===e.type&&"&"===e.value||"command"===e.type&&/^(end|cr|\\)$/.test(e.value)))}while(!c);l.push(this.swapMathList([])),l.length>0&&r.push(l);const d=this.swapMathList(o);if(this.parseMode=i,this.tabularMode=s,!t.tabular&&0===d.length)return null;if(t.tabular&&0===r.length)return null;const m=new Be(this.parseMode,"array",d);return Object.assign(m,t.parser(e,a,r)),m.array=r,m.rowGaps=n,m.environmentName=e,m}scanImplicitGroup(e){const t=this.style;e||(e=e=>"}"===e.type);let a=null,i=null,s=[],o=null;const r=this.swapMathList([]);for(;!this.end()&&!e(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const e=new Be("math","mathstyle");e.mathstyle=this.get().value,this.mathList.push(e)}else this.hasInfixCommand()&&!a?(a=this.get(),i=se("\\"+a.value,"math",this.macros),i&&([,s]=this.parseArguments(i)),o=this.swapMathList([])):this.parseAtom();let n;return a?(s.unshift(this.swapMathList(r)),s.unshift(o),n=[new Be(this.parseMode,i.type,i.value||a.value,i.parse?i.parse("\\"+a.value,s):null)],n[0].symbol="\\"+a.value):n=this.swapMathList(r),this.style=t,n}scanGroup(){if(!this.parseToken("{"))return null;const e=new Be(this.parseMode,"group");return e.body=this.scanImplicitGroup(e=>"}"===e.type),this.parseToken("}"),e.latexOpen="{",e.latexClose="}",e}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const e=new Be(this.parseMode,"leftright");e.leftDelim="(",e.inner=!1;const t=this.swapMathList([]);let a=1;for(;!this.end()&&0!==a;)this.hasLiteral("(")&&(a+=1),this.hasLiteral(")")&&(a-=1),0!==a&&this.parseAtom();return 0===a&&this.parseLiteral(")"),e.rightDelim=0===a?")":"?",e.body=this.swapMathList(t),e}scanDelim(){this.skipWhitespace();const e=this.get();if(!e)return this.onError({code:"unexpected-end-of-string"}),null;let t=".";"command"===e.type?t="\\"+e.value:"literal"===e.type&&(t=e.value);const a=se(t,"math",this.macros);return a?a.mode&&!a.mode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:t}),null):"mopen"===a.type||"mclose"===a.type||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(t)?t:(this.onError({code:"unexpected-delimiter",arg:t}),null):(this.onError({code:"unknown-command",arg:t}),null)}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return this.onError({code:"unbalanced-braces"}),null;const e=this.style;let t="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;t="mright"}const a=this.scanDelim();if(!a)return null;const i=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(t);)this.parseAtom();this.style=e;const s=this.scanDelim(),o=new Be(this.parseMode,"leftright");return o.leftDelim=a,o.rightDelim=s,o.inner="right"===t,o.body=this.swapMathList(i),o}parseSupSub(){var e,t;if("math"!==this.parseMode)return!1;let a=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){const i=this.hasLiteral("_")?"subscript":"superscript";if(this.parseLiteral("^")||this.parseLiteral("_")){const t=this.scanArg();if(t){const s=this.lastSubsupAtom();s[i]=(null!==(e=s[i])&&void 0!==e?e:[]).concat(t),a=!0}}else if(this.parseLiteral("'")){const e=this.lastSubsupAtom(),i=new Be(e.mode,"mord","′");i.symbol="\\prime",e.superscript=null!==(t=e.superscript)&&void 0!==t?t:[],e.superscript.push(i),a=!0}}return a}parseLimits(){if(this.parseCommand("limits")){const e=this.lastSubsupAtom();return e.limits="limits",e.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const e=this.lastSubsupAtom();return e.limits="nolimits",e.explicitLimits=!0,!0}return!1}scanOptionalArg(e){if(e=e&&"auto"!==e?e:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const t=this.parseMode;this.parseMode=e;const a=this.swapMathList();let i;for(;!this.end()&&!this.parseLiteral("]");)if("string"===e)i=this.scanString();else if("number"===e)i=this.scanNumber();else if("dimen"===e)i=this.scanDimen();else if("skip"===e)i=this.scanSkip();else if("colspec"===e)i=this.scanColspec();else if("color"===e)i=this.scanColor()||"#ffffff";else if("bbox"===e){const e=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/),t={};for(const a of e){const e=be(a);if(e)t.backgroundcolor=e;else{const e=a.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(e)t.padding=r(e[1],e[2]);else{const e=a.match(/^\s*border\s*:\s*(.*)/);e&&(t.border=e[1])}}}i=t}else this.mathList=this.mathList.concat(this.scanImplicitGroup(e=>"literal"===e.type&&"]"===e.value));this.parseMode=t;const s=this.swapMathList(a);return i||s}scanArg(e){var t;let a;if(e=e&&"auto"!==e?e:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===e)return this.scanDelim()||".";if(/^(math|text)$/.test(e)){const t=this.parseMode;this.parseMode=e;const a=this.scanToken();return this.parseMode=t,a}}if(this.hasToken("#")){const e=this.get();return this.skipUntilToken("}"),"?"===e.value?this.placeholder():this.args?null===this.args[e.value]||void 0===this.args[e.value]?this.placeholder():"string"==typeof this.args[e.value]?ot(this.args[e.value],this.parseMode,null,this.macros,!1,this.onError):null!==(t=this.args[e.value])&&void 0!==t?t:null:null}const i=this.parseMode;this.parseMode=e;const s=this.swapMathList([]);if("string"===e)a=this.scanString(),this.skipUntilToken("}");else if("number"===e)a=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===e)a=this.scanDimen(),this.skipUntilToken("}");else if("skip"===e)a=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===e)a=this.scanColspec(),this.skipUntilToken("}");else if("color"===e)a=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===e)a=this.scanDelim()||".",this.skipUntilToken("}");else{const t=this.index;let i=1;do{const e=this.get();"}"===(null==e?void 0:e.type)&&(i-=1),"{"===(null==e?void 0:e.type)&&(i+=1)}while(i>0&&!this.end());if(a=function(e,t,a,i){return g[e]&&g[e].parse?g[e].parse(t,a,i):null}(e,this.tokens.slice(t,this.index-1),this.onError,{args:this.args,macros:this.macros,smartFence:this.smartFence,style:this.style,parse:(e,t,i)=>{const s=new st(t,i.args,i.macros,this.onError);return s.parseMode=e,s.style=i.style,a=s.scanImplicitGroup(),[a,t.slice(s.index)]}}),!a){this.index=t;do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end())}}this.parseMode=i;const o=this.swapMathList(s);return a||o}scanToken(){var t;const a=this.get();if(!a)return null;let i=null;if("space"===a.type)"text"===this.parseMode&&(i=new Be("text",""," ",this.style),i.symbol=" ");else if("placeholder"===a.type)i=new Be(this.parseMode,"placeholder",a.value),i.captureSelection=!0;else if("command"===a.type){if("placeholder"===a.value)i=new Be(this.parseMode,"placeholder",this.scanArg("string"),this.style),i.captureSelection=!0;else if("char"===a.value){const e=this.index;let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),i=new Be(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),i.symbol="\\char",i.latex="\\char"+it(this.tokens.slice(e))}else if("hskip"===a.value||"kern"===a.value){const e=this.scanSkip();isFinite(e)&&(i=new Be(this.parseMode,"spacing",null,this.style),i.width=e,i.symbol="\\"+a.value,i.latex="\\"+a.value)}else if(i=this.scanMacro(a.value),!i){const e=se("\\"+a.value,this.parseMode,{});if(!e)return this.onError({code:"unknown-command",arg:"\\"+a.value}),i=new Be("math","error","\\"+a.value),i.symbol="\\"+a.value,i.latex="\\"+a.value,[i];if(e.mode&&!e.mode.includes(this.parseMode))return this.onError({code:"invalid-command",arg:"\\"+a.value}),i=new Be("math","error","\\"+a.value),i.symbol="\\"+a.value,i.latex="\\"+a.value,[i];const t=this.index,[s,o]=this.parseArguments(e);if(!o)return null;if(e.infix)this.onError({code:"too-many-infix-commands",arg:"\\"+a.value});else{if(e.parse){const t=e.parse("\\"+a.value,o);if(t.type)i=new Be(this.parseMode,e.type,s?this.scanArg(s):null,{...this.style,...t});else{const e=this.parseMode;if(t.mode&&(this.parseMode=t.mode,delete t.mode),s){const e=this.style;this.style={...this.style,...t},i=this.scanArg(s),this.style=e}else this.style={...this.style,...t};this.parseMode=e}}else{const t={...this.style,variant:e.variant||this.style.variant,variantStyle:e.variantStyle||this.style.variantStyle};i=new Be(this.parseMode,e.type||"mop",e.value||a.value,t)}if(i instanceof Be&&!/^(llap|rlap|class|cssId)$/.test(a.value)){i.symbol="\\"+a.value;const e=it(this.tokens.slice(t,this.index));if(e&&(i.latex=i.symbol+e),i.isFunction&&this.smartFence){const e=this.scanSmartFence();e&&(i=[i,e])}}}}}else if("literal"===a.type&&"string"==typeof a.value){const e=se(a.value,this.parseMode,this.macros);if(e){const t={...this.style};i=new Be(this.parseMode,e.type,e.value||a.value,t),e.isFunction&&(i.isFunction=!0)}else i=new Be(this.parseMode,"math"===this.parseMode?"mord":"",a.value,this.style);if(i.symbol=a.value,i.latex=Q(this.parseMode,a.value),(null==e?void 0:e.isFunction)&&this.smartFence){const e=this.scanSmartFence();e&&(i=[i,e])}}else"#"===a.type?i="?"!==a.value&&this.args?null===this.args[a.value]||void 0===this.args[a.value]?this.placeholder():"string"==typeof this.args[a.value]?ot(this.args[a.value],this.parseMode,[],this.macros,!1,this.onError):this.args[a.value]:this.placeholder():"}"===a.type?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:a.type+(null!==(t=a.value)&&void 0!==t?t:"")});return i&&!e(i)?[i]:i}scanMacro(e){var t;if(!this.macros||!this.macros[e])return null;const a=this.index,i=[];let s,o=0;"string"==typeof this.macros[e]?(s=this.macros[e],/(^|[^\\])#1/.test(s)&&(o=1),/(^|[^\\])#2/.test(s)&&(o=2),/(^|[^\\])#3/.test(s)&&(o=3),/(^|[^\\])#4/.test(s)&&(o=4),/(^|[^\\])#5/.test(s)&&(o=5),/(^|[^\\])#6/.test(s)&&(o=6),/(^|[^\\])#7/.test(s)&&(o=7),/(^|[^\\])#8/.test(s)&&(o=8),/(^|[^\\])#9/.test(s)&&(o=9)):(s=this.macros[e].def,o=this.macros[e].args||0);for(let e=1;e<=o;e++)i[e]=this.scanLiteralArg();i["?"]=null===(t=this.args)||void 0===t?void 0:t["?"];const r=new Be(this.parseMode,"group",ot(s,this.parseMode,i,this.macros,!1,this.onError));return r.captureSelection=!0,r.symbol="\\"+e,r.latex="\\"+e+it(this.tokens.slice(a)),r}parseAtom(){let t=this.scanEnvironment()||this.scanModeShift()||this.scanModeSet()||this.scanGroup()||this.scanLeftRight();return!(t||!this.parseSupSub()&&!this.parseLimits())||(t||(t=this.scanToken()),e(t)?this.mathList=this.mathList.concat(t):t&&this.mathList.push(t),null!==t)}}function ot(e,t,a,i,s=!1,o){let r=[];const n=new st(function(e){const t=[],a=e.toString().split(/\r?\n/);let i="",s="";for(const e of a){i+=s,s=" ";const t=e.match(/((?:\\%)|[^%])*/);t&&(i+=t[0])}const o=new Ge(i);for(;!o.end();){const e=o.makeToken();e&&t.push(e)}return t}(e),a,i,t=>{o&&o({...t,latex:e})});for(n.parseMode=t||"math",s&&(n.smartFence=!0);!n.end();)r=r.concat(n.scanImplicitGroup());return r}function rt(e){return 0===e.length||1===e.length&&"first"===e[0].type}function nt(e){const t=e.siblings();for(let e=t.length-1;e>=0;e--)t[e].suggestion&&t.splice(e,1)}function lt(e){let t=1,a=e.ancestor(t);for(;a;)a.latex=void 0,t+=1,a=e.ancestor(t)}function ct(e,t){let a="";for(const t of e)a+=t.relation+":"+t.offset+"/";return t&&(a+="#"+t),a}function dt(e){const t={path:[],extent:0},a=e.split("#");a.length>1&&(t.extent=parseInt(a[1]));const i=a[0].split("/");for(const e of i){const a=e.match(/([^:]*):(.*)/);a&&t.path.push({relation:a[1],offset:parseInt(a[2])})}return t}function mt(e,t){let a=0,i=-1,s=!1;for(;!s;)i+=1,s=i>=e.length||i>=t.length,s=s||!(e[i].relation===t[i].relation&&e[i].offset===t[i].offset);return a=i===e.length&&i===t.length?0:i+1===e.length&&i+1===t.length&&e[i].relation===t[i].relation?1:2,a}function pt(e){return dt(ct(e)).path}function ht(e,t){let a=0;for(let i=0;i0;)i.col+=1,(!e[i.row]||i.col>=e[i.row].length)&&(i.col=0,i.row+=1),a-=1;return i}function ft(t,a){let i;return"object"!=typeof a&&(a=ut(t,a)),e(t[a.row])&&(i=t[a.row][a.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(new Be("","first")),i}function gt(e){let t=0,a=0,i=1;for(const t of e)a+=1,t.length>i&&(i=t.length);return t=a*i,t}function yt(e,t,a){const i={...t};if(i.row+=a,i.row<0){if(i.col+=a,i.row=e.length-1,i.col<0)return null;for(;i.row>=0&&!ft(e,i);)i.row-=1;if(i.row<0)return null}else if(i.row>=e.length){for(i.col+=a,i.row=0;i.rowe.length-1)return null}return i}class bt{constructor(e,t,a,i){this.options={mode:"math",removeExtraneousParentheses:!1,...e},this.root=Oe(this.options.mode),this.path=[{relation:"body",offset:0}],this.extent=0,this.setListeners(t),this.setHooks(a),this.mathfield=i,this.suppressChangeNotifications=!1}clone(){const e=new bt(this.options,this.listeners,this.hooks,this.mathfield);return e.root=this.root,e.path=pt(this.path),e}setListeners(e){this.listeners=e}setHooks(e){this.hooks={announce:(null==e?void 0:e.announce)?e.announce:(e,t,a,i)=>{},moveOut:(null==e?void 0:e.moveOut)?e.moveOut:()=>!0,tabOut:(null==e?void 0:e.tabOut)?e.tabOut:()=>!0}}announce(e,t,a=[]){this.hooks.announce(this.mathfield,e,t,a)}toString(){return ct(this.path,this.extent)}siblings(){if(0===this.path.length)return[];let e;return this.parent().array?e=ft(this.parent().array,this.relation()):(e=this.parent()[this.relation()]||[],"string"==typeof e&&(e=[])),0!==e.length&&"first"===e[0].type||e.unshift(new Be("","first")),e}anchorOffset(){return this.path.length>0?this.path[this.path.length-1].offset:0}focusOffset(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0}startOffset(){return Math.min(this.focusOffset(),this.anchorOffset())}endOffset(){return Math.max(this.focusOffset(),this.anchorOffset())}sibling(e){return this.siblings()[this.startOffset()+e]}ancestor(e){if(e>this.path.length)return null;let t=this.root;for(let a=0;a0?this.path[this.path.length-1].relation:""}insertFirstAtom(){this.siblings()}}function vt(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onSelectionWillChange)||e.suppressChangeNotifications||e.listeners.onSelectionWillChange(e)}function xt(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onSelectionDidChange)||e.suppressChangeNotifications||e.listeners.onSelectionDidChange(e)}function kt(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onContentWillChange)||e.suppressChangeNotifications||e.listeners.onContentWillChange(e)}function wt(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onContentDidChange)||e.suppressChangeNotifications||e.listeners.onContentDidChange(e)}function St(e){return!!e&&("mord"===e.type&&/[0-9.]/.test(e.body)||"mpunct"===e.type&&","===e.body)}function Mt(e){const t=e.siblings();if(t.length<=1)return null;let a=Math.min(e.endOffset(),t.length-1);if("command"!==t[a].type)return null;for(;a>0&&"command"===t[a].type;)a-=1;let i=e.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>a?{start:a+1,end:i}:null}function Lt(e){const t=Rt(e)?Vt(e):e.sibling(1);let a;if(t){if("command"===t.type)return"command";a=t.mode}let i=1,s=e.ancestor(i);for(;!a&&s;)s&&(a=s.mode),i+=1,s=e.ancestor(i);return a}function Ct(e){const t=Rt(e)?Vt(e):e.sibling(1);let a;if(t&&"first"!==t.type){if("command"===t.type)return{};a={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=e.ancestor(i);for(;!a&&s;)s&&(a={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=e.ancestor(i);return a}function At(e,t=1,a=!0){var i;const s=e.suppressChangeNotifications;e.suppressChangeNotifications=!0;const o=e.clone(),r=e.extent;Dt(e,t),"placeholder"===Vt(e).type&&Dt(e,t);const n=Yt(e,(t,a)=>"placeholder"===a.type||t.length>1&&1===e.siblings().length,t);if(0===n.length){if(jt(e,o,r),a&&(null===(i=e.hooks)||void 0===i?void 0:i.tabOut)&&e.hooks.tabOut(e,t>0?"forward":"backward")&&document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',a=Array.prototype.filter.call(document.querySelectorAll(e),e=>(e.offsetWidth>0||e.offsetHeight>0)&&!e.contains(document.activeElement)||e===document.activeElement);let i=a.indexOf(document.activeElement)+t;i<0&&(i=a.length-1),i>=a.length&&(i=0),a[i].focus()}return e.suppressChangeNotifications=s,!1}return vt(e),jt(e,n[0]),"placeholder"===Vt(e).type&&Pt(e,-1),e.announce("move",o),xt(e),e.suppressChangeNotifications=s,!0}function $t(e,t=0,a=0,i=""){const s=e.path[e.path.length-1].relation;i||(i=s);const o=e.parent();if(!o&&"body"!==i)return!1;const r=i.startsWith("cell");if(!r&&!o[i]||r&&!o.array)return!1;const n=i!==s;e.path[e.path.length-1].relation=i;const l=e.siblings().length;e.path[e.path.length-1].relation=s;const c=e.extent;"end"===a?a=l-t-1:"start"===a&&(a=-t),Pt(e,a);const d=e.extent!==c;Pt(e,c),t<0&&(t=l+t),t=Math.max(0,Math.min(t,l-1));const m=e.path[e.path.length-1].offset;return(n||m!==t||d)&&(n&&Zt(e),vt(e),e.path[e.path.length-1].relation=i,e.path[e.path.length-1].offset=t,Pt(e,a),xt(e)),!0}function zt(t,a){var i;a=null!=a?a:{};const s={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(t.anchorOffset()===t.siblings().length-1){Zt(t);let e=s[t.relation()];const o=t.parent();for(;e&&!o[e];)e=s[e];if(e)return void $t(t,0,0,e);if(t.parent().array){const e=gt(t.parent().array);let a=parseInt(t.relation().match(/cell([0-9]*)$/)[1])+1;for(;a=0;){if(ft(t.parent().array,e)&&$t(t,-1,0,"cell"+e))return void xt(t);e-=1}}return 1===t.path.length?(t.suppressChangeNotifications||!(null===(i=t.hooks)||void 0===i?void 0:i.moveOut)||t.hooks.moveOut(t,"backward"))&&(t.path[0].offset=t.root.body.length-1):(t.path.pop(),$t(t,t.anchorOffset()-1)),void xt(t)}const o=Vt(t);if(!o.captureSelection){let a;if(o.array){a="";const e=gt(o.array);let i=e-1;for(;!a&&i0)for(It(e)&&t--;t>0;)zt(e),t--;else if(t<0)for(Ht(e)&&t++;0!==t;)_t(e),t++;e.announce("move",a)}return!0}function qt(e,t){var a;const i=null!==(a=(t=null!=t?t:{extend:!1}).extend)&&void 0!==a&&a;Ht(e);const s=e.relation();if("denom"===s)i?(vt(e),e.path.pop(),e.path[e.path.length-1].offset-=1,Pt(e,1),xt(e)):$t(e,e.anchorOffset(),0,"numer"),e.announce("moveUp");else if(e.parent().array){let a=ut(e.parent().array,s);a=yt(e.parent().array,a,-1),a&&ft(e.parent().array,a)?(e.path[e.path.length-1].relation="cell"+ht(e.parent().array,a),$t(e,e.anchorOffset()),e.announce("moveUp")):Dt(e,-1,t)}else e.announce("line");return!0}function Tt(e,t){var a;const i=null!==(a=(t=null!=t?t:{extend:!1}).extend)&&void 0!==a&&a;It(e);const s=e.relation();if("numer"===s)i?(vt(e),e.path.pop(),e.path[e.path.length-1].offset-=1,Pt(e,1),xt(e)):$t(e,e.anchorOffset(),0,"denom"),e.announce("moveDown");else if(e.parent().array){let a=ut(e.parent().array,s);a=yt(e.parent().array,a,1),a&&ft(e.parent().array,a)?(e.path[e.path.length-1].relation="cell"+ht(e.parent().array,a),$t(e,e.anchorOffset()),e.announce("moveDown")):Dt(e,1,t)}else e.announce("line");return!0}function Kt(e,t){let a=e.path[e.path.length-1].offset,i=0;const s=e.clone();i=e.extent+t;const o=a+i;if(o<0&&0!==i){if(e.path.length>1)return vt(e),e.path.pop(),Pt(e,-1),xt(e),e.announce("move",s),!0;a=e.path[e.path.length-1].offset,i=e.extent}else if(o>=e.siblings().length){if(e.path.length>1)return vt(e),e.path.pop(),e.path[e.path.length-1].offset-=1,Pt(e,1),xt(e),e.announce("move",s),!0;Rt(e)&&(a-=1),i-=1}return $t(e,a,i),e.announce("move",s),!0}function Et(e,t,a){var i;const s=null!==(i=(a=null!=a?a:{extend:!1}).extend)&&void 0!==i&&i;t=t<0?-1:1;const o=e.clone(),r=e.siblings(),n=e.focusOffset();let l=n+t;if(s&&(l=Math.min(Math.max(0,l),r.length-1)),l<0||l>=r.length)Dt(e,t,a);else{if(r[l]&&"text"===r[l].mode){if(l=function(e,t,a){a=a<0?-1:1;const i=e.siblings();if(!i[t])return t;if("text"!==i[t].mode)return t;let s;if(U.test(i[t].body)){let e,o=t;do{e="text"===i[o].mode&&U.test(i[o].body),o+=a}while(i[o]&&e);s=i[o]?o-2*a:o-a}else if(/\s/.test(i[t].body)){let e=t;for(;i[e]&&"text"===i[e].mode&&/\s/.test(i[e].body);)e+=a;if(i[e]){let t=!0;do{t="text"===i[e].mode&&!/\s/.test(i[e].body),e+=a}while(i[e]&&t);s=i[e]?e-2*a:e-a}else s=e-a}else{let e=t;for(;i[e]&&"text"===i[e].mode&&!/\s/.test(i[e].body);)e+=a;s=i[e]?e:e-a;let o=!0;for(;i[e]&&o;)o="text"===i[e].mode&&/\s/.test(i[e].body),o&&(s=e),e+=a;s=i[e]?e-2*a:e-a}return s-(a>0?0:1)}(e,l,t),l<0&&!s)return void $t(e,0);if(l>r.length)return $t(e,r.length-1),void Dt(e,t,a)}else{const e=r[l]?r[l].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let a="mopen"===e?1:-1;for(l+=t>0?1:-1;l>=0&&l0&&(l-=1)}else{for(;r[l]&&"math"===r[l].mode&&r[l].type===e;)l+=t;l-=t>0?1:0}}if(s){const t=e.anchorOffset();$t(e,t,l-t)}else $t(e,l);e.announce("move",o)}}function Ft(e,t=1,a){var i;a=null!=a?a:{extend:!1},t=t<0?-1:1;const s=e.clone(),o=[{relation:"body",offset:e.path[0].offset}];let r;return null!==(i=!a.extend)&&void 0!==i&&i?(o[0].offset=t<0?0:e.root.body.length-1,r=0):t<0?o[0].offset>0&&(r=-o[0].offset):o[0].offset=i)return $t(e,e.endOffset()-1,1),!0;$t(e,a,i-a)}else if("mord"===e.sibling(0).type&&/[0-9,.]/.test(e.sibling(0).body)){let a=e.startOffset(),i=e.endOffset();for(;St(t[a]);)a-=1;for(;St(t[i]);)i+=1;i-=1,$t(e,a,i-a)}else $t(e,0,"end");return!0}function Ot(e){return e.path=[{relation:"body",offset:0}],$t(e,0,"end")}function Rt(e){return 0===e.extent}function Pt(e,t){return e.extent=t,!0}function It(e){return 0!==e.extent&&($t(e,e.endOffset()),!0)}function Ht(e){return 0!==e.extent&&($t(e,e.startOffset()),!0)}function Wt(e){if(e.path.length>1){const t=e.clone();return e.path.pop(),Pt(e,0),e.announce("move",t),!0}return e.announce("plonk"),!1}function Vt(e){if(e.parent().array)return ft(e.parent().array,e.relation())[e.anchorOffset()];const t=e.siblings();return t[Math.min(t.length-1,e.anchorOffset())]}function Ut(e,t,a,i={extendToWordBoundary:!1}){const s=mt(t,a);if(0===s)return i.extendToWordBoundary?Ut(e,t=Xt(e,t,-1),a=Xt(e,a,1)):jt(e,pt(t),0);if(1===s){const s=a[a.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?Ut(e,t=Xt(e,t,s<0?1:-1),a=Xt(e,a,s<0?-1:1)):jt(e,pt(t),s)}let o=function(e,t){const a=[],i=Math.min(e.length-1,t.length-1);let s=0;for(;s<=i&&e[s].relation===t[s].relation&&e[s].offset===t[s].offset;)a.push(e[s]),s+=1;return a}(t,a);const r=o.length;if(t.length===r||a.length===r||t[r].relation!==a[r].relation)return jt(e,o,-1);o.push(t[r]),o=pt(o);let n=a[r].offset-t[r].offset+1;return n<=0?a.length>r+1?(o[r].relation=a[r].relation,o[r].offset=a[r].offset,o[o.length-1].offset-=1,n=2-n):(o[r].relation=a[r].relation,o[r].offset=a[r].offset,n=1-n):a.length<=t.length?o[o.length-1].offset-=1:a.length>t.length&&(o[r].offset-=1),jt(e,o,n)}function jt(t,a,i=0){let s;if("string"==typeof a)s=dt(a);else if(e(a)){const e=pt(a),o=t.path;t.path=e,0===i&&"placeholder"===Vt(t).type&&(e[e.length-1].offset=t.anchorOffset()-1,i=1),s={path:e,extent:i||0},t.path=o}else s=a;const o=0!==mt(t.path,s.path),r=s.extent!==t.extent;return(o||r)&&(o&&Zt(t),vt(t),t.path=pt(s.path),t.siblings().length=0?It(s):(Ht(s),Dt(s,1));const o=Vt(s);do{t.bind(s)(s.path,Vt(s))&&i.push(s.toString()),a>=0?zt(s,{iterateAll:!0}):_t(s,{iterateAll:!0})}while(o!==Vt(s));return i}const Jt="apple"===aa()?{id:"apple.en-intl",displayName:"English (international)",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","∫","ı"],KeyC:["c","C","ç","Ç"],KeyD:["d","D","∂","Î"],KeyE:["e","E","´","´"],KeyF:["f","F","ƒ","Ï"],KeyG:["g","G","©","˝"],KeyH:["h","H","˙","Ó"],KeyI:["i","I","ˆ","ˆ"],KeyJ:["j","J","∆","Ô"],KeyK:["k","K","˚",""],KeyL:["l","L","¬","Ò"],KeyM:["m","M","µ","Â"],KeyN:["n","N","˜","˜"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","π","∏"],KeyQ:["q","Q","œ","Œ"],KeyR:["r","R","®","‰"],KeyS:["s","S","ß","Í"],KeyT:["t","T","†","ˇ"],KeyU:["u","U","¨","¨"],KeyV:["v","V","√","◊"],KeyW:["w","W","∑","„"],KeyX:["x","X","≈","˛"],KeyY:["y","Y","¥","Á"],KeyZ:["z","Z","Ω","¸"],Digit1:["1","!","¡","⁄"],Digit2:["2","@","™","€"],Digit3:["3","#","£","‹"],Digit4:["4","$","¢","›"],Digit5:["5","%","∞","fi"],Digit6:["6","ˆ","§","fl"],Digit7:["7","&","¶","‡"],Digit8:["8","*","•","°"],Digit9:["9","(","ª","·"],Digit0:["0",")","º","‚"],Space:[" "," "," "," "],Minus:["-","_","–","—"],Equal:["=","+","≠","±"],BracketLeft:["[","{","“","”"],BracketRight:["]","}","‘","’"],Backslash:["\\","|","«","»"],Semicolon:[";",":","…","Ú"],Quote:["'",'"',"æ","Æ"],Backquote:["`","˜","`","`"],Comma:[",","<","≤","¯"],Period:[".",">","≥","˘"],Slash:["/","?","÷","¿"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["§","±","§","±"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}}:"windows"===aa()?{id:"windows.en-intl",displayName:"English (international)",platform:"windows",locale:"en",score:0,mapping:{KeyA:["a","A","á","Á"],KeyB:["b","B","",""],KeyC:["c","C","©","¢"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","é","É"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","í","Í"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","ø","Ø"],KeyM:["m","M","µ",""],KeyN:["n","N","ñ","Ñ"],KeyO:["o","O","ó","Ó"],KeyP:["p","P","ö","Ö"],KeyQ:["q","Q","ä","Ä"],KeyR:["r","R","®",""],KeyS:["s","S","ß","§"],KeyT:["t","T","þ","Þ"],KeyU:["u","U","ú","Ú"],KeyV:["v","V","",""],KeyW:["w","W","å","Å"],KeyX:["x","X","",""],KeyY:["y","Y","ü","Ü"],KeyZ:["z","Z","æ","Æ"],Digit1:["1","!","¡","¹"],Digit2:["2","@","²",""],Digit3:["3","#","³",""],Digit4:["4","$","¤","£"],Digit5:["5","%","€",""],Digit6:["6","^","¼",""],Digit7:["7","&","½",""],Digit8:["8","*","¾",""],Digit9:["9","(","‘",""],Digit0:["0",")","’",""],Space:[" "," ","",""],Minus:["-","_","¥",""],Equal:["=","+","×","÷"],BracketLeft:["[","{","«",""],BracketRight:["]","}","»",""],Backslash:["\\","|","¬","¦"],Semicolon:[";",":","¶","°"],Quote:["'",'"',"´","¨"],Backquote:["`","~","",""],Comma:[",","<","ç","Ç"],Period:[".",">","",""],Slash:["/","?","¿",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}}:{id:"linux.en",displayName:"English",platform:"linux",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","¦"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},Qt={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},ea=[];let ta;function aa(){let e;return(null===navigator||void 0===navigator?void 0:navigator.platform)&&(null===navigator||void 0===navigator?void 0:navigator.userAgent)&&(/^(mac)/i.test(navigator.platform)?e="apple":/^(win)/i.test(navigator.platform)?e="windows":/(android)/i.test(navigator.userAgent)?e="linux":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="apple":/\bCrOS\b/i.test(navigator.userAgent)&&(e="linux")),e}function ia(e){e.platform===aa()&&ea.push(e)}function sa(e){ta=ea.find(t=>e.startsWith(t.locale))}function oa(){return null!=ta?ta:ea[0]}ia(Jt),ia({id:"apple.french",locale:"fr",displayName:"French",platform:"apple",score:0,mapping:{KeyA:["q","Q","‡","Ω"],KeyB:["b","B","ß","∫"],KeyC:["c","C","©","¢"],KeyD:["d","D","∂","∆"],KeyE:["e","E","ê","Ê"],KeyF:["f","F","ƒ","·"],KeyG:["g","G","fi","fl"],KeyH:["h","H","Ì","Î"],KeyI:["i","I","î","ï"],KeyJ:["j","J","Ï","Í"],KeyK:["k","K","È","Ë"],KeyL:["l","L","¬","|"],KeyM:[",","?","∞","¿"],KeyN:["n","N","~","ı"],KeyO:["o","O","œ","Œ"],KeyP:["p","P","π","∏"],KeyQ:["a","A","æ","Æ"],KeyR:["r","R","®","‚"],KeyS:["s","S","Ò","∑"],KeyT:["t","T","†","™"],KeyU:["u","U","º","ª"],KeyV:["v","V","◊","√"],KeyW:["z","Z","Â","Å"],KeyX:["x","X","≈","⁄"],KeyY:["y","Y","Ú","Ÿ"],KeyZ:["w","W","‹","›"],Digit1:["&","1","","´"],Digit2:["é","2","ë","„"],Digit3:['"',"3","“","”"],Digit4:["'","4","‘","’"],Digit5:["(","5","{","["],Digit6:["§","6","¶","å"],Digit7:["è","7","«","»"],Digit8:["!","8","¡","Û"],Digit9:["ç","9","Ç","Á"],Digit0:["à","0","ø","Ø"],Space:[" "," "," "," "],Minus:[")","°","}","]"],Equal:["-","_","—","–"],BracketLeft:["^","¨","ô","Ô"],BracketRight:["$","*","€","¥"],Backslash:["`","£","@","#"],Semicolon:["m","M","µ","Ó"],Quote:["ù","%","Ù","‰"],Backquote:["<",">","≤","≥"],Comma:[";",".","…","•"],Period:[":","/","÷","\\"],Slash:["=","+","≠","±"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","•","Ÿ"],NumpadEqual:["=","=","=","="]}}),ia({id:"linux.french",locale:"fr",displayName:"French",platform:"apple",score:0,mapping:{KeyA:["q","Q","@","Ω"],KeyB:["b","B","”","’"],KeyC:["c","C","¢","©"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","€","¢"],KeyF:["f","F","đ","ª"],KeyG:["g","G","ŋ","Ŋ"],KeyH:["h","H","ħ","Ħ"],KeyI:["i","I","→","ı"],KeyJ:["j","J","̉","̛"],KeyK:["k","K","ĸ","&"],KeyL:["l","L","ł","Ł"],KeyM:[",","?","́","̋"],KeyN:["n","N","n","N"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","þ","Þ"],KeyQ:["a","A","æ","Æ"],KeyR:["r","R","¶","®"],KeyS:["s","S","ß","§"],KeyT:["t","T","ŧ","Ŧ"],KeyU:["u","U","↓","↑"],KeyV:["v","V","“","‘"],KeyW:["z","Z","«","<"],KeyX:["x","X","»",">"],KeyY:["y","Y","←","¥"],KeyZ:["w","W","ł","Ł"],Digit1:["&","1","¹","¡"],Digit2:["é","2","~","⅛"],Digit3:['"',"3","#","£"],Digit4:["'","4","{","$"],Digit5:["(","5","[","⅜"],Digit6:["-","6","|","⅝"],Digit7:["è","7","`","⅞"],Digit8:["_","8","\\","™"],Digit9:["ç","9","^","±"],Digit0:["à","0","@","°"],Enter:["\r","\r","\r","\r"],Escape:["","","",""],Backspace:["\b","\b","\b","\b"],Tab:["\t","","\t",""],Space:[" "," "," "," "],Minus:[")","°","]","¿"],Equal:["=","+","}","̨"],BracketLeft:["̂","̈","̈","̊"],BracketRight:["$","£","¤","̄"],Backslash:["*","µ","̀","̆"],Semicolon:["m","M","µ","º"],Quote:["ù","%","̂","̌"],Backquote:["²","~","¬","¬"],Comma:[";",".","─","×"],Period:[":","/","·","÷"],Slash:["!","§","̣","̇"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","¦"]}}),ia({id:"windows.french",locale:"fr",displayName:"French",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","€",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["é","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["è","7","`",""],Digit8:["_","8","\\",""],Digit9:["ç","9","^",""],Digit0:["à","0","@",""],Space:[" "," ","",""],Minus:[")","°","]",""],Equal:["=","+","}",""],BracketLeft:["^","¨","",""],BracketRight:["$","£","¤",""],Backslash:["*","µ","",""],Semicolon:["m","M","",""],Quote:["ù","%","",""],Backquote:["²","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","§","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}}),ia({id:"windows.german",locale:"de",displayName:"German",platform:"windows",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","€",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","µ",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"²",""],Digit3:["3","§","³",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["ß","?","\\","ẞ"],Equal:["´","`","",""],BracketLeft:["ü","Ü","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["ö","Ö","",""],Quote:["ä","Ä","",""],Backquote:["^","°","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}}),ia({id:"apple.german",locale:"de",displayName:"German",platform:"apple",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","∫","‹"],KeyC:["c","C","ç","Ç"],KeyD:["d","D","∂","™"],KeyE:["e","E","€","‰"],KeyF:["f","F","ƒ","Ï"],KeyG:["g","G","©","Ì"],KeyH:["h","H","ª","Ó"],KeyI:["i","I","⁄","Û"],KeyJ:["j","J","º","ı"],KeyK:["k","K","∆","ˆ"],KeyL:["l","L","@","fl"],KeyM:["m","M","µ","˘"],KeyN:["n","N","~","›"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","π","∏"],KeyQ:["q","Q","«","»"],KeyR:["r","R","®","¸"],KeyS:["s","S","‚","Í"],KeyT:["t","T","†","˝"],KeyU:["u","U","¨","Á"],KeyV:["v","V","√","◊"],KeyW:["w","W","∑","„"],KeyX:["x","X","≈","Ù"],KeyY:["z","Z","Ω","ˇ"],KeyZ:["y","Y","¥","‡"],Digit1:["1","!","¡","¬"],Digit2:["2",'"',"“","”"],Digit3:["3","§","¶","#"],Digit4:["4","$","¢","£"],Digit5:["5","%","[","fi"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","˜"],Digit9:["9",")","}","·"],Digit0:["0","=","≠","¯"],Space:[" "," "," "," "],Minus:["ß","?","¿","˙"],Equal:["´","`","'","˚"],BracketLeft:["ü","Ü","•","°"],BracketRight:["+","*","±",""],Backslash:["#","'","‘","’"],Semicolon:["ö","Ö","œ","Œ"],Quote:["ä","Ä","æ","Æ"],Backquote:["<",">","≤","≥"],Comma:[",",";","∞","˛"],Period:[".",":","…","÷"],Slash:["-","_","–","—"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","°","„","“"],NumpadEqual:["=","=","=","="]}});const ra=[{key:"ctrl+alt+e",command:["insert","\\text{cmd+alt+e}"]},{key:"cmd+alt+a",command:["insert","\\text{cmd+alt+a}"]},{key:"ctrl+alt+a",command:["insert","\\text{ctrl+alt+a}"]},{key:"meta+alt+2",command:["insert","\\text{meta+alt+2}"]},{key:"ctrl+alt+shift+a",command:["insert","\\text{ctrl+alt+shift+a}"]},{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendToPreviousChar"},{key:"shift+[ArrowRight]",command:"extendToNextChar"},{key:"shift+[ArrowUp]",command:"extendUp"},{key:"shift+[ArrowDown]",command:"extendDown"},{key:"[Backspace]",command:"deletePreviousChar"},{key:"alt+[Delete]",command:"deletePreviousChar"},{key:"[Delete]",command:"deleteNextChar"},{key:"alt+[Backspace]",command:"deleteNextChar"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"alt+shift+[ArrowLeft]",command:"extendToPreviousWord"},{key:"alt+shift+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"ctrl+shift+[ArrowLeft]",command:"extendToGroupStart"},{key:"ctrl+shift+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Space]",ifMode:"math",command:"moveAfterParent"},{key:"shift+[Space]",ifMode:"math",command:"moveBeforeParent"},{key:"[Home]",command:"moveToMathFieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathFieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"cmd+shift+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathFieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathFieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"cmd+shift+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",ifMode:"math",command:"moveToNextPlaceholder"},{key:"shift+[Tab]",ifMode:"math",command:"moveToPreviousPlaceholder"},{key:"[Tab]",ifMode:"text",command:"moveToNextPlaceholder"},{key:"shift+[Tab]",ifMode:"text",command:"moveToPreviousPlaceholder"},{key:"[Escape]",ifMode:"math",command:["switch-mode","command"]},{key:"\\",ifMode:"math",command:["switch-mode","command"]},{key:"alt+[Equal]",ifMode:"math",command:["applyStyle",{mode:"text"}]},{key:"alt+[Equal]",ifMode:"text",command:["applyStyle",{mode:"math"}]},{key:"[Escape]",ifMode:"command",command:["complete",{discard:!0}]},{key:"[Tab]",ifMode:"command",command:["complete",{acceptSuggestion:!0}]},{key:"[Return]",ifMode:"command",command:"complete"},{key:"[Enter]",ifMode:"command",command:"complete"},{key:"shift+[Escape]",ifMode:"command",command:["complete",{discard:!0}]},{key:"[ArrowDown]",ifMode:"command",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"command",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deletePreviousChar"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"[Undo]",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"cmd+shift+y",command:"redo"},{key:"ctrl+shift+z",ifPlatform:"!macos",command:"redo"},{key:"cmd+shift+z",command:"redo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathFieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathFieldEnd"},{key:"ctrl+shift+b",ifPlatform:"macos",command:"extendToPreviousChar"},{key:"ctrl+shift+f",ifPlatform:"macos",command:"extendToNextChar"},{key:"ctrl+shift+p",ifPlatform:"macos",command:"extendUp"},{key:"ctrl+shift+n",ifPlatform:"macos",command:"extendDown"},{key:"ctrl+shift+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"ctrl+shift+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"ctrl+alt+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"ctrl+alt+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"ctrl+shift+alt+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"ctrl+shift+alt+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deletePreviousChar"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteNextChar"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"shift+[Quote]",ifMode:"math",command:["switchMode","text","","“"]},{key:"shift+[Quote]",ifMode:"text",command:["switch-mode","math","”",""]},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","$$\\sqrt{#0}$$"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Minus]",ifMode:"math",command:"moveToSubscript"},{key:"alt+[BracketLeft]",ifMode:"math",command:["insert","$$\\left\\lbrack #0 \\right\\rbrack$$"]},{key:"alt+shift+[BracketLeft]",ifMode:"math",command:["insert","$$\\left\\lbrace #0 \\right\\rbrace$$"]},{key:"[Return]",ifMode:"math",command:"addRowAfter"},{key:"[Enter]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Comma]",ifMode:"math",command:"addColumnAfter"},{key:"[Return]",ifMode:"text",command:"addRowAfter"},{key:"[Enter]",ifMode:"text",command:"addRowAfter"},{key:"ctrl+[Comma]",ifMode:"text",command:"addColumnAfter"},{key:"alt+p",ifMode:"math",command:["insert","$$\\pi$$"]},{key:"alt+v",ifMode:"math",command:["insert","$$\\sqrt{#0}$$"]},{key:"alt+w",ifMode:"math",command:["insert","$$\\sum_{i=#?}^{#?}$$"]},{key:"alt+u",ifMode:"math",command:["insert","$$\\cup$$"]},{key:"alt+n",ifMode:"math",command:["insert","$$\\cap$$"]},{key:"alt+o",ifMode:"math",command:["insert","$$\\emptyset$$"]},{key:"alt+d",ifMode:"math",command:["insert","$$\\differentialD$$"]},{key:"alt+shift+o",ifMode:"math",command:["insert","$$\\varnothing$$"]},{key:"alt+shift+d",ifMode:"math",command:["insert","$$\\partial$$"]},{key:"alt+shift+p",ifMode:"math",command:["insert","$$\\prod_{i=#?}^{#?}$$"]},{key:"alt+shift+u",ifMode:"math",command:["insert","$$\\bigcup$$"]},{key:"alt+shift+n",ifMode:"math",command:["insert","$$\\bigcap$$"]},{key:"alt+shift+a",ifMode:"math",command:["insert","$$\\forall$$"]},{key:"alt+shift+e",ifMode:"math",command:["insert","$$\\exists$$"]},{key:"alt+[Digit5]",ifMode:"math",command:["insert","$\\infty$$"]},{key:"alt+[Digit6]",ifMode:"math",command:["insert","$$\\wedge$$"]},{key:"alt+shift+[Digit6]",ifMode:"math",command:["insert","$$\\vee$$"]},{key:"alt+[Digit9]",ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifMode:"math",command:["insert",")"]},{key:"alt+shift+[Backslash]",ifMode:"math",command:["insert","|"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","$$\\backslash$$"]},{key:"[Slash]",ifMode:"math",command:["insert","$$\\frac{#@}{#?}$$"]},{key:"alt+[Slash]",ifMode:"math",command:["insert","$$\\frac{#?}{#@}$$"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","$$\\frac{#@}{#?}$$"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+[Backquote]",ifMode:"math",command:["insert","$$\\~$$"]},{key:"alt+shift+[Slash]",ifMode:"math",command:["insert","$$\\/$$"]},{key:"alt+shift+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleVirtualKeyboard"},{key:"ctrl+alt+[ArrowUp]",command:["speak","parent",{withHighlighting:!1}]},{key:"ctrl+alt+[ArrowDown]",command:["speak","all",{withHighlighting:!1}]}],na={"\\theta":"alt+q","\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\prod":"alt+shift+p","\\sum":"alt+w","\\int":"alt+b","\\cup":"alt+u","\\cap":"alt+n","\\bigcup":"alt+shift+u","\\bigcap":"alt+shift+n","\\forall":"alt+shift+a","\\exists":"alt+shift+e","\\infty":"alt+[Digit5]","\\wedge":"alt+[Digit5]","\\vee":"alt+shift+[Digit6]","\\differentialD":"alt+d","\\partial":"alt+shift+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"alt+shift+o","\\~":"~"};function la(e){if((null===navigator||void 0===navigator?void 0:navigator.platform)&&(null===navigator||void 0===navigator?void 0:navigator.userAgent)){let t;if(/^(mac)/i.test(navigator.platform)?t="macos":/^(win)/i.test(navigator.platform)?t="windows":/(android)/i.test(navigator.userAgent)?t="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?t="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(t="chromeos"),e.startsWith("!")&&!e.endsWith(t))return!0;if(e.endsWith(t))return!0}return!1}function ca(t){let a=t;return e(a)&&(a=a.length>0?a[0]+"("+a.slice(1).join("")+")":""),a}function da(e){const t=la("macos")||la("ios"),a=e.split("+");let i="";for(const e of a)!t&&i&&(i+='+'),e.startsWith("Key")?i+=e.substr(3,1):e.startsWith("Digit")?i+=e.substr(5,1):i+={cmd:"⌘",meta:t?"⌘":"command",shift:t?"⇧":"shift",alt:t?"⌥":"alt",ctrl:t?"⌃":"control","\n":t?"⏎":"return","[return]":t?"⏎":"return","[enter]":t?"⌤":"enter","[tab]":t?"⇥":"tab","[escape]":"esc","[backspace]":t?"⌫":"backspace","[delete]":t?"⌦":"del","[pageup]":t?"⇞":"page up","[pagedown]":t?"⇟":"page down","[home]":t?"⤒":"home","[end]":t?"⤓":"end","[space]":"space","[equal]":"=","[minus]":"-","[comma]":",","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",bracketLeft:"[",bracketRight:"]",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* 🔢",numpaddivide:"/ 🔢",numpadsubtract:"- 🔢",numpadadd:"+ 🔢",numpaddecimal:". 🔢",numpadcomma:", 🔢",help:"help",left:"⇠",up:"⇡",right:"⇢",down:"⇣","[arrowleft]":"⇠","[arrowup]":"⇡","[arrowright]":"⇢","[arrowdown]":"⇣","[digit0]":"0","[digit1]":"1","[digit2]":"2","[digit3]":"3","[digit4]":"4","[digit5]":"5","[digit6]":"6","[digit7]":"7","[digit8]":"8","[digit9]":"9"}[e.toLowerCase()]||e.toUpperCase();return i}function ma(e,t){const a=[],i=[];return e.forEach(e=>{try{const t=function(e){if(e.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(e.ifPlatform))throw new Error(`Unexpected platform "${e.ifPlatform}" for keybinding ${e.key}`);let t=e.key.split("+");const a=t.pop();let i=e.ifPlatform;if(t=t.map(e=>{const t=e.toLowerCase();if("cmd"===t){if(i&&"macos"!==i&&"ios"!==i)throw new Error('Unexpected "cmd" modifier with platform "'+i+'"');return i||(i=la("ios")?"ios":"macos"),"meta"}if("win"===t){if(i&&"windows"!==i)throw new Error('Unexpected "win" modifier with platform "'+i+'"');return i="windows","meta"}return t}),!i||la(i)){if(/^\[(.*)\]$/.test(a))t.push(a);else{const i=function(e){var t,a;const i=null!==(t=ea[0])&&void 0!==t?t:Jt;for(const[t,a]of Object.entries(i.mapping))if(a[0]===e)return"["+t+"]";return null!==(a=Qt[e])&&void 0!==a?a:""}(a);if(!i)throw new Error('Invalid keybinding key "'+e.key+'"');t.push(i)}return{...e,ifPlatform:i,key:t.join("+")}}}(e);t&&a.push(t)}catch(e){i.push(e.message)}}),i.length>0&&t(i),a}function pa(e,t,a,i){const s=t.split(" ");for(const t of s){const s=t.match(/(.*):(.*)/);if(s){const t=null!=i?i:{};"active"===s[2]?t.passive=!1:t[s[2]]=!0,e.addEventListener(s[1],a,t)}else e.addEventListener(t,a,i)}}function ha(e,t,a,i){const s=t.split(" ");for(const t of s){const s=t.match(/(.*):(.*)/);if(s){const t=null!=i?i:{};"active"===s[2]?t.passive=!1:t[s[2]]=!0,e.removeEventListener(s[1],a,t)}else e.removeEventListener(t,a,i)}}function ua(e,t){let a=document.getElementById(e);return a?a.setAttribute("data-refcount",Number(parseInt(a.getAttribute("data-refcount"))+1).toString()):(a=document.createElement("div"),a.setAttribute("aria-hidden","true"),a.setAttribute("data-refcount","1"),a.className=t,a.id=e,document.body.appendChild(a)),a}function fa(e){if(!e)return;const t=parseInt(e.getAttribute("data-refcount"));t<=1?e.remove():e.setAttribute("data-refcount",Number(t-1).toString())}function ga(e){return e.element&&e.element.mathfield===e}function ya(e){const t=function e(t){if(t.classList.contains("ML__caret")||t.classList.contains("ML__text-caret")||t.classList.contains("ML__command-caret"))return t;let a;for(const i of t.children)if(a=e(i),a)break;return a}(e);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}function ba(e){const t=e.querySelectorAll(".ML__selected");if(t&&t.length>0){const a={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(e=>{const t=e.getBoundingClientRect();t.lefta.right&&(a.right=t.right),t.bottom>a.bottom&&(a.bottom=t.bottom),t.top{if("mousedown"!==a.type||1===a.buttons){a.stopPropagation(),a.preventDefault(),t.classList.add("pressed"),i=Date.now(),"touchstart"===a.type&&(o=a.changedTouches[0].identifier);const r=t.getAttribute("data-"+e.config.namespace+"command-pressed");r&&e.$perform(JSON.parse(r));const l=t.getAttribute("data-"+e.config.namespace+"command-pressAndHoldStart");l&&(s=t,n&&clearTimeout(n),n=window.setTimeout((function(){t.classList.contains("pressed")&&e.$perform(JSON.parse(l))}),300))}}),pa(t,"mouseleave touchcancel",()=>{t.classList.remove("pressed")}),pa(t,"touchmove:passive",e=>{e.preventDefault();for(let t=0;t{1===e.buttons&&t.classList.add("pressed")}),pa(t,"mouseup touchend click",a=>{if(r){a.stopPropagation(),a.preventDefault();const e=r;return r=null,void e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0}))}if(t.classList.remove("pressed"),t.classList.add("active"),"click"===a.type&&0!==a.detail)return a.stopPropagation(),void a.preventDefault();window.setTimeout((function(){t.classList.remove("active")}),150);let o=t.getAttribute("data-"+e.config.namespace+"command-pressAndHoldEnd");const n=Date.now();(t!==s||nequal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function ka(t,a,i){if(!a||0===a.length)return void Ma(t);const s=a,o=function(e,t){const a=ot(e,"math",null,t.config.macros);return q(_(Ne({mathstyle:c.displaystyle,macros:t.config.macros},a),"ML__base"),"ML__mathlive").toMarkup()}(a,t),r=function(t){let a=xa[t]||"";return e(a)&&(a=a.join("
    ")),a}(s),n=function(t,a){let i=[];if("string"==typeof a){const t=na[a];e(t)?i=t.slice():t&&i.push(t)}const s=ca(a),o=new RegExp("^"+s.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return t.forEach(e=>{o.test(ca(e.command))&&i.push(e)}),i.map(da)}(t.keybindings,s).join("
    ");let l=i?'
    ':"";l+='',l+='
    '+o+"
    ",r&&(l+='
    '+r+"
    "),n&&(l+='
    '+n+"
    "),l+="
    ",l+=i?'
    ':"",function(e,t){e.popover.innerHTML=e.config.createHTML(t);const a=ya(e.field);a&&Sa(e,a),e.popover.classList.add("is-visible")}(t,l);let d=t.popover.getElementsByClassName("ML__popover__content");d&&d.length>0&&va(t,d[0],{default:["complete",{acceptSuggestion:!0}]}),d=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),d&&d.length>0&&va(t,d[0],"previousSuggestion"),d=t.popover.getElementsByClassName("ML__popover__next-shortcut"),d&&d.length>0&&va(t,d[0],"nextSuggestion")}function wa(e,t){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(null==t?void 0:t.deferred)window.requestAnimationFrame(()=>wa(e));else if(Vt(e.model)&&"command"===Vt(e.model).type){const t=ya(e.field);t&&Sa(e,t)}else Ma(e)}function Sa(e,t){const a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,s=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,r=e.virtualKeyboardVisible?e.virtualKeyboard.offsetHeight:0;t.x+e.popover.offsetWidth/2>i-s?e.popover.style.left=i-e.popover.offsetWidth-s+"px":t.x-e.popover.offsetWidth/2<0?e.popover.style.left=0:e.popover.style.left=t.x-e.popover.offsetWidth/2+"px",t.y+e.popover.offsetHeight+5>a-o-r?(e.popover.classList.add("reverse-direction"),e.popover.style.top=t.y-t.height-e.popover.offsetHeight-5+"px"):(e.popover.classList.remove("reverse-direction"),e.popover.style.top=t.y+5+"px")}function Ma(e){e.popover.classList.remove("is-visible")}function La(e,t=!1){let a="";const i=Mt(e);if(i){const s=t?e.anchorOffset()+1:i.end,o=e.siblings();for(let e=i.start;e"placeholder"===e.type));Pt(e,0),e.path[e.path.length-1].offset=a.start-1,0!==i.length&&At(e,1,!1)||$t(e,a.start+t.length-1)}else e.siblings().splice(a.start,a.end-a.start),$t(e,a.start-1,0);wt(e)}}const $a={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function za(e){return e.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function _a(e,t){return e&&t.generateID?' extid="'+e+'"':""}function Da(e,t,a){let i=!1;t=t||e.atoms.length;let s="",o="",r=-1,n=-1;const l=e.atoms[e.index];if(e.index0){if(i=!0,qa(e)&&(r=e.index,e.index+=1),Ta(e)&&(n=e.index,e.index+=1),r>=0&&n>=0)s=""+o,s+=Oa(e.atoms[n].subscript,0,0,a).mathML,s+=Oa(e.atoms[r].superscript,0,0,a).mathML,s+="";else if(r>=0){if(s=""+o,qa(e)){const t=Oa(e.atoms[r].superscript,0,0,a).mathML,i=Oa(e.atoms[r+1].superscript,0,0,a).mathML;s+=""!==t&&""!==t||""!==i&&""!==i?""===t||""===t?"":t:""}else s+=Oa(e.atoms[r].superscript,0,0,a).mathML;s+=""}else n>=0?(s=""+o,s+=Oa(e.atoms[n].subscript,0,0,a).mathML,s+=""):s=o;"mi"!==e.lastType&&"mn"!==e.lastType&&"mtext"!==e.lastType&&"fence"!==e.lastType||/^(.*)<\/mo>$/.test(s)||(s=""+s),o.endsWith(">f")||o.endsWith(">g")?(s+="&x2061;",e.lastType="applyfunction"):e.lastType=/^(.*)<\/mo>$/.test(s)?"mo":"mi",e.mathML+=s}return i}function qa(e){return e.index"+e,s+=Oa(o.subscript,0,0,a).mathML,s+=Oa(o.superscript,0,0,a).mathML,s+=""):o.superscript?(s=""+e,s+=Oa(o.superscript,0,0,a).mathML,s+=""):o.subscript&&(s=""+e,s+=Oa(o.subscript,0,0,a).mathML,s+=""),s.length>0&&(i=!0,t.mathML+=s,t.lastType=""),i))}function Ea(e,t,a){let i=!1;t=t||e.atoms.length;const s=e.index;let o="";for(;e.index0&&(i=!0,o=""+o+"",e.mathML+=o,e.lastType="mtext"),i}function Fa(e,t,a){let i=!1;t=t||e.atoms.length;const s=e.index;let o="",r=function(e){let t=-1,a=e.index,i=!1,s=!1;for(;a=0&&r=0;)o+=e.atoms[e.index].body,e.index+=1;return o.length>0&&(i=!0,o=""+o+"",r<0&&qa(e)&&(r=e.index,e.index+=1),r>=0&&(o=""+o,o+=Oa(e.atoms[r].superscript,0,0,a).mathML,o+=""),e.mathML+=o,e.lastType="mn"),i}function Na(e,t,a){let i=!1;t=t||e.atoms.length;let s="",o="";if(e.index",s+=Ra(e.atoms[l],a),s+=Oa(e.atoms,l+1,c,a).mathML,s+=Ra(e.atoms[c],a),s+="","mi"!==e.lastType&&"mn"!==e.lastType&&"mfrac"!==e.lastType&&"fence"!==e.lastType||(s=""+s),e.index=c+1,Ka(s,e,a)&&(i=!0,e.lastType="",s=""),o="fence")}return s.length>0&&(i=!0,e.mathML+=s,e.lastType=o),i}function Ba(e,t,a){let i=!1;t=t||e.atoms.length;let s="",o="";const r=e.atoms[e.index];if(e.index":"")+e,s+=Oa(r.subscript,0,0,a).mathML,s+=Oa(r.superscript,0,0,a).mathML,s+="nolimits"!==r.limits?"":""):r.superscript?(s+=("nolimits"!==r.limits?"":"")+e,s+=Oa(r.superscript,0,0,a).mathML,s+="nolimits"!==r.limits?"":""):(s+=("nolimits"!==r.limits?"":"")+e,s+=Oa(r.subscript,0,0,a).mathML,s+="nolimits"!==r.limits?"":""),o="mo"}else{const t=e.atoms[e.index],r="\\operatorname"===t.symbol,n=r?'"+Pa(t.body)+"":Ra(t,a);s+=n,e.index+=1,Ka(s,e,a)&&(i=!0,e.lastType="",s=""),e.index-=1,r||/^(.*)<\/mo>$/.test(n)?o=r?"mi":"mo":(s+="",o="applyfunction")}"mi"!==e.lastType&&"mn"!==e.lastType||/^(.*)<\/mo>$/.test(s)||(s=""+s),e.index+=1}return s.length>0&&(i=!0,e.mathML+=s,e.lastType=o),i}function Oa(e,t,a,i){const s={atoms:e,index:null!=t?t:0,mathML:"",lastType:""};if("number"==typeof e||"boolean"==typeof e)s.mathML=e.toString();else if("string"==typeof e)s.mathML=e;else if(e instanceof Be)s.mathML=Ia(e,i);else if(Array.isArray(e)){let t=0;for(a=null!=a?a:e?e.length:0;s.index0&&"genfrac"===s.atoms[s.index].type&&(e=""+e),"genfrac"===s.atoms[s.index].type?s.lastType="mfrac":s.lastType="",e.length>0&&(s.mathML+=e,t+=1),s.index+=1}t>1&&(s.mathML=""+s.mathML+"")}return s}function Ra(e,t){let a="";const i=Pa(e.body);return i&&(a=""+i+""),a}function Pa(e){if(!e)return"";if("string"==typeof e)return za(e);if(!Array.isArray(e)&&"string"==typeof e.body)return za(e.body);let t="";for(const a of e)"string"==typeof a.body&&(t+=a.body);return za(t)}function Ia(e,t){const a={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋"},i={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},s={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let o,r,n,l,c,d,m="",p="",h={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[e.fontFamily||e.font]||"";h&&(h=' mathvariant="'+h+'"');const u=e.symbol;if("text"===e.mode)m=""+e.body+"";else switch(e.type){case"first":break;case"group":case"root":m=Oa(e.body,0,0,t).mathML;break;case"array":if((e.lFence&&"."!==e.lFence||e.rFence&&"."!==e.rFence)&&(m+="",e.lFence&&"."!==e.lFence&&(m+=""+($a[e.lFence]||e.lFence)+"")),m+="",o=0;o"+Oa(e.array[r][o],0,0,t).mathML+"";m+=""}m+="",(e.lFence&&"."!==e.lFence||e.rFence&&"."!==e.rFence)&&(e.rFence&&"."!==e.rFence&&(m+=""+($a[e.lFence]||e.rFence)+""),m+="");break;case"genfrac":(e.leftDelim||e.rightDelim)&&(m+=""),e.leftDelim&&"."!==e.leftDelim&&(m+=""+($a[e.leftDelim]||e.leftDelim)+""),e.hasBarLine?(m+="",m+=Oa(e.numer,0,0,t).mathML||" ",m+=Oa(e.denom,0,0,t).mathML||" ",m+=""):(m+="",m+=""+Oa(e.numer,0,0,t).mathML+"",m+=""+Oa(e.denom,0,0,t).mathML+"",m+=""),e.rightDelim&&"."!==e.rightDelim&&(m+=""+($a[e.rightDelim]||e.rightDelim)+""),(e.leftDelim||e.rightDelim)&&(m+="");break;case"surd":e.index?(m+="",m+=Oa(e.body,0,0,t).mathML,m+=Oa(e.index,0,0,t).mathML,m+=""):(m+="",m+=Oa(e.body,0,0,t).mathML,m+="");break;case"leftright":m="",e.leftDelim&&"."!==e.leftDelim&&(m+=""+($a[e.leftDelim]||e.leftDelim)+""),e.body&&(m+=Oa(e.body,0,0,t).mathML),e.rightDelim&&"."!==e.rightDelim&&(m+=""+($a[e.rightDelim]||e.rightDelim)+""),m+="";break;case"sizeddelim":case"delim":m+='"+($a[e.delim]||e.delim)+"";break;case"accent":m+='",m+=Oa(e.body,0,0,t).mathML,m+=""+($a[u]||e.accent)+"",m+="";break;case"line":case"overlap":break;case"overunder":c=e.overscript,l=e.underscript,(e.svgAbove||c)&&(e.svgBelow||l)?d=e.body:c?(d=e.body,e.body&&e.body[0]&&e.body[0].underscript?(l=e.body[0].underscript,d=e.body[0].body):e.body&&e.body[0]&&"first"===e.body[0].type&&e.body[1]&&e.body[1].underscript&&(l=e.body[1].underscript,d=e.body[1].body)):l&&(d=e.body,e.body&&e.body[0]&&e.body[0].overscript?(c=e.body[0].overscript,d=e.body[0].body):e.body&&e.body[0]&&"first"===e.body[0].type&&e.body[1]&&e.body[1].overscript&&(c=e.body[1].overscript,d=e.body[1].body)),(e.svgAbove||c)&&(e.svgBelow||l)?(m+=``,m+=a[e.svgBody]||Oa(d,0,0,t).mathML,m+=a[e.svgBelow]||Oa(l,0,0,t).mathML,m+=a[e.svgAbove]||Oa(c,0,0,t).mathML,m+=""):e.svgAbove||c?(m+=``+(a[e.svgBody]||Oa(d,0,0,t).mathML),m+=a[e.svgAbove]||Oa(c,0,0,t).mathML,m+=""):(e.svgBelow||l)&&(m+=``+(a[e.svgBody]||Oa(d,0,0,t).mathML),m+=a[e.svgBelow]||Oa(l,0,0,t).mathML,m+="");break;case"placeholder":case"mord":{m=i[u]||u||("string"==typeof e.body?e.body:"");const a=u?u.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;a?m="&#x"+a[1]+";":m.length>0&&"\\"===m.charAt(0)&&(m="string"==typeof e.body&&e.body.charCodeAt(0)>255?"&#x"+("000000"+e.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof e.body?e.body.charAt(0):e.body);const s=/\d/.test(m)?"mn":"mi";m="<"+s+h+_a(e.id,t)+">"+za(m)+"";break}case"mbin":case"mrel":case"textord":case"minner":m=u&&i[u]?""+i[u]+"":u&&$a[u]?""+$a[u]+"":Ra(e,t);break;case"mpunct":m='"+($a[u]||u)+"";break;case"mop":"​"!==e.body&&(m="",m+="\\operatorname"===u?e.body:u||e.body,m+="");break;case"mathstyle":break;case"box":m='"+Oa(e.body,0,0,t).mathML+"";break;case"spacing":m+='';break;case"enclose":m=''+Oa(e.body,0,0,t).mathML+"";break;case"space":m+=" "}return m}function Ha(e,t){return Oa(e,0,0,t).mathML}function Wa(e){let t=0;for(let a=0;a{ga(e)&&e.dirty&&Ua(e)}))}function Ua(e,t){t=null!=t?t:{},e.dirty=!1,window.mathlive||(window.mathlive={}),Vt(e.model)||(e.model.path=[{relation:"body",offset:0}]),e.model.root.forEach(e=>{e.caret="",e.isSelected=!1,e.containsCaret=!1});const a=e.$hasFocus();if(Rt(e.model)?Vt(e.model).caret=a&&!e.config.readOnly?e.mode:"":Gt(e.model,e=>{e.isSelected=!0}),a&&!e.config.readOnly){let t=e.model.ancestor(1),a=1,i=!1;for(;t&&!i;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,i=!0),a+=1,t=e.model.ancestor(a)}const i=_(Ne({mathstyle:c.displaystyle,letterShapeStyle:e.config.letterShapeStyle,atomIdsSettings:{seed:Wa(e.model.root.toLatex(!1)),groupNumbers:t.forHighlighting},smartFence:e.config.smartFence,macros:e.config.macros},e.model.root),"ML__base");i.attributes={translate:"no","aria-hidden":"true"};const s=q(i,"ML__mathlive");e.field.innerHTML=e.config.createHTML(s.toMarkup(0,e.config.horizontalSpacingScale)),e.field.classList.toggle("ML__focused",a&&!e.config.readOnly),e.accessibleNode.innerHTML=e.config.createHTML(''+Ha(e.model.root,e.config)+"");const o=ba(e.field);if(o){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=o.left+"px",t.style.top=o.top+"px",t.style.width=Math.ceil(o.right-o.left)+"px",t.style.height=Math.ceil(o.bottom-o.top-1)+"px",e.field.insertBefore(t,e.field.childNodes[0])}}const ja={};function Ga(e,t){t=null!=t?t:{target:"mathfield",canUndo:!1},Object.keys(e).forEach(a=>{ja[a]={...t,fn:e[a]}})}function Za(e,t=",",a){if(!e)return[];let i,s=[];for(let o of e)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(i?s.push(i):i=new Be("math","mpunct",t,a),s=s.concat(o));return s}function Xa(t,a){const i=t.parent();if(i&&"array"===i.type&&e(i.array)){const e=t.relation();if(i.array){const s=ut(i.array,e);"after row"===a||"before row"===a?(s.col=0,s.row=s.row+("after row"===a?1:0),i.array.splice(s.row,0,[[]])):(s.col+="after column"===a?1:0,i.array[s.row].splice(s.col,0,[]));const o=ht(i.array,s);t.path.pop(),t.path.push({relation:"cell"+o.toString(),offset:0}),t.insertFirstAtom()}}}function Ya(e){var t;const a=e.parent();if("leftright"===a.type){a.type="array";const i=null!==(t={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[a.leftDelim])&&void 0!==t?t:"matrix",s=ie(i),o=[[a.body]];Object.assign(a,s.parser(i,[],o)),a.mode=Lt(e),a.environmentName=i,a.array=o,a.rowGaps=[0],delete a.body,e.path[e.path.length-1].relation="cell0"}}function Ja(e){return kt(e),Ya(e),Xa(e,"after row"),wt(e),!0}function Qa(e){return kt(e),Ya(e),Xa(e,"after column"),wt(e),!0}function ei(e,t=0){kt(e),vt(e);const a=e.suppressChangeNotifications;if(e.suppressChangeNotifications=!0,t=t<0?-1:t>0?1:t,nt(e),e.parent().array&&t<0&&0===e.startOffset()){const t=e.parent().array;if(function(e){const t={col:0,row:0};for(;t.row0){let e=t.length;"first"===t[0].type&&(e-=1),e>0&&(a+=1)}i.row+=1}return a}(t,a.col)&&(function(e,t){let a=0;for(;a"placeholder"!==e.type&&"first"!==e.type);e.parent()[t]=null,e.path.pop(),e.siblings().splice(e.anchorOffset(),0,...a),$t(e,e.anchorOffset()-1),e.announce("deleted: "+t)}else if("denom"===t){const t=e.parent().numer.filter(e=>"placeholder"!==e.type&&"first"!==e.type),a=e.parent().denom.filter(e=>"placeholder"!==e.type&&"first"!==e.type);e.path.pop(),e.siblings().splice(e.anchorOffset(),1,...a),e.siblings().splice(e.anchorOffset(),0,...t),$t(e,e.anchorOffset()+t.length-1),e.announce("deleted: denominator")}else if("body"===t){const t=e.siblings().filter(e=>"placeholder"!==e.type);e.path.length>1&&(t.shift(),e.path.pop(),e.siblings().splice(e.anchorOffset(),1,...t),$t(e,e.anchorOffset()-1),e.announce("deleted: root"))}else Dt(e,-1),ti(e,-1)}else if(t>0)if(a!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(e.sibling(1).type)?Dt(e,1):(e.announce("deleted",null,i.slice(a+1,a+2)),i.splice(a+1,1));else if("numer"===e.relation()){const t=e.parent().numer.filter(e=>"placeholder"!==e.type&&"first"!==e.type),a=e.parent().denom.filter(e=>"placeholder"!==e.type&&"first"!==e.type);e.path.pop(),e.siblings().splice(e.anchorOffset(),1,...a),e.siblings().splice(e.anchorOffset(),0,...t),$t(e,e.anchorOffset()+t.length-1),e.announce("deleted: numerator")}else Dt(e,1),ti(e,-1)}else{const t=e.startOffset()+1,a=e.endOffset()+1;e.announce("deleted",null,i.slice(t,a)),i.splice(t,a-t),$t(e,t-1)}lt(e),e.suppressChangeNotifications=a,xt(e),wt(e)}function ti(e,t=0){if(0===t)ei(e,0);else if(t>0)for(;t>0;)ei(e,1),t--;else for(;t<0;)ei(e,-1),t++;return!0}Ga({performWithFeedback:(e,t)=>function(e,t){return e.$focus(),e.config.keypressVibration&&(null===navigator||void 0===navigator?void 0:navigator.vibrate)&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,e=>e[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?e.returnKeypressSound?(e.returnKeypressSound.load(),e.returnKeypressSound.play().catch(e=>{})):e.keypressSound&&(e.keypressSound.load(),e.keypressSound.play().catch(e=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!e.deleteKeypressSound?e.keypressSound&&(e.keypressSound.load(),e.keypressSound.play().catch(e=>{})):(e.deleteKeypressSound.load(),e.deleteKeypressSound.play().catch(e=>{})),e.$perform(t)}(e,t)}),Ga({addRowAfter:Ja,addColumnAfter:Qa,addRowBefore:function(e){return kt(e),Ya(e),Xa(e,"before row"),wt(e),!0},addColumnBefore:function(e){return kt(e),Ya(e),Xa(e,"before column"),wt(e),!0}},{target:"model",category:"array-edit"});const ai={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},arcsin:{mode:"math",value:"\\arcsin"},arccos:{mode:"math",value:"\\arccos"},arctan:{mode:"math",value:"\\arctan"},sin:{mode:"math",value:"\\sin"},sinh:{mode:"math",value:"\\sinh"},cos:{mode:"math",value:"\\cos"},cosh:{mode:"math",value:"\\cosh"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},sec:{mode:"math",value:"\\sec"},csc:{mode:"math",value:"\\csc"},cot:{mode:"math",value:"\\cot"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ii(e,t,a){var i;return function(e,t){if(!t)return"";if("string"==typeof t)return t;if(!e)return t.value;let a=!1,i=!1,s=!1,o=!1,r=!1,n=!1,l=!1,c=!1,d=!1,m=!1,p=!1,h=!1,u=!1,f=!1,g=e[e.length-1],y=e.length-1;for(;g&&/msubsup|placeholder/.test(g.type);)y-=1,g=e[y];if(a=!g||"first"===g.type,g){if(void 0!==t.mode&&g.mode!==t.mode)return"";u="text"===g.mode,i=!u&&"mord"===g.type&&V.test(g.body),s=!u&&"mord"===g.type&&/[0-9]+$/.test(g.body),o=!u&&g.isFunction,r="genfrac"===g.type,n="surd"===g.type,l="mbin"===g.type,c="mrel"===g.type,d="mpunct"===g.type||"minner"===g.type,m=!!g.array,p="mopen"===g.type,h="mclose"===g.type||"leftright"===g.type,f="space"===g.type}return void 0!==t.after?/nothing/.test(t.after)&&a||/letter/.test(t.after)&&i||/digit/.test(t.after)&&s||/function/.test(t.after)&&o||/frac/.test(t.after)&&r||/surd/.test(t.after)&&n||/binop/.test(t.after)&&l||/relop/.test(t.after)&&c||/punct/.test(t.after)&&d||/array/.test(t.after)&&m||/openfence/.test(t.after)&&p||/closefence/.test(t.after)&&h||/text/.test(t.after)&&u||/space/.test(t.after)&&f?t.value:"":t.value}(e,null!==(i=null==a?void 0:a[t])&&void 0!==i?i:ai[t])}function si(e,t){if(!e)return["latex",""];if(e.length<=1)return["latex",e];if(!t||"ASCIIMath"!==t.format){const t=e.trim();if(t.startsWith("$$")&&t.endsWith("$$")||t.startsWith("\\[")&&t.endsWith("\\]")||t.startsWith("\\(")&&t.endsWith("\\)"))return["latex",t.substring(2,t.length-2)];if(t.startsWith("$")&&t.endsWith("$"))return["latex",t.substring(1,t.length-1)];if(e=e.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(e))return["latex",e]}return e=(e=(e=(e=(e=(e=e.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),[(null==t?void 0:t.format)||"ASCIIMath",oi(e,null!=t?t:{})]}function oi(e,t){var a,i,s,o,r,n,l;if(!e)return"";let c,d=!1;if(d||"^"!==e[0]&&"_"!==e[0]||(c=ri(e.substr(1),{inlineShortcuts:null!==(a=null==t?void 0:t.inlineShortcuts)&&void 0!==a?a:{},noWrap:!0}),e=e[0]+"{"+c.match+"}",e+=oi(c.rest,t),d=!0),d||(c=e.match(/^(sqrt|\u221a)(.*)/),c&&(c=ri(c[2],{inlineShortcuts:null!==(i=null==t?void 0:t.inlineShortcuts)&&void 0!==i?i:{},noWrap:!0}),e="\\sqrt{"+c.match+"}",e+=oi(c.rest,t),d=!0)),d||(c=e.match(/^(\\cbrt|\u221b)(.*)/),c&&(c=ri(c[2],{inlineShortcuts:null!==(s=null==t?void 0:t.inlineShortcuts)&&void 0!==s?s:{},noWrap:!0}),e="\\sqrt[3]{"+c.match+"}",e+=oi(c.rest,t),d=!0)),d||(c=e.match(/^abs(.*)/),c&&(c=ri(c[1],{inlineShortcuts:null!==(o=null==t?void 0:t.inlineShortcuts)&&void 0!==o?o:{},noWrap:!0}),e="\\left|"+c.match+"\\right|",e+=oi(c.rest,t),d=!0)),d||(c=e.match(/^["”“](.*?)["”“](.*)/),c&&(e="\\text{"+c[1]+"}",e+=oi(c[2],t),d=!0)),d||(c=e.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),c&&(e=ni(c[1],t),e+=oi(c[2],t),d=!0)),!d&&/^(f|g|h)[^a-zA-Z]/.test(e)&&(c=ri(e.substring(1),{inlineShortcuts:null!==(r=t.inlineShortcuts)&&void 0!==r?r:{},noWrap:!0}),e="("===e[1]?e[0]+"\\mleft("+c.match+"\\mright)":e[0]+c.match,e+=oi(c.rest,t),d=!0),d||(c=e.match(/^([a-zA-Z]+)(.*)/),c&&(e=ni(c[1],t),e+=oi(c[2],t),d=!0)),!d)if(c=ri(e,{inlineShortcuts:null!==(n=t.inlineShortcuts)&&void 0!==n?n:{},noWrap:!0}),c.match&&"/"===c.rest[0]){const a=ri(c.rest.substr(1),{inlineShortcuts:null!==(l=t.inlineShortcuts)&&void 0!==l?l:{},noWrap:!0});a.match&&(e="\\frac{"+c.match+"}{"+a.match+"}"+oi(a.rest,t)),d=!0}else c.match&&(e="("===e[0]?"\\left("+c.match+"\\right)"+oi(c.rest,t):c.match+oi(c.rest,t),d=!0);return d||(c=e.match(/^(\s+)(.*)$/),c&&(e=" "+oi(c[2],t),d=!0)),e}function ri(e,t){let a="",i=e=e.trim(),s=e.charAt(0),o={"(":")","{":"}","[":"]"}[s];if(o){let r=1,n=1;for(;n0;)e[n]===s&&r++,e[n]===o&&r--,n++;0===r?(t.noWrap&&"("===s?a=oi(e.substring(1,n-1),t):("{"===s&&"}"===o&&(s="\\{",o="\\}"),a="\\left"+s+oi(e.substring(1,n-1),t)+"\\right"+o),i=e.substring(n)):(a=e.substring(1,n),i="")}else{let s=e.match(/^([a-zA-Z]+)/);if(s){let a=ii(null,e,t.inlineShortcuts);if(a)return a=a.replace("_{#?}",""),a=a.replace("^{#?}",""),{match:a,rest:e.substring(a.length)}}if(s=e.match(/^([a-zA-Z])/),s)return{match:s[1],rest:e.substring(1)};if(s=e.match(/^(-)?\d+(\.\d*)?/),s)return{match:s[0],rest:e.substring(s[0].length)};/^\\(left|right)/.test(e)||(s=e.match(/^(\\[a-zA-Z]+)/),s&&(i=e.substring(s[1].length),a=s[1]))}return{match:a,rest:i}}function ni(e,t){let a=ii(null,e,t);return a?(a=a.replace("_{#?}",""),a=a.replace("^{#?}",""),a+=" "):a=e,a}function li(e,t,a){const i=e.parent();let s="leftright"===i.type?i.leftDelim+i.rightDelim:"";if("\\lbrace\\rbrace"===s&&(s="{}"),"\\{\\}"===s&&(s="{}"),"{}"===s&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return di(e,"\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:a}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrock");const o=I[t];if(o&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const s=Rt(e)||"placeholder"===Vt(e).type;i=e.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=s?"?":o;let r=[];return s&&(r=e.siblings().splice(e.anchorOffset()+1,e.siblings().length)),di(e,i,{mode:"math",format:"latex",style:a}),s&&(e.sibling(0).body=r,Dt(e,-1)),!0}let r;if(Object.keys(I).forEach(e=>{t===I[e]&&(r=e)}),r){if(i&&"leftright"===i.type&&e.endOffset()===e.siblings().length-1)return kt(e),i.rightDelim=t,Dt(e,1),wt(e),!0;const s=e.siblings();let o;for(o=e.endOffset();o>=0&&("leftright"!==s[o].type||"?"!==s[o].rightDelim);o--);if(o>=0)return kt(e),s[o].rightDelim=t,s[o].body=s[o].body.concat(s.slice(o+1,e.endOffset()+1)),s.splice(o+1,e.endOffset()-o),$t(e,o),wt(e),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){kt(e),i.rightDelim=t;const a=s.slice(e.endOffset()+1);return s.splice(e.endOffset()+1),e.path.pop(),e.siblings().splice(e.endOffset()+1,0,...a),wt(e),!0}const r=e.ancestor(2);return!(!r||"leftright"!==r.type||"?"!==r.rightDelim||e.endOffset()!==s.length-1)&&(Dt(e,1),li(e,t,a))}return!1}function ci(e,t){if(Rt(e))return!1;function a(t,a){let i=!0;return Gt(e,e=>{i=i&&e[t]===a},{recursive:!0}),i}return t.color&&a("color",t.color)&&(t.color="none"),t.backgroundColor&&a("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&a("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&a("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&a("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&a("fontSize",t.fontSize)&&(t.fontSize="size5"),kt(e),Gt(e,e=>e.applyStyle(t),{recursive:!0}),wt(e),!0}function di(e,t,a){var i,s,o,r;if(null!==(i=a.smartFence)&&void 0!==i&&i){if(li(e,t,a.style))return}else{const a=e.parent();if("leftright"===(null==a?void 0:a.type)&&"?"===a.rightDelim&&e.endOffset()===e.siblings().length-1&&/^[)}\]|]$/.test(t))return kt(e),a.rightDelim=t,Dt(e,1),void wt(e)}const n=e.suppressChangeNotifications;a.suppressChangeNotifications&&(e.suppressChangeNotifications=!0),kt(e);const l=e.suppressChangeNotifications;e.suppressChangeNotifications=!0,a.insertionMode||(a.insertionMode="replaceSelection"),a.selectionMode||(a.selectionMode="placeholder"),a.format||(a.format="auto"),a.macros=null!==(s=a.macros)&&void 0!==s?s:e.options.macros;const c=a.mode||Lt(e);let d;const m=[Nt(e)],p=null!==(o=a.placeholder)&&void 0!==o?o:"\\placeholder{}";m["?"]=p,"replaceSelection"!==a.insertionMode||Rt(e)?"replaceAll"===a.insertionMode?(e.root.body=[],e.root.latex="",e.path=[{relation:"body",offset:0}],e.extent=0):"insertBefore"===a.insertionMode?Ht(e):"insertAfter"===a.insertionMode&&It(e):ti(e);const h=e.siblings(),u=e.startOffset();if(u+10&&h[u]&&"placeholder"===h[u].type&&ti(e,-1),"math"===c&&"ASCIIMath"===a.format)[,t]=si(t,{format:"ASCIIMath"}),d=ot(t,"math",null,null==a?void 0:a.macros,!1,e.listeners.onError),pi(e,d);else if("text"===c||"auto"!==a.format&&"latex"!==a.format)"text"!==c&&"text"!==a.format||(d=ot(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),"text",m,a.macros,!1,e.listeners.onError));else if("command"===c){d=[];for(const e of t)W.test(e)&&d.push(new Be("command","command",e))}else if(""===t)d=[new Be("command","command","\\")];else{if("auto"===a.format&&([a.format,t]=si(t)),m[0])t=t.replace(/(^|[^\\])#@/g,"$1#0");else if(/(^|[^\\])#@/.test(t)){const a=function(e){const t=e.siblings();let a=e.startOffset();if("text"===t[a].mode)for(;a>=1&&"text"===t[a].mode;)a--;else for(;a>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[a].type);)a--;return a}(e);t=t.replace(/(^|[^\\])#@/g,"$1"+function(e,t,a){const i=e.siblings();if(rt(i))return"";if("first"===i[0].type&&0===t&&(t=1),"root"===e.parent().type&&1===t&&a===i.length-1)return e.parent().toLatex(!1);let s="",o=t;for(;o<=a;)s+=i[o].toLatex(!1),o++;return s}(e,a+1,e.startOffset())),function(e,t){t>0?e.siblings().splice(e.anchorOffset()+1,t):(e.siblings().splice(e.anchorOffset()+t+1,-t),$t(e,e.anchorOffset()+t))}(e,a-e.startOffset())}else t=t.replace(/(^|[^\\])#@/g,"$1#?");/^\$\$(.*)\$\$$/.test(t)&&(t=t.substring(2,t.length-2)),d=ot(t,c,m,a.macros,null!==(r=a.smartFence)&&void 0!==r&&r,e.listeners.onError),"latex"!==a.format&&pi(e,d)}lt(e),function e(t,a){t&&a&&(Re(t)?t.forEach(t=>e(t,a)):"object"==typeof t&&(t.color||t.backgroundColor||t.fontFamily||t.fontShape||t.fontSeries||t.fontSize||(t.applyStyle(a),e(t.body,a),e(t.numer,a),e(t.denom,a),e(t.index,a),e(t.overscript,a),e(t.underscript,a),e(t.subscript,a),e(t.superscript,a))))}(d,a.style);const f=e.parent();if("latex"!==a.format&&e.options.removeExtraneousParentheses&&f&&"leftright"===f.type&&"("===f.leftDelim&&rt(f.body)&&d&&1===d.length&&"genfrac"===d[0].type?(e.path.pop(),e.siblings()[e.anchorOffset()]=d[0]):("latex"!==a.format||1!==m.length||m[0]||"root"===f.type&&rt(f.body)&&(f.latex=t),Array.prototype.splice.apply(e.siblings(),[e.anchorOffset()+1,0].concat(d))),e.insertFirstAtom(),e.suppressChangeNotifications=l,"placeholder"===a.selectionMode){let t=[];for(const e of d)t=t.concat(e.filter(e=>"placeholder"===e.type));0!==t.length&&At(e,1,!1)?e.announce("move"):$t(e,e.anchorOffset()+d.length)}else"before"===a.selectionMode||("after"===a.selectionMode?$t(e,e.anchorOffset()+d.length):"item"===a.selectionMode&&$t(e,e.anchorOffset(),d.length));wt(e),e.suppressChangeNotifications=n}function mi(e){if(e)return 1===e.length&&"leftright"===e[0].type&&"("===e[0].leftDelim&&(e=e[0].body),e}function pi(e,t){if(t&&e.options.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Re(t[e].body)){let a=0,i=0,s=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(a++,i=o),"first"!==t[e].body[o].type&&s++;0===s&&1===a&&(t[e]=t[e].body[i])}t.forEach(t=>{if("genfrac"===t.type&&(pi(e,t.numer),pi(e,t.denom),t.numer=mi(t.numer),t.denom=mi(t.denom)),t.superscript&&(pi(e,t.superscript),t.superscript=mi(t.superscript)),t.subscript&&(pi(e,t.subscript),t.subscript=mi(t.subscript)),t.underscript&&(pi(e,t.underscript),t.underscript=mi(t.underscript)),t.overscript&&(pi(e,t.overscript),t.overscript=mi(t.overscript)),t.index&&(pi(e,t.index),t.index=mi(t.index)),"surd"===t.type?(pi(e,t.body),t.body=mi(t.body)):Re(t.body)&&pi(e,t.body),t.array)for(let a=gt(t.array);a>=0;a--)pi(e,ft(t.array,a))})}}function hi(e){if(It(e),!Vt(e).superscript)if(Vt(e).subscript)Vt(e).superscript=[new Be("","first")];else{const t=e.sibling(1);(null==t?void 0:t.superscript)?e.path[e.path.length-1].offset+=1:(null==t?void 0:t.subscript)?(e.path[e.path.length-1].offset+=1,Vt(e).superscript=[new Be("","first")]):("limits"!==Vt(e).limits&&(e.siblings().splice(e.anchorOffset()+1,0,new Be(e.parent().mode,"msubsup","​",Ct(e))),e.path[e.path.length-1].offset+=1),Vt(e).superscript=[new Be("","first")])}return e.path.push({relation:"superscript",offset:0}),Bt(e),!0}Ga({moveToOpposite:e=>{const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[e.relation()];return t||hi(e),e.parent()[t]||(e.parent()[t]=[new Be("","first")]),$t(e,0,"end",t),!0},moveBeforeParent:e=>e.path.length>1?(e.path.pop(),$t(e,e.anchorOffset()-1),!0):(e.announce("plonk"),!1),moveAfterParent:e=>Wt(e),moveToNextPlaceholder:e=>At(e,1),moveToPreviousPlaceholder:e=>At(e,-1),moveToNextChar:e=>Dt(e,1),moveToPreviousChar:e=>Dt(e,-1),moveUp:e=>qt(e),moveDown:e=>Tt(e),moveToNextWord:e=>Et(e,1),moveToPreviousWord:e=>Et(e,-1),moveToGroupStart:e=>$t(e,0),moveToGroupEnd:e=>$t(e,-1),moveToMathFieldStart:e=>Ft(e,-1),moveToMathFieldEnd:e=>Ft(e,1),moveToSuperscript:e=>hi(e),moveToSubscript:e=>function(e){if(It(e),!Vt(e).subscript)if(Vt(e).superscript)Vt(e).subscript=[new Be("","first")];else{const t=e.sibling(1);(null==t?void 0:t.subscript)?e.path[e.path.length-1].offset+=1:(null==t?void 0:t.superscript)?(e.path[e.path.length-1].offset+=1,Vt(e).subscript=[new Be("","first")]):("limits"!==Vt(e).limits&&(e.siblings().splice(e.anchorOffset()+1,0,new Be(e.parent().mode,"msubsup","​",Ct(e))),e.path[e.path.length-1].offset+=1),Vt(e).subscript=[new Be("","first")])}return e.path.push({relation:"subscript",offset:0}),Bt(e),!0}(e)},{target:"model",category:"selection-anchor"}),Ga({selectGroup:e=>Bt(e),selectAll:e=>Ot(e),extendToNextChar:e=>Kt(e,1),extendToPreviousChar:e=>Kt(e,-1),extendToNextWord:e=>Et(e,1,{extend:!0}),extendToPreviousWord:e=>Et(e,-1,{extend:!0}),extendUp:e=>qt(e,{extend:!0}),extendDown:e=>Tt(e,{extend:!0}),extendToNextBoundary:e=>Et(e,1,{extend:!0}),extendToPreviousBoundary:e=>Et(e,-1,{extend:!0}),extendToGroupStart:e=>Pt(e,-e.anchorOffset()),extendToGroupEnd:e=>Pt(e,e.siblings().length-e.anchorOffset()),extendToMathFieldStart:e=>Ft(e,-1,{extend:!0}),extendToMathFieldEnd:e=>Ft(e,1,{extend:!0})},{target:"model",category:"selection-extend"}),Ga({deleteAll:e=>(Ot(e),ti(e)),deleteNextChar:e=>ti(e,1),deletePreviousChar:e=>ti(e,-1),deleteNextWord:e=>(Et(e,1,{extend:!0}),ti(e)),deletePreviousWord:e=>(Et(e,-1,{extend:!0}),ti(e)),deleteToGroupStart:e=>(Pt(e,-e.anchorOffset()),ti(e)),deleteToGroupEnd:e=>(Ft(e,-1,{extend:!0}),ti(e)),deleteToMathFieldStart:e=>(Ft(e,-1,{extend:!0}),ti(e)),deleteToMathFieldEnd:e=>(Ft(e,1,{extend:!0}),ti(e))},{target:"model",category:"delete"});const ui=["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"];function fi(e){return!e.ctrlKey&&!e.metaKey&&"Dead"!==e.key&&ui.indexOf(e.code)>=0}function gi(e){const t=[];return(e=function(e){if(!e.code){const t=Object.entries(oa().mapping);let a,i=!1,s=!1;for(let o=0;o<4;o++){for(const[r,n]of t)if(n[o]===e.key){a=r,3===o?(i=!0,s=!0):2===o?i=!0:1===o&&(s=!0);break}if(a)break}return new KeyboardEvent(e.type,{...e,altKey:i,shiftKey:s,code:a})}return new KeyboardEvent(e.type,e)}(e)).ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),0===t.length?"["+e.code+"]":(t.push("["+e.code+"]"),t.join("+"))}function yi(e){var t;if(!e)return"";let a;return"Unidentified"===e.key&&e.target&&(a=e.target.value),a=null!==(t=null!=a?a:e.key)&&void 0!==t?t:e.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(a)&&(a=""),a}class bi{constructor(e){this.mathlist=e,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(e){this.canUndo()&&("function"==typeof(null==e?void 0:e.onUndoStateWillChange)&&e.onUndoStateWillChange(this.mathlist.mathfield,"undo"),this.restore(this.stack[this.index-1],e),this.index-=1,e&&"function"==typeof e.onUndoStateDidChange&&e.onUndoStateDidChange(this.mathlist.mathfield,"undo"),this.canCoalesce=!1)}redo(e){this.canRedo()&&("function"==typeof(null==e?void 0:e.onUndoStateWillChange)&&e.onUndoStateWillChange(this.mathlist.mathfield,"redo"),this.index+=1,this.restore(this.stack[this.index],e),e&&"function"==typeof e.onUndoStateDidChange&&e.onUndoStateDidChange(this.mathlist.mathfield,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(e){this.record&&("function"==typeof(null==e?void 0:e.onUndoStateWillChange)&&e.onUndoStateWillChange(this.mathlist.mathfield,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(!1),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),e&&"function"==typeof e.onUndoStateDidChange&&e.onUndoStateDidChange(this.mathlist.mathfield,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(e){this.canCoalesce&&this.pop(),this.snapshot(e),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(!1),selection:this.mathlist.toString()}}restore(e,t){const a=this.mathlist.suppressChangeNotifications;void 0!==t.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=t.suppressChangeNotifications),di(this.mathlist,e?e.latex:"",{...t,format:"latex",mode:"math",insertionMode:"replaceAll",selectionMode:"after",smartFence:!1}),jt(this.mathlist,e?e.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=a}}const vi={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},xi={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"};function ki(t){if(!t)return"";if(e(t)){let e="";if(0===t.length)return"";if("first"===t[0].type&&t.shift(),0===t.length)return"";if("text"===t[0].mode){let a=0;for(e='"';t[a]&&"text"===t[a].mode;)e+=t[a].body,a++;e+='"'+ki(t.slice(a))}else if("math"===t[0].mode){let a=0;for(;t[a]&&"math"===t[a].mode;)e+=ki(t[a]),a++;e+=ki(t.slice(a))}return e.trim()}if("text"===t.mode)return'"'+t.body+'"';let a="";const i=t.symbol;let s;switch(t.type){case"group":case"root":a=ki(t.body);break;case"array":break;case"genfrac":(t.leftDelim||t.rightDelim)&&(a+="."!==t.leftDelim&&t.leftDelim?t.leftDelim:"{:"),t.hasBarLine?(a+="(",a+=ki(t.numer),a+=")/(",a+=ki(t.denom),a+=")"):(a+="("+ki(t.numer)+"),",a+="("+ki(t.denom)+")"),(t.leftDelim||t.rightDelim)&&(a+="."!==t.rightDelim&&t.rightDelim?t.rightDelim:"{:");break;case"surd":t.index?a+="root("+ki(t.index)+")("+ki(t.body)+")":a+="sqrt("+ki(t.body)+")";break;case"leftright":a+="."!==t.leftDelim&&t.leftDelim?t.leftDelim:"{:",a+=ki(t.body),a+="."!==t.rightDelim&&t.rightDelim?t.rightDelim:":}";break;case"sizeddelim":case"delim":case"overlap":case"overunder":break;case"mord":a=vi[i]||i||("string"==typeof t.body?t.body:""),"\\"===a[0]&&(a+=""),s=i?i.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,s?a=String.fromCharCode(parseInt("0x"+s[1])):a.length>0&&"\\"===a.charAt(0)&&(a="string"==typeof t.body?t.body.charAt(0):t.symbol);break;case"mbin":case"mrel":case"textord":case"minner":a=i&&vi[i]?vi[i]:i&&xi[i]?xi[i]:t.body;break;case"mopen":case"mclose":a+=t.body;break;case"mpunct":a=xi[i]||i;break;case"mop":"​"!==t.body&&(a="",a+="\\operatorname"===i?ki(t.body):t.body||i,a+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":a=" "}if(t.subscript){a+="_";const e=ki(t.subscript);e.length>1&&!/^(-)?\d+(\.\d*)?$/.test(e)?a+="("+e+")":a+=e}if(t.superscript){a+="^";const e=ki(t.superscript);e.length>1&&!/^(-)?\d+(\.\d*)?$/.test(e)?a+="("+e+")":a+=e}return a}const wi={};function Si(e){const t=wi.locale.substring(0,2);let a="";return wi.strings[wi.locale]&&(a=wi.strings[wi.locale][e]),!a&&wi.strings[t]&&(a=wi.strings[t][e]),a||(a=wi.strings.en[e]),a||(a=e),a}function Mi(e,t,a){nt(e);const i=[],s=t.substr(a);for(const e of s){const t=new Be("command","command",e);t.suggestion=!0,i.push(t)}Array.prototype.splice.apply(e.siblings(),[e.anchorOffset()+1,0].concat(i))}function Li(e,t){if(t=t||{acceptSuggestion:!1},Ma(e),t.discard)return Aa(e.model,null),e.switchMode("math"),!0;const a=La(e.model,!t.acceptSuggestion);if(a){if("\\("===a||"\\)"===a)Aa(e.model,[]),di(e.model,a.slice(1),{mode:e.mode});else{e.switchMode("math");const t=ot(a,"math",null,e.config.macros);t?Aa(e.model,t):Ca(e.model,!0)}return e.snapshot(),e.model.announce("replacement"),!0}return!1}function Ci(e){!function(e){const t=e.siblings(),a=Mt(e);let i=a.start;for(;i1)}return Va(e),!0}wi.plural=function(e,t,a){(a=null!=a?a:{}).type=a.type||"cardinal";const i=wi.locale.substring(0,2),s="ordinal"===a.type?wi._ordinal:wi._cardinal;let o,r="ordinal"===a.type?wi._ordinalPluralCategories.indexOf(s.select(e)):wi._cardinalPluralCategories.indexOf(s.select(e));return wi.strings[wi.locale]&&(o=wi.strings[wi.locale][t]),!o&&wi.strings[i]&&(o=wi.strings[i][t]),o||(o=wi.strings.en[t],o||(o=t),r="ordinal"===a.type?wi._ordinalPluralCategories.indexOf(wi._ordinalEnglish.select(e)):wi._cardinalPluralCategories.indexOf(wi._cardinalEnglish.select(e))),o.split(";")[r]||o.split(";")[0]},wi.merge=function(e,t){if(e&&t){const a=wi._locale;wi.locale=e,wi.strings[e]={...wi.strings[e],...t},wi.locale=a}else e&&!t&&Object.keys(e).forEach(t=>wi.merge(t,e[t]))},Object.defineProperty(wi,"locale",{set(e){wi._locale=e,wi._ordinal=null,wi._cardinal=null},get(){var e;return wi._locale||(wi._locale=null!==(e=null===navigator||void 0===navigator?void 0:navigator.language.slice(0,5))&&void 0!==e?e:"en"),wi._locale}}),Object.defineProperty(wi,"ordinal",{get:()=>(wi._ordinal||(wi._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),wi._ordinalEnglishPluralCategories=wi._ordinalEnglish.resolvedOptions().pluralCategories,wi._ordinal=new Intl.PluralRules(wi.locale,{type:"ordinal"}),wi._ordinalPluralCategories=wi._ordinal.resolvedOptions().pluralCategories),wi._ordinal)}),Object.defineProperty(wi,"cardinal",{get:()=>(wi._cardinal||(wi._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),wi._cardinalEnglishPluralCategories=wi._cardinalEnglish.resolvedOptions().pluralCategories,wi._cardinal=new Intl.PluralRules(wi.locale,{type:"cardinal"}),wi._cardinalPluralCategories=wi._ordinal.resolvedOptions().pluralCategories),wi._cardinal)}),wi.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.symbols":"Symbols","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.symbols":"حرف او رمز","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.symbols":"Symbole","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.symbols":"σύμβολα","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.symbols":"Símbolos","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.symbols":"نمادها","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"حروف رومی","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.symbols":"Symboles","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres romaines","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.symbols":"Simboli","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.symbols":"シンボル","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"ローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.symbols":"Symbolika","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.symbols":"Символы","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Латинские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}},Ga({complete:Li,nextSuggestion:function(e){return e.suggestionIndex+=1,Ci(e),!1},previousSuggestion:function(e){if(e.suggestionIndex-=1,e.suggestionIndex<0){nt(e.model);const t=oe(La(e.model));e.suggestionIndex=t.length-1}return Ci(e),!1}},{target:"mathfield",category:"autocomplete"});const Ai={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"eye ","\\sum":"Summation ","\\prod":"Product ",a:'a',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function $i(e){let t=0;if(Re(e))for(const a of e)"first"!==a.type&&(t+=1);return 1===t}function zi(e){let t="";if(Re(e))for(const a of e)"first"!==a.type&&"string"==typeof a.body&&(t+=a.body);return t}function _i(e,t){var a;const i={...t,textToSpeechRulesOptions:{...t.textToSpeechRulesOptions}};if(window.sre&&"sre"===i.textToSpeechRules){const t=Ha(e,i);return t?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=null!==(a=i.textToSpeechRulesOptions)&&void 0!==a?a:{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(t)):""}let s=function e(t,a,i){function s(e){return""+e+""}if(!a)return"";let o="";if(Re(a)){let r=!1,n=!1;for(let l=0;l'),o+=a.body;else{a.id&&"math"===t&&(o+='');let r="",n="",l="",c=!1;switch(a.type){case"group":case"root":o+=e("math",a.body,i);break;case"genfrac":if(r=e("math",a.numer,i),n=e("math",a.denom,i),$i(a.numer)&&$i(a.denom)){const e={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[zi(a.numer)+"/"+zi(a.denom)];e?o=e:o+=r+" over "+n}else o+=' the fraction '+r+', over '+n+'. End fraction.';break;case"surd":if(l=e("math",a.body,i),a.index){let t=e("math",a.index,i);t=t.trim();const s=t.replace(//g,"");o+="3"===s?' the cube root of '+l+'. End cube root':"n"===s?' the nth root of '+l+'. End root':' the root with index: '+t+', of '+l+'. End root'}else $i(a.body)?o+=" the square root of "+l+" , ":o+=' the square root of '+l+'. End square root';break;case"leftright":o+=Ai[a.leftDelim]||a.leftDelim,o+=e("math",a.body,i),o+=Ai[a.rightDelim]||a.rightDelim;break;case"rule":case"overunder":case"overlap":break;case"placeholder":o+="placeholder "+a.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const s=a.symbol;if("\\mathbin"===s||"\\mathrel"===s||"\\mathopen"===s||"\\mathclose"===s||"\\mathpunct"===s||"\\mathord"===s||"\\mathinner"===s){o=e(t,a.body,i);break}let r=a.body,n=a.symbol;if("delim"!==a.type&&"sizeddelim"!==a.type||(r=n=a.delim),"text"===t)o+=r;else{if("mbin"===a.type&&(o+=''),r){const e=Ai[r]||(n?Ai[n.trim()]:"");if(e)o+=" "+e;else{const e=n?function(e){let t="";return"\\"===e.charAt(0)&&(t=" "+e.replace("\\","")+" "),t}(n.trim()):"";o+=e||function(e){let t="";return i.textToSpeechMarkup?/[a-z]/.test(e)?t+=' '+e+"":/[A-Z]/.test(e)?t+="capital "+e.toLowerCase():t+=e:/[a-z]/.test(e)?t+=" '"+e.toUpperCase()+"'":/[A-Z]/.test(e)?t+=" 'capital "+e.toUpperCase()+"'":t+=e,t}(r)}}else o+=e("math",a.body,i);"mbin"===a.type&&(o+='')}break}case"mop":if("​"!==a.body){const t=a.symbol;if("\\sum"===t)if(a.superscript&&a.subscript){let t=e("math",a.superscript,i);t=t.trim();let s=e("math",a.subscript,i);s=s.trim(),o+=' the summation from '+s+' to '+t+' of ',c=!0}else if(a.subscript){let t=e("math",a.subscript,i);t=t.trim(),o+=' the summation from '+t+' of ',c=!0}else o+=" the summation of";else if("\\prod"===t)if(a.superscript&&a.subscript){let t=e("math",a.superscript,i);t=t.trim();let s=e("math",a.subscript,i);s=s.trim(),o+=' the product from '+s+' to '+t+' of ',c=!0}else if(a.subscript){let t=e("math",a.subscript,i);t=t.trim(),o+=' the product from '+t+' of ',c=!0}else o+=" the product of ";else if("\\int"===t)if(a.superscript&&a.subscript){let t=e("math",a.superscript,i);t=t.trim();let r=e("math",a.subscript,i);r=r.trim(),o+=' the integral from '+s(r)+' to '+s(t)+' of ',c=!0}else o+=' the integral of ';else"string"==typeof a.body?o+=Ai[a.body]||Ai[a.symbol]||" "+a.body:a.symbol&&("\\"===a.symbol[0]?o+=" "+a.symbol.substr(1):o+=" "+a.symbol)}break;case"enclose":l=e("math",a.body,i),$i(a.body)?o+=" crossed out "+l+" , ":o+=" crossed out "+l+". End cross out"}if(!c&&a.superscript){let s=e(t,a.superscript,i);s=s.trim();const r=s.replace(/<[^>]*>/g,"");if($i(a.superscript)){if("math"===t){const e=function(e){if(Re(e))for(const t of e)if("first"!==t.type&&t.id)return t.id.toString();return""}(a.superscript);e&&(o+='')}"′"===r?o+=" prime ":"2"===r?o+=" squared ":"3"===r?o+=" cubed ":isNaN(parseInt(r))?o+=" to the "+s+"; ":o+=' to the '+r+" power; "}else isNaN(parseInt(r))?o+=" raised to the "+s+"; ":o+=' raised to the '+r+" power; "}if(!c&&a.subscript){let t=e("math",a.subscript,i);t=t.trim(),$i(a.subscript)?o+=" sub "+t:o+=" subscript "+t+". End subscript. "}}return o}("math",e,i);if("ssml"===i.textToSpeechMarkup){let e="";i.speechEngineRate&&(e=''),s=''+e+"

    "+s+"

    "+(e?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(e){let t="other";return(null===navigator||void 0===navigator?void 0:navigator.platform)&&(null===navigator||void 0===navigator?void 0:navigator.userAgent)&&(/^(mac)/i.test(navigator.platform)?t="mac":/^(win)/i.test(navigator.platform)?t="win":/(android)/i.test(navigator.userAgent)?t="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?t="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(t="chromeos")),"mac"===t?"mac":"!mac"}()?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s}function Di(e,t,a){return t+_i(a,{...e,textToSpeechMarkup:"",textToSpeechRulesOptions:{...e.textToSpeechRulesOptions,markup:"none"}})}function qi(e,t){if(!t&&window&&window.mathlive&&(t=window.mathlive.config),(t=null!=t?t:{}).speechEngine&&"local"!==t.speechEngine)if("amazon"===t.speechEngine){if(window&&window.AWS){const a=new window.AWS.Polly({apiVersion:"2016-06-10"}),i={OutputFormat:"mp3",VoiceId:t.speechEngineVoice,Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes(t.speechEngineVoice)?"neural":"standard",Text:e,TextType:"ssml"};a.synthesizeSpeech(i,(function(e,t){if(e);else if(null==t?void 0:t.AudioStream){const e=new Uint8Array(t.AudioStream),a=new Blob([e.buffer],{type:"audio/mpeg"}),i=URL.createObjectURL(a);new Audio(i).play().catch(e=>{})}}))}}else t.speechEngine;else{const t=new SpeechSynthesisUtterance(e);window&&window.speechSynthesis.speak(t)}}function Ti(e,t,a,i){let s="";"plonk"===t?(e.plonkSound&&(e.plonkSound.load(),e.plonkSound.play().catch(e=>{})),e.resetKeystrokeBuffer()):"delete"===t?s=Di(e.config,"deleted: ",i):"focus"===t||/move/.test(t)?s=(Rt(e.model)?"":"selected: ")+function(e,t){function a(e,t){return"body"===t.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[e.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[t.relation]}const i=t?t.path:[],s=e.model.path,o=s[s.length-1];let r="";for(;i.length>s.length;)r+="out of "+a(t.parent(),i[i.length-1])+"; ",i.pop();if(!Rt(e.model))return Di(e.config,"",Nt(e.model));const n=a(e.model.parent(),o);0===o.offset&&(r+=(n?"start of "+n:"unknown")+": ");const l=e.model.sibling(Math.max(1,e.model.extent));return l?r+=Di(e.config,"",l):0!==o.offset&&(r+=n?"end of "+n:"unknown"),r}(e,a):"replacement"===t?s=Di(e.config,"",e.model.sibling(0)):"line"===t?(s=Di(e.config,"",e.model.root),e.accessibleNode.innerHTML=e.config.createHTML(''+Ha(e.model.root,e.config)+""),e.textarea.setAttribute("aria-label","after: "+s)):s=i?Di(e.config,t+" ",i):t;const o=/\u00a0/.test(e.ariaLiveText.textContent)?"   ":"   ";e.ariaLiveText.textContent=s+o}Ga({speak:(e,t,a)=>function(e,t,a){a=null!=a?a:{withHighlighting:!1};const i=function(e,t){let a=null;switch(t){case"all":a=e.model.root;break;case"selection":Rt(e.model)||(a=Nt(e.model));break;case"left":{const t=e.model.siblings(),i=e.model.startOffset();if(i>=1){a=[];for(let e=1;e<=i;e++)a.push(t[e])}break}case"right":{const t=e.model.siblings(),i=e.model.endOffset()+1;if(i<=t.length-1){a=[];for(let e=i;e<=t.length-1;e++)a.push(t[e])}break}case"group":a=e.model.siblings();break;case"parent":{const t=e.model.parent();t&&"root"!==t.type&&(a=e.model.parent());break}}return a}(e,t);if(null===i)return e.config.speakHook(function(e){let t="";switch(e){case"all":break;case"selection":t="no selection";break;case"left":t="at start";break;case"right":t="at end";break;case"group":break;case"parent":t="no parent"}return t}(t),e.config),!1;const s={...e.config};(a.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml");const o=_i(i,s);return a.withHighlighting?(window.mathlive.readAloudMathField=e,Ua(e,{forHighlighting:!0}),e.config.readAloudHook&&e.config.readAloudHook(e.field,o,e.config)):e.config.speakHook&&e.config.speakHook(o,s),!1}(e,t,a)},{target:"mathfield",category:"speech"});const Ki=()=>{};function Ei(e){if("string"==typeof e){const t=new Audio;return t.preload="none",t.src=e,t.volume=.5,t}return e}function Fi(e){e instanceof HTMLAudioElement&&(e.pause(),e.removeAttribute("src"),e.load())}function Ni(t,a){const i=Bi(t,Object.keys(t));return Object.keys(a).forEach(t=>{var s;switch(t){case"scriptDepth":if(e(a.scriptDepth))i.scriptDepth=[a.scriptDepth[0],a.scriptDepth[1]];else{if("number"!=typeof a.scriptDepth)throw Error("Unexpected value for scriptDepth");i.scriptDepth=[a.scriptDepth,a.scriptDepth]}break;case"namespace":if(!/^[a-z]*[-]?$/.test(a.namespace))throw Error("namespace must be a string of lowercase characters only");/-$/.test(a.namespace)?i.namespace=a.namespace:i.namespace=a.namespace+"-";break;case"locale":i.locale="auto"===a.locale?wi.locale:a.locale;break;case"strings":wi.merge(a.strings);break;case"virtualKeyboardLayout":"auto"===a.virtualKeyboardLayout?i.virtualKeyboardLayout={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[wi.locale.substring(0,2)]||"qwerty":i.virtualKeyboardLayout=a.virtualKeyboardLayout;break;case"virtualKeyboardMode":{const e=null===(s=window.matchMedia)||void 0===s?void 0:s.call(window,"(any-pointer: coarse)").matches;"auto"===a.virtualKeyboardMode?i.virtualKeyboardMode=e?"onfocus":"off":i.virtualKeyboardMode=a.virtualKeyboardMode}break;case"letterShapeStyle":"auto"===a.letterShapeStyle?"fr"===wi.locale.substring(0,2)?i.letterShapeStyle="french":i.letterShapeStyle="tex":i.letterShapeStyle=a.letterShapeStyle;break;case"plonkSound":Fi(i.plonkSound),i.plonkSound=Ei(a.plonkSound);break;case"keypressSound":if(Fi(i.keypressSound),"string"==typeof a.keypressSound){const e=Ei(a.keypressSound);i.keypressSound={delete:e,return:e,spacebar:e,default:e}}else if(a.keypressSound instanceof HTMLAudioElement)i.keypressSound={delete:a.keypressSound,return:a.keypressSound,spacebar:a.keypressSound,default:a.keypressSound};else{if(!a.keypressSound.default)throw Error("Missing keypressSound.default");i.keypressSound={...a.keypressSound},i.keypressSound.return||(i.keypressSound.return=a.keypressSound.default),i.keypressSound.spacebar||(i.keypressSound.spacebar=a.keypressSound.default),i.keypressSound.delete||(i.keypressSound.delete=a.keypressSound.default)}break;case"onBlur":case"onFocus":case"onContentWillChange":case"onContentDidChange":case"onSelectionWillChange":case"onSelectionDidChange":case"onUndoStateWillChange":case"onUndoStateDidChange":case"onModeChange":case"onVirtualKeyboardToggle":case"onReadAloudStatus":case"onError":if(null===a[t])i[t]=Ki;else if("function"!=typeof a[t])throw Error(t+" must be a function or null");i[t]=a[t];break;default:e(a[t])?i[t]=[...a[t]]:"object"==typeof a[t]?i[t]={...a[t]}:i[t]=a[t]}}),void 0!==a.overrideDefaultInlineShortcuts&&(a.overrideDefaultInlineShortcuts?i.inlineShortcuts=a.inlineShortcuts:i.inlineShortcuts={...ai,...a.inlineShortcuts}),i}function Bi(t,a){let i;i="string"==typeof a?[a]:void 0===a?Object.keys(t):a;const s={};return i.forEach(a=>{e(s[a])?s[a]=[...s[a]]:"object"==typeof s[a]?s[a]={...s[a]}:s[a]=t[a]}),"string"==typeof a?s[a]:s}function Oi(e,t,a){"function"==typeof t&&(a=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(kt(e.model);!s;){const o=e.model.sibling(i);s=0===t||!o||"math"!==o.mode||!(/mord|textord|mpunct/.test(o.type)||"mop"===o.type&&/[a-zA-Z]+/.test(o.body))||!!o.superscript||!!o.subscript||a&&!a(o),s||(o.applyStyle({mode:"text"}),o.symbol=o.body,o.latex=""),i-=1,t-=1}wt(e.model)}function Ri(e,t,a){"function"==typeof t&&(a=t,t=1/0),void 0===t&&(t=1/0),kt(e.model);let i=0,s=!1;for(;!s;){const o=e.model.sibling(i);s=0===t||!o||"text"!==o.mode||" "===o.body||a&&!a(o),s||o.applyStyle({mode:"math"}),i-=1,t-=1}Pi(e),wt(e.model)}function Pi(e){let t=0;for(;e.model.sibling(t)&&"math"===e.model.sibling(t).mode;)t-=1;if(e.model.sibling(t)&&"text"===e.model.sibling(t).mode&&" "===e.model.sibling(t).body&&(!e.model.sibling(t-1)||"math"===e.model.sibling(t-1).mode)){kt(e.model),e.model.siblings().splice(t-1,1),wt(e.model);const a=e.model.suppressChangeNotifications;e.model.suppressChangeNotifications=!0,$t(e.model,e.model.anchorOffset()-1),e.model.suppressChangeNotifications=a}}function Ii(e,t,a){!function(e){const t=e.shiftKey&&e.altKey?3:e.altKey?2:e.shiftKey?1:0;if("Unidentified"===e.key)return;if("Dead"===e.key)return;const a=ea.filter(a=>{var i;return(null===(i=a.mapping[e.code])||void 0===i?void 0:i[t])===e.key});0!==a.length&&(a.forEach(e=>{e.score+=1}),ea.sort((e,t)=>t.score-e.score))}(a);const i=oa();if(e.keyboardLayout!==i.id&&(e.keyboardLayout=i.id,e.keybindings=ma(e.config.keybindings,t=>{"function"==typeof e.config.onError&&e.config.onError({code:"invalid-keybinding",arg:t.join("\n")})})),function(e,t){const a=e.keystrokeCaption;if(a&&e.keystrokeCaptionVisible){const i=e.element.getBoundingClientRect();a.style.left=i.left+"px",a.style.top=i.top-64+"px",a.innerHTML=e.config.createHTML(""+(da(t)||t)+""+a.innerHTML),a.style.visibility="visible",setTimeout((function(){a.childNodes.length>0&&a.removeChild(a.childNodes[a.childNodes.length-1]),0===a.childNodes.length&&(a.style.visibility="hidden")}),3e3)}}(e,t),clearTimeout(e.keystrokeBufferResetTimer),e.config.onKeystroke&&!e.config.onKeystroke(e,t,a))return(null==a?void 0:a.preventDefault)&&(a.preventDefault(),a.stopPropagation()),!1;let s,o,r,n=!1;if("command"!==e.mode&&(!a||!a.ctrlKey&&!a.metaKey))if(fi(a)){const t=yi(a),i=e.keystrokeBuffer+t;let r=0;for(;!s&&r{e.startsWith(o)&&!a.includes(e)&&a.push(e)});const r=(null==t?void 0:t.inlineShortcuts)?t.inlineShortcuts:null;r&&Object.keys(r).forEach(e=>{e.startsWith(o)&&a.push(e)})}return a}(i,e.config).length<=1?n=!0:e.config.inlineShortcutTimeout&&(e.keystrokeBufferResetTimer=setTimeout(()=>{e.resetKeystrokeBuffer()},e.config.inlineShortcutTimeout))}else e.resetKeystrokeBuffer();if(e.config.smartMode){const i=e.mode;s?e.mode="math":function(e,t,a){if(e.smartModeSuppressed)return!1;if(e.model.endOffset()<*|]$/.test(i))return Pi(e),!0}else{if("[Space]"===t)return Oi(e,void 0,e=>/[a-z][:,;.]$/.test(e.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return Oi(e,void 0,e=>/[a-zA-Z]/.test(e.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return Oi(e,1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return Oi(e,void 0,e=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(e.body)),!0;if(/\?|\./.test(i))return!0}return!1}(e,t,a)&&(e.mode={math:"text",text:"math"}[e.mode],r=""),e.mode!==i&&"function"==typeof e.config.onModeChange&&e.config.onModeChange(e,e.mode)}if(s||r||(r=function(e,t,a){if(0===e.length)return"";for(let i=e.length-1;i--;i>=0)if(e[i].key===a&&(!e[i].ifMode||e[i].ifMode===t))return e[i].command;return""}(e.keybindings,e.mode,t)),!s&&!r)return!0;if(e.config.readOnly&&"insert"===r[0])return!0;Ca(e.model,!1);const l=e.model.parent();if("moveAfterParent"===r&&l&&"leftright"===l.type&&e.model.endOffset()===e.model.siblings().length-1&&e.config.smartFence&&li(e.model,".",e.style)&&(r="",Va(e)),"math"===e.mode&&"[Spacebar]"===t&&!s){const t=e.model.sibling(1),a=e.model.sibling(-1);(t&&"text"===t.mode||a&&"text"===a.mode)&&di(e.model," ",{mode:"text"})}if(r)e.$perform(r);else if(s){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(s)){const t={...Ct(e.model),...e.style};di(e.model,yi(a),{suppressChangeNotifications:!0,mode:e.mode,style:t});const i=e.mode;e.snapshotAndCoalesce(),e.restoreToUndoRecord(e.keystrokeBufferStates[o]),e.mode=i}kt(e.model);const t=e.model.suppressChangeNotifications;e.model.suppressChangeNotifications=!0;const i={...Ct(e.model),...e.style};di(e.model,s,{format:"latex",mode:e.mode,style:i,smartFence:!0}),Pi(e),s.endsWith(" ")&&(e.mode="text",di(e.model," ",{mode:"text",style:i})),e.model.suppressChangeNotifications=t,wt(e.model),e.snapshot(),Va(e),e.model.announce("replacement"),n&&e.resetKeystrokeBuffer()}return e.scrollIntoView(),(null==a?void 0:a.preventDefault)&&(a.preventDefault(),a.stopPropagation()),!1}function Hi(e,t,a){if(e.config.readOnly)return void e.model.announce("plonk");if((a=null!=a?a:{}).focus&&e.$focus(),a.feedback&&(e.config.keypressVibration&&(null===navigator||void 0===navigator?void 0:navigator.vibrate)&&navigator.vibrate(3),e.keypressSound&&(e.keypressSound.load(),e.keypressSound.play().catch(e=>{}))),a.commandMode&&"command"!==e.mode&&e.switchMode("command"),Ca(e.model,!1),a.simulateKeystroke){const a=t.charAt(0);if(!Ii(e,a,new KeyboardEvent("keypress",{key:a})))return}let i="",s=!1;if(e.pasteInProgress)e.pasteInProgress=!1,di(e.model,t,{smartFence:e.config.smartFence,mode:"math"});else{const a={...Ct(e.model),...e.style},o=Ue(t);for(const t of o)if("command"===e.mode){nt(e.model),e.suggestionIndex=0;const a=La(e.model),o=oe(a+t);s=o.length>1,0===o.length?(di(e.model,t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(a+t)&&Ca(e.model,!0),Ma(e)):(di(e.model,t,{mode:"command"}),o[0].match!==a+t&&Mi(e.model,o[0].match,-o[0].match.length+a.length+1),i=o[0].match)}else if("math"===e.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(Wi(e)>=e.config.scriptDepth[1])return void e.model.announce("plonk")}else if("moveToSubscript"===i&&Vi(e)>=e.config.scriptDepth[0])return void e.model.announce("plonk");e.$perform(i)}else e.config.smartSuperscript&&"superscript"===e.model.relation()&&/[0-9]/.test(t)&&0===e.model.siblings().filter(e=>"first"!==e.type).length?(di(e.model,t,{mode:"math",style:a}),Wt(e.model)):di(e.model,t,{mode:"math",style:a,smartFence:e.config.smartFence})}else"text"===e.mode&&di(e.model,t,{mode:"text",style:a})}"command"!==e.mode&&e.snapshotAndCoalesce(),e.dirty=!0,e.scrollIntoView(),ka(e,i,s)}function Wi(e){let t=0,a=0,i=e.model.ancestor(a),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),a+=1,i=e.model.ancestor(a);return s?t:0}function Vi(e){let t=0,a=0,i=e.model.ancestor(a),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),a+=1,i=e.model.ancestor(a);return s?t:0}function Ui(e){return e.pasteInProgress=!0,!0}let ji;Ga({undo:e=>(Li(e),e.undo(),!0),redo:e=>(Li(e),e.redo(),!0),scrollIntoView:e=>(e.scrollIntoView(),!0),scrollToStart:e=>(e.field.scroll(0,0),!0),scrollToEnd:e=>{const t=e.field.getBoundingClientRect();return e.field.scroll(t.left-window.scrollX,0),!0},enterCommandMode:e=>(e.switchMode("command"),!0),toggleKeystrokeCaption:e=>(e.keystrokeCaptionVisible=!e.keystrokeCaptionVisible,e.keystrokeCaption.innerHTML="",e.keystrokeCaptionVisible||(e.keystrokeCaption.style.visibility="hidden"),!1),switchMode:(e,t)=>(e.switchMode(t),!0),insert:(e,t,a)=>e.$insert(t,a),typedText:(e,t)=>(Hi(e,t),!0)}),Ga({applyStyle:function(e,t){e.resetKeystrokeBuffer();const a=function(e){const t={};return"string"==typeof e.mode&&(t.mode=e.mode.toLowerCase()),"string"==typeof e.color&&(t.color=e.color),"string"==typeof e.backgroundColor&&(t.backgroundColor=e.backgroundColor),"string"==typeof e.fontFamily&&(t.fontFamily=e.fontFamily),"string"==typeof e.series&&(t.fontSeries=e.series),"string"==typeof e.fontSeries&&(t.fontSeries=e.fontSeries.toLowerCase()),t.fontSeries&&(t.fontSeries={bold:"b",medium:"m",normal:"m"}[t.fontSeries]||t.fontSeries),"string"==typeof e.shape&&(t.fontShape=e.shape),"string"==typeof e.fontShape&&(t.fontShape=e.fontShape.toLowerCase()),t.fontShape&&(t.fontShape={italic:"it",up:"n",upright:"n",normal:"n"}[t.fontShape]||t.fontShape),"string"==typeof e.size?t.fontSize=e.size:"number"==typeof e.size&&(t.fontSize="size"+Math.min(0,Math.max(10,e.size))),"string"==typeof e.fontSize&&(t.fontSize=e.fontSize.toLowerCase()),t.fontSize&&(t.fontSize={tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normal:"size5",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.fontSize]||t.fontSize),t}(t);if(a.mode){if(Rt(e.model))e.switchMode(a.mode);else{const t=e.mode,a="math"===(Lt(e.model)||e.config.defaultMode)?"text":"math";let i=e.$selectedText("ASCIIMath");if("math"===a&&/^"[^"]+"$/.test(i)&&(i=i.slice(1,-1)),e.$insert(i,{mode:a,selectionMode:"item",format:"text"===a?"text":"ASCIIMath"}),e.mode=a,e.groupIsSelected()){const t=e.model.parent();!t||"group"!==t.type&&"root"!==t.type||(t.mode=a)}e.mode!==t&&"function"==typeof e.config.onModeChange&&e.config.onModeChange(e,e.mode)}delete a.mode}return Rt(e.model)?(e.style.fontSeries&&a.fontSeries===e.style.fontSeries&&(a.fontSeries="auto"),a.fontShape&&a.fontShape===e.style.fontShape&&(a.fontShape="auto"),a.color&&a.color===e.style.color&&(a.color="none"),a.backgroundColor&&a.backgroundColor===e.style.backgroundColor&&(a.backgroundColor="none"),a.fontSize&&a.fontSize===e.style.fontSize&&(a.fontSize="auto"),e.style={...e.style,...a}):(ci(e.model,a),e.snapshot()),!0}},{target:"mathfield"}),Ga({copyToClipboard:e=>(e.$focus(),Rt(e.model)&&e.$select(),document.execCommand("copy"),!1),cutToClipboard:e=>(e.$focus(),document.execCommand("cut"),!0),pasteFromClipboard:e=>(e.$focus(),document.execCommand("paste"),!0)},{target:"mathfield",category:"clipboard"});let Gi=0;function Zi(e,t,a,i){var s;let o;(i=null!=i?i:{}).bias=null!==(s=i.bias)&&void 0!==s?s:0;const r=function e(t,a,i){let s={element:null,distance:Number.POSITIVE_INFINITY},o=!0;if(t.getAttribute("data-atom-id")){s.element=t;const e=t.getBoundingClientRect(),r=a-(e.left+e.right)/2,n=i-(e.top+e.bottom)/2;s.distance=r*r+n*n,o=a>=e.left&&a<=e.right}if(o&&t.children)for(const o of t.children){const t=e(o,a,i);t.element&&t.distance<=s.distance&&(s=t)}return s}(e.field,t,a).element,n=r?r.getAttribute("data-atom-id"):null;if(n){const a=Yt(e.model,(e,t)=>t.captureSelection?t.filter(e=>e.id===n).length>0:t.id===n);if(a&&a.length>0)if(o=dt(a[0]).path,0===i.bias){const e=r.getBoundingClientRect();tf ()",classes:"tex",layers:["functions"]},symbols:{tooltip:"keyboard.tooltip.symbols",layer:"symbols",label:"∞≠∈",classes:"tex",layers:["symbols"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},Yi={"\\varphi ":["Φ","\\Phi "],"\\varsigma ":["Σ","\\Sigma "],"\\epsilon ":["Ɛ",'{\\char"0190}'],"\\rho ":["Ρ",'{\\char"3A1}'],"\\tau ":["Τ",'{\\char"3A4}'],"\\upsilon ":["Υ","\\Upsilon "],"\\theta ":["Θ","\\Theta "],"\\iota ":["Ι",'{\\char"399}'],"\\omicron ":["Ο",'{\\char"39F}'],"\\pi ":["Π","\\Pi "],"\\alpha ":["Α",'{\\char"391}'],"\\sigma ":["Σ","\\Sigma "],"\\delta ":["Δ","\\Delta "],"\\phi ":["Φ","\\Phi "],"\\gamma ":["Γ","\\Gamma "],"\\eta ":["Η",'{\\char"397}'],"\\xi ":["Ξ","\\Xi "],"\\kappa ":["Κ",'{\\char"39A}'],"\\lambda ":["Λ","\\Lambda "],"\\zeta ":["Ζ",'{\\char"396}'],"\\chi ":["Χ",'{\\char"3A7}'],"\\psi ":["Ψ","\\Psi "],"\\omega ":["Ω","\\Omega "],"\\beta ":["Β",'{\\char"392}'],"\\nu ":["Ν",'{\\char"39D}'],"\\mu ":["Μ",'{\\char"39C}']},Ji={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let Qi={};const es={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ;
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ;
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • ,
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function ts(e,t,a){return e=e.replace(/(^|[^\\])#@/g,"$1#?"),q(_(Ne({mathstyle:c.displaystyle,macros:a.config.macros},ot(e,"math",t,a.config.macros)),"ML__base"),"ML__mathlive").toMarkup()}function as(e,t,a){var i;let s="
    ";const o=t.replace(/\s+/g," ").split(" ");if(o.length>1){const t={...Xi,...null!==(i=e.config.customVirtualKeyboards)&&void 0!==i?i:{}};for(const e of o){if(!t[e])break;s+="
    "+t[e].label+"
    "}}return s+="
    ",s+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function is(e,t,a){var i;for(let s=0;s"+o.getAttribute("data-aside").replace(/"/g,'"')+""),void 0!==r&&(o.innerHTML=e.config.createHTML(r)),o.getAttribute("data-classes")&&o.classList.add(o.getAttribute("data-classes"));const n=null===(i=o.getAttribute("data-insert"))||void 0===i?void 0:i.replace(/"/g,'"');let l;if(n&&Yi[n]&&(o.setAttribute("data-shifted",Yi[n][0]),o.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",Yi[n][1]]))),l=o.getAttribute("data-command")?JSON.parse(o.getAttribute("data-command")):o.getAttribute("data-insert")?["insert",o.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:o.getAttribute("data-latex")?["insert",o.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:["typedText",o.getAttribute("data-key")||o.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],a&&(l=[a,l]),o.getAttribute("data-alt-keys")){const e=Qi[o.getAttribute("data-alt-keys")];e&&(l={default:l,pressAndHoldStart:["showAlternateKeys",o.getAttribute("data-alt-keys"),e],pressAndHoldEnd:"hideAlternateKeys"})}va(e,o,l)}}function ss(e,t){const a={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},i=a[e.config.virtualKeyboardLayout]?a[e.config.virtualKeyboardLayout]:a.qwerty;let s,o=t;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let r=o.match(/()/);for(;r;){s="";const e=r[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),t={};for(const a of e){const e=a.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);t[e[1]]=e[3]}let n=i[t.name];if(n||(n=a.qwerty[t.name]),n)for(const e of n){let a=t.class||"";a&&(a=" "+a),"~"===e?(s+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===e?s+="
  • ":"^"===e?s+="
  • ":"/"===e?s+="
  • ÷
  • ":"*"===e?s+="
  • ×
  • ":"-"===e?s+="
  • ":/tt/.test(a)?s+="
  • '+e+"
  • ":s+="
  • "+e+"
  • "}o=o.replace(new RegExp(r[1]+r[2]+r[3]),s),r=o.match(/()/)}return o}function os(e){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",fa(t)),!1}function rs(e){const t=e.virtualKeyboard.querySelectorAll("div.keyboard-layer.is-visible .rows .keycap, div.keyboard-layer.is-visible .rows .action");if(t)for(let a=0;a',command:'["applyStyle",{"color":"'+e+'"}]'});Ji["background-color"]=[];for(const e of fe)Ji["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+e+'"}]'});Qi={...Ji},Object.keys(Qi).forEach(e=>{Qi[e]=Qi[e].slice()});for(let e=0;e<26;e++){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[e];Qi[t]||(Qi[t]=[]),Qi[t].unshift({latex:"\\mathbb{"+t+"}",aside:"blackboard",insert:"\\mathbb{"+t+"}"}),Qi[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),Qi[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),Qi[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),Qi[t].unshift({latex:"\\mathcal{"+t+"}",aside:"calligraphy",insert:"\\mathcal{"+t+"}"}),Qi[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}for(let e=0;e<=26;e++){const t="abcdefghijklmnopqrstuvwxyz"[e];Qi[t]||(Qi[t]=[]),Qi[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),Qi[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),Qi[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),Qi[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}for(let e=0;e<10;e++){const t="0123456789"[e];Qi[t]||(Qi[t]=[]),Qi[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),Qi[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),Qi[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),Qi[t].unshift({latex:"\\mathcal{"+t+"}",aside:"script",insert:"\\mathcal{"+t+"}"}),Qi[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}let o=e.config.virtualKeyboards;o||(o="all"),o=o.replace(/\ball\b/i,"numeric functions symbols roman greek");const r={...es,...null!==(a=e.config.customVirtualKeyboardLayers)&&void 0!==a?a:{}},n={...Xi,...null!==(i=e.config.customVirtualKeyboards)&&void 0!==i?i:{}},l=o.replace(/\s+/g," ").split(" ");for(const t of l){if(!n[t])break;let a=n[t].layers||[];n[t].layer&&a.push(n[t].layer),a=Array.from(new Set(a));for(const i of a){if(!r[i])break;if("object"==typeof r[i]){let e="";if(r[i].styles&&(e+=``),r[i].backdrop&&(e+=`
    `),r[i].container&&(e+=`
    `),r[i].rows){e+="
    ";for(const t of r[i].rows){e+="
      ";for(const a of t)e+="${a.label?a.label:""}`;e+="
    "}e+="
    "}r[i].container&&(e+="
    "),r[i].backdrop&&(e+="
    "),r[i]=e}s+="
    ",s+=as(e,o,t);const a="function"==typeof r[i]?r[i]():r[i];s+=ss(e,a),s+="
    "}}const c=document.createElement("div");c.className="ML__keyboard",t?c.classList.add(t):e.config.virtualKeyboardTheme&&c.classList.add(e.config.virtualKeyboardTheme),c.innerHTML=e.config.createHTML(s),is(e,[].slice.call(c.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton")));const d=c.getElementsByClassName("layer-switch");for(let t=0;t{e.addEventListener("mousedown",e=>{e.preventDefault(),e.stopPropagation()}),e.addEventListener("touchstart",e=>{e.preventDefault(),e.stopPropagation()})}),m[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){os(),rs(e)})),window.addEventListener("blur",(function(){os(),rs(e)})),window.addEventListener("touchend",(function(){os(),rs(e)})),window.addEventListener("touchcancel",(function(){os(),rs(e)})),c}(e,t),pa(e.virtualKeyboard,"touchstart:passive mousedown",()=>{e.$focus()}),document.body.appendChild(e.virtualKeyboard)),window.setTimeout(()=>{e.virtualKeyboard.classList.add("is-visible")},1)):e.virtualKeyboard&&e.virtualKeyboard.classList.remove("is-visible"),"function"==typeof e.config.onVirtualKeyboardToggle&&e.config.onVirtualKeyboardToggle(e,e.virtualKeyboardVisible,e.virtualKeyboard),!1}Ga({showAlternateKeys:(e,t,a)=>{const i=ua("mathlive-alternate-keys-panel","ML__keyboard alternate-keys");e.virtualKeyboard.classList.contains("material")&&i.classList.add("material"),a.length>=7?i.style.width="286px":4===a.length||2===a.length?i.style.width="146px":1===a.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const e of a)s+="";s="
      "+s+"
    ",i.innerHTML=e.config.createHTML(s),is(e,[].slice.call(i.getElementsByTagName("li")),"performAlternateKeys");const o=e.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(o){o.top-i.clientHeight<0&&(i.style.width="auto",a.length<=6?i.style.height="56px":a.length<=12?i.style.height="108px":i.style.height="205px");const e=(o.top-i.clientHeight+5).toString()+"px",t=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(o.left+o.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+t+","+e+")",i.classList.add("is-visible")}return!1}},{target:"virtual-keyboard"}),Ga({shiftKeyboardLayer:t=>{const a=t.virtualKeyboard.querySelectorAll("div.keyboard-layer.is-visible .rows .keycap, div.keyboard-layer.is-visible .rows .action");if(a)for(let i=0;ios(),performAlternateKeys:(e,t)=>(os(),e.$perform(t)),switchKeyboardLayer:(e,t)=>ls(e,t),unshiftKeyboardLayer:e=>rs(e),insertAndUnshiftKeyboardLayer:(e,t)=>(e.$insert(t),rs(e),!0)},{target:"virtual-keyboard"}),Ga({toggleVirtualKeyboardAlt:e=>{let t=!1;return e.virtualKeyboard&&(t=e.virtualKeyboard.classList.contains("material"),e.virtualKeyboard.remove(),delete e.virtualKeyboard,e.virtualKeyboard=null),cs(e,t?"":"material"),!1},toggleVirtualKeyboardShift:e=>{var t,a;e.config.virtualKeyboardLayout={qwerty:"azerty",azerty:"qwertz",qwertz:"dvorak",dvorak:"colemak",colemak:"qwerty"}[e.config.virtualKeyboardLayout];const i=null!==(a=null===(t=e.virtualKeyboard)||void 0===t?void 0:t.querySelector("div.keyboard-layer.is-visible").id)&&void 0!==a?a:"";return e.virtualKeyboard&&(e.virtualKeyboard.remove(),delete e.virtualKeyboard,e.virtualKeyboard=null),cs(e),i&&ls(e,i),!1}},{target:"virtual-keyboard"}),Ga({toggleVirtualKeyboard:(e,t)=>ms(e,t),hideVirtualKeyboard:e=>ds(e),showVirtualKeyboard:(e,t)=>cs(e,t)},{target:"virtual-keyboard"});const ps={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},hs={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},us={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},fs={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function gs(t,a){return e(t.arg)?t.arg[a]:void 0}function ys(e){return e&&fs[e]||-1}function bs(e){return/=|=>/.test(e)?"right":"left"}function vs(e){if("f"===e||"g"===e)return!0;const t=us[e];return!!t&&!!/%[^01_^]?/.test(t)}function xs(e){e=(e||"").trim();let t=ps[e];if(!t)if(/^\\[^{}]+$/.test(e)){const a=se(e,"math",{});t=a&&a.value||e.slice(1)}else t=e;return t}function ks(e){if(!e)return null;const t=xs(As(e)),a=[ys(t),bs(t)];return a[0]<=0?null:a}function ws(e){return null!==ks(e)}const Ss={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Ms={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Ls={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Cs={",":"list",";":"list2"};function As(t){if("string"==typeof t)return t;if(e(t)){let e="";for(const a of t)e+=As(a);return e}if(t.symbol&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.symbol))return t.symbol;if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(e(t.body)){let e="";for(const a of t.body)e+=As(a);return e}return""}function $s(e){return"string"==typeof e.sym?function(e){let t=us[e];return t?t.replace("%1","").replace("%0","").replace("%",""):(e.length>1&&(t="\\"+e),t||(t=ee("math",e)),t)}(e.sym)||e.sym:""}function zs(e){return parseFloat(e.num)}function _s(e){return"object"==typeof e&&void 0!==e.num}function Ds(e){let t=0;return _s(e)&&(t="object"==typeof e.num?void 0!==e.num.re?Js(e.num.re):0:parseFloat(e.num)),t}function qs(e){let t=0;return _s(e)&&"object"==typeof e.num&&(t=void 0!==e.num.im?Js(e.num.im):0),t}function Ts(e){return e&&void 0!==e.sup}function Ks(e){return e&&void 0!==e.sub}function Es(e,t,a){let i=!1;const s=e.atoms[e.index];return s&&s.type===t&&(i=void 0===a||As(s)===a),i}function Fs(e,...t){const a={fn:e,arg:void 0};if(t){const e=[];for(const a of t)a&&e.push(a);e.length>0&&(a.arg=e)}return a}function Ns(e){return"number"==typeof e?{num:e.toString()}:"string"==typeof e||"object"==typeof e?{num:e}:void 0}function Bs(e){if(_s(e)){const t=Ds(e),a=qs(e);return 0!==a?(0!==t&&(e.num.re=(-t).toString()),e.num.im=(-a).toString()):e.num=(-t).toString(),e}return Fs("negate",e)}function Os(e){const t=e.atoms[e.index+1];return t&&"msubsup"===t.type}function Rs(e,t){let a=e.atoms[e.index];return!a||void 0===a.superscript&&void 0===a.subscript?a=null:e.index+=1,a||(a=e.atoms[e.index+1],a&&"msubsup"===a.type&&(a.superscript||a.subscript)?e.index+=2:a=null),a?(void 0!==a.subscript&&(e.ast.sub=Gs(a.subscript,t)),void 0!==a.superscript&&("msubsup"===a.type?/['\u2032]|\\prime/.test(As(a.superscript))?(e.index+=1,a=e.atoms[e.index+1],a&&"msubsup"===a.type&&/['\u2032]|\\prime/.test(As(a.superscript))?e.ast.sup={sym:"″"}:(e.ast.sup={sym:"′"},e.index-=1)):/['\u2033]|\\doubleprime/.test(As(a.superscript))?e.ast.sup={sym:"″"}:e.ast&&(e.ast.sup=Gs(a.superscript,t)):e.ast.sup=Gs(a.superscript,t))):e.index+=1,e}function Ps(e,t){const a=e.ast;if(Hs(e,"!!"))return e.index+=1,e.ast=Fs("factorial2",a),Ps(e=Rs(e,t),t);if(Hs(e,"++"))return e.index+=1,e.ast=Fs("increment",a),Ps(e=Rs(e,t),t);if(Hs(e,"--"))return e.index+=1,e.ast=Fs("decrement",a),Ps(e=Rs(e,t),t);const i=e.atoms[e.index];return(null==i?void 0:i.symbol)&&Ms[i.symbol]&&(e.ast=Fs(Ms[i.symbol],a),e=Ps(e=Rs(e,t),t)),e}function Is(e,t,a,i){if(e.index=e.index||0,0===e.atoms.length||e.index>=e.atoms.length)return e.ast=void 0,e;const s=e.minPrec;e.minPrec=0;let o=e.atoms[e.index];if(t){if("mopen"===o.type&&As(o)===t)e.index+=1,o=(e=Vs(e,i)).atoms[e.index],o&&"mclose"===o.type&&As(o)===a&&(Os(e)&&(e.ast={group:e.ast}),e=Ps(e=Rs(e,i),i));else if("textord"===o.type&&As(o)===t)e.index+=1,o=(e=Vs(e,i)).atoms[e.index],o&&"textord"===o.type&&As(o)===a&&(e.index+=1,e=Ps(e=Rs(e,i),i));else if("\\lVert"===t&&"textord"===o.type&&"|"===o.symbol){if(o=e.atoms[e.index+1],o&&"textord"===o.type&&"|"===o.symbol){e.index+=2,o=(e=Vs(e,i)).atoms[e.index];const t=e.atoms[e.index+1];o&&"textord"===o.type&&"|"===o.symbol&&t&&"textord"===t.type&&"|"===t.symbol&&(e.index+=2,e=Ps(e=Rs(e,i),i))}}else if("sizeddelim"===o.type&&o.delim===t)e.index+=1,o=(e=Vs(e,i)).atoms[e.index],o&&"sizeddelim"===o.type&&o.delim===a&&(e.index+=1,e=Ps(e=Rs(e,i),i));else{if("leftright"!==o.type||o.leftDelim!==t||"?"!==o.rightDelim&&o.rightDelim!==a)return;e.ast=Gs(o.body,i),Os(e)&&(e.ast={group:e.ast}),e=Ps(e=Rs(e,i),i)}return e.minPrec=s,e}{let r=!0;if("mopen"===o.type?(t=o.symbol,a=I[t]):"sizeddelim"===o.type?(t=o.delim,a=I[t]):"leftright"===o.type?(r=!1,t=o.leftDelim,"?"===(a=o.rightDelim)&&(a=I[t])):"textord"===o.type&&(t=o.symbol,a=I[t]),t&&a){if("|"===t&&"|"===a){const i=e.atoms[e.index+1];i&&"textord"===i.type&&"|"===i.symbol&&(t="\\lVert",a="\\rVert")}if(e=Is(e,t,a,i))return r&&(e.index+=1),e.ast={fn:Ss[t+a]||t+a,arg:[e.ast]},e.minPrec=s,e}}}function Hs(e,t){return e.index=e.index||0,!(e.atoms.length<=1||e.index>=e.atoms.length-1)&&t===As(e.atoms[e.index])+As(e.atoms[e.index+1])}function Ws(e){if(e.index=e.index||0,!(e.atoms.length<=1||e.index>=e.atoms.length-1)){if(!Es(e,"textord","\\nabla")){const t=e.atoms[e.index].symbol+e.atoms[e.index+1].symbol,a=/^(>=|<=|>>|<<|:=|!=)$/.test(t)?t:"";return a&&(e.index+=1),a}return e.index+=1,Es(e,"mbin","\\times")?(e.index+=1,e.ast="curl",e):Es(e,"mbin","\\cdot")?(e.index+=1,e.ast="div",e):void(e.index-=1)}}function Vs(t,a){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(a,i){if(a.index=a.index||0,a.ast=void 0,0===a.atoms.length||a.index>=a.atoms.length)return a;let s=a.atoms[a.index];if("text"===s.mode){let e="";for(;a.atoms[a.index]&&"text"===a.atoms[a.index].mode;)e+=a.atoms[a.index].body,a.index+=1;return a.ast={text:e},a}const o=xs(As(s));if(Ws(a))a.ast=Fs(a.ast,t(a,i).ast);else{if("root"===s.type)return a.index=0,a.atoms=s.body,t(a,i);if("mbin"===s.type&&"-"===o)a.index+=1,(a=t(a,i)).ast=Bs(a.ast);else if("mbin"===s.type&&"+"===o)a.index+=1,(a=t(a,i)).ast=Fs("add",a.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.symbol)){let e="",o=!1,r=/^[0-9.eEdD]$/;for(;a.index0&&"\\"===n.charAt(0)&&"string"==typeof e.body&&(n=e.body)),o=J(n,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),o!==n?(r={sym:o},l="normal"):r={sym:n};break;case"minner":case"mop":break;case"box":r=Gs(e.body,t);break;case"enclose":break;case"array":if("cardinality"===e.environmentName)r=Fs("card",Gs(e.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(e.environmentName)){r={fn:"array",args:[]};for(const a of e.array)r.args.push(a.map(e=>Gs(e,t)))}else if("cases"===e.environmentName){r={fn:"cases",args:[]};for(const a of e.array)if(a[0]){const e=[];e.push(Gs(a[0],t));let i=Gs(a[1],t);i&&"text"===i.fn&&i.arg&&/^(if|when|for)$/i.test(i.arg[0].trim())&&(i=i.arg.filter(e=>"string"!=typeof e)),e.push(null!=i?i:{}),r.args.push(e)}}break;case"spacing":case"space":case"mathstyle":break;default:r=void 0}return r&&l&&"normal"!==l&&(r.variant=l),r&&"string"==typeof e.cssClass&&(r.class=e.cssClass),r&&"string"==typeof e.cssId&&(r.id=e.cssId),r}function js(t){if(!t)return[];let a;if(e(t)){a=[];for(const e of t){const t=js(e);a=a.concat(t)}}else{if("spacing"===t.type||"first"===t.type)return[];"box"===t.type?a=js(t.body):(t.body&&e(t.body)&&(t.body=js(t.body)),t.superscript&&e(t.superscript)&&(t.superscript=js(t.superscript)),t.subscript&&e(t.subscript)&&(t.subscript=js(t.subscript)),t.index&&e(t.index)&&(t.index=js(t.index)),t.denom&&e(t.denom)&&(t.denom=js(t.denom)),t.numer&&e(t.numer)&&(t.numer=js(t.numer)),t.array&&e(t.array)&&(t.array=t.array.map(e=>e.map(e=>js(e)))),a=[t])}return a}function Gs(e,t){return function(e,t){e.index=e.index||0,e.ast=void 0;const a=[];for(;e.atoms[e.index];)if("text"===e.atoms[e.index].mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;a.push(Fs("text",t))}else{const i=Vs(e,t).ast;if(!i)return;a.push(i)}return a.length>1?Fs("sequence",...a):a[0]||void 0}({atoms:js(e)},t)}function Zs(e,t){return Gs(e,t)}function Xs(e,...t){e=e||".. ";let a="";if(t.length>0){"."!==e[0]&&(a+=e[0]);let i="";for(const s of t)a+=i+s,i=e[2];"."!==e[1]&&(a+=e[1])}return a}function Ys(e,t){const a=e.length;e=e.substr(0,t.precision-2);for(let a=0;a1&&(i+o.repeat(r+1)).startsWith(e))return"0"===o?i.replace(/(\d{3})/g,"$1"+t.groupSeparator):i.replace(/(\d{3})/g,"$1"+t.groupSeparator)+t.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+t.groupSeparator)+t.endRepeatingDigits}}return a!==e.length&&(e+="\\ldots"),e.replace(/(\d{3})/g,"$1"+t.groupSeparator)}function Js(e){return parseFloat(parseFloat(e).toPrecision(15))}function Qs(e,t){let a,i="";if("number"==typeof t.precision){if("number"!=typeof e){let a="",i="";if("-"===e[0]?(a="-",e=e.substr(1)):"+"===e[0]&&(e=e.substr(1)),e.indexOf(".")>=0){const s=e.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=s[1],r=s[2].substring(0,Math.min(t.precision-o.length,s[2].length));if(i=s[4]||"","0"===o){let i=0;for(;"0"===r[i]&&i=t.precision)s="0",a="";else{s=e[i];const a=Ys(e.substr(i+1),t);a&&(s+=t.decimalMarker+a)}"0"!==s&&(e.length-1>t.precision&&!s.endsWith("}")&&!s.endsWith("\\ldots")&&(s+="\\ldots"),i>4&&(s+=t.exponentProduct,t.exponentMarker?s+=t.exponentMarker+(1-i).toString():s+="10^{"+(1-i).toString()+"}")),e=s}else{e=o.replace(/\B(?=(\d{3})+(?!\d))/g,t.groupSeparator);const a=Ys(r,t);a&&(e+=t.decimalMarker+a)}}else if(e.length>t.precision){const a=e.length;let i=e[0];const s=Ys(e.substr(2),t);s&&(i+=t.decimalMarker+s,"}"!==i[i.length-1]&&(i+="\\ldots")),"1"!==i?i+=t.exponentProduct:i="",t.exponentMarker?i+=t.exponentMarker+(a-2).toString():i+="10^{"+(a-2).toString()+"}",e=i}else e=e.replace(/\B(?=(\d{3})+(?!\d))/g,t.groupSeparator);return i&&(i=t.exponentMarker?t.exponentMarker+i:t.exponentProduct+" 10^{"+i+"}"),a+e+i}a=Js(e)}if("engineering"===t.scientificNotation)if(0===a)i="0";else{const e=Math.abs(a);let s=Math.round(Math.log10(e));s-=s%3,e<1e3&&(s=0);const o=e/Math.pow(10,s);let r="";const n=o.toString().match(/^(.*)\.(.*)$/);(null==n?void 0:n[1])&&n[2]&&(r=n[1]+t.decimalMarker+n[2]),t.groupSeparator&&(r=Ys(o.toExponential(),t));let l="";l=0===s?"":t.exponentMarker?t.exponentMarker+s:t.exponentProduct+" 10^{"+s+"}",i=(a<0?"-":"")+r+l}else{const a="string"==typeof e?e:e.toString();let s,o,r,n=a.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);s=a,r="",(null==n?void 0:n[1])&&n[2]&&(s=n[1],o=t.exponentMarker?t.exponentMarker+n[2]:t.exponentProduct+" 10^{"+n[2]+"}"),n=s.match(/^(.*)\.(.*)$/),(null==n?void 0:n[1])&&n[2]&&(s=n[1],r=n[2]),t.groupSeparator&&(s=s.replace(/\B(?=(\d{3})+(?!\d))/g,t.groupSeparator),r=Ys(r,t)),r&&(r=t.decimalMarker+r),i=s+r+(o||"")}return i}class eo{constructor(e,t){this.config=Ni({namespace:"",substituteTextArea:void 0,readOnly:!1,createHTML:e=>e,defaultMode:"math",macros:P,horizontalSpacingScale:1,letterShapeStyle:"auto",smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,ignoreSpacebarInMathMode:!0,locale:"auto",strings:{},keybindings:ra,overrideDefaultInlineShortcuts:!1,inlineShortcuts:{},inlineShortcutTimeout:0,virtualKeyboardToggleGlyph:'',virtualKeyboardMode:"auto",virtualKeyboards:"all",virtualKeyboardLayout:"auto",customVirtualKeyboardLayers:{},customVirtualKeyboards:{},virtualKeyboardTheme:/android|cros/i.test(null===navigator||void 0===navigator?void 0:navigator.userAgent)?"material":"apple",keypressVibration:!0,keypressSound:null,plonkSound:null,textToSpeechRules:"mathlive",textToSpeechMarkup:"",textToSpeechRulesOptions:{},speechEngine:"local",speechEngineVoice:"Joanna",speechEngineRate:"100%",speakHook:Ki,readAloudHook:Ki,onAnnounce:Ti,onKeystroke:()=>!0,onMoveOutOf:()=>!0,onTabOutOf:()=>!0,onBlur:Ki,onFocus:Ki,onContentWillChange:Ki,onContentDidChange:Ki,onSelectionWillChange:Ki,onSelectionDidChange:Ki,onUndoStateWillChange:Ki,onUndoStateDidChange:Ki,onModeChange:Ki,onVirtualKeyboardToggle:Ki,onReadAloudStatus:Ki,onError:()=>{}},t),this.element=e,e.mathfield=this,this.originalContent=e.innerHTML;let a=this.element.textContent;a&&(a=a.trim());let i="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?i+=this.config.substituteTextArea:i+="":/android|ipad|ipod|iphone/i.test(null===navigator||void 0===navigator?void 0:navigator.userAgent)?i+="\n \n \n ":i+='',i+='',"manual"===this.config.virtualKeyboardMode?(i+=`
    `,this.config.virtualKeyboardToggleGlyph?i+=this.config.virtualKeyboardToggleGlyph:i+='',i+="
    "):i+="",i+="
    ",i+='\n
    \n \n \n
    \n ',this.element.innerHTML=this.config.createHTML(i);let s=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[s++].firstElementChild,this.field=this.element.children[s].children[0],this.field.addEventListener("wheel",e=>{e.preventDefault(),e.stopPropagation();const t=void 0===e.deltaX?e.detail:-e.deltaX;isFinite(t)&&this.field.scroll({top:0,left:this.field.scrollLeft-5*t})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[s++].children[1],va(this,this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[s].children[0],this.accessibleNode=this.element.children[s++].children[1],this.popover=ua("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=ua("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=this.config.defaultMode,this.smartModeSuppressed=!1,this.style={},this.blurred=!0,pa(this.element,"focus",this),pa(this.element,"blur",this),pa(this.textarea,"cut",this),pa(this.textarea,"copy",this),pa(this.textarea,"paste",this),function(e,t){let a,i=null,s=null,o=!1,r=!1;function n(e){clearTimeout(a),a=setTimeout((function(){clearTimeout(a),e()}))}function l(){if(function(e){return e.selectionStart!==e.selectionEnd}(e))return;const a=e.value;e.value="",a.length>0&&t.typedText(a)}const c=e;c.addEventListener("keydown",a=>{if(t.allowDeadKey()||"Dead"!==a.key&&"Unidentified"!==a.key&&229!==a.keyCode)r=!1;else{r=!0,o=!1;const a=t.blur,i=t.focus;t.blur=null,t.focus=null,"function"==typeof e.blur&&(e.blur(),e.focus()),t.blur=a,t.focus=i}return!(!o&&"CapsLock"!==a.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(a.code))||(i=a,s=null,t.keystroke(gi(a),a))},!0),c.addEventListener("keypress",e=>{o||(i&&s&&t.keystroke(gi(i),i),s=e,n(l))},!0),c.addEventListener("keyup",()=>{o||!i||s||l()},!0),c.addEventListener("paste",()=>{e.focus();const a=e.value;e.value="",a.length>0&&t.paste(a)},!0),c.addEventListener("blur",()=>{i=null,s=null,t.blur&&t.blur()},!0),c.addEventListener("focus",()=>{t.focus&&t.focus()},!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r&&t.allowDeadKey()&&n(l)},!0),c.addEventListener("input",()=>{if(r){const a=t.blur,i=t.focus;t.blur=null,t.focus=null,e.blur(),e.focus(),t.blur=a,t.focus=i,r=!1,o=!1,t.allowDeadKey()&&n(l)}else o||n(l)})}(this.textarea,{allowDeadKey:()=>"text"===this.mode,typedText:e=>Hi(this,e),paste:()=>Ui(this),keystroke:(e,t)=>Ii(this,e,t),focus:()=>this._onFocus(),blur:()=>this._onBlur()}),window.PointerEvent?pa(this.field,"pointerdown",this):pa(this.field,"touchstart:active mousedown",this),pa(window,"resize",this),this.model=new bt({mode:this.config.defaultMode,macros:this.config.macros,removeExtraneousParentheses:this.config.removeExtraneousParentheses},{onContentDidChange:e=>this.config.onContentDidChange(this),onSelectionDidChange:e=>this._onSelectionDidChange(),onContentWillChange:()=>this.config.onContentWillChange(this),onSelectionWillChange:()=>this.config.onSelectionWillChange(this),onError:this.config.onError},{announce:(e,t,a,i)=>{var s,o;return null===(o=(s=this.config).onAnnounce)||void 0===o?void 0:o.call(s,this,t,a,i)},moveOut:(e,t)=>this.config.onMoveOutOf(this,t),tabOut:(e,t)=>this.config.onTabOutOf(this,t)},this),this.undoManager=new bi(this.model),di(this.model,a,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:!0,macros:this.config.macros}),this.undoManager.startRecording(),this.undoManager.snapshot(this.config),this.model.setListeners({onContentDidChange:e=>this.config.onContentDidChange(this),onSelectionDidChange:e=>this._onSelectionDidChange(),onContentWillChange:()=>this.config.onContentWillChange(this),onSelectionWillChange:()=>this.config.onSelectionWillChange(this),onError:this.config.onError}),this.model.setHooks({announce:(e,t,a,i)=>{var s,o;return null===(o=(s=this.config).onAnnounce)||void 0===o?void 0:o.call(s,this,t,a,i)},moveOut:(e,t)=>this.config.onMoveOutOf(this,t),tabOut:(e,t)=>this.config.onTabOutOf(this,t)}),this.config.locale.startsWith(oa().locale)||sa(this.config.locale),this.keybindings=ma(this.config.keybindings,e=>{"function"==typeof this.config.onError&&this.config.onError({code:"invalid-keybinding",arg:e.join("\n")})}),Va(this)}$setConfig(e){this.config=Ni(this.config,e),this.model.setListeners({onContentDidChange:e=>this.config.onContentDidChange(this),onSelectionDidChange:e=>this._onSelectionDidChange(),onContentWillChange:()=>this.config.onContentWillChange(this),onSelectionWillChange:()=>this.config.onSelectionWillChange(this),onError:this.config.onError}),this.model.setHooks({announce:(e,t,a,i)=>{var s,o;return null===(o=(s=this.config).onAnnounce)||void 0===o?void 0:o.call(s,this,t,a,i)},moveOut:(e,t)=>this.config.onMoveOutOf(this,t),tabOut:(e,t)=>this.config.onTabOutOf(this,t)}),this.config.locale.startsWith(oa().locale)||sa(this.config.locale),this.keybindings=ma(this.config.keybindings,e=>{"function"==typeof this.config.onError&&this.config.onError({code:"invalid-keybinding",arg:e.join("\n")})}),this.config.readOnly||this._onBlur(),Va(this)}getConfig(e){return Bi(this.config,e)}handleEvent(e){switch(e.type){case"focus":this._onFocus();break;case"blur":this._onBlur();break;case"touchstart":case"mousedown":case"pointerdown":!function(e,t){const a=e;let i,s=!1,o=!1,r=!1;if(1!==t.buttons&&0!==t.buttons)return;let n=!1,l=!1;const c=t.touches?t.touches[0].clientX:t.clientX,d=t.touches?t.touches[0].clientY:t.clientY,m=Date.now(),p=setInterval(()=>{n?a.field.scroll({top:0,left:a.field.scrollLeft-16}):l&&a.field.scroll({top:0,left:a.field.scrollLeft+16})},32);function h(e){window.PointerEvent?(ha(a.field,"pointermove",u),ha(a.field,"pointerup pointercancel",h),a.field.releasePointerCapture(e.pointerId)):(ha(a.field,"touchmove",u),ha(a.field,"touchcancel touchend",h),ha(window,"mousemove",u),ha(window,"mouseup blur",h)),s=!1,clearInterval(p),a.element.querySelectorAll(".ML__scroller").forEach(e=>e.parentNode.removeChild(e)),e.preventDefault(),e.stopPropagation()}function u(t){const s=t.touches?t.touches[0].clientX:t.clientX,r=t.touches?t.touches[0].clientY:t.clientY,p="touch"===t.pointerType?20:5;if(Date.now()h.right,n=s=f.left&&c<=f.right&&d>=f.top&&d<=f.bottom){e.$hasFocus()||(r=!0,e.textarea.focus&&e.textarea.focus()),e.resetKeystrokeBuffer(),e.smartModeSuppressed=!1;const n=e.field.querySelector(".ML__mathlive").getBoundingClientRect();if(i=c>n.right?[{relation:"body",offset:e.model.root.body.length-1}]:Zi(e,c,d,{bias:0}),i){let n=document.createElement("div");n.className="ML__scroller",e.element.appendChild(n),n.style.left=f.left-200+"px",n=document.createElement("div"),n.className="ML__scroller",e.element.appendChild(n),n.style.left=f.right+"px",t.shiftKey?(Ut(e.model,e.model.path,i),i=pt(e.model.path),i[i.length-1].offset-=1):jt(e.model,i,0),r=!0,e.style={},3===t.detail||Gi>2?(h(t),3!==t.detail&&3!==Gi||Ot(e.model)):s||(s=!0,window.PointerEvent?(pa(a.field,"pointermove",u),pa(a.field,"pointerup pointercancel",h),a.field.setPointerCapture(t.pointerId)):(pa(window,"blur",h),t.touches?(pa(t.target,"touchmove",u),pa(t.target,"touchcancel touchend",h)):(pa(window,"mousemove",u),pa(window,"mouseup",h))),2!==t.detail&&2!==Gi||(o=!0,Bt(e.model)))}}else ji=null;r&&Va(e),t.preventDefault()}(this,e);break;case"resize":this.resizeTimer&&window.cancelAnimationFrame(this.resizeTimer),this.resizeTimer=window.requestAnimationFrame(()=>ga(this)&&this._onResize());break;case"cut":t=this,setTimeout(function(){t.$clearSelection(),Va(t)}.bind(t),0);break;case"copy":!function(e,t){Rt(e.model)?(t.clipboardData.setData("text/plain","$$"+e.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",e.$text("json")),t.clipboardData.setData("application/xml",e.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+e.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",e.$selectedText("json")),t.clipboardData.setData("application/xml",e.$selectedText("mathML"))),t.preventDefault()}(this,e);break;case"paste":Ui(this)}var t}$revertToOriginalContent(){this.element.innerHTML=this.config.createHTML(this.originalContent),delete this.element.mathfield,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,ha(this.textarea,"cut",this),ha(this.textarea,"copy",this),ha(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,fa(this.popover),delete this.popover,fa(this.keystrokeCaption),delete this.keystrokeCaption,fa(this.virtualKeyboard),delete this.virtualKeyboard,fa(document.getElementById("mathlive-alternate-keys-panel")),ha(this.element,"pointerdown",this),ha(this.element,"touchstart:active mousedown",this),ha(this.element,"focus",this),ha(this.element,"blur",this),ha(window,"resize",this),delete this.element}resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_onSelectionDidChange(){!function(e){const t=Mt(e);if(t){const a=e.siblings(),i=e.anchorOffset()+1;for(let e=t.start;e=0;e--)"command"===a[e].type?a.splice(e,1):t(a[e]);else if(t(a.body),t(a.superscript),t(a.subscript),t(a.underscript),t(a.overscript),t(a.numer),t(a.denom),t(a.index),a.array)for(let e=gt(a.array);e>=0;e--)t(ft(a.array,e))}(t.root.body),t.suppressChangeNotifications=a,wt(t)}(this.model))}wa(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&cs(this),wa(this),this.config.onFocus&&this.config.onFocus(this),Va(this))}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&ds(this),Li(this,{discard:!0}),Va(this),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),wa(this)}$perform(t){return function(t,a){var i;if(!a)return!1;let s,o=[],r=!1,n=!1;if(e(a)?(s=a[0],o=a.slice(1)):s=a,s=s.replace(/-\w/g,e=>e[1].toUpperCase()),"model"===(null===(i=ja[s])||void 0===i?void 0:i.target)){if(/^(delete|transpose|add)/.test(s)&&t.resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(s)&&"command"!==t.mode&&(t.popUndoStack(),t.snapshot()),ja[s].fn(t.model,...o),/^(delete|transpose|add)/.test(s)&&"command"!==t.mode&&t.snapshot(),/^(delete)/.test(s)&&"command"===t.mode){const e=oe(La(t.model));0===e.length?Ma(t):ka(t,e[0].match,e.length>1)}n=!0,r=!0}else{if(!ja[s])throw Error('Unknown command "'+s+'"');n=ja[s].fn(t,...o),r=!0}return Rt(t.model)&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(s)||(t.resetKeystrokeBuffer(),t.style={}),n&&Va(t),r}(this,t)}formatMathlist(e,t){let a="";if("latex"===(t=t||"latex")||"latex-expanded"===t)a=e.toLatex("latex-expanded"===t);else if("mathML"===t)a=Ha(e,this.config);else if("spoken"===t)a=_i(e,this.config);else if("spoken-text"===t){const t=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",a=_i(e,this.config),this.config.textToSpeechMarkup=t}else if("spoken-ssml"===t||"spoken-ssml-withHighlighting"===t){const t=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="ssml",a=_i(e,this.config),this.config.textToSpeechMarkup=t}else if("json"===t){const t=Zs(e);a=JSON.stringify(t)}else if("json-2"===t){const t=Zs(e);a=JSON.stringify(t,null,2)}else"ASCIIMath"===t&&(a=ki(e));return a}$text(e){return this.formatMathlist(this.model.root,e)}$selectedText(e){const t=Nt(this.model);if(!t)return"";const a=Oe("math",t);return this.formatMathlist(a,e)}$selectionIsCollapsed(){return Rt(this.model)}$selectionDepth(){return this.model.path.length}$selectionAtStart(){return 0===this.model.startOffset()}$selectionAtEnd(){return this.model.endOffset()>=this.model.siblings().length-1}groupIsSelected(){return 0===this.model.startOffset()&&this.model.endOffset()>=this.model.siblings().length-1}$latex(e,t){return"string"==typeof e?(e!==this.model.root.toLatex()&&(t=null!=t?t:{mode:"math"},di(this.model,e,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:t.suppressChangeNotifications,macros:this.config.macros}),this.undoManager.snapshot(this.config),Va(this)),e):this.model.root.toLatex()}$el(){return this.element}scrollIntoView(){var e;this.dirty&&Ua(this);let t=null===(e=ya(this.field))||void 0===e?void 0:e.x;const a=this.field.getBoundingClientRect();if(void 0===t){const e=ba(this.field);e&&(t=e.right+a.left-this.field.scrollLeft)}if(void 0!==t){const e=t-window.scrollX;ea.right&&this.field.scroll({top:0,left:e-a.right+this.field.scrollLeft+20,behavior:"smooth"})}}$insert(e,t){if("string"==typeof e&&e.length>0){if((t=null!=t?t:{mode:"math"}).focus&&this.$focus(),t.feedback&&(this.config.keypressVibration&&(null===navigator||void 0===navigator?void 0:navigator.vibrate)&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===e)Ja(this.model);else if("&"===e)Qa(this.model);else{const a=this.style;di(this.model,e,{mode:this.mode,style:Ct(this.model),...t}),t.resetStyle&&(this.style=a)}return this.undoManager.snapshot(this.config),Va(this),!0}return!1}switchMode(e,t="",a=""){this.resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(e),t&&this.$insert(t,{format:"latex",mode:{math:"text",text:"math"}[e]}),Ca(this.model,!1),"command"===e?(nt(this.model),Ma(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&ls(this,"lower-command"),di(this.model,"",{mode:"math"})):this.mode=e,a&&this.$insert(a,{format:"latex",mode:e}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),Va(this)}$hasFocus(){return document.hasFocus()&&function e(t=document){var a,i;return(null===(i=null===(a=t.activeElement)||void 0===a?void 0:a.shadowRoot)||void 0===i?void 0:i.activeElement)?e(t.activeElement.shadowRoot):t.activeElement}(document)===this.textarea}$focus(){this.$hasFocus()||("function"==typeof this.textarea.focus&&this.textarea.focus(),this.model.announce("line"))}$blur(){this.$hasFocus()&&this.textarea.blur&&this.textarea.blur()}$select(){Ot(this.model)}$clearSelection(){ti(this.model)}$applyStyle(e){ci(this.model,e)}$keystroke(e,t){return Ii(this,e,t)}$typedText(e){Hi(this,e)}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(){this.undoManager.snapshot({...this.config,onUndoStateDidChange:(e,t)=>{ns(this),this.config.onUndoStateDidChange(e,t)}})}snapshotAndCoalesce(){this.undoManager.snapshotAndCoalesce({...this.config,onUndoStateDidChange:(e,t)=>{ns(this),this.config.onUndoStateDidChange(e,t)}})}getUndoRecord(){return this.undoManager.save()}restoreToUndoRecord(e){this.undoManager.restore(e,{...this.config,suppressChangeNotifications:!0})}undo(){return this.undoManager.undo({...this.config,onUndoStateDidChange:(e,t)=>{ns(this),this.config.onUndoStateDidChange(e,t)}})}redo(){return this.undoManager.redo({...this.config,onUndoStateDidChange:(e,t)=>{ns(this),this.config.onUndoStateDidChange(e,t)}})}}function to(e,t,a){let i=a,s=0;const o=e.length;for(;i0&&s.push({type:"text",data:r.slice(0,c)}),l=!1);let d=!1;for(;!d;){if(l){if(n=r.indexOf(t,c),-1===n){d=!0;break}c!==n&&s.push({type:"text",data:r.slice(c,n)}),c=n}else{if(n=to(a,r,c+t.length),-1===n){d=!0;break}s.push({type:"math",data:r.slice(c+t.length,n),rawData:r.slice(c,n+a.length),mathstyle:i}),c=n+a.length}l=!l}c";a.innerHTML=t.createHTML?t.createHTML(i):i}catch(t){a.textContent=e}return a.className="sr-only",a}(e,a)),/\bspeakable-text\b/i.test(a.renderAccessibleContent)&&a.renderToSpeakableText){const i=document.createElement("span"),s=a.renderToSpeakableText(e,a);i.innerHTML=a.createHTML?a.createHTML(s):s,i.className="sr-only",t.appendChild(i)}return t.appendChild(s),t}return s}function oo(e,t){let a=null;if(t.TeX.processEnvironments&&/^\s*\\begin/.test(e))a=document.createDocumentFragment(),a.appendChild(so(e,void 0,t,!0));else{const i=io(e,t.TeX.delimiters);if(1===i.length&&"text"===i[0].type)return null;a=document.createDocumentFragment();for(let e=0;e0?no(e[t].children,a):e[t];if("string"==typeof t){for(let s=0;s0?no(e[s].children,a):e[s];if(i=no(e[s].children,t),i)return i}return i}return null}function lo(e,t){var a;const i=no(e,t);return i?null!==(a=i.classes)&&void 0!==a?a:"":null}function co(e,t){let a="";return e[t]&&(a+=''+t+"=",a+='',a+=e[t],a+='" '),a}var mo={mathlistToMarkup:function e(t,a=""){if(!t)return"";let i="";if(Array.isArray(t))for(let s=0;s"),"string"==typeof t.body&&t.body.length>0&&(i+=' ',i+=t.body,(t.body.charCodeAt(0)<32||t.body.charCodeAt(0)>127)&&(i+=" U+"+("000000"+t.body.charCodeAt(0).toString(16)).substr(-6)),i+=" "),"mathrm"===t.fontFamily?(i+='',i+=co(t,"fontFamily"),i+=""):i+=co(t,"fontFamily"),i+=co(t,"hasBarLine"),i+=co(t,"leftDelim"),i+=co(t,"rightDelim"),i+=co(t,"continuousFraction"),i+=co(t,"limits"),i+=co(t,"symbol"),i+=function(e,t){let a="";return e.framecolor&&(a+='framecolor=',a+='',a+='',a+=e.framecolor,a+=""),a}(t),i+=co(t,"mathstyle"),i+=co(t,"size"),i+=co(t,"cls"),i+=co(t,"delim"),i+=co(t,"shift"),i+=co(t,"width"),i+=co(t,"height"),i+=co(t,"position"),i+=e(t.overscript,a+"↑"),i+=e(t.underscript,a+"↓"),i+=e(t.superscript,a+"↑"),i+=e(t.subscript,a+"↓"),i+=e(t.body,a+"▶"),i+=e(t.numer,a+"▲"),i+=e(t.denom,a+"▼"),t.array)for(let s=0;s"+a+"⌗ row "+(s+1)+"/"+t.array.length;for(let o=0;o"),t.body&&t.body.length>0&&(i+=''+t.body+""),t.classes&&t.classes.length>0&&(i+=' '+t.classes+""),t.isTight&&(i+='  tight '),t.caret&&(i+='  caret '),t.style)for(const e in t.style)Object.prototype.hasOwnProperty.call(t.style,e)&&(i+=' '+e+":",i+=' '+t.style[e]+"; ");t.children&&(i+=t.children.map(t=>e(t,a+"▷")).join("; "))}return i},spanToString:function e(t,a=""){let i="";if(Array.isArray(t))if(0===t.length)i+="[]\n";else{i+="[\n";for(let s=0;s0&&(i+=a+'body:"'+t.body+'",\n'),t.classes&&t.classes.length>0&&(i+=a+'classes:"'+t.classes+'",\n'),t.style)for(const e in t.style)Object.prototype.hasOwnProperty.call(t.style,e)&&(i+=a+e+':"',i+=t.style[e]+'",\n');t.children&&t.children.length>0&&(i+=a+"children:"+t.children.map(t=>e(t,a)).join("; ")),i+=a+"}"}return i},hasClass:function(e,t,a){const i=lo(e,t);if(!i)return!1;const s=i.split(" ");for(let e=0;e{if(e)return;if(!t||!t.AudioStream)return;const a=new TextDecoder("utf-8").decode(new Uint8Array(t.AudioStream));window.mathlive.readAloudMarks=a.split("\n").map(e=>e?JSON.parse(e):{}),window.mathlive.readAloudTokens=[];for(const e of window.mathlive.readAloudMarks)e.value&&window.mathlive.readAloudTokens.push(e.value);window.mathlive.readAloudCurrentMark="",o.OutputFormat="mp3",o.SpeechMarkTypes=[],s.synthesizeSpeech(o,(function(e,t){if(e)return;if(!t||!t.AudioStream)return;const a=new Uint8Array(t.AudioStream),i=new Blob([a.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{const e=window.mathlive.readAloudMathField;r&&r(e,"ended"),e?(Ua(e),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function e(t){if(t.classList.remove("highlight"),t.children)for(const a of t.children)e(a)}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let e="";const t=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const a of window.mathlive.readAloudMarks)a.time0&&Array.from(t.children).forEach(t=>{e(t,a)})):(t.classList.add("highlight"),t.children&&t.children.length>0&&Array.from(t.children).forEach(t=>{e(t)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,r&&r(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}))})}function ho(e,t,a=3e3,i="$0"){t.forEach(t=>{N[t]&&(N[t].frequency=a,N[t].category=e,N[t].template=i.replace(/\$0/g,t)),O[t]&&(O[t]={...O[t],frequency:a,category:e,template:i.replace(/\$0/g,t)})})}function uo(e,t){(t=null!=t?t:{}).mathstyle=t.mathstyle||"displaystyle",t.letterShapeStyle=t.letterShapeStyle||"auto";const a=ot(e,"math",null,t.macros,!1,t.onError);let i=Ne({mathstyle:c[t.mathstyle],letterShapeStyle:t.letterShapeStyle},a);return i=function e(t){if(!t||0===t.length)return[];t[0].children=e(t[0].children);const a=[t[0]];for(let i=1;i0\\right\\}"),ho("Layout",["\\overset","\\underset","\\stackrel","\\stackbin"],1200,"$0{arg}{x=0}"),ho("Layout",["\\rlap","\\mathrlap"],1200,"$0{/}0"),ho("Layout",["\\llap","\\mathllap"],1200,"o$0{/}"),ho("Fractions",["\\frac"],4e3,"$0{\\placeholder{}}{\\placeholder{}}"),ho("Fractions",["\\binom","\\dfrac","\\tfrac","\\dbinom","\\tbinom","\\pdiff","\\cfrac"],1200,"$0{\\placeholder{}}{\\placeholder{}}"),ho("Fractions",["\\over","\\atop","\\choose"],1200,'\\unicode{"2B1A} $0 \\unicode{"2B1A}'),ho("Fractions",["\\overwithdelims","\\atopwithdelims"],1200,'{\\unicode{"2B1A} $0{\\lbrace}{\\rbrace} \\unicode{"2B1A}}'),ho("Extensible Operators",["\\sum","\\prod","\\bigcap","\\bigcup","\\int"],4e3),ho("Extensible Operators",["\\bigoplus","\\smallint","\\iint","\\oint"],3e3),ho("Extensible Operators",["\\bigwedge","\\bigvee","\\coprod","\\bigsqcup","\\bigotimes","\\bigodot","\\biguplus","\\intop","\\sqcup","\\sqcap","\\uplus","\\wr","\\Cap","\\Cup","\\doublecap","\\doublecup","\\amalg","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],1200),ho("Accents",["\\vec"],4e3),ho("Accents",["\\bar","\\ddot","\\acute","\\tilde","\\check"],3e3,"$0{\\placeholder{}}"),ho("Accents",["\\^","\\`","\\'"],1200,"$0{e}"),ho("Accents",["\\c"],1200,"$0{c}"),ho("Accents",["\\~"],1200,"$0{n}"),ho("Accents",["\\mathring","\\hat","\\dot","\\breve","\\grave"],1200,"$0{\\placeholder{}}"),ho("Extensible Symbols",["\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftharpoon","\\overrightharpoon","\\overleftrightarrow","\\overbrace","\\overlinesegment","\\overgroup","\\widehat","\\widecheck","\\widetilde"],3e3,"$0{ABC}"),ho("Extensible Symbols",["\\underrightarrow","\\underleftarrow","\\underleftrightarrow","\\underbrace","\\underlinesegment","\\undergroup","\\utilde"],3e3,"$0{ABC}"),ho("Sizing",["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],1200,"$0{x=0}"),ho("Sizing",["\\big","\\Big","\\bigg","\\Bigg"],1200,"$0($0)"),ho("Sizing",["\\bigl","\\Bigl","\\biggl","\\Biggl"],1200,"$0("),ho("Sizing",["\\bigr","\\Bigr","\\biggr","\\Biggr"],1200,"$0)"),ho("Sizing",["\\bigm","\\Bigm","\\biggm","\\Biggm"],1200,"$0|"),ho("Letterlike Symbols",["\\nabla","\\partial","\\doubleStruckCapitalN","\\N","\\doubleStruckCapitalR","\\R","\\doubleStruckCapitalQ","\\Q","\\doubleStruckCapitalC","\\C","\\doubleStruckCapitalZ","\\Z","\\exponentialE","\\forall","\\exists","\\nexists","\\$","\\%","\\And","\\degree"],4e3),ho("Letterlike Symbols",["\\doubleStruckCapitalP","\\P","\\ell","\\hbar","\\hslash","\\imath","\\jmath","\\imaginaryI","\\imaginaryJ","\\differentialD","\\rd","\\capitalDifferentialD","\\rD","\\differencedelta","\\mid","@","\\Re","\\Im"],3e3),ho("Letterlike Symbols",["\\top","\\bot","\\scriptCapitalE","\\scriptCapitalH","\\scriptCapitalL","\\gothicCapitalC","\\gothicCapitalH","\\gothicCapitalI","\\gothicCapitalR","\\Bbbk","\\Finv","\\Game","\\wp","\\eth","\\mho","\\pounds","\\yen","\\euro"],1200),ho("Crosses",["\\dagger","\\dag"],4e3),ho("Crosses",["\\ddag","\\ddagger","\\maltese","\\textdagger","\\textdaggerdbl"],1200),ho("Various",["\\checkmark","\\diagup","\\diagdown","\\angle","\\measuredangle","\\sphericalangle","\\prime","\\doubleprime","\\backprime","\\backdoubleprime","\\sharp","\\flat","\\natural","\\&","\\#","\\clubsuit","\\spadesuit","\\diamondsuit","\\heartsuit","\\backslash","\\infty","/","\\_","\\/","|","'"],1200),ho("Various",["\\unicode"],1200,'$0{"2B1A}'),ho("Arrows",["\\longrightarrow","\\rightarrow","\\Longrightarrow","\\Rightarrow"],4e3),ho("Arrows",["\\longmapsto","\\mapsto","\\Longleftrightarrow","\\rightleftarrows","\\leftarrow","\\curvearrowleft","\\uparrow","\\downarrow","\\hookrightarrow","\\rightharpoonup","\\rightleftharpoons"],3e3),ho("Arrows",["\\Leftarrow","\\longleftrightarrow","\\longleftarrow","\\Longleftarrow","\\searrow","\\nearrow","\\swarrow","\\nwarrow","\\Uparrow","\\Downarrow","\\updownarrow","\\Updownarrow","\\hookleftarrow","\\leftharpoonup","\\leftharpoondown","\\rightharpoondown","\\leftrightarrows","\\dashrightarrow","\\dashleftarrow","\\leftleftarrows","\\Lleftarrow","\\twoheadleftarrow","\\leftarrowtail","\\looparrowleft","\\leftrightharpoons","\\circlearrowleft","\\Lsh","\\upuparrows","\\downharpoonleft","\\multimap","\\leftrightsquigarrow","\\twoheadrightarrow","\\rightarrowtail","\\looparrowright","\\curvearrowright","\\circlearrowright","\\Rsh","\\downdownarrows","\\upharpoonright","\\downharpoonright","\\rightsquigarrow","\\leadsto","\\Rrightarrow","\\restriction"],1200),ho("Arrows",["\\upharpoonleft","\\rightrightarrows"],0),ho("Negated Arrows",["\\nrightarrow","\\nRightarrow","\\nleftrightarrow","\\nLeftrightarrow","\\nleftarrow","\\nLeftarrow"],1200),ho("Extensible Symbols",["\\xrightarrow","\\xleftarrow","\\xRightarrow","\\xLeftarrow","\\xleftharpoonup","\\xleftharpoondown","\\xrightharpoonup","\\xrightharpoondown","\\xlongequal","\\xtwoheadleftarrow","\\xtwoheadrightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xrightleftharpoons","\\xleftrightharpoons","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium"],1200,"$0[below]{above}=0"),ho("Negated Relations",["\\nless","\\nleqslant","\\lneq","\\lneqq","\\nleqq","\\unlhd","\\unrhd","\\lvertneqq","\\lnsim","\\lnapprox","\\nprec","\\npreceq","\\precnsim","\\precnapprox","\\nsim","\\nshortmid","\\nmid","\\nvdash","\\nvDash","\\ngtr","\\ngeqslant","\\ngeqq","\\gneq","\\gneqq","\\gvertneqq","\\gnsim","\\nsucc","\\succnsim","\\ncong","\\nshortparallel","\\nparallel","\\nVDash","\\nVdash","\\precneqq","\\succneqq","\\gnapprox","\\succnapprox","\\nsucceq"],1200),ho("Hebrew",["\\aleph","\\beth","\\daleth","\\gimel"],1200),ho("Fences",["\\lbrace","\\rbrace","\\vert","\\Vert","\\{","\\}","(",")","[","]"],4e3),ho("Fences",["\\langle","\\rangle","\\lfloor","\\rfloor","\\lceil","\\rceil","\\mvert","\\|","\\mVert"],3e3),ho("Fences",["\\lvert","\\rvert","\\lVert","\\rVert","\\lbrack","\\rbrack","\\ulcorner","\\urcorner","\\llcorner","\\lrcorner","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache"],1200),ho("Relations",["=","\\ne","\\neq","<",">","\\leqslant","\\geqslant","\\approx"],4e3),ho("Relations",["\\lt","\\gt","\\le","\\ge","\\leq","\\geq","\\gg","\\cong","\\equiv","\\prec","\\preceq","\\succ","\\perp","\\parallel","\\propto","\\smile","\\frown","\\sim","\\gtrsim"],3e3),ho("Relations",["\\coloneq","\\succeq","\\approxeq","\\thickapprox","\\lessapprox","\\gtrapprox","\\precapprox","\\succapprox","\\thicksim","\\succsim","\\precsim","\\backsim","\\eqsim","\\backsimeq","\\simeq","\\lesssim","\\nleq","\\ngeq","\\smallsmile","\\smallfrown","\\bowtie","\\asymp","\\leqq","\\eqslantless","\\ll","\\lll","\\lessgtr","\\lesseqgtr","\\lesseqqgtr","\\risingdotseq","\\fallingdotseq","\\preccurlyeq","\\curlyeqprec","\\vDash","\\Vvdash","\\bumpeq","\\Bumpeq","\\geqq","\\eqslantgtr","\\ggg","\\gtrless","\\gtreqless","\\gtreqqless","\\succcurlyeq","\\curlyeqsucc","\\Vdash","\\shortmid","\\shortparallel","\\between","\\pitchfork","\\varpropto","\\backepsilon","\\llless","\\gggtr","\\lhd","\\rhd","\\Join","\\doteq","\\doteqdot","\\Doteq","\\eqcirc","\\circeq","\\lessdot","\\gtrdot","\\measeq","\\eqdef","\\questeq"],1200),ho("Logic",["\\leftrightarrow","\\Leftrightarrow","\\to"],4e3),ho("Logic",["\\models","\\vdash"],3e3),ho("Logic",["\\therefore","\\because","\\implies","\\gets","\\dashv","\\impliedby","\\biconditional","\\roundimplies"],1200),ho("Operators",["+","-","*","\\cdot"],4e3),ho("Operators",["\\sqrt"],4e3,"$0{\\placeholder{}}"),ho("Operators",["\\pm","\\mp","\\times","\\div","\\surd"],3e3),ho("Operators",["\\ltimes","\\rtimes","\\leftthreetimes","\\rightthreetimes","\\intercal","\\dotplus","\\centerdot","\\doublebarwedge","\\divideontimes","\\divides"],1200),ho("Logic",["\\wedge","\\vee","\\neg"],4e3),ho("Logic",["\\lnot"],3e3),ho("Logic",["\\land","\\lor","\\barwedge","\\veebar","\\nor","\\curlywedge","\\curlyvee"],1200),ho("Greek",["\\alpha","\\beta","\\gamma","\\delta","\\epsilon","\\varepsilon","\\zeta","\\eta","\\theta","\\vartheta","\\iota","\\kappa","\\varkappa","\\lambda","\\mu","\\nu","\\xi","\\pi","\\varpi","\\rho","\\varrho","\\sigma","\\varsigma","\\tau","\\phi","\\varphi","\\upsilon","\\chi","\\psi","\\omega","\\Gamma","\\Delta","\\Theta","\\Lambda","\\Xi","\\Pi","\\Sigma","\\Upsilon","\\Phi","\\Psi","\\Omega","\\digamma","\\omicron"],3e3),ho("Sets",["\\emptyset","\\varnothing","\\cap","\\cup","\\in","\\notin","\\subset","\\supset","\\subseteq","\\supseteq","\\sqsubseteq"],4e3),ho("Sets",["\\setminus","\\not","\\ni","\\sqsupseteq","\\nsupseteqq","\\supsetneq","\\varsupsetneq","\\supsetneqq","\\varsupsetneqq"],3e3),ho("Sets",["\\smallsetminus","\\complement","\\owns","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\varsubsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq","\\nsubseteqq","\\subseteqq","\\Subset","\\sqsubset","\\supseteqq","\\Supset","\\sqsupset"],1200),ho("Spacing",["\\space, \\quad","\\qquad"],3e3,'\\unicode{"203A}$0\\unicode{"2039}'),ho("Spacing",["\\!","\\,","\\:","\\;","\\enskip","\\enspace"],1200,'\\unicode{"203A}$0\\unicode{"2039}'),ho("Spacing",["\\hspace","\\hspace*"],1200,'\\unicode{"203A}$0{1em}\\unicode{"2039}'),ho("Punctuation",["\\colon","\\cdotp","\\ldots","\\cdots","\\ddots","\\vdots","?","!",":",'"',",",".",";"],3e3),ho("Punctuation",["\\mathellipsis","\\ldotp","\\Colon"],1200),ho("Boxes",["\\square","\\Box"],3e3),ho("Boxes",["\\blacksquare","\\boxminus","\\boxplus","\\boxtimes","\\boxdot"],1200),ho("Circles",["\\circ","\\bullet","\\circleddash","\\oplus","\\otimes"],3e3),ho("Circles",["\\bigcirc","\\circledast","\\ominus","\\circledcirc","\\oslash","\\circledS","\\circledR","\\odot"],1200),ho("Triangles",["\\triangle","\\triangleq"],3e3),ho("Triangles",["\\bigtriangleup","\\vartriangle","\\triangledown","\\bigtriangledown","\\triangleleft","\\vartriangleleft","\\trianglelefteq","\\ntriangleleft","\\ntrianglelefteq","\\triangleright","\\vartriangleright","\\trianglerighteq","\\ntriangleright","\\ntrianglerighteq","\\blacktriangle","\\blacktriangledown","\\blacktriangleleft","\\blacktriangleright"],1200),ho("Shapes",["\\ast","\\star"],3e3),ho("Shapes",["\\diamond","\\Diamond","\\lozenge","\\blacklozenge","\\bigstar"],1200);var xo={version:"0.52.0",latexToMarkup:uo,latexToMathML:fo,latexToSpeakableText:go,latexToAST:function(e,t){var a;return(t=null!=t?t:{}).macros={...P,...null!==(a=t.macros)&&void 0!==a?a:{}},Zs(ot(e,"math",null,t.macros,!1,t.onError),t)},astToLatex:function(t,a){return function t(a,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let o="";if(void 0===a)return"";if("string"==typeof a)o=a;else if(a.latex)o=a.latex;else if(_s(a)){const e=zs(a);if(e===-1/0)o="-\\infty ";else if(e===1/0)o="\\infty ";else if("object"!=typeof a.num||"string"!=typeof a.num.re&&"string"!=typeof a.num.im)o=isNaN(e)?"\\text{NaN}":Qs(a.num,s);else{const e=Ds(a),t=qs(a);isNaN(e)||isNaN(t)?o="\\text{NaN}":Math.abs(t)<=Number.EPSILON&&Math.abs(e)<=Number.EPSILON?o="0":(Math.abs(e)>Number.EPSILON&&(o=Qs(e,s)),Math.abs(t)>Number.EPSILON&&(Math.abs(e)>Number.EPSILON&&(o+=t>0?"+":""),o+=(1!==Math.abs(t)?Qs(t,s):"")+"\\imaginaryI "))}Ts(a)&&(o+="^{"+t(a.sup,s)+"}"),Ks(a)&&(o+="_{"+t(a.sub,s)+"}")}else if(a.group)o=t(a.group,s),_s(a.group)||$s(a.group)?0!==qs(a.group)&&(o=Xs(a.fence||"(),",o)):o=Xs(a.fence||"(),",o),Ts(a)&&(o+="^{"+t(a.sup,s)+"}"),Ks(a)&&(o+="_{"+t(a.sub,s)+"}");else if(a.fn)if("bind"===a.fn){if(o=t(gs(a,0),s)+"|_{",a.arg&&2===a.arg.length)o+=t(gs(a,1));else{let e="";for(let i=1;it(e,s)));else if("text"===a.fn)o="\\text{"+(a.arg[0]||"")+"}";else if("pow"===a.fn&&e(a.arg)&&a.arg.length>=2)o=t(gs(a,0),s),_s(gs(a,0))||$s(gs(a,0))||(o=Xs(a.fence||"(),",o)),o+="^{"+t(gs(a,1),s)+"}";else if("equal"===a.fn&&a.arg&&a.arg.length>2)o=a.arg.map(e=>t(e,s)).join(" = ");else{const i=function(e){let t=us[e];return t||(t=e.length>1?"\\operatorname{"+e+"}%^%_ %":e+"%^%_ %"),t}(a.fn);o=i;let r="";if(/%(?![01_^])/.test(i)&&e(a.arg)&&a.arg.length>1)o+=Xs(a.fence||"(),",...a.arg.map(e=>t(e,s)));else if(e(a.arg)&&a.arg.length>0){const e=t(gs(a,0),s),n=t(gs(a,1),s),l=[...a.arg];/%0/.test(i)&&(o=o.replace("%0",e),l.shift()),/%1/.test(i)&&(o=o.replace("%1",n),l.shift()),l.length>0&&(r=Xs(a.fence||"(),",...l.map(e=>t(e,s))))}else r=Xs(a.fence||"(),","");o=Ts(a)?o.replace("%^","^{"+t(a.sup,s)+"}"):o.replace("%^",""),o=Ks(a)?o.replace("%_","_{"+t(a.sub,s)+"}"):o.replace("%_",""),o=o.replace(/%(?![01_^])/,r),o=o.replace("%0","").replace("%1","")}else{const e=[];for(const i of a.arg)"add"===i.fn||"subtract"===i.fn||0!==Ds(r=i)&&0!==qs(r)||Ts(a)&&0!==qs(i)&&1!==qs(i)?e.push(Xs("() ",t(i,s))):e.push(t(i,s));if("multiply"===a.fn)o=!a.arg||2!==a.arg.length||!_s(a.arg[0])&&"divide"!==a.arg[0].fn||_s(a.arg[1])&&(0!==Ds(a.arg[1])||1!==qs(a.arg[1]))?e.join(" \\times "):e[0]+e[1];else if(a.arg&&1===a.arg.length)o="negate"===a.arg[0].fn||_s(a.arg[0])&&zs(a.arg[0])<0?e[0]:"+"+e[0];else{o=e[0];for(let t=1;t=0&&(i+=t,i({...e,[t]:i[t][this.size]}),{}),this.metrics.emPerEx=i.xHeight[this.size]/i.quad[this.size]}sup(){return c[[4,5,4,5,6,7,6,7][this.id]]}sub(){return c[[5,5,5,5,7,7,7,7][this.id]]}fracNum(){return c[[2,3,4,5,6,7,6,7][this.id]]}fracDen(){return c[[3,3,5,5,7,7,7,7][this.id]]}cramp(){return c[[1,1,3,3,5,5,7,7][this.id]]}cls(){return["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"][this.size]}adjustTo(e){let t=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]][this.size][e.size];return t.length>0&&(t=" "+t),t}isTight(){return this.size>=2}}const c={0:new l(0,0,1,!1),1:new l(1,0,1,!0),2:new l(2,1,1,!1),3:new l(3,1,1,!0),4:new l(4,2,.7,!1),5:new l(5,2,.7,!0),6:new l(6,3,.5,!1),7:new l(7,3,.5,!0)};c.displaystyle=c[0],c.textstyle=c[2],c.scriptstyle=c[4],c.scriptscriptstyle=c[6];class d{constructor(e){var t;this.macros=null!==(t=e.macros)&&void 0!==t?t:{},this.atomIdsSettings=e.atomIdsSettings,this.mathstyle=e.mathstyle||c.displaystyle,this.letterShapeStyle=e.letterShapeStyle||"tex",this.size=e.size||"size5",this.parentMathstyle=e.parentMathstyle||this.mathstyle,this.parentSize=e.parentSize||this.size,this.opacity=e.opacity,this.smartFence=e.smartFence}clone(e={}){const t=new d(this);return e&&(Object.assign(t,e),e.mathstyle?(t.parentMathstyle=this.mathstyle,t.parentSize=this.size,"string"==typeof e.mathstyle&&(t.mathstyle=c[e.mathstyle])):t.mathstyle=this.mathstyle),t}setMathstyle(e){e&&"auto"!==e&&(this.mathstyle=c[e])}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sub()})}}const m={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},p={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34]},h={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",widetilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",widetilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",widetilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",widetilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};function u(e){let t="",a="";for(const i of e)/[a-zA-Z*]/.test(i[0])&&(a+=t),t=/\\[a-zA-Z]+\*?$/.test(i)?" ":"",a+=i;return a}function f(e,t){const a=[];let i,s=[];return e.forEach(e=>{if("first"!==e.type){let o;"variant"===t?(o=e.variant,e.variantStyle&&"up"!==e.variantStyle&&(o+="-"+e.variantStyle)):o=e[t],o!==i?(s.length>0&&a.push(s),s=[e],i=o):s.push(e)}}),s.length>0&&a.push(s),a}const g={};function y(e,t){g[e]={...t}}const b=["","mord","mbin","mop","mrel","mopen","mclose","mpunct","minner","spacing","first","command","error","placeholder","textord","none"];function v(e){return b.includes(e)}const x={"mord+mop":3,"mord+mbin":4,"mord+mrel":5,"mord+minner":3,"mop+mord":3,"mop+mop":3,"mop+mbin":5,"mop+minner":3,"mbin+mord":4,"mbin+mop":4,"mbin+mopen":4,"mbin+minner":4,"mrel+mord":5,"mrel+mop":5,"mrel+mopen":5,"mrel+minner":5,"mclose+mop":3,"mclose+mbin":4,"mclose+mrel":5,"mclose+minner":3,"mpunct+mord":3,"mpunct+mop":3,"mpunct+mbin":4,"mpunct+mrel":5,"mpunct+mopen":3,"mpunct+mpunct":3,"mpunct+minner":3},k=["​"," ","  "," "," ","  "," ","",""," "],w=[""," ⁣",""," ⁣"," ⁣"," ⁣"],S={"mord+mop":3,"mop+mord":3,"mop+mop":3,"mclose+mop":3,"minner+mop":3};function M(t){if("string"==typeof t)return t;if("number"==typeof t)return Number(Math.ceil(100*t)/100).toString();if(void 0===t)return"";if(e(t)){let e="";for(const a of t)e+=M(a);return e}return""}class L{constructor(t,a="",i=""){this.classes=a,e(t)?this.children=[].concat(...t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.type=i,this.style=null,this.updateDimensions()}updateDimensions(){let e=0,t=0,a=1;this.children?this.children.forEach(i=>{i.height>e&&(e=i.height),i.depth>t&&(t=i.depth),i.maxFontSize>a&&(a=i.maxFontSize)}):"string"==typeof this.body&&(e=.7,t=.2),this.height=e,this.depth=t,this.maxFontSize=a}selected(e){e&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!e&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(t=>t.selected(e))}applyStyle(e){if(!e)return;if(e.color&&("none"!==e.color?this.setStyle("color",e.color):this.setStyle("color","")),e.backgroundColor&&("none"!==e.backgroundColor?this.setStyle("background-color",e.backgroundColor):this.setStyle("background-color","")),e.cssClass&&(this.classes+=" "+e.cssClass),!this.body)return;const t=function(e,t){return g[t.mode]&&g[t.mode].applyStyle?g[t.mode].applyStyle(e,t):""}(this,e);if(this.body&&t){this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[e.fontSize]||1,this.height=0,this.depth=0,this.skew=0,this.italic=0;for(let e=0;e0&&(this.style||(this.style={}),this.style[e]=a)}setTop(e){e&&0!==e&&(this.style||(this.style={}),this.style.top=M(e)+"em",this.height-=e,this.depth+=e)}setLeft(e){e&&0!==e&&(this.style||(this.style={}),this.style["margin-left"]=M(e)+"em")}setRight(e){e&&0!==e&&(this.style||(this.style={}),this.style["margin-right"]=M(e)+"em")}setWidth(e){e&&0!==e&&(this.style||(this.style={}),this.style.width=M(e)+"em")}toMarkup(e=1,t=1){var a;let i="",s=this.body||"";if(this.children){let e="none";for(const a of this.children){let i=0;if(e){let s=a.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),i=a.isTight?S[e+"+"+s]||0:x[e+"+"+s]||0,i=Math.floor(t*i))}s+=a.toMarkup(i,t),e=C(a)}}if("​"!==s&&(s||this.svgBody)||this.classes&&"ML__selected"!==this.classes||this.cssId||this.style||this.svgOverlay){i="`${e}="${this.attributes[e]}"`).join(" "));const t=this.classes.split(" ");t.push(null!==(a={command:"ML__command",placeholder:"ML__placeholder",error:"ML__error"}[this.type])&&void 0!==a?a:""),this.caret&&"command"===this.type&&t.push("ML__command-caret");let o="";if(o=t.length>1?t.filter((e,t,a)=>e.length>0&&a.indexOf(e)===t).join(" "):t[0],o.length>0&&(i+=` class="${o}"`),e&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=M(parseFloat(this.style["margin-left"])+e/18)+"em":e<0&&w[-e]?s=w[-e]+s:k[e]?s=k[e]+s:(this.style||(this.style={}),this.style["margin-left"]=M(e/18)+"em")),this.style){let e="";const t=/ML__selected/.test(this.classes);for(const a in this.style)Object.prototype.hasOwnProperty.call(this.style,a)&&("background-color"===a&&t||(e+=a+":"+this.style[a]+";"));e.length>0&&(i+=' style="'+e+'"')}i+=">",this.svgBody?i+=function(e){if(p[e]){const t=p[e][2];return``}const[t,a,i,s]=m[e];let o,r;const n=i/1e3;3===t.length?(o=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],r=["xMinYMin","xMidYMin","xMaxYMin"]):2===t.length?(o=["slice-1-of-2","slice-2-of-2"],r=["xMinYMin","xMaxYMin"]):(o=["slice-1-of-1"],r=[s]);const l=t.map((e,t)=>``).join("");return`${l}`}(this.svgBody):this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(e){if(this.type!==e.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;if(this.svgBody||!this.body)return!1;if(e.svgBody||!e.body)return!1;const t=this.children&&this.children.length>0,a=e.children&&e.children.length>0;if(t||a)return!1;if((this.style?this.style.length:0)!==(e.style?e.style.length:0))return!1;const i=this.classes.trim().replace(/\s+/g," ").split(" "),s=e.classes.trim().replace(/\s+/g," ").split(" ");if(i.length!==s.length)return!1;i.sort(),s.sort();for(let e=0;eMath.max(e,t.height),0):t.height:0}function $(t){return t?e(t)?t.reduce((e,t)=>Math.max(e,t.depth),0):t.depth:0}function z(t){return t?e(t)?t[t.length-1].italic:t.italic:0}function _(t,a="",i=""){if(e(t)){const e=t.filter(e=>!!e);return 1===e.length?new L(e[0],a,i):new L(e,a,i)}return new L(t,a,i)}function D(e,t,a="",i=""){const s=new L(t,a,i),r=o(t,e);return s.height=r.height,s.depth=r.depth,s.skew=r.skew,s.italic=r.italic,s.setRight(s.italic),s}function q(t,a="",i=""){const s=_("","ML__strut");let o,r;return s.setStyle("height",A(t),"em"),0!==$(t)&&(o=_("","ML__strut--bottom"),o.setStyle("height",A(t)+$(t),"em"),o.setStyle("vertical-align",-$(t),"em")),r=e(t)?[s,o,...t]:[s,o,t],_(r,a,i)}function T(e,t,a,i,s){s=s||"";const o=K(t,(s+=" style-wrap ")+a.adjustTo(i));o.type=e;const r=i.sizeMultiplier/a.sizeMultiplier;return o.height*=r,o.depth*=r,o.maxFontSize=i.sizeMultiplier,o}function K(t,a="",i=""){if(!a){if(t instanceof L)return t;if(e(t)&&1===t.length)return t[0]}const s=new L(t,a,i);let o=1;return o=t instanceof L?t.maxFontSize:t.reduce((e,t)=>Math.max(e,t.maxFontSize),0),s.height*=o,s.depth*=o,s}function E(t,a,i="shift",s=0){let o=0,r=0;i=i||"shift";for(let t=0;t0?"em":""),i.attributes={"aria-hidden":"true"}),"size5"!==e.size?new L(i,"fontsize-ensurer reset-"+e.size+" size5"):0!==a?i:null}(t,n),c=[];r=o;for(const e of a)if("number"==typeof e)r+=e;else if(e instanceof L){const t=_([l,e]);t.setTop(-e.depth-r),c.push(t),r+=e.height+e.depth}const d=_(c,"vlist");return d.depth=Math.max(o,$(d)||0),d.height=Math.max(-r,A(d)||0),d}function F(e){const t=new L(null);return t.svgBody=e,t.height=function(e){return m[e]?m[e][2]/1e3:p[e][2]}(e)/2,t.depth=t.height,t}const N={},B={"<":"<",">":">",o:"o","&":"\\&","{":"\\{","}":"\\}","[":"\\lbrack","]":"\\rbrack",":":"\\colon"," ":"~","¬":"\\neg","·":"\\cdot","¼":"\\frac{1}{4}","½":"\\frac{1}{2}","¾":"\\frac{3}{4}","⁰":"^{0}","ⁱ":"^{i}","¹":"^{1}","²":"^{2}","³":"^{3}","†":"\\dagger","‡":"\\ddagger","…":"\\ldots","⁴":"^{4}","⁵":"^{5}","⁶":"^{6}","⁷":"^{7}","⁸":"^{8}","⁹":"^{9}","⁺":"^{+}","⁻":"^{-}","⁼":"^{=}","ⁿ":"^{n}","₀":"_{0}","₁":"_{1}","₂":"_{2}","₃":"_{3}","₄":"_{4}","₅":"_{5}","₆":"_{6}","₇":"_{7}","₈":"_{8}","₉":"_{9}","₊":"_{+}","₋":"_{-}","₌":"_{=}","ₐ":"_{a}","ₑ":"_{e}","ₒ":"_{o}","ₓ":"_{x}","′":"\\prime","'":"\\prime","←":"\\gets","→":"\\to","△":"\\triangle","▽":"\\triangledown","∋":"\\owns","∗":"\\ast","∣":"\\vert","∥":"\\Vert","∧":"\\land","∨":"\\lor","⋅":"\\cdot","⋈":"\\bowtie","≠":"\\ne","≤":"\\le","≥":"\\ge","⊥":"\\bot","⟷":"\\biconditional","⟸":"\\impliedby","⟹":"\\implies","ℂ":"\\C","ℕ":"\\N","ℙ":"\\P","ℚ":"\\Q","ℝ":"\\R","ℤ":"\\Z"},O={},R={},P={iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace",rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}"},I={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},H={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","\\textdagger":"†","\\textdaggerdbl":"‡","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},W=/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,V=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/,U=/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/;function j(e,t,a="mord",i=""){N[e]={type:a,variant:i,value:t},B[t]||i||(B[t]=e),H[e]=t}function G(e,t){for(let a=e;a<=t;a++){const e=String.fromCodePoint(a);j(e,e)}}function Z(e,t){return"math"===e?B[t]||t:"text"===e&&Object.keys(H).find(e=>H[e]===t)||t}const X={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},Y=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function J(e,t,a){if(!/[A-Za-z0-9]/.test(e))return e;if(!t&&!a)return e;const i=e.codePointAt(0);for(let e=0;e=Y[e].offset&&i120831)&&(e<8448||e>8527))return{char:String.fromCodePoint(e)};for(const t in X)if(Object.prototype.hasOwnProperty.call(X,t)&&X[t]===e){e=t.codePointAt(0);break}for(let t=0;t=Y[t].start&&e=1;)i.params.push({isOptional:!1,type:"math"}),s-=1}}}else"math"===t?i=N[e]:H[e]&&(i={value:H[e]});return!i||"mord"!==i.type||"f"!==i.value&&"g"!==i.value&&"h"!==i.value||(i.isFunction=!0),i}function oe(e){if(e.length<=1)return[];const t=[];for(const a in O)Object.prototype.hasOwnProperty.call(O,a)&&a.startsWith(e)&&!O[a].infix&&t.push({match:a,frequency:O[a].frequency});for(const a in N)Object.prototype.hasOwnProperty.call(N,a)&&a.startsWith(e)&&t.push({match:a,frequency:N[a].frequency});return t.sort((e,t)=>e.frequency===t.frequency?e.match.length-t.match.length:(t.frequency||0)-(e.frequency||0)),t}function re(e){let t="auto";const a=e.match(/:([^=]+)/);return a&&(t=a[1].trim()),t}function ne(e){if(!e)return[];let t=[],a=e.split("]");if("["===a[0].charAt(0)){t.push({isOptional:!0,type:re(a[0].slice(1))});for(let e=1;e<=a.length;e++)t=t.concat(ne(a[e]))}else if(a=e.split("}"),"{"===a[0].charAt(0)){t.push({isOptional:!1,type:re(a[0].slice(1))});for(let e=1;e<=a.length;e++)t=t.concat(ne(a[e]))}return t}function le(e){let t="",a=!0;return e.forEach(e=>{"string"==typeof e.body?t+=e.body:a=!1}),a?t:""}function ce(e,t,a,i=!1){"string"==typeof e&&(e=[e]);const s={tabular:i,params:ne(t),parser:a};for(const t of e)R[t]=s}function de(e,t,a){ce(e,t,a,!0)}function me(e,t,a,i,s){"string"==typeof e&&(e=[e]),a||(a={});const o={params:ne(t),mode:a.mode,infix:!!a.infix,parse:i,emit:s};e.forEach(e=>{O["\\"+e]=o})}const pe={acute:"ˊ",grave:"ˋ",dot:"˙",ddot:"¨",mathring:"˚",tilde:"~",bar:"ˉ",breve:"˘",check:"ˇ",hat:"^",vec:"⃗"};me(Object.keys(pe),"{body:auto}",null,(function(e,t){return{type:"accent",accent:pe[e.slice(1)],limits:"accent",skipBoundary:!0,body:t[0]}})),me(["widehat","widecheck","widetilde"],"{body:auto}",null,(e,t)=>{const a=le(t[0]);return{type:"accent",svgAccent:e.slice(1)+(a.length>5?"4":["1","1","2","2","3","3"][a.length]),limits:"accent",skipBoundary:!0,body:t[0]}}),me("utilde","{body:auto}",null,(e,t)=>{const a=le(t[0]),i="widetilde"+(a.length>5?"4":["1","1","2","2","3","3"][a.length]);return{type:"overunder",body:t[0],svgBelow:i,skipBoundary:!0}},(e,t,a,i)=>`\\utilde{${i(a,a.body)}}`),me("^","{:string}",{},(e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[t[0]]||"^"})),me("`","{:string}",{},(e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[t[0]]||"`"})),me("'","{:string}",{},(function(e,t){return{type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[t[0]]||"^"}})),me("~","{:string}",{},(e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[t[0]]||"´"})),me("c","{:string}",{},(e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{c:"ç",C:"Ç"}[t[0]]||""})),me("enclose","{notation:string}[style:string]{body:auto}",null,(e,t)=>{const a={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:t[2]};if(t[1]){const e=t[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const t of e){const e=t.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(e)a.strokeWidth=n(e[1],"px"),isFinite(a.strokeWidth)||(a.strokeWidth=1),a.strokeStyle=e[2],a.strokeColor=e[3];else{const e=t.match(/\s*([a-z]*)\s*=\s*"(.*)"/);e&&("mathbackground"===e[1]?a.backgroundcolor=e[2]:"mathcolor"===e[1]?a.strokeColor=e[2]:"padding"===e[1]?a.padding=n(e[2],"px"):"shadow"===e[1]&&(a.shadow=e[2]))}}"dashed"===a.strokeStyle?a.svgStrokeStyle="5,5":"dotted"===a.strokeStyle&&(a.svgStrokeStyle="1,5")}return a.borderStyle=a.strokeWidth+"px "+a.strokeStyle+" "+a.strokeColor,a.notation={},t[0].split(/[, ]/).filter(e=>e.length>0).forEach(e=>{a.notation[e.toLowerCase()]=!0}),a.notation.updiagonalarrow&&(a.notation.updiagonalstrike=!1),a.notation.box&&(a.notation.left=!1,a.notation.right=!1,a.notation.bottom=!1,a.notation.top=!1),a}),me("cancel","{body:auto}",null,(function(e,t){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:t[0]}})),me("bcancel","{body:auto}",null,(function(e,t){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:t[0]}})),me("xcancel","{body:auto}",null,(function(e,t){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:t[0]}})),ce("math","",()=>({mathstyle:"textstyle"})),ce("displaymath","",(function(){return{mathstyle:"displaystyle"}})),de("array","{columns:colspec}",(e,t)=>({colFormat:t[0],mathstyle:"textstyle"})),de(["equation","equation","subequations"],"",()=>({colFormat:[{align:"c"}]})),de("multline","",(function(){return{colFormat:[{align:"m"}]}})),de(["align","align*","aligned","eqnarray"],"",(e,t,a)=>{let i=0;for(const e of a)i=Math.max(i,e.length);const s=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({colFormat:[{align:"r"},{align:"l"}]})),de(["gather","gathered"],"",()=>({colFormat:[{gap:.25},{align:"c"},{gap:0}],jot:.3})),de(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","smallmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*","smallmatrix*"],"[columns:colspec]",(e,t)=>{var a;const i={mathstyle:"textstyle"};switch(e){case"pmatrix":case"pmatrix*":i.lFence="(",i.rFence=")";break;case"bmatrix":case"bmatrix*":i.lFence="[",i.rFence="]";break;case"Bmatrix":case"Bmatrix*":i.lFence="\\lbrace",i.rFence="\\rbrace";break;case"vmatrix":case"vmatrix*":i.lFence="\\vert",i.rFence="\\vert";break;case"Vmatrix":case"Vmatrix*":i.lFence="\\Vert",i.rFence="\\Vert";break;case"smallmatrix":case"smallmatrix*":i.mathstyle="scriptstyle";break;case"matrix":case"matrix*":i.lFence=".",i.rFence="."}return i.colFormat=null!==(a=t[0])&&void 0!==a?a:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}],i}),de("cases","",()=>({arraystretch:1.2,lFence:"\\lbrace",rFence:".",colFormat:[{align:"l"},{gap:1},{align:"l"}]})),ce("center","",(function(){return{colFormat:[{align:"c"}]}})),me(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overbrace","overlinesegment","overgroup"],"{:auto}",null,(e,t)=>({type:"overunder",body:t[0],svgAbove:e.slice(1),skipBoundary:!0,limits:"overunder"}),(e,t,a,i)=>`${e}{${i(a,a.body)}}`),me(["underrightarrow","underleftarrow","underleftrightarrow","underbrace","underlinesegment","undergroup"],"{:auto}",null,(e,t)=>({type:"overunder",body:t[0],svgBelow:e.slice(1),skipBoundary:!0,limits:"overunder"}),(e,t,a,i)=>`${e}{${i(a,a.body)}}`),me(["xrightarrow","xleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","xLeftrightarrow","xrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xrightleftarrows","xrightequilibrium","xleftequilibrium"],"[:auto]{:auto}",null,(e,t)=>({type:"overunder",mathtype:"mrel",svgBody:e.slice(1),overscript:t[1],underscript:t[0],skipBoundary:!0}),(e,t,a,i)=>e+(a.underscript?`[${i(a,a.underscript)}]`:"")+`{${i(a,a.overscript)}}`),me(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","coth","ctg","cth","cotg","csc","cosec","deg","dim","exp","hom","inf","ker","lg","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th"],"",null,(function(e){return{type:"mop",limits:"nolimits",isSymbol:!1,isFunction:!0,body:e.slice(1),variant:"main",variantStyle:"up"}})),me(["liminf","limsup"],"",null,e=>({type:"mop",limits:"limits",isSymbol:!1,body:{"\\liminf":"lim inf","\\limsup":"lim sup"}[e],variant:"main"})),me(["lim","mod"],"",null,(function(e){return{type:"mop",limits:"limits",isSymbol:!1,body:e.slice(1),variant:"main"}})),me(["det","max","min"],"",null,(function(e){return{type:"mop",limits:"limits",isSymbol:!1,isFunction:!0,body:e.slice(1),variant:"main"}})),me("sqrt","[index:auto]{radicand:auto}",null,(e,t)=>({type:"surd",body:t[1],index:t[0]}),(e,t,a,i)=>{let s="";return a.index&&(s+=`[${i(a,a.index)}]`),s+=`{${i(a,a.body)}}`,e+s}),me(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{numerator}{denominator}",null,(e,t)=>{const a={type:"genfrac",numer:t[0],denom:t[1],mathstyle:"auto"};switch(e){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":a.hasBarLine=!0;break;case"\\\\atopfrac":a.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a.hasBarLine=!1,a.leftDelim="(",a.rightDelim=")"}switch(e){case"\\dfrac":case"\\dbinom":a.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":a.mathstyle="textstyle"}return"\\cfrac"===e&&(a.continuousFraction=!0),a},(e,t,a,i)=>`${e}{${i(a,a.numer)}}{${i(a,a.denom)}}`),me(["over","atop","choose"],"",{infix:!0},(e,t)=>{const a=t[0],i=t[1];let s=!1,o=null,r=null;switch(e){case"\\atop":break;case"\\over":s=!0;break;case"\\choose":s=!1,o="(",r=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:a,denom:i,hasBarLine:s,leftDelim:o,rightDelim:r,mathstyle:"auto"}},(e,t,a,i)=>`{${i(a,a.numer)}${e} ${i(a,a.denom)}}`),me("pdiff","{numerator}{denominator}",null,(e,t)=>({type:"genfrac",numer:t[0],denom:t[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}),(e,t,a,i)=>`${e}{${i(a,a.numer)}}{${i(a,a.denom)}}`),me(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","smallint","intop"],"",null,e=>({type:"mop",limits:"auto",isSymbol:!0,variant:"main",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[e.slice(1)]}));const he={int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑",sqcup:"⊔",sqcap:"⊓",uplus:"⊎",wr:"≀",amalg:"⨿",Cap:"⋒",Cup:"⋓",doublecap:"⋒",doublecup:"⋓"};me(Object.keys(he),"",null,(function(e){return{type:"mop",limits:"nolimits",isSymbol:!0,body:he[e.slice(1)],variant:{"⋒":"ams","⋓":"ams"}[he[e.slice(1)]]}})),me(["Re","Im"],"",null,(function(e){return{type:"mop",limits:"nolimits",isSymbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[e],variant:"fraktur"}})),me("middle","{:delim}",null,(function(e,t){return{type:"delim",delim:t[0]}}));const ue={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},fe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ge=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"],ye={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};function be(e){var t;const a=e.toLowerCase().split("!");let i,s,o,r=255,n=255,l=255,c=-1;const d=a.length>0&&"-"===a[0].charAt(0);d&&(a[0]=a[0].slice(1));for(let e=0;e=0&&(r=(1-c)*r+c*i,n=(1-c)*n+c*s,l=(1-c)*l+c*o,c=-1),e+1=0&&(r=c*r+(1-c)*i,n=c*n+(1-c)*s,l=c*l+(1-c)*o),d&&(r=255-r,n=255-n,l=255-l),"#"+("00"+Math.round(r).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(l).toString(16)).slice(-2)}function ve(e){let t=e.toUpperCase();for(const e in ye)if(ye[e]===t){t=e;break}for(const e in ue)if(ue[e]===t){t=e;break}return t}me("ensuremath","{:math}",{},(e,t)=>({type:"group",mode:"math",body:t[0],skipBoundary:!0,latexOpen:"\\ensuremath{",latexClose:"}"}),(e,t,a,i)=>i(a,a.body)),me("color","{:color}",{},(e,t)=>({color:t[0]})),me("textcolor","{:color}{content:auto*}",{},(e,t)=>({color:t[0]})),me("boxed","{content:math}",null,(e,t)=>({type:"box",framecolor:"black",skipBoundary:!0,body:t[0]})),me("colorbox","{background-color:string}{content:auto}",{},(e,t)=>({type:"box",backgroundcolor:be(t[0]),skipBoundary:!0,body:t[1],verbatimBackgroundcolor:t[0]}),(e,t,a,i)=>`${e}{${a.verbatimBackgroundcolor||ve(a.backgroundcolor)}}{${i(a,a.body)}}`),me("fcolorbox","{frame-color:string}{background-color:string}{content:auto}",{},(e,t)=>({type:"box",framecolor:be(t[0]),backgroundcolor:be(t[1]),skipBoundary:!0,body:t[2],verbatimBackgroundcolor:t[1],verbatimFramecolor:t[0]}),(e,t,a,i)=>`${e}{${a.verbatimFramecolor||ve(a.framecolor)}{${a.verbatimBackgroundcolor||ve(a.backgroundcolor)}}{${i(a,a.body)}}`),me("bbox","[:bbox]{body:auto}",{},(e,t)=>{if(t[0]){const e=t[0];return{type:"box",padding:e.padding,border:e.border,backgroundcolor:e.backgroundcolor,skipBoundary:!0,body:t[1]}}return{type:"box",skipBoundary:!0,body:t[1]}},(e,t,a,i)=>{let s=e;if(isFinite(a.padding)||void 0!==a.border||void 0!==a.backgroundcolor){const e=[];isFinite(a.padding)&&e.push(Math.floor(100*a.padding)/100+"em"),a.border&&e.push("border:"+a.border),a.backgroundcolor&&e.push(ve(a.backgroundcolor)),s+=`[${e.join(",")}]`}return s+`{${i(a,a.body)}}`}),me(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{},(e,t)=>({fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[e.slice(1)]})),me("fontseries","{:string}",{mode:"text"},(e,t)=>({fontSeries:t[0]})),me("fontshape","{:string}",{mode:"text"},(e,t)=>({fontShape:t[0]})),me("fontfamily","{:string}",{mode:"text"},(e,t)=>({fontFamily:t[0]})),me("selectfont","",{mode:"text"},(e,t)=>({})),me("bf","",{},(e,t)=>({fontSeries:"b",fontShape:"n",fontFamily:"cmr"})),me(["boldsymbol","bm"],"{:math*}",{},(e,t)=>({mode:"math",cssClass:"ML__boldsymbol"})),me("bold","{:math*}",{},(e,t)=>({mode:"math",variantStyle:"bold"})),me("bfseries","",{mode:"text"},(e,t)=>({fontSeries:"b"})),me("mdseries","",{mode:"text"},(e,t)=>({fontSeries:"m"})),me("upshape","",{mode:"text"},(e,t)=>({fontShape:"n"})),me("slshape","",{mode:"text"},(e,t)=>({fontShape:"sl"})),me("scshape","",{mode:"text"},(e,t)=>({fontShape:"sc"})),me("textbf","{:text*}",{},(e,t)=>({mode:"text",fontSeries:"b"})),me("textmd","{:text*}",{},(e,t)=>({mode:"text",fontSeries:"m"})),me("textup","{:text*}",{},(e,t)=>({mode:"text",fontShape:"n"})),me("textnormal","{:text*}",{},(e,t)=>({mode:"text",fontShape:"n",fontSeries:"m"})),me("textsl","{:text*}",{},(e,t)=>({mode:"text",fontShape:"sl"})),me("textit","{:text*}",{},(e,t)=>({mode:"text",fontShape:"it"})),me("textsc","{:text*}",{},(e,t)=>({mode:"text",fontShape:"sc"})),me("textrm","{:text*}",{},(e,t)=>({mode:"text",fontFamily:"roman"})),me("textsf","{:text*}",{},(e,t)=>({mode:"text",fontFamily:"sans-serif"})),me("texttt","{:text*}",{},(e,t)=>({mode:"text",fontFamily:"monospace"})),me("mathbf","{:math*}",{},(e,t)=>({mode:"math",variant:"normal",variantStyle:"bold"})),me("mathit","{:math*}",{},(e,t)=>({mode:"math",variant:"normal",variantStyle:"italic"})),me("mathbfit","{:math*}",{},(e,t)=>({mode:"math",variant:"normal",variantStyle:"bolditalic"})),me("mathrm","{:math*}",{},(e,t)=>({mode:"math",variant:"normal",variantStyle:"up"})),me("mathsf","{:math*}",{},(e,t)=>({mode:"math",variant:"sans-serif",variantStyle:"up"})),me("mathtt","{:math*}",{},(e,t)=>({mode:"math",variant:"monospace",variantStyle:"up"})),me("it","",{},(e,t)=>({fontSeries:"m",fontShape:"it",fontFamily:"cmr",variantStyle:"italic"})),me("rmfamily","",{},(e,t)=>({fontFamily:"roman"})),me("sffamily","",{},(e,t)=>({fontFamily:"sans-serif"})),me("ttfamily","",{},(e,t)=>({fontFamily:"monospace"})),me(["Bbb","mathbb"],"{:math*}",{},(e,t)=>({variant:"double-struck",variantStyle:"up"})),me(["frak","mathfrak"],"{:math*}",{},(e,t)=>({variant:"fraktur",variantStyle:"up"})),me("mathcal","{:math*}",{},(e,t)=>({variant:"calligraphic",variantStyle:"up"})),me("mathscr","{:math*}",{},(e,t)=>({variant:"script",variantStyle:"up"})),me("mbox","{:text}",null,(e,t)=>({type:"group",mode:"math",body:t[0]})),me("text","{:text*}",null,(e,t)=>({mode:"text"})),me("class","{name:string}{content:auto*}",null,(e,t)=>({cssClass:t[0]})),me("cssId","{id:string}{content:auto}",null,(e,t)=>({type:"group",body:t[1],cssId:t[0]})),me("em","",null,(e,t)=>({cssClass:"ML__emph"})),me("emph","{:auto}",null,(e,t)=>({cssClass:"ML__emph",body:t[0],type:"group",skipBoundary:!0}));const xe={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function ke(e,t,a,i,s,o=""){const r=T(e,D("Size"+a+"-Regular",te("math",t),"delimsizing size"+a),s.mathstyle,c.textstyle,o);return i&&r.setTop((1-s.mathstyle.sizeMultiplier)*s.mathstyle.metrics.axisHeight),r.setStyle("color",s.color),"number"==typeof s.opacity&&r.setStyle("opacity",s.opacity),r}function we(e,t){let a="";return"Size1-Regular"===t?a=" delim-size1":"Size4-Regular"===t&&(a=" delim-size4"),D(t,te("math",e),"delimsizinginner"+a)}function Se(e,t,a,i,s,r=""){let n,l,d,m;n=d=m=te("math",t),l=null;let p="Size1-Regular";"\\vert"===t||"\\lvert"===t||"\\rvert"===t||"\\mvert"===t||"\\mid"===t?d=n=m="∣":"\\Vert"===t||"\\lVert"===t||"\\rVert"===t||"\\mVert"===t||"\\|"===t?d=n=m="∥":"\\uparrow"===t?d=m="⏐":"\\Uparrow"===t?d=m="‖":"\\downarrow"===t?n=d="⏐":"\\Downarrow"===t?n=d="‖":"\\updownarrow"===t?(n="↑",d="⏐",m="↓"):"\\Updownarrow"===t?(n="⇑",d="‖",m="⇓"):"["===t||"\\lbrack"===t?(n="⎡",d="⎢",m="⎣",p="Size4-Regular"):"]"===t||"\\rbrack"===t?(n="⎤",d="⎥",m="⎦",p="Size4-Regular"):"\\lfloor"===t?(d=n="⎢",m="⎣",p="Size4-Regular"):"\\lceil"===t?(n="⎡",d=m="⎢",p="Size4-Regular"):"\\rfloor"===t?(d=n="⎥",m="⎦",p="Size4-Regular"):"\\rceil"===t?(n="⎤",d=m="⎥",p="Size4-Regular"):"("===t?(n="⎛",d="⎜",m="⎝",p="Size4-Regular"):")"===t?(n="⎞",d="⎟",m="⎠",p="Size4-Regular"):"\\{"===t||"\\lbrace"===t?(n="⎧",l="⎨",m="⎩",d="⎪",p="Size4-Regular"):"\\}"===t||"\\rbrace"===t?(n="⎫",l="⎬",m="⎭",d="⎪",p="Size4-Regular"):"\\lgroup"===t?(n="⎧",m="⎩",d="⎪",p="Size4-Regular"):"\\rgroup"===t?(n="⎫",m="⎭",d="⎪",p="Size4-Regular"):"\\lmoustache"===t?(n="⎧",m="⎭",d="⎪",p="Size4-Regular"):"\\rmoustache"===t?(n="⎫",m="⎩",d="⎪",p="Size4-Regular"):"\\surd"===t?(n="",m="⎷",d="",p="Size4-Regular"):"\\ulcorner"===t?(n="┌",d=m=" "):"\\urcorner"===t?(n="┐",d=m=" "):"\\llcorner"===t?(m="└",d=n=" "):"\\lrcorner"===t&&(n="┘",d=n=" ");const h=o(te("math",n),p),u=h.height+h.depth,f=o(te("math",d),p),g=f.height+f.depth,y=o(te("math",m),p),b=y.height+y.depth;let v=0,x=1;if(null!==l){const e=o(te("math",l),p);v=e.height+e.depth,x=2}const k=u+b+v,w=Math.ceil((a-k)/(x*g)),S=k+w*x*g;let M=s.mathstyle.metrics.axisHeight;i&&(M*=s.mathstyle.sizeMultiplier);const L=S/2-M,C=[];if(C.push(we(m,p)),null===l)for(let e=0;e{const a={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[e],body:t[0],captureSelection:!0};return"\\mathop"===e&&(a.limits="limits",a.isFunction=!0),a},(e,t,a,i)=>`${e}{${i(a,a.body)}}`),me(["operatorname","operatorname*"],"{operator:math}",null,(function(e,t){const a={type:"mop",captureSelection:!0,body:t[0],isFunction:!0};return a.body.forEach(e=>{e.isFunction=!1,e.variant||e.variantStyle||(e.variant="main",e.variantStyle="up"),e.type="mord",e.body={"∗":"*","−":"-"}[e.body]||e.body}),"\\operatorname"===e?a.limits="nolimits":"\\operatorname*"===e&&(a.limits="limits"),a})),me("unicode","{charcode:number}",null,(e,t)=>{let a=parseInt(t[0]);return isFinite(a)||(a=10067),{type:"mord",body:String.fromCodePoint(a),codepoint:a}},(e,t,a,i)=>`${e}{"${("000000"+a.codepoint.toString(16)).toUpperCase().substr(-6)}}`),me("rule","[raise:dimen]{width:dimen}{thickness:dimen}",null,(function(e,t){return{type:"rule",shift:t[0],width:t[1],height:t[2]}})),me("overline","{:auto}",null,(e,t)=>({type:"line",position:"overline",skipBoundary:!0,body:t[0]})),me("underline","{:auto}",null,(e,t)=>({type:"line",position:"underline",skipBoundary:!0,body:t[0]})),me("overset","{annotation:auto}{symbol:auto}",null,(function(e,t){return{type:"overunder",overscript:t[0],skipBoundary:!0,body:t[1]}}),(e,t,a,i)=>`${e}{${i(a,a.overscript)}}{${i(a,a.body)}}`),me("underset","{annotation:auto}{symbol:auto}",null,(function(e,t){return{type:"overunder",underscript:t[0],skipBoundary:!0,body:t[1]}}),(e,t,a,i)=>`${e}{${i(a,a.overscript)}}{${i(a,a.body)}}`),me(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0},(function(e,t){return{type:"genfrac",numer:t[0],denom:t[1],hasBarLine:!1,leftDelim:t[2],rightDelim:t[3],mathstyle:"auto"}}),(e,t,a,i)=>`${i(a,a.numer)} ${e}${a.leftDelim}${a.rightDelim}${i(a,a.denom)}`),me(["stackrel","stackbin"],"{annotation:auto}{symbol:auto}",null,(function(e,t){return{type:"overunder",overscript:t[0],skipBoundary:!0,body:t[1],mathtype:"\\stackrel"===e?"mrel":"mbin"}}),(e,t,a,i)=>`${e}{${i(a,a.overscript)}}{${i(a,a.body)}}`),me("rlap","{:auto}",null,(function(e,t){return{type:"overlap",align:"right",skipBoundary:!0,body:t[0]}})),me("llap","{:auto}",null,(function(e,t){return{type:"overlap",align:"left",skipBoundary:!0,body:t[0]}})),me("mathrlap","{:auto}",null,(function(e,t){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:t[0]}})),me("mathllap","{:auto}",null,(function(e,t){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:t[0]}})),function(e){for(let e=0;e<"0123456789/@.?!".length;e++){const t="0123456789/@.?!".charAt(e);j(t,t)}}(),G(65,90),G(97,122),j("\\forall","∀"),j("\\exists","∃"),j("\\nexists","∄","mord","ams"),j("\\mid","∣","mrel"),j("\\top","⊤"),j("\\bot","⊥"),j("\\sharp","♯"),j("\\flat","♭"),j("\\natural","♮"),j("\\#","#"),j("\\&","&"),j("\\clubsuit","♣"),j("\\heartsuit","♡"),j("\\spadesuit","♠"),j("\\diamondsuit","♢"),j("\\differencedelta","∆","mrel"),j("\\backslash","\\"),j("\\nabla","∇"),j("\\partial","∂"),j("\\ell","ℓ"),j("\\hbar","ℏ"),j("\\hslash","ℏ","mord","ams"),j("\\Finv","Ⅎ","mord","ams"),j("\\Game","⅁","mord","ams"),j("\\wp","℘"),j("\\eth","ð","mord","ams"),j("\\mho","℧","mord","ams"),j("\\Bbbk","k","mord","ams"),j("\\N","N","mord","double-struck"),j("\\R","R","mord","double-struck"),j("\\Q","Q","mord","double-struck"),j("\\C","C","mord","double-struck"),j("\\Z","Z","mord","double-struck"),j("\\P","P","mord","double-struck"),j("\\pounds","£"),j("\\yen","¥","mord","ams"),j("\\euro","€"),j("\\dagger","†","mbin"),j("\\dag","†","mbin"),j("\\ddag","‡","mbin"),j("\\ddagger","‡","mbin"),j("\\maltese","✠","mord","ams"),j("\\rightarrow","→","mrel"),j("\\to","→","mrel"),j("\\leftarrow","←","mrel"),j("\\gets","←","mrel"),j("\\Rightarrow","⇒","mrel"),j("\\Leftarrow","⇐","mrel"),j("\\longrightarrow","⟶","mrel"),j("\\longleftarrow","⟵","mrel"),j("\\Longrightarrow","⟹","mrel"),j("\\implies","⟹","mrel"),j("\\Longleftarrow","⟸","mrel"),j("\\impliedby","⟸","mrel"),j("\\dashrightarrow","⇢","mrel","ams"),j("\\dashleftarrow","⇠","mrel","ams"),j("\\Rrightarrow","⇛","mrel","ams"),j("\\Lleftarrow","⇚","mrel","ams"),j("\\longleftrightarrow","⟷","mrel"),j("\\biconditional","⟷","mrel"),j("\\Longleftrightarrow","⟺","mrel"),j("\\leftrightarrows","⇆","mrel","ams"),j("\\rightleftarrows","⇄","mrel","ams"),j("\\mapsto","↦","mrel"),j("\\longmapsto","⟼","mrel"),j("\\uparrow","↑","mrel"),j("\\downarrow","↓","mrel"),j("\\Uparrow","⇑","mrel"),j("\\Downarrow","⇓","mrel"),j("\\updownarrow","↕","mrel"),j("\\Updownarrow","⇕","mrel"),j("\\curvearrowright","↷","mrel","ams"),j("\\curvearrowleft","↶","mrel","ams"),j("\\hookrightarrow","↪","mrel"),j("\\hookleftarrow","↩","mrel"),j("\\rightharpoonup","⇀","mrel"),j("\\leftharpoonup","↼","mrel"),j("\\rightharpoondown","⇁","mrel"),j("\\leftharpoondown","↽","mrel"),j("\\rightrightarrows","⇉","mrel","ams"),j("\\leftleftarrows","⇇","mrel","ams"),j("\\upuparrows","⇈","mrel","ams"),j("\\downdownarrows","⇊","mrel","ams"),j("\\leftarrowtail","↢","mrel","ams"),j("\\rightarrowtail","↣","mrel","ams"),j("\\looparrowright","↬","mrel","ams"),j("\\looparrowleft","↫","mrel","ams"),j("\\twoheadleftarrow","↞","mrel","ams"),j("\\twoheadrightarrow","↠","mrel","ams"),j("\\rightleftharpoons","⇌","mrel"),j("\\leftrightharpoons","⇋","mrel","ams"),j("\\Rsh","↱","mrel","ams"),j("\\Lsh","↰","mrel","ams"),j("\\searrow","↘","mrel"),j("\\nearrow","↗","mrel"),j("\\swarrow","↙","mrel"),j("\\nwarrow","↖","mrel"),j("\\circlearrowright","↻","mrel","ams"),j("\\circlearrowleft","↺","mrel","ams"),j("\\restriction","↾","mrel","ams"),j("\\upharpoonright","↾","mrel","ams"),j("\\upharpoonleft","↿","mrel","ams"),j("\\downharpoonright","⇂","mrel","ams"),j("\\downharpoonleft","⇃","mrel","ams"),j("\\rightsquigarrow","⇝","mrel","ams"),j("\\leadsto","⇝","mrel","ams"),j("\\leftrightsquigarrow","↭","mrel","ams"),j("\\originalof","⊶","mrel"),j("\\imageof","⊷","mrel"),j("\\multimap","⊸","mrel","ams"),j("\\nrightarrow","↛","mrel","ams"),j("\\nleftarrow","↚","mrel","ams"),j("\\nRightarrow","⇏","mrel","ams"),j("\\nLeftarrow","⇍","mrel","ams"),j("\\nleftrightarrow","↮","mrel","ams"),j("\\nLeftrightarrow","⇎","mrel","ams"),j("\\nless","≮","mrel","ams"),j("\\nleqslant","","mrel","ams"),j("\\lneq","⪇","mrel","ams"),j("\\lneqq","≨","mrel","ams"),j("\\nleqq","","mrel","ams"),j("\\unlhd","⊴","mbin","ams"),j("\\unrhd","⊵","mbin","ams"),j("\\lvertneqq","","mrel","ams"),j("\\lnsim","⋦","mrel","ams"),j("\\lnapprox","⪉","mrel","ams"),j("\\nprec","⊀","mrel","ams"),j("\\npreceq","⋠","mrel","ams"),j("\\precnsim","⋨","mrel","ams"),j("\\precnapprox","⪹","mrel","ams"),j("\\nsim","≁","mrel","ams"),j("\\nshortmid","","mrel","ams"),j("\\nmid","∤","mrel","ams"),j("\\nvdash","⊬","mrel","ams"),j("\\nvDash","⊭","mrel","ams"),j("\\ngtr","≯","mrel","ams"),j("\\ngeqslant","","mrel","ams"),j("\\ngeqq","","mrel","ams"),j("\\gneq","⪈","mrel","ams"),j("\\gneqq","≩","mrel","ams"),j("\\gvertneqq","","mrel","ams"),j("\\gnsim","⋧","mrel","ams"),j("\\gnapprox","⪊","mrel","ams"),j("\\nsucc","⊁","mrel","ams"),j("\\nsucceq","⋡","mrel","ams"),j("\\succnsim","⋩","mrel","ams"),j("\\succnapprox","⪺","mrel","ams"),j("\\ncong","≆","mrel","ams"),j("\\nshortparallel","","mrel","ams"),j("\\nparallel","∦","mrel","ams"),j("\\nVDash","⊯","mrel","ams"),j("\\nsupseteqq","","mrel","ams"),j("\\supsetneq","⊋","mrel","ams"),j("\\varsupsetneq","","mrel","ams"),j("\\supsetneqq","⫌","mrel","ams"),j("\\varsupsetneqq","","mrel","ams"),j("\\nVdash","⊮","mrel","ams"),j("\\precneqq","⪵","mrel","ams"),j("\\succneqq","⪶","mrel","ams"),j("\\nsubseteqq","","mrel","ams"),j("\\checkmark","✓","mord","ams"),j("\\diagup","╱","mord","ams"),j("\\diagdown","╲","mord","ams"),j("\\measuredangle","∡","mord","ams"),j("\\sphericalangle","∢","mord","ams"),j("\\backprime","‵","mord","ams"),j("\\backdoubleprime","‶","mord","ams"),j("\\ast","∗","mbin"),j("\\star","⋆","mbin"),j("\\diamond","⋄","mbin"),j("\\Diamond","◊","mord","ams"),j("\\lozenge","◊","mord","ams"),j("\\blacklozenge","⧫","mord","ams"),j("\\bigstar","★","mord","ams"),j("\\aleph","ℵ"),j("\\beth","ℶ","mord","ams"),j("\\daleth","ℸ","mord","ams"),j("\\gimel","ℷ","mord","ams"),j("\\lbrace","{","mopen"),j("\\rbrace","}","mclose"),j("\\langle","⟨","mopen"),j("\\rangle","⟩","mclose"),j("\\lfloor","⌊","mopen"),j("\\rfloor","⌋","mclose"),j("\\lceil","⌈","mopen"),j("\\rceil","⌉","mclose"),j("\\vert","∣"),j("\\mvert","∣","mrel"),j("\\lvert","∣","mopen"),j("\\rvert","∣","mclose"),j("\\|","∥"),j("\\Vert","∥"),j("\\mVert","∥"),j("\\lVert","∥","mopen"),j("\\rVert","∥","mclose"),j("\\parallel","∥","mrel"),j("\\shortparallel","∥","mrel","ams"),j("\\lbrack","[","mopen"),j("\\rbrack","]","mclose"),j("\\{","{","mopen"),j("\\}","}","mclose"),j("(","(","mopen"),j(")",")","mclose"),j("[","[","mopen"),j("]","]","mclose"),j("\\ulcorner","┌","mopen","ams"),j("\\urcorner","┐","mclose","ams"),j("\\llcorner","└","mopen","ams"),j("\\lrcorner","┘","mclose","ams"),j("\\lgroup","⟮","mopen"),j("\\rgroup","⟯","mclose"),j("\\lmoustache","⎰","mopen"),j("\\rmoustache","⎱","mclose"),j("=","=","mrel"),j("\\ne","≠","mrel"),j("\\neq","≠","mrel"),j("<","<","mrel"),j("\\lt","<","mrel"),j(">",">","mrel"),j("\\gt",">","mrel"),j("\\le","≤","mrel"),j("\\leq","≤","mrel"),j("\\ge","≥","mrel"),j("\\geq","≥","mrel"),j("\\leqslant","⩽","mrel","ams"),j("\\geqslant","⩾","mrel","ams"),j("\\ll","≪","mrel"),j("\\gg","≫","mrel"),j("\\coloneq","≔","mrel"),j("\\measeq","≝","mrel"),j("\\eqdef","≞","mrel"),j("\\questeq","≟","mrel"),j(":",":","mrel"),j("\\cong","≅","mrel"),j("\\equiv","≡","mrel"),j("\\prec","≺","mrel"),j("\\preceq","⪯","mrel"),j("\\succ","≻","mrel"),j("\\succeq","⪰","mrel"),j("\\perp","⊥","mrel"),j("\\propto","∝","mrel"),j("\\Colon","∷","mrel"),j("\\smile","⌣","mrel"),j("\\frown","⌢","mrel"),j("\\sim","∼","mrel"),j("\\gtrsim","≳","mrel","ams"),j("\\approx","≈","mrel"),j("\\approxeq","≊","mrel","ams"),j("\\thickapprox","≈","mrel","ams"),j("\\lessapprox","⪅","mrel","ams"),j("\\gtrapprox","⪆","mrel","ams"),j("\\precapprox","⪷","mrel","ams"),j("\\succapprox","⪸","mrel","ams"),j("\\thicksim","∼","mrel","ams"),j("\\succsim","≿","mrel","ams"),j("\\precsim","≾","mrel","ams"),j("\\backsim","∽","mrel","ams"),j("\\eqsim","≂","mrel","ams"),j("\\backsimeq","⋍","mrel","ams"),j("\\simeq","≃","mrel"),j("\\lesssim","≲","mrel","ams"),j("\\nleq","≰","mrel","ams"),j("\\ngeq","≱","mrel","ams"),j("\\smallsmile","⌣","mrel","ams"),j("\\smallfrown","⌢","mrel","ams"),j("\\bowtie","⋈","mrel"),j("\\Join","⋈","mrel"),j("\\asymp","≍","mrel"),j("\\sqsubseteq","⊑","mrel"),j("\\sqsupseteq","⊒","mrel"),j("\\leqq","≦","mrel","ams"),j("\\eqslantless","⪕","mrel","ams"),j("\\lll","⋘","mrel","ams"),j("\\lessgtr","≶","mrel","ams"),j("\\lesseqgtr","⋚","mrel","ams"),j("\\lesseqqgtr","⪋","mrel","ams"),j("\\risingdotseq","≓","mrel","ams"),j("\\fallingdotseq","≒","mrel","ams"),j("\\subseteqq","⫅","mrel","ams"),j("\\Subset","⋐","mrel","ams"),j("\\sqsubset","⊏","mrel","ams"),j("\\preccurlyeq","≼","mrel","ams"),j("\\curlyeqprec","⋞","mrel","ams"),j("\\vDash","⊨","mrel","ams"),j("\\Vvdash","⊪","mrel","ams"),j("\\bumpeq","≏","mrel","ams"),j("\\Bumpeq","≎","mrel","ams"),j("\\geqq","≧","mrel","ams"),j("\\eqslantgtr","⪖","mrel","ams"),j("\\ggg","⋙","mrel","ams"),j("\\gtrless","≷","mrel","ams"),j("\\gtreqless","⋛","mrel","ams"),j("\\gtreqqless","⪌","mrel","ams"),j("\\supseteqq","⫆","mrel","ams"),j("\\Supset","⋑","mrel","ams"),j("\\sqsupset","⊐","mrel","ams"),j("\\succcurlyeq","≽","mrel","ams"),j("\\curlyeqsucc","⋟","mrel","ams"),j("\\Vdash","⊩","mrel","ams"),j("\\shortmid","∣","mrel","ams"),j("\\between","≬","mrel","ams"),j("\\pitchfork","⋔","mrel","ams"),j("\\varpropto","∝","mrel","ams"),j("\\backepsilon","∍","mrel","ams"),j("\\llless","⋘","mrel","ams"),j("\\gggtr","⋙","mrel","ams"),j("\\lhd","⊲","mbin","ams"),j("\\rhd","⊳","mbin","ams"),j("\\doteq","≐","mrel"),j("\\doteqdot","≑","mrel","ams"),j("\\Doteq","≑","mrel","ams"),j("\\eqcirc","≖","mrel","ams"),j("\\circeq","≗","mrel","ams"),j("\\lessdot","⋖","mbin","ams"),j("\\gtrdot","⋗","mbin","ams"),j("\\~","~","mrel"),j("\\leftrightarrow","↔","mrel"),j("\\Leftrightarrow","⇔","mrel"),j("\\models","⊨","mrel"),j("\\vdash","⊢","mrel"),j("\\therefore","∴","mrel","ams"),j("\\because","∵","mrel","ams"),j("\\dashv","⊣","mrel"),j("\\roundimplies","⥰","mrel"),j("+","+","mbin"),j("-","−","mbin"),j("−","−","mbin"),j("\\pm","±","mbin"),j("\\mp","∓","mbin"),j("*","∗","mbin"),j("\\times","×","mbin"),j("\\div","÷","mbin"),j("\\surd","√"),j("\\divides","∣","mbin"),j("\\ltimes","⋉","mbin","ams"),j("\\rtimes","⋊","mbin","ams"),j("\\leftthreetimes","⋋","mbin","ams"),j("\\rightthreetimes","⋌","mbin","ams"),j("\\intercal","⊺","mbin","ams"),j("\\dotplus","∔","mbin","ams"),j("\\doublebarwedge","⩞","mbin","ams"),j("\\divideontimes","⋇","mbin","ams"),j("\\centerdot","⋅","mbin","ams"),j("\\cdot","⋅","mbin"),j("\\infty","∞"),j("\\prime","′"),j("\\doubleprime","″"),j("\\angle","∠"),j("`","‘"),j("\\$","$"),j("\\%","%"),j("\\_","_"),j("\\alpha","α"),j("\\beta","β"),j("\\gamma","γ"),j("\\delta","δ"),j("\\epsilon","ϵ"),j("\\varepsilon","ε"),j("\\zeta","ζ"),j("\\eta","η"),j("\\theta","θ"),j("\\vartheta","ϑ"),j("\\iota","ι"),j("\\kappa","κ"),j("\\varkappa","ϰ","mord","ams"),j("\\lambda","λ"),j("\\mu","μ"),j("\\nu","ν"),j("\\xi","ξ"),j("\\omicron","o"),j("\\pi","π"),j("\\varpi","ϖ"),j("\\rho","ρ"),j("\\varrho","ϱ"),j("\\sigma","σ"),j("\\varsigma","ς"),j("\\tau","τ"),j("\\phi","ϕ"),j("\\varphi","φ"),j("\\upsilon","υ"),j("\\chi","χ"),j("\\psi","ψ"),j("\\omega","ω"),j("\\Gamma","Γ"),j("\\Delta","Δ"),j("\\Theta","Θ"),j("\\Lambda","Λ"),j("\\Xi","Ξ"),j("\\Pi","Π"),j("\\Sigma","Σ"),j("\\Upsilon","Υ"),j("\\Phi","Φ"),j("\\Psi","Ψ"),j("\\Omega","Ω"),j("\\digamma","ϝ","mord","ams"),j("\\emptyset","∅"),j("\\varnothing","∅","mord","ams"),j("\\cap","∩","mbin"),j("\\cup","∪","mbin"),j("\\setminus","∖","mbin"),j("\\smallsetminus","∖","mbin","ams"),j("\\complement","∁","mord","ams"),j("\\in","∈","mrel"),j("\\notin","∉","mrel"),j("\\not","̸","mrel"),j("\\ni","∋","mrel"),j("\\owns","∋","mrel"),j("\\subset","⊂","mrel"),j("\\supset","⊃","mrel"),j("\\subseteq","⊆","mrel"),j("\\supseteq","⊇","mrel"),j("\\subsetneq","⊊","mrel","ams"),j("\\varsubsetneq","","mrel","ams"),j("\\subsetneqq","⫋","mrel","ams"),j("\\varsubsetneqq","","mrel","ams"),j("\\nsubset","⊄","mrel","ams"),j("\\nsupset","⊅","mrel","ams"),j("\\nsubseteq","⊈","mrel","ams"),j("\\nsupseteq","⊉","mrel","ams"),j("\\ "," ","spacing"),j("~"," ","spacing"),j("\\space"," ","spacing"),j("\\!",null,"spacing"),j("\\,",null,"spacing"),j("\\:",null,"spacing"),j("\\;",null,"spacing"),j("\\enskip",null,"spacing"),j("\\enspace",null,"spacing"),j("\\quad",null,"spacing"),j("\\qquad",null,"spacing"),j("\\colon",":","mpunct"),j("\\cdotp","⋅","mpunct"),j("\\cdots","⋯","minner"),j("\\ddots","⋱","minner"),j("\\ldots","…","minner"),j("\\mathellipsis","…","minner"),j("\\vdots","⋮"),j("\\ldotp",".","mpunct"),j(",",",","mpunct"),j(";",";","mpunct"),j("\\land","∧","mbin"),j("\\wedge","∧","mbin"),j("\\lor","∨","mbin"),j("\\vee","∨","mbin"),j("\\lnot","¬"),j("\\neg","¬"),j("\\barwedge","⊼","mbin","ams"),j("\\veebar","⊻","mbin","ams"),j("\\nor","⊻","mbin","ams"),j("\\curlywedge","⋏","mbin","ams"),j("\\curlyvee","⋎","mbin","ams"),j("\\square","□","mord","ams"),j("\\Box","□","mord","ams"),j("\\blacksquare","■","mord","ams"),j("\\boxminus","⊟","mbin","ams"),j("\\boxplus","⊞","mbin","ams"),j("\\boxtimes","⊠","mbin","ams"),j("\\boxdot","⊡","mbin","ams"),j("\\circ","∘","mbin"),j("\\bigcirc","◯","mbin"),j("\\bullet","∙","mbin"),j("\\circleddash","⊝","mbin","ams"),j("\\circledast","⊛","mbin","ams"),j("\\oplus","⊕","mbin"),j("\\ominus","⊖","mbin"),j("\\otimes","⊗","mbin"),j("\\odot","⊙","mbin"),j("\\circledcirc","⊚","mbin","ams"),j("\\oslash","⊘","mbin"),j("\\circledS","Ⓢ","mord","ams"),j("\\circledR","®","mord","ams"),j("\\triangle","△"),j("\\bigtriangleup","△","mbin"),j("\\vartriangle","△","mrel","ams"),j("\\triangleq","≜","mrel","ams"),j("\\triangledown","▽","mord","ams"),j("\\bigtriangledown","▽","mbin"),j("\\triangleleft","◃","mbin"),j("\\vartriangleleft","⊲","mrel","ams"),j("\\trianglelefteq","⊴","mrel","ams"),j("\\ntriangleleft","⋪","mrel","ams"),j("\\ntrianglelefteq","⋬","mrel","ams"),j("\\triangleright","▹","mbin"),j("\\vartriangleright","⊳","mrel","ams"),j("\\trianglerighteq","⊵","mrel","ams"),j("\\ntriangleright","⋫","mrel","ams"),j("\\ntrianglerighteq","⋭","mrel","ams"),j("\\blacktriangle","▲","mord","ams"),j("\\blacktriangledown","▼","mord","ams"),j("\\blacktriangleleft","◀","mrel","ams"),j("\\blacktriangleright","▶","mrel","ams"),j("\\/","/"),j("|","∣","textord"),j("\\And","&","mbin"),j("\\imath","ı"),j("\\jmath","ȷ"),j("\\degree","°"),j("'","′"),j('"',"”");const Me=["(",")","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd"],Le=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache"],Ce=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Ae=[0,1.2,1.8,2.4,3],$e=[{type:"small",mathstyle:c.scriptscriptstyle},{type:"small",mathstyle:c.scriptstyle},{type:"small",mathstyle:c.textstyle},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],ze=[{type:"small",mathstyle:c.scriptscriptstyle},{type:"small",mathstyle:c.scriptstyle},{type:"small",mathstyle:c.textstyle},{type:"stack"}],_e=[{type:"small",mathstyle:c.scriptscriptstyle},{type:"small",mathstyle:c.scriptstyle},{type:"small",mathstyle:c.textstyle},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function De(e,t,a,i,s,r=""){if(!t||0===t.length||"."===t)return Te(e,s,e);let n;"<"===t||"\\lt"===t?t="\\langle":">"!==t&&"\\gt"!==t||(t="\\rangle"),n=Ce.includes(t)?$e:Me.includes(t)?_e:ze;const l=function(e,t,a,i){for(let r=Math.min(2,3-i.mathstyle.size);rt)return a[r]}var s;return a[a.length-1]}(te("math",t),a,n,s);return"small"===l.type?function(e,t,a,i,s,o=""){const r=T(e,D("Main-Regular",te("math",t)),s.mathstyle,a,o);return i&&r.setTop((1-s.mathstyle.sizeMultiplier/a.sizeMultiplier)*s.mathstyle.metrics.axisHeight),r.setStyle("color",s.color),"number"==typeof s.opacity&&r.setStyle("opacity",s.opacity),r}(e,t,l.mathstyle,i,s,"ML__small-delim "+r):"large"===l.type?ke(e,t,l.size,i,s,r):Se(e,t,a,i,s,r)}function qe(e,t,a,i,s,o=""){if("."===t)return Te(e,s,o);const r=s.mathstyle.metrics.axisHeight*s.mathstyle.sizeMultiplier,n=Math.max(a-r,i+r);return De(e,t,Math.max(n/500*901,2*n-.5),!0,s,o)}function Te(e,t,a){return _("","sizing"+t.mathstyle.adjustTo(c.textstyle)+" nulldelimiter "+(a||""),e)}const Ke={},Ee={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};function Fe(e,t){Ke[e]={decompose:t}}function Ne(t,a){var i,s;function o(e){return"mord"===e.type&&!!e.symbol&&/^[0-9,.]$/.test(e.symbol)}function r(e){return"text"===e.mode}const n=t instanceof d?t:new d(t),l=!n.atomIdsSettings||!n.atomIdsSettings.groupNumbers;let c=[];if(e(a)){if(0===a.length)return[];if(1===a.length)c=a[0].decompose(n),c&&l&&a[0].isSelected&&c.forEach(e=>e.selected(!0));else{let e="none",t=a[1].type,d=[],m="",p=!0,h=null;for(let u=0;ue.selected(!0))):(d.length>0&&(c=[...c,...d],d=[]),c=c.concat(e))}e=a[u].getFinalBaseElement().type,t=a[u+1]?a[u+1].getInitialBaseElement().type:"none"}d.length>0&&(c=[...c,...d],d=[])}}else a&&(c=a.decompose(n),c&&l&&a.isSelected&&c.forEach(e=>e.selected(!0)));if(!c||0===c.length)return null;if(n.mathstyle!==n.parentMathstyle){const e=n.mathstyle.sizeMultiplier/n.parentMathstyle.sizeMultiplier;for(const t of c)t.height*=e,t.depth*=e}if(n.size!==n.parentSize){const e=Ee[n.size]/Ee[n.parentSize];for(const t of c)t.height*=e,t.depth*=e}return c}class Be{constructor(e,t,a="",i={}){this.mode=e,this.type=t,this.body=a,this.applyStyle(i)}toLatex(t=!1){return function(t,a){if(!(a=void 0!==a&&a)&&t.latex)return t.latex;let i="",s=0,o=0,r=0;const n=t.symbol,l=(t,i)=>function(t,a,i){let s="";return e(a)?s=function(e,t,a){if(0===t.length)return"";if("first"===t[0].type){if(1===t.length)return"";t=t.slice(1)}return 0===t.length?"":u(f(t,"cssClass").map(t=>{const i=u(f(t,"color").map(t=>u(function(e){const t=[];let a=[],i="NONE";return e.forEach(e=>{"first"!==e.type&&(e.mode!==i?(a.length>0&&t.push(a),a=[e],i=e.mode):a.push(e))}),a.length>0&&t.push(a),t}(t).map(t=>function(e,t,a){return g[t[0].mode]&&g[t[0].mode].emitLatexRun?g[t[0].mode].emitLatexRun(e,t,a):""}(e,t,a)))));return!t[0].cssClass||e&&e.cssClass===t[0].cssClass?i:"ML__boldsymbol"===t[0].cssClass?"\\boldsymbol{"+i+"}":"ML__emph"===t[0].cssClass?"\\emph{"+i+"}":"\\class{"+t[0].cssClass+"}{"+i+"}"}))}(t,a,i):"number"==typeof a||"boolean"==typeof a?s=a.toString():"string"==typeof a?s=a.replace(/\s/g,"~"):a&&"function"==typeof a.toLatex&&(s=a.toLatex(i)),s}(t,i,a);switch(t.type){case"group":n?i=a?l(t,t.body):t.latex:(i=t.latexOpen||(t.cssId||t.cssClass?"":"{"),t.cssId&&(i+="\\cssId{"+t.cssId+"}{"),"ML__emph"===t.cssClass?i+="\\emph{"+l(t,t.body):(t.cssClass&&(i+="\\class{"+t.cssClass+"}{"),i+=l(t,t.body),t.cssClass&&(i+="}")),t.cssId&&(i+="}"),i+=t.latexClose||(t.cssId||t.cssClass?"":"}"));break;case"array":if(i+="\\begin{"+t.environmentName+"}","array"===t.environmentName){if(i+="{",t.colFormat)for(r=0;r0&&(i+=" & "),i+=l(t,t.array[o][s]);o1&&(i+=" "),i+=l(t,t.body),i+="\\right"+(t.rightDelim||"."),t.rightDelim&&t.rightDelim.length>1&&(i+=" ")):a?(i+="."===t.leftDelim?"":t.leftDelim,i+=l(t,t.body),i+="."===t.rightDelim?"":t.rightDelim):(i+="\\mleft"+(t.leftDelim||"."),t.leftDelim&&t.leftDelim.length>1&&(i+=" "),i+=l(t,t.body),i+="\\mright"+(t.rightDelim||"."),t.rightDelim&&t.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+t.delim+"}";break;case"rule":i+=n,t.shift&&(i+=`[${l(t,t.shift)}em]`),i+=`{${l(t,t.width)}em}{${l(t,t.height)}em}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":i+='\\char"'===n?t.latex:ae(n,null,t,l);break;case"mop":"​"!==t.body&&("\\mathop"===n||"\\operatorname"===n?i+=n+"{"+l(t,t.body)+"}":(i+=n,/^\\.*[a-zA-Z0-9]$/.test(n)&&(i+=" "))),t.explicitLimits&&("limits"===t.limits&&(i+="\\limits "),"nolimits"===t.limits&&(i+="\\nolimits "));break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",t.width?i+=t.width+"em":i+="0em",i+="}"):(i+=" ",t.width&&(i+=t.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{"+Object.keys(t.notation).join(" ")+"}";let e="",a="";t.backgroundColor&&"transparent"!==t.backgroundColor&&(e+=a+'mathbackground="'+ve(t.backgroundColor)+'"',a=","),t.shadow&&"auto"!==t.shadow&&(e+=a+'shadow="'+t.shadow+'"',a=","),1!==t.strokeWidth||"solid"!==t.strokeStyle?(e+=a+t.borderStyle,a=","):t.strokeColor&&"currentColor"!==t.strokeColor&&(e+=a+'mathcolor="'+ve(t.strokeColor)+'"',a=","),e&&(i+=`[${e}]`)}i+=`{${l(t,t.body)}}`;break;case"mathstyle":i+="\\"+t.mathstyle;break;case"space":i+=t.symbol;break;case"placeholder":i+="\\placeholder{}";break;case"first":case"command":case"msubsup":break;case"error":i+=t.latex;break;case"":break;default:i=ae(n,parent,t,l),i||(i+=n)}if(t.superscript){let e=l(t,t.superscript);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(t.subscript){const e=l(t,t.subscript);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i}(this,t)}getStyle(){return{mode:this.mode,color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,variant:this.variant,variantStyle:this.variantStyle,fontFamily:this.fontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(e){Object.assign(this,e),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Ee[this.fontSize]),"text"===this.mode&&"root"!==this.type&&(this.type="")}getInitialBaseElement(){let t;return e(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t||this}getFinalBaseElement(){return e(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const e=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(e.type)}forEach(t){if(t(this),e(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const a of e)for(const e of a)e.forEach(t)}filter(t){let a=[];t(this)&&a.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(e(this[i]))for(const e of this[i])e&&(a=a.concat(e.filter(t)));if(e(this.array))for(const e of this.array)for(const i of e)i&&(a=a.concat(i.filter(t)));return a}decomposeGroup(e){const t=_(Ne(e.clone({mathstyle:this.mathstyle?c[this.mathstyle]:void 0}),this.body),"","mord");return this.cssId&&(t.cssId=this.cssId),t.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),t}decomposeOverlap(e){const t=_(Ne(e,this.body),"inner");return _([t,_(null,"fix")],"left"===this.align?"llap":"rlap","mord")}decomposeRule(e){const t=e.mathstyle,a=_("","rule","mord");let i=this.shift&&!isNaN(this.shift)?this.shift:0;i/=t.sizeMultiplier;const s=this.width/t.sizeMultiplier,o=this.height/t.sizeMultiplier;return a.setStyle("border-right-width",s,"em"),a.setStyle("border-top-width",o,"em"),a.setStyle("margin-top",-(o-i),"em"),a.setStyle("border-color",e.color),a.width=s,a.height=o+i,a.depth=-i,a}decompose(t,a=null){let i=null;if(!this.type||/mord|minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(this.type)?(i="string"==typeof this.body?this.makeSpan(t,this.body):this.makeSpan(t,Ne(t,this.body)),i.type=v(this.type)?this.type:""):"group"===this.type||"root"===this.type?i=this.decomposeGroup(t):"delim"===this.type?(i=_(null,""),i.delim=this.delim):"sizeddelim"===this.type?i=this.bind(t,function(e,t,a,i,s=""){return"."===t?Te(e,i,s):("<"===t||"\\lt"===t?t="\\langle":">"!==t&&"\\gt"!==t||(t="\\rangle"),Me.includes(t)||Ce.includes(t)?ke(e,t,a,!1,i,s):Le.includes(t)?Se(e,t,Ae[a],!1,i,s):null)}(this.cls,this.delim,this.size,t)):"overlap"===this.type?i=this.decomposeOverlap(t):"rule"===this.type?i=this.decomposeRule(t):"msubsup"===this.type?(i=_("​","","mord"),a&&(i.height=a[0].height,i.depth=a[0].depth)):"space"===this.type?i=this.makeSpan(t," "):"spacing"===this.type?"​"===this.body?i=this.makeSpan(t,"​"):" "===this.body?i="math"===this.mode?this.makeSpan(t," "):this.makeSpan(t," "):this.width?(i=_("​","mspace "),this.width>0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em")):i=_("​","mspace "+({qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad")):"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):i="placeholder"===this.type?this.makeSpan(t,"⬚"):"first"===this.type?this.makeSpan(t,"​"):Ke[this.type].decompose(t,this),!i)return null;if(this.caret&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(e(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),this.containsCaret&&(e(i)?(i[0].classes=(i[0].classes||"")+" ML__contains-caret",i[i.length-1].classes=(i[i.length-1].classes||"")+" ML__contains-caret"):i.classes=(i.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(e(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return e(i)?i:[i]}attachSupsub(e,t,a){if(!this.superscript&&!this.subscript)return t;const i=e.mathstyle;let s=null,o=null;this.superscript&&(s=_(Ne(e.sup(),this.superscript),i.adjustTo(i.sup()))),this.subscript&&(o=_(Ne(e.sub(),this.subscript),i.adjustTo(i.sub())));let r,n=0,l=0;this.isCharacterBox()||(n=A(t)-i.metrics.supDrop,l=$(t)+i.metrics.subDrop),r=i===c.displaystyle?i.metrics.sup1:i.cramped?i.metrics.sup3:i.metrics.sup2;const d=.05/(c.textstyle.sizeMultiplier*i.sizeMultiplier);let m=null;if(o&&s){n=Math.max(n,r,s.depth+.25*i.metrics.xHeight),l=Math.max(l,i.metrics.sub2);const a=.04;if(n-$(s)-(A(o)-l)<4*a){l=4*a-(n-s.depth)+A(o);const e=.8*i.metrics.xHeight-(n-$(s));e>0&&(n+=e,l-=e)}m=E(e,[o,l,s,-n],"individualShift"),this.isSymbol&&m.children[0].setLeft(-z(t))}else o&&!s?(l=Math.max(l,i.metrics.sub1,A(o)-.8*i.metrics.xHeight),m=E(e,[o],"shift",l),m.children[0].setRight(d),this.isCharacterBox()&&m.children[0].setLeft(-z(t))):!o&&s&&(n=Math.max(n,r,s.depth+.25*i.metrics.xHeight),m=E(e,[s],"shift",-n),m.children[0].setRight(d));const p=_(m,"msubsup");return this.caret&&(p.caret=this.caret,this.caret=""),_([t,p],"",a)}attachLimits(e,t,a,i){const s=this.superscript?_(Ne(e.sup(),this.superscript),e.mathstyle.adjustTo(e.mathstyle.sup())):null,o=this.subscript?_(Ne(e.sub(),this.subscript),e.mathstyle.adjustTo(e.mathstyle.sub())):null;return function(e,t,a,i,s,o){if(!s&&!o)return t;t=_(t);let r=0,n=0;s&&(r=Math.max(.111,.2-$(s))),o&&(n=Math.max(.166,.6-A(o)));let l=null;return o&&s?(l=E(e,[.1,o,n,t,r,s,.1],"bottom",.1+A(o)+$(o)+n+$(t)+a),l.children[0].setLeft(-i),l.children[2].setLeft(i)):o&&!s?(l=E(e,[.1,o,n,t],"top",A(t)-a),l.children[0].setLeft(-i)):!o&&s&&(l=E(e,[t,r,s,.1],"bottom",$(t)+a),l.children[1].setLeft(i)),_(l,"op-limits","mop")}(e,t,a,i,s,o)}bind(e,t){return"first"!==this.type&&"​"!==this.body&&(this.id=function(e){let t;return e.atomIdsSettings&&("number"==typeof e.atomIdsSettings.seed?(t=e.atomIdsSettings.overrideID?e.atomIdsSettings.overrideID:e.atomIdsSettings.seed.toString(36),e.atomIdsSettings.seed+=1):t=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36)),t}(e),this.id&&(t.attributes||(t.attributes={}),t.attributes["data-atom-id"]=this.id)),t}makeSpan(e,t){const a=_(t,"","textord"===this.type?"mord":v(this.type)?this.type:""),i=this.getStyle();i.letterShapeStyle=e.letterShapeStyle,a.applyStyle(i);const s=(null==i?void 0:i.fontSize)?i.fontSize:"size5";return s!==e.parentSize?(a.classes+=" sizing reset-"+e.parentSize,a.classes+=" "+s):e.parentSize!==e.size&&(a.classes+=" sizing reset-"+e.parentSize,a.classes+=" "+e.size),a.maxFontSize=Math.max(a.maxFontSize,e.mathstyle.sizeMultiplier||1),"text"===this.mode&&(a.classes+=" ML__text"),e.mathstyle.isTight()&&(a.isTight=!0),"math"!==this.mode&&(a.italic=0),a.setRight(a.italic),"number"==typeof e.opacity&&a.setStyle("opacity",e.opacity),this.bind(e,a),this.caret&&(this.superscript||this.subscript||(a.caret=this.caret,this.caret="",e.mathstyle.isTight()&&(a.isTight=!0))),a}}function Oe(t,a=[]){const i=new Be(t,"root",a||[]);return!e(i.body)||0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new Be("","first")),i}function Re(t){return e(t)}const Pe=[[8205,1],[65038,2],[127995,5],[129456,4],[917536,96]];let Ie;const He=[127462,127487];function We(e){var t;return Ie||(Ie={},Pe.forEach(e=>{for(let t=e[0];t<=e[0]+e[1]-1;t++)Ie[t]=!0})),null!==(t=Ie[e])&&void 0!==t&&t}function Ve(e){return e>=He[0]&&e<=He[1]}function Ue(e){if(/^[\x20-\xFF]*$/.test(e))return e;const t=[],a=function(e){const t=[];for(let a=0;a=55296&&i<=56319){const t=e.charCodeAt(a+1);if(t>=56320&&t<=57343){const e=i-55296,s=t-56320;i=Math.pow(2,16)+e*Math.pow(2,10)+s,a++}}t.push(i)}return t}(e);let i=0;for(;i=this.s.length}get(){return this.pos="0"&&a<="9"?parseInt(a):"?"):e=new je("literal","#")}}else"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),e=new je("$$")):e=new je("$")):e=new je("literal",this.get());return e}}function Ze(e){const t=_("​","arraycolsep");return t.setWidth(e),t}function Xe(e,t,a,i){const s=[];for(const o of t){const t=_(Ne(e,i));t.depth=o.depth,t.height=o.height,s.push(t),s.push(o.pos-a)}return E(e,s,"individualShift")}Fe("genfrac",(e,t)=>{const a="auto"===t.mathstyle?e.mathstyle:c[t.mathstyle],i=e.clone({mathstyle:a});let s=[];t.numerPrefix&&s.push(_(t.numerPrefix,"mord"));const o=t.continuousFraction?a:a.fracNum();s=s.concat(Ne(i.clone({mathstyle:o}),t.numer));const r=K(s,e.mathstyle.adjustTo(o));let n=[];t.denomPrefix&&n.push(_(t.denomPrefix,"mord"));const l=t.continuousFraction?a:a.fracDen();n=n.concat(Ne(i.clone({mathstyle:l}),t.denom));const d=K(n,e.mathstyle.adjustTo(l)),m=t.hasBarLine?.04/a.sizeMultiplier:0;let p,h,u=0;a.size===c.displaystyle.size?(p=a.metrics.num1,u=m>0?3*m:.28,h=a.metrics.denom1):(m>0?(p=a.metrics.num2,u=m):(p=a.metrics.num3,u=.12),h=a.metrics.denom2);const f=r?$(r):0,g=d?A(d):0;let y;if(0===m){const e=p-f-(g-h);e{let a=t.colFormat;a&&0===a.length&&(a=[{align:"l"}]),a||(a=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const e of a)e.align&&s++;for(const e of t.array){let t=0;for(;t0&&(l+=m,r0&&y.push(E(e,a,"individualShift"))}const b=[];let v=!1,x=!1,k=0,w=!t.lFence;for(const t of a){if(t.align&&k>=y.length)break;if(t.align&&k{const i=a.svgBody?F(a.svgBody):Ne(t,a.body),s=t.clone({mathstyle:c.scriptstyle});let o,r;a.svgAbove?o=F(a.svgAbove):a.overscript&&(o=_(Ne(s,a.overscript),t.mathstyle.adjustTo(s.mathstyle))),a.svgBelow?r=F(a.svgBelow):a.underscript&&(r=_(Ne(s,a.underscript),t.mathstyle.adjustTo(s.mathstyle))),o&&r&&(r.setLeft(.3),r.setRight(.3),o.setLeft(.3),o.setRight(.3));let n=function(t,a,i,s,o){if(!i&&!s)return e(a)?_(a):a;let r=0,n=0;i&&(r=Math.max(.111,.2-$(i))),s&&(n=Math.max(.166,.6-A(s)));let l=null;if(s&&i){const e=A(s)+$(s)+$(a);l=E(t,[0,s,.2+$(a),a,-r,i,.166],"bottom",e)}else s&&!i?l=E(t,[0,s,n,a],"top",A(a)):i&&!s&&(l=E(t,[a,Math.max(.166,r-$(i)),i,0],"bottom",$(a)));return _(l,"op-over-under",o)}(t,i,o,r,v(a.type)?a.type:"mord");return(a.superscript||a.subscript)&&(n=a.attachLimits(t,n,0,0)),[n]}),Fe("accent",(t,a)=>{const i=t.mathstyle;let s=Ne(t.cramp(),a.body);(a.superscript||a.subscript)&&(s=[a.attachSupsub(t,_(s,"","mord"),"mord")]);let o=0;e(a.body)&&1===a.body.length&&a.body[0].isCharacterBox()&&(o=function(t){if(!t)return 0;if(e(t)){let e=0;for(const a of t)e+=a.skew||0;return e}return t.skew}(s));let r,n=Math.min(A(s),i.metrics.xHeight);if(a.svgAccent)r=F(a.svgAccent),n=.111-n;else{const e=D("Main-Regular",a.accent,"math");e.italic=0;const t="⃗"===a.accent?" accent-vec":"";r=_(_(e),"accent-body"+t)}return r=E(t,[s,-n,r]),r.children[1].setLeft(2*o),[_([r],"accent","mord")]}),Fe("enclose",(e,t)=>{const a=_(Ne(e,t.body),"","mord"),i="number"==typeof t.padding?t.padding:.3,s=_("","ML__notation");s.setStyle("position","absolute"),s.setStyle("height",A(a)+$(a)+2*i,"em"),s.height=A(a)+i,s.depth=$(a)+i,0!==i?s.setStyle("width","calc(100% + "+2*i+"em)"):s.setStyle("width","100%"),s.setStyle("top","0"),s.setStyle("left",-i,"em"),s.setStyle("z-index","-1"),t.backgroundcolor&&s.setStyle("background-color",t.backgroundcolor),t.notation.box&&s.setStyle("border",t.borderStyle),t.notation.actuarial&&(s.setStyle("border-top",t.borderStyle),s.setStyle("border-right",t.borderStyle)),t.notation.madruwb&&(s.setStyle("border-bottom",t.borderStyle),s.setStyle("border-right",t.borderStyle)),t.notation.roundedbox&&(s.setStyle("border-radius",(A(a)+$(a))/2,"em"),s.setStyle("border",t.borderStyle)),t.notation.circle&&(s.setStyle("border-radius","50%"),s.setStyle("border",t.borderStyle)),t.notation.top&&s.setStyle("border-top",t.borderStyle),t.notation.left&&s.setStyle("border-left",t.borderStyle),t.notation.right&&s.setStyle("border-right",t.borderStyle),t.notation.bottom&&s.setStyle("border-bottom",t.borderStyle);let o="";if(t.notation.horizontalstrike&&(o+='{const a="number"==typeof t.padding?t.padding:.3,i=_(Ne(e,t.body),"","mord");i.setStyle("vertical-align",-$(i),"em"),i.setStyle("height",0);const s=_(i,"","mord"),o=_("","ML__box");o.setStyle("position","absolute"),o.setStyle("height",A(s)+$(s)+2*a,"em"),0!==a?o.setStyle("width","calc(100% + "+2*a+"em)"):o.setStyle("width","100%"),o.setStyle("top",-a,"em"),o.setStyle("left",-a,"em"),o.setStyle("z-index","-1"),o.setStyle("box-sizing","border-box"),t.backgroundcolor&&o.setStyle("background-color",t.backgroundcolor),t.framecolor&&o.setStyle("border","0.04em solid "+t.framecolor),t.border&&o.setStyle("border",t.border),s.setStyle("display","inline-block"),s.setStyle("height",A(s)+$(s),"em");const r=_([o,s]);return r.setStyle("position","relative"),r.setStyle("vertical-align",-a+$(s),"em"),r.height=A(s)+a,r.depth=$(s)+a,r.setLeft(a),r.setRight(a),r.setStyle("height",r.height+r.depth-2*a,"em"),r.setStyle("top",-a,"em"),r.setStyle("display","inline-block"),[r]}),Fe("mop",(t,a)=>{var i;const s=t.mathstyle;let o,r=0,n=0;if(a.isSymbol){const e=s.size===c.displaystyle.size&&"\\smallint"!==a.symbol;o=D(e?"Size2-Regular":"Size1-Regular",a.body,"op-symbol "+(e?"large-op":"small-op"),"mop"),r=(o.height-o.depth)/2-s.metrics.axisHeight*s.sizeMultiplier,n=o.italic,o.applyStyle({color:a.phantom?"transparent":a.color,backgroundColor:a.phantom?"transparent":a.backgroundColor,cssId:a.cssId,cssClass:a.cssClass,letterShapeStyle:t.letterShapeStyle})}else o=e(a.body)?_(Ne(t,a.body),"","mop"):a.makeSpan(t,a.body);a.bind(t,o),a.isSymbol&&o.setTop(r);let l=o;if(a.superscript||a.subscript){const e=null!==(i=a.limits)&&void 0!==i?i:"auto";l="limits"===e||"auto"===e&&s.size===c.displaystyle.size?a.attachLimits(t,o,r,n):a.attachSupsub(t,o,"mop")}return[l]}),Fe("line",(e,t)=>{const a=e.mathstyle,i=Ne(e.cramp(),t.body),s=.04/a.sizeMultiplier,o=_(null,e.mathstyle.adjustTo(c.textstyle)+" "+t.position+"-line");let r;if(o.height=s,o.maxFontSize=1,"overline"===t.position)r=E(e,[i,3*s,o,s]);else{const t=_(i);r=E(e,[s,o,3*s,t],"top",A(t))}return[_(r,t.position,"mord")]}),Fe("leftright",(e,t)=>{if(!t.body)return t.leftDelim?new Be("math","mopen",t.leftDelim).decompose(e):t.rightDelim?new Be("math","mclose",t.rightDelim).decompose(e):null;const a=e.clone(),i=Ne(a,t.body),s=a.mathstyle;let o=0,r=0,n=[];if(o=A(i)*s.sizeMultiplier,r=$(i)*s.sizeMultiplier,t.leftDelim&&(n.push(t.bind(e,qe("mopen",t.leftDelim,o,r,a,"ML__open"))),n[n.length-1].applyStyle(t.getStyle())),i){for(let s=0;s{const a=e.mathstyle,i=Ne(e.cramp(),t.body),s=.04/a.sizeMultiplier;let o=s;a.idA(i)+$(i)+r&&(r=(r+l-(A(i)+$(i)))/2),n.setTop(n.height-A(i)-(r+s));const d=_(null,e.mathstyle.adjustTo(c.textstyle)+" sqrt-line");d.applyStyle(t.getStyle()),d.height=s;const m=E(e,[i,r,d,s]);if(!t.index)return[t.bind(e,_([n,m],"sqrt","mord"))];const p=e.clone({mathstyle:c.scriptscriptstyle}),h=E(e,[_(Ne(p,t.index),a.adjustTo(c.scriptscriptstyle))],"shift",-.6*(Math.max(n.height,m.height)-Math.max(n.depth,m.depth)));return[t.bind(e,_([_(h,"root"),n,m],"sqrt","mord"))]});const Ye={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML_bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},Je={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[0-9A-Z ]$/,fraktur:/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/,monospace:/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9]$/,"sans-serif":/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9]$/},Qe=/^[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5]$/,et=[/^[a-z]$/,/^[A-Z]$/,Qe,/^[\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9]$/],tt={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]};y("math",{emitLatexRun:function(e,t,a){let i=e.variant;return e.variantStyle&&"up"!==e.variantStyle&&(i+="-"+e.variantStyle),u(f(t,"color").map(t=>{const s=u(f(t,"variant").map(t=>{let s=t[0].variant;if(t[0].variantStyle&&"up"!==t[0].variantStyle&&(s+="-"+t[0].variantStyle),t.every(t=>{const a=se(t.symbol,e.mode,null);if(!a||!a.variant&&!a.variantStyle)return!1;let i=t.variant;return t.variantStyle&&"up"!==t.variantStyle&&(i+="-"+t.variantStyle),i===s}))return u(t.map(e=>e.toLatex(a)));let o="";return s&&s!==i&&(o={calligraphic:"\\mathcal{",fraktur:"\\mathfrak{","double-struck":"\\mathbb{",script:"\\mathscr{",monospace:"\\mathtt{","sans-serif":"\\mathsf{",normal:"\\mathrm{","normal-italic":"\\mathit{","normal-bold":"\\mathbf{","normal-bolditalic":"\\mathbfit{",ams:"","ams-italic":"\\mathit{","ams-bold":"\\mathbf{","ams-bolditalic":"\\mathbfit{",main:"","main-italic":"\\mathit{","main-bold":"\\mathbf{","main-bolditalic":"\\mathbfit{"}[s]),o+u(t.map(e=>e.toLatex(a)))+(o?"}":"")}));return!t[0].color||e&&e.color===t[0].color?s:"\\textcolor{"+ve(t[0].color)+"}{"+s+"}"}))},applyStyle:function(e,t){const a="auto"!==t.letterShapeStyle&&t.letterShapeStyle?t.letterShapeStyle:"tex";let i=t.variant||"normal",s=t.variantStyle||"";"normal"===i&&!s&&/\u00a3|\u0131|\u0237/.test(e.body)&&(i="main",s="italic"),"normal"!==i||s||1!==e.body.length||et.forEach((t,i)=>{t.test(e.body)&&"it"===tt[a][i]&&(s="italic")}),"up"===s&&(s="");const o=s?i+"-"+s:i,[r,n]=Ye[o];return Je[i]&&!Je[i].test(e.body)?(e.body=J(e.body,i,s),e.variant="",e.variantStyle="",null):(Qe.test(e.body)&&(e.classes+=" lcGreek"),n&&(e.classes+=" "+n),r)}});const at={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"};function it(e){let t=!1;const a=e.map(e=>"literal"===e.type?e.value:"{"===e.type?"{":"}"===e.type?"}":"command"===e.type?"\\"+e.value:"placeholder"===e.type?"#?":"#"===e.type?(t=!0,"#"+e.value):"space"===e.type?" ":"$"===e.type?"$":"$$"===e.type?"$$":"").join("");return t?"":a}y("text",{emitLatexRun:function(e,t,a){const i=function(e,t,a){return u(f(t,"color").map(t=>{const a=function(e,t,a){return function(e,t,a){return u(f(t,"fontFamily").map(e=>{const t=function(e,t,a){return u(f(t,"fontSize").map(e=>{const t=function(e,t,a){return u(f(t,"fontSeries").map(e=>{const t=function(e,t,a){return u(f(t,"fontShape").map(e=>{const t=function(e,t,a){let i=!1;return u(t.map(e=>{let t="",a="";return e.latex?t=e.latex:"string"==typeof e.body?t=ee("text",e.body):e.symbol&&(t=e.symbol.replace(/\\/g,"\\backslash ")),!i||t&&!/^[a-zA-Z0-9*]/.test(t)||(a="{}"),i=/\\[a-zA-Z0-9]+\*?$/.test(t),a+t}))}(0,e);return"it"===e[0].fontShape?"\\textit{"+t+"}":"sl"===e[0].fontShape?"\\textsl{"+t+"}":"sc"===e[0].fontShape?"\\textsc{"+t+"}":"n"===e[0].fontShape?"\\textup{"+t+"}":e[0].fontShape?"\\fontshape{"+e[0].fontShape+"}"+t:t}))}(0,e);return"b"===e[0].fontSeries?"\\textbf{"+t+"}":"l"===e[0].fontSeries?"\\textlf{"+t+"}":"m"===e[0].fontSeries?"\\textmd{"+t+"}":e[0].fontSeries?"\\fontseries{"+e[0].fontSeries+"}"+t:t}))}(0,e),a={size1:"tiny",size2:"scriptsize",size3:"footnotesize",size4:"small",size5:"normalsize",size6:"large",size7:"Large",size8:"LARGE",size9:"huge",size10:"Huge"}[e[0].fontSize]||"";return a?"\\"+a+" "+t:t}))}(0,e),a={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[e[0].fontFamily]||"";return a?"\\"+a+"{"+t+"}":e[0].fontFamily?"\\fontfamily{"+e[0].fontFamily+"}"+t:t}))}(0,t)}(0,t);return!t[0].color||"none"===t[0].color||e&&e.color===t[0].color?a:"\\textcolor{"+ve(t[0].color)+"}{"+a+"}"}))}(e,t);return t.every(e=>e.fontSeries||e.fontShape||e.fontFamily)&&t[0].mode===e.mode?i:`\\text{${i}}`},applyStyle:function(e,t){const a=t.fontFamily;if(at[a]?e.classes+=" "+at[a]:a&&e.setStyle("font-family",a),t.fontShape&&(e.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const a=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);a&&(e.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[a[1]||""]||""),e.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[a[2]||""]||""))}return"Main-Regular"},parse:(e,t,a)=>function(e,t,a){var i;let s,o=[];for(;e.length>0;){const r=e.shift();if("space"===r.type)s=new Be("text",""," ",a.style),s.symbol=" ",o.push(s);else if("placeholder"===r.type)s=new Be("text","placeholder",r.value),s.captureSelection=!0,o.push(s);else if("command"===r.type){let t;e.unshift(r),[t,e]=a.parse("text",e,a),o=[...o,...t]}else if("literal"===r.type){const e=se(r.value,"text",a.macros);!e||e.mode&&!e.mode.includes("text")?t({code:"unexpected-token"}):(s=new Be("text",e?e.type:"",e?e.value:r.value,a.style),s.symbol=r.value,s.latex=Z("text",r.value),o.push(s))}else if("$"===r.type||"$$"===r.type){const t=e.slice(0,e.findIndex(e=>e.type===r.type));e=e.slice(t.length+1);const[i]=a.parse("math",t,a);o=[...o,...i]}else"{"===r.type||"}"===r.type||t({code:"unexpected-token",arg:r.type+(null!==(i=r.value)&&void 0!==i?i:"")})}return[o,e]}(e,t,a)[0]});class st{constructor(e,t,a,i){this.index=0,this.mathList=[],this.style={},this.parseMode="math",this.smartFence=!1,this.tabularMode=!1,this.endCount=0,this.tokens=e,this.args=t,this.macros=a,this.onError=e=>i({before:it(this.tokens.slice(this.index,this.index+10)),after:it(this.tokens.slice(Math.max(0,this.index-10),this.index)),...e})}swapMathList(e=[]){const t=this.mathList;return this.mathList=e,t}swapParseMode(e){const t=this.parseMode;return this.parseMode=e,t}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=e.length}const s=e.toUpperCase()===i.toUpperCase();return s||(this.index=t),s}scanString(){let e="",t=this.end();for(;!t;){if(this.hasLiteral("]"))t=!0;else if(this.hasToken("literal"))e+=this.get().value;else if(this.skipWhitespace())e+=" ";else if(this.hasToken("command")){const t=this.get();"space"===t.value?e+=" ":(this.onError({code:"unbalanced-braces"}),e+=t.value)}else t=!0;t=t||this.end()}return e}scanLiteralArg(){let e="";if(this.hasToken("{")){this.get();let t=1;for(;t>0&&!this.end();){const a=this.get();"space"===a.type?e+=" ":"#"===a.type?e+="#"+a.value:"command"===a.type?e+="\\"+a.value:"}"===a.type?(t-=1,t>0&&(e+="}")):"{"===a.type?(t+=1,e+="{"):e+=a.value}}return e}scanColor(){return be(this.scanString())}scanNumber(e=!0){const t=this.parseLiteral("-");t||this.parseLiteral("+"),this.skipWhitespace(),e=!!e;let a=10,i=/[0-9]/;this.parseLiteral("'")?(a=8,i=/[0-7]/,e=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(a=16,i=/[0-9A-F]/,e=!0);let s="";for(;this.hasLiteralPattern(i);)s+=this.get().value;if(!e&&(this.parseLiteral(".")||this.parseLiteral(",")))for(s+=".";this.hasLiteralPattern(i);)s+=this.get().value;const o=e?parseInt(s,a):parseFloat(s);return t?-o:o}scanDimen(){const e=this.scanNumber(!1);let t;return this.skipWhitespace(),this.parseKeyword("pt")?t=r(e,"pt"):this.parseKeyword("mm")?t=r(e,"mm"):this.parseKeyword("cm")?t=r(e,"cm"):this.parseKeyword("ex")?t=r(e,"ex"):this.parseKeyword("px")?t=r(e,"px"):this.parseKeyword("em")?t=r(e,"em"):this.parseKeyword("bp")?t=r(e,"bp"):this.parseKeyword("dd")?t=r(e,"dd"):this.parseKeyword("pc")?t=r(e,"pc"):this.parseKeyword("in")?t=r(e,"in"):this.parseKeyword("mu")?t=r(e,"mu"):(this.onError({code:"missing-unit"}),t=r(e,"pt")),t}scanSkip(){const e=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),e}scanColspec(){this.skipWhitespace();const e=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const t=this.get().value;if("lcr".includes(t))e.push({align:t});else if("|"===t)e.push({rule:!0});else if("@"===t){if(this.parseToken("{")){const t=this.swapParseMode("math");e.push({gap:this.scanImplicitGroup(e=>"}"===e.type)}),this.swapParseMode(t)}this.parseToken("}")}}return e}scanModeSet(){let e;if(this.parseCommand("(")&&(e=")"),!e&&this.parseCommand("[")&&(e="]"),!e)return null;const t=this.swapParseMode("math"),a=new Be("math","group");return a.mathstyle=")"===e?"textstyle":"displaystyle",a.body=this.scanImplicitGroup(t=>"command"===t.type&&t.value===e),this.parseCommand(e),this.swapParseMode(t),a.body&&0!==a.body.length?a:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const e=this.get().type,t=new Be("math","group");t.mathstyle="$"===e?"textstyle":"displaystyle",t.latexOpen="textstyle"===t.mathstyle?"$":"$$",t.latexClose=t.latexOpen;const a=this.swapParseMode("math");return t.body=this.scanImplicitGroup(t=>t.type===e),this.parseToken(e),this.swapParseMode(a),t.body&&0!==t.body.length?t:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const e=this.scanArg("string");if(!e)return null;const t=ie(e);if(!t)return null;const a=[];if(null==t?void 0:t.params)for(const i of t.params)if(i.isOptional)a.push(this.scanOptionalArg(i.type));else{const t=this.scanArg(i.type);t||this.onError({code:"missing-argument",arg:e}),a.push(t)}const i=this.parseMode,s=this.tabularMode,o=this.swapMathList([]);this.tabularMode=t.tabular;const r=[],n=[];let l=[],c=!1;do{if(this.end()&&(this.onError({code:"unbalanced-environment",arg:e}),c=!0),!c&&this.parseCommand("end")&&(this.scanArg("string")!==e&&this.onError({code:"unbalanced-environment",arg:e}),c=!0),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let e=0;this.skipWhitespace(),this.parseLiteral("[")&&(e=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),n.push(e||0),r.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup(e=>"}"===e.type||"literal"===e.type&&"&"===e.value||"command"===e.type&&/^(end|cr|\\)$/.test(e.value)))}while(!c);l.push(this.swapMathList([])),l.length>0&&r.push(l);const d=this.swapMathList(o);if(this.parseMode=i,this.tabularMode=s,!t.tabular&&0===d.length)return null;if(t.tabular&&0===r.length)return null;const m=new Be(this.parseMode,"array",d);return Object.assign(m,t.parser(e,a,r)),m.array=r,m.rowGaps=n,m.environmentName=e,m}scanImplicitGroup(e){const t=this.style;e||(e=e=>"}"===e.type);let a=null,i=null,s=[],o=null;const r=this.swapMathList([]);for(;!this.end()&&!e(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const e=new Be("math","mathstyle");e.mathstyle=this.get().value,this.mathList.push(e)}else this.hasInfixCommand()&&!a?(a=this.get(),i=se("\\"+a.value,"math",this.macros),i&&([,s]=this.parseArguments(i)),o=this.swapMathList([])):this.parseAtom();let n;return a?(s.unshift(this.swapMathList(r)),s.unshift(o),n=[new Be(this.parseMode,i.type,i.value||a.value,i.parse?i.parse("\\"+a.value,s):null)],n[0].symbol="\\"+a.value):n=this.swapMathList(r),this.style=t,n}scanGroup(){if(!this.parseToken("{"))return null;const e=new Be(this.parseMode,"group");return e.body=this.scanImplicitGroup(e=>"}"===e.type),this.parseToken("}"),e.latexOpen="{",e.latexClose="}",e}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const e=new Be(this.parseMode,"leftright");e.leftDelim="(",e.inner=!1;const t=this.swapMathList([]);let a=1;for(;!this.end()&&0!==a;)this.hasLiteral("(")&&(a+=1),this.hasLiteral(")")&&(a-=1),0!==a&&this.parseAtom();return 0===a&&this.parseLiteral(")"),e.rightDelim=0===a?")":"?",e.body=this.swapMathList(t),e}scanDelim(){this.skipWhitespace();const e=this.get();if(!e)return this.onError({code:"unexpected-end-of-string"}),null;let t=".";"command"===e.type?t="\\"+e.value:"literal"===e.type&&(t=e.value);const a=se(t,"math",this.macros);return a?a.mode&&!a.mode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:t}),null):"mopen"===a.type||"mclose"===a.type||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(t)?t:(this.onError({code:"unexpected-delimiter",arg:t}),null):(this.onError({code:"unknown-command",arg:t}),null)}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return this.onError({code:"unbalanced-braces"}),null;const e=this.style;let t="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;t="mright"}const a=this.scanDelim();if(!a)return null;const i=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(t);)this.parseAtom();this.style=e;const s=this.scanDelim(),o=new Be(this.parseMode,"leftright");return o.leftDelim=a,o.rightDelim=s,o.inner="right"===t,o.body=this.swapMathList(i),o}parseSupSub(){var e,t;if("math"!==this.parseMode)return!1;let a=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){const i=this.hasLiteral("_")?"subscript":"superscript";if(this.parseLiteral("^")||this.parseLiteral("_")){const t=this.scanArg();if(t){const s=this.lastSubsupAtom();s[i]=(null!==(e=s[i])&&void 0!==e?e:[]).concat(t),a=!0}}else if(this.parseLiteral("'")){const e=this.lastSubsupAtom(),i=new Be(e.mode,"mord","′");i.symbol="\\prime",e.superscript=null!==(t=e.superscript)&&void 0!==t?t:[],e.superscript.push(i),a=!0}}return a}parseLimits(){if(this.parseCommand("limits")){const e=this.lastSubsupAtom();return e.limits="limits",e.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const e=this.lastSubsupAtom();return e.limits="nolimits",e.explicitLimits=!0,!0}return!1}scanOptionalArg(e){if(e=e&&"auto"!==e?e:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const t=this.parseMode;this.parseMode=e;const a=this.swapMathList();let i;for(;!this.end()&&!this.parseLiteral("]");)if("string"===e)i=this.scanString();else if("number"===e)i=this.scanNumber();else if("dimen"===e)i=this.scanDimen();else if("skip"===e)i=this.scanSkip();else if("colspec"===e)i=this.scanColspec();else if("color"===e)i=this.scanColor()||"#ffffff";else if("bbox"===e){const e=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/),t={};for(const a of e){const e=be(a);if(e)t.backgroundcolor=e;else{const e=a.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(e)t.padding=r(e[1],e[2]);else{const e=a.match(/^\s*border\s*:\s*(.*)/);e&&(t.border=e[1])}}}i=t}else this.mathList=this.mathList.concat(this.scanImplicitGroup(e=>"literal"===e.type&&"]"===e.value));this.parseMode=t;const s=this.swapMathList(a);return i||s}scanArg(e){var t;let a;if(e=e&&"auto"!==e?e:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===e)return this.scanDelim()||".";if(/^(math|text)$/.test(e)){const t=this.parseMode;this.parseMode=e;const a=this.scanToken();return this.parseMode=t,a}}if(this.hasToken("#")){const e=this.get();return this.skipUntilToken("}"),"?"===e.value?this.placeholder():this.args?null===this.args[e.value]||void 0===this.args[e.value]?this.placeholder():"string"==typeof this.args[e.value]?ot(this.args[e.value],this.parseMode,null,this.macros,!1,this.onError):null!==(t=this.args[e.value])&&void 0!==t?t:null:null}const i=this.parseMode;this.parseMode=e;const s=this.swapMathList([]);if("string"===e)a=this.scanString(),this.skipUntilToken("}");else if("number"===e)a=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===e)a=this.scanDimen(),this.skipUntilToken("}");else if("skip"===e)a=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===e)a=this.scanColspec(),this.skipUntilToken("}");else if("color"===e)a=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===e)a=this.scanDelim()||".",this.skipUntilToken("}");else{const t=this.index;let i=1;do{const e=this.get();"}"===(null==e?void 0:e.type)&&(i-=1),"{"===(null==e?void 0:e.type)&&(i+=1)}while(i>0&&!this.end());if(o=e,r=this.tokens.slice(t,this.index-1),n=this.onError,l={args:this.args,macros:this.macros,smartFence:this.smartFence,style:this.style,parse:(e,t,i)=>{const s=new st(t,i.args,i.macros,this.onError);return s.parseMode=e,s.style=i.style,a=s.scanImplicitGroup(),[a,t.slice(s.index)]}},a=g[o]&&g[o].parse?g[o].parse(r,n,l):null,!a){this.index=t;do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end())}}var o,r,n,l;this.parseMode=i;const c=this.swapMathList(s);return a||c}scanToken(){var t;const a=this.get();if(!a)return null;let i=null;if("space"===a.type)"text"===this.parseMode&&(i=new Be("text",""," ",this.style),i.symbol=" ");else if("placeholder"===a.type)i=new Be(this.parseMode,"placeholder",a.value),i.captureSelection=!0;else if("command"===a.type){if("placeholder"===a.value)i=new Be(this.parseMode,"placeholder",this.scanArg("string"),this.style),i.captureSelection=!0;else if("char"===a.value){const e=this.index;let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),i=new Be(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),i.symbol="\\char",i.latex="\\char"+it(this.tokens.slice(e))}else if("hskip"===a.value||"kern"===a.value){const e=this.scanSkip();isFinite(e)&&(i=new Be(this.parseMode,"spacing",null,this.style),i.width=e,i.symbol="\\"+a.value,i.latex="\\"+a.value)}else if(i=this.scanMacro(a.value),!i){const e=se("\\"+a.value,this.parseMode,{});if(!e)return this.onError({code:"unknown-command",arg:"\\"+a.value}),i=new Be("math","error","\\"+a.value),i.symbol="\\"+a.value,i.latex="\\"+a.value,[i];if(e.mode&&!e.mode.includes(this.parseMode))return this.onError({code:"invalid-command",arg:"\\"+a.value}),i=new Be("math","error","\\"+a.value),i.symbol="\\"+a.value,i.latex="\\"+a.value,[i];const t=this.index,[s,o]=this.parseArguments(e);if(!o)return null;if(e.infix)this.onError({code:"too-many-infix-commands",arg:"\\"+a.value});else{if(e.parse){const t=e.parse("\\"+a.value,o);if(t.type)i=new Be(this.parseMode,e.type,s?this.scanArg(s):null,{...this.style,...t});else{const e=this.parseMode;if(t.mode&&(this.parseMode=t.mode,delete t.mode),s){const e=this.style;this.style={...this.style,...t},i=this.scanArg(s),this.style=e}else this.style={...this.style,...t};this.parseMode=e}}else{const t={...this.style,variant:e.variant||this.style.variant,variantStyle:e.variantStyle||this.style.variantStyle};i=new Be(this.parseMode,e.type||"mop",e.value||a.value,t)}if(i instanceof Be&&!/^(llap|rlap|class|cssId)$/.test(a.value)){i.symbol="\\"+a.value;const e=it(this.tokens.slice(t,this.index));if(e&&(i.latex=i.symbol+e),i.isFunction&&this.smartFence){const e=this.scanSmartFence();e&&(i=[i,e])}}}}}else if("literal"===a.type&&"string"==typeof a.value){const e=se(a.value,this.parseMode,this.macros);if(e){const t={...this.style};i=new Be(this.parseMode,e.type,e.value||a.value,t),e.isFunction&&(i.isFunction=!0)}else i=new Be(this.parseMode,"math"===this.parseMode?"mord":"",a.value,this.style);if(i.symbol=a.value,i.latex=Q(this.parseMode,a.value),(null==e?void 0:e.isFunction)&&this.smartFence){const e=this.scanSmartFence();e&&(i=[i,e])}}else"#"===a.type?i="?"!==a.value&&this.args?null===this.args[a.value]||void 0===this.args[a.value]?this.placeholder():"string"==typeof this.args[a.value]?ot(this.args[a.value],this.parseMode,[],this.macros,!1,this.onError):this.args[a.value]:this.placeholder():"}"===a.type?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:a.type+(null!==(t=a.value)&&void 0!==t?t:"")});return i&&!e(i)?[i]:i}scanMacro(e){var t;if(!this.macros||!this.macros[e])return null;const a=this.index,i=[];let s,o=0;"string"==typeof this.macros[e]?(s=this.macros[e],/(^|[^\\])#1/.test(s)&&(o=1),/(^|[^\\])#2/.test(s)&&(o=2),/(^|[^\\])#3/.test(s)&&(o=3),/(^|[^\\])#4/.test(s)&&(o=4),/(^|[^\\])#5/.test(s)&&(o=5),/(^|[^\\])#6/.test(s)&&(o=6),/(^|[^\\])#7/.test(s)&&(o=7),/(^|[^\\])#8/.test(s)&&(o=8),/(^|[^\\])#9/.test(s)&&(o=9)):(s=this.macros[e].def,o=this.macros[e].args||0);for(let e=1;e<=o;e++)i[e]=this.scanLiteralArg();i["?"]=null===(t=this.args)||void 0===t?void 0:t["?"];const r=new Be(this.parseMode,"group",ot(s,this.parseMode,i,this.macros,!1,this.onError));return r.captureSelection=!0,r.symbol="\\"+e,r.latex="\\"+e+it(this.tokens.slice(a)),r}parseAtom(){let t=this.scanEnvironment()||this.scanModeShift()||this.scanModeSet()||this.scanGroup()||this.scanLeftRight();return!(t||!this.parseSupSub()&&!this.parseLimits())||(t||(t=this.scanToken()),e(t)?this.mathList=this.mathList.concat(t):t&&this.mathList.push(t),null!==t)}}function ot(e,t,a,i,s=!1,o){let r=[];const n=new st(function(e){const t=[],a=e.toString().split(/\r?\n/);let i="",s="";for(const e of a){i+=s,s=" ";const t=e.match(/((?:\\%)|[^%])*/);t&&(i+=t[0])}const o=new Ge(i);for(;!o.end();){const e=o.makeToken();e&&t.push(e)}return t}(e),a,i,t=>{o&&o({...t,latex:e})});for(n.parseMode=t||"math",s&&(n.smartFence=!0);!n.end();)r=r.concat(n.scanImplicitGroup());return r}function rt(e){return 0===e.length||1===e.length&&"first"===e[0].type}function nt(e){const t=e.siblings();for(let e=t.length-1;e>=0;e--)t[e].suggestion&&t.splice(e,1)}function lt(e){let t=1,a=e.ancestor(t);for(;a;)a.latex=void 0,t+=1,a=e.ancestor(t)}function ct(e,t){let a="";for(const t of e)a+=t.relation+":"+t.offset+"/";return t&&(a+="#"+t),a}function dt(e){const t={path:[],extent:0},a=e.split("#");a.length>1&&(t.extent=parseInt(a[1]));const i=a[0].split("/");for(const e of i){const a=e.match(/([^:]*):(.*)/);a&&t.path.push({relation:a[1],offset:parseInt(a[2])})}return t}function mt(e,t){let a=0,i=-1,s=!1;for(;!s;)i+=1,s=i>=e.length||i>=t.length,s=s||!(e[i].relation===t[i].relation&&e[i].offset===t[i].offset);return a=i===e.length&&i===t.length?0:i+1===e.length&&i+1===t.length&&e[i].relation===t[i].relation?1:2,a}function pt(e){return dt(ct(e)).path}function ht(e,t){let a=0;for(let i=0;i0;)i.col+=1,(!e[i.row]||i.col>=e[i.row].length)&&(i.col=0,i.row+=1),a-=1;return i}function ft(t,a){let i;return"object"!=typeof a&&(a=ut(t,a)),e(t[a.row])&&(i=t[a.row][a.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(new Be("","first")),i}function gt(e){let t=0,a=0,i=1;for(const t of e)a+=1,t.length>i&&(i=t.length);return t=a*i,t}function yt(e,t,a){const i={...t};if(i.row+=a,i.row<0){if(i.col+=a,i.row=e.length-1,i.col<0)return null;for(;i.row>=0&&!ft(e,i);)i.row-=1;if(i.row<0)return null}else if(i.row>=e.length){for(i.col+=a,i.row=0;i.rowe.length-1)return null}return i}class bt{constructor(e,t,a,i){this.options={mode:"math",removeExtraneousParentheses:!1,...e},this.root=Oe(this.options.mode),this.path=[{relation:"body",offset:0}],this.extent=0,this.setListeners(t),this.setHooks(a),this.mathfield=i,this.suppressChangeNotifications=!1}clone(){const e=new bt(this.options,this.listeners,this.hooks,this.mathfield);return e.root=this.root,e.path=pt(this.path),e}setListeners(e){this.listeners=e}setHooks(e){this.hooks={announce:(null==e?void 0:e.announce)?e.announce:(e,t,a,i)=>{},moveOut:(null==e?void 0:e.moveOut)?e.moveOut:()=>!0,tabOut:(null==e?void 0:e.tabOut)?e.tabOut:()=>!0}}announce(e,t,a=[]){this.hooks.announce(this.mathfield,e,t,a)}toString(){return ct(this.path,this.extent)}siblings(){if(0===this.path.length)return[];let e;return this.parent().array?e=ft(this.parent().array,this.relation()):(e=this.parent()[this.relation()]||[],"string"==typeof e&&(e=[])),0!==e.length&&"first"===e[0].type||e.unshift(new Be("","first")),e}anchorOffset(){return this.path.length>0?this.path[this.path.length-1].offset:0}focusOffset(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0}startOffset(){return Math.min(this.focusOffset(),this.anchorOffset())}endOffset(){return Math.max(this.focusOffset(),this.anchorOffset())}sibling(e){return this.siblings()[this.startOffset()+e]}ancestor(e){if(e>this.path.length)return null;let t=this.root;for(let a=0;a0?this.path[this.path.length-1].relation:""}insertFirstAtom(){this.siblings()}}function vt(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onSelectionWillChange)||e.suppressChangeNotifications||e.listeners.onSelectionWillChange(e)}function xt(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onSelectionDidChange)||e.suppressChangeNotifications||e.listeners.onSelectionDidChange(e)}function kt(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onContentWillChange)||e.suppressChangeNotifications||e.listeners.onContentWillChange(e)}function wt(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onContentDidChange)||e.suppressChangeNotifications||e.listeners.onContentDidChange(e)}function St(e){return!!e&&("mord"===e.type&&/[0-9.]/.test(e.body)||"mpunct"===e.type&&","===e.body)}function Mt(e){const t=e.siblings();if(t.length<=1)return null;let a=Math.min(e.endOffset(),t.length-1);if("command"!==t[a].type)return null;for(;a>0&&"command"===t[a].type;)a-=1;let i=e.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>a?{start:a+1,end:i}:null}function Lt(e){const t=Rt(e)?Vt(e):e.sibling(1);let a;if(t){if("command"===t.type)return"command";a=t.mode}let i=1,s=e.ancestor(i);for(;!a&&s;)s&&(a=s.mode),i+=1,s=e.ancestor(i);return a}function Ct(e){const t=Rt(e)?Vt(e):e.sibling(1);let a;if(t&&"first"!==t.type){if("command"===t.type)return{};a={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=e.ancestor(i);for(;!a&&s;)s&&(a={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=e.ancestor(i);return a}function At(e,t=1,a=!0){var i;const s=e.suppressChangeNotifications;e.suppressChangeNotifications=!0;const o=e.clone(),r=e.extent;Dt(e,t),"placeholder"===Vt(e).type&&Dt(e,t);const n=Yt(e,(t,a)=>"placeholder"===a.type||t.length>1&&1===e.siblings().length,t);if(0===n.length){if(jt(e,o,r),a&&(null===(i=e.hooks)||void 0===i?void 0:i.tabOut)&&e.hooks.tabOut(e,t>0?"forward":"backward")&&document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',a=Array.prototype.filter.call(document.querySelectorAll(e),e=>(e.offsetWidth>0||e.offsetHeight>0)&&!e.contains(document.activeElement)||e===document.activeElement);let i=a.indexOf(document.activeElement)+t;i<0&&(i=a.length-1),i>=a.length&&(i=0),a[i].focus()}return e.suppressChangeNotifications=s,!1}return vt(e),jt(e,n[0]),"placeholder"===Vt(e).type&&Pt(e,-1),e.announce("move",o),xt(e),e.suppressChangeNotifications=s,!0}function $t(e,t=0,a=0,i=""){const s=e.path[e.path.length-1].relation;i||(i=s);const o=e.parent();if(!o&&"body"!==i)return!1;const r=i.startsWith("cell");if(!r&&!o[i]||r&&!o.array)return!1;const n=i!==s;e.path[e.path.length-1].relation=i;const l=e.siblings().length;e.path[e.path.length-1].relation=s;const c=e.extent;"end"===a?a=l-t-1:"start"===a&&(a=-t),Pt(e,a);const d=e.extent!==c;Pt(e,c),t<0&&(t=l+t),t=Math.max(0,Math.min(t,l-1));const m=e.path[e.path.length-1].offset;return(n||m!==t||d)&&(n&&Zt(e),vt(e),e.path[e.path.length-1].relation=i,e.path[e.path.length-1].offset=t,Pt(e,a),xt(e)),!0}function zt(t,a){var i;a=null!=a?a:{};const s={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(t.anchorOffset()===t.siblings().length-1){Zt(t);let e=s[t.relation()];const o=t.parent();for(;e&&!o[e];)e=s[e];if(e)return void $t(t,0,0,e);if(t.parent().array){const e=gt(t.parent().array);let a=parseInt(t.relation().match(/cell([0-9]*)$/)[1])+1;for(;a=0;){if(ft(t.parent().array,e)&&$t(t,-1,0,"cell"+e))return void xt(t);e-=1}}return 1===t.path.length?(t.suppressChangeNotifications||!(null===(i=t.hooks)||void 0===i?void 0:i.moveOut)||t.hooks.moveOut(t,"backward"))&&(t.path[0].offset=t.root.body.length-1):(t.path.pop(),$t(t,t.anchorOffset()-1)),void xt(t)}const o=Vt(t);if(!o.captureSelection){let a;if(o.array){a="";const e=gt(o.array);let i=e-1;for(;!a&&i0)for(It(e)&&t--;t>0;)zt(e),t--;else if(t<0)for(Ht(e)&&t++;0!==t;)_t(e),t++;e.announce("move",a)}return!0}function qt(e,t){var a;const i=null!==(a=(t=null!=t?t:{extend:!1}).extend)&&void 0!==a&&a;Ht(e);const s=e.relation();if("denom"===s)i?(vt(e),e.path.pop(),e.path[e.path.length-1].offset-=1,Pt(e,1),xt(e)):$t(e,e.anchorOffset(),0,"numer"),e.announce("moveUp");else if(e.parent().array){let a=ut(e.parent().array,s);a=yt(e.parent().array,a,-1),a&&ft(e.parent().array,a)?(e.path[e.path.length-1].relation="cell"+ht(e.parent().array,a),$t(e,e.anchorOffset()),e.announce("moveUp")):Dt(e,-1,t)}else e.announce("line");return!0}function Tt(e,t){var a;const i=null!==(a=(t=null!=t?t:{extend:!1}).extend)&&void 0!==a&&a;It(e);const s=e.relation();if("numer"===s)i?(vt(e),e.path.pop(),e.path[e.path.length-1].offset-=1,Pt(e,1),xt(e)):$t(e,e.anchorOffset(),0,"denom"),e.announce("moveDown");else if(e.parent().array){let a=ut(e.parent().array,s);a=yt(e.parent().array,a,1),a&&ft(e.parent().array,a)?(e.path[e.path.length-1].relation="cell"+ht(e.parent().array,a),$t(e,e.anchorOffset()),e.announce("moveDown")):Dt(e,1,t)}else e.announce("line");return!0}function Kt(e,t){let a=e.path[e.path.length-1].offset,i=0;const s=e.clone();i=e.extent+t;const o=a+i;if(o<0&&0!==i){if(e.path.length>1)return vt(e),e.path.pop(),Pt(e,-1),xt(e),e.announce("move",s),!0;a=e.path[e.path.length-1].offset,i=e.extent}else if(o>=e.siblings().length){if(e.path.length>1)return vt(e),e.path.pop(),e.path[e.path.length-1].offset-=1,Pt(e,1),xt(e),e.announce("move",s),!0;Rt(e)&&(a-=1),i-=1}return $t(e,a,i),e.announce("move",s),!0}function Et(e,t,a){var i;const s=null!==(i=(a=null!=a?a:{extend:!1}).extend)&&void 0!==i&&i;t=t<0?-1:1;const o=e.clone(),r=e.siblings(),n=e.focusOffset();let l=n+t;if(s&&(l=Math.min(Math.max(0,l),r.length-1)),l<0||l>=r.length)Dt(e,t,a);else{if(r[l]&&"text"===r[l].mode){if(l=function(e,t,a){a=a<0?-1:1;const i=e.siblings();if(!i[t])return t;if("text"!==i[t].mode)return t;let s;if(U.test(i[t].body)){let e,o=t;do{e="text"===i[o].mode&&U.test(i[o].body),o+=a}while(i[o]&&e);s=i[o]?o-2*a:o-a}else if(/\s/.test(i[t].body)){let e=t;for(;i[e]&&"text"===i[e].mode&&/\s/.test(i[e].body);)e+=a;if(i[e]){let t=!0;do{t="text"===i[e].mode&&!/\s/.test(i[e].body),e+=a}while(i[e]&&t);s=i[e]?e-2*a:e-a}else s=e-a}else{let e=t;for(;i[e]&&"text"===i[e].mode&&!/\s/.test(i[e].body);)e+=a;s=i[e]?e:e-a;let o=!0;for(;i[e]&&o;)o="text"===i[e].mode&&/\s/.test(i[e].body),o&&(s=e),e+=a;s=i[e]?e-2*a:e-a}return s-(a>0?0:1)}(e,l,t),l<0&&!s)return void $t(e,0);if(l>r.length)return $t(e,r.length-1),void Dt(e,t,a)}else{const e=r[l]?r[l].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let a="mopen"===e?1:-1;for(l+=t>0?1:-1;l>=0&&l0&&(l-=1)}else{for(;r[l]&&"math"===r[l].mode&&r[l].type===e;)l+=t;l-=t>0?1:0}}if(s){const t=e.anchorOffset();$t(e,t,l-t)}else $t(e,l);e.announce("move",o)}}function Ft(e,t=1,a){var i;a=null!=a?a:{extend:!1},t=t<0?-1:1;const s=e.clone(),o=[{relation:"body",offset:e.path[0].offset}];let r;return null!==(i=!a.extend)&&void 0!==i&&i?(o[0].offset=t<0?0:e.root.body.length-1,r=0):t<0?o[0].offset>0&&(r=-o[0].offset):o[0].offset=i)return $t(e,e.endOffset()-1,1),!0;$t(e,a,i-a)}else if("mord"===e.sibling(0).type&&/[0-9,.]/.test(e.sibling(0).body)){let a=e.startOffset(),i=e.endOffset();for(;St(t[a]);)a-=1;for(;St(t[i]);)i+=1;i-=1,$t(e,a,i-a)}else $t(e,0,"end");return!0}function Ot(e){return e.path=[{relation:"body",offset:0}],$t(e,0,"end")}function Rt(e){return 0===e.extent}function Pt(e,t){return e.extent=t,!0}function It(e){return 0!==e.extent&&($t(e,e.endOffset()),!0)}function Ht(e){return 0!==e.extent&&($t(e,e.startOffset()),!0)}function Wt(e){if(e.path.length>1){const t=e.clone();return e.path.pop(),Pt(e,0),e.announce("move",t),!0}return e.announce("plonk"),!1}function Vt(e){if(e.parent().array)return ft(e.parent().array,e.relation())[e.anchorOffset()];const t=e.siblings();return t[Math.min(t.length-1,e.anchorOffset())]}function Ut(e,t,a,i={extendToWordBoundary:!1}){const s=mt(t,a);if(0===s)return i.extendToWordBoundary?Ut(e,t=Xt(e,t,-1),a=Xt(e,a,1)):jt(e,pt(t),0);if(1===s){const s=a[a.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?Ut(e,t=Xt(e,t,s<0?1:-1),a=Xt(e,a,s<0?-1:1)):jt(e,pt(t),s)}let o=function(e,t){const a=[],i=Math.min(e.length-1,t.length-1);let s=0;for(;s<=i&&e[s].relation===t[s].relation&&e[s].offset===t[s].offset;)a.push(e[s]),s+=1;return a}(t,a);const r=o.length;if(t.length===r||a.length===r||t[r].relation!==a[r].relation)return jt(e,o,-1);o.push(t[r]),o=pt(o);let n=a[r].offset-t[r].offset+1;return n<=0?a.length>r+1?(o[r].relation=a[r].relation,o[r].offset=a[r].offset,o[o.length-1].offset-=1,n=2-n):(o[r].relation=a[r].relation,o[r].offset=a[r].offset,n=1-n):a.length<=t.length?o[o.length-1].offset-=1:a.length>t.length&&(o[r].offset-=1),jt(e,o,n)}function jt(t,a,i=0){let s;if("string"==typeof a)s=dt(a);else if(e(a)){const e=pt(a),o=t.path;t.path=e,0===i&&"placeholder"===Vt(t).type&&(e[e.length-1].offset=t.anchorOffset()-1,i=1),s={path:e,extent:i||0},t.path=o}else s=a;const o=0!==mt(t.path,s.path),r=s.extent!==t.extent;return(o||r)&&(o&&Zt(t),vt(t),t.path=pt(s.path),t.siblings().length=0?It(s):(Ht(s),Dt(s,1));const o=Vt(s);do{t.bind(s)(s.path,Vt(s))&&i.push(s.toString()),a>=0?zt(s,{iterateAll:!0}):_t(s,{iterateAll:!0})}while(o!==Vt(s));return i}const Jt="apple"===aa()?{id:"apple.en-intl",displayName:"English (international)",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","∫","ı"],KeyC:["c","C","ç","Ç"],KeyD:["d","D","∂","Î"],KeyE:["e","E","´","´"],KeyF:["f","F","ƒ","Ï"],KeyG:["g","G","©","˝"],KeyH:["h","H","˙","Ó"],KeyI:["i","I","ˆ","ˆ"],KeyJ:["j","J","∆","Ô"],KeyK:["k","K","˚",""],KeyL:["l","L","¬","Ò"],KeyM:["m","M","µ","Â"],KeyN:["n","N","˜","˜"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","π","∏"],KeyQ:["q","Q","œ","Œ"],KeyR:["r","R","®","‰"],KeyS:["s","S","ß","Í"],KeyT:["t","T","†","ˇ"],KeyU:["u","U","¨","¨"],KeyV:["v","V","√","◊"],KeyW:["w","W","∑","„"],KeyX:["x","X","≈","˛"],KeyY:["y","Y","¥","Á"],KeyZ:["z","Z","Ω","¸"],Digit1:["1","!","¡","⁄"],Digit2:["2","@","™","€"],Digit3:["3","#","£","‹"],Digit4:["4","$","¢","›"],Digit5:["5","%","∞","fi"],Digit6:["6","ˆ","§","fl"],Digit7:["7","&","¶","‡"],Digit8:["8","*","•","°"],Digit9:["9","(","ª","·"],Digit0:["0",")","º","‚"],Space:[" "," "," "," "],Minus:["-","_","–","—"],Equal:["=","+","≠","±"],BracketLeft:["[","{","“","”"],BracketRight:["]","}","‘","’"],Backslash:["\\","|","«","»"],Semicolon:[";",":","…","Ú"],Quote:["'",'"',"æ","Æ"],Backquote:["`","˜","`","`"],Comma:[",","<","≤","¯"],Period:[".",">","≥","˘"],Slash:["/","?","÷","¿"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["§","±","§","±"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}}:"windows"===aa()?{id:"windows.en-intl",displayName:"English (international)",platform:"windows",locale:"en",score:0,mapping:{KeyA:["a","A","á","Á"],KeyB:["b","B","",""],KeyC:["c","C","©","¢"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","é","É"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","í","Í"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","ø","Ø"],KeyM:["m","M","µ",""],KeyN:["n","N","ñ","Ñ"],KeyO:["o","O","ó","Ó"],KeyP:["p","P","ö","Ö"],KeyQ:["q","Q","ä","Ä"],KeyR:["r","R","®",""],KeyS:["s","S","ß","§"],KeyT:["t","T","þ","Þ"],KeyU:["u","U","ú","Ú"],KeyV:["v","V","",""],KeyW:["w","W","å","Å"],KeyX:["x","X","",""],KeyY:["y","Y","ü","Ü"],KeyZ:["z","Z","æ","Æ"],Digit1:["1","!","¡","¹"],Digit2:["2","@","²",""],Digit3:["3","#","³",""],Digit4:["4","$","¤","£"],Digit5:["5","%","€",""],Digit6:["6","^","¼",""],Digit7:["7","&","½",""],Digit8:["8","*","¾",""],Digit9:["9","(","‘",""],Digit0:["0",")","’",""],Space:[" "," ","",""],Minus:["-","_","¥",""],Equal:["=","+","×","÷"],BracketLeft:["[","{","«",""],BracketRight:["]","}","»",""],Backslash:["\\","|","¬","¦"],Semicolon:[";",":","¶","°"],Quote:["'",'"',"´","¨"],Backquote:["`","~","",""],Comma:[",","<","ç","Ç"],Period:[".",">","",""],Slash:["/","?","¿",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}}:{id:"linux.en",displayName:"English",platform:"linux",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","¦"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},Qt={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},ea=[];let ta;function aa(){let e;return(null===navigator||void 0===navigator?void 0:navigator.platform)&&(null===navigator||void 0===navigator?void 0:navigator.userAgent)&&(/^(mac)/i.test(navigator.platform)?e="apple":/^(win)/i.test(navigator.platform)?e="windows":/(android)/i.test(navigator.userAgent)?e="linux":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="apple":/\bCrOS\b/i.test(navigator.userAgent)&&(e="linux")),e}function ia(e){e.platform===aa()&&ea.push(e)}function sa(e){ta=ea.find(t=>e.startsWith(t.locale))}function oa(){return null!=ta?ta:ea[0]}ia(Jt),ia({id:"apple.french",locale:"fr",displayName:"French",platform:"apple",score:0,mapping:{KeyA:["q","Q","‡","Ω"],KeyB:["b","B","ß","∫"],KeyC:["c","C","©","¢"],KeyD:["d","D","∂","∆"],KeyE:["e","E","ê","Ê"],KeyF:["f","F","ƒ","·"],KeyG:["g","G","fi","fl"],KeyH:["h","H","Ì","Î"],KeyI:["i","I","î","ï"],KeyJ:["j","J","Ï","Í"],KeyK:["k","K","È","Ë"],KeyL:["l","L","¬","|"],KeyM:[",","?","∞","¿"],KeyN:["n","N","~","ı"],KeyO:["o","O","œ","Œ"],KeyP:["p","P","π","∏"],KeyQ:["a","A","æ","Æ"],KeyR:["r","R","®","‚"],KeyS:["s","S","Ò","∑"],KeyT:["t","T","†","™"],KeyU:["u","U","º","ª"],KeyV:["v","V","◊","√"],KeyW:["z","Z","Â","Å"],KeyX:["x","X","≈","⁄"],KeyY:["y","Y","Ú","Ÿ"],KeyZ:["w","W","‹","›"],Digit1:["&","1","","´"],Digit2:["é","2","ë","„"],Digit3:['"',"3","“","”"],Digit4:["'","4","‘","’"],Digit5:["(","5","{","["],Digit6:["§","6","¶","å"],Digit7:["è","7","«","»"],Digit8:["!","8","¡","Û"],Digit9:["ç","9","Ç","Á"],Digit0:["à","0","ø","Ø"],Space:[" "," "," "," "],Minus:[")","°","}","]"],Equal:["-","_","—","–"],BracketLeft:["^","¨","ô","Ô"],BracketRight:["$","*","€","¥"],Backslash:["`","£","@","#"],Semicolon:["m","M","µ","Ó"],Quote:["ù","%","Ù","‰"],Backquote:["<",">","≤","≥"],Comma:[";",".","…","•"],Period:[":","/","÷","\\"],Slash:["=","+","≠","±"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","•","Ÿ"],NumpadEqual:["=","=","=","="]}}),ia({id:"linux.french",locale:"fr",displayName:"French",platform:"apple",score:0,mapping:{KeyA:["q","Q","@","Ω"],KeyB:["b","B","”","’"],KeyC:["c","C","¢","©"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","€","¢"],KeyF:["f","F","đ","ª"],KeyG:["g","G","ŋ","Ŋ"],KeyH:["h","H","ħ","Ħ"],KeyI:["i","I","→","ı"],KeyJ:["j","J","̉","̛"],KeyK:["k","K","ĸ","&"],KeyL:["l","L","ł","Ł"],KeyM:[",","?","́","̋"],KeyN:["n","N","n","N"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","þ","Þ"],KeyQ:["a","A","æ","Æ"],KeyR:["r","R","¶","®"],KeyS:["s","S","ß","§"],KeyT:["t","T","ŧ","Ŧ"],KeyU:["u","U","↓","↑"],KeyV:["v","V","“","‘"],KeyW:["z","Z","«","<"],KeyX:["x","X","»",">"],KeyY:["y","Y","←","¥"],KeyZ:["w","W","ł","Ł"],Digit1:["&","1","¹","¡"],Digit2:["é","2","~","⅛"],Digit3:['"',"3","#","£"],Digit4:["'","4","{","$"],Digit5:["(","5","[","⅜"],Digit6:["-","6","|","⅝"],Digit7:["è","7","`","⅞"],Digit8:["_","8","\\","™"],Digit9:["ç","9","^","±"],Digit0:["à","0","@","°"],Enter:["\r","\r","\r","\r"],Escape:["","","",""],Backspace:["\b","\b","\b","\b"],Tab:["\t","","\t",""],Space:[" "," "," "," "],Minus:[")","°","]","¿"],Equal:["=","+","}","̨"],BracketLeft:["̂","̈","̈","̊"],BracketRight:["$","£","¤","̄"],Backslash:["*","µ","̀","̆"],Semicolon:["m","M","µ","º"],Quote:["ù","%","̂","̌"],Backquote:["²","~","¬","¬"],Comma:[";",".","─","×"],Period:[":","/","·","÷"],Slash:["!","§","̣","̇"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","¦"]}}),ia({id:"windows.french",locale:"fr",displayName:"French",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","€",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["é","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["è","7","`",""],Digit8:["_","8","\\",""],Digit9:["ç","9","^",""],Digit0:["à","0","@",""],Space:[" "," ","",""],Minus:[")","°","]",""],Equal:["=","+","}",""],BracketLeft:["^","¨","",""],BracketRight:["$","£","¤",""],Backslash:["*","µ","",""],Semicolon:["m","M","",""],Quote:["ù","%","",""],Backquote:["²","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","§","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}}),ia({id:"windows.german",locale:"de",displayName:"German",platform:"windows",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","€",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","µ",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"²",""],Digit3:["3","§","³",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["ß","?","\\","ẞ"],Equal:["´","`","",""],BracketLeft:["ü","Ü","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["ö","Ö","",""],Quote:["ä","Ä","",""],Backquote:["^","°","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}}),ia({id:"apple.german",locale:"de",displayName:"German",platform:"apple",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","∫","‹"],KeyC:["c","C","ç","Ç"],KeyD:["d","D","∂","™"],KeyE:["e","E","€","‰"],KeyF:["f","F","ƒ","Ï"],KeyG:["g","G","©","Ì"],KeyH:["h","H","ª","Ó"],KeyI:["i","I","⁄","Û"],KeyJ:["j","J","º","ı"],KeyK:["k","K","∆","ˆ"],KeyL:["l","L","@","fl"],KeyM:["m","M","µ","˘"],KeyN:["n","N","~","›"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","π","∏"],KeyQ:["q","Q","«","»"],KeyR:["r","R","®","¸"],KeyS:["s","S","‚","Í"],KeyT:["t","T","†","˝"],KeyU:["u","U","¨","Á"],KeyV:["v","V","√","◊"],KeyW:["w","W","∑","„"],KeyX:["x","X","≈","Ù"],KeyY:["z","Z","Ω","ˇ"],KeyZ:["y","Y","¥","‡"],Digit1:["1","!","¡","¬"],Digit2:["2",'"',"“","”"],Digit3:["3","§","¶","#"],Digit4:["4","$","¢","£"],Digit5:["5","%","[","fi"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","˜"],Digit9:["9",")","}","·"],Digit0:["0","=","≠","¯"],Space:[" "," "," "," "],Minus:["ß","?","¿","˙"],Equal:["´","`","'","˚"],BracketLeft:["ü","Ü","•","°"],BracketRight:["+","*","±",""],Backslash:["#","'","‘","’"],Semicolon:["ö","Ö","œ","Œ"],Quote:["ä","Ä","æ","Æ"],Backquote:["<",">","≤","≥"],Comma:[",",";","∞","˛"],Period:[".",":","…","÷"],Slash:["-","_","–","—"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","°","„","“"],NumpadEqual:["=","=","=","="]}});const ra=[{key:"ctrl+alt+e",command:["insert","\\text{cmd+alt+e}"]},{key:"cmd+alt+a",command:["insert","\\text{cmd+alt+a}"]},{key:"ctrl+alt+a",command:["insert","\\text{ctrl+alt+a}"]},{key:"meta+alt+2",command:["insert","\\text{meta+alt+2}"]},{key:"ctrl+alt+shift+a",command:["insert","\\text{ctrl+alt+shift+a}"]},{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendToPreviousChar"},{key:"shift+[ArrowRight]",command:"extendToNextChar"},{key:"shift+[ArrowUp]",command:"extendUp"},{key:"shift+[ArrowDown]",command:"extendDown"},{key:"[Backspace]",command:"deletePreviousChar"},{key:"alt+[Delete]",command:"deletePreviousChar"},{key:"[Delete]",command:"deleteNextChar"},{key:"alt+[Backspace]",command:"deleteNextChar"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"alt+shift+[ArrowLeft]",command:"extendToPreviousWord"},{key:"alt+shift+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"ctrl+shift+[ArrowLeft]",command:"extendToGroupStart"},{key:"ctrl+shift+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Space]",ifMode:"math",command:"moveAfterParent"},{key:"shift+[Space]",ifMode:"math",command:"moveBeforeParent"},{key:"[Home]",command:"moveToMathFieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathFieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"cmd+shift+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathFieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathFieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"cmd+shift+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",ifMode:"math",command:"moveToNextPlaceholder"},{key:"shift+[Tab]",ifMode:"math",command:"moveToPreviousPlaceholder"},{key:"[Tab]",ifMode:"text",command:"moveToNextPlaceholder"},{key:"shift+[Tab]",ifMode:"text",command:"moveToPreviousPlaceholder"},{key:"[Escape]",ifMode:"math",command:["switch-mode","command"]},{key:"\\",ifMode:"math",command:["switch-mode","command"]},{key:"alt+[Equal]",ifMode:"math",command:["applyStyle",{mode:"text"}]},{key:"alt+[Equal]",ifMode:"text",command:["applyStyle",{mode:"math"}]},{key:"[Escape]",ifMode:"command",command:["complete",{discard:!0}]},{key:"[Tab]",ifMode:"command",command:["complete",{acceptSuggestion:!0}]},{key:"[Return]",ifMode:"command",command:"complete"},{key:"[Enter]",ifMode:"command",command:"complete"},{key:"shift+[Escape]",ifMode:"command",command:["complete",{discard:!0}]},{key:"[ArrowDown]",ifMode:"command",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"command",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deletePreviousChar"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"[Undo]",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"cmd+shift+y",command:"redo"},{key:"ctrl+shift+z",ifPlatform:"!macos",command:"redo"},{key:"cmd+shift+z",command:"redo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathFieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathFieldEnd"},{key:"ctrl+shift+b",ifPlatform:"macos",command:"extendToPreviousChar"},{key:"ctrl+shift+f",ifPlatform:"macos",command:"extendToNextChar"},{key:"ctrl+shift+p",ifPlatform:"macos",command:"extendUp"},{key:"ctrl+shift+n",ifPlatform:"macos",command:"extendDown"},{key:"ctrl+shift+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"ctrl+shift+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"ctrl+alt+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"ctrl+alt+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"ctrl+shift+alt+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"ctrl+shift+alt+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deletePreviousChar"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteNextChar"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"shift+[Quote]",ifMode:"math",command:["switchMode","text","","“"]},{key:"shift+[Quote]",ifMode:"text",command:["switch-mode","math","”",""]},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","$$\\sqrt{#0}$$"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Minus]",ifMode:"math",command:"moveToSubscript"},{key:"alt+[BracketLeft]",ifMode:"math",command:["insert","$$\\left\\lbrack #0 \\right\\rbrack$$"]},{key:"alt+shift+[BracketLeft]",ifMode:"math",command:["insert","$$\\left\\lbrace #0 \\right\\rbrace$$"]},{key:"[Return]",ifMode:"math",command:"addRowAfter"},{key:"[Enter]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Comma]",ifMode:"math",command:"addColumnAfter"},{key:"[Return]",ifMode:"text",command:"addRowAfter"},{key:"[Enter]",ifMode:"text",command:"addRowAfter"},{key:"ctrl+[Comma]",ifMode:"text",command:"addColumnAfter"},{key:"alt+p",ifMode:"math",command:["insert","$$\\pi$$"]},{key:"alt+v",ifMode:"math",command:["insert","$$\\sqrt{#0}$$"]},{key:"alt+w",ifMode:"math",command:["insert","$$\\sum_{i=#?}^{#?}$$"]},{key:"alt+u",ifMode:"math",command:["insert","$$\\cup$$"]},{key:"alt+n",ifMode:"math",command:["insert","$$\\cap$$"]},{key:"alt+o",ifMode:"math",command:["insert","$$\\emptyset$$"]},{key:"alt+d",ifMode:"math",command:["insert","$$\\differentialD$$"]},{key:"alt+shift+o",ifMode:"math",command:["insert","$$\\varnothing$$"]},{key:"alt+shift+d",ifMode:"math",command:["insert","$$\\partial$$"]},{key:"alt+shift+p",ifMode:"math",command:["insert","$$\\prod_{i=#?}^{#?}$$"]},{key:"alt+shift+u",ifMode:"math",command:["insert","$$\\bigcup$$"]},{key:"alt+shift+n",ifMode:"math",command:["insert","$$\\bigcap$$"]},{key:"alt+shift+a",ifMode:"math",command:["insert","$$\\forall$$"]},{key:"alt+shift+e",ifMode:"math",command:["insert","$$\\exists$$"]},{key:"alt+[Digit5]",ifMode:"math",command:["insert","$\\infty$$"]},{key:"alt+[Digit6]",ifMode:"math",command:["insert","$$\\wedge$$"]},{key:"alt+shift+[Digit6]",ifMode:"math",command:["insert","$$\\vee$$"]},{key:"alt+[Digit9]",ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifMode:"math",command:["insert",")"]},{key:"alt+shift+[Backslash]",ifMode:"math",command:["insert","|"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","$$\\backslash$$"]},{key:"[Slash]",ifMode:"math",command:["insert","$$\\frac{#@}{#?}$$"]},{key:"alt+[Slash]",ifMode:"math",command:["insert","$$\\frac{#?}{#@}$$"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","$$\\frac{#@}{#?}$$"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+[Backquote]",ifMode:"math",command:["insert","$$\\~$$"]},{key:"alt+shift+[Slash]",ifMode:"math",command:["insert","$$\\/$$"]},{key:"alt+shift+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleVirtualKeyboard"},{key:"ctrl+alt+[ArrowUp]",command:["speak","parent",{withHighlighting:!1}]},{key:"ctrl+alt+[ArrowDown]",command:["speak","all",{withHighlighting:!1}]}],na={"\\theta":"alt+q","\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\prod":"alt+shift+p","\\sum":"alt+w","\\int":"alt+b","\\cup":"alt+u","\\cap":"alt+n","\\bigcup":"alt+shift+u","\\bigcap":"alt+shift+n","\\forall":"alt+shift+a","\\exists":"alt+shift+e","\\infty":"alt+[Digit5]","\\wedge":"alt+[Digit5]","\\vee":"alt+shift+[Digit6]","\\differentialD":"alt+d","\\partial":"alt+shift+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"alt+shift+o","\\~":"~"};function la(e){if((null===navigator||void 0===navigator?void 0:navigator.platform)&&(null===navigator||void 0===navigator?void 0:navigator.userAgent)){let t;if(/^(mac)/i.test(navigator.platform)?t="macos":/^(win)/i.test(navigator.platform)?t="windows":/(android)/i.test(navigator.userAgent)?t="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?t="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(t="chromeos"),e.startsWith("!")&&!e.endsWith(t))return!0;if(e.endsWith(t))return!0}return!1}function ca(t){let a=t;return e(a)&&(a=a.length>0?a[0]+"("+a.slice(1).join("")+")":""),a}function da(e){const t=la("macos")||la("ios"),a=e.split("+");let i="";for(const e of a)!t&&i&&(i+='+'),e.startsWith("Key")?i+=e.substr(3,1):e.startsWith("Digit")?i+=e.substr(5,1):i+={cmd:"⌘",meta:t?"⌘":"command",shift:t?"⇧":"shift",alt:t?"⌥":"alt",ctrl:t?"⌃":"control","\n":t?"⏎":"return","[return]":t?"⏎":"return","[enter]":t?"⌤":"enter","[tab]":t?"⇥":"tab","[escape]":"esc","[backspace]":t?"⌫":"backspace","[delete]":t?"⌦":"del","[pageup]":t?"⇞":"page up","[pagedown]":t?"⇟":"page down","[home]":t?"⤒":"home","[end]":t?"⤓":"end","[space]":"space","[equal]":"=","[minus]":"-","[comma]":",","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",bracketLeft:"[",bracketRight:"]",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* 🔢",numpaddivide:"/ 🔢",numpadsubtract:"- 🔢",numpadadd:"+ 🔢",numpaddecimal:". 🔢",numpadcomma:", 🔢",help:"help",left:"⇠",up:"⇡",right:"⇢",down:"⇣","[arrowleft]":"⇠","[arrowup]":"⇡","[arrowright]":"⇢","[arrowdown]":"⇣","[digit0]":"0","[digit1]":"1","[digit2]":"2","[digit3]":"3","[digit4]":"4","[digit5]":"5","[digit6]":"6","[digit7]":"7","[digit8]":"8","[digit9]":"9"}[e.toLowerCase()]||e.toUpperCase();return i}function ma(e,t){const a=[],i=[];return e.forEach(e=>{try{const t=function(e){if(e.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(e.ifPlatform))throw new Error(`Unexpected platform "${e.ifPlatform}" for keybinding ${e.key}`);let t=e.key.split("+");const a=t.pop();let i=e.ifPlatform;if(t=t.map(e=>{const t=e.toLowerCase();if("cmd"===t){if(i&&"macos"!==i&&"ios"!==i)throw new Error('Unexpected "cmd" modifier with platform "'+i+'"');return i||(i=la("ios")?"ios":"macos"),"meta"}if("win"===t){if(i&&"windows"!==i)throw new Error('Unexpected "win" modifier with platform "'+i+'"');return i="windows","meta"}return t}),!i||la(i)){if(/^\[(.*)\]$/.test(a))t.push(a);else{const i=function(e){var t,a;const i=null!==(t=ea[0])&&void 0!==t?t:Jt;for(const[t,a]of Object.entries(i.mapping))if(a[0]===e)return"["+t+"]";return null!==(a=Qt[e])&&void 0!==a?a:""}(a);if(!i)throw new Error('Invalid keybinding key "'+e.key+'"');t.push(i)}return{...e,ifPlatform:i,key:t.join("+")}}}(e);t&&a.push(t)}catch(e){i.push(e.message)}}),i.length>0&&t(i),a}function pa(e,t,a,i){const s=t.split(" ");for(const t of s){const s=t.match(/(.*):(.*)/);if(s){const t=null!=i?i:{};"active"===s[2]?t.passive=!1:t[s[2]]=!0,e.addEventListener(s[1],a,t)}else e.addEventListener(t,a,i)}}function ha(e,t,a,i){const s=t.split(" ");for(const t of s){const s=t.match(/(.*):(.*)/);if(s){const t=null!=i?i:{};"active"===s[2]?t.passive=!1:t[s[2]]=!0,e.removeEventListener(s[1],a,t)}else e.removeEventListener(t,a,i)}}function ua(e,t){let a=document.getElementById(e);return a?a.setAttribute("data-refcount",Number(parseInt(a.getAttribute("data-refcount"))+1).toString()):(a=document.createElement("div"),a.setAttribute("aria-hidden","true"),a.setAttribute("data-refcount","1"),a.className=t,a.id=e,document.body.appendChild(a)),a}function fa(e){if(!e)return;const t=parseInt(e.getAttribute("data-refcount"));t<=1?e.remove():e.setAttribute("data-refcount",Number(t-1).toString())}function ga(e){return e.element&&e.element.mathfield===e}function ya(e){const t=function e(t){if(t.classList.contains("ML__caret")||t.classList.contains("ML__text-caret")||t.classList.contains("ML__command-caret"))return t;let a;for(const i of t.children)if(a=e(i),a)break;return a}(e);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}function ba(e){const t=e.querySelectorAll(".ML__selected");if(t&&t.length>0){const a={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(e=>{const t=e.getBoundingClientRect();t.lefta.right&&(a.right=t.right),t.bottom>a.bottom&&(a.bottom=t.bottom),t.top{if("mousedown"!==a.type||1===a.buttons){a.stopPropagation(),a.preventDefault(),t.classList.add("pressed"),i=Date.now(),"touchstart"===a.type&&(o=a.changedTouches[0].identifier);const r=t.getAttribute("data-"+e.config.namespace+"command-pressed");r&&e.$perform(JSON.parse(r));const l=t.getAttribute("data-"+e.config.namespace+"command-pressAndHoldStart");l&&(s=t,n&&clearTimeout(n),n=window.setTimeout((function(){t.classList.contains("pressed")&&e.$perform(JSON.parse(l))}),300))}}),pa(t,"mouseleave touchcancel",()=>{t.classList.remove("pressed")}),pa(t,"touchmove:passive",e=>{e.preventDefault();for(let t=0;t{1===e.buttons&&t.classList.add("pressed")}),pa(t,"mouseup touchend click",a=>{if(r){a.stopPropagation(),a.preventDefault();const e=r;return r=null,void e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0}))}if(t.classList.remove("pressed"),t.classList.add("active"),"click"===a.type&&0!==a.detail)return a.stopPropagation(),void a.preventDefault();window.setTimeout((function(){t.classList.remove("active")}),150);let o=t.getAttribute("data-"+e.config.namespace+"command-pressAndHoldEnd");const n=Date.now();(t!==s||nequal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function ka(t,a,i){if(!a||0===a.length)return void Ma(t);const s=a,o=function(e,t){const a=ot(e,"math",null,t.config.macros);return q(_(Ne({mathstyle:c.displaystyle,macros:t.config.macros},a),"ML__base"),"ML__mathlive").toMarkup()}(a,t),r=function(t){let a=xa[t]||"";return e(a)&&(a=a.join("
    ")),a}(s),n=function(t,a){let i=[];if("string"==typeof a){const t=na[a];e(t)?i=t.slice():t&&i.push(t)}const s=ca(a),o=new RegExp("^"+s.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return t.forEach(e=>{o.test(ca(e.command))&&i.push(e)}),i.map(da)}(t.keybindings,s).join("
    ");let l=i?'
    ':"";l+='',l+='
    '+o+"
    ",r&&(l+='
    '+r+"
    "),n&&(l+='
    '+n+"
    "),l+="
    ",l+=i?'
    ':"",function(e,t){e.popover.innerHTML=e.config.createHTML(t);const a=ya(e.field);a&&Sa(e,a),e.popover.classList.add("is-visible")}(t,l);let d=t.popover.getElementsByClassName("ML__popover__content");d&&d.length>0&&va(t,d[0],{default:["complete",{acceptSuggestion:!0}]}),d=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),d&&d.length>0&&va(t,d[0],"previousSuggestion"),d=t.popover.getElementsByClassName("ML__popover__next-shortcut"),d&&d.length>0&&va(t,d[0],"nextSuggestion")}function wa(e,t){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(null==t?void 0:t.deferred)window.requestAnimationFrame(()=>wa(e));else if(Vt(e.model)&&"command"===Vt(e.model).type){const t=ya(e.field);t&&Sa(e,t)}else Ma(e)}function Sa(e,t){const a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,s=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,r=e.virtualKeyboardVisible?e.virtualKeyboard.offsetHeight:0;t.x+e.popover.offsetWidth/2>i-s?e.popover.style.left=i-e.popover.offsetWidth-s+"px":t.x-e.popover.offsetWidth/2<0?e.popover.style.left=0:e.popover.style.left=t.x-e.popover.offsetWidth/2+"px",t.y+e.popover.offsetHeight+5>a-o-r?(e.popover.classList.add("reverse-direction"),e.popover.style.top=t.y-t.height-e.popover.offsetHeight-5+"px"):(e.popover.classList.remove("reverse-direction"),e.popover.style.top=t.y+5+"px")}function Ma(e){e.popover.classList.remove("is-visible")}function La(e,t=!1){let a="";const i=Mt(e);if(i){const s=t?e.anchorOffset()+1:i.end,o=e.siblings();for(let e=i.start;e"placeholder"===e.type));Pt(e,0),e.path[e.path.length-1].offset=a.start-1,0!==i.length&&At(e,1,!1)||$t(e,a.start+t.length-1)}else e.siblings().splice(a.start,a.end-a.start),$t(e,a.start-1,0);wt(e)}}const $a={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function za(e){return e.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function _a(e,t){return e&&t.generateID?' extid="'+e+'"':""}function Da(e,t,a){let i=!1;t=t||e.atoms.length;let s="",o="",r=-1,n=-1;const l=e.atoms[e.index];if(e.index0){if(i=!0,qa(e)&&(r=e.index,e.index+=1),Ta(e)&&(n=e.index,e.index+=1),r>=0&&n>=0)s=""+o,s+=Oa(e.atoms[n].subscript,0,0,a).mathML,s+=Oa(e.atoms[r].superscript,0,0,a).mathML,s+="";else if(r>=0){if(s=""+o,qa(e)){const t=Oa(e.atoms[r].superscript,0,0,a).mathML,i=Oa(e.atoms[r+1].superscript,0,0,a).mathML;s+=""!==t&&""!==t||""!==i&&""!==i?""===t||""===t?"":t:""}else s+=Oa(e.atoms[r].superscript,0,0,a).mathML;s+=""}else n>=0?(s=""+o,s+=Oa(e.atoms[n].subscript,0,0,a).mathML,s+=""):s=o;"mi"!==e.lastType&&"mn"!==e.lastType&&"mtext"!==e.lastType&&"fence"!==e.lastType||/^(.*)<\/mo>$/.test(s)||(s=""+s),o.endsWith(">f")||o.endsWith(">g")?(s+="&x2061;",e.lastType="applyfunction"):e.lastType=/^(.*)<\/mo>$/.test(s)?"mo":"mi",e.mathML+=s}return i}function qa(e){return e.index"+e,s+=Oa(o.subscript,0,0,a).mathML,s+=Oa(o.superscript,0,0,a).mathML,s+=""):o.superscript?(s=""+e,s+=Oa(o.superscript,0,0,a).mathML,s+=""):o.subscript&&(s=""+e,s+=Oa(o.subscript,0,0,a).mathML,s+=""),s.length>0&&(i=!0,t.mathML+=s,t.lastType=""),i))}function Ea(e,t,a){let i=!1;t=t||e.atoms.length;const s=e.index;let o="";for(;e.index0&&(i=!0,o=""+o+"",e.mathML+=o,e.lastType="mtext"),i}function Fa(e,t,a){let i=!1;t=t||e.atoms.length;const s=e.index;let o="",r=function(e){let t=-1,a=e.index,i=!1,s=!1;for(;a=0&&r=0;)o+=e.atoms[e.index].body,e.index+=1;return o.length>0&&(i=!0,o=""+o+"",r<0&&qa(e)&&(r=e.index,e.index+=1),r>=0&&(o=""+o,o+=Oa(e.atoms[r].superscript,0,0,a).mathML,o+=""),e.mathML+=o,e.lastType="mn"),i}function Na(e,t,a){let i=!1;t=t||e.atoms.length;let s="",o="";if(e.index",s+=Ra(e.atoms[l],a),s+=Oa(e.atoms,l+1,c,a).mathML,s+=Ra(e.atoms[c],a),s+="","mi"!==e.lastType&&"mn"!==e.lastType&&"mfrac"!==e.lastType&&"fence"!==e.lastType||(s=""+s),e.index=c+1,Ka(s,e,a)&&(i=!0,e.lastType="",s=""),o="fence")}return s.length>0&&(i=!0,e.mathML+=s,e.lastType=o),i}function Ba(e,t,a){let i=!1;t=t||e.atoms.length;let s="",o="";const r=e.atoms[e.index];if(e.index":"")+e,s+=Oa(r.subscript,0,0,a).mathML,s+=Oa(r.superscript,0,0,a).mathML,s+="nolimits"!==r.limits?"":""):r.superscript?(s+=("nolimits"!==r.limits?"":"")+e,s+=Oa(r.superscript,0,0,a).mathML,s+="nolimits"!==r.limits?"":""):(s+=("nolimits"!==r.limits?"":"")+e,s+=Oa(r.subscript,0,0,a).mathML,s+="nolimits"!==r.limits?"":""),o="mo"}else{const t=e.atoms[e.index],r="\\operatorname"===t.symbol,n=r?'"+Pa(t.body)+"":Ra(t,a);s+=n,e.index+=1,Ka(s,e,a)&&(i=!0,e.lastType="",s=""),e.index-=1,r||/^(.*)<\/mo>$/.test(n)?o=r?"mi":"mo":(s+="",o="applyfunction")}"mi"!==e.lastType&&"mn"!==e.lastType||/^(.*)<\/mo>$/.test(s)||(s=""+s),e.index+=1}return s.length>0&&(i=!0,e.mathML+=s,e.lastType=o),i}function Oa(e,t,a,i){const s={atoms:e,index:null!=t?t:0,mathML:"",lastType:""};if("number"==typeof e||"boolean"==typeof e)s.mathML=e.toString();else if("string"==typeof e)s.mathML=e;else if(e instanceof Be)s.mathML=Ia(e,i);else if(Array.isArray(e)){let t=0;for(a=null!=a?a:e?e.length:0;s.index0&&"genfrac"===s.atoms[s.index].type&&(e=""+e),"genfrac"===s.atoms[s.index].type?s.lastType="mfrac":s.lastType="",e.length>0&&(s.mathML+=e,t+=1),s.index+=1}t>1&&(s.mathML=""+s.mathML+"")}return s}function Ra(e,t){let a="";const i=Pa(e.body);return i&&(a=""+i+""),a}function Pa(e){if(!e)return"";if("string"==typeof e)return za(e);if(!Array.isArray(e)&&"string"==typeof e.body)return za(e.body);let t="";for(const a of e)"string"==typeof a.body&&(t+=a.body);return za(t)}function Ia(e,t){const a={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋"},i={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},s={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let o,r,n,l,c,d,m="",p="",h={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[e.fontFamily||e.font]||"";h&&(h=' mathvariant="'+h+'"');const u=e.symbol;if("text"===e.mode)m=""+e.body+"";else switch(e.type){case"first":break;case"group":case"root":m=Oa(e.body,0,0,t).mathML;break;case"array":if((e.lFence&&"."!==e.lFence||e.rFence&&"."!==e.rFence)&&(m+="",e.lFence&&"."!==e.lFence&&(m+=""+($a[e.lFence]||e.lFence)+"")),m+="",o=0;o"+Oa(e.array[r][o],0,0,t).mathML+"";m+=""}m+="",(e.lFence&&"."!==e.lFence||e.rFence&&"."!==e.rFence)&&(e.rFence&&"."!==e.rFence&&(m+=""+($a[e.lFence]||e.rFence)+""),m+="");break;case"genfrac":(e.leftDelim||e.rightDelim)&&(m+=""),e.leftDelim&&"."!==e.leftDelim&&(m+=""+($a[e.leftDelim]||e.leftDelim)+""),e.hasBarLine?(m+="",m+=Oa(e.numer,0,0,t).mathML||" ",m+=Oa(e.denom,0,0,t).mathML||" ",m+=""):(m+="",m+=""+Oa(e.numer,0,0,t).mathML+"",m+=""+Oa(e.denom,0,0,t).mathML+"",m+=""),e.rightDelim&&"."!==e.rightDelim&&(m+=""+($a[e.rightDelim]||e.rightDelim)+""),(e.leftDelim||e.rightDelim)&&(m+="");break;case"surd":e.index?(m+="",m+=Oa(e.body,0,0,t).mathML,m+=Oa(e.index,0,0,t).mathML,m+=""):(m+="",m+=Oa(e.body,0,0,t).mathML,m+="");break;case"leftright":m="",e.leftDelim&&"."!==e.leftDelim&&(m+=""+($a[e.leftDelim]||e.leftDelim)+""),e.body&&(m+=Oa(e.body,0,0,t).mathML),e.rightDelim&&"."!==e.rightDelim&&(m+=""+($a[e.rightDelim]||e.rightDelim)+""),m+="";break;case"sizeddelim":case"delim":m+='"+($a[e.delim]||e.delim)+"";break;case"accent":m+='",m+=Oa(e.body,0,0,t).mathML,m+=""+($a[u]||e.accent)+"",m+="";break;case"line":case"overlap":break;case"overunder":c=e.overscript,l=e.underscript,(e.svgAbove||c)&&(e.svgBelow||l)?d=e.body:c?(d=e.body,e.body&&e.body[0]&&e.body[0].underscript?(l=e.body[0].underscript,d=e.body[0].body):e.body&&e.body[0]&&"first"===e.body[0].type&&e.body[1]&&e.body[1].underscript&&(l=e.body[1].underscript,d=e.body[1].body)):l&&(d=e.body,e.body&&e.body[0]&&e.body[0].overscript?(c=e.body[0].overscript,d=e.body[0].body):e.body&&e.body[0]&&"first"===e.body[0].type&&e.body[1]&&e.body[1].overscript&&(c=e.body[1].overscript,d=e.body[1].body)),(e.svgAbove||c)&&(e.svgBelow||l)?(m+=``,m+=a[e.svgBody]||Oa(d,0,0,t).mathML,m+=a[e.svgBelow]||Oa(l,0,0,t).mathML,m+=a[e.svgAbove]||Oa(c,0,0,t).mathML,m+=""):e.svgAbove||c?(m+=``+(a[e.svgBody]||Oa(d,0,0,t).mathML),m+=a[e.svgAbove]||Oa(c,0,0,t).mathML,m+=""):(e.svgBelow||l)&&(m+=``+(a[e.svgBody]||Oa(d,0,0,t).mathML),m+=a[e.svgBelow]||Oa(l,0,0,t).mathML,m+="");break;case"placeholder":case"mord":{m=i[u]||u||("string"==typeof e.body?e.body:"");const a=u?u.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;a?m="&#x"+a[1]+";":m.length>0&&"\\"===m.charAt(0)&&(m="string"==typeof e.body&&e.body.charCodeAt(0)>255?"&#x"+("000000"+e.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof e.body?e.body.charAt(0):e.body);const s=/\d/.test(m)?"mn":"mi";m="<"+s+h+_a(e.id,t)+">"+za(m)+"";break}case"mbin":case"mrel":case"textord":case"minner":m=u&&i[u]?""+i[u]+"":u&&$a[u]?""+$a[u]+"":Ra(e,t);break;case"mpunct":m='"+($a[u]||u)+"";break;case"mop":"​"!==e.body&&(m="",m+="\\operatorname"===u?e.body:u||e.body,m+="");break;case"mathstyle":break;case"box":m='"+Oa(e.body,0,0,t).mathML+"";break;case"spacing":m+='';break;case"enclose":m=''+Oa(e.body,0,0,t).mathML+"";break;case"space":m+=" "}return m}function Ha(e,t){return Oa(e,0,0,t).mathML}function Wa(e){let t=0;for(let a=0;a{ga(e)&&e.dirty&&Ua(e)}))}function Ua(e,t){t=null!=t?t:{},e.dirty=!1,window.mathlive||(window.mathlive={}),Vt(e.model)||(e.model.path=[{relation:"body",offset:0}]),e.model.root.forEach(e=>{e.caret="",e.isSelected=!1,e.containsCaret=!1});const a=e.$hasFocus();if(Rt(e.model)?Vt(e.model).caret=a&&!e.config.readOnly?e.mode:"":Gt(e.model,e=>{e.isSelected=!0}),a&&!e.config.readOnly){let t=e.model.ancestor(1),a=1,i=!1;for(;t&&!i;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,i=!0),a+=1,t=e.model.ancestor(a)}const i=_(Ne({mathstyle:c.displaystyle,letterShapeStyle:e.config.letterShapeStyle,atomIdsSettings:{seed:Wa(e.model.root.toLatex(!1)),groupNumbers:t.forHighlighting},smartFence:e.config.smartFence,macros:e.config.macros},e.model.root),"ML__base");i.attributes={translate:"no","aria-hidden":"true"};const s=q(i,"ML__mathlive");e.field.innerHTML=e.config.createHTML(s.toMarkup(0,e.config.horizontalSpacingScale)),e.field.classList.toggle("ML__focused",a&&!e.config.readOnly),e.accessibleNode.innerHTML=e.config.createHTML(''+Ha(e.model.root,e.config)+"");const o=ba(e.field);if(o){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=o.left+"px",t.style.top=o.top+"px",t.style.width=Math.ceil(o.right-o.left)+"px",t.style.height=Math.ceil(o.bottom-o.top-1)+"px",e.field.insertBefore(t,e.field.childNodes[0])}}const ja={};function Ga(e,t){t=null!=t?t:{target:"mathfield",canUndo:!1},Object.keys(e).forEach(a=>{ja[a]={...t,fn:e[a]}})}function Za(e,t=",",a){if(!e)return[];let i,s=[];for(let o of e)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(i?s.push(i):i=new Be("math","mpunct",t,a),s=s.concat(o));return s}function Xa(t,a){const i=t.parent();if(i&&"array"===i.type&&e(i.array)){const e=t.relation();if(i.array){const s=ut(i.array,e);"after row"===a||"before row"===a?(s.col=0,s.row=s.row+("after row"===a?1:0),i.array.splice(s.row,0,[[]])):(s.col+="after column"===a?1:0,i.array[s.row].splice(s.col,0,[]));const o=ht(i.array,s);t.path.pop(),t.path.push({relation:"cell"+o.toString(),offset:0}),t.insertFirstAtom()}}}function Ya(e){var t;const a=e.parent();if("leftright"===a.type){a.type="array";const i=null!==(t={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[a.leftDelim])&&void 0!==t?t:"matrix",s=ie(i),o=[[a.body]];Object.assign(a,s.parser(i,[],o)),a.mode=Lt(e),a.environmentName=i,a.array=o,a.rowGaps=[0],delete a.body,e.path[e.path.length-1].relation="cell0"}}function Ja(e){return kt(e),Ya(e),Xa(e,"after row"),wt(e),!0}function Qa(e){return kt(e),Ya(e),Xa(e,"after column"),wt(e),!0}function ei(e,t=0){kt(e),vt(e);const a=e.suppressChangeNotifications;if(e.suppressChangeNotifications=!0,t=t<0?-1:t>0?1:t,nt(e),e.parent().array&&t<0&&0===e.startOffset()){const t=e.parent().array;if(function(e){const t={col:0,row:0};for(;t.row0){let e=t.length;"first"===t[0].type&&(e-=1),e>0&&(a+=1)}i.row+=1}return a}(t,a.col)&&(function(e,t){let a=0;for(;a"placeholder"!==e.type&&"first"!==e.type);e.parent()[t]=null,e.path.pop(),e.siblings().splice(e.anchorOffset(),0,...a),$t(e,e.anchorOffset()-1),e.announce("deleted: "+t)}else if("denom"===t){const t=e.parent().numer.filter(e=>"placeholder"!==e.type&&"first"!==e.type),a=e.parent().denom.filter(e=>"placeholder"!==e.type&&"first"!==e.type);e.path.pop(),e.siblings().splice(e.anchorOffset(),1,...a),e.siblings().splice(e.anchorOffset(),0,...t),$t(e,e.anchorOffset()+t.length-1),e.announce("deleted: denominator")}else if("body"===t){const t=e.siblings().filter(e=>"placeholder"!==e.type);e.path.length>1&&(t.shift(),e.path.pop(),e.siblings().splice(e.anchorOffset(),1,...t),$t(e,e.anchorOffset()-1),e.announce("deleted: root"))}else Dt(e,-1),ti(e,-1)}else if(t>0)if(a!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(e.sibling(1).type)?Dt(e,1):(e.announce("deleted",null,i.slice(a+1,a+2)),i.splice(a+1,1));else if("numer"===e.relation()){const t=e.parent().numer.filter(e=>"placeholder"!==e.type&&"first"!==e.type),a=e.parent().denom.filter(e=>"placeholder"!==e.type&&"first"!==e.type);e.path.pop(),e.siblings().splice(e.anchorOffset(),1,...a),e.siblings().splice(e.anchorOffset(),0,...t),$t(e,e.anchorOffset()+t.length-1),e.announce("deleted: numerator")}else Dt(e,1),ti(e,-1)}else{const t=e.startOffset()+1,a=e.endOffset()+1;e.announce("deleted",null,i.slice(t,a)),i.splice(t,a-t),$t(e,t-1)}lt(e),e.suppressChangeNotifications=a,xt(e),wt(e)}function ti(e,t=0){if(0===t)ei(e,0);else if(t>0)for(;t>0;)ei(e,1),t--;else for(;t<0;)ei(e,-1),t++;return!0}Ga({performWithFeedback:(e,t)=>function(e,t){return e.$focus(),e.config.keypressVibration&&(null===navigator||void 0===navigator?void 0:navigator.vibrate)&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,e=>e[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?e.returnKeypressSound?(e.returnKeypressSound.load(),e.returnKeypressSound.play().catch(e=>{})):e.keypressSound&&(e.keypressSound.load(),e.keypressSound.play().catch(e=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!e.deleteKeypressSound?e.keypressSound&&(e.keypressSound.load(),e.keypressSound.play().catch(e=>{})):(e.deleteKeypressSound.load(),e.deleteKeypressSound.play().catch(e=>{})),e.$perform(t)}(e,t)}),Ga({addRowAfter:Ja,addColumnAfter:Qa,addRowBefore:function(e){return kt(e),Ya(e),Xa(e,"before row"),wt(e),!0},addColumnBefore:function(e){return kt(e),Ya(e),Xa(e,"before column"),wt(e),!0}},{target:"model",category:"array-edit"});const ai={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},arcsin:{mode:"math",value:"\\arcsin"},arccos:{mode:"math",value:"\\arccos"},arctan:{mode:"math",value:"\\arctan"},sin:{mode:"math",value:"\\sin"},sinh:{mode:"math",value:"\\sinh"},cos:{mode:"math",value:"\\cos"},cosh:{mode:"math",value:"\\cosh"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},sec:{mode:"math",value:"\\sec"},csc:{mode:"math",value:"\\csc"},cot:{mode:"math",value:"\\cot"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ii(e,t,a){var i;return function(e,t){if(!t)return"";if("string"==typeof t)return t;if(!e)return t.value;let a=!1,i=!1,s=!1,o=!1,r=!1,n=!1,l=!1,c=!1,d=!1,m=!1,p=!1,h=!1,u=!1,f=!1,g=e[e.length-1],y=e.length-1;for(;g&&/msubsup|placeholder/.test(g.type);)y-=1,g=e[y];if(a=!g||"first"===g.type,g){if(void 0!==t.mode&&g.mode!==t.mode)return"";u="text"===g.mode,i=!u&&"mord"===g.type&&V.test(g.body),s=!u&&"mord"===g.type&&/[0-9]+$/.test(g.body),o=!u&&g.isFunction,r="genfrac"===g.type,n="surd"===g.type,l="mbin"===g.type,c="mrel"===g.type,d="mpunct"===g.type||"minner"===g.type,m=!!g.array,p="mopen"===g.type,h="mclose"===g.type||"leftright"===g.type,f="space"===g.type}return void 0!==t.after?/nothing/.test(t.after)&&a||/letter/.test(t.after)&&i||/digit/.test(t.after)&&s||/function/.test(t.after)&&o||/frac/.test(t.after)&&r||/surd/.test(t.after)&&n||/binop/.test(t.after)&&l||/relop/.test(t.after)&&c||/punct/.test(t.after)&&d||/array/.test(t.after)&&m||/openfence/.test(t.after)&&p||/closefence/.test(t.after)&&h||/text/.test(t.after)&&u||/space/.test(t.after)&&f?t.value:"":t.value}(e,null!==(i=null==a?void 0:a[t])&&void 0!==i?i:ai[t])}function si(e,t){if(!e)return["latex",""];if(e.length<=1)return["latex",e];if(!t||"ASCIIMath"!==t.format){const t=e.trim();if(t.startsWith("$$")&&t.endsWith("$$")||t.startsWith("\\[")&&t.endsWith("\\]")||t.startsWith("\\(")&&t.endsWith("\\)"))return["latex",t.substring(2,t.length-2)];if(t.startsWith("$")&&t.endsWith("$"))return["latex",t.substring(1,t.length-1)];if(e=e.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(e))return["latex",e]}return e=(e=(e=(e=(e=(e=e.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),[(null==t?void 0:t.format)||"ASCIIMath",oi(e,null!=t?t:{})]}function oi(e,t){var a,i,s,o,r,n,l;if(!e)return"";let c,d=!1;if(d||"^"!==e[0]&&"_"!==e[0]||(c=ri(e.substr(1),{inlineShortcuts:null!==(a=null==t?void 0:t.inlineShortcuts)&&void 0!==a?a:{},noWrap:!0}),e=e[0]+"{"+c.match+"}",e+=oi(c.rest,t),d=!0),d||(c=e.match(/^(sqrt|\u221a)(.*)/),c&&(c=ri(c[2],{inlineShortcuts:null!==(i=null==t?void 0:t.inlineShortcuts)&&void 0!==i?i:{},noWrap:!0}),e="\\sqrt{"+c.match+"}",e+=oi(c.rest,t),d=!0)),d||(c=e.match(/^(\\cbrt|\u221b)(.*)/),c&&(c=ri(c[2],{inlineShortcuts:null!==(s=null==t?void 0:t.inlineShortcuts)&&void 0!==s?s:{},noWrap:!0}),e="\\sqrt[3]{"+c.match+"}",e+=oi(c.rest,t),d=!0)),d||(c=e.match(/^abs(.*)/),c&&(c=ri(c[1],{inlineShortcuts:null!==(o=null==t?void 0:t.inlineShortcuts)&&void 0!==o?o:{},noWrap:!0}),e="\\left|"+c.match+"\\right|",e+=oi(c.rest,t),d=!0)),d||(c=e.match(/^["”“](.*?)["”“](.*)/),c&&(e="\\text{"+c[1]+"}",e+=oi(c[2],t),d=!0)),d||(c=e.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),c&&(e=ni(c[1],t),e+=oi(c[2],t),d=!0)),!d&&/^(f|g|h)[^a-zA-Z]/.test(e)&&(c=ri(e.substring(1),{inlineShortcuts:null!==(r=t.inlineShortcuts)&&void 0!==r?r:{},noWrap:!0}),e="("===e[1]?e[0]+"\\mleft("+c.match+"\\mright)":e[0]+c.match,e+=oi(c.rest,t),d=!0),d||(c=e.match(/^([a-zA-Z]+)(.*)/),c&&(e=ni(c[1],t),e+=oi(c[2],t),d=!0)),!d)if(c=ri(e,{inlineShortcuts:null!==(n=t.inlineShortcuts)&&void 0!==n?n:{},noWrap:!0}),c.match&&"/"===c.rest[0]){const a=ri(c.rest.substr(1),{inlineShortcuts:null!==(l=t.inlineShortcuts)&&void 0!==l?l:{},noWrap:!0});a.match&&(e="\\frac{"+c.match+"}{"+a.match+"}"+oi(a.rest,t)),d=!0}else c.match&&(e="("===e[0]?"\\left("+c.match+"\\right)"+oi(c.rest,t):c.match+oi(c.rest,t),d=!0);return d||(c=e.match(/^(\s+)(.*)$/),c&&(e=" "+oi(c[2],t),d=!0)),e}function ri(e,t){let a="",i=e=e.trim(),s=e.charAt(0),o={"(":")","{":"}","[":"]"}[s];if(o){let r=1,n=1;for(;n0;)e[n]===s&&r++,e[n]===o&&r--,n++;0===r?(t.noWrap&&"("===s?a=oi(e.substring(1,n-1),t):("{"===s&&"}"===o&&(s="\\{",o="\\}"),a="\\left"+s+oi(e.substring(1,n-1),t)+"\\right"+o),i=e.substring(n)):(a=e.substring(1,n),i="")}else{let s=e.match(/^([a-zA-Z]+)/);if(s){let a=ii(null,e,t.inlineShortcuts);if(a)return a=a.replace("_{#?}",""),a=a.replace("^{#?}",""),{match:a,rest:e.substring(a.length)}}if(s=e.match(/^([a-zA-Z])/),s)return{match:s[1],rest:e.substring(1)};if(s=e.match(/^(-)?\d+(\.\d*)?/),s)return{match:s[0],rest:e.substring(s[0].length)};/^\\(left|right)/.test(e)||(s=e.match(/^(\\[a-zA-Z]+)/),s&&(i=e.substring(s[1].length),a=s[1]))}return{match:a,rest:i}}function ni(e,t){let a=ii(null,e,t);return a?(a=a.replace("_{#?}",""),a=a.replace("^{#?}",""),a+=" "):a=e,a}function li(e,t,a){const i=e.parent();let s="leftright"===i.type?i.leftDelim+i.rightDelim:"";if("\\lbrace\\rbrace"===s&&(s="{}"),"\\{\\}"===s&&(s="{}"),"{}"===s&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return di(e,"\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:a}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrock");const o=I[t];if(o&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const s=Rt(e)||"placeholder"===Vt(e).type;i=e.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=s?"?":o;let r=[];return s&&(r=e.siblings().splice(e.anchorOffset()+1,e.siblings().length)),di(e,i,{mode:"math",format:"latex",style:a}),s&&(e.sibling(0).body=r,Dt(e,-1)),!0}let r;if(Object.keys(I).forEach(e=>{t===I[e]&&(r=e)}),r){if(i&&"leftright"===i.type&&e.endOffset()===e.siblings().length-1)return kt(e),i.rightDelim=t,Dt(e,1),wt(e),!0;const s=e.siblings();let o;for(o=e.endOffset();o>=0&&("leftright"!==s[o].type||"?"!==s[o].rightDelim);o--);if(o>=0)return kt(e),s[o].rightDelim=t,s[o].body=s[o].body.concat(s.slice(o+1,e.endOffset()+1)),s.splice(o+1,e.endOffset()-o),$t(e,o),wt(e),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){kt(e),i.rightDelim=t;const a=s.slice(e.endOffset()+1);return s.splice(e.endOffset()+1),e.path.pop(),e.siblings().splice(e.endOffset()+1,0,...a),wt(e),!0}const r=e.ancestor(2);return!(!r||"leftright"!==r.type||"?"!==r.rightDelim||e.endOffset()!==s.length-1)&&(Dt(e,1),li(e,t,a))}return!1}function ci(e,t){if(Rt(e))return!1;function a(t,a){let i=!0;return Gt(e,e=>{i=i&&e[t]===a},{recursive:!0}),i}return t.color&&a("color",t.color)&&(t.color="none"),t.backgroundColor&&a("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&a("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&a("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&a("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&a("fontSize",t.fontSize)&&(t.fontSize="size5"),kt(e),Gt(e,e=>e.applyStyle(t),{recursive:!0}),wt(e),!0}function di(e,t,a){var i,s,o,r;if(null!==(i=a.smartFence)&&void 0!==i&&i){if(li(e,t,a.style))return}else{const a=e.parent();if("leftright"===(null==a?void 0:a.type)&&"?"===a.rightDelim&&e.endOffset()===e.siblings().length-1&&/^[)}\]|]$/.test(t))return kt(e),a.rightDelim=t,Dt(e,1),void wt(e)}const n=e.suppressChangeNotifications;a.suppressChangeNotifications&&(e.suppressChangeNotifications=!0),kt(e);const l=e.suppressChangeNotifications;e.suppressChangeNotifications=!0,a.insertionMode||(a.insertionMode="replaceSelection"),a.selectionMode||(a.selectionMode="placeholder"),a.format||(a.format="auto"),a.macros=null!==(s=a.macros)&&void 0!==s?s:e.options.macros;const c=a.mode||Lt(e);let d;const m=[Nt(e)],p=null!==(o=a.placeholder)&&void 0!==o?o:"\\placeholder{}";m["?"]=p,"replaceSelection"!==a.insertionMode||Rt(e)?"replaceAll"===a.insertionMode?(e.root.body=[],e.root.latex="",e.path=[{relation:"body",offset:0}],e.extent=0):"insertBefore"===a.insertionMode?Ht(e):"insertAfter"===a.insertionMode&&It(e):ti(e);const h=e.siblings(),u=e.startOffset();if(u+10&&h[u]&&"placeholder"===h[u].type&&ti(e,-1),"math"===c&&"ASCIIMath"===a.format)[,t]=si(t,{format:"ASCIIMath"}),d=ot(t,"math",null,null==a?void 0:a.macros,!1,e.listeners.onError),pi(e,d);else if("text"===c||"auto"!==a.format&&"latex"!==a.format)"text"!==c&&"text"!==a.format||(d=ot(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),"text",m,a.macros,!1,e.listeners.onError));else if("command"===c){d=[];for(const e of t)W.test(e)&&d.push(new Be("command","command",e))}else if(""===t)d=[new Be("command","command","\\")];else{if("auto"===a.format&&([a.format,t]=si(t)),m[0])t=t.replace(/(^|[^\\])#@/g,"$1#0");else if(/(^|[^\\])#@/.test(t)){const a=function(e){const t=e.siblings();let a=e.startOffset();if("text"===t[a].mode)for(;a>=1&&"text"===t[a].mode;)a--;else for(;a>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[a].type);)a--;return a}(e);t=t.replace(/(^|[^\\])#@/g,"$1"+function(e,t,a){const i=e.siblings();if(rt(i))return"";if("first"===i[0].type&&0===t&&(t=1),"root"===e.parent().type&&1===t&&a===i.length-1)return e.parent().toLatex(!1);let s="",o=t;for(;o<=a;)s+=i[o].toLatex(!1),o++;return s}(e,a+1,e.startOffset())),function(e,t){t>0?e.siblings().splice(e.anchorOffset()+1,t):(e.siblings().splice(e.anchorOffset()+t+1,-t),$t(e,e.anchorOffset()+t))}(e,a-e.startOffset())}else t=t.replace(/(^|[^\\])#@/g,"$1#?");/^\$\$(.*)\$\$$/.test(t)&&(t=t.substring(2,t.length-2)),d=ot(t,c,m,a.macros,null!==(r=a.smartFence)&&void 0!==r&&r,e.listeners.onError),"latex"!==a.format&&pi(e,d)}lt(e),function e(t,a){t&&a&&(Re(t)?t.forEach(t=>e(t,a)):"object"==typeof t&&(t.color||t.backgroundColor||t.fontFamily||t.fontShape||t.fontSeries||t.fontSize||(t.applyStyle(a),e(t.body,a),e(t.numer,a),e(t.denom,a),e(t.index,a),e(t.overscript,a),e(t.underscript,a),e(t.subscript,a),e(t.superscript,a))))}(d,a.style);const f=e.parent();if("latex"!==a.format&&e.options.removeExtraneousParentheses&&f&&"leftright"===f.type&&"("===f.leftDelim&&rt(f.body)&&d&&1===d.length&&"genfrac"===d[0].type?(e.path.pop(),e.siblings()[e.anchorOffset()]=d[0]):("latex"!==a.format||1!==m.length||m[0]||"root"===f.type&&rt(f.body)&&(f.latex=t),Array.prototype.splice.apply(e.siblings(),[e.anchorOffset()+1,0].concat(d))),e.insertFirstAtom(),e.suppressChangeNotifications=l,"placeholder"===a.selectionMode){let t=[];for(const e of d)t=t.concat(e.filter(e=>"placeholder"===e.type));0!==t.length&&At(e,1,!1)?e.announce("move"):$t(e,e.anchorOffset()+d.length)}else"before"===a.selectionMode||("after"===a.selectionMode?$t(e,e.anchorOffset()+d.length):"item"===a.selectionMode&&$t(e,e.anchorOffset(),d.length));wt(e),e.suppressChangeNotifications=n}function mi(e){if(e)return 1===e.length&&"leftright"===e[0].type&&"("===e[0].leftDelim&&(e=e[0].body),e}function pi(e,t){if(t&&e.options.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Re(t[e].body)){let a=0,i=0,s=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(a++,i=o),"first"!==t[e].body[o].type&&s++;0===s&&1===a&&(t[e]=t[e].body[i])}t.forEach(t=>{if("genfrac"===t.type&&(pi(e,t.numer),pi(e,t.denom),t.numer=mi(t.numer),t.denom=mi(t.denom)),t.superscript&&(pi(e,t.superscript),t.superscript=mi(t.superscript)),t.subscript&&(pi(e,t.subscript),t.subscript=mi(t.subscript)),t.underscript&&(pi(e,t.underscript),t.underscript=mi(t.underscript)),t.overscript&&(pi(e,t.overscript),t.overscript=mi(t.overscript)),t.index&&(pi(e,t.index),t.index=mi(t.index)),"surd"===t.type?(pi(e,t.body),t.body=mi(t.body)):Re(t.body)&&pi(e,t.body),t.array)for(let a=gt(t.array);a>=0;a--)pi(e,ft(t.array,a))})}}function hi(e){if(It(e),!Vt(e).superscript)if(Vt(e).subscript)Vt(e).superscript=[new Be("","first")];else{const t=e.sibling(1);(null==t?void 0:t.superscript)?e.path[e.path.length-1].offset+=1:(null==t?void 0:t.subscript)?(e.path[e.path.length-1].offset+=1,Vt(e).superscript=[new Be("","first")]):("limits"!==Vt(e).limits&&(e.siblings().splice(e.anchorOffset()+1,0,new Be(e.parent().mode,"msubsup","​",Ct(e))),e.path[e.path.length-1].offset+=1),Vt(e).superscript=[new Be("","first")])}return e.path.push({relation:"superscript",offset:0}),Bt(e),!0}Ga({moveToOpposite:e=>{const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[e.relation()];return t||hi(e),e.parent()[t]||(e.parent()[t]=[new Be("","first")]),$t(e,0,"end",t),!0},moveBeforeParent:e=>e.path.length>1?(e.path.pop(),$t(e,e.anchorOffset()-1),!0):(e.announce("plonk"),!1),moveAfterParent:e=>Wt(e),moveToNextPlaceholder:e=>At(e,1),moveToPreviousPlaceholder:e=>At(e,-1),moveToNextChar:e=>Dt(e,1),moveToPreviousChar:e=>Dt(e,-1),moveUp:e=>qt(e),moveDown:e=>Tt(e),moveToNextWord:e=>Et(e,1),moveToPreviousWord:e=>Et(e,-1),moveToGroupStart:e=>$t(e,0),moveToGroupEnd:e=>$t(e,-1),moveToMathFieldStart:e=>Ft(e,-1),moveToMathFieldEnd:e=>Ft(e,1),moveToSuperscript:e=>hi(e),moveToSubscript:e=>function(e){if(It(e),!Vt(e).subscript)if(Vt(e).superscript)Vt(e).subscript=[new Be("","first")];else{const t=e.sibling(1);(null==t?void 0:t.subscript)?e.path[e.path.length-1].offset+=1:(null==t?void 0:t.superscript)?(e.path[e.path.length-1].offset+=1,Vt(e).subscript=[new Be("","first")]):("limits"!==Vt(e).limits&&(e.siblings().splice(e.anchorOffset()+1,0,new Be(e.parent().mode,"msubsup","​",Ct(e))),e.path[e.path.length-1].offset+=1),Vt(e).subscript=[new Be("","first")])}return e.path.push({relation:"subscript",offset:0}),Bt(e),!0}(e)},{target:"model",category:"selection-anchor"}),Ga({selectGroup:e=>Bt(e),selectAll:e=>Ot(e),extendToNextChar:e=>Kt(e,1),extendToPreviousChar:e=>Kt(e,-1),extendToNextWord:e=>Et(e,1,{extend:!0}),extendToPreviousWord:e=>Et(e,-1,{extend:!0}),extendUp:e=>qt(e,{extend:!0}),extendDown:e=>Tt(e,{extend:!0}),extendToNextBoundary:e=>Et(e,1,{extend:!0}),extendToPreviousBoundary:e=>Et(e,-1,{extend:!0}),extendToGroupStart:e=>Pt(e,-e.anchorOffset()),extendToGroupEnd:e=>Pt(e,e.siblings().length-e.anchorOffset()),extendToMathFieldStart:e=>Ft(e,-1,{extend:!0}),extendToMathFieldEnd:e=>Ft(e,1,{extend:!0})},{target:"model",category:"selection-extend"}),Ga({deleteAll:e=>(Ot(e),ti(e)),deleteNextChar:e=>ti(e,1),deletePreviousChar:e=>ti(e,-1),deleteNextWord:e=>(Et(e,1,{extend:!0}),ti(e)),deletePreviousWord:e=>(Et(e,-1,{extend:!0}),ti(e)),deleteToGroupStart:e=>(Pt(e,-e.anchorOffset()),ti(e)),deleteToGroupEnd:e=>(Ft(e,-1,{extend:!0}),ti(e)),deleteToMathFieldStart:e=>(Ft(e,-1,{extend:!0}),ti(e)),deleteToMathFieldEnd:e=>(Ft(e,1,{extend:!0}),ti(e))},{target:"model",category:"delete"});const ui=["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"];function fi(e){return!e.ctrlKey&&!e.metaKey&&"Dead"!==e.key&&ui.indexOf(e.code)>=0}function gi(e){const t=[];return(e=function(e){if(!e.code){const t=Object.entries(oa().mapping);let a,i=!1,s=!1;for(let o=0;o<4;o++){for(const[r,n]of t)if(n[o]===e.key){a=r,3===o?(i=!0,s=!0):2===o?i=!0:1===o&&(s=!0);break}if(a)break}return new KeyboardEvent(e.type,{...e,altKey:i,shiftKey:s,code:a})}return new KeyboardEvent(e.type,e)}(e)).ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),0===t.length?"["+e.code+"]":(t.push("["+e.code+"]"),t.join("+"))}function yi(e){var t;if(!e)return"";let a;return"Unidentified"===e.key&&e.target&&(a=e.target.value),a=null!==(t=null!=a?a:e.key)&&void 0!==t?t:e.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(a)&&(a=""),a}class bi{constructor(e){this.mathlist=e,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(e){this.canUndo()&&("function"==typeof(null==e?void 0:e.onUndoStateWillChange)&&e.onUndoStateWillChange(this.mathlist.mathfield,"undo"),this.restore(this.stack[this.index-1],e),this.index-=1,e&&"function"==typeof e.onUndoStateDidChange&&e.onUndoStateDidChange(this.mathlist.mathfield,"undo"),this.canCoalesce=!1)}redo(e){this.canRedo()&&("function"==typeof(null==e?void 0:e.onUndoStateWillChange)&&e.onUndoStateWillChange(this.mathlist.mathfield,"redo"),this.index+=1,this.restore(this.stack[this.index],e),e&&"function"==typeof e.onUndoStateDidChange&&e.onUndoStateDidChange(this.mathlist.mathfield,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(e){this.record&&("function"==typeof(null==e?void 0:e.onUndoStateWillChange)&&e.onUndoStateWillChange(this.mathlist.mathfield,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(!1),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),e&&"function"==typeof e.onUndoStateDidChange&&e.onUndoStateDidChange(this.mathlist.mathfield,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(e){this.canCoalesce&&this.pop(),this.snapshot(e),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(!1),selection:this.mathlist.toString()}}restore(e,t){const a=this.mathlist.suppressChangeNotifications;void 0!==t.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=t.suppressChangeNotifications),di(this.mathlist,e?e.latex:"",{...t,format:"latex",mode:"math",insertionMode:"replaceAll",selectionMode:"after",smartFence:!1}),jt(this.mathlist,e?e.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=a}}const vi={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},xi={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"};function ki(t){if(!t)return"";if(e(t)){let e="";if(0===t.length)return"";if("first"===t[0].type&&t.shift(),0===t.length)return"";if("text"===t[0].mode){let a=0;for(e='"';t[a]&&"text"===t[a].mode;)e+=t[a].body,a++;e+='"'+ki(t.slice(a))}else if("math"===t[0].mode){let a=0;for(;t[a]&&"math"===t[a].mode;)e+=ki(t[a]),a++;e+=ki(t.slice(a))}return e.trim()}if("text"===t.mode)return'"'+t.body+'"';let a="";const i=t.symbol;let s;switch(t.type){case"group":case"root":a=ki(t.body);break;case"array":break;case"genfrac":(t.leftDelim||t.rightDelim)&&(a+="."!==t.leftDelim&&t.leftDelim?t.leftDelim:"{:"),t.hasBarLine?(a+="(",a+=ki(t.numer),a+=")/(",a+=ki(t.denom),a+=")"):(a+="("+ki(t.numer)+"),",a+="("+ki(t.denom)+")"),(t.leftDelim||t.rightDelim)&&(a+="."!==t.rightDelim&&t.rightDelim?t.rightDelim:"{:");break;case"surd":t.index?a+="root("+ki(t.index)+")("+ki(t.body)+")":a+="sqrt("+ki(t.body)+")";break;case"leftright":a+="."!==t.leftDelim&&t.leftDelim?t.leftDelim:"{:",a+=ki(t.body),a+="."!==t.rightDelim&&t.rightDelim?t.rightDelim:":}";break;case"sizeddelim":case"delim":case"overlap":case"overunder":break;case"mord":a=vi[i]||i||("string"==typeof t.body?t.body:""),"\\"===a[0]&&(a+=""),s=i?i.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,s?a=String.fromCharCode(parseInt("0x"+s[1])):a.length>0&&"\\"===a.charAt(0)&&(a="string"==typeof t.body?t.body.charAt(0):t.symbol);break;case"mbin":case"mrel":case"textord":case"minner":a=i&&vi[i]?vi[i]:i&&xi[i]?xi[i]:t.body;break;case"mopen":case"mclose":a+=t.body;break;case"mpunct":a=xi[i]||i;break;case"mop":"​"!==t.body&&(a="",a+="\\operatorname"===i?ki(t.body):t.body||i,a+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":a=" "}if(t.subscript){a+="_";const e=ki(t.subscript);e.length>1&&!/^(-)?\d+(\.\d*)?$/.test(e)?a+="("+e+")":a+=e}if(t.superscript){a+="^";const e=ki(t.superscript);e.length>1&&!/^(-)?\d+(\.\d*)?$/.test(e)?a+="("+e+")":a+=e}return a}const wi={};function Si(e){const t=wi.locale.substring(0,2);let a="";return wi.strings[wi.locale]&&(a=wi.strings[wi.locale][e]),!a&&wi.strings[t]&&(a=wi.strings[t][e]),a||(a=wi.strings.en[e]),a||(a=e),a}function Mi(e,t,a){nt(e);const i=[],s=t.substr(a);for(const e of s){const t=new Be("command","command",e);t.suggestion=!0,i.push(t)}Array.prototype.splice.apply(e.siblings(),[e.anchorOffset()+1,0].concat(i))}function Li(e,t){if(t=t||{acceptSuggestion:!1},Ma(e),t.discard)return Aa(e.model,null),e.switchMode("math"),!0;const a=La(e.model,!t.acceptSuggestion);if(a){if("\\("===a||"\\)"===a)Aa(e.model,[]),di(e.model,a.slice(1),{mode:e.mode});else{e.switchMode("math");const t=ot(a,"math",null,e.config.macros);t?Aa(e.model,t):Ca(e.model,!0)}return e.snapshot(),e.model.announce("replacement"),!0}return!1}function Ci(e){!function(e){const t=e.siblings(),a=Mt(e);let i=a.start;for(;i1)}return Va(e),!0}wi.plural=function(e,t,a){(a=null!=a?a:{}).type=a.type||"cardinal";const i=wi.locale.substring(0,2),s="ordinal"===a.type?wi._ordinal:wi._cardinal;let o,r="ordinal"===a.type?wi._ordinalPluralCategories.indexOf(s.select(e)):wi._cardinalPluralCategories.indexOf(s.select(e));return wi.strings[wi.locale]&&(o=wi.strings[wi.locale][t]),!o&&wi.strings[i]&&(o=wi.strings[i][t]),o||(o=wi.strings.en[t],o||(o=t),r="ordinal"===a.type?wi._ordinalPluralCategories.indexOf(wi._ordinalEnglish.select(e)):wi._cardinalPluralCategories.indexOf(wi._cardinalEnglish.select(e))),o.split(";")[r]||o.split(";")[0]},wi.merge=function(e,t){if(e&&t){const a=wi._locale;wi.locale=e,wi.strings[e]={...wi.strings[e],...t},wi.locale=a}else e&&!t&&Object.keys(e).forEach(t=>wi.merge(t,e[t]))},Object.defineProperty(wi,"locale",{set(e){wi._locale=e,wi._ordinal=null,wi._cardinal=null},get(){var e;return wi._locale||(wi._locale=null!==(e=null===navigator||void 0===navigator?void 0:navigator.language.slice(0,5))&&void 0!==e?e:"en"),wi._locale}}),Object.defineProperty(wi,"ordinal",{get:()=>(wi._ordinal||(wi._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),wi._ordinalEnglishPluralCategories=wi._ordinalEnglish.resolvedOptions().pluralCategories,wi._ordinal=new Intl.PluralRules(wi.locale,{type:"ordinal"}),wi._ordinalPluralCategories=wi._ordinal.resolvedOptions().pluralCategories),wi._ordinal)}),Object.defineProperty(wi,"cardinal",{get:()=>(wi._cardinal||(wi._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),wi._cardinalEnglishPluralCategories=wi._cardinalEnglish.resolvedOptions().pluralCategories,wi._cardinal=new Intl.PluralRules(wi.locale,{type:"cardinal"}),wi._cardinalPluralCategories=wi._ordinal.resolvedOptions().pluralCategories),wi._cardinal)}),wi.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.symbols":"Symbols","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.symbols":"حرف او رمز","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.symbols":"Symbole","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.symbols":"σύμβολα","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.symbols":"Símbolos","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.symbols":"نمادها","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"حروف رومی","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.symbols":"Symboles","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres romaines","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.symbols":"Simboli","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.symbols":"シンボル","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"ローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.symbols":"Symbolika","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.symbols":"Символы","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Латинские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}},Ga({complete:Li,nextSuggestion:function(e){return e.suggestionIndex+=1,Ci(e),!1},previousSuggestion:function(e){if(e.suggestionIndex-=1,e.suggestionIndex<0){nt(e.model);const t=oe(La(e.model));e.suggestionIndex=t.length-1}return Ci(e),!1}},{target:"mathfield",category:"autocomplete"});const Ai={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"eye ","\\sum":"Summation ","\\prod":"Product ",a:'a',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function $i(e){let t=0;if(Re(e))for(const a of e)"first"!==a.type&&(t+=1);return 1===t}function zi(e){let t="";if(Re(e))for(const a of e)"first"!==a.type&&"string"==typeof a.body&&(t+=a.body);return t}function _i(e,t){var a;const i={...t,textToSpeechRulesOptions:{...t.textToSpeechRulesOptions}};if(window.sre&&"sre"===i.textToSpeechRules){const t=Ha(e,i);return t?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=null!==(a=i.textToSpeechRulesOptions)&&void 0!==a?a:{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(t)):""}let s=function e(t,a,i){function s(e){return""+e+""}if(!a)return"";let o="";if(Re(a)){let r=!1,n=!1;for(let l=0;l'),o+=a.body;else{a.id&&"math"===t&&(o+='');let r="",n="",l="",c=!1;switch(a.type){case"group":case"root":o+=e("math",a.body,i);break;case"genfrac":if(r=e("math",a.numer,i),n=e("math",a.denom,i),$i(a.numer)&&$i(a.denom)){const e={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[zi(a.numer)+"/"+zi(a.denom)];e?o=e:o+=r+" over "+n}else o+=' the fraction '+r+', over '+n+'. End fraction.';break;case"surd":if(l=e("math",a.body,i),a.index){let t=e("math",a.index,i);t=t.trim();const s=t.replace(//g,"");o+="3"===s?' the cube root of '+l+'. End cube root':"n"===s?' the nth root of '+l+'. End root':' the root with index: '+t+', of '+l+'. End root'}else $i(a.body)?o+=" the square root of "+l+" , ":o+=' the square root of '+l+'. End square root';break;case"leftright":o+=Ai[a.leftDelim]||a.leftDelim,o+=e("math",a.body,i),o+=Ai[a.rightDelim]||a.rightDelim;break;case"rule":case"overunder":case"overlap":break;case"placeholder":o+="placeholder "+a.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const s=a.symbol;if("\\mathbin"===s||"\\mathrel"===s||"\\mathopen"===s||"\\mathclose"===s||"\\mathpunct"===s||"\\mathord"===s||"\\mathinner"===s){o=e(t,a.body,i);break}let r=a.body,n=a.symbol;if("delim"!==a.type&&"sizeddelim"!==a.type||(r=n=a.delim),"text"===t)o+=r;else{if("mbin"===a.type&&(o+=''),r){const e=Ai[r]||(n?Ai[n.trim()]:"");if(e)o+=" "+e;else{const e=n?function(e){let t="";return"\\"===e.charAt(0)&&(t=" "+e.replace("\\","")+" "),t}(n.trim()):"";o+=e||function(e){let t="";return i.textToSpeechMarkup?/[a-z]/.test(e)?t+=' '+e+"":/[A-Z]/.test(e)?t+="capital "+e.toLowerCase():t+=e:/[a-z]/.test(e)?t+=" '"+e.toUpperCase()+"'":/[A-Z]/.test(e)?t+=" 'capital "+e.toUpperCase()+"'":t+=e,t}(r)}}else o+=e("math",a.body,i);"mbin"===a.type&&(o+='')}break}case"mop":if("​"!==a.body){const t=a.symbol;if("\\sum"===t)if(a.superscript&&a.subscript){let t=e("math",a.superscript,i);t=t.trim();let s=e("math",a.subscript,i);s=s.trim(),o+=' the summation from '+s+' to '+t+' of ',c=!0}else if(a.subscript){let t=e("math",a.subscript,i);t=t.trim(),o+=' the summation from '+t+' of ',c=!0}else o+=" the summation of";else if("\\prod"===t)if(a.superscript&&a.subscript){let t=e("math",a.superscript,i);t=t.trim();let s=e("math",a.subscript,i);s=s.trim(),o+=' the product from '+s+' to '+t+' of ',c=!0}else if(a.subscript){let t=e("math",a.subscript,i);t=t.trim(),o+=' the product from '+t+' of ',c=!0}else o+=" the product of ";else if("\\int"===t)if(a.superscript&&a.subscript){let t=e("math",a.superscript,i);t=t.trim();let r=e("math",a.subscript,i);r=r.trim(),o+=' the integral from '+s(r)+' to '+s(t)+' of ',c=!0}else o+=' the integral of ';else"string"==typeof a.body?o+=Ai[a.body]||Ai[a.symbol]||" "+a.body:a.symbol&&("\\"===a.symbol[0]?o+=" "+a.symbol.substr(1):o+=" "+a.symbol)}break;case"enclose":l=e("math",a.body,i),$i(a.body)?o+=" crossed out "+l+" , ":o+=" crossed out "+l+". End cross out"}if(!c&&a.superscript){let s=e(t,a.superscript,i);s=s.trim();const r=s.replace(/<[^>]*>/g,"");if($i(a.superscript)){if("math"===t){const e=function(e){if(Re(e))for(const t of e)if("first"!==t.type&&t.id)return t.id.toString();return""}(a.superscript);e&&(o+='')}"′"===r?o+=" prime ":"2"===r?o+=" squared ":"3"===r?o+=" cubed ":isNaN(parseInt(r))?o+=" to the "+s+"; ":o+=' to the '+r+" power; "}else isNaN(parseInt(r))?o+=" raised to the "+s+"; ":o+=' raised to the '+r+" power; "}if(!c&&a.subscript){let t=e("math",a.subscript,i);t=t.trim(),$i(a.subscript)?o+=" sub "+t:o+=" subscript "+t+". End subscript. "}}return o}("math",e,i);if("ssml"===i.textToSpeechMarkup){let e="";i.speechEngineRate&&(e=''),s=''+e+"

    "+s+"

    "+(e?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(e){let t="other";return(null===navigator||void 0===navigator?void 0:navigator.platform)&&(null===navigator||void 0===navigator?void 0:navigator.userAgent)&&(/^(mac)/i.test(navigator.platform)?t="mac":/^(win)/i.test(navigator.platform)?t="win":/(android)/i.test(navigator.userAgent)?t="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?t="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(t="chromeos")),"mac"===t?"mac":"!mac"}()?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s}function Di(e,t,a){return t+_i(a,{...e,textToSpeechMarkup:"",textToSpeechRulesOptions:{...e.textToSpeechRulesOptions,markup:"none"}})}function qi(e,t){if(!t&&window&&window.mathlive&&(t=window.mathlive.config),(t=null!=t?t:{}).speechEngine&&"local"!==t.speechEngine)if("amazon"===t.speechEngine){if(window&&window.AWS){const a=new window.AWS.Polly({apiVersion:"2016-06-10"}),i={OutputFormat:"mp3",VoiceId:t.speechEngineVoice,Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes(t.speechEngineVoice)?"neural":"standard",Text:e,TextType:"ssml"};a.synthesizeSpeech(i,(function(e,t){if(e);else if(null==t?void 0:t.AudioStream){const e=new Uint8Array(t.AudioStream),a=new Blob([e.buffer],{type:"audio/mpeg"}),i=URL.createObjectURL(a);new Audio(i).play().catch(e=>{})}}))}}else t.speechEngine;else{const t=new SpeechSynthesisUtterance(e);window&&window.speechSynthesis.speak(t)}}function Ti(e,t,a,i){let s="";"plonk"===t?(e.plonkSound&&(e.plonkSound.load(),e.plonkSound.play().catch(e=>{})),e.resetKeystrokeBuffer()):"delete"===t?s=Di(e.config,"deleted: ",i):"focus"===t||/move/.test(t)?s=(Rt(e.model)?"":"selected: ")+function(e,t){function a(e,t){return"body"===t.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[e.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[t.relation]}const i=t?t.path:[],s=e.model.path,o=s[s.length-1];let r="";for(;i.length>s.length;)r+="out of "+a(t.parent(),i[i.length-1])+"; ",i.pop();if(!Rt(e.model))return Di(e.config,"",Nt(e.model));const n=a(e.model.parent(),o);0===o.offset&&(r+=(n?"start of "+n:"unknown")+": ");const l=e.model.sibling(Math.max(1,e.model.extent));return l?r+=Di(e.config,"",l):0!==o.offset&&(r+=n?"end of "+n:"unknown"),r}(e,a):"replacement"===t?s=Di(e.config,"",e.model.sibling(0)):"line"===t?(s=Di(e.config,"",e.model.root),e.accessibleNode.innerHTML=e.config.createHTML(''+Ha(e.model.root,e.config)+""),e.textarea.setAttribute("aria-label","after: "+s)):s=i?Di(e.config,t+" ",i):t;const o=/\u00a0/.test(e.ariaLiveText.textContent)?"   ":"   ";e.ariaLiveText.textContent=s+o}Ga({speak:(e,t,a)=>function(e,t,a){a=null!=a?a:{withHighlighting:!1};const i=function(e,t){let a=null;switch(t){case"all":a=e.model.root;break;case"selection":Rt(e.model)||(a=Nt(e.model));break;case"left":{const t=e.model.siblings(),i=e.model.startOffset();if(i>=1){a=[];for(let e=1;e<=i;e++)a.push(t[e])}break}case"right":{const t=e.model.siblings(),i=e.model.endOffset()+1;if(i<=t.length-1){a=[];for(let e=i;e<=t.length-1;e++)a.push(t[e])}break}case"group":a=e.model.siblings();break;case"parent":{const t=e.model.parent();t&&"root"!==t.type&&(a=e.model.parent());break}}return a}(e,t);if(null===i)return e.config.speakHook(function(e){let t="";switch(e){case"all":break;case"selection":t="no selection";break;case"left":t="at start";break;case"right":t="at end";break;case"group":break;case"parent":t="no parent"}return t}(t),e.config),!1;const s={...e.config};(a.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml");const o=_i(i,s);return a.withHighlighting?(window.mathlive.readAloudMathField=e,Ua(e,{forHighlighting:!0}),e.config.readAloudHook&&e.config.readAloudHook(e.field,o,e.config)):e.config.speakHook&&e.config.speakHook(o,s),!1}(e,t,a)},{target:"mathfield",category:"speech"});const Ki=()=>{};function Ei(e){if("string"==typeof e){const t=new Audio;return t.preload="none",t.src=e,t.volume=.5,t}return e}function Fi(e){e instanceof HTMLAudioElement&&(e.pause(),e.removeAttribute("src"),e.load())}function Ni(t,a){const i=Bi(t,Object.keys(t));return Object.keys(a).forEach(t=>{var s;switch(t){case"scriptDepth":if(e(a.scriptDepth))i.scriptDepth=[a.scriptDepth[0],a.scriptDepth[1]];else{if("number"!=typeof a.scriptDepth)throw Error("Unexpected value for scriptDepth");i.scriptDepth=[a.scriptDepth,a.scriptDepth]}break;case"namespace":if(!/^[a-z]*[-]?$/.test(a.namespace))throw Error("namespace must be a string of lowercase characters only");/-$/.test(a.namespace)?i.namespace=a.namespace:i.namespace=a.namespace+"-";break;case"locale":i.locale="auto"===a.locale?wi.locale:a.locale;break;case"strings":wi.merge(a.strings);break;case"virtualKeyboardLayout":"auto"===a.virtualKeyboardLayout?i.virtualKeyboardLayout={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[wi.locale.substring(0,2)]||"qwerty":i.virtualKeyboardLayout=a.virtualKeyboardLayout;break;case"virtualKeyboardMode":{const e=null===(s=window.matchMedia)||void 0===s?void 0:s.call(window,"(any-pointer: coarse)").matches;"auto"===a.virtualKeyboardMode?i.virtualKeyboardMode=e?"onfocus":"off":i.virtualKeyboardMode=a.virtualKeyboardMode}break;case"letterShapeStyle":"auto"===a.letterShapeStyle?"fr"===wi.locale.substring(0,2)?i.letterShapeStyle="french":i.letterShapeStyle="tex":i.letterShapeStyle=a.letterShapeStyle;break;case"plonkSound":Fi(i.plonkSound),i.plonkSound=Ei(a.plonkSound);break;case"keypressSound":if(Fi(i.keypressSound),"string"==typeof a.keypressSound){const e=Ei(a.keypressSound);i.keypressSound={delete:e,return:e,spacebar:e,default:e}}else if(a.keypressSound instanceof HTMLAudioElement)i.keypressSound={delete:a.keypressSound,return:a.keypressSound,spacebar:a.keypressSound,default:a.keypressSound};else{if(!a.keypressSound.default)throw Error("Missing keypressSound.default");i.keypressSound={...a.keypressSound},i.keypressSound.return||(i.keypressSound.return=a.keypressSound.default),i.keypressSound.spacebar||(i.keypressSound.spacebar=a.keypressSound.default),i.keypressSound.delete||(i.keypressSound.delete=a.keypressSound.default)}break;case"onBlur":case"onFocus":case"onContentWillChange":case"onContentDidChange":case"onSelectionWillChange":case"onSelectionDidChange":case"onUndoStateWillChange":case"onUndoStateDidChange":case"onModeChange":case"onVirtualKeyboardToggle":case"onReadAloudStatus":case"onError":if(null===a[t])i[t]=Ki;else if("function"!=typeof a[t])throw Error(t+" must be a function or null");i[t]=a[t];break;default:e(a[t])?i[t]=[...a[t]]:"object"==typeof a[t]?i[t]={...a[t]}:i[t]=a[t]}}),void 0!==a.overrideDefaultInlineShortcuts&&(a.overrideDefaultInlineShortcuts?i.inlineShortcuts=a.inlineShortcuts:i.inlineShortcuts={...ai,...a.inlineShortcuts}),i}function Bi(t,a){let i;i="string"==typeof a?[a]:void 0===a?Object.keys(t):a;const s={};return i.forEach(a=>{e(s[a])?s[a]=[...s[a]]:"object"==typeof s[a]?s[a]={...s[a]}:s[a]=t[a]}),"string"==typeof a?s[a]:s}function Oi(e,t,a){"function"==typeof t&&(a=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(kt(e.model);!s;){const o=e.model.sibling(i);s=0===t||!o||"math"!==o.mode||!(/mord|textord|mpunct/.test(o.type)||"mop"===o.type&&/[a-zA-Z]+/.test(o.body))||!!o.superscript||!!o.subscript||a&&!a(o),s||(o.applyStyle({mode:"text"}),o.symbol=o.body,o.latex=""),i-=1,t-=1}wt(e.model)}function Ri(e,t,a){"function"==typeof t&&(a=t,t=1/0),void 0===t&&(t=1/0),kt(e.model);let i=0,s=!1;for(;!s;){const o=e.model.sibling(i);s=0===t||!o||"text"!==o.mode||" "===o.body||a&&!a(o),s||o.applyStyle({mode:"math"}),i-=1,t-=1}Pi(e),wt(e.model)}function Pi(e){let t=0;for(;e.model.sibling(t)&&"math"===e.model.sibling(t).mode;)t-=1;if(e.model.sibling(t)&&"text"===e.model.sibling(t).mode&&" "===e.model.sibling(t).body&&(!e.model.sibling(t-1)||"math"===e.model.sibling(t-1).mode)){kt(e.model),e.model.siblings().splice(t-1,1),wt(e.model);const a=e.model.suppressChangeNotifications;e.model.suppressChangeNotifications=!0,$t(e.model,e.model.anchorOffset()-1),e.model.suppressChangeNotifications=a}}function Ii(e,t,a){!function(e){const t=e.shiftKey&&e.altKey?3:e.altKey?2:e.shiftKey?1:0;if("Unidentified"===e.key)return;if("Dead"===e.key)return;const a=ea.filter(a=>{var i;return(null===(i=a.mapping[e.code])||void 0===i?void 0:i[t])===e.key});0!==a.length&&(a.forEach(e=>{e.score+=1}),ea.sort((e,t)=>t.score-e.score))}(a);const i=oa();if(e.keyboardLayout!==i.id&&(e.keyboardLayout=i.id,e.keybindings=ma(e.config.keybindings,t=>{"function"==typeof e.config.onError&&e.config.onError({code:"invalid-keybinding",arg:t.join("\n")})})),function(e,t){const a=e.keystrokeCaption;if(a&&e.keystrokeCaptionVisible){const i=e.element.getBoundingClientRect();a.style.left=i.left+"px",a.style.top=i.top-64+"px",a.innerHTML=e.config.createHTML(""+(da(t)||t)+""+a.innerHTML),a.style.visibility="visible",setTimeout((function(){a.childNodes.length>0&&a.removeChild(a.childNodes[a.childNodes.length-1]),0===a.childNodes.length&&(a.style.visibility="hidden")}),3e3)}}(e,t),clearTimeout(e.keystrokeBufferResetTimer),e.config.onKeystroke&&!e.config.onKeystroke(e,t,a))return(null==a?void 0:a.preventDefault)&&(a.preventDefault(),a.stopPropagation()),!1;let s,o,r,n=!1;if("command"!==e.mode&&(!a||!a.ctrlKey&&!a.metaKey))if(fi(a)){const t=yi(a),i=e.keystrokeBuffer+t;let r=0;for(;!s&&r{e.startsWith(o)&&!a.includes(e)&&a.push(e)});const r=(null==t?void 0:t.inlineShortcuts)?t.inlineShortcuts:null;r&&Object.keys(r).forEach(e=>{e.startsWith(o)&&a.push(e)})}return a}(i,e.config).length<=1?n=!0:e.config.inlineShortcutTimeout&&(e.keystrokeBufferResetTimer=setTimeout(()=>{e.resetKeystrokeBuffer()},e.config.inlineShortcutTimeout))}else e.resetKeystrokeBuffer();if(e.config.smartMode){const i=e.mode;s?e.mode="math":function(e,t,a){if(e.smartModeSuppressed)return!1;if(e.model.endOffset()<*|]$/.test(i))return Pi(e),!0}else{if("[Space]"===t)return Oi(e,void 0,e=>/[a-z][:,;.]$/.test(e.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return Oi(e,void 0,e=>/[a-zA-Z]/.test(e.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return Oi(e,1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return Oi(e,void 0,e=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(e.body)),!0;if(/\?|\./.test(i))return!0}return!1}(e,t,a)&&(e.mode={math:"text",text:"math"}[e.mode],r=""),e.mode!==i&&"function"==typeof e.config.onModeChange&&e.config.onModeChange(e,e.mode)}if(s||r||(r=function(e,t,a){if(0===e.length)return"";for(let i=e.length-1;i--;i>=0)if(e[i].key===a&&(!e[i].ifMode||e[i].ifMode===t))return e[i].command;return""}(e.keybindings,e.mode,t)),!s&&!r)return!0;if(e.config.readOnly&&"insert"===r[0])return!0;Ca(e.model,!1);const l=e.model.parent();if("moveAfterParent"===r&&l&&"leftright"===l.type&&e.model.endOffset()===e.model.siblings().length-1&&e.config.smartFence&&li(e.model,".",e.style)&&(r="",Va(e)),"math"===e.mode&&"[Spacebar]"===t&&!s){const t=e.model.sibling(1),a=e.model.sibling(-1);(t&&"text"===t.mode||a&&"text"===a.mode)&&di(e.model," ",{mode:"text"})}if(r)e.$perform(r);else if(s){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(s)){const t={...Ct(e.model),...e.style};di(e.model,yi(a),{suppressChangeNotifications:!0,mode:e.mode,style:t});const i=e.mode;e.snapshotAndCoalesce(),e.restoreToUndoRecord(e.keystrokeBufferStates[o]),e.mode=i}kt(e.model);const t=e.model.suppressChangeNotifications;e.model.suppressChangeNotifications=!0;const i={...Ct(e.model),...e.style};di(e.model,s,{format:"latex",mode:e.mode,style:i,smartFence:!0}),Pi(e),s.endsWith(" ")&&(e.mode="text",di(e.model," ",{mode:"text",style:i})),e.model.suppressChangeNotifications=t,wt(e.model),e.snapshot(),Va(e),e.model.announce("replacement"),n&&e.resetKeystrokeBuffer()}return e.scrollIntoView(),(null==a?void 0:a.preventDefault)&&(a.preventDefault(),a.stopPropagation()),!1}function Hi(e,t,a){if(e.config.readOnly)return void e.model.announce("plonk");if((a=null!=a?a:{}).focus&&e.$focus(),a.feedback&&(e.config.keypressVibration&&(null===navigator||void 0===navigator?void 0:navigator.vibrate)&&navigator.vibrate(3),e.keypressSound&&(e.keypressSound.load(),e.keypressSound.play().catch(e=>{}))),a.commandMode&&"command"!==e.mode&&e.switchMode("command"),Ca(e.model,!1),a.simulateKeystroke){const a=t.charAt(0);if(!Ii(e,a,new KeyboardEvent("keypress",{key:a})))return}let i="",s=!1;if(e.pasteInProgress)e.pasteInProgress=!1,di(e.model,t,{smartFence:e.config.smartFence,mode:"math"});else{const a={...Ct(e.model),...e.style},o=Ue(t);for(const t of o)if("command"===e.mode){nt(e.model),e.suggestionIndex=0;const a=La(e.model),o=oe(a+t);s=o.length>1,0===o.length?(di(e.model,t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(a+t)&&Ca(e.model,!0),Ma(e)):(di(e.model,t,{mode:"command"}),o[0].match!==a+t&&Mi(e.model,o[0].match,-o[0].match.length+a.length+1),i=o[0].match)}else if("math"===e.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(Wi(e)>=e.config.scriptDepth[1])return void e.model.announce("plonk")}else if("moveToSubscript"===i&&Vi(e)>=e.config.scriptDepth[0])return void e.model.announce("plonk");e.$perform(i)}else e.config.smartSuperscript&&"superscript"===e.model.relation()&&/[0-9]/.test(t)&&0===e.model.siblings().filter(e=>"first"!==e.type).length?(di(e.model,t,{mode:"math",style:a}),Wt(e.model)):di(e.model,t,{mode:"math",style:a,smartFence:e.config.smartFence})}else"text"===e.mode&&di(e.model,t,{mode:"text",style:a})}"command"!==e.mode&&e.snapshotAndCoalesce(),e.dirty=!0,e.scrollIntoView(),ka(e,i,s)}function Wi(e){let t=0,a=0,i=e.model.ancestor(a),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),a+=1,i=e.model.ancestor(a);return s?t:0}function Vi(e){let t=0,a=0,i=e.model.ancestor(a),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),a+=1,i=e.model.ancestor(a);return s?t:0}function Ui(e){return e.pasteInProgress=!0,!0}let ji;Ga({undo:e=>(Li(e),e.undo(),!0),redo:e=>(Li(e),e.redo(),!0),scrollIntoView:e=>(e.scrollIntoView(),!0),scrollToStart:e=>(e.field.scroll(0,0),!0),scrollToEnd:e=>{const t=e.field.getBoundingClientRect();return e.field.scroll(t.left-window.scrollX,0),!0},enterCommandMode:e=>(e.switchMode("command"),!0),toggleKeystrokeCaption:e=>(e.keystrokeCaptionVisible=!e.keystrokeCaptionVisible,e.keystrokeCaption.innerHTML="",e.keystrokeCaptionVisible||(e.keystrokeCaption.style.visibility="hidden"),!1),switchMode:(e,t)=>(e.switchMode(t),!0),insert:(e,t,a)=>e.$insert(t,a),typedText:(e,t)=>(Hi(e,t),!0)}),Ga({applyStyle:function(e,t){e.resetKeystrokeBuffer();const a=function(e){const t={};return"string"==typeof e.mode&&(t.mode=e.mode.toLowerCase()),"string"==typeof e.color&&(t.color=e.color),"string"==typeof e.backgroundColor&&(t.backgroundColor=e.backgroundColor),"string"==typeof e.fontFamily&&(t.fontFamily=e.fontFamily),"string"==typeof e.series&&(t.fontSeries=e.series),"string"==typeof e.fontSeries&&(t.fontSeries=e.fontSeries.toLowerCase()),t.fontSeries&&(t.fontSeries={bold:"b",medium:"m",normal:"m"}[t.fontSeries]||t.fontSeries),"string"==typeof e.shape&&(t.fontShape=e.shape),"string"==typeof e.fontShape&&(t.fontShape=e.fontShape.toLowerCase()),t.fontShape&&(t.fontShape={italic:"it",up:"n",upright:"n",normal:"n"}[t.fontShape]||t.fontShape),"string"==typeof e.size?t.fontSize=e.size:"number"==typeof e.size&&(t.fontSize="size"+Math.min(0,Math.max(10,e.size))),"string"==typeof e.fontSize&&(t.fontSize=e.fontSize.toLowerCase()),t.fontSize&&(t.fontSize={tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normal:"size5",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.fontSize]||t.fontSize),t}(t);if(a.mode){if(Rt(e.model))e.switchMode(a.mode);else{const t=e.mode,a="math"===(Lt(e.model)||e.config.defaultMode)?"text":"math";let i=e.$selectedText("ASCIIMath");if("math"===a&&/^"[^"]+"$/.test(i)&&(i=i.slice(1,-1)),e.$insert(i,{mode:a,selectionMode:"item",format:"text"===a?"text":"ASCIIMath"}),e.mode=a,e.groupIsSelected()){const t=e.model.parent();!t||"group"!==t.type&&"root"!==t.type||(t.mode=a)}e.mode!==t&&"function"==typeof e.config.onModeChange&&e.config.onModeChange(e,e.mode)}delete a.mode}return Rt(e.model)?(e.style.fontSeries&&a.fontSeries===e.style.fontSeries&&(a.fontSeries="auto"),a.fontShape&&a.fontShape===e.style.fontShape&&(a.fontShape="auto"),a.color&&a.color===e.style.color&&(a.color="none"),a.backgroundColor&&a.backgroundColor===e.style.backgroundColor&&(a.backgroundColor="none"),a.fontSize&&a.fontSize===e.style.fontSize&&(a.fontSize="auto"),e.style={...e.style,...a}):(ci(e.model,a),e.snapshot()),!0}},{target:"mathfield"}),Ga({copyToClipboard:e=>(e.$focus(),Rt(e.model)&&e.$select(),document.execCommand("copy"),!1),cutToClipboard:e=>(e.$focus(),document.execCommand("cut"),!0),pasteFromClipboard:e=>(e.$focus(),document.execCommand("paste"),!0)},{target:"mathfield",category:"clipboard"});let Gi=0;function Zi(e,t,a,i){var s;let o;(i=null!=i?i:{}).bias=null!==(s=i.bias)&&void 0!==s?s:0;const r=function e(t,a,i){let s={element:null,distance:Number.POSITIVE_INFINITY},o=!0;if(t.getAttribute("data-atom-id")){s.element=t;const e=t.getBoundingClientRect(),r=a-(e.left+e.right)/2,n=i-(e.top+e.bottom)/2;s.distance=r*r+n*n,o=a>=e.left&&a<=e.right}if(o&&t.children)for(const o of t.children){const t=e(o,a,i);t.element&&t.distance<=s.distance&&(s=t)}return s}(e.field,t,a).element,n=r?r.getAttribute("data-atom-id"):null;if(n){const a=Yt(e.model,(e,t)=>t.captureSelection?t.filter(e=>e.id===n).length>0:t.id===n);if(a&&a.length>0)if(o=dt(a[0]).path,0===i.bias){const e=r.getBoundingClientRect();tf ()",classes:"tex",layers:["functions"]},symbols:{tooltip:"keyboard.tooltip.symbols",layer:"symbols",label:"∞≠∈",classes:"tex",layers:["symbols"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},Yi={"\\varphi ":["Φ","\\Phi "],"\\varsigma ":["Σ","\\Sigma "],"\\epsilon ":["Ɛ",'{\\char"0190}'],"\\rho ":["Ρ",'{\\char"3A1}'],"\\tau ":["Τ",'{\\char"3A4}'],"\\upsilon ":["Υ","\\Upsilon "],"\\theta ":["Θ","\\Theta "],"\\iota ":["Ι",'{\\char"399}'],"\\omicron ":["Ο",'{\\char"39F}'],"\\pi ":["Π","\\Pi "],"\\alpha ":["Α",'{\\char"391}'],"\\sigma ":["Σ","\\Sigma "],"\\delta ":["Δ","\\Delta "],"\\phi ":["Φ","\\Phi "],"\\gamma ":["Γ","\\Gamma "],"\\eta ":["Η",'{\\char"397}'],"\\xi ":["Ξ","\\Xi "],"\\kappa ":["Κ",'{\\char"39A}'],"\\lambda ":["Λ","\\Lambda "],"\\zeta ":["Ζ",'{\\char"396}'],"\\chi ":["Χ",'{\\char"3A7}'],"\\psi ":["Ψ","\\Psi "],"\\omega ":["Ω","\\Omega "],"\\beta ":["Β",'{\\char"392}'],"\\nu ":["Ν",'{\\char"39D}'],"\\mu ":["Μ",'{\\char"39C}']},Ji={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let Qi={};const es={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ;
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ;
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • ,
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function ts(e,t,a){return e=e.replace(/(^|[^\\])#@/g,"$1#?"),q(_(Ne({mathstyle:c.displaystyle,macros:a.config.macros},ot(e,"math",t,a.config.macros)),"ML__base"),"ML__mathlive").toMarkup()}function as(e,t,a){var i;let s="
    ";const o=t.replace(/\s+/g," ").split(" ");if(o.length>1){const t={...Xi,...null!==(i=e.config.customVirtualKeyboards)&&void 0!==i?i:{}};for(const e of o){if(!t[e])break;s+="
    "+t[e].label+"
    "}}return s+="
    ",s+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function is(e,t,a){var i;for(let s=0;s"+o.getAttribute("data-aside").replace(/"/g,'"')+""),void 0!==r&&(o.innerHTML=e.config.createHTML(r)),o.getAttribute("data-classes")&&o.classList.add(o.getAttribute("data-classes"));const n=null===(i=o.getAttribute("data-insert"))||void 0===i?void 0:i.replace(/"/g,'"');let l;if(n&&Yi[n]&&(o.setAttribute("data-shifted",Yi[n][0]),o.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",Yi[n][1]]))),l=o.getAttribute("data-command")?JSON.parse(o.getAttribute("data-command")):o.getAttribute("data-insert")?["insert",o.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:o.getAttribute("data-latex")?["insert",o.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:["typedText",o.getAttribute("data-key")||o.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],a&&(l=[a,l]),o.getAttribute("data-alt-keys")){const e=Qi[o.getAttribute("data-alt-keys")];e&&(l={default:l,pressAndHoldStart:["showAlternateKeys",o.getAttribute("data-alt-keys"),e],pressAndHoldEnd:"hideAlternateKeys"})}va(e,o,l)}}function ss(e,t){const a={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},i=a[e.config.virtualKeyboardLayout]?a[e.config.virtualKeyboardLayout]:a.qwerty;let s,o=t;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let r=o.match(/()/);for(;r;){s="";const e=r[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),t={};for(const a of e){const e=a.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);t[e[1]]=e[3]}let n=i[t.name];if(n||(n=a.qwerty[t.name]),n)for(const e of n){let a=t.class||"";a&&(a=" "+a),"~"===e?(s+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===e?s+="
  • ":"^"===e?s+="
  • ":"/"===e?s+="
  • ÷
  • ":"*"===e?s+="
  • ×
  • ":"-"===e?s+="
  • ":/tt/.test(a)?s+="
  • '+e+"
  • ":s+="
  • "+e+"
  • "}o=o.replace(new RegExp(r[1]+r[2]+r[3]),s),r=o.match(/()/)}return o}function os(e){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",fa(t)),!1}function rs(e){const t=e.virtualKeyboard.querySelectorAll("div.keyboard-layer.is-visible .rows .keycap, div.keyboard-layer.is-visible .rows .action");if(t)for(let a=0;a',command:'["applyStyle",{"color":"'+e+'"}]'});Ji["background-color"]=[];for(const e of fe)Ji["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+e+'"}]'});Qi={...Ji},Object.keys(Qi).forEach(e=>{Qi[e]=Qi[e].slice()});for(let e=0;e<26;e++){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[e];Qi[t]||(Qi[t]=[]),Qi[t].unshift({latex:"\\mathbb{"+t+"}",aside:"blackboard",insert:"\\mathbb{"+t+"}"}),Qi[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),Qi[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),Qi[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),Qi[t].unshift({latex:"\\mathcal{"+t+"}",aside:"calligraphy",insert:"\\mathcal{"+t+"}"}),Qi[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}for(let e=0;e<=26;e++){const t="abcdefghijklmnopqrstuvwxyz"[e];Qi[t]||(Qi[t]=[]),Qi[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),Qi[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),Qi[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),Qi[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}for(let e=0;e<10;e++){const t="0123456789"[e];Qi[t]||(Qi[t]=[]),Qi[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),Qi[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),Qi[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),Qi[t].unshift({latex:"\\mathcal{"+t+"}",aside:"script",insert:"\\mathcal{"+t+"}"}),Qi[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}let o=e.config.virtualKeyboards;o||(o="all"),o=o.replace(/\ball\b/i,"numeric functions symbols roman greek");const r={...es,...null!==(a=e.config.customVirtualKeyboardLayers)&&void 0!==a?a:{}},n={...Xi,...null!==(i=e.config.customVirtualKeyboards)&&void 0!==i?i:{}},l=o.replace(/\s+/g," ").split(" ");for(const t of l){if(!n[t])break;let a=n[t].layers||[];n[t].layer&&a.push(n[t].layer),a=Array.from(new Set(a));for(const i of a){if(!r[i])break;if("object"==typeof r[i]){let e="";if(r[i].styles&&(e+=``),r[i].backdrop&&(e+=`
    `),r[i].container&&(e+=`
    `),r[i].rows){e+="
    ";for(const t of r[i].rows){e+="
      ";for(const a of t)e+="${a.label?a.label:""}`;e+="
    "}e+="
    "}r[i].container&&(e+="
    "),r[i].backdrop&&(e+="
    "),r[i]=e}s+="
    ",s+=as(e,o,t);const a="function"==typeof r[i]?r[i]():r[i];s+=ss(e,a),s+="
    "}}const c=document.createElement("div");c.className="ML__keyboard",t?c.classList.add(t):e.config.virtualKeyboardTheme&&c.classList.add(e.config.virtualKeyboardTheme),c.innerHTML=e.config.createHTML(s),is(e,[].slice.call(c.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton")));const d=c.getElementsByClassName("layer-switch");for(let t=0;t{e.addEventListener("mousedown",e=>{e.preventDefault(),e.stopPropagation()}),e.addEventListener("touchstart",e=>{e.preventDefault(),e.stopPropagation()})}),m[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){os(),rs(e)})),window.addEventListener("blur",(function(){os(),rs(e)})),window.addEventListener("touchend",(function(){os(),rs(e)})),window.addEventListener("touchcancel",(function(){os(),rs(e)})),c}(e,t),pa(e.virtualKeyboard,"touchstart:passive mousedown",()=>{e.$focus()}),document.body.appendChild(e.virtualKeyboard)),window.setTimeout(()=>{e.virtualKeyboard.classList.add("is-visible")},1)):e.virtualKeyboard&&e.virtualKeyboard.classList.remove("is-visible"),"function"==typeof e.config.onVirtualKeyboardToggle&&e.config.onVirtualKeyboardToggle(e,e.virtualKeyboardVisible,e.virtualKeyboard),!1}Ga({showAlternateKeys:(e,t,a)=>{const i=ua("mathlive-alternate-keys-panel","ML__keyboard alternate-keys");e.virtualKeyboard.classList.contains("material")&&i.classList.add("material"),a.length>=7?i.style.width="286px":4===a.length||2===a.length?i.style.width="146px":1===a.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const e of a)s+="";s="
      "+s+"
    ",i.innerHTML=e.config.createHTML(s),is(e,[].slice.call(i.getElementsByTagName("li")),"performAlternateKeys");const o=e.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(o){o.top-i.clientHeight<0&&(i.style.width="auto",a.length<=6?i.style.height="56px":a.length<=12?i.style.height="108px":i.style.height="205px");const e=(o.top-i.clientHeight+5).toString()+"px",t=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(o.left+o.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+t+","+e+")",i.classList.add("is-visible")}return!1}},{target:"virtual-keyboard"}),Ga({shiftKeyboardLayer:t=>{const a=t.virtualKeyboard.querySelectorAll("div.keyboard-layer.is-visible .rows .keycap, div.keyboard-layer.is-visible .rows .action");if(a)for(let i=0;ios(),performAlternateKeys:(e,t)=>(os(),e.$perform(t)),switchKeyboardLayer:(e,t)=>ls(e,t),unshiftKeyboardLayer:e=>rs(e),insertAndUnshiftKeyboardLayer:(e,t)=>(e.$insert(t),rs(e),!0)},{target:"virtual-keyboard"}),Ga({toggleVirtualKeyboardAlt:e=>{let t=!1;return e.virtualKeyboard&&(t=e.virtualKeyboard.classList.contains("material"),e.virtualKeyboard.remove(),delete e.virtualKeyboard,e.virtualKeyboard=null),cs(e,t?"":"material"),!1},toggleVirtualKeyboardShift:e=>{var t,a;e.config.virtualKeyboardLayout={qwerty:"azerty",azerty:"qwertz",qwertz:"dvorak",dvorak:"colemak",colemak:"qwerty"}[e.config.virtualKeyboardLayout];const i=null!==(a=null===(t=e.virtualKeyboard)||void 0===t?void 0:t.querySelector("div.keyboard-layer.is-visible").id)&&void 0!==a?a:"";return e.virtualKeyboard&&(e.virtualKeyboard.remove(),delete e.virtualKeyboard,e.virtualKeyboard=null),cs(e),i&&ls(e,i),!1}},{target:"virtual-keyboard"}),Ga({toggleVirtualKeyboard:(e,t)=>ms(e,t),hideVirtualKeyboard:e=>ds(e),showVirtualKeyboard:(e,t)=>cs(e,t)},{target:"virtual-keyboard"});const ps={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},hs={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},us={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},fs={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function gs(t,a){return e(t.arg)?t.arg[a]:void 0}function ys(e){return e&&fs[e]||-1}function bs(e){return/=|=>/.test(e)?"right":"left"}function vs(e){if("f"===e||"g"===e)return!0;const t=us[e];return!!t&&!!/%[^01_^]?/.test(t)}function xs(e){e=(e||"").trim();let t=ps[e];if(!t)if(/^\\[^{}]+$/.test(e)){const a=se(e,"math",{});t=a&&a.value||e.slice(1)}else t=e;return t}function ks(e){if(!e)return null;const t=xs(As(e)),a=[ys(t),bs(t)];return a[0]<=0?null:a}function ws(e){return null!==ks(e)}const Ss={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Ms={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Ls={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Cs={",":"list",";":"list2"};function As(t){if("string"==typeof t)return t;if(e(t)){let e="";for(const a of t)e+=As(a);return e}if(t.symbol&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.symbol))return t.symbol;if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(e(t.body)){let e="";for(const a of t.body)e+=As(a);return e}return""}function $s(e){return"string"==typeof e.sym?function(e){let t=us[e];return t?t.replace("%1","").replace("%0","").replace("%",""):(e.length>1&&(t="\\"+e),t||(t=ee("math",e)),t)}(e.sym)||e.sym:""}function zs(e){return parseFloat(e.num)}function _s(e){return"object"==typeof e&&void 0!==e.num}function Ds(e){let t=0;return _s(e)&&(t="object"==typeof e.num?void 0!==e.num.re?Js(e.num.re):0:parseFloat(e.num)),t}function qs(e){let t=0;return _s(e)&&"object"==typeof e.num&&(t=void 0!==e.num.im?Js(e.num.im):0),t}function Ts(e){return e&&void 0!==e.sup}function Ks(e){return e&&void 0!==e.sub}function Es(e,t,a){let i=!1;const s=e.atoms[e.index];return s&&s.type===t&&(i=void 0===a||As(s)===a),i}function Fs(e,...t){const a={fn:e,arg:void 0};if(t){const e=[];for(const a of t)a&&e.push(a);e.length>0&&(a.arg=e)}return a}function Ns(e){return"number"==typeof e?{num:e.toString()}:"string"==typeof e||"object"==typeof e?{num:e}:void 0}function Bs(e){if(_s(e)){const t=Ds(e),a=qs(e);return 0!==a?(0!==t&&(e.num.re=(-t).toString()),e.num.im=(-a).toString()):e.num=(-t).toString(),e}return Fs("negate",e)}function Os(e){const t=e.atoms[e.index+1];return t&&"msubsup"===t.type}function Rs(e,t){let a=e.atoms[e.index];return!a||void 0===a.superscript&&void 0===a.subscript?a=null:e.index+=1,a||(a=e.atoms[e.index+1],a&&"msubsup"===a.type&&(a.superscript||a.subscript)?e.index+=2:a=null),a?(void 0!==a.subscript&&(e.ast.sub=Gs(a.subscript,t)),void 0!==a.superscript&&("msubsup"===a.type?/['\u2032]|\\prime/.test(As(a.superscript))?(e.index+=1,a=e.atoms[e.index+1],a&&"msubsup"===a.type&&/['\u2032]|\\prime/.test(As(a.superscript))?e.ast.sup={sym:"″"}:(e.ast.sup={sym:"′"},e.index-=1)):/['\u2033]|\\doubleprime/.test(As(a.superscript))?e.ast.sup={sym:"″"}:e.ast&&(e.ast.sup=Gs(a.superscript,t)):e.ast.sup=Gs(a.superscript,t))):e.index+=1,e}function Ps(e,t){const a=e.ast;if(Hs(e,"!!"))return e.index+=1,e.ast=Fs("factorial2",a),Ps(e=Rs(e,t),t);if(Hs(e,"++"))return e.index+=1,e.ast=Fs("increment",a),Ps(e=Rs(e,t),t);if(Hs(e,"--"))return e.index+=1,e.ast=Fs("decrement",a),Ps(e=Rs(e,t),t);const i=e.atoms[e.index];return(null==i?void 0:i.symbol)&&Ms[i.symbol]&&(e.ast=Fs(Ms[i.symbol],a),e=Ps(e=Rs(e,t),t)),e}function Is(e,t,a,i){if(e.index=e.index||0,0===e.atoms.length||e.index>=e.atoms.length)return e.ast=void 0,e;const s=e.minPrec;e.minPrec=0;let o=e.atoms[e.index];if(t){if("mopen"===o.type&&As(o)===t)e.index+=1,o=(e=Vs(e,i)).atoms[e.index],o&&"mclose"===o.type&&As(o)===a&&(Os(e)&&(e.ast={group:e.ast}),e=Ps(e=Rs(e,i),i));else if("textord"===o.type&&As(o)===t)e.index+=1,o=(e=Vs(e,i)).atoms[e.index],o&&"textord"===o.type&&As(o)===a&&(e.index+=1,e=Ps(e=Rs(e,i),i));else if("\\lVert"===t&&"textord"===o.type&&"|"===o.symbol){if(o=e.atoms[e.index+1],o&&"textord"===o.type&&"|"===o.symbol){e.index+=2,o=(e=Vs(e,i)).atoms[e.index];const t=e.atoms[e.index+1];o&&"textord"===o.type&&"|"===o.symbol&&t&&"textord"===t.type&&"|"===t.symbol&&(e.index+=2,e=Ps(e=Rs(e,i),i))}}else if("sizeddelim"===o.type&&o.delim===t)e.index+=1,o=(e=Vs(e,i)).atoms[e.index],o&&"sizeddelim"===o.type&&o.delim===a&&(e.index+=1,e=Ps(e=Rs(e,i),i));else{if("leftright"!==o.type||o.leftDelim!==t||"?"!==o.rightDelim&&o.rightDelim!==a)return;e.ast=Gs(o.body,i),Os(e)&&(e.ast={group:e.ast}),e=Ps(e=Rs(e,i),i)}return e.minPrec=s,e}{let r=!0;if("mopen"===o.type?(t=o.symbol,a=I[t]):"sizeddelim"===o.type?(t=o.delim,a=I[t]):"leftright"===o.type?(r=!1,t=o.leftDelim,"?"===(a=o.rightDelim)&&(a=I[t])):"textord"===o.type&&(t=o.symbol,a=I[t]),t&&a){if("|"===t&&"|"===a){const i=e.atoms[e.index+1];i&&"textord"===i.type&&"|"===i.symbol&&(t="\\lVert",a="\\rVert")}if(e=Is(e,t,a,i))return r&&(e.index+=1),e.ast={fn:Ss[t+a]||t+a,arg:[e.ast]},e.minPrec=s,e}}}function Hs(e,t){return e.index=e.index||0,!(e.atoms.length<=1||e.index>=e.atoms.length-1)&&t===As(e.atoms[e.index])+As(e.atoms[e.index+1])}function Ws(e){if(e.index=e.index||0,!(e.atoms.length<=1||e.index>=e.atoms.length-1)){if(!Es(e,"textord","\\nabla")){const t=e.atoms[e.index].symbol+e.atoms[e.index+1].symbol,a=/^(>=|<=|>>|<<|:=|!=)$/.test(t)?t:"";return a&&(e.index+=1),a}return e.index+=1,Es(e,"mbin","\\times")?(e.index+=1,e.ast="curl",e):Es(e,"mbin","\\cdot")?(e.index+=1,e.ast="div",e):void(e.index-=1)}}function Vs(t,a){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(a,i){if(a.index=a.index||0,a.ast=void 0,0===a.atoms.length||a.index>=a.atoms.length)return a;let s=a.atoms[a.index];if("text"===s.mode){let e="";for(;a.atoms[a.index]&&"text"===a.atoms[a.index].mode;)e+=a.atoms[a.index].body,a.index+=1;return a.ast={text:e},a}const o=xs(As(s));if(Ws(a))a.ast=Fs(a.ast,t(a,i).ast);else{if("root"===s.type)return a.index=0,a.atoms=s.body,t(a,i);if("mbin"===s.type&&"-"===o)a.index+=1,(a=t(a,i)).ast=Bs(a.ast);else if("mbin"===s.type&&"+"===o)a.index+=1,(a=t(a,i)).ast=Fs("add",a.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.symbol)){let e="",o=!1,r=/^[0-9.eEdD]$/;for(;a.index0&&"\\"===n.charAt(0)&&"string"==typeof e.body&&(n=e.body)),o=J(n,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),o!==n?(r={sym:o},l="normal"):r={sym:n};break;case"minner":case"mop":break;case"box":r=Gs(e.body,t);break;case"enclose":break;case"array":if("cardinality"===e.environmentName)r=Fs("card",Gs(e.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(e.environmentName)){r={fn:"array",args:[]};for(const a of e.array)r.args.push(a.map(e=>Gs(e,t)))}else if("cases"===e.environmentName){r={fn:"cases",args:[]};for(const a of e.array)if(a[0]){const e=[];e.push(Gs(a[0],t));let i=Gs(a[1],t);i&&"text"===i.fn&&i.arg&&/^(if|when|for)$/i.test(i.arg[0].trim())&&(i=i.arg.filter(e=>"string"!=typeof e)),e.push(null!=i?i:{}),r.args.push(e)}}break;case"spacing":case"space":case"mathstyle":break;default:r=void 0}return r&&l&&"normal"!==l&&(r.variant=l),r&&"string"==typeof e.cssClass&&(r.class=e.cssClass),r&&"string"==typeof e.cssId&&(r.id=e.cssId),r}function js(t){if(!t)return[];let a;if(e(t)){a=[];for(const e of t){const t=js(e);a=a.concat(t)}}else{if("spacing"===t.type||"first"===t.type)return[];"box"===t.type?a=js(t.body):(t.body&&e(t.body)&&(t.body=js(t.body)),t.superscript&&e(t.superscript)&&(t.superscript=js(t.superscript)),t.subscript&&e(t.subscript)&&(t.subscript=js(t.subscript)),t.index&&e(t.index)&&(t.index=js(t.index)),t.denom&&e(t.denom)&&(t.denom=js(t.denom)),t.numer&&e(t.numer)&&(t.numer=js(t.numer)),t.array&&e(t.array)&&(t.array=t.array.map(e=>e.map(e=>js(e)))),a=[t])}return a}function Gs(e,t){return function(e,t){e.index=e.index||0,e.ast=void 0;const a=[];for(;e.atoms[e.index];)if("text"===e.atoms[e.index].mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;a.push(Fs("text",t))}else{const i=Vs(e,t).ast;if(!i)return;a.push(i)}return a.length>1?Fs("sequence",...a):a[0]||void 0}({atoms:js(e)},t)}function Zs(e,t){return Gs(e,t)}function Xs(e,...t){e=e||".. ";let a="";if(t.length>0){"."!==e[0]&&(a+=e[0]);let i="";for(const s of t)a+=i+s,i=e[2];"."!==e[1]&&(a+=e[1])}return a}function Ys(e,t){const a=e.length;e=e.substr(0,t.precision-2);for(let a=0;a1&&(i+o.repeat(r+1)).startsWith(e))return"0"===o?i.replace(/(\d{3})/g,"$1"+t.groupSeparator):i.replace(/(\d{3})/g,"$1"+t.groupSeparator)+t.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+t.groupSeparator)+t.endRepeatingDigits}}return a!==e.length&&(e+="\\ldots"),e.replace(/(\d{3})/g,"$1"+t.groupSeparator)}function Js(e){return parseFloat(parseFloat(e).toPrecision(15))}function Qs(e,t){let a,i="";if("number"==typeof t.precision){if("number"!=typeof e){let a="",i="";if("-"===e[0]?(a="-",e=e.substr(1)):"+"===e[0]&&(e=e.substr(1)),e.indexOf(".")>=0){const s=e.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=s[1],r=s[2].substring(0,Math.min(t.precision-o.length,s[2].length));if(i=s[4]||"","0"===o){let i=0;for(;"0"===r[i]&&i=t.precision)s="0",a="";else{s=e[i];const a=Ys(e.substr(i+1),t);a&&(s+=t.decimalMarker+a)}"0"!==s&&(e.length-1>t.precision&&!s.endsWith("}")&&!s.endsWith("\\ldots")&&(s+="\\ldots"),i>4&&(s+=t.exponentProduct,t.exponentMarker?s+=t.exponentMarker+(1-i).toString():s+="10^{"+(1-i).toString()+"}")),e=s}else{e=o.replace(/\B(?=(\d{3})+(?!\d))/g,t.groupSeparator);const a=Ys(r,t);a&&(e+=t.decimalMarker+a)}}else if(e.length>t.precision){const a=e.length;let i=e[0];const s=Ys(e.substr(2),t);s&&(i+=t.decimalMarker+s,"}"!==i[i.length-1]&&(i+="\\ldots")),"1"!==i?i+=t.exponentProduct:i="",t.exponentMarker?i+=t.exponentMarker+(a-2).toString():i+="10^{"+(a-2).toString()+"}",e=i}else e=e.replace(/\B(?=(\d{3})+(?!\d))/g,t.groupSeparator);return i&&(i=t.exponentMarker?t.exponentMarker+i:t.exponentProduct+" 10^{"+i+"}"),a+e+i}a=Js(e)}if("engineering"===t.scientificNotation)if(0===a)i="0";else{const e=Math.abs(a);let s=Math.round(Math.log10(e));s-=s%3,e<1e3&&(s=0);const o=e/Math.pow(10,s);let r="";const n=o.toString().match(/^(.*)\.(.*)$/);(null==n?void 0:n[1])&&n[2]&&(r=n[1]+t.decimalMarker+n[2]),t.groupSeparator&&(r=Ys(o.toExponential(),t));let l="";l=0===s?"":t.exponentMarker?t.exponentMarker+s:t.exponentProduct+" 10^{"+s+"}",i=(a<0?"-":"")+r+l}else{const a="string"==typeof e?e:e.toString();let s,o,r,n=a.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);s=a,r="",(null==n?void 0:n[1])&&n[2]&&(s=n[1],o=t.exponentMarker?t.exponentMarker+n[2]:t.exponentProduct+" 10^{"+n[2]+"}"),n=s.match(/^(.*)\.(.*)$/),(null==n?void 0:n[1])&&n[2]&&(s=n[1],r=n[2]),t.groupSeparator&&(s=s.replace(/\B(?=(\d{3})+(?!\d))/g,t.groupSeparator),r=Ys(r,t)),r&&(r=t.decimalMarker+r),i=s+r+(o||"")}return i}class eo{constructor(e,t){this.config=Ni({namespace:"",substituteTextArea:void 0,readOnly:!1,createHTML:e=>e,defaultMode:"math",macros:P,horizontalSpacingScale:1,letterShapeStyle:"auto",smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,ignoreSpacebarInMathMode:!0,locale:"auto",strings:{},keybindings:ra,overrideDefaultInlineShortcuts:!1,inlineShortcuts:{},inlineShortcutTimeout:0,virtualKeyboardToggleGlyph:'',virtualKeyboardMode:"auto",virtualKeyboards:"all",virtualKeyboardLayout:"auto",customVirtualKeyboardLayers:{},customVirtualKeyboards:{},virtualKeyboardTheme:/android|cros/i.test(null===navigator||void 0===navigator?void 0:navigator.userAgent)?"material":"apple",keypressVibration:!0,keypressSound:null,plonkSound:null,textToSpeechRules:"mathlive",textToSpeechMarkup:"",textToSpeechRulesOptions:{},speechEngine:"local",speechEngineVoice:"Joanna",speechEngineRate:"100%",speakHook:Ki,readAloudHook:Ki,onAnnounce:Ti,onKeystroke:()=>!0,onMoveOutOf:()=>!0,onTabOutOf:()=>!0,onBlur:Ki,onFocus:Ki,onContentWillChange:Ki,onContentDidChange:Ki,onSelectionWillChange:Ki,onSelectionDidChange:Ki,onUndoStateWillChange:Ki,onUndoStateDidChange:Ki,onModeChange:Ki,onVirtualKeyboardToggle:Ki,onReadAloudStatus:Ki,onError:()=>{}},t),this.element=e,e.mathfield=this,this.originalContent=e.innerHTML;let a=this.element.textContent;a&&(a=a.trim());let i="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?i+=this.config.substituteTextArea:i+="":/android|ipad|ipod|iphone/i.test(null===navigator||void 0===navigator?void 0:navigator.userAgent)?i+="\n \n \n ":i+='',i+='',"manual"===this.config.virtualKeyboardMode?(i+=`
    `,this.config.virtualKeyboardToggleGlyph?i+=this.config.virtualKeyboardToggleGlyph:i+='',i+="
    "):i+="",i+="
    ",i+='\n
    \n \n \n
    \n ',this.element.innerHTML=this.config.createHTML(i);let s=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[s++].firstElementChild,this.field=this.element.children[s].children[0],this.field.addEventListener("wheel",e=>{e.preventDefault(),e.stopPropagation();const t=void 0===e.deltaX?e.detail:-e.deltaX;isFinite(t)&&this.field.scroll({top:0,left:this.field.scrollLeft-5*t})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[s++].children[1],va(this,this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[s].children[0],this.accessibleNode=this.element.children[s++].children[1],this.popover=ua("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=ua("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=this.config.defaultMode,this.smartModeSuppressed=!1,this.style={},this.blurred=!0,pa(this.element,"focus",this),pa(this.element,"blur",this),pa(this.textarea,"cut",this),pa(this.textarea,"copy",this),pa(this.textarea,"paste",this),function(e,t){let a,i=null,s=null,o=!1,r=!1;function n(e){clearTimeout(a),a=setTimeout((function(){clearTimeout(a),e()}))}function l(){if(function(e){return e.selectionStart!==e.selectionEnd}(e))return;const a=e.value;e.value="",a.length>0&&t.typedText(a)}const c=e;c.addEventListener("keydown",a=>{if(t.allowDeadKey()||"Dead"!==a.key&&"Unidentified"!==a.key&&229!==a.keyCode)r=!1;else{r=!0,o=!1;const a=t.blur,i=t.focus;t.blur=null,t.focus=null,"function"==typeof e.blur&&(e.blur(),e.focus()),t.blur=a,t.focus=i}return!(!o&&"CapsLock"!==a.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(a.code))||(i=a,s=null,t.keystroke(gi(a),a))},!0),c.addEventListener("keypress",e=>{o||(i&&s&&t.keystroke(gi(i),i),s=e,n(l))},!0),c.addEventListener("keyup",()=>{o||!i||s||l()},!0),c.addEventListener("paste",()=>{e.focus();const a=e.value;e.value="",a.length>0&&t.paste(a)},!0),c.addEventListener("blur",()=>{i=null,s=null,t.blur&&t.blur()},!0),c.addEventListener("focus",()=>{t.focus&&t.focus()},!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r&&t.allowDeadKey()&&n(l)},!0),c.addEventListener("input",()=>{if(r){const a=t.blur,i=t.focus;t.blur=null,t.focus=null,e.blur(),e.focus(),t.blur=a,t.focus=i,r=!1,o=!1,t.allowDeadKey()&&n(l)}else o||n(l)})}(this.textarea,{allowDeadKey:()=>"text"===this.mode,typedText:e=>Hi(this,e),paste:()=>Ui(this),keystroke:(e,t)=>Ii(this,e,t),focus:()=>this._onFocus(),blur:()=>this._onBlur()}),window.PointerEvent?pa(this.field,"pointerdown",this):pa(this.field,"touchstart:active mousedown",this),pa(window,"resize",this),this.model=new bt({mode:this.config.defaultMode,macros:this.config.macros,removeExtraneousParentheses:this.config.removeExtraneousParentheses},{onContentDidChange:e=>this.config.onContentDidChange(this),onSelectionDidChange:e=>this._onSelectionDidChange(),onContentWillChange:()=>this.config.onContentWillChange(this),onSelectionWillChange:()=>this.config.onSelectionWillChange(this),onError:this.config.onError},{announce:(e,t,a,i)=>{var s,o;return null===(o=(s=this.config).onAnnounce)||void 0===o?void 0:o.call(s,this,t,a,i)},moveOut:(e,t)=>this.config.onMoveOutOf(this,t),tabOut:(e,t)=>this.config.onTabOutOf(this,t)},this),this.undoManager=new bi(this.model),di(this.model,a,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:!0,macros:this.config.macros}),this.undoManager.startRecording(),this.undoManager.snapshot(this.config),this.model.setListeners({onContentDidChange:e=>this.config.onContentDidChange(this),onSelectionDidChange:e=>this._onSelectionDidChange(),onContentWillChange:()=>this.config.onContentWillChange(this),onSelectionWillChange:()=>this.config.onSelectionWillChange(this),onError:this.config.onError}),this.model.setHooks({announce:(e,t,a,i)=>{var s,o;return null===(o=(s=this.config).onAnnounce)||void 0===o?void 0:o.call(s,this,t,a,i)},moveOut:(e,t)=>this.config.onMoveOutOf(this,t),tabOut:(e,t)=>this.config.onTabOutOf(this,t)}),this.config.locale.startsWith(oa().locale)||sa(this.config.locale),this.keybindings=ma(this.config.keybindings,e=>{"function"==typeof this.config.onError&&this.config.onError({code:"invalid-keybinding",arg:e.join("\n")})}),Va(this)}$setConfig(e){this.config=Ni(this.config,e),this.model.setListeners({onContentDidChange:e=>this.config.onContentDidChange(this),onSelectionDidChange:e=>this._onSelectionDidChange(),onContentWillChange:()=>this.config.onContentWillChange(this),onSelectionWillChange:()=>this.config.onSelectionWillChange(this),onError:this.config.onError}),this.model.setHooks({announce:(e,t,a,i)=>{var s,o;return null===(o=(s=this.config).onAnnounce)||void 0===o?void 0:o.call(s,this,t,a,i)},moveOut:(e,t)=>this.config.onMoveOutOf(this,t),tabOut:(e,t)=>this.config.onTabOutOf(this,t)}),this.config.locale.startsWith(oa().locale)||sa(this.config.locale),this.keybindings=ma(this.config.keybindings,e=>{"function"==typeof this.config.onError&&this.config.onError({code:"invalid-keybinding",arg:e.join("\n")})}),this.config.readOnly||this._onBlur(),Va(this)}getConfig(e){return Bi(this.config,e)}handleEvent(e){switch(e.type){case"focus":this._onFocus();break;case"blur":this._onBlur();break;case"touchstart":case"mousedown":case"pointerdown":!function(e,t){const a=e;let i,s=!1,o=!1,r=!1;if(1!==t.buttons&&0!==t.buttons)return;let n=!1,l=!1;const c=t.touches?t.touches[0].clientX:t.clientX,d=t.touches?t.touches[0].clientY:t.clientY,m=Date.now(),p=setInterval(()=>{n?a.field.scroll({top:0,left:a.field.scrollLeft-16}):l&&a.field.scroll({top:0,left:a.field.scrollLeft+16})},32);function h(e){window.PointerEvent?(ha(a.field,"pointermove",u),ha(a.field,"pointerup pointercancel",h),a.field.releasePointerCapture(e.pointerId)):(ha(a.field,"touchmove",u),ha(a.field,"touchcancel touchend",h),ha(window,"mousemove",u),ha(window,"mouseup blur",h)),s=!1,clearInterval(p),a.element.querySelectorAll(".ML__scroller").forEach(e=>e.parentNode.removeChild(e)),e.preventDefault(),e.stopPropagation()}function u(t){const s=t.touches?t.touches[0].clientX:t.clientX,r=t.touches?t.touches[0].clientY:t.clientY,p="touch"===t.pointerType?20:5;if(Date.now()h.right,n=s=f.left&&c<=f.right&&d>=f.top&&d<=f.bottom){e.$hasFocus()||(r=!0,e.textarea.focus&&e.textarea.focus()),e.resetKeystrokeBuffer(),e.smartModeSuppressed=!1;const n=e.field.querySelector(".ML__mathlive").getBoundingClientRect();if(i=c>n.right?[{relation:"body",offset:e.model.root.body.length-1}]:Zi(e,c,d,{bias:0}),i){let n=document.createElement("div");n.className="ML__scroller",e.element.appendChild(n),n.style.left=f.left-200+"px",n=document.createElement("div"),n.className="ML__scroller",e.element.appendChild(n),n.style.left=f.right+"px",t.shiftKey?(Ut(e.model,e.model.path,i),i=pt(e.model.path),i[i.length-1].offset-=1):jt(e.model,i,0),r=!0,e.style={},3===t.detail||Gi>2?(h(t),3!==t.detail&&3!==Gi||Ot(e.model)):s||(s=!0,window.PointerEvent?(pa(a.field,"pointermove",u),pa(a.field,"pointerup pointercancel",h),a.field.setPointerCapture(t.pointerId)):(pa(window,"blur",h),t.touches?(pa(t.target,"touchmove",u),pa(t.target,"touchcancel touchend",h)):(pa(window,"mousemove",u),pa(window,"mouseup",h))),2!==t.detail&&2!==Gi||(o=!0,Bt(e.model)))}}else ji=null;r&&Va(e),t.preventDefault()}(this,e);break;case"resize":this.resizeTimer&&window.cancelAnimationFrame(this.resizeTimer),this.resizeTimer=window.requestAnimationFrame(()=>ga(this)&&this._onResize());break;case"cut":t=this,setTimeout(function(){t.$clearSelection(),Va(t)}.bind(t),0);break;case"copy":!function(e,t){Rt(e.model)?(t.clipboardData.setData("text/plain","$$"+e.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",e.$text("json")),t.clipboardData.setData("application/xml",e.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+e.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",e.$selectedText("json")),t.clipboardData.setData("application/xml",e.$selectedText("mathML"))),t.preventDefault()}(this,e);break;case"paste":Ui(this)}var t}$revertToOriginalContent(){this.element.innerHTML=this.config.createHTML(this.originalContent),delete this.element.mathfield,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,ha(this.textarea,"cut",this),ha(this.textarea,"copy",this),ha(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,fa(this.popover),delete this.popover,fa(this.keystrokeCaption),delete this.keystrokeCaption,fa(this.virtualKeyboard),delete this.virtualKeyboard,fa(document.getElementById("mathlive-alternate-keys-panel")),ha(this.element,"pointerdown",this),ha(this.element,"touchstart:active mousedown",this),ha(this.element,"focus",this),ha(this.element,"blur",this),ha(window,"resize",this),delete this.element}resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_onSelectionDidChange(){!function(e){const t=Mt(e);if(t){const a=e.siblings(),i=e.anchorOffset()+1;for(let e=t.start;e=0;e--)"command"===a[e].type?a.splice(e,1):t(a[e]);else if(t(a.body),t(a.superscript),t(a.subscript),t(a.underscript),t(a.overscript),t(a.numer),t(a.denom),t(a.index),a.array)for(let e=gt(a.array);e>=0;e--)t(ft(a.array,e))}(t.root.body),t.suppressChangeNotifications=a,wt(t)}(this.model))}wa(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&cs(this),wa(this),this.config.onFocus&&this.config.onFocus(this),Va(this))}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&ds(this),Li(this,{discard:!0}),Va(this),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),wa(this)}$perform(t){return function(t,a){var i;if(!a)return!1;let s,o=[],r=!1,n=!1;if(e(a)?(s=a[0],o=a.slice(1)):s=a,s=s.replace(/-\w/g,e=>e[1].toUpperCase()),"model"===(null===(i=ja[s])||void 0===i?void 0:i.target)){if(/^(delete|transpose|add)/.test(s)&&t.resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(s)&&"command"!==t.mode&&(t.popUndoStack(),t.snapshot()),ja[s].fn(t.model,...o),/^(delete|transpose|add)/.test(s)&&"command"!==t.mode&&t.snapshot(),/^(delete)/.test(s)&&"command"===t.mode){const e=oe(La(t.model));0===e.length?Ma(t):ka(t,e[0].match,e.length>1)}n=!0,r=!0}else{if(!ja[s])throw Error('Unknown command "'+s+'"');n=ja[s].fn(t,...o),r=!0}return Rt(t.model)&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(s)||(t.resetKeystrokeBuffer(),t.style={}),n&&Va(t),r}(this,t)}formatMathlist(e,t){let a="";if("latex"===(t=t||"latex")||"latex-expanded"===t)a=e.toLatex("latex-expanded"===t);else if("mathML"===t)a=Ha(e,this.config);else if("spoken"===t)a=_i(e,this.config);else if("spoken-text"===t){const t=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",a=_i(e,this.config),this.config.textToSpeechMarkup=t}else if("spoken-ssml"===t||"spoken-ssml-withHighlighting"===t){const t=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="ssml",a=_i(e,this.config),this.config.textToSpeechMarkup=t}else if("json"===t){const t=Zs(e);a=JSON.stringify(t)}else if("json-2"===t){const t=Zs(e);a=JSON.stringify(t,null,2)}else"ASCIIMath"===t&&(a=ki(e));return a}$text(e){return this.formatMathlist(this.model.root,e)}$selectedText(e){const t=Nt(this.model);if(!t)return"";const a=Oe("math",t);return this.formatMathlist(a,e)}$selectionIsCollapsed(){return Rt(this.model)}$selectionDepth(){return this.model.path.length}$selectionAtStart(){return 0===this.model.startOffset()}$selectionAtEnd(){return this.model.endOffset()>=this.model.siblings().length-1}groupIsSelected(){return 0===this.model.startOffset()&&this.model.endOffset()>=this.model.siblings().length-1}$latex(e,t){return"string"==typeof e?(e!==this.model.root.toLatex()&&(t=null!=t?t:{mode:"math"},di(this.model,e,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:t.suppressChangeNotifications,macros:this.config.macros}),this.undoManager.snapshot(this.config),Va(this)),e):this.model.root.toLatex()}$el(){return this.element}scrollIntoView(){var e;this.dirty&&Ua(this);let t=null===(e=ya(this.field))||void 0===e?void 0:e.x;const a=this.field.getBoundingClientRect();if(void 0===t){const e=ba(this.field);e&&(t=e.right+a.left-this.field.scrollLeft)}if(void 0!==t){const e=t-window.scrollX;ea.right&&this.field.scroll({top:0,left:e-a.right+this.field.scrollLeft+20,behavior:"smooth"})}}$insert(e,t){if("string"==typeof e&&e.length>0){if((t=null!=t?t:{mode:"math"}).focus&&this.$focus(),t.feedback&&(this.config.keypressVibration&&(null===navigator||void 0===navigator?void 0:navigator.vibrate)&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===e)Ja(this.model);else if("&"===e)Qa(this.model);else{const a=this.style;di(this.model,e,{mode:this.mode,style:Ct(this.model),...t}),t.resetStyle&&(this.style=a)}return this.undoManager.snapshot(this.config),Va(this),!0}return!1}switchMode(e,t="",a=""){this.resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(e),t&&this.$insert(t,{format:"latex",mode:{math:"text",text:"math"}[e]}),Ca(this.model,!1),"command"===e?(nt(this.model),Ma(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&ls(this,"lower-command"),di(this.model,"",{mode:"math"})):this.mode=e,a&&this.$insert(a,{format:"latex",mode:e}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),Va(this)}$hasFocus(){return document.hasFocus()&&function e(t=document){var a,i;return(null===(i=null===(a=t.activeElement)||void 0===a?void 0:a.shadowRoot)||void 0===i?void 0:i.activeElement)?e(t.activeElement.shadowRoot):t.activeElement}(document)===this.textarea}$focus(){this.$hasFocus()||("function"==typeof this.textarea.focus&&this.textarea.focus(),this.model.announce("line"))}$blur(){this.$hasFocus()&&this.textarea.blur&&this.textarea.blur()}$select(){Ot(this.model)}$clearSelection(){ti(this.model)}$applyStyle(e){ci(this.model,e)}$keystroke(e,t){return Ii(this,e,t)}$typedText(e){Hi(this,e)}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(){this.undoManager.snapshot({...this.config,onUndoStateDidChange:(e,t)=>{ns(this),this.config.onUndoStateDidChange(e,t)}})}snapshotAndCoalesce(){this.undoManager.snapshotAndCoalesce({...this.config,onUndoStateDidChange:(e,t)=>{ns(this),this.config.onUndoStateDidChange(e,t)}})}getUndoRecord(){return this.undoManager.save()}restoreToUndoRecord(e){this.undoManager.restore(e,{...this.config,suppressChangeNotifications:!0})}undo(){return this.undoManager.undo({...this.config,onUndoStateDidChange:(e,t)=>{ns(this),this.config.onUndoStateDidChange(e,t)}})}redo(){return this.undoManager.redo({...this.config,onUndoStateDidChange:(e,t)=>{ns(this),this.config.onUndoStateDidChange(e,t)}})}}function to(e,t,a){let i=a,s=0;const o=e.length;for(;i0&&s.push({type:"text",data:r.slice(0,c)}),l=!1);let d=!1;for(;!d;){if(l){if(n=r.indexOf(t,c),-1===n){d=!0;break}c!==n&&s.push({type:"text",data:r.slice(c,n)}),c=n}else{if(n=to(a,r,c+t.length),-1===n){d=!0;break}s.push({type:"math",data:r.slice(c+t.length,n),rawData:r.slice(c,n+a.length),mathstyle:i}),c=n+a.length}l=!l}c";a.innerHTML=t.createHTML?t.createHTML(i):i}catch(t){a.textContent=e}return a.className="sr-only",a}(e,a)),/\bspeakable-text\b/i.test(a.renderAccessibleContent)&&a.renderToSpeakableText){const i=document.createElement("span"),s=a.renderToSpeakableText(e,a);i.innerHTML=a.createHTML?a.createHTML(s):s,i.className="sr-only",t.appendChild(i)}return t.appendChild(s),t}return s}function oo(e,t){let a=null;if(t.TeX.processEnvironments&&/^\s*\\begin/.test(e))a=document.createDocumentFragment(),a.appendChild(so(e,void 0,t,!0));else{const i=io(e,t.TeX.delimiters);if(1===i.length&&"text"===i[0].type)return null;a=document.createDocumentFragment();for(let e=0;e0?no(e[t].children,a):e[t];if("string"==typeof t){for(let s=0;s0?no(e[s].children,a):e[s];if(i=no(e[s].children,t),i)return i}return i}return null}function lo(e,t){var a;const i=no(e,t);return i?null!==(a=i.classes)&&void 0!==a?a:"":null}function co(e,t){let a="";return e[t]&&(a+=''+t+"=",a+='',a+=e[t],a+='" '),a}var mo={mathlistToMarkup:function e(t,a=""){if(!t)return"";let i="";if(Array.isArray(t))for(let s=0;s"),"string"==typeof t.body&&t.body.length>0&&(i+=' ',i+=t.body,(t.body.charCodeAt(0)<32||t.body.charCodeAt(0)>127)&&(i+=" U+"+("000000"+t.body.charCodeAt(0).toString(16)).substr(-6)),i+=" "),"mathrm"===t.fontFamily?(i+='',i+=co(t,"fontFamily"),i+=""):i+=co(t,"fontFamily"),i+=co(t,"hasBarLine"),i+=co(t,"leftDelim"),i+=co(t,"rightDelim"),i+=co(t,"continuousFraction"),i+=co(t,"limits"),i+=co(t,"symbol"),i+=function(e,t){let a="";return e.framecolor&&(a+='framecolor=',a+='',a+='',a+=e.framecolor,a+=""),a}(t),i+=co(t,"mathstyle"),i+=co(t,"size"),i+=co(t,"cls"),i+=co(t,"delim"),i+=co(t,"shift"),i+=co(t,"width"),i+=co(t,"height"),i+=co(t,"position"),i+=e(t.overscript,a+"↑"),i+=e(t.underscript,a+"↓"),i+=e(t.superscript,a+"↑"),i+=e(t.subscript,a+"↓"),i+=e(t.body,a+"▶"),i+=e(t.numer,a+"▲"),i+=e(t.denom,a+"▼"),t.array)for(let s=0;s"+a+"⌗ row "+(s+1)+"/"+t.array.length;for(let o=0;o"),t.body&&t.body.length>0&&(i+=''+t.body+""),t.classes&&t.classes.length>0&&(i+=' '+t.classes+""),t.isTight&&(i+='  tight '),t.caret&&(i+='  caret '),t.style)for(const e in t.style)Object.prototype.hasOwnProperty.call(t.style,e)&&(i+=' '+e+":",i+=' '+t.style[e]+"; ");t.children&&(i+=t.children.map(t=>e(t,a+"▷")).join("; "))}return i},spanToString:function e(t,a=""){let i="";if(Array.isArray(t))if(0===t.length)i+="[]\n";else{i+="[\n";for(let s=0;s0&&(i+=a+'body:"'+t.body+'",\n'),t.classes&&t.classes.length>0&&(i+=a+'classes:"'+t.classes+'",\n'),t.style)for(const e in t.style)Object.prototype.hasOwnProperty.call(t.style,e)&&(i+=a+e+':"',i+=t.style[e]+'",\n');t.children&&t.children.length>0&&(i+=a+"children:"+t.children.map(t=>e(t,a)).join("; ")),i+=a+"}"}return i},hasClass:function(e,t,a){const i=lo(e,t);if(!i)return!1;const s=i.split(" ");for(let e=0;e{if(e)return;if(!t||!t.AudioStream)return;const a=new TextDecoder("utf-8").decode(new Uint8Array(t.AudioStream));window.mathlive.readAloudMarks=a.split("\n").map(e=>e?JSON.parse(e):{}),window.mathlive.readAloudTokens=[];for(const e of window.mathlive.readAloudMarks)e.value&&window.mathlive.readAloudTokens.push(e.value);window.mathlive.readAloudCurrentMark="",o.OutputFormat="mp3",o.SpeechMarkTypes=[],s.synthesizeSpeech(o,(function(e,t){if(e)return;if(!t||!t.AudioStream)return;const a=new Uint8Array(t.AudioStream),i=new Blob([a.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{const e=window.mathlive.readAloudMathField;r&&r(e,"ended"),e?(Ua(e),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function e(t){if(t.classList.remove("highlight"),t.children)for(const a of t.children)e(a)}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let e="";const t=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const a of window.mathlive.readAloudMarks)a.time0&&Array.from(t.children).forEach(t=>{e(t,a)})):(t.classList.add("highlight"),t.children&&t.children.length>0&&Array.from(t.children).forEach(t=>{e(t)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,r&&r(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}))})}function ho(e,t,a=3e3,i="$0"){t.forEach(t=>{N[t]&&(N[t].frequency=a,N[t].category=e,N[t].template=i.replace(/\$0/g,t)),O[t]&&(O[t]={...O[t],frequency:a,category:e,template:i.replace(/\$0/g,t)})})}function uo(e,t){(t=null!=t?t:{}).mathstyle=t.mathstyle||"displaystyle",t.letterShapeStyle=t.letterShapeStyle||"auto";const a=ot(e,"math",null,t.macros,!1,t.onError);let i=Ne({mathstyle:c[t.mathstyle],letterShapeStyle:t.letterShapeStyle},a);return i=function e(t){if(!t||0===t.length)return[];t[0].children=e(t[0].children);const a=[t[0]];for(let i=1;i0\\right\\}"),ho("Layout",["\\overset","\\underset","\\stackrel","\\stackbin"],1200,"$0{arg}{x=0}"),ho("Layout",["\\rlap","\\mathrlap"],1200,"$0{/}0"),ho("Layout",["\\llap","\\mathllap"],1200,"o$0{/}"),ho("Fractions",["\\frac"],4e3,"$0{\\placeholder{}}{\\placeholder{}}"),ho("Fractions",["\\binom","\\dfrac","\\tfrac","\\dbinom","\\tbinom","\\pdiff","\\cfrac"],1200,"$0{\\placeholder{}}{\\placeholder{}}"),ho("Fractions",["\\over","\\atop","\\choose"],1200,'\\unicode{"2B1A} $0 \\unicode{"2B1A}'),ho("Fractions",["\\overwithdelims","\\atopwithdelims"],1200,'{\\unicode{"2B1A} $0{\\lbrace}{\\rbrace} \\unicode{"2B1A}}'),ho("Extensible Operators",["\\sum","\\prod","\\bigcap","\\bigcup","\\int"],4e3),ho("Extensible Operators",["\\bigoplus","\\smallint","\\iint","\\oint"],3e3),ho("Extensible Operators",["\\bigwedge","\\bigvee","\\coprod","\\bigsqcup","\\bigotimes","\\bigodot","\\biguplus","\\intop","\\sqcup","\\sqcap","\\uplus","\\wr","\\Cap","\\Cup","\\doublecap","\\doublecup","\\amalg","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],1200),ho("Accents",["\\vec"],4e3),ho("Accents",["\\bar","\\ddot","\\acute","\\tilde","\\check"],3e3,"$0{\\placeholder{}}"),ho("Accents",["\\^","\\`","\\'"],1200,"$0{e}"),ho("Accents",["\\c"],1200,"$0{c}"),ho("Accents",["\\~"],1200,"$0{n}"),ho("Accents",["\\mathring","\\hat","\\dot","\\breve","\\grave"],1200,"$0{\\placeholder{}}"),ho("Extensible Symbols",["\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftharpoon","\\overrightharpoon","\\overleftrightarrow","\\overbrace","\\overlinesegment","\\overgroup","\\widehat","\\widecheck","\\widetilde"],3e3,"$0{ABC}"),ho("Extensible Symbols",["\\underrightarrow","\\underleftarrow","\\underleftrightarrow","\\underbrace","\\underlinesegment","\\undergroup","\\utilde"],3e3,"$0{ABC}"),ho("Sizing",["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],1200,"$0{x=0}"),ho("Sizing",["\\big","\\Big","\\bigg","\\Bigg"],1200,"$0($0)"),ho("Sizing",["\\bigl","\\Bigl","\\biggl","\\Biggl"],1200,"$0("),ho("Sizing",["\\bigr","\\Bigr","\\biggr","\\Biggr"],1200,"$0)"),ho("Sizing",["\\bigm","\\Bigm","\\biggm","\\Biggm"],1200,"$0|"),ho("Letterlike Symbols",["\\nabla","\\partial","\\doubleStruckCapitalN","\\N","\\doubleStruckCapitalR","\\R","\\doubleStruckCapitalQ","\\Q","\\doubleStruckCapitalC","\\C","\\doubleStruckCapitalZ","\\Z","\\exponentialE","\\forall","\\exists","\\nexists","\\$","\\%","\\And","\\degree"],4e3),ho("Letterlike Symbols",["\\doubleStruckCapitalP","\\P","\\ell","\\hbar","\\hslash","\\imath","\\jmath","\\imaginaryI","\\imaginaryJ","\\differentialD","\\rd","\\capitalDifferentialD","\\rD","\\differencedelta","\\mid","@","\\Re","\\Im"],3e3),ho("Letterlike Symbols",["\\top","\\bot","\\scriptCapitalE","\\scriptCapitalH","\\scriptCapitalL","\\gothicCapitalC","\\gothicCapitalH","\\gothicCapitalI","\\gothicCapitalR","\\Bbbk","\\Finv","\\Game","\\wp","\\eth","\\mho","\\pounds","\\yen","\\euro"],1200),ho("Crosses",["\\dagger","\\dag"],4e3),ho("Crosses",["\\ddag","\\ddagger","\\maltese","\\textdagger","\\textdaggerdbl"],1200),ho("Various",["\\checkmark","\\diagup","\\diagdown","\\angle","\\measuredangle","\\sphericalangle","\\prime","\\doubleprime","\\backprime","\\backdoubleprime","\\sharp","\\flat","\\natural","\\&","\\#","\\clubsuit","\\spadesuit","\\diamondsuit","\\heartsuit","\\backslash","\\infty","/","\\_","\\/","|","'"],1200),ho("Various",["\\unicode"],1200,'$0{"2B1A}'),ho("Arrows",["\\longrightarrow","\\rightarrow","\\Longrightarrow","\\Rightarrow"],4e3),ho("Arrows",["\\longmapsto","\\mapsto","\\Longleftrightarrow","\\rightleftarrows","\\leftarrow","\\curvearrowleft","\\uparrow","\\downarrow","\\hookrightarrow","\\rightharpoonup","\\rightleftharpoons"],3e3),ho("Arrows",["\\Leftarrow","\\longleftrightarrow","\\longleftarrow","\\Longleftarrow","\\searrow","\\nearrow","\\swarrow","\\nwarrow","\\Uparrow","\\Downarrow","\\updownarrow","\\Updownarrow","\\hookleftarrow","\\leftharpoonup","\\leftharpoondown","\\rightharpoondown","\\leftrightarrows","\\dashrightarrow","\\dashleftarrow","\\leftleftarrows","\\Lleftarrow","\\twoheadleftarrow","\\leftarrowtail","\\looparrowleft","\\leftrightharpoons","\\circlearrowleft","\\Lsh","\\upuparrows","\\downharpoonleft","\\multimap","\\leftrightsquigarrow","\\twoheadrightarrow","\\rightarrowtail","\\looparrowright","\\curvearrowright","\\circlearrowright","\\Rsh","\\downdownarrows","\\upharpoonright","\\downharpoonright","\\rightsquigarrow","\\leadsto","\\Rrightarrow","\\restriction"],1200),ho("Arrows",["\\upharpoonleft","\\rightrightarrows"],0),ho("Negated Arrows",["\\nrightarrow","\\nRightarrow","\\nleftrightarrow","\\nLeftrightarrow","\\nleftarrow","\\nLeftarrow"],1200),ho("Extensible Symbols",["\\xrightarrow","\\xleftarrow","\\xRightarrow","\\xLeftarrow","\\xleftharpoonup","\\xleftharpoondown","\\xrightharpoonup","\\xrightharpoondown","\\xlongequal","\\xtwoheadleftarrow","\\xtwoheadrightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xrightleftharpoons","\\xleftrightharpoons","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium"],1200,"$0[below]{above}=0"),ho("Negated Relations",["\\nless","\\nleqslant","\\lneq","\\lneqq","\\nleqq","\\unlhd","\\unrhd","\\lvertneqq","\\lnsim","\\lnapprox","\\nprec","\\npreceq","\\precnsim","\\precnapprox","\\nsim","\\nshortmid","\\nmid","\\nvdash","\\nvDash","\\ngtr","\\ngeqslant","\\ngeqq","\\gneq","\\gneqq","\\gvertneqq","\\gnsim","\\nsucc","\\succnsim","\\ncong","\\nshortparallel","\\nparallel","\\nVDash","\\nVdash","\\precneqq","\\succneqq","\\gnapprox","\\succnapprox","\\nsucceq"],1200),ho("Hebrew",["\\aleph","\\beth","\\daleth","\\gimel"],1200),ho("Fences",["\\lbrace","\\rbrace","\\vert","\\Vert","\\{","\\}","(",")","[","]"],4e3),ho("Fences",["\\langle","\\rangle","\\lfloor","\\rfloor","\\lceil","\\rceil","\\mvert","\\|","\\mVert"],3e3),ho("Fences",["\\lvert","\\rvert","\\lVert","\\rVert","\\lbrack","\\rbrack","\\ulcorner","\\urcorner","\\llcorner","\\lrcorner","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache"],1200),ho("Relations",["=","\\ne","\\neq","<",">","\\leqslant","\\geqslant","\\approx"],4e3),ho("Relations",["\\lt","\\gt","\\le","\\ge","\\leq","\\geq","\\gg","\\cong","\\equiv","\\prec","\\preceq","\\succ","\\perp","\\parallel","\\propto","\\smile","\\frown","\\sim","\\gtrsim"],3e3),ho("Relations",["\\coloneq","\\succeq","\\approxeq","\\thickapprox","\\lessapprox","\\gtrapprox","\\precapprox","\\succapprox","\\thicksim","\\succsim","\\precsim","\\backsim","\\eqsim","\\backsimeq","\\simeq","\\lesssim","\\nleq","\\ngeq","\\smallsmile","\\smallfrown","\\bowtie","\\asymp","\\leqq","\\eqslantless","\\ll","\\lll","\\lessgtr","\\lesseqgtr","\\lesseqqgtr","\\risingdotseq","\\fallingdotseq","\\preccurlyeq","\\curlyeqprec","\\vDash","\\Vvdash","\\bumpeq","\\Bumpeq","\\geqq","\\eqslantgtr","\\ggg","\\gtrless","\\gtreqless","\\gtreqqless","\\succcurlyeq","\\curlyeqsucc","\\Vdash","\\shortmid","\\shortparallel","\\between","\\pitchfork","\\varpropto","\\backepsilon","\\llless","\\gggtr","\\lhd","\\rhd","\\Join","\\doteq","\\doteqdot","\\Doteq","\\eqcirc","\\circeq","\\lessdot","\\gtrdot","\\measeq","\\eqdef","\\questeq"],1200),ho("Logic",["\\leftrightarrow","\\Leftrightarrow","\\to"],4e3),ho("Logic",["\\models","\\vdash"],3e3),ho("Logic",["\\therefore","\\because","\\implies","\\gets","\\dashv","\\impliedby","\\biconditional","\\roundimplies"],1200),ho("Operators",["+","-","*","\\cdot"],4e3),ho("Operators",["\\sqrt"],4e3,"$0{\\placeholder{}}"),ho("Operators",["\\pm","\\mp","\\times","\\div","\\surd"],3e3),ho("Operators",["\\ltimes","\\rtimes","\\leftthreetimes","\\rightthreetimes","\\intercal","\\dotplus","\\centerdot","\\doublebarwedge","\\divideontimes","\\divides"],1200),ho("Logic",["\\wedge","\\vee","\\neg"],4e3),ho("Logic",["\\lnot"],3e3),ho("Logic",["\\land","\\lor","\\barwedge","\\veebar","\\nor","\\curlywedge","\\curlyvee"],1200),ho("Greek",["\\alpha","\\beta","\\gamma","\\delta","\\epsilon","\\varepsilon","\\zeta","\\eta","\\theta","\\vartheta","\\iota","\\kappa","\\varkappa","\\lambda","\\mu","\\nu","\\xi","\\pi","\\varpi","\\rho","\\varrho","\\sigma","\\varsigma","\\tau","\\phi","\\varphi","\\upsilon","\\chi","\\psi","\\omega","\\Gamma","\\Delta","\\Theta","\\Lambda","\\Xi","\\Pi","\\Sigma","\\Upsilon","\\Phi","\\Psi","\\Omega","\\digamma","\\omicron"],3e3),ho("Sets",["\\emptyset","\\varnothing","\\cap","\\cup","\\in","\\notin","\\subset","\\supset","\\subseteq","\\supseteq","\\sqsubseteq"],4e3),ho("Sets",["\\setminus","\\not","\\ni","\\sqsupseteq","\\nsupseteqq","\\supsetneq","\\varsupsetneq","\\supsetneqq","\\varsupsetneqq"],3e3),ho("Sets",["\\smallsetminus","\\complement","\\owns","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\varsubsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq","\\nsubseteqq","\\subseteqq","\\Subset","\\sqsubset","\\supseteqq","\\Supset","\\sqsupset"],1200),ho("Spacing",["\\space, \\quad","\\qquad"],3e3,'\\unicode{"203A}$0\\unicode{"2039}'),ho("Spacing",["\\!","\\,","\\:","\\;","\\enskip","\\enspace"],1200,'\\unicode{"203A}$0\\unicode{"2039}'),ho("Spacing",["\\hspace","\\hspace*"],1200,'\\unicode{"203A}$0{1em}\\unicode{"2039}'),ho("Punctuation",["\\colon","\\cdotp","\\ldots","\\cdots","\\ddots","\\vdots","?","!",":",'"',",",".",";"],3e3),ho("Punctuation",["\\mathellipsis","\\ldotp","\\Colon"],1200),ho("Boxes",["\\square","\\Box"],3e3),ho("Boxes",["\\blacksquare","\\boxminus","\\boxplus","\\boxtimes","\\boxdot"],1200),ho("Circles",["\\circ","\\bullet","\\circleddash","\\oplus","\\otimes"],3e3),ho("Circles",["\\bigcirc","\\circledast","\\ominus","\\circledcirc","\\oslash","\\circledS","\\circledR","\\odot"],1200),ho("Triangles",["\\triangle","\\triangleq"],3e3),ho("Triangles",["\\bigtriangleup","\\vartriangle","\\triangledown","\\bigtriangledown","\\triangleleft","\\vartriangleleft","\\trianglelefteq","\\ntriangleleft","\\ntrianglelefteq","\\triangleright","\\vartriangleright","\\trianglerighteq","\\ntriangleright","\\ntrianglerighteq","\\blacktriangle","\\blacktriangledown","\\blacktriangleleft","\\blacktriangleright"],1200),ho("Shapes",["\\ast","\\star"],3e3),ho("Shapes",["\\diamond","\\Diamond","\\lozenge","\\blacklozenge","\\bigstar"],1200);var xo={version:"0.52.1-soc",latexToMarkup:uo,latexToMathML:fo,latexToSpeakableText:go,latexToAST:function(e,t){var a;return(t=null!=t?t:{}).macros={...P,...null!==(a=t.macros)&&void 0!==a?a:{}},Zs(ot(e,"math",null,t.macros,!1,t.onError),t)},astToLatex:function(t,a){return function t(a,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let o="";if(void 0===a)return"";if("string"==typeof a)o=a;else if(a.latex)o=a.latex;else if(_s(a)){const e=zs(a);if(e===-1/0)o="-\\infty ";else if(e===1/0)o="\\infty ";else if("object"!=typeof a.num||"string"!=typeof a.num.re&&"string"!=typeof a.num.im)o=isNaN(e)?"\\text{NaN}":Qs(a.num,s);else{const e=Ds(a),t=qs(a);isNaN(e)||isNaN(t)?o="\\text{NaN}":Math.abs(t)<=Number.EPSILON&&Math.abs(e)<=Number.EPSILON?o="0":(Math.abs(e)>Number.EPSILON&&(o=Qs(e,s)),Math.abs(t)>Number.EPSILON&&(Math.abs(e)>Number.EPSILON&&(o+=t>0?"+":""),o+=(1!==Math.abs(t)?Qs(t,s):"")+"\\imaginaryI "))}Ts(a)&&(o+="^{"+t(a.sup,s)+"}"),Ks(a)&&(o+="_{"+t(a.sub,s)+"}")}else if(a.group)o=t(a.group,s),_s(a.group)||$s(a.group)?0!==qs(a.group)&&(o=Xs(a.fence||"(),",o)):o=Xs(a.fence||"(),",o),Ts(a)&&(o+="^{"+t(a.sup,s)+"}"),Ks(a)&&(o+="_{"+t(a.sub,s)+"}");else if(a.fn)if("bind"===a.fn){if(o=t(gs(a,0),s)+"|_{",a.arg&&2===a.arg.length)o+=t(gs(a,1));else{let e="";for(let i=1;it(e,s)));else if("text"===a.fn)o="\\text{"+(a.arg[0]||"")+"}";else if("pow"===a.fn&&e(a.arg)&&a.arg.length>=2)o=t(gs(a,0),s),_s(gs(a,0))||$s(gs(a,0))||(o=Xs(a.fence||"(),",o)),o+="^{"+t(gs(a,1),s)+"}";else if("equal"===a.fn&&a.arg&&a.arg.length>2)o=a.arg.map(e=>t(e,s)).join(" = ");else{const i=function(e){let t=us[e];return t||(t=e.length>1?"\\operatorname{"+e+"}%^%_ %":e+"%^%_ %"),t}(a.fn);o=i;let r="";if(/%(?![01_^])/.test(i)&&e(a.arg)&&a.arg.length>1)o+=Xs(a.fence||"(),",...a.arg.map(e=>t(e,s)));else if(e(a.arg)&&a.arg.length>0){const e=t(gs(a,0),s),n=t(gs(a,1),s),l=[...a.arg];/%0/.test(i)&&(o=o.replace("%0",e),l.shift()),/%1/.test(i)&&(o=o.replace("%1",n),l.shift()),l.length>0&&(r=Xs(a.fence||"(),",...l.map(e=>t(e,s))))}else r=Xs(a.fence||"(),","");o=Ts(a)?o.replace("%^","^{"+t(a.sup,s)+"}"):o.replace("%^",""),o=Ks(a)?o.replace("%_","_{"+t(a.sub,s)+"}"):o.replace("%_",""),o=o.replace(/%(?![01_^])/,r),o=o.replace("%0","").replace("%1","")}else{const e=[];for(const i of a.arg)"add"===i.fn||"subtract"===i.fn||0!==Ds(r=i)&&0!==qs(r)||Ts(a)&&0!==qs(i)&&1!==qs(i)?e.push(Xs("() ",t(i,s))):e.push(t(i,s));if("multiply"===a.fn)o=!a.arg||2!==a.arg.length||!_s(a.arg[0])&&"divide"!==a.arg[0].fn||_s(a.arg[1])&&(0!==Ds(a.arg[1])||1!==qs(a.arg[1]))?e.join(" \\times "):e[0]+e[1];else if(a.arg&&1===a.arg.length)o="negate"===a.arg[0].fn||_s(a.arg[0])&&zs(a.arg[0])<0?e[0]:"+"+e[0];else{o=e[0];for(let t=1;t=0&&(i+=t,i = { diff --git a/dist/vue-mathlive.mjs b/dist/vue-mathlive.mjs index 8846aef55..fa95df5c1 100644 --- a/dist/vue-mathlive.mjs +++ b/dist/vue-mathlive.mjs @@ -1,2 +1,2 @@ -/* MathLive "0.52.0" */ +/* MathLive "0.52.1-soc" */ var t={name:"mathlive-mathfield",template:'
    ',props:{id:{type:String,default:""},value:{type:String,default:""},config:{type:Object,default:()=>({})},onKeystroke:{type:Function,default:function(t,e){return!0}},onMoveOutOf:{type:Function,default:function(t){return!0}},onTabOutOf:{type:Function,default:function(t){return!0}}},install:function(t,e){Object.defineProperty(t.prototype,"$mathlive",{value:e}),t.component("mathlive-mathfield",this)},watch:{value:function(t,e){t!==e&&this.$el.mathfield.$latex(t,{suppressChangeNotifications:!0})},config:{deep:!0,handler:function(t){this.$el.mathfield.$setConfig(t)}}},mounted:function(){this.$nextTick(()=>{this.$mathlive.makeMathField(this.$el,{...this.config,onContentDidChange:t=>{this.$emit("input",this.$el.mathfield.$text())},onFocus:t=>{this.$emit("focus")},onBlur:t=>{this.$emit("blur")},onContentWillChange:t=>{this.$emit("content-will-change")},onSelectionWillChange:t=>{this.$emit("selection-will-change")},onUndoStateWillChange:(t,e)=>{this.$emit("undo-state-will-change",e)},onUndoStateDidChange:(t,e)=>{this.$emit("undo-state-did-change",e)},onVirtualKeyboardToggle:(t,e,i)=>{this.$emit("virtual-keyboard-toggle",e,i)},onReadAloudStatus:(t,e)=>{this.$emit("read-aloud-status",e)},onKeystroke:(t,e,i)=>this.onKeystroke(e,i),onMoveOutOf:(t,e)=>this.onMoveOutOf(e),onTabOutOf:(t,e)=>this.onTabOutOf(e)})})},methods:{perform:function(t){this.$el.mathfield.$perform(t)},hasFocus:function(){return this.$el.mathfield.$hasFocus()},focus:function(){this.$el.mathfield.$focus()},blur:function(){this.$el.mathfield.$blur()},text:function(t){return this.$el.mathfield.$text(t)},selectedText:function(t){return this.$el.mathfield.$selectedText(t)},insert:function(t,e){this.$el.mathfield.$insert(t,e)},keystroke:function(t,e){return this.$el.mathfield.$keystroke(t,e)},typedText:function(t){this.$el.mathfield.$keystroke(t)},selectionIsCollapsed:function(){return this.$el.mathfield.$selectionIsCollapsed()},selectionDepth:function(){return this.$el.mathfield.$selectionDepth()},selectionAtStart:function(){return this.$el.mathfield.$selectionAtStart()},selectionAtEnd:function(){return this.$el.mathfield.$selectionAtEnd()},select:function(){this.$el.mathfield.$select()},clearSelection:function(){this.$el.mathfield.$clearSelection()}}};export default t; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a3e328916..530cc63cb 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "mathlive", - "version": "0.52.0", + "version": "0.52.1-soc", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7caf51781..335388599 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mathlive", - "version": "0.52.0", + "version": "0.52.1-soc", "description": "Render and edit beautifully typeset math", "license": "MIT", "funding": { diff --git a/src/core/definitions-utils.ts b/src/core/definitions-utils.ts index e22a8c7d6..12ab259ab 100644 --- a/src/core/definitions-utils.ts +++ b/src/core/definitions-utils.ts @@ -56,7 +56,7 @@ export const REVERSE_MATH_SYMBOLS = { '[': '\\lbrack', ']': '\\rbrack', ':': '\\colon', // Also : - + '\u00a0': '~', // Also \space '\u00ac': '\\neg', // Also \lnot @@ -366,18 +366,11 @@ export const COMMAND_MODE_CHARACTERS = /[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$% // and Spanish. We use \p{L} (Unicode property escapes: "Letter") // but Firefox doesn't support it // (https://bugzilla.mozilla.org/show_bug.cgi?id=1361876). Booo... -// See also https://stackoverflow.com/questions/26133593/using-regex-to-match-international-unicode-alphanumeric-characters-in-javascript -export const LETTER = - typeof navigator !== 'undefined' && - /firefox|edge/i.test(navigator.userAgent) - ? /[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/ - : new RegExp('\\p{Letter}', 'u'); - -export const LETTER_AND_DIGITS = - typeof navigator !== 'undefined' && - /firefox|edge/i.test(navigator.userAgent) - ? /[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/ - : new RegExp('[0-9\\p{Letter}]', 'u'); + +// Socrative June 17, 2020: Regex was causing issues in IE, older versions of Safari (e.g. on IOS 11), and Firefox +export const LETTER = /[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/; + +export const LETTER_AND_DIGITS = /[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/; /** * @param symbol The LaTeX command for this symbol, for