manim-web 0.3.19 → 0.3.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/README.md +1 -1
  2. package/dist/AmsConfiguration-BMyoprhk.js +847 -0
  3. package/dist/AmsConfiguration-BdxxYRby.js +847 -0
  4. package/dist/ConfigMacrosConfiguration-B8X_JSVI.js +46 -0
  5. package/dist/ConfigMacrosConfiguration-DUxp6DUV.js +46 -0
  6. package/dist/Entities-B1o7gN0J.js +429 -0
  7. package/dist/Entities-C82lnCux.js +429 -0
  8. package/dist/Factory-BKM7FEO-.js +107 -0
  9. package/dist/Factory-D-whCqrb.js +107 -0
  10. package/dist/{GifExporter-7EpPGupp.js → GifExporter-BrxY_q7e.js} +1 -1
  11. package/dist/{GifExporter-DCrSD6FV.js → GifExporter-S2pbxMc5.js} +1 -1
  12. package/dist/HtmlNode-BLmQ2r7U.js +981 -0
  13. package/dist/HtmlNode-DXGeKrcW.js +981 -0
  14. package/dist/InputJax-DL9oUQY4.js +41 -0
  15. package/dist/InputJax-DnDWM3Y0.js +41 -0
  16. package/dist/NewcommandConfiguration-BPjclFig.js +32 -0
  17. package/dist/NewcommandConfiguration-bJ6P1rBY.js +32 -0
  18. package/dist/NewcommandMethods-C_E3iLoK.js +187 -0
  19. package/dist/NewcommandMethods-Cb7yFm5P.js +187 -0
  20. package/dist/Options-DRlTi0G8.js +63 -0
  21. package/dist/Options-XPptO-6X.js +63 -0
  22. package/dist/ParseMethods-BMPfzfQC.js +2636 -0
  23. package/dist/ParseMethods-D3_HeS1K.js +2636 -0
  24. package/dist/Styles-Dky5jZUe.js +293 -0
  25. package/dist/Styles-J-6R3Vr8.js +293 -0
  26. package/dist/{VideoExporter-6w8xBpcV.js → VideoExporter-6ikT3u9H.js} +1 -1
  27. package/dist/{VideoExporter-DdQb18dC.js → VideoExporter-D_RxVahH.js} +1 -1
  28. package/dist/animation/Animation.d.ts +15 -0
  29. package/dist/animation/Animation.d.ts.map +1 -1
  30. package/dist/animation/transform/FadeMorphStrategy.d.ts +18 -0
  31. package/dist/animation/transform/FadeMorphStrategy.d.ts.map +1 -0
  32. package/dist/animation/transform/FadeTransforms.d.ts +2 -0
  33. package/dist/animation/transform/FadeTransforms.d.ts.map +1 -1
  34. package/dist/animation/transform/MorphStrategy.d.ts +8 -0
  35. package/dist/animation/transform/MorphStrategy.d.ts.map +1 -0
  36. package/dist/animation/transform/MovementTransforms.d.ts +8 -0
  37. package/dist/animation/transform/MovementTransforms.d.ts.map +1 -1
  38. package/dist/animation/transform/PointMorphStrategy.d.ts +36 -0
  39. package/dist/animation/transform/PointMorphStrategy.d.ts.map +1 -0
  40. package/dist/animation/transform/ShapeMorphStrategy.d.ts +39 -0
  41. package/dist/animation/transform/ShapeMorphStrategy.d.ts.map +1 -0
  42. package/dist/animation/transform/Transform.d.ts +9 -88
  43. package/dist/animation/transform/Transform.d.ts.map +1 -1
  44. package/dist/animation/transform/TransformMatching.d.ts.map +1 -1
  45. package/dist/animation/transform/TransformMatchingBase.d.ts +1 -0
  46. package/dist/animation/transform/TransformMatchingBase.d.ts.map +1 -1
  47. package/dist/animation/transform/TransformMatchingShared.d.ts +37 -0
  48. package/dist/animation/transform/TransformMatchingShared.d.ts.map +1 -0
  49. package/dist/animation/transform/TransformPairing.d.ts +19 -0
  50. package/dist/animation/transform/TransformPairing.d.ts.map +1 -0
  51. package/dist/constants/fontRender.d.ts +19 -0
  52. package/dist/constants/fontRender.d.ts.map +1 -0
  53. package/dist/constants/index.d.ts.map +1 -1
  54. package/dist/core/AnimateProxy.d.ts +1 -0
  55. package/dist/core/AnimateProxy.d.ts.map +1 -1
  56. package/dist/core/Camera.d.ts +19 -6
  57. package/dist/core/Camera.d.ts.map +1 -1
  58. package/dist/core/CameraFrame.d.ts +0 -2
  59. package/dist/core/CameraFrame.d.ts.map +1 -1
  60. package/dist/core/Group.d.ts +2 -0
  61. package/dist/core/Group.d.ts.map +1 -1
  62. package/dist/core/Mobject.d.ts +6 -0
  63. package/dist/core/Mobject.d.ts.map +1 -1
  64. package/dist/core/MobjectTraversal.d.ts +25 -0
  65. package/dist/core/MobjectTraversal.d.ts.map +1 -0
  66. package/dist/core/Scene.d.ts.map +1 -1
  67. package/dist/core/TexturedMobject.d.ts +38 -0
  68. package/dist/core/TexturedMobject.d.ts.map +1 -0
  69. package/dist/core/ThreeDScene.d.ts +18 -3
  70. package/dist/core/ThreeDScene.d.ts.map +1 -1
  71. package/dist/core/VMobject.d.ts +54 -110
  72. package/dist/core/VMobject.d.ts.map +1 -1
  73. package/dist/core/VMobjectCurveUtils.d.ts +106 -0
  74. package/dist/core/VMobjectCurveUtils.d.ts.map +1 -0
  75. package/dist/core/VMobjectGeometry.d.ts +4 -16
  76. package/dist/core/VMobjectGeometry.d.ts.map +1 -1
  77. package/dist/core/VMobjectRendering.d.ts.map +1 -1
  78. package/dist/core/VMobjectStrokeGeometry.d.ts +20 -0
  79. package/dist/core/VMobjectStrokeGeometry.d.ts.map +1 -0
  80. package/dist/core/VMobjectTransformAlignment.d.ts +11 -0
  81. package/dist/core/VMobjectTransformAlignment.d.ts.map +1 -0
  82. package/dist/html-DU38zqaN.js +829 -0
  83. package/dist/html-DjkQuIHJ.js +829 -0
  84. package/dist/index.js +4 -4
  85. package/dist/integrations/react.js +5 -5
  86. package/dist/integrations/vue.js +7 -7
  87. package/dist/interaction/Draggable.d.ts +2 -0
  88. package/dist/interaction/Draggable.d.ts.map +1 -1
  89. package/dist/interaction/OrbitControls.d.ts +2 -0
  90. package/dist/interaction/OrbitControls.d.ts.map +1 -1
  91. package/dist/lengths-CP7zmbxJ.js +54 -0
  92. package/dist/lengths-D4tR1gYA.js +54 -0
  93. package/dist/liteAdaptor-BLgze3o2.js +616 -0
  94. package/dist/liteAdaptor-zXv-jsO1.js +616 -0
  95. package/dist/manim-web.browser.js +35324 -31248
  96. package/dist/mathjax-7LgaTjtj.js +121 -0
  97. package/dist/mathjax-CoSFlQ0H.js +121 -0
  98. package/dist/mo-C5uLT3Z9.js +2675 -0
  99. package/dist/mo-CNYDGAsg.js +2675 -0
  100. package/dist/mobjects/geometry/AngleShapes.d.ts +8 -0
  101. package/dist/mobjects/geometry/AngleShapes.d.ts.map +1 -1
  102. package/dist/mobjects/geometry/BooleanOperations.d.ts +1 -1
  103. package/dist/mobjects/geometry/BooleanOperations.d.ts.map +1 -1
  104. package/dist/mobjects/geometry/PolygonExtensions.d.ts +1 -1
  105. package/dist/mobjects/geometry/PolygonExtensions.d.ts.map +1 -1
  106. package/dist/mobjects/graphing/ComplexPlane.d.ts +18 -0
  107. package/dist/mobjects/graphing/ComplexPlane.d.ts.map +1 -1
  108. package/dist/mobjects/image/index.d.ts +9 -2
  109. package/dist/mobjects/image/index.d.ts.map +1 -1
  110. package/dist/mobjects/text/MarkupText.d.ts.map +1 -1
  111. package/dist/mobjects/text/MathJaxRenderer.d.ts +4 -2
  112. package/dist/mobjects/text/MathJaxRenderer.d.ts.map +1 -1
  113. package/dist/mobjects/text/MathTex.d.ts +9 -2
  114. package/dist/mobjects/text/MathTex.d.ts.map +1 -1
  115. package/dist/mobjects/text/MathTexImage.d.ts +14 -4
  116. package/dist/mobjects/text/MathTexImage.d.ts.map +1 -1
  117. package/dist/mobjects/text/Text.d.ts +10 -5
  118. package/dist/mobjects/text/Text.d.ts.map +1 -1
  119. package/dist/mobjects/text/katexStyles.d.ts.map +1 -1
  120. package/dist/mobjects/text/svgPathParser.d.ts.map +1 -1
  121. package/dist/mobjects/three-d/ThreeDAxes.d.ts +121 -9
  122. package/dist/mobjects/three-d/ThreeDAxes.d.ts.map +1 -1
  123. package/dist/{chunk-DeC0fbbY.js → rolldown-runtime-DnwLefa7.js} +1 -1
  124. package/dist/{src-0ifQdJUj.js → src-CW4pfZdP.js} +33071 -29118
  125. package/dist/svg-CYweEoZ1.js +28698 -0
  126. package/dist/svg-swSF_J59.js +28698 -0
  127. package/dist/tex-C4_queV-.js +1423 -0
  128. package/dist/tex-CA5MLeEe.js +1423 -0
  129. package/dist/utils/math.d.ts +50 -5
  130. package/dist/utils/math.d.ts.map +1 -1
  131. package/package.json +6 -5
  132. package/dist/AllPackages-C4Ha3Jps.js +0 -7912
  133. package/dist/AllPackages-Dwxf_-Ps.js +0 -7912
  134. package/dist/BaseConfiguration-D2fikupy.js +0 -4402
  135. package/dist/BaseConfiguration-DYpI8zxb.js +0 -4402
  136. package/dist/Entities-BxzKxtF2.js +0 -458
  137. package/dist/Entities-gIbwAkB6.js +0 -458
  138. package/dist/InputJax-BszJvLkW.js +0 -43
  139. package/dist/InputJax-CgHBfQsv.js +0 -43
  140. package/dist/MathItem-4gYKatZT.js +0 -77
  141. package/dist/MathItem-BGJUnd1K.js +0 -77
  142. package/dist/Options-CQim5zsr.js +0 -188
  143. package/dist/Options-Cn9jv1mh.js +0 -188
  144. package/dist/PrioritizedList-C1R4aNEC.js +0 -36
  145. package/dist/PrioritizedList-lIkFMNlo.js +0 -36
  146. package/dist/Styles-Bi9Db-2J.js +0 -411
  147. package/dist/Styles-CzHPc-An.js +0 -411
  148. package/dist/TeXAtom-Cinii27y.js +0 -2025
  149. package/dist/TeXAtom-DFdvwkN2.js +0 -2025
  150. package/dist/html-DKkfg_ss.js +0 -1587
  151. package/dist/html-DpiYkktJ.js +0 -1587
  152. package/dist/lengths-C0YS8_KC.js +0 -65
  153. package/dist/lengths-eBH2o1TO.js +0 -65
  154. package/dist/liteAdaptor-CB8lQj3d.js +0 -828
  155. package/dist/liteAdaptor-DvuW8HsZ.js +0 -828
  156. package/dist/mathjax-BVz9WLAG.js +0 -105
  157. package/dist/mathjax-BbWkqal4.js +0 -2
  158. package/dist/mathjax-BrFZxFhK.js +0 -2
  159. package/dist/mathjax-DdKmwllV.js +0 -105
  160. package/dist/mo-B60kIOAG.js +0 -3271
  161. package/dist/mo-cSv2058o.js +0 -3271
  162. package/dist/svg-BDTt4xHZ.js +0 -23879
  163. package/dist/svg-DzbC3CbJ.js +0 -23879
  164. package/dist/tex-CRhAZgfS.js +0 -401
  165. package/dist/tex-D3LEgNlQ.js +0 -401
@@ -0,0 +1,2636 @@
1
+ import { o as e, r as t, t as n } from "./Options-XPptO-6X.js";
2
+ import { o as r } from "./mathjax-CoSFlQ0H.js";
3
+ import { n as i } from "./Styles-J-6R3Vr8.js";
4
+ import { t as a } from "./Entities-B1o7gN0J.js";
5
+ import { d as o, h as s, i as c, p as l, t as u, x as d } from "./mo-CNYDGAsg.js";
6
+ import { r as f } from "./lengths-CP7zmbxJ.js";
7
+ //#region node_modules/@mathjax/src/mjs/input/tex/NodeUtil.js
8
+ var p = {
9
+ attrs: new Set([
10
+ "autoOP",
11
+ "fnOP",
12
+ "movesupsub",
13
+ "subsupOK",
14
+ "texprimestyle",
15
+ "useHeight",
16
+ "variantForm",
17
+ "withDelims",
18
+ "mathaccent",
19
+ "open",
20
+ "close"
21
+ ]),
22
+ createEntity(e) {
23
+ return String.fromCodePoint(parseInt(e, 16));
24
+ },
25
+ getChildren(e) {
26
+ return e.childNodes;
27
+ },
28
+ getText(e) {
29
+ return e.getText();
30
+ },
31
+ appendChildren(e, t) {
32
+ for (let n of t) e.appendChild(n);
33
+ },
34
+ setAttribute(e, t, n) {
35
+ e.attributes.set(t, n);
36
+ },
37
+ setProperty(e, t, n) {
38
+ e.setProperty(t, n);
39
+ },
40
+ setProperties(e, t) {
41
+ for (let n of Object.keys(t)) {
42
+ let r = t[n];
43
+ n === "texClass" ? (e.texClass = r, e.setProperty(n, r)) : n === "movablelimits" ? (e.setProperty("movablelimits", r), (e.isKind("mo") || e.isKind("mstyle")) && e.attributes.set("movablelimits", r)) : n === "inferred" || (p.attrs.has(n) ? e.setProperty(n, r) : e.attributes.set(n, r));
44
+ }
45
+ },
46
+ getProperty(e, t) {
47
+ return e.getProperty(t);
48
+ },
49
+ getAttribute(e, t) {
50
+ return e.attributes.get(t);
51
+ },
52
+ removeAttribute(e, t) {
53
+ e.attributes.unset(t);
54
+ },
55
+ removeProperties(e, ...t) {
56
+ e.removeProperty(...t);
57
+ },
58
+ getChildAt(e, t) {
59
+ return e.childNodes[t];
60
+ },
61
+ setChild(e, t, n) {
62
+ let r = e.childNodes;
63
+ r[t] = n, n && (n.parent = e);
64
+ },
65
+ copyChildren(e, t) {
66
+ let n = e.childNodes;
67
+ for (let e = 0; e < n.length; e++) this.setChild(t, e, n[e]);
68
+ },
69
+ copyAttributes(e, t) {
70
+ t.attributes = e.attributes;
71
+ for (let [n, r] of Object.entries(e.getAllProperties())) t.setProperty(n, r);
72
+ },
73
+ isType(e, t) {
74
+ return e.isKind(t);
75
+ },
76
+ isEmbellished(e) {
77
+ return e.isEmbellished;
78
+ },
79
+ getTexClass(e) {
80
+ return e.texClass;
81
+ },
82
+ getCoreMO(e) {
83
+ return e.coreMO();
84
+ },
85
+ isNode(e) {
86
+ return e instanceof l || e instanceof o;
87
+ },
88
+ isInferred(e) {
89
+ return e.isInferred;
90
+ },
91
+ getForm(e) {
92
+ if (!e.isKind("mo")) return null;
93
+ let t = e, n = t.getForms();
94
+ for (let e of n) {
95
+ let n = this.getOp(t, e);
96
+ if (n) return n;
97
+ }
98
+ return null;
99
+ },
100
+ getOp(e, t = "infix") {
101
+ return u.OPTABLE[t][e.getText()] || null;
102
+ },
103
+ getMoAttribute(e, t) {
104
+ if (!e.attributes.isSet(t)) for (let n of [
105
+ "infix",
106
+ "postfix",
107
+ "prefix"
108
+ ]) {
109
+ let r = this.getOp(e, n)?.[3]?.[t];
110
+ if (r !== void 0) return r;
111
+ }
112
+ return e.attributes.get(t);
113
+ }
114
+ }, m = {
115
+ Variant: {
116
+ NORMAL: "normal",
117
+ BOLD: "bold",
118
+ ITALIC: "italic",
119
+ BOLDITALIC: "bold-italic",
120
+ DOUBLESTRUCK: "double-struck",
121
+ FRAKTUR: "fraktur",
122
+ BOLDFRAKTUR: "bold-fraktur",
123
+ SCRIPT: "script",
124
+ BOLDSCRIPT: "bold-script",
125
+ SANSSERIF: "sans-serif",
126
+ BOLDSANSSERIF: "bold-sans-serif",
127
+ SANSSERIFITALIC: "sans-serif-italic",
128
+ SANSSERIFBOLDITALIC: "sans-serif-bold-italic",
129
+ MONOSPACE: "monospace",
130
+ INITIAL: "inital",
131
+ TAILED: "tailed",
132
+ LOOPED: "looped",
133
+ STRETCHED: "stretched",
134
+ CALLIGRAPHIC: "-tex-calligraphic",
135
+ BOLDCALLIGRAPHIC: "-tex-bold-calligraphic",
136
+ OLDSTYLE: "-tex-oldstyle",
137
+ BOLDOLDSTYLE: "-tex-bold-oldstyle",
138
+ MATHITALIC: "-tex-mathit"
139
+ },
140
+ Form: {
141
+ PREFIX: "prefix",
142
+ INFIX: "infix",
143
+ POSTFIX: "postfix"
144
+ },
145
+ LineBreak: {
146
+ AUTO: "auto",
147
+ NEWLINE: "newline",
148
+ NOBREAK: "nobreak",
149
+ GOODBREAK: "goodbreak",
150
+ BADBREAK: "badbreak"
151
+ },
152
+ LineBreakStyle: {
153
+ BEFORE: "before",
154
+ AFTER: "after",
155
+ DUPLICATE: "duplicate",
156
+ INFIXLINBREAKSTYLE: "infixlinebreakstyle"
157
+ },
158
+ IndentAlign: {
159
+ LEFT: "left",
160
+ CENTER: "center",
161
+ RIGHT: "right",
162
+ AUTO: "auto",
163
+ ID: "id",
164
+ INDENTALIGN: "indentalign"
165
+ },
166
+ IndentShift: { INDENTSHIFT: "indentshift" },
167
+ LineThickness: {
168
+ THIN: "thin",
169
+ MEDIUM: "medium",
170
+ THICK: "thick"
171
+ },
172
+ Notation: {
173
+ LONGDIV: "longdiv",
174
+ ACTUARIAL: "actuarial",
175
+ PHASORANGLE: "phasorangle",
176
+ RADICAL: "radical",
177
+ BOX: "box",
178
+ ROUNDEDBOX: "roundedbox",
179
+ CIRCLE: "circle",
180
+ LEFT: "left",
181
+ RIGHT: "right",
182
+ TOP: "top",
183
+ BOTTOM: "bottom",
184
+ UPDIAGONALSTRIKE: "updiagonalstrike",
185
+ DOWNDIAGONALSTRIKE: "downdiagonalstrike",
186
+ VERTICALSTRIKE: "verticalstrike",
187
+ HORIZONTALSTRIKE: "horizontalstrike",
188
+ NORTHEASTARROW: "northeastarrow",
189
+ MADRUWB: "madruwb",
190
+ UPDIAGONALARROW: "updiagonalarrow"
191
+ },
192
+ Align: {
193
+ TOP: "top",
194
+ BOTTOM: "bottom",
195
+ CENTER: "center",
196
+ BASELINE: "baseline",
197
+ AXIS: "axis",
198
+ LEFT: "left",
199
+ RIGHT: "right"
200
+ },
201
+ Lines: {
202
+ NONE: "none",
203
+ SOLID: "solid",
204
+ DASHED: "dashed"
205
+ },
206
+ Side: {
207
+ LEFT: "left",
208
+ RIGHT: "right",
209
+ LEFTOVERLAP: "leftoverlap",
210
+ RIGHTOVERLAP: "rightoverlap"
211
+ },
212
+ Width: {
213
+ AUTO: "auto",
214
+ FIT: "fit"
215
+ },
216
+ Actiontype: {
217
+ TOGGLE: "toggle",
218
+ STATUSLINE: "statusline",
219
+ TOOLTIP: "tooltip",
220
+ INPUT: "input"
221
+ },
222
+ Overflow: {
223
+ LINBREAK: "linebreak",
224
+ SCROLL: "scroll",
225
+ ELIDE: "elide",
226
+ TRUNCATE: "truncate",
227
+ SCALE: "scale"
228
+ },
229
+ Unit: {
230
+ EM: "em",
231
+ EX: "ex",
232
+ PX: "px",
233
+ IN: "in",
234
+ CM: "cm",
235
+ MM: "mm",
236
+ PT: "pt",
237
+ PC: "pc"
238
+ },
239
+ Attr: {
240
+ LATEX: "data-latex",
241
+ LATEXITEM: "data-latex-item"
242
+ }
243
+ }, h;
244
+ (function(e) {
245
+ e.HANDLER = "handler", e.FALLBACK = "fallback", e.ITEMS = "items", e.TAGS = "tags", e.OPTIONS = "options", e.NODES = "nodes", e.PREPROCESSORS = "preprocessors", e.POSTPROCESSORS = "postprocessors", e.INIT = "init", e.CONFIG = "config", e.PRIORITY = "priority", e.PARSER = "parser";
246
+ })(h ||= {});
247
+ var g;
248
+ (function(e) {
249
+ e.DELIMITER = "delimiter", e.MACRO = "macro", e.CHARACTER = "character", e.ENVIRONMENT = "environment";
250
+ })(g ||= {});
251
+ //#endregion
252
+ //#region node_modules/@mathjax/src/mjs/input/tex/UnitUtil.js
253
+ var ee = class {
254
+ constructor(e) {
255
+ this.num = "([-+]?([.,]\\d+|\\d+([.,]\\d*)?))", this.unit = "", this.dimenEnd = /./, this.dimenRest = /./, this.map = new Map(e), this.updateDimen();
256
+ }
257
+ updateDimen() {
258
+ this.unit = `(${Array.from(this.map.keys()).join("|")})`, this.dimenEnd = RegExp("^\\s*" + this.num + "\\s*" + this.unit + "\\s*$"), this.dimenRest = RegExp("^\\s*" + this.num + "\\s*" + this.unit + " ?");
259
+ }
260
+ set(e, t) {
261
+ return this.map.set(e, t), this.updateDimen(), this;
262
+ }
263
+ get(e) {
264
+ return this.map.get(e) || this.map.get("pt");
265
+ }
266
+ delete(e) {
267
+ return this.map.delete(e) ? (this.updateDimen(), !0) : !1;
268
+ }
269
+ }, _ = 7.2, te = 72;
270
+ function ne([e, t, n]) {
271
+ return t === "mu" ? [
272
+ v.em(v.UNIT_CASES.get(t) * parseFloat(e)).slice(0, -2),
273
+ "em",
274
+ n
275
+ ] : [
276
+ e,
277
+ t,
278
+ n
279
+ ];
280
+ }
281
+ var v = {
282
+ UNIT_CASES: new ee([
283
+ ["em", 1],
284
+ ["ex", .43],
285
+ ["pt", 1 / 10],
286
+ ["pc", 1.2],
287
+ ["px", _ / te],
288
+ ["in", _],
289
+ ["cm", _ / 2.54],
290
+ ["mm", _ / 25.4],
291
+ ["mu", 1 / 18]
292
+ ]),
293
+ matchDimen(e, t = !1) {
294
+ let n = e.match(t ? v.UNIT_CASES.dimenRest : v.UNIT_CASES.dimenEnd);
295
+ return n ? ne([
296
+ n[1].replace(/,/, "."),
297
+ n[4],
298
+ n[0].length
299
+ ]) : [
300
+ null,
301
+ null,
302
+ 0
303
+ ];
304
+ },
305
+ dimen2em(e) {
306
+ let [t, n] = v.matchDimen(e), r = parseFloat(t || "1");
307
+ return v.UNIT_CASES.get(n) * r;
308
+ },
309
+ em(e) {
310
+ return Math.abs(e) < 6e-4 ? "0em" : e.toFixed(3).replace(/\.?0+$/, "") + "em";
311
+ },
312
+ trimSpaces(e) {
313
+ if (typeof e != "string") return e;
314
+ let t = e.trim();
315
+ return t.match(/\\$/) && e.match(/ $/) && (t += " "), t;
316
+ }
317
+ }, re = class {
318
+ constructor(e, t, n) {
319
+ this._factory = e, this._env = t, this.global = {}, this.stack = [], this.global = { isInner: n }, this.stack = [this._factory.create("start", this.global)], t && (this.stack[0].env = t), this.env = this.stack[0].env;
320
+ }
321
+ set env(e) {
322
+ this._env = e;
323
+ }
324
+ get env() {
325
+ return this._env;
326
+ }
327
+ Push(...e) {
328
+ for (let t of e) {
329
+ if (!t) continue;
330
+ let e = p.isNode(t) ? this._factory.create("mml", t) : t;
331
+ e.global = this.global;
332
+ let [n, r] = this.stack.length ? this.Top().checkItem(e) : [null, !0];
333
+ if (r) {
334
+ if (n) {
335
+ this.Pop(), this.Push(...n);
336
+ continue;
337
+ }
338
+ e.isKind("null") || this.stack.push(e), e.env ? (e.copyEnv && Object.assign(e.env, this.env), this.env = e.env) : e.env = this.env;
339
+ }
340
+ }
341
+ }
342
+ Pop() {
343
+ let e = this.stack.pop();
344
+ return e.isOpen || delete e.env, this.env = this.stack.length ? this.Top().env : {}, e;
345
+ }
346
+ Top(e = 1) {
347
+ return this.stack.length < e ? null : this.stack[this.stack.length - e];
348
+ }
349
+ Prev(e) {
350
+ let t = this.Top();
351
+ return e ? t.First : t.Pop();
352
+ }
353
+ get height() {
354
+ return this.stack.length;
355
+ }
356
+ toString() {
357
+ return "stack[\n " + this.stack.join("\n ") + "\n]";
358
+ }
359
+ }, y = class e {
360
+ static processString(t, n) {
361
+ let r = t.split(e.pattern);
362
+ for (let e = 1, t = r.length; e < t; e += 2) {
363
+ let t = r[e].charAt(0);
364
+ t >= "0" && t <= "9" ? (r[e] = n[parseInt(r[e], 10) - 1], typeof r[e] == "number" && (r[e] = r[e].toString())) : t === "{" && (t = r[e].substring(1), t >= "0" && t <= "9" ? (r[e] = n[parseInt(r[e].substring(1, r[e].length - 1), 10) - 1], typeof r[e] == "number" && (r[e] = r[e].toString())) : r[e].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/) && (r[e] = "%" + r[e]));
365
+ }
366
+ return r.join("");
367
+ }
368
+ constructor(t, n, ...r) {
369
+ this.id = t, this.message = e.processString(n, r);
370
+ }
371
+ };
372
+ y.pattern = /%(\d+|\{\d+\}|\{[a-z]+:%\d+(?:\|(?:%\{\d+\}|%.|[^}])*)+\}|.)/g;
373
+ //#endregion
374
+ //#region node_modules/@mathjax/src/mjs/input/tex/StackItem.js
375
+ var ie = class {
376
+ constructor(e) {
377
+ this._nodes = e, this.startStr = "", this.startI = 0, this.stopI = 0;
378
+ }
379
+ get nodes() {
380
+ return this._nodes;
381
+ }
382
+ Push(...e) {
383
+ this._nodes.push(...e);
384
+ }
385
+ Pop() {
386
+ return this._nodes.pop();
387
+ }
388
+ get First() {
389
+ return this._nodes[this.Size() - 1];
390
+ }
391
+ set First(e) {
392
+ this._nodes[this.Size() - 1] = e;
393
+ }
394
+ get Last() {
395
+ return this._nodes[0];
396
+ }
397
+ set Last(e) {
398
+ this._nodes[0] = e;
399
+ }
400
+ Peek(e) {
401
+ return e ??= 1, this._nodes.slice(this.Size() - e);
402
+ }
403
+ Size() {
404
+ return this._nodes.length;
405
+ }
406
+ Clear() {
407
+ this._nodes = [];
408
+ }
409
+ toMml(e = !0, t) {
410
+ return this._nodes.length === 1 && !t ? this.First : this.create("node", e ? "inferredMrow" : "mrow", this._nodes, {});
411
+ }
412
+ create(e, ...t) {
413
+ return this.factory.configuration.nodeFactory.create(e, ...t);
414
+ }
415
+ }, b = class e extends ie {
416
+ constructor(e, ...t) {
417
+ super(t), this.factory = e, this.global = {}, this._properties = {}, this.isOpen && (this._env = {});
418
+ }
419
+ get kind() {
420
+ return "base";
421
+ }
422
+ get env() {
423
+ return this._env;
424
+ }
425
+ set env(e) {
426
+ this._env = e;
427
+ }
428
+ get copyEnv() {
429
+ return !0;
430
+ }
431
+ getProperty(e) {
432
+ return this._properties[e];
433
+ }
434
+ setProperty(e, t) {
435
+ return this._properties[e] = t, this;
436
+ }
437
+ get isOpen() {
438
+ return !1;
439
+ }
440
+ get isClose() {
441
+ return !1;
442
+ }
443
+ get isFinal() {
444
+ return !1;
445
+ }
446
+ isKind(e) {
447
+ return e === this.kind;
448
+ }
449
+ checkItem(t) {
450
+ if (t.isKind("over") && this.isOpen && (t.setProperty("num", this.toMml(!1)), this.Clear()), t.isKind("cell") && this.isOpen) {
451
+ if (t.getProperty("linebreak")) return e.fail;
452
+ throw new y("Misplaced", "Misplaced %1", t.getName());
453
+ }
454
+ if (t.isClose && this.getErrors(t.kind)) {
455
+ let [e, n] = this.getErrors(t.kind);
456
+ throw new y(e, n, t.getName());
457
+ }
458
+ return t.isFinal ? (this.Push(t.First), e.fail) : e.success;
459
+ }
460
+ clearEnv() {
461
+ for (let e of Object.keys(this.env)) delete this.env[e];
462
+ }
463
+ setProperties(e) {
464
+ return Object.assign(this._properties, e), this;
465
+ }
466
+ getName() {
467
+ return this.getProperty("name");
468
+ }
469
+ toString() {
470
+ return this.kind + "[" + this.nodes.join("; ") + "]";
471
+ }
472
+ getErrors(t) {
473
+ return this.constructor.errors[t] || e.errors[t];
474
+ }
475
+ addLatexItem(e, t = "") {
476
+ let n = this.startStr.slice(this.startI, this.stopI);
477
+ if (n) {
478
+ let r = t ? t + n : n;
479
+ e.attributes.set(m.Attr.LATEXITEM, r), r !== "}" && e.attributes.set(m.Attr.LATEX, r);
480
+ }
481
+ }
482
+ };
483
+ b.fail = [null, !1], b.success = [null, !0], b.errors = {
484
+ end: ["MissingBeginExtraEnd", "Missing \\begin{%1} or extra \\end{%1}"],
485
+ close: ["ExtraCloseMissingOpen", "Extra close brace or missing open brace"],
486
+ right: ["MissingLeftExtraRight", "Missing \\left or extra \\right"],
487
+ middle: ["ExtraMiddle", "Extra \\middle"]
488
+ };
489
+ //#endregion
490
+ //#region node_modules/@mathjax/src/mjs/input/tex/TexParser.js
491
+ var x = class e {
492
+ constructor(e, t, n) {
493
+ this._string = e, this.configuration = n, this.macroCount = 0, this.i = 0, this.currentCS = "", this.saveI = 0;
494
+ let r = Object.hasOwn(t, "isInner"), i = t.isInner;
495
+ delete t.isInner;
496
+ let a;
497
+ if (t) {
498
+ a = {};
499
+ for (let e of Object.keys(t)) a[e] = t[e];
500
+ }
501
+ this.configuration.pushParser(this), this.stack = new re(this.itemFactory, a, r ? i : !0), this.Parse(), this.Push(this.itemFactory.create("stop")), this.stack.env = a;
502
+ }
503
+ get options() {
504
+ return this.configuration.options;
505
+ }
506
+ get itemFactory() {
507
+ return this.configuration.itemFactory;
508
+ }
509
+ get tags() {
510
+ return this.configuration.tags;
511
+ }
512
+ set string(e) {
513
+ this._string = e;
514
+ }
515
+ get string() {
516
+ return this._string;
517
+ }
518
+ parse(e, t) {
519
+ let n = this.saveI;
520
+ this.saveI = this.i - +(e === "character" && t[1] !== "&");
521
+ let r = this.configuration.handlers.get(e).parse(t);
522
+ return e !== "macro" && this.updateResult(t[1], n), this.saveI = n, r;
523
+ }
524
+ lookup(e, t) {
525
+ return this.configuration.handlers.get(e).lookup(t);
526
+ }
527
+ contains(e, t) {
528
+ return this.configuration.handlers.get(e).contains(t);
529
+ }
530
+ toString() {
531
+ let e = "";
532
+ for (let t of Array.from(this.configuration.handlers.keys())) e += t + ": " + this.configuration.handlers.get(t) + "\n";
533
+ return e;
534
+ }
535
+ Parse() {
536
+ let e;
537
+ for (; this.i < this.string.length;) e = this.getCodePoint(), this.i += e.length, this.parse(g.CHARACTER, [this, e]);
538
+ }
539
+ Push(e) {
540
+ e instanceof b && (e.startI = this.saveI, e.stopI = this.i, e.startStr = this.string), e instanceof l && e.isInferred ? this.PushAll(e.childNodes) : this.stack.Push(e);
541
+ }
542
+ PushAll(e) {
543
+ for (let t of e) this.stack.Push(t);
544
+ }
545
+ mml() {
546
+ if (!this.stack.Top().isKind("mml")) return null;
547
+ let e = this.stack.Top().First;
548
+ this.configuration.popParser();
549
+ let t = this.trimTex(this.string);
550
+ return t && e.attributes.set(m.Attr.LATEX, t), e;
551
+ }
552
+ convertDelimiter(e) {
553
+ return this.lookup(g.DELIMITER, e)?.char ?? null;
554
+ }
555
+ getCodePoint() {
556
+ let e = this.string.codePointAt(this.i);
557
+ return e === void 0 ? "" : String.fromCodePoint(e);
558
+ }
559
+ nextIsSpace() {
560
+ return !!this.string.charAt(this.i).match(/\s/);
561
+ }
562
+ GetNext() {
563
+ for (; this.nextIsSpace();) this.i++;
564
+ return this.getCodePoint();
565
+ }
566
+ GetCS() {
567
+ let e = this.string.slice(this.i).match(/^(([a-z]+) ?|[\uD800-\uDBFF].|.)/i);
568
+ return e ? (this.i += e[0].length, e[2] || e[1]) : (this.i++, " ");
569
+ }
570
+ GetArgument(e, t = !1) {
571
+ switch (this.GetNext()) {
572
+ case "":
573
+ if (!t) throw new y("MissingArgFor", "Missing argument for %1", this.currentCS);
574
+ return null;
575
+ case "}":
576
+ if (!t) throw new y("ExtraCloseMissingOpen", "Extra close brace or missing open brace");
577
+ return null;
578
+ case "\\": return this.i++, "\\" + this.GetCS();
579
+ case "{": {
580
+ let e = ++this.i, t = 1;
581
+ for (; this.i < this.string.length;) switch (this.string.charAt(this.i++)) {
582
+ case "\\":
583
+ this.i++;
584
+ break;
585
+ case "{":
586
+ t++;
587
+ break;
588
+ case "}":
589
+ if (--t === 0) return this.string.slice(e, this.i - 1);
590
+ break;
591
+ }
592
+ throw new y("MissingCloseBrace", "Missing close brace");
593
+ }
594
+ }
595
+ let n = this.getCodePoint();
596
+ return this.i += n.length, n;
597
+ }
598
+ GetBrackets(e, t, n = !1) {
599
+ if (this.GetNext() !== "[") return t;
600
+ let r = ++this.i, i = 0, a = 0;
601
+ for (; this.i < this.string.length;) switch (this.string.charAt(this.i++)) {
602
+ case "{":
603
+ i++;
604
+ break;
605
+ case "\\":
606
+ this.i++;
607
+ break;
608
+ case "}":
609
+ if (i-- <= 0) throw new y("ExtraCloseLooking", "Extra close brace while looking for %1", "']'");
610
+ break;
611
+ case "[":
612
+ i === 0 && a++;
613
+ break;
614
+ case "]":
615
+ if (i === 0) {
616
+ if (!n || a === 0) return this.string.slice(r, this.i - 1);
617
+ a--;
618
+ }
619
+ break;
620
+ }
621
+ throw new y("MissingCloseBracket", "Could not find closing ']' for argument to %1", this.currentCS);
622
+ }
623
+ GetDelimiter(e, t = !1) {
624
+ let n = this.GetNext();
625
+ if (this.i += n.length, this.i <= this.string.length && (n === "\\" ? n += this.GetCS() : n === "{" && t && (this.i--, n = this.GetArgument(e).trim()), this.contains(g.DELIMITER, n))) return this.convertDelimiter(n);
626
+ throw new y("MissingOrUnrecognizedDelim", "Missing or unrecognized delimiter for %1", this.currentCS);
627
+ }
628
+ GetDimen(e) {
629
+ if (this.GetNext() === "{") {
630
+ let t = this.GetArgument(e), [n, r] = v.matchDimen(t);
631
+ if (n) return n + r;
632
+ } else {
633
+ let e = this.string.slice(this.i), [t, n, r] = v.matchDimen(e, !0);
634
+ if (t) return this.i += r, t + n;
635
+ }
636
+ throw new y("MissingDimOrUnits", "Missing dimension or its units for %1", this.currentCS);
637
+ }
638
+ GetUpTo(e, t) {
639
+ for (; this.nextIsSpace();) this.i++;
640
+ let n = this.i, r = 0;
641
+ for (; this.i < this.string.length;) {
642
+ let e = this.i, i = this.GetNext();
643
+ switch (this.i += i.length, i) {
644
+ case "\\":
645
+ i += this.GetCS();
646
+ break;
647
+ case "{":
648
+ r++;
649
+ break;
650
+ case "}":
651
+ if (r === 0) throw new y("ExtraCloseLooking", "Extra close brace while looking for %1", t);
652
+ r--;
653
+ break;
654
+ }
655
+ if (r === 0 && i === t) return this.string.slice(n, e);
656
+ }
657
+ throw new y("TokenNotFoundForCommand", "Could not find %1 for %2", t, this.currentCS);
658
+ }
659
+ ParseArg(t) {
660
+ return new e(this.GetArgument(t), this.stack.env, this.configuration).mml();
661
+ }
662
+ ParseUpTo(t, n) {
663
+ return new e(this.GetUpTo(t, n), this.stack.env, this.configuration).mml();
664
+ }
665
+ GetDelimiterArg(e) {
666
+ let t = v.trimSpaces(this.GetArgument(e));
667
+ if (t === "") return null;
668
+ if (this.contains(g.DELIMITER, t)) return t;
669
+ throw new y("MissingOrUnrecognizedDelim", "Missing or unrecognized delimiter for %1", this.currentCS);
670
+ }
671
+ GetStar() {
672
+ let e = this.GetNext() === "*";
673
+ return e && this.i++, e;
674
+ }
675
+ create(e, ...t) {
676
+ let n = this.configuration.nodeFactory.create(e, ...t);
677
+ return n.isToken && n.attributes.hasExplicit("mathvariant") && n.attributes.get("mathvariant").charAt(0) === "-" && n.setProperty("ignore-variant", !0), n;
678
+ }
679
+ trimTex(e) {
680
+ return e.trim() + (e.match(/(?:^|[^\\])(?:\\\\)*\\\s+$/) ? " " : "");
681
+ }
682
+ updateResult(e, t) {
683
+ let n = this.stack.Prev(!0);
684
+ if (!n) return;
685
+ let r = m.Attr.LATEX, i = n.attributes.get(r), a = n.attributes.get(m.Attr.LATEXITEM);
686
+ if (a !== void 0) {
687
+ i || (e === "}" || a === "}" ? this.composeBraces(n) : n.attributes.set(r, a));
688
+ return;
689
+ }
690
+ t = t < this.saveI ? this.saveI : t;
691
+ let o = this.trimTex(t === this.i ? e : this.string.slice(t, this.i));
692
+ if (!(!o || o === i || e === "\\" && o === "\\")) {
693
+ if (o === "_" || o === "^") n.setProperty("sub-sup", o);
694
+ else {
695
+ switch (n.getProperty("sub-sup")) {
696
+ case "^":
697
+ if (n.childNodes[2] && (o === "}" ? this.composeBraces(n.childNodes[2]) : n.childNodes[2].attributes.hasExplicit(r) || n.childNodes[2].attributes.set(r, o)), n.childNodes[1]) {
698
+ let e = n.childNodes[1].attributes.get(r);
699
+ this.composeLatex(n, `_${e}^`, 0, 2);
700
+ } else this.composeLatex(n, "^", 0, 2);
701
+ return;
702
+ case "_":
703
+ if (n.childNodes[1] && (o === "}" ? this.composeBraces(n.childNodes[1]) : n.childNodes[1].attributes.hasExplicit(r) || n.childNodes[1].attributes.set(r, o)), n.childNodes[2]) {
704
+ let e = n.childNodes[2].attributes.get(r);
705
+ this.composeLatex(n, `^${e}_`, 0, 1);
706
+ } else this.composeLatex(n, "_", 0, 1);
707
+ return;
708
+ }
709
+ if (o === "}") {
710
+ this.composeBraces(n);
711
+ return;
712
+ }
713
+ }
714
+ n.attributes.set(r, o);
715
+ }
716
+ }
717
+ composeLatex(e, t, n, r) {
718
+ if (!e.childNodes[n] || !e.childNodes[r]) return;
719
+ let i = m.Attr.LATEX, a = (e.childNodes[n].attributes.get(i) || "") + t + e.childNodes[r].attributes.get(i);
720
+ e.attributes.set(i, a);
721
+ }
722
+ composeBraces(e) {
723
+ let t = this.composeBracedContent(e);
724
+ e.attributes.set(m.Attr.LATEX, `{${t}}`);
725
+ }
726
+ composeBracedContent(e) {
727
+ let t = e.childNodes[0]?.childNodes || [], n = "";
728
+ for (let e of t) {
729
+ let t = (e?.attributes)?.get(m.Attr.LATEX) || "";
730
+ t && (n += n && n.match(/[a-zA-Z]$/) && t.match(/^[a-zA-Z]/) ? " " + t : t);
731
+ }
732
+ return n;
733
+ }
734
+ }, S = class {
735
+ static oneof(...e) {
736
+ return new this("string", (t) => e.includes(t), (e) => e);
737
+ }
738
+ constructor(e, t, n) {
739
+ this.name = e, this.verify = t, this.convert = n;
740
+ }
741
+ };
742
+ new S("boolean", (e) => e === "true" || e === "false", (e) => e === "true"), new S("number", (e) => !!e.match(/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[-+]?\d+)?$/), (e) => parseFloat(e)), new S("integer", (e) => !!e.match(/^[-+]?\d+$/), (e) => parseInt(e)), new S("string", (e) => !0, (e) => e), new S("dimen", (e) => v.matchDimen(e)[0] !== null, (e) => e);
743
+ function ae(e, t = !1) {
744
+ let n = {}, r = e, i, a, o, s = !0;
745
+ for (; r;) [a, i, r] = w(r, ["=", ","], t, s), s = !1, i === "=" ? ([o, i, r] = w(r, [","], t), o = o === "false" || o === "true" ? JSON.parse(o) : o, n[a] = o) : a && (n[a] = !0);
746
+ return n;
747
+ }
748
+ function C(e, t) {
749
+ if (t === 0) return e.replace(/^\s+/, "").replace(/([^\\\s]|^)((?:\\\\)*(?:\\\s)?)?\s+$/, "$1$2");
750
+ for (; t > 0;) e = e.trim().slice(1, -1), t--;
751
+ return e;
752
+ }
753
+ function w(e, t, n = !1, r = !1) {
754
+ let i = e.length, a = 0, o = "", s = 0, c = 0, l = !0;
755
+ for (; s < i;) {
756
+ let r = e[s++];
757
+ switch (r) {
758
+ case "\\":
759
+ o += r + (e[s++] || ""), l = !1;
760
+ continue;
761
+ case " ": break;
762
+ case "{":
763
+ l && c++, a++;
764
+ break;
765
+ case "}":
766
+ if (!a) throw new y("ExtraCloseMissingOpen", "Extra close brace or missing open brace");
767
+ a--, l = !1;
768
+ break;
769
+ default:
770
+ if (!a && t.includes(r)) return [
771
+ C(o, n ? Math.min(1, c) : c),
772
+ r,
773
+ e.slice(s)
774
+ ];
775
+ c > a && (c = a), l = !1;
776
+ }
777
+ o += r;
778
+ }
779
+ if (a) throw new y("ExtraOpenMissingClose", "Extra open brace or missing close brace");
780
+ return r && c ? [
781
+ "",
782
+ "",
783
+ C(o, 1)
784
+ ] : [
785
+ C(o, n ? Math.min(1, c) : c),
786
+ "",
787
+ e.slice(s)
788
+ ];
789
+ }
790
+ var T = {
791
+ cols(...e) {
792
+ return e.map((e) => v.em(e)).join(" ");
793
+ },
794
+ fenced(e, t, n, r, i = "", a = "") {
795
+ let o = e.nodeFactory, c = o.create("node", "mrow", [], {
796
+ open: t,
797
+ close: r,
798
+ texClass: s.INNER
799
+ }), l;
800
+ if (i) l = new x("\\" + i + "l" + t, e.parser.stack.env, e).mml();
801
+ else {
802
+ let e = o.create("text", t);
803
+ l = o.create("node", "mo", [], {
804
+ fence: !0,
805
+ stretchy: !0,
806
+ symmetric: !0,
807
+ texClass: s.OPEN
808
+ }, e);
809
+ }
810
+ if (p.appendChildren(c, [l, n]), i) l = new x("\\" + i + "r" + r, e.parser.stack.env, e).mml();
811
+ else {
812
+ let e = o.create("text", r);
813
+ l = o.create("node", "mo", [], {
814
+ fence: !0,
815
+ stretchy: !0,
816
+ symmetric: !0,
817
+ texClass: s.CLOSE
818
+ }, e);
819
+ }
820
+ return a && l.attributes.set("mathcolor", a), p.appendChildren(c, [l]), c;
821
+ },
822
+ fixedFence(e, t, n, r) {
823
+ let i = e.nodeFactory.create("node", "mrow", [], {
824
+ open: t,
825
+ close: r,
826
+ texClass: s.ORD
827
+ });
828
+ return t && p.appendChildren(i, [T.mathPalette(e, t, "l")]), p.isType(n, "mrow") ? p.appendChildren(i, p.getChildren(n)) : p.appendChildren(i, [n]), r && p.appendChildren(i, [T.mathPalette(e, r, "r")]), i;
829
+ },
830
+ mathPalette(e, t, n) {
831
+ (t === "{" || t === "}") && (t = "\\" + t);
832
+ let r = "{\\bigg" + n + " " + t + "}", i = "{\\big" + n + " " + t + "}";
833
+ return new x("\\mathchoice" + r + i + i + i, {}, e).mml();
834
+ },
835
+ fixInitialMO(e, t) {
836
+ for (let n = 0, r = t.length; n < r; n++) {
837
+ let r = t[n];
838
+ if (r && !p.isType(r, "mspace") && (!p.isType(r, "TeXAtom") || p.getChildren(r)[0] && p.getChildren(p.getChildren(r)[0]).length)) {
839
+ if (p.isEmbellished(r) || p.isType(r, "TeXAtom") && p.getTexClass(r) === s.REL) {
840
+ let n = e.nodeFactory.create("node", "mi");
841
+ t.unshift(n);
842
+ }
843
+ break;
844
+ }
845
+ }
846
+ },
847
+ internalMath(e, t, n, r) {
848
+ if (t = t.replace(/ +/g, " "), e.configuration.options.internalMath) return e.configuration.options.internalMath(e, t, n, r);
849
+ let i = r || e.stack.env.font, a = i ? { mathvariant: i } : {}, o = [], s = 0, c = 0, l, u, d = "", f = 0;
850
+ if (t.match(/\\?[${}\\]|\\\(|\\(?:eq)?ref\s*\{|\\U/)) {
851
+ for (; s < t.length;) if (l = t.charAt(s++), l === "$") d === "$" && f === 0 ? (u = e.create("node", "TeXAtom", [new x(t.slice(c, s - 1), {}, e.configuration).mml()]), o.push(u), d = "", c = s) : d === "" && (c < s - 1 && o.push(T.internalText(e, t.slice(c, s - 1), a)), d = "$", c = s);
852
+ else if (l === "{" && d !== "") f++;
853
+ else if (l === "}") if (d === "}" && f === 0) {
854
+ let n = new x(t.slice(c, s), {}, e.configuration).mml();
855
+ u = e.create("node", "TeXAtom", [n], a), o.push(u), d = "", c = s;
856
+ } else d !== "" && f && f--;
857
+ else if (l === "\\") {
858
+ if (d === "" && t.substring(s).match(/^(eq)?ref\s*\{/)) {
859
+ let n = RegExp["$&"].length;
860
+ c < s - 1 && o.push(T.internalText(e, t.slice(c, s - 1), a)), d = "}", c = s - 1, s += n;
861
+ } else if (l = t.charAt(s++), l === "(" && d === "") c < s - 2 && o.push(T.internalText(e, t.slice(c, s - 2), a)), d = ")", c = s;
862
+ else if (l === ")" && d === ")" && f === 0) u = e.create("node", "TeXAtom", [new x(t.slice(c, s - 2), {}, e.configuration).mml()]), o.push(u), d = "", c = s;
863
+ else if (l.match(/[${}\\]/) && d === "") s--, t = t.substring(0, s - 1) + t.substring(s);
864
+ else if (l === "U") {
865
+ let e = t.substring(s).match(/^\s*(?:([0-9A-F])|\{\s*([0-9A-F]+)\s*\})/);
866
+ if (!e) throw new y("BadRawUnicode", "Argument to %1 must a hexadecimal number with 1 to 6 digits", "\\U");
867
+ let n = String.fromCodePoint(parseInt(e[1] || e[2], 16));
868
+ t = t.substring(0, s - 2) + n + t.substring(s + e[0].length), s = s - 2 + n.length;
869
+ }
870
+ }
871
+ if (d !== "") throw new y("MathNotTerminated", "Math mode is not properly terminated");
872
+ }
873
+ return c < t.length && o.push(T.internalText(e, t.slice(c), a)), n == null ? o.length > 1 && (o = [e.create("node", "mrow", o)]) : o = [e.create("node", "mstyle", o, {
874
+ displaystyle: !1,
875
+ scriptlevel: n
876
+ })], o;
877
+ },
878
+ internalText(e, t, n) {
879
+ t = t.replace(/\n+/g, " ").replace(/^ +/, a.nbsp).replace(/ +$/, a.nbsp);
880
+ let r = e.create("text", t);
881
+ return e.create("node", "mtext", [], n, r);
882
+ },
883
+ underOver(e, t, n, r, i) {
884
+ if (T.checkMovableLimits(t), p.isType(t, "munderover") && p.isEmbellished(t)) {
885
+ p.setProperties(p.getCoreMO(t), {
886
+ lspace: 0,
887
+ rspace: 0
888
+ });
889
+ let n = e.create("node", "mo", [], { rspace: 0 });
890
+ t = e.create("node", "mrow", [n, t]);
891
+ }
892
+ let a = e.create("node", "munderover", [t]);
893
+ p.setChild(a, r === "over" ? a.over : a.under, n);
894
+ let o = a;
895
+ return i && (o = e.create("node", "TeXAtom", [e.create("node", "mstyle", [a], {
896
+ displaystyle: !0,
897
+ scriptlevel: 0
898
+ })], {
899
+ texClass: s.OP,
900
+ movesupsub: !0
901
+ })), p.setProperty(o, "subsupOK", !0), o;
902
+ },
903
+ checkMovableLimits(e) {
904
+ let t = p.isType(e, "mo") ? p.getForm(e) : null;
905
+ (p.getProperty(e, "movablelimits") || t && t[3] && t[3].movablelimits) && p.setProperties(e, { movablelimits: !1 });
906
+ },
907
+ setArrayAlign(e, t, n) {
908
+ return n || (t = v.trimSpaces(t || "")), t === "t" ? e.arraydef.align = "baseline 1" : t === "b" ? e.arraydef.align = "baseline -1" : t === "c" ? e.arraydef.align = "axis" : t && (n ? (n.string = `[${t}]` + n.string.slice(n.i), n.i = 0) : e.arraydef.align = t), e;
909
+ },
910
+ substituteArgs(e, t, n) {
911
+ let r = "", i = "", a = 0;
912
+ for (; a < n.length;) {
913
+ let o = n.charAt(a++);
914
+ if (o === "\\") r += o + n.charAt(a++);
915
+ else if (o === "#") if (o = n.charAt(a++), o === "#") r += o;
916
+ else {
917
+ if (!o.match(/[1-9]/) || parseInt(o, 10) > t.length) throw new y("IllegalMacroParam", "Illegal macro parameter reference");
918
+ i = T.addArgs(e, T.addArgs(e, i, r), t[parseInt(o, 10) - 1]), r = "";
919
+ }
920
+ else r += o;
921
+ }
922
+ return T.addArgs(e, i, r);
923
+ },
924
+ addArgs(e, t, n) {
925
+ if (n.match(/^[a-z]/i) && t.match(/(^|[^\\])(\\\\)*\\[a-z]+$/i) && (t += " "), t.length + n.length > e.configuration.options.maxBuffer) throw new y("MaxBufferSize", "MathJax internal buffer size exceeded; is there a recursive macro call?");
926
+ return t + n;
927
+ },
928
+ checkMaxMacros(e, t = !0) {
929
+ if (!(++e.macroCount <= e.configuration.options.maxMacros)) throw t ? new y("MaxMacroSub1", "MathJax maximum macro substitution count exceeded; is here a recursive macro call?") : new y("MaxMacroSub2", "MathJax maximum substitution count exceeded; is there a recursive latex environment?");
930
+ },
931
+ checkEqnEnv(e, t = !0) {
932
+ let n = e.stack.Top(), r = n.First;
933
+ if (!(n.getProperty("nestable") && t && !r || n.getProperty("nestStart")) && (!n.isKind("start") || r)) throw new y("ErroneousNestingEq", "Erroneous nesting of equation structures");
934
+ },
935
+ copyNode(e, t) {
936
+ let n = e.copy(), r = t.configuration;
937
+ return n.walkTree((e) => {
938
+ r.addNode(e.kind, e);
939
+ let t = (e.getProperty("in-lists") || "").split(/,/);
940
+ for (let n of t) n && r.addNode(n, e);
941
+ }), n;
942
+ },
943
+ mmlFilterAttribute(e, t, n) {
944
+ return n;
945
+ },
946
+ getFontDef(e) {
947
+ let t = e.stack.env.font;
948
+ return t ? { mathvariant: t } : {};
949
+ },
950
+ keyvalOptions(e, t = null, n = !1, r = !1) {
951
+ let i = ae(e, r);
952
+ if (t) for (let e of Object.keys(i)) if (Object.hasOwn(t, e)) {
953
+ if (t[e] instanceof S) {
954
+ let n = t[e], r = String(i[e]);
955
+ if (!n.verify(r)) throw new y("InvalidValue", "Value for key '%1' is not of the expected type", e);
956
+ i[e] = n.convert(r);
957
+ }
958
+ } else {
959
+ if (n) throw new y("InvalidOption", "Invalid option: %1", e);
960
+ delete i[e];
961
+ }
962
+ return i;
963
+ },
964
+ isLatinOrGreekChar(e) {
965
+ return !!e.normalize("NFD").match(/[a-zA-Z\u0370-\u03F0]/);
966
+ }
967
+ }, E = class {
968
+ constructor(e = "???", t = "") {
969
+ this.tag = e, this.id = t;
970
+ }
971
+ }, D = class {
972
+ constructor(e = "", t = !1, n = !1, r = null, i = "", a = "", o = !1, s = "") {
973
+ this.env = e, this.taggable = t, this.defaultTags = n, this.tag = r, this.tagId = i, this.tagFormat = a, this.noTag = o, this.labelId = s;
974
+ }
975
+ }, O = class {
976
+ constructor() {
977
+ this.counter = 0, this.allCounter = 0, this.configuration = null, this.ids = {}, this.allIds = {}, this.labels = {}, this.allLabels = {}, this.redo = !1, this.refUpdate = !1, this.currentTag = new D(), this.history = [], this.stack = [], this.enTag = function(e, t) {
978
+ let n = this.configuration.nodeFactory, r = n.create("node", "mtd", [e]), i = n.create("node", "mlabeledtr", [t, r]);
979
+ return n.create("node", "mtable", [i], {
980
+ side: this.configuration.options.tagSide,
981
+ minlabelspacing: this.configuration.options.tagIndent,
982
+ displaystyle: !0
983
+ });
984
+ };
985
+ }
986
+ start(e, t, n) {
987
+ this.currentTag && this.stack.push(this.currentTag);
988
+ let r = this.label;
989
+ this.currentTag = new D(e, t, n), this.label = r;
990
+ }
991
+ get env() {
992
+ return this.currentTag.env;
993
+ }
994
+ end() {
995
+ this.history.push(this.currentTag);
996
+ let e = this.label;
997
+ this.currentTag = this.stack.pop(), e && !this.label && (this.label = e);
998
+ }
999
+ tag(e, t) {
1000
+ this.currentTag.tag = e, this.currentTag.tagFormat = t ? e : this.formatTag(e), this.currentTag.noTag = !1;
1001
+ }
1002
+ notag() {
1003
+ this.tag("", !0), this.currentTag.noTag = !0;
1004
+ }
1005
+ get noTag() {
1006
+ return this.currentTag.noTag;
1007
+ }
1008
+ set label(e) {
1009
+ this.currentTag.labelId = e;
1010
+ }
1011
+ get label() {
1012
+ return this.currentTag.labelId;
1013
+ }
1014
+ formatUrl(e, t) {
1015
+ return t + "#" + encodeURIComponent(e);
1016
+ }
1017
+ formatTag(e) {
1018
+ return [
1019
+ "(",
1020
+ e,
1021
+ ")"
1022
+ ];
1023
+ }
1024
+ formatRef(e) {
1025
+ return this.formatTag(e);
1026
+ }
1027
+ formatId(e) {
1028
+ return "mjx-eqn:" + e.replace(/\s/g, "_");
1029
+ }
1030
+ formatNumber(e) {
1031
+ return e.toString();
1032
+ }
1033
+ autoTag() {
1034
+ this.currentTag.tag ?? (this.counter++, this.tag(this.formatNumber(this.counter), !1));
1035
+ }
1036
+ clearTag() {
1037
+ this.tag(null, !0), this.currentTag.tagId = "";
1038
+ }
1039
+ getTag(e = !1) {
1040
+ if (e) return this.autoTag(), this.makeTag();
1041
+ let t = this.currentTag;
1042
+ return t.taggable && !t.noTag && (t.defaultTags && this.autoTag(), t.tag) ? this.makeTag() : null;
1043
+ }
1044
+ resetTag() {
1045
+ this.history = [], this.redo = !1, this.refUpdate = !1, this.clearTag();
1046
+ }
1047
+ reset(e = 0) {
1048
+ this.resetTag(), this.counter = this.allCounter = e, this.allLabels = {}, this.allIds = {}, this.label = "";
1049
+ }
1050
+ startEquation(e) {
1051
+ this.history = [], this.stack = [], this.clearTag(), this.currentTag = new D("", void 0, void 0), this.labels = {}, this.ids = {}, this.counter = this.allCounter, this.redo = !1;
1052
+ let t = e.inputData.recompile;
1053
+ t && (this.refUpdate = !0, this.counter = t.counter);
1054
+ }
1055
+ finishEquation(e) {
1056
+ this.redo && (e.inputData.recompile = {
1057
+ state: e.state(),
1058
+ counter: this.allCounter
1059
+ }), this.refUpdate || (this.allCounter = this.counter), Object.assign(this.allIds, this.ids), Object.assign(this.allLabels, this.labels);
1060
+ }
1061
+ finalize(e, t) {
1062
+ if (!t.display || this.currentTag.env || this.currentTag.tag == null) return e;
1063
+ let n = this.makeTag();
1064
+ return this.enTag(e, n);
1065
+ }
1066
+ makeId() {
1067
+ this.currentTag.tagId = this.formatId(this.configuration.options.useLabelIds && this.label || this.currentTag.tag);
1068
+ }
1069
+ makeTag() {
1070
+ this.makeId(), this.label &&= (this.labels[this.label] = new E(this.currentTag.tag, this.currentTag.tagId), "");
1071
+ let e = this.currentTag.tagFormat, t = new x((Array.isArray(e) ? e : e.match(/^(\(|\[|\{)(.*)(\}|\]|\))$/)?.slice(1) || [e]).map((e) => e ? `\\text{${e}}` : "").join(""), {}, this.configuration).mml();
1072
+ return this.configuration.nodeFactory.create("node", "mtd", [t], {
1073
+ id: this.currentTag.tagId,
1074
+ rowalign: this.configuration.options.tagAlign
1075
+ });
1076
+ }
1077
+ }, k = new Map([["none", class extends O {
1078
+ autoTag() {}
1079
+ getTag() {
1080
+ return this.currentTag.tag ? super.getTag() : null;
1081
+ }
1082
+ }], ["all", class extends O {
1083
+ finalize(e, t) {
1084
+ if (!t.display || this.history.find(function(e) {
1085
+ return e.taggable;
1086
+ })) return e;
1087
+ let n = this.getTag(!0);
1088
+ return this.enTag(e, n);
1089
+ }
1090
+ }]]), A = "none", j = {
1091
+ OPTIONS: {
1092
+ tags: A,
1093
+ tagSide: "right",
1094
+ tagIndent: "0.8em",
1095
+ useLabelIds: !0,
1096
+ ignoreDuplicateLabels: !1,
1097
+ tagAlign: "baseline"
1098
+ },
1099
+ add(e, t) {
1100
+ k.set(e, t);
1101
+ },
1102
+ addTags(e) {
1103
+ for (let t of Object.keys(e)) j.add(t, e[t]);
1104
+ },
1105
+ create(e) {
1106
+ let t = k.get(e) || k.get(A);
1107
+ if (!t) throw Error("Unknown tags class");
1108
+ return new t();
1109
+ },
1110
+ setDefault(e) {
1111
+ A = e;
1112
+ },
1113
+ getDefault() {
1114
+ return j.create(A);
1115
+ }
1116
+ }, M = class {
1117
+ constructor(e, t, n) {
1118
+ this._token = e, this._char = t, this._attributes = n;
1119
+ }
1120
+ get token() {
1121
+ return this._token;
1122
+ }
1123
+ get char() {
1124
+ return this._char;
1125
+ }
1126
+ get attributes() {
1127
+ return this._attributes;
1128
+ }
1129
+ }, N = class {
1130
+ constructor(e, t, n = []) {
1131
+ this._token = e, this._func = t, this._args = n;
1132
+ }
1133
+ get token() {
1134
+ return this._token;
1135
+ }
1136
+ get func() {
1137
+ return this._func;
1138
+ }
1139
+ get args() {
1140
+ return this._args;
1141
+ }
1142
+ };
1143
+ //#endregion
1144
+ //#region node_modules/@mathjax/src/mjs/input/tex/TokenMap.js
1145
+ function P(e) {
1146
+ return e === void 0 ? !0 : e;
1147
+ }
1148
+ var F = class {
1149
+ constructor(e, t) {
1150
+ this._name = e, this._parser = t, B.register(this);
1151
+ }
1152
+ get name() {
1153
+ return this._name;
1154
+ }
1155
+ parserFor(e) {
1156
+ return this.contains(e) ? this.parser : null;
1157
+ }
1158
+ parse([e, t]) {
1159
+ let n = this.parserFor(t), r = this.lookup(t);
1160
+ return n && r ? P(n(e, r)) : null;
1161
+ }
1162
+ set parser(e) {
1163
+ this._parser = e;
1164
+ }
1165
+ get parser() {
1166
+ return this._parser;
1167
+ }
1168
+ }, oe = class extends F {
1169
+ constructor(e, t, n) {
1170
+ super(e, t), this._regExp = n;
1171
+ }
1172
+ contains(e) {
1173
+ return this._regExp.test(e);
1174
+ }
1175
+ lookup(e) {
1176
+ return this.contains(e) ? e : null;
1177
+ }
1178
+ }, I = class extends F {
1179
+ constructor() {
1180
+ super(...arguments), this.map = /* @__PURE__ */ new Map();
1181
+ }
1182
+ lookup(e) {
1183
+ return this.map.get(e);
1184
+ }
1185
+ contains(e) {
1186
+ return this.map.has(e);
1187
+ }
1188
+ add(e, t) {
1189
+ this.map.set(e, t);
1190
+ }
1191
+ remove(e) {
1192
+ this.map.delete(e);
1193
+ }
1194
+ }, L = class extends I {
1195
+ constructor(e, t, n) {
1196
+ super(e, t);
1197
+ for (let e of Object.keys(n)) {
1198
+ let t = n[e], [r, i] = typeof t == "string" ? [t, null] : t, a = new M(e, r, i);
1199
+ this.add(e, a);
1200
+ }
1201
+ }
1202
+ }, se = class extends L {
1203
+ parse([e, t]) {
1204
+ return super.parse([e, "\\" + t]);
1205
+ }
1206
+ }, R = class extends I {
1207
+ constructor(e, t, n = {}) {
1208
+ super(e, null);
1209
+ let r = (e) => typeof e == "string" ? n[e] : e;
1210
+ for (let [e, n] of Object.entries(t)) {
1211
+ let t, i;
1212
+ Array.isArray(n) ? (t = r(n[0]), i = n.slice(1)) : (t = r(n), i = []);
1213
+ let a = new N(e, t, i);
1214
+ this.add(e, a);
1215
+ }
1216
+ }
1217
+ parserFor(e) {
1218
+ let t = this.lookup(e);
1219
+ return t ? t.func : null;
1220
+ }
1221
+ parse([e, t]) {
1222
+ let n = this.lookup(t), r = this.parserFor(t);
1223
+ return !n || !r ? null : P(r(e, n.token, ...n.args));
1224
+ }
1225
+ }, ce = class extends R {
1226
+ parse([e, t]) {
1227
+ let n = this.lookup(t), r = this.parserFor(t);
1228
+ if (!n || !r) return null;
1229
+ let i = e.currentCS;
1230
+ e.currentCS = "\\" + t;
1231
+ let a = r(e, "\\" + n.token, ...n.args);
1232
+ return e.currentCS = i, P(a);
1233
+ }
1234
+ }, le = class extends R {
1235
+ constructor(e, t, n, r = {}) {
1236
+ super(e, n, r), this.parser = t;
1237
+ }
1238
+ parse([e, t]) {
1239
+ let n = this.lookup(t), r = this.parserFor(t);
1240
+ return !n || !r ? null : P(this.parser(e, n.token, r, n.args));
1241
+ }
1242
+ }, z = /* @__PURE__ */ new Map(), B = {
1243
+ register(e) {
1244
+ z.set(e.name, e);
1245
+ },
1246
+ getMap(e) {
1247
+ return z.get(e);
1248
+ }
1249
+ }, V = class e {
1250
+ constructor() {
1251
+ this._configuration = new r(), this._fallback = new d();
1252
+ }
1253
+ add(e, t, n = r.DEFAULTPRIORITY) {
1254
+ for (let t of e.slice().reverse()) {
1255
+ let e = B.getMap(t);
1256
+ if (!e) {
1257
+ this.warn(`Configuration '${t}' not found! Omitted.`);
1258
+ return;
1259
+ }
1260
+ this._configuration.add(e, n);
1261
+ }
1262
+ t && this._fallback.add(t, n);
1263
+ }
1264
+ remove(e, t = null) {
1265
+ for (let t of e) {
1266
+ let e = this.retrieve(t);
1267
+ e && this._configuration.remove(e);
1268
+ }
1269
+ t && this._fallback.remove(t);
1270
+ }
1271
+ parse(t) {
1272
+ for (let { item: n } of this._configuration) {
1273
+ let r = n.parse(t);
1274
+ if (r === e.FALLBACK) break;
1275
+ if (r) return r;
1276
+ }
1277
+ let [n, r] = t;
1278
+ Array.from(this._fallback)[0].item(n, r);
1279
+ }
1280
+ lookup(e) {
1281
+ let t = this.applicable(e);
1282
+ return t ? t.lookup(e) : null;
1283
+ }
1284
+ contains(e) {
1285
+ let t = this.applicable(e);
1286
+ return !!t && !(t instanceof L && t.lookup(e).char === null);
1287
+ }
1288
+ toString() {
1289
+ let e = [];
1290
+ for (let { item: t } of this._configuration) e.push(t.name);
1291
+ return e.join(", ");
1292
+ }
1293
+ applicable(e) {
1294
+ for (let { item: t } of this._configuration) if (t.contains(e)) return t;
1295
+ return null;
1296
+ }
1297
+ retrieve(e) {
1298
+ for (let { item: t } of this._configuration) if (t.name === e) return t;
1299
+ return null;
1300
+ }
1301
+ warn(e) {
1302
+ console.log("TexParser Warning: " + e);
1303
+ }
1304
+ };
1305
+ V.FALLBACK = Symbol("fallback");
1306
+ var ue = class {
1307
+ constructor() {
1308
+ this.map = /* @__PURE__ */ new Map();
1309
+ }
1310
+ add(e, t, n = r.DEFAULTPRIORITY) {
1311
+ for (let r of Object.keys(e)) {
1312
+ let i = r, a = this.get(i);
1313
+ a || (a = new V(), this.set(i, a)), a.add(e[i], t[i], n);
1314
+ }
1315
+ }
1316
+ remove(e, t) {
1317
+ for (let n of Object.keys(e)) {
1318
+ let r = this.get(n);
1319
+ r && r.remove(e[n], t[n]);
1320
+ }
1321
+ }
1322
+ set(e, t) {
1323
+ this.map.set(e, t);
1324
+ }
1325
+ get(e) {
1326
+ return this.map.get(e);
1327
+ }
1328
+ retrieve(e) {
1329
+ for (let t of this.map.values()) {
1330
+ let n = t.retrieve(e);
1331
+ if (n) return n;
1332
+ }
1333
+ return null;
1334
+ }
1335
+ keys() {
1336
+ return this.map.keys();
1337
+ }
1338
+ }, de = class e {
1339
+ static makeProcessor(e, t) {
1340
+ return Array.isArray(e) ? e : [e, t];
1341
+ }
1342
+ static _create(t, n = {}) {
1343
+ let i = n.priority ?? r.DEFAULTPRIORITY, a = n.init ? this.makeProcessor(n.init, i) : null, o = n.config ? this.makeProcessor(n.config, i) : null, s = (n.preprocessors || []).map((e) => this.makeProcessor(e, i)), c = (n.postprocessors || []).map((e) => this.makeProcessor(e, i)), l = n.parser || "tex";
1344
+ return new e(t, n[h.HANDLER] || {}, n[h.FALLBACK] || {}, n[h.ITEMS] || {}, n[h.TAGS] || {}, n[h.OPTIONS] || {}, n[h.NODES] || {}, s, c, a, o, i, l);
1345
+ }
1346
+ static create(t, n = {}) {
1347
+ let r = e._create(t, n);
1348
+ return U.set(t, r), r;
1349
+ }
1350
+ static local(t = {}) {
1351
+ return e._create("", t);
1352
+ }
1353
+ constructor(e, t = {}, n = {}, r = {}, i = {}, a = {}, o = {}, s = [], c = [], l = null, u = null, d, f) {
1354
+ this.name = e, this.handler = t, this.fallback = n, this.items = r, this.tags = i, this.options = a, this.nodes = o, this.preprocessors = s, this.postprocessors = c, this.initMethod = l, this.configMethod = u, this.priority = d, this.parser = f, this.handler = Object.assign({
1355
+ [g.CHARACTER]: [],
1356
+ [g.DELIMITER]: [],
1357
+ [g.MACRO]: [],
1358
+ [g.ENVIRONMENT]: []
1359
+ }, t);
1360
+ }
1361
+ get init() {
1362
+ return this.initMethod ? this.initMethod[0] : null;
1363
+ }
1364
+ get config() {
1365
+ return this.configMethod ? this.configMethod[0] : null;
1366
+ }
1367
+ }, H = /* @__PURE__ */ new Map(), U = {
1368
+ set(e, t) {
1369
+ H.set(e, t);
1370
+ },
1371
+ get(e) {
1372
+ return H.get(e);
1373
+ },
1374
+ keys() {
1375
+ return H.keys();
1376
+ }
1377
+ }, fe = class {
1378
+ constructor(e, t = ["tex"]) {
1379
+ this.initMethod = new d(), this.configMethod = new d(), this.configurations = new r(), this.parsers = [], this.handlers = new ue(), this.items = {}, this.tags = {}, this.options = {}, this.nodes = {}, this.parsers = t;
1380
+ for (let t of e.slice().reverse()) this.addPackage(t);
1381
+ for (let { item: e, priority: t } of this.configurations) this.append(e, t);
1382
+ }
1383
+ init() {
1384
+ this.initMethod.execute(this);
1385
+ }
1386
+ config(e) {
1387
+ this.configMethod.execute(this, e);
1388
+ for (let t of this.configurations) this.addFilters(e, t.item);
1389
+ }
1390
+ addPackage(e) {
1391
+ let t = typeof e == "string" ? e : e[0], n = this.getPackage(t);
1392
+ n && this.configurations.add(n, typeof e == "string" ? n.priority : e[1]);
1393
+ }
1394
+ add(t, r, i = {}) {
1395
+ let a = this.getPackage(t);
1396
+ this.append(a), this.configurations.add(a, a.priority), this.init();
1397
+ let o = r.parseOptions;
1398
+ o.nodeFactory.setCreators(a.nodes);
1399
+ for (let e of Object.keys(a.items)) o.itemFactory.setNodeClass(e, a.items[e]);
1400
+ j.addTags(a.tags), n(o.options, a.options), e(o.options, i), this.addFilters(r, a), a.config && a.config(this, r);
1401
+ }
1402
+ getPackage(e) {
1403
+ let t = U.get(e);
1404
+ if (t && !this.parsers.includes(t.parser)) throw Error(`Package '${e}' doesn't target the proper parser`);
1405
+ return t || this.warn(`Package '${e}' not found. Omitted.`), t;
1406
+ }
1407
+ append(e, t) {
1408
+ t ||= e.priority, e.initMethod && this.initMethod.add(e.initMethod[0], e.initMethod[1]), e.configMethod && this.configMethod.add(e.configMethod[0], e.configMethod[1]), this.handlers.add(e.handler, e.fallback, t), Object.assign(this.items, e.items), Object.assign(this.tags, e.tags), n(this.options, e.options), Object.assign(this.nodes, e.nodes);
1409
+ }
1410
+ addFilters(e, t) {
1411
+ for (let [n, r] of t.preprocessors) e.preFilters.add(n, r);
1412
+ for (let [n, r] of t.postprocessors) e.postFilters.add(n, r);
1413
+ }
1414
+ warn(e) {
1415
+ console.warn("MathJax Warning: " + e);
1416
+ }
1417
+ }, pe = class extends b {
1418
+ constructor(e, t) {
1419
+ super(e), this.global = t;
1420
+ }
1421
+ get kind() {
1422
+ return "start";
1423
+ }
1424
+ get isOpen() {
1425
+ return !0;
1426
+ }
1427
+ checkItem(e) {
1428
+ if (e.isKind("stop")) {
1429
+ let e = this.toMml();
1430
+ return this.global.isInner || (e = this.factory.configuration.tags.finalize(e, this.env)), [[this.factory.create("mml", e)], !0];
1431
+ }
1432
+ return super.checkItem(e);
1433
+ }
1434
+ }, me = class extends b {
1435
+ get kind() {
1436
+ return "stop";
1437
+ }
1438
+ get isClose() {
1439
+ return !0;
1440
+ }
1441
+ }, W = class extends b {
1442
+ get kind() {
1443
+ return "open";
1444
+ }
1445
+ get isOpen() {
1446
+ return !0;
1447
+ }
1448
+ checkItem(e) {
1449
+ if (e.isKind("close")) {
1450
+ let t = this.toMml(), n = this.create("node", "TeXAtom", [t]);
1451
+ return e.addLatexItem(n), [[this.factory.create("mml", n)], !0];
1452
+ }
1453
+ return super.checkItem(e);
1454
+ }
1455
+ };
1456
+ W.errors = Object.assign(Object.create(b.errors), { stop: ["ExtraOpenMissingClose", "Extra open brace or missing close brace"] });
1457
+ var he = class extends b {
1458
+ get kind() {
1459
+ return "close";
1460
+ }
1461
+ get isClose() {
1462
+ return !0;
1463
+ }
1464
+ }, ge = class extends b {
1465
+ get kind() {
1466
+ return "null";
1467
+ }
1468
+ }, _e = class extends b {
1469
+ get kind() {
1470
+ return "prime";
1471
+ }
1472
+ checkItem(e) {
1473
+ let [t, n] = this.Peek(2), r = (p.isType(t, "msubsup") || p.isType(t, "msup")) && !p.getChildAt(t, t.sup), i = (p.isType(t, "munderover") || p.isType(t, "mover")) && !p.getChildAt(t, t.over) && !p.getProperty(t, "subsupOK");
1474
+ if (!r && !i) return [[this.create("node", t.getProperty("movesupsub") ? "mover" : "msup", [t, n]), e], !0];
1475
+ let a = r ? t.sup : t.over;
1476
+ return p.setChild(t, a, n), [[t, e], !0];
1477
+ }
1478
+ }, G = class extends b {
1479
+ get kind() {
1480
+ return "subsup";
1481
+ }
1482
+ checkItem(e) {
1483
+ if (e.isKind("open") || e.isKind("left")) return b.success;
1484
+ let t = this.First, n = this.getProperty("position");
1485
+ if (e.isKind("mml")) return this.getProperty("primes") && (n === 2 ? (p.setProperty(this.getProperty("primes"), "variantForm", !0), e.First = this.create("node", "mrow", [this.getProperty("primes"), e.First])) : p.setChild(t, 2, this.getProperty("primes"))), p.setChild(t, n, e.First), this.getProperty("movesupsub") != null && p.setProperty(t, "movesupsub", this.getProperty("movesupsub")), [[this.factory.create("mml", t)], !0];
1486
+ super.checkItem(e);
1487
+ let r = this.getErrors([
1488
+ "",
1489
+ "sub",
1490
+ "sup"
1491
+ ][n]);
1492
+ throw new y(r[0], r[1], ...r.splice(2));
1493
+ }
1494
+ };
1495
+ G.errors = Object.assign(Object.create(b.errors), {
1496
+ stop: ["MissingScript", "Missing superscript or subscript argument"],
1497
+ sup: ["MissingOpenForSup", "Missing open brace for superscript"],
1498
+ sub: ["MissingOpenForSub", "Missing open brace for subscript"]
1499
+ });
1500
+ var ve = class extends b {
1501
+ constructor(e) {
1502
+ super(e), this.setProperty("name", "\\over");
1503
+ }
1504
+ get kind() {
1505
+ return "over";
1506
+ }
1507
+ get isClose() {
1508
+ return !0;
1509
+ }
1510
+ checkItem(e) {
1511
+ if (e.isKind("over")) throw new y("AmbiguousUseOf", "Ambiguous use of %1", e.getName());
1512
+ if (e.isClose) {
1513
+ let t = this.create("node", "mfrac", [this.getProperty("num"), this.toMml(!1)]);
1514
+ return this.getProperty("thickness") != null && p.setAttribute(t, "linethickness", this.getProperty("thickness")), (this.getProperty("ldelim") || this.getProperty("rdelim")) && (p.setProperty(t, "withDelims", !0), t = T.fixedFence(this.factory.configuration, this.getProperty("ldelim"), t, this.getProperty("rdelim"))), t.attributes.set(m.Attr.LATEXITEM, this.getProperty("name")), [[this.factory.create("mml", t), e], !0];
1515
+ }
1516
+ return super.checkItem(e);
1517
+ }
1518
+ toString() {
1519
+ return "over[" + this.getProperty("num") + " / " + this.nodes.join("; ") + "]";
1520
+ }
1521
+ }, K = class extends b {
1522
+ constructor(e, t) {
1523
+ super(e), this.setProperty("delim", t);
1524
+ }
1525
+ get kind() {
1526
+ return "left";
1527
+ }
1528
+ get isOpen() {
1529
+ return !0;
1530
+ }
1531
+ checkItem(e) {
1532
+ if (e.isKind("right")) {
1533
+ let t = T.fenced(this.factory.configuration, this.getProperty("delim"), this.toMml(), e.getProperty("delim"), "", e.getProperty("color")), n = t.childNodes[0], r = t.childNodes[t.childNodes.length - 1], i = this.factory.create("mml", t);
1534
+ return this.addLatexItem(n, "\\left"), e.addLatexItem(r, "\\right"), i.Peek()[0].attributes.set(m.Attr.LATEXITEM, "\\left" + e.startStr.slice(this.startI, e.stopI)), [[i], !0];
1535
+ }
1536
+ if (e.isKind("middle")) {
1537
+ let t = { stretchy: !0 };
1538
+ e.getProperty("color") && (t.mathcolor = e.getProperty("color"));
1539
+ let n = this.create("token", "mo", t, e.getProperty("delim"));
1540
+ return e.addLatexItem(n, "\\middle"), this.Push(this.create("node", "TeXAtom", [], { texClass: s.CLOSE }), n, this.create("node", "TeXAtom", [], { texClass: s.OPEN })), this.env = {}, [[this], !0];
1541
+ }
1542
+ return super.checkItem(e);
1543
+ }
1544
+ };
1545
+ K.errors = Object.assign(Object.create(b.errors), { stop: ["ExtraLeftMissingRight", "Extra \\left or missing \\right"] });
1546
+ var ye = class extends b {
1547
+ constructor(e, t, n) {
1548
+ super(e), this.setProperty("delim", t), n && this.setProperty("color", n);
1549
+ }
1550
+ get kind() {
1551
+ return "middle";
1552
+ }
1553
+ get isClose() {
1554
+ return !0;
1555
+ }
1556
+ }, be = class extends b {
1557
+ constructor(e, t, n) {
1558
+ super(e), this.setProperty("delim", t), n && this.setProperty("color", n);
1559
+ }
1560
+ get kind() {
1561
+ return "right";
1562
+ }
1563
+ get isClose() {
1564
+ return !0;
1565
+ }
1566
+ }, xe = class extends b {
1567
+ get kind() {
1568
+ return "break";
1569
+ }
1570
+ constructor(e, t, n) {
1571
+ super(e), this.setProperty("linebreak", t), this.setProperty("insert", n);
1572
+ }
1573
+ checkItem(e) {
1574
+ let t = this.getProperty("linebreak");
1575
+ if (e.isKind("mml")) {
1576
+ let n = e.First;
1577
+ if (n.isKind("mo")) {
1578
+ if ((p.getOp(n)?.[3]?.linebreakstyle || p.getAttribute(n, "linebreakstyle")) !== "after") return p.setAttribute(n, "linebreak", t), [[e], !0];
1579
+ if (!this.getProperty("insert")) return [[e], !0];
1580
+ }
1581
+ }
1582
+ let n = this.create("token", "mspace", { linebreak: t });
1583
+ return [[this.factory.create("mml", n), e], !0];
1584
+ }
1585
+ }, q = class extends b {
1586
+ get kind() {
1587
+ return "begin";
1588
+ }
1589
+ get isOpen() {
1590
+ return !0;
1591
+ }
1592
+ checkItem(e) {
1593
+ if (e.isKind("end")) {
1594
+ if (e.getName() !== this.getName()) throw new y("EnvBadEnd", "\\begin{%1} ended with \\end{%2}", this.getName(), e.getName());
1595
+ let t = this.toMml();
1596
+ return e.addLatexItem(t), [[this.factory.create("mml", t)], !0];
1597
+ }
1598
+ if (e.isKind("stop")) throw new y("EnvMissingEnd", "Missing \\end{%1}", this.getName());
1599
+ return super.checkItem(e);
1600
+ }
1601
+ }, Se = class extends b {
1602
+ get kind() {
1603
+ return "end";
1604
+ }
1605
+ get isClose() {
1606
+ return !0;
1607
+ }
1608
+ }, Ce = class extends b {
1609
+ get kind() {
1610
+ return "style";
1611
+ }
1612
+ checkItem(e) {
1613
+ if (!e.isClose) return super.checkItem(e);
1614
+ let t = this.create("node", "mstyle", this.nodes, this.getProperty("styles"));
1615
+ return [[this.factory.create("mml", t), e], !0];
1616
+ }
1617
+ }, we = class extends b {
1618
+ get kind() {
1619
+ return "position";
1620
+ }
1621
+ checkItem(e) {
1622
+ if (e.isClose) throw new y("MissingBoxFor", "Missing box for %1", this.getName());
1623
+ if (e.isFinal) {
1624
+ let t = e.toMml();
1625
+ switch (this.getProperty("move")) {
1626
+ case "vertical": return t = this.create("node", "mpadded", [t], {
1627
+ height: this.getProperty("dh"),
1628
+ depth: this.getProperty("dd"),
1629
+ voffset: this.getProperty("dh")
1630
+ }), [[this.factory.create("mml", t)], !0];
1631
+ case "horizontal": return [[
1632
+ this.factory.create("mml", this.getProperty("left")),
1633
+ e,
1634
+ this.factory.create("mml", this.getProperty("right"))
1635
+ ], !0];
1636
+ }
1637
+ }
1638
+ return super.checkItem(e);
1639
+ }
1640
+ }, Te = class extends b {
1641
+ get kind() {
1642
+ return "cell";
1643
+ }
1644
+ get isClose() {
1645
+ return !0;
1646
+ }
1647
+ }, Ee = class extends b {
1648
+ get isFinal() {
1649
+ return !0;
1650
+ }
1651
+ get kind() {
1652
+ return "mml";
1653
+ }
1654
+ }, De = class extends b {
1655
+ get kind() {
1656
+ return "fn";
1657
+ }
1658
+ checkItem(e) {
1659
+ let t = this.First;
1660
+ if (t) {
1661
+ if (e.isOpen) return b.success;
1662
+ if (!e.isKind("fn")) {
1663
+ let n = e.First;
1664
+ if (!e.isKind("mml") || !n || p.isType(n, "mstyle") && n.childNodes.length && p.isType(n.childNodes[0].childNodes[0], "mspace") || p.isType(n, "mspace")) return [[t, e], !0];
1665
+ p.isEmbellished(n) && (n = p.getCoreMO(n));
1666
+ let r = p.getForm(n);
1667
+ if (r != null && [
1668
+ 0,
1669
+ 0,
1670
+ 1,
1671
+ 1,
1672
+ 0,
1673
+ 1,
1674
+ 1,
1675
+ 0,
1676
+ 0,
1677
+ 0
1678
+ ][r[2]]) return [[t, e], !0];
1679
+ }
1680
+ return t.isKind("TeXAtom") && t.isEmpty ? [[t, e], !0] : [[
1681
+ t,
1682
+ this.create("token", "mo", { texClass: s.NONE }, a.ApplyFunction),
1683
+ e
1684
+ ], !0];
1685
+ }
1686
+ return super.checkItem(e);
1687
+ }
1688
+ }, Oe = class extends b {
1689
+ constructor() {
1690
+ super(...arguments), this.remap = B.getMap("not_remap");
1691
+ }
1692
+ get kind() {
1693
+ return "not";
1694
+ }
1695
+ checkItem(e) {
1696
+ let t, n, r;
1697
+ if (e.isKind("open") || e.isKind("left")) return b.success;
1698
+ if (e.isKind("mml") && (p.isType(e.First, "mo") || p.isType(e.First, "mi") || p.isType(e.First, "mtext")) && (t = e.First, n = p.getText(t), n.length === 1 && !p.getProperty(t, "movesupsub") && p.getChildren(t).length === 1)) return this.remap.contains(n) ? (r = this.create("text", this.remap.lookup(n).char), p.setChild(t, 0, r)) : (r = this.create("text", "̸"), p.appendChildren(t, [r])), [[e], !0];
1699
+ r = this.create("text", "⧸");
1700
+ let i = this.create("node", "mtext", [], {}, r), a = this.create("node", "mpadded", [i], { width: 0 });
1701
+ return t = this.create("node", "TeXAtom", [a], { texClass: s.REL }), [[t, e], !0];
1702
+ }
1703
+ }, ke = class extends b {
1704
+ get kind() {
1705
+ return "nonscript";
1706
+ }
1707
+ checkItem(e) {
1708
+ if (e.isKind("mml") && e.Size() === 1) {
1709
+ let t = e.First;
1710
+ if (t.isKind("mstyle") && t.notParent && (t = p.getChildren(p.getChildren(t)[0])[0]), t.isKind("mspace")) {
1711
+ if (t !== e.First) {
1712
+ let t = this.create("node", "mrow", [e.Pop()]);
1713
+ e.Push(t);
1714
+ }
1715
+ this.factory.configuration.addNode("nonscript", e.First);
1716
+ }
1717
+ }
1718
+ return [[e], !0];
1719
+ }
1720
+ }, Ae = class extends b {
1721
+ get kind() {
1722
+ return "dots";
1723
+ }
1724
+ checkItem(e) {
1725
+ if (e.isKind("open") || e.isKind("left")) return b.success;
1726
+ let t = this.getProperty("ldots"), n = e.First;
1727
+ if (e.isKind("mml") && p.isEmbellished(n)) {
1728
+ let e = p.getTexClass(p.getCoreMO(n));
1729
+ (e === s.BIN || e === s.REL) && (t = this.getProperty("cdots"));
1730
+ }
1731
+ return [[t, e], !0];
1732
+ }
1733
+ }, J = class extends b {
1734
+ constructor() {
1735
+ super(...arguments), this.table = [], this.row = [], this.frame = [], this.hfill = [], this.arraydef = {}, this.cstart = [], this.cend = [], this.cextra = [], this.atEnd = !1, this.ralign = [], this.breakAlign = {
1736
+ cell: "",
1737
+ row: "",
1738
+ table: ""
1739
+ }, this.templateSubs = 0;
1740
+ }
1741
+ get kind() {
1742
+ return "array";
1743
+ }
1744
+ get isOpen() {
1745
+ return !0;
1746
+ }
1747
+ get copyEnv() {
1748
+ return !1;
1749
+ }
1750
+ checkItem(e) {
1751
+ if (e.isClose && !e.isKind("over")) {
1752
+ if (e.getProperty("isEntry")) return this.EndEntry(), this.clearEnv(), this.StartEntry(), b.fail;
1753
+ if (e.getProperty("isCR")) return this.EndEntry(), this.EndRow(), this.clearEnv(), this.StartEntry(), b.fail;
1754
+ this.EndTable(), this.clearEnv();
1755
+ let t = this.factory.create("mml", this.createMml());
1756
+ if (this.getProperty("requireClose")) {
1757
+ if (e.isKind("close")) return [[t], !0];
1758
+ throw new y("MissingCloseBrace", "Missing close brace");
1759
+ }
1760
+ return [[t, e], !0];
1761
+ }
1762
+ return super.checkItem(e);
1763
+ }
1764
+ createMml() {
1765
+ let e = this.arraydef.scriptlevel;
1766
+ delete this.arraydef.scriptlevel;
1767
+ let t = this.create("node", "mtable", this.table, this.arraydef);
1768
+ return e && t.setProperty("smallmatrix", !0), this.breakAlign.table && p.setAttribute(t, "data-break-align", this.breakAlign.table), this.getProperty("arrayPadding") && (p.setAttribute(t, "data-frame-styles", ""), p.setAttribute(t, "framespacing", this.getProperty("arrayPadding"))), t = this.handleFrame(t), e !== void 0 && (t = this.create("node", "mstyle", [t], { scriptlevel: e })), (this.getProperty("open") || this.getProperty("close")) && (t = T.fenced(this.factory.configuration, this.getProperty("open"), t, this.getProperty("close"))), t;
1769
+ }
1770
+ handleFrame(e) {
1771
+ if (!this.frame.length) return e;
1772
+ let t = new Map(this.frame), n = this.frame.reduce((e, [, t]) => t === e ? t : "", this.frame[0][1]);
1773
+ if (n) {
1774
+ if (this.frame.length === 4) return p.setAttribute(e, "frame", n), p.removeAttribute(e, "data-frame-styles"), e;
1775
+ if (n === "solid") return p.setAttribute(e, "data-frame-styles", ""), e = this.create("node", "menclose", [e], {
1776
+ notation: Array.from(t.keys()).join(" "),
1777
+ "data-padding": 0
1778
+ }), e;
1779
+ }
1780
+ let r = i.map((e) => t.get(e) || "none").join(" ");
1781
+ return p.setAttribute(e, "data-frame-styles", r), e;
1782
+ }
1783
+ StartEntry() {
1784
+ let e = this.row.length, t = this.cstart[e], n = this.cend[e], r = this.ralign[e], i = this.cextra;
1785
+ if (!t && !n && !r && !i[e] && !i[e + 1]) return;
1786
+ let [a, o, s, c] = this.getEntry();
1787
+ if (i[e] && (!this.atEnd || i[e + 1]) && (t += "&"), s !== "&" && (c = !!o.trim() || !!(e || s && s.substring(0, 4) !== "\\end"), i[e + 1] && !i[e] && (n = (n || "") + "&", this.atEnd = !0)), !c && !a) return;
1788
+ let l = this.parser;
1789
+ if (c && (t && (o = T.addArgs(l, t, o)), n && (o = T.addArgs(l, o, n)), r && (o = "\\text{" + o.trim() + "}"), (t || n || r) && ++this.templateSubs > l.configuration.options.maxTemplateSubtitutions)) throw new y("MaxTemplateSubs", "Maximum template substitutions exceeded; is there an invalid use of \\\\ in the template?");
1790
+ a && (o = T.addArgs(l, a, o)), l.string = T.addArgs(l, o, l.string), l.i = 0;
1791
+ }
1792
+ getEntry() {
1793
+ let e = this.parser, t = /^([^]*?)([&{}]|\\\\|\\(?:begin|end)\s*\{array\}|\\cr|\\)/, n = 0, r = 0, i = e.i, a, o = [
1794
+ "",
1795
+ "",
1796
+ "",
1797
+ !1
1798
+ ];
1799
+ for (; (a = e.string.slice(i).match(t)) !== null;) switch (i += a[0].length, a[2]) {
1800
+ case "\\":
1801
+ i++;
1802
+ break;
1803
+ case "{":
1804
+ n++;
1805
+ break;
1806
+ case "}":
1807
+ if (!n) return o;
1808
+ n--;
1809
+ break;
1810
+ case "\\begin{array}":
1811
+ n || r++;
1812
+ break;
1813
+ case "\\end{array}": if (!n && r) {
1814
+ r--;
1815
+ break;
1816
+ }
1817
+ default: {
1818
+ if (n || r) continue;
1819
+ i -= a[2].length;
1820
+ let t = e.string.slice(e.i, i).trim(), o = t.match(/^(?:\s*\\(?:h(?:dash)?line|hfil{1,3}|rowcolor\s*\{.*?\}))+/);
1821
+ return o && (t = t.slice(o[0].length)), e.string = e.string.slice(i), e.i = 0, [
1822
+ o?.[0] || "",
1823
+ t,
1824
+ a[2],
1825
+ !0
1826
+ ];
1827
+ }
1828
+ }
1829
+ return o;
1830
+ }
1831
+ EndEntry() {
1832
+ let e = this.create("node", "mtd", this.nodes);
1833
+ this.hfill.length && (this.hfill[0] === 0 && p.setAttribute(e, "columnalign", "right"), this.hfill[this.hfill.length - 1] === this.Size() && p.setAttribute(e, "columnalign", p.getAttribute(e, "columnalign") ? "center" : "left"));
1834
+ let t = this.ralign[this.row.length];
1835
+ if (t) {
1836
+ let [n, r, i] = t, a = this.create("node", "mpadded", e.childNodes[0].childNodes, {
1837
+ width: r,
1838
+ "data-overflow": "auto",
1839
+ "data-align": i,
1840
+ "data-vertical-align": n
1841
+ });
1842
+ a.setProperty("vbox", n), e.childNodes[0].childNodes = [], e.appendChild(a);
1843
+ } else this.breakAlign.cell && p.setAttribute(e, "data-vertical-align", this.breakAlign.cell);
1844
+ this.breakAlign.cell = "", this.row.push(e), this.Clear(), this.hfill = [];
1845
+ }
1846
+ EndRow() {
1847
+ let e = "mtr";
1848
+ this.getProperty("isNumbered") && this.row.length === 3 ? (this.row.unshift(this.row.pop()), e = "mlabeledtr") : this.getProperty("isLabeled") && (e = "mlabeledtr", this.setProperty("isLabeled", !1));
1849
+ let t = this.create("node", e, this.row);
1850
+ this.breakAlign.row && (p.setAttribute(t, "data-break-align", this.breakAlign.row), this.breakAlign.row = ""), this.addLatexItem(t), this.table.push(t), this.row = [], this.atEnd = !1;
1851
+ }
1852
+ EndTable() {
1853
+ (this.Size() || this.row.length) && (this.EndEntry(), this.EndRow()), this.checkLines();
1854
+ }
1855
+ checkLines() {
1856
+ if (this.arraydef.rowlines) {
1857
+ let e = this.arraydef.rowlines.split(/ /);
1858
+ e.length === this.table.length ? (this.frame.push(["bottom", e.pop()]), e.length ? this.arraydef.rowlines = e.join(" ") : delete this.arraydef.rowlines) : e.length < this.table.length - 1 && (this.arraydef.rowlines += " none");
1859
+ }
1860
+ if (this.getProperty("rowspacing")) {
1861
+ let e = this.arraydef.rowspacing.split(/ /);
1862
+ for (; e.length < this.table.length;) e.push(this.getProperty("rowspacing") + "em");
1863
+ this.arraydef.rowspacing = e.join(" ");
1864
+ }
1865
+ }
1866
+ addRowSpacing(e) {
1867
+ if (this.arraydef.rowspacing) {
1868
+ let t = this.arraydef.rowspacing.split(/ /);
1869
+ if (!this.getProperty("rowspacing")) {
1870
+ let e = v.dimen2em(t[0]);
1871
+ this.setProperty("rowspacing", e);
1872
+ }
1873
+ let n = this.getProperty("rowspacing");
1874
+ for (; t.length < this.table.length;) t.push(v.em(n));
1875
+ t[this.table.length - 1] = v.em(Math.max(0, n + v.dimen2em(e))), this.arraydef.rowspacing = t.join(" ");
1876
+ }
1877
+ }
1878
+ }, je = class extends J {
1879
+ constructor(e, ...t) {
1880
+ super(e), this.maxrow = 0, this.factory.configuration.tags.start(t[0], t[2], t[1]);
1881
+ }
1882
+ get kind() {
1883
+ return "eqnarray";
1884
+ }
1885
+ EndEntry() {
1886
+ let e = this.arraydef.columnalign.split(/ /);
1887
+ (this.row.length && e.length ? e[this.row.length % e.length] : "right") !== "right" && T.fixInitialMO(this.factory.configuration, this.nodes), super.EndEntry();
1888
+ }
1889
+ EndRow() {
1890
+ this.row.length > this.maxrow && (this.maxrow = this.row.length);
1891
+ let e = this.factory.configuration.tags.getTag();
1892
+ e && (this.row = [e].concat(this.row), this.setProperty("isLabeled", !0)), this.factory.configuration.tags.clearTag(), super.EndRow();
1893
+ }
1894
+ EndTable() {
1895
+ super.EndTable(), this.factory.configuration.tags.end(), this.extendArray("columnalign", this.maxrow), this.extendArray("columnwidth", this.maxrow), this.extendArray("columnspacing", this.maxrow - 1), this.extendArray("data-break-align", this.maxrow), this.addIndentshift();
1896
+ }
1897
+ extendArray(e, t) {
1898
+ if (!this.arraydef[e]) return;
1899
+ let n = this.arraydef[e].split(/ /), r = [...n];
1900
+ if (r.length > 1) {
1901
+ for (; r.length < t;) r.push(...n);
1902
+ this.arraydef[e] = r.slice(0, t).join(" ");
1903
+ }
1904
+ }
1905
+ addIndentshift() {
1906
+ let e = this.arraydef.columnalign.split(/ /), t = "";
1907
+ for (let n of e.keys()) {
1908
+ if (e[n] === "left" && n > 0) {
1909
+ let e = t === "center" ? ".7em" : "2em";
1910
+ for (let t of this.table) {
1911
+ let r = t.childNodes[t.isKind("mlabeledtr") ? n + 1 : n];
1912
+ if (r) {
1913
+ let t = this.create("node", "mstyle", r.childNodes[0].childNodes, { indentshift: e });
1914
+ r.childNodes[0].childNodes = [], r.appendChild(t);
1915
+ }
1916
+ }
1917
+ }
1918
+ t = e[n];
1919
+ }
1920
+ }
1921
+ }, Y = class extends q {
1922
+ get kind() {
1923
+ return "mstyle";
1924
+ }
1925
+ constructor(e, t, n) {
1926
+ super(e), this.attrList = t, this.setProperty("name", n);
1927
+ }
1928
+ checkItem(e) {
1929
+ return e.isKind("end") && e.getName() === this.getName() ? [[this.create("node", "mstyle", [this.toMml()], this.attrList)], !0] : super.checkItem(e);
1930
+ }
1931
+ }, Me = class extends b {
1932
+ constructor(e, ...t) {
1933
+ super(e), this.factory.configuration.tags.start("equation", !0, t[0]);
1934
+ }
1935
+ get kind() {
1936
+ return "equation";
1937
+ }
1938
+ get isOpen() {
1939
+ return !0;
1940
+ }
1941
+ checkItem(e) {
1942
+ if (e.isKind("end")) {
1943
+ let t = this.toMml(), n = this.factory.configuration.tags.getTag();
1944
+ return this.factory.configuration.tags.end(), [[n ? this.factory.configuration.tags.enTag(t, n) : t, e], !0];
1945
+ }
1946
+ if (e.isKind("stop")) throw new y("EnvMissingEnd", "Missing \\end{%1}", this.getName());
1947
+ return super.checkItem(e);
1948
+ }
1949
+ }, Ne = 1.2 / .85, Pe = {
1950
+ fontfamily: 1,
1951
+ fontsize: 1,
1952
+ fontweight: 1,
1953
+ fontstyle: 1,
1954
+ color: 1,
1955
+ background: 1,
1956
+ id: 1,
1957
+ class: 1,
1958
+ href: 1,
1959
+ style: 1
1960
+ };
1961
+ function X(e, t = Infinity) {
1962
+ let n = e.replace(/\s+/g, "").split("").map((e) => {
1963
+ let t = {
1964
+ t: "top",
1965
+ b: "bottom",
1966
+ m: "middle",
1967
+ c: "center"
1968
+ }[e];
1969
+ if (!t) throw new y("BadBreakAlign", "Invalid alignment character: %1", e);
1970
+ return t;
1971
+ });
1972
+ if (n.length > t) throw new y("TooManyAligns", "Too many alignment characters: %1", e);
1973
+ return t === 1 ? n[0] : n.join(" ");
1974
+ }
1975
+ function Z(e, t) {
1976
+ let n = e.stack.env, r = n.inRoot;
1977
+ n.inRoot = !0;
1978
+ let i = new x(t, n, e.configuration), a = i.mml(), o = i.stack.global;
1979
+ if (o.leftRoot || o.upRoot) {
1980
+ let t = {};
1981
+ o.leftRoot && (t.width = o.leftRoot), o.upRoot && (t.voffset = o.upRoot, t.height = o.upRoot), a = e.create("node", "mpadded", [a], t);
1982
+ }
1983
+ return n.inRoot = r, a;
1984
+ }
1985
+ var Q = {
1986
+ Open(e, t) {
1987
+ e.Push(e.itemFactory.create("open"));
1988
+ },
1989
+ Close(e, t) {
1990
+ e.Push(e.itemFactory.create("close"));
1991
+ },
1992
+ Bar(e, t) {
1993
+ let n = e.create("token", "mo", {
1994
+ stretchy: !1,
1995
+ texClass: s.ORD
1996
+ }, t);
1997
+ n.setProperty("keep-attrs", "stretchy"), e.Push(n);
1998
+ },
1999
+ Tilde(e, t) {
2000
+ e.Push(e.create("token", "mtext", {}, a.nbsp));
2001
+ },
2002
+ Space(e, t) {},
2003
+ Superscript(e, t) {
2004
+ e.GetNext().match(/\d/) && (e.string = e.string.substring(0, e.i + 1) + " " + e.string.substring(e.i + 1));
2005
+ let n, r, i = e.stack.Top();
2006
+ i.isKind("prime") ? ([r, n] = i.Peek(2), e.stack.Pop()) : (r = e.stack.Prev(), r ||= e.create("token", "mi", {}, ""));
2007
+ let a = p.getProperty(r, "movesupsub"), o = p.isType(r, "msubsup") ? r.sup : r.over;
2008
+ if (p.isType(r, "msubsup") && !p.isType(r, "msup") && p.getChildAt(r, r.sup) || p.isType(r, "munderover") && !p.isType(r, "mover") && p.getChildAt(r, r.over) && !p.getProperty(r, "subsupOK")) throw new y("DoubleExponent", "Double exponent: use braces to clarify");
2009
+ (!p.isType(r, "msubsup") || p.isType(r, "msup")) && (a ? ((!p.isType(r, "munderover") || p.isType(r, "mover") || p.getChildAt(r, r.over)) && (r = e.create("node", "munderover", [r], { movesupsub: !0 })), o = r.over) : (r = e.create("node", "msubsup", [r]), o = r.sup)), e.Push(e.itemFactory.create("subsup", r).setProperties({
2010
+ position: o,
2011
+ primes: n,
2012
+ movesupsub: a
2013
+ }));
2014
+ },
2015
+ Subscript(e, t) {
2016
+ e.GetNext().match(/\d/) && (e.string = e.string.substring(0, e.i + 1) + " " + e.string.substring(e.i + 1));
2017
+ let n, r, i = e.stack.Top();
2018
+ i.isKind("prime") ? ([r, n] = i.Peek(2), e.stack.Pop()) : (r = e.stack.Prev(), r ||= e.create("token", "mi", {}, ""));
2019
+ let a = p.getProperty(r, "movesupsub"), o = p.isType(r, "msubsup") ? r.sub : r.under;
2020
+ if (p.isType(r, "msubsup") && !p.isType(r, "msup") && p.getChildAt(r, r.sub) || p.isType(r, "munderover") && !p.isType(r, "mover") && p.getChildAt(r, r.under) && !p.getProperty(r, "subsupOK")) throw new y("DoubleSubscripts", "Double subscripts: use braces to clarify");
2021
+ (!p.isType(r, "msubsup") || p.isType(r, "msup")) && (a ? ((!p.isType(r, "munderover") || p.isType(r, "mover") || p.getChildAt(r, r.under)) && (r = e.create("node", "munderover", [r], { movesupsub: !0 })), o = r.under) : (r = e.create("node", "msubsup", [r]), o = r.sub)), e.Push(e.itemFactory.create("subsup", r).setProperties({
2022
+ position: o,
2023
+ primes: n,
2024
+ movesupsub: a
2025
+ }));
2026
+ },
2027
+ Prime(e, t) {
2028
+ let n = e.stack.Prev();
2029
+ if (n ||= e.create("token", "mi"), p.isType(n, "msubsup") && !p.isType(n, "msup") && p.getChildAt(n, n.sup) || p.isType(n, "munderover") && !p.isType(n, "mover") && p.getChildAt(n, n.over) && !p.getProperty(n, "subsupOK")) throw new y("DoubleExponentPrime", "Prime causes double exponent: use braces to clarify");
2030
+ let r = "";
2031
+ e.i--;
2032
+ do
2033
+ r += a.prime, e.i++, t = e.GetNext();
2034
+ while (t === "'" || t === a.rsquo);
2035
+ r = [
2036
+ "",
2037
+ "′",
2038
+ "″",
2039
+ "‴",
2040
+ "⁗"
2041
+ ][r.length] || r;
2042
+ let i = e.create("token", "mo", { variantForm: !0 }, r);
2043
+ e.Push(e.itemFactory.create("prime", n, i));
2044
+ },
2045
+ Comment(e, t) {
2046
+ for (; e.i < e.string.length && e.string.charAt(e.i) !== "\n";) e.i++;
2047
+ },
2048
+ Hash(e, t) {
2049
+ throw new y("CantUseHash1", "You can't use 'macro parameter character #' in math mode");
2050
+ },
2051
+ MathFont(e, t, n, r = "") {
2052
+ let i = new x(e.GetArgument(t), Object.assign(Object.assign({ multiLetterIdentifiers: e.options.identifierPattern }, e.stack.env), {
2053
+ font: n,
2054
+ italicFont: r,
2055
+ noAutoOP: !0
2056
+ }), e.configuration).mml();
2057
+ e.Push(e.create("node", "TeXAtom", [i]));
2058
+ },
2059
+ SetFont(e, t, n) {
2060
+ e.stack.env.font = n, e.Push(e.itemFactory.create("null"));
2061
+ },
2062
+ SetStyle(e, t, n, r, i) {
2063
+ e.stack.env.style = n, e.stack.env.level = i, e.Push(e.itemFactory.create("style").setProperty("styles", {
2064
+ displaystyle: r,
2065
+ scriptlevel: i
2066
+ }));
2067
+ },
2068
+ SetSize(e, t, n) {
2069
+ e.stack.env.size = n, e.Push(e.itemFactory.create("style").setProperty("styles", { mathsize: f(n) }));
2070
+ },
2071
+ Spacer(e, t, n) {
2072
+ let r = e.create("node", "mspace", [], { width: f(n) }), i = e.create("node", "mstyle", [r], { scriptlevel: 0 });
2073
+ e.Push(i);
2074
+ },
2075
+ DiscretionaryTimes(e, t) {
2076
+ e.Push(e.create("token", "mo", { linebreakmultchar: "×" }, "⁢"));
2077
+ },
2078
+ AllowBreak(e, t) {
2079
+ e.Push(e.create("token", "mspace"));
2080
+ },
2081
+ Break(e, t) {
2082
+ e.Push(e.create("token", "mspace", { linebreak: m.LineBreak.NEWLINE }));
2083
+ },
2084
+ Linebreak(e, t, n) {
2085
+ let r = !0, i = e.stack.Prev(!0);
2086
+ i && i.isKind("mo") && p.getMoAttribute(i, "linebreakstyle") !== m.LineBreakStyle.BEFORE && (i.attributes.set("linebreak", n), r = !1), e.Push(e.itemFactory.create("break", n, r));
2087
+ },
2088
+ LeftRight(e, t) {
2089
+ let n = t.substring(1);
2090
+ e.Push(e.itemFactory.create(n, e.GetDelimiter(t), e.stack.env.color));
2091
+ },
2092
+ NamedFn(e, t, n) {
2093
+ n ||= t.substring(1);
2094
+ let r = e.create("token", "mi", { texClass: s.OP }, n);
2095
+ e.Push(e.itemFactory.create("fn", r));
2096
+ },
2097
+ NamedOp(e, t, n) {
2098
+ n ||= t.substring(1), n = n.replace(/&thinsp;/, " ");
2099
+ let r = e.create("token", "mo", {
2100
+ movablelimits: !0,
2101
+ movesupsub: !0,
2102
+ form: m.Form.PREFIX,
2103
+ texClass: s.OP
2104
+ }, n);
2105
+ e.Push(r);
2106
+ },
2107
+ Limits(e, t, n) {
2108
+ let r = e.stack.Prev(!0);
2109
+ if (!r || p.getTexClass(p.getCoreMO(r)) !== s.OP && p.getProperty(r, "movesupsub") == null) throw new y("MisplacedLimits", "%1 is allowed only on operators", e.currentCS);
2110
+ let i = e.stack.Top(), a;
2111
+ p.isType(r, "munderover") && !n ? (a = e.create("node", "msubsup"), p.copyChildren(r, a), r = i.Last = a) : p.isType(r, "msubsup") && n && (a = e.create("node", "munderover"), p.copyChildren(r, a), r = i.Last = a), p.setProperty(r, "movesupsub", !!n), p.setProperties(p.getCoreMO(r), { movablelimits: !1 }), ((p.isType(r, "mo") ? p.getMoAttribute(r, "movableLimits") : p.getAttribute(r, "movablelimits")) || p.getProperty(r, "movablelimits")) && p.setProperties(r, { movablelimits: !1 });
2112
+ },
2113
+ Over(e, t, n, r) {
2114
+ let i = e.itemFactory.create("over").setProperty("name", e.currentCS);
2115
+ n || r ? (i.setProperty("ldelim", n), i.setProperty("rdelim", r)) : t.match(/withdelims$/) && (i.setProperty("ldelim", e.GetDelimiter(t)), i.setProperty("rdelim", e.GetDelimiter(t))), t.match(/^\\above/) ? i.setProperty("thickness", e.GetDimen(t)) : (t.match(/^\\atop/) || n || r) && i.setProperty("thickness", 0), e.Push(i);
2116
+ },
2117
+ Frac(e, t) {
2118
+ let n = e.ParseArg(t), r = e.ParseArg(t), i = e.create("node", "mfrac", [n, r]);
2119
+ e.Push(i);
2120
+ },
2121
+ Sqrt(e, t) {
2122
+ let n = e.GetBrackets(t), r = e.GetArgument(t);
2123
+ r === "\\frac" && (r += "{" + e.GetArgument(r) + "}{" + e.GetArgument(r) + "}");
2124
+ let i = new x(r, e.stack.env, e.configuration).mml();
2125
+ i = n ? e.create("node", "mroot", [i, Z(e, n)]) : e.create("node", "msqrt", [i]), e.Push(i);
2126
+ },
2127
+ Root(e, t) {
2128
+ let n = e.GetUpTo(t, "\\of"), r = e.ParseArg(t), i = e.create("node", "mroot", [r, Z(e, n)]);
2129
+ e.Push(i);
2130
+ },
2131
+ MoveRoot(e, t, n) {
2132
+ if (!e.stack.env.inRoot) throw new y("MisplacedMoveRoot", "%1 can appear only within a root", e.currentCS);
2133
+ if (e.stack.global[n]) throw new y("MultipleMoveRoot", "Multiple use of %1", e.currentCS);
2134
+ let r = e.GetArgument(t);
2135
+ if (!r.match(/-?[0-9]+/)) throw new y("IntegerArg", "The argument to %1 must be an integer", e.currentCS);
2136
+ r = parseInt(r, 10) / 15 + "em", r.substring(0, 1) !== "-" && (r = "+" + r), e.stack.global[n] = r;
2137
+ },
2138
+ Accent(e, t, n, r) {
2139
+ let i = e.ParseArg(t), a = Object.assign(Object.assign({}, T.getFontDef(e)), {
2140
+ accent: !0,
2141
+ mathaccent: r === void 0 ? !0 : r
2142
+ }), o = p.createEntity(n), s = e.create("token", "mo", a, o);
2143
+ p.setAttribute(s, "stretchy", !!r);
2144
+ let c = p.isEmbellished(i) ? p.getCoreMO(i) : i;
2145
+ (p.isType(c, "mo") || p.getProperty(c, "movablelimits")) && p.setProperties(c, { movablelimits: !1 });
2146
+ let l = e.create("node", "munderover");
2147
+ p.setChild(l, 0, i), p.setChild(l, 1, null), p.setChild(l, 2, s);
2148
+ let u = e.create("node", "TeXAtom", [l]);
2149
+ e.Push(u);
2150
+ },
2151
+ UnderOver(e, t, n, r) {
2152
+ let i = p.createEntity(n), a = e.create("token", "mo", {
2153
+ stretchy: !0,
2154
+ accent: !0
2155
+ }, i);
2156
+ i.match(u.mathaccentsWithWidth) && a.setProperty("mathaccent", !1);
2157
+ let o = t.charAt(1) === "o" ? "over" : "under", s = e.ParseArg(t);
2158
+ e.Push(T.underOver(e, s, a, o, r));
2159
+ },
2160
+ Overset(e, t) {
2161
+ let n = e.ParseArg(t), r = e.ParseArg(t), i = n.coreMO(), a = i.isKind("mo") && p.getMoAttribute(i, "accent") === !0;
2162
+ T.checkMovableLimits(r);
2163
+ let o = e.create("node", "mover", [r, n], { accent: a });
2164
+ e.Push(o);
2165
+ },
2166
+ Underset(e, t) {
2167
+ let n = e.ParseArg(t), r = e.ParseArg(t), i = n.coreMO(), a = i.isKind("mo") && p.getMoAttribute(i, "accent") === !0;
2168
+ T.checkMovableLimits(r);
2169
+ let o = e.create("node", "munder", [r, n], { accentunder: a });
2170
+ e.Push(o);
2171
+ },
2172
+ Overunderset(e, t) {
2173
+ let n = e.ParseArg(t), r = e.ParseArg(t), i = e.ParseArg(t), a = n.coreMO(), o = r.coreMO(), s = a.isKind("mo") && p.getMoAttribute(a, "accent") === !0, c = o.isKind("mo") && p.getMoAttribute(o, "accent") === !0;
2174
+ T.checkMovableLimits(i);
2175
+ let l = e.create("node", "munderover", [
2176
+ i,
2177
+ r,
2178
+ n
2179
+ ], {
2180
+ accent: s,
2181
+ accentunder: c
2182
+ });
2183
+ e.Push(l);
2184
+ },
2185
+ TeXAtom(e, t, n) {
2186
+ let r = { texClass: n }, i, a;
2187
+ if (n === s.OP) {
2188
+ r.movesupsub = r.movablelimits = !0;
2189
+ let n = e.GetArgument(t), o = n.match(/^\s*\\rm\s+([a-zA-Z0-9 ]+)$/);
2190
+ if (o) r.mathvariant = m.Variant.NORMAL, a = e.create("token", "mi", r, o[1]);
2191
+ else {
2192
+ let t = new x(n, e.stack.env, e.configuration).mml();
2193
+ a = e.create("node", "TeXAtom", [t], r);
2194
+ }
2195
+ i = e.itemFactory.create("fn", a);
2196
+ } else i = e.create("node", "TeXAtom", [e.ParseArg(t)], r);
2197
+ e.Push(i);
2198
+ },
2199
+ VBox(e, t, n) {
2200
+ let r = new x(e.GetArgument(t), e.stack.env, e.configuration), i = {
2201
+ "data-vertical-align": n,
2202
+ texClass: s.ORD
2203
+ };
2204
+ r.stack.env.hsize && (i.width = r.stack.env.hsize, i["data-overflow"] = "linebreak");
2205
+ let a = e.create("node", "mpadded", [r.mml()], i);
2206
+ a.setProperty("vbox", n), e.Push(a);
2207
+ },
2208
+ Hsize(e, t) {
2209
+ e.GetNext() === "=" && e.i++, e.stack.env.hsize = e.GetDimen(t), e.Push(e.itemFactory.create("null"));
2210
+ },
2211
+ ParBox(e, t) {
2212
+ let n = e.GetBrackets(t, "c"), r = e.GetDimen(t), i = T.internalMath(e, e.GetArgument(t)), a = X(n, 1), o = e.create("node", "mpadded", i, {
2213
+ width: r,
2214
+ "data-overflow": "linebreak",
2215
+ "data-vertical-align": a
2216
+ });
2217
+ o.setProperty("vbox", a), e.Push(o);
2218
+ },
2219
+ BreakAlign(e, t) {
2220
+ let n = e.stack.Top();
2221
+ if (!(n instanceof J)) throw new y("BreakNotInArray", "%1 must be used in an alignment environment", e.currentCS);
2222
+ switch (e.GetArgument(t).trim()) {
2223
+ case "c":
2224
+ if (n.First) throw new y("BreakFirstInEntry", "%1 must be at the beginning of an alignment entry", e.currentCS + "{c}");
2225
+ n.breakAlign.cell = X(e.GetArgument(t), 1);
2226
+ break;
2227
+ case "r":
2228
+ if (n.row.length || n.First) throw new y("BreakFirstInRow", "%1 must be at the beginning of an alignment row", e.currentCS + "{r}");
2229
+ n.breakAlign.row = X(e.GetArgument(t));
2230
+ break;
2231
+ case "t":
2232
+ if (n.table.length || n.row.length || n.First) throw new y("BreakFirstInTable", "%1 must be at the beginning of an alignment", e.currentCS + "{t}");
2233
+ n.breakAlign.table = X(e.GetArgument(t));
2234
+ break;
2235
+ default: throw new y("BreakType", "First argument to %1 must be one of c, r, or t", e.currentCS);
2236
+ }
2237
+ },
2238
+ MmlToken(e, t) {
2239
+ let n = e.GetArgument(t), r = e.GetBrackets(t, "").replace(/^\s+/, ""), i = e.GetArgument(t), a = {}, o = [], s;
2240
+ try {
2241
+ s = e.create("node", n);
2242
+ } catch {
2243
+ s = null;
2244
+ }
2245
+ if (!s || !s.isToken) throw new y("NotMathMLToken", "%1 is not a token element", n);
2246
+ for (; r !== "";) {
2247
+ let t = r.match(/^([a-z]+)\s*=\s*('[^'\n]*'|"[^"\n]*"|[^ ,\n]*)[\s\n]*,?[\s\n]*/i);
2248
+ if (!t) throw new y("InvalidMathMLAttr", "Invalid MathML attribute: %1", r.split(/[\s\n=]/)[0]);
2249
+ if (!s.attributes.hasDefault(t[1]) && !Pe[t[1]]) throw new y("UnknownAttrForElement", "%1 is not a recognized attribute for %2", t[1], n);
2250
+ let i = T.mmlFilterAttribute(e, t[1], t[2].replace(/^(['"])(.*)\1$/, "$2"));
2251
+ i && (i.toLowerCase() === "true" ? i = !0 : i.toLowerCase() === "false" && (i = !1), a[t[1]] = i, o.push(t[1])), r = r.substring(t[0].length);
2252
+ }
2253
+ o.length && s.setProperty("keep-attrs", o.join(" "));
2254
+ let l = e.create("text", c(i));
2255
+ s.appendChild(l), p.setProperties(s, a), e.Push(s);
2256
+ },
2257
+ Strut(e, t) {
2258
+ let n = e.create("node", "mrow"), r = e.create("node", "mpadded", [n], {
2259
+ height: "8.6pt",
2260
+ depth: "3pt",
2261
+ width: 0
2262
+ });
2263
+ e.Push(r);
2264
+ },
2265
+ Phantom(e, t, n, r) {
2266
+ let i = e.create("node", "mphantom", [e.ParseArg(t)]);
2267
+ (n || r) && (i = e.create("node", "mpadded", [i]), r && (p.setAttribute(i, "height", 0), p.setAttribute(i, "depth", 0)), n && p.setAttribute(i, "width", 0));
2268
+ let a = e.create("node", "TeXAtom", [i]);
2269
+ e.Push(a);
2270
+ },
2271
+ Smash(e, t) {
2272
+ let n = v.trimSpaces(e.GetBrackets(t, "")), r = e.create("node", "mpadded", [e.ParseArg(t)]);
2273
+ switch (n) {
2274
+ case "b":
2275
+ p.setAttribute(r, "depth", 0);
2276
+ break;
2277
+ case "t":
2278
+ p.setAttribute(r, "height", 0);
2279
+ break;
2280
+ default: p.setAttribute(r, "height", 0), p.setAttribute(r, "depth", 0);
2281
+ }
2282
+ let i = e.create("node", "TeXAtom", [r]);
2283
+ e.Push(i);
2284
+ },
2285
+ Lap(e, t) {
2286
+ let n = e.create("node", "mpadded", [e.ParseArg(t)], { width: 0 });
2287
+ t === "\\llap" && p.setAttribute(n, "lspace", "-1width");
2288
+ let r = e.create("node", "TeXAtom", [n]);
2289
+ e.Push(r);
2290
+ },
2291
+ RaiseLower(e, t) {
2292
+ let n = e.GetDimen(t), r = e.itemFactory.create("position").setProperties({
2293
+ name: e.currentCS,
2294
+ move: "vertical"
2295
+ });
2296
+ n.charAt(0) === "-" && (n = n.slice(1), t = t.substring(1) === "raise" ? "\\lower" : "\\raise"), t === "\\lower" ? (r.setProperty("dh", "-" + n), r.setProperty("dd", "+" + n)) : (r.setProperty("dh", "+" + n), r.setProperty("dd", "-" + n)), e.Push(r);
2297
+ },
2298
+ MoveLeftRight(e, t) {
2299
+ let n = e.GetDimen(t), r = n.charAt(0) === "-" ? n.slice(1) : "-" + n;
2300
+ if (t === "\\moveleft") {
2301
+ let e = n;
2302
+ n = r, r = e;
2303
+ }
2304
+ e.Push(e.itemFactory.create("position").setProperties({
2305
+ name: e.currentCS,
2306
+ move: "horizontal",
2307
+ left: e.create("node", "mspace", [], { width: n }),
2308
+ right: e.create("node", "mspace", [], { width: r })
2309
+ }));
2310
+ },
2311
+ Hskip(e, t, n = !1) {
2312
+ let r = e.create("node", "mspace", [], { width: e.GetDimen(t) });
2313
+ n && p.setAttribute(r, "linebreak", "nobreak"), e.Push(r);
2314
+ },
2315
+ Nonscript(e, t) {
2316
+ e.Push(e.itemFactory.create("nonscript"));
2317
+ },
2318
+ Rule(e, t, n) {
2319
+ let r = {
2320
+ width: e.GetDimen(t),
2321
+ height: e.GetDimen(t),
2322
+ depth: e.GetDimen(t)
2323
+ };
2324
+ n !== "blank" && (r.mathbackground = e.stack.env.color || "black");
2325
+ let i = e.create("node", "mspace", [], r);
2326
+ e.Push(i);
2327
+ },
2328
+ rule(e, t) {
2329
+ let n = e.GetBrackets(t), r = e.GetDimen(t), i = e.GetDimen(t), a = e.create("node", "mspace", [], {
2330
+ width: r,
2331
+ height: i,
2332
+ mathbackground: e.stack.env.color || "black"
2333
+ });
2334
+ n && (a = e.create("node", "mpadded", [a], { voffset: n }), n.match(/^-/) ? (p.setAttribute(a, "height", n), p.setAttribute(a, "depth", "+" + n.substring(1))) : p.setAttribute(a, "height", "+" + n)), e.Push(a);
2335
+ },
2336
+ MakeBig(e, t, n, r) {
2337
+ r *= Ne;
2338
+ let i = String(r).replace(/(\.\d\d\d).+/, "$1") + "em", a = e.GetDelimiter(t, !0), o = e.create("token", "mo", {
2339
+ minsize: i,
2340
+ maxsize: i,
2341
+ fence: !0,
2342
+ stretchy: !0,
2343
+ symmetric: !0
2344
+ }, a), s = e.create("node", "TeXAtom", [o], { texClass: n });
2345
+ e.Push(s);
2346
+ },
2347
+ BuildRel(e, t) {
2348
+ let n = e.ParseUpTo(t, "\\over"), r = e.ParseArg(t), i = e.create("node", "munderover");
2349
+ p.setChild(i, 0, r), p.setChild(i, 1, null), p.setChild(i, 2, n);
2350
+ let a = e.create("node", "TeXAtom", [i], { texClass: s.REL });
2351
+ e.Push(a);
2352
+ },
2353
+ HBox(e, t, n, r) {
2354
+ e.PushAll(T.internalMath(e, e.GetArgument(t), n, r));
2355
+ },
2356
+ FBox(e, t) {
2357
+ let n = T.internalMath(e, e.GetArgument(t)), r = e.create("node", "menclose", n, { notation: "box" });
2358
+ e.Push(r);
2359
+ },
2360
+ FrameBox(e, n) {
2361
+ let r = e.GetBrackets(n), i = e.GetBrackets(n) || "c", a = T.internalMath(e, e.GetArgument(n));
2362
+ r && (a = [e.create("node", "mpadded", a, {
2363
+ width: r,
2364
+ "data-align": t(i, {
2365
+ l: "left",
2366
+ r: "right"
2367
+ }, "center")
2368
+ })]);
2369
+ let o = e.create("node", "TeXAtom", [e.create("node", "menclose", a, { notation: "box" })], { texClass: s.ORD });
2370
+ e.Push(o);
2371
+ },
2372
+ MakeBox(e, n) {
2373
+ let r = e.GetBrackets(n), i = e.GetBrackets(n, "c"), a = e.create("node", "mpadded", T.internalMath(e, e.GetArgument(n)));
2374
+ r && p.setAttribute(a, "width", r);
2375
+ let o = t(i.toLowerCase(), {
2376
+ c: "center",
2377
+ r: "right"
2378
+ }, "");
2379
+ o && p.setAttribute(a, "data-align", o), i.toLowerCase() !== i && p.setAttribute(a, "data-overflow", "linebreak"), e.Push(a);
2380
+ },
2381
+ Not(e, t) {
2382
+ e.Push(e.itemFactory.create("not"));
2383
+ },
2384
+ Dots(e, t) {
2385
+ let n = p.createEntity("2026"), r = p.createEntity("22EF"), i = e.create("token", "mo", { stretchy: !1 }, n), a = e.create("token", "mo", { stretchy: !1 }, r);
2386
+ e.Push(e.itemFactory.create("dots").setProperties({
2387
+ ldots: i,
2388
+ cdots: a
2389
+ }));
2390
+ },
2391
+ Matrix(e, t, n, r, i, a, o, s, c, l) {
2392
+ let u = e.GetNext();
2393
+ if (u === "") throw new y("MissingArgFor", "Missing argument for %1", e.currentCS);
2394
+ u === "{" ? e.i++ : (e.string = u + "}" + e.string.slice(e.i + 1), e.i = 0);
2395
+ let d = e.itemFactory.create("array").setProperty("requireClose", !0);
2396
+ (n || !i) && d.setProperty("arrayPadding", ".2em .125em"), d.arraydef = {
2397
+ rowspacing: o || "4pt",
2398
+ columnspacing: a || "1em"
2399
+ }, c && d.setProperty("isCases", !0), l && (d.setProperty("isNumbered", !0), d.arraydef.side = l), (n || r) && (d.setProperty("open", n), d.setProperty("close", r)), s === "D" && (d.arraydef.displaystyle = !0), i != null && (d.arraydef.columnalign = i), e.Push(d);
2400
+ },
2401
+ Entry(e, t) {
2402
+ e.Push(e.itemFactory.create("cell").setProperties({
2403
+ isEntry: !0,
2404
+ name: t
2405
+ }));
2406
+ let n = e.stack.Top(), r = n.getProperty("casesEnv");
2407
+ if (!n.getProperty("isCases") && !r) return;
2408
+ let i = e.string, a = 0, o = -1, s = e.i, c = i.length, l = r ? RegExp(`^\\\\end\\s*\\{${r.replace(/\*/, "\\*")}\\}`) : null;
2409
+ for (; s < c;) {
2410
+ let t = i.charAt(s);
2411
+ if (t === "{") a++, s++;
2412
+ else if (t === "}") a === 0 ? c = 0 : (a--, a === 0 && o < 0 && (o = s - e.i), s++);
2413
+ else if (t === "&" && a === 0) throw new y("ExtraAlignTab", "Extra alignment tab in \\cases text");
2414
+ else if (t === "\\") {
2415
+ let e = i.substring(s);
2416
+ e.match(/^((\\cr)[^a-zA-Z]|\\\\)/) || l && e.match(l) ? c = 0 : s += 2;
2417
+ } else s++;
2418
+ }
2419
+ let u = i.substring(e.i, s);
2420
+ if (!u.match(/^\s*\\text[^a-zA-Z]/) || o !== u.replace(/\s+$/, "").length - 1) {
2421
+ let t = T.internalMath(e, v.trimSpaces(u), 0);
2422
+ e.PushAll(t), e.i = s;
2423
+ }
2424
+ },
2425
+ Cr(e, t) {
2426
+ e.Push(e.itemFactory.create("cell").setProperties({
2427
+ isCR: !0,
2428
+ name: t
2429
+ }));
2430
+ },
2431
+ CrLaTeX(e, t, n = !1) {
2432
+ let r;
2433
+ if (!n && (e.string.charAt(e.i) === "*" && e.i++, e.string.charAt(e.i) === "[")) {
2434
+ let n = e.GetBrackets(t, ""), [i, a] = v.matchDimen(n);
2435
+ if (n && !i) throw new y("BracketMustBeDimension", "Bracket argument to %1 must be a dimension", e.currentCS);
2436
+ r = i + a;
2437
+ }
2438
+ e.Push(e.itemFactory.create("cell").setProperties({
2439
+ isCR: !0,
2440
+ name: t,
2441
+ linebreak: !0
2442
+ }));
2443
+ let i = e.stack.Top(), a;
2444
+ i instanceof J ? r && i.addRowSpacing(r) : (a = e.create("node", "mspace", [], { linebreak: m.LineBreak.NEWLINE }), r && p.setAttribute(a, "data-lineleading", r), e.Push(a));
2445
+ },
2446
+ HLine(e, t, n) {
2447
+ n ??= "solid";
2448
+ let r = e.stack.Top();
2449
+ if (!(r instanceof J) || r.Size()) throw new y("Misplaced", "Misplaced %1", e.currentCS);
2450
+ if (!r.table.length) r.frame.push(["top", n]);
2451
+ else {
2452
+ let e = r.arraydef.rowlines ? r.arraydef.rowlines.split(/ /) : [];
2453
+ for (; e.length < r.table.length;) e.push("none");
2454
+ e[r.table.length - 1] = n, r.arraydef.rowlines = e.join(" ");
2455
+ }
2456
+ },
2457
+ HFill(e, t) {
2458
+ let n = e.stack.Top();
2459
+ if (n instanceof J) n.hfill.push(n.Size());
2460
+ else throw new y("UnsupportedHFill", "Unsupported use of %1", e.currentCS);
2461
+ },
2462
+ NewColumnType(e, t) {
2463
+ let n = e.GetArgument(t), r = e.GetBrackets(t, "0"), i = e.GetArgument(t);
2464
+ if (n.length !== 1) throw new y("BadColumnName", "Column specifier must be exactly one character: %1", n);
2465
+ if (!r.match(/^\d+$/)) throw new y("PositiveIntegerArg", "Argument to %1 must be a positive integer", r);
2466
+ let a = e.configuration.columnParser;
2467
+ a.columnHandler[n] = (e) => a.macroColumn(e, i, parseInt(r)), e.Push(e.itemFactory.create("null"));
2468
+ },
2469
+ BeginEnd(e, t) {
2470
+ let n = e.GetArgument(t);
2471
+ if (n.match(/\\/)) throw new y("InvalidEnv", "Invalid environment name '%1'", n);
2472
+ let r = e.configuration.handlers.get(g.ENVIRONMENT).lookup(n);
2473
+ if (r && t === "\\end") {
2474
+ if (!r.args[0]) {
2475
+ let t = e.itemFactory.create("end").setProperty("name", n);
2476
+ e.Push(t);
2477
+ return;
2478
+ }
2479
+ e.stack.env.closing = n;
2480
+ }
2481
+ T.checkMaxMacros(e, !1), e.parse(g.ENVIRONMENT, [e, n]);
2482
+ },
2483
+ Array(e, t, n, r, i, a, o, s, c) {
2484
+ i ||= e.GetArgument("\\begin{" + t.getName() + "}");
2485
+ let l = e.itemFactory.create("array");
2486
+ return t.getName() === "array" && l.setProperty("arrayPadding", ".5em .125em"), l.parser = e, l.arraydef = {
2487
+ columnspacing: a || "1em",
2488
+ rowspacing: o || "4pt"
2489
+ }, e.configuration.columnParser.process(e, i, l), n && l.setProperty("open", e.convertDelimiter(n)), r && l.setProperty("close", e.convertDelimiter(r)), (s || "").charAt(1) === "'" && (l.arraydef["data-cramped"] = !0, s = s.charAt(0)), s === "D" ? l.arraydef.displaystyle = !0 : s && (l.arraydef.displaystyle = !1), l.arraydef.scriptlevel = +(s === "S"), c && (l.arraydef.useHeight = !1), e.Push(t), l.StartEntry(), l;
2490
+ },
2491
+ AlignedArray(e, t, n = "") {
2492
+ let r = e.GetBrackets("\\begin{" + t.getName() + "}"), i = Q.Array(e, t, null, null, null, null, null, n);
2493
+ return T.setArrayAlign(i, r);
2494
+ },
2495
+ IndentAlign(e, t) {
2496
+ let n = `\\begin{${t.getName()}}`, r = e.GetBrackets(n, ""), i = e.GetBrackets(n, ""), a = e.GetBrackets(n, "");
2497
+ if (r && !v.matchDimen(r)[0] || i && !v.matchDimen(i)[0] || a && !v.matchDimen(a)[0]) throw new y("BracketMustBeDimension", "Bracket argument to %1 must be a dimension", n);
2498
+ let o = e.GetArgument(n);
2499
+ if (o && !o.match(/^([lcr]{1,3})?$/)) throw new y("BadAlignment", "Alignment must be one to three copies of l, c, or r");
2500
+ let s = [...o].map((e) => ({
2501
+ l: "left",
2502
+ c: "center",
2503
+ r: "right"
2504
+ })[e]);
2505
+ s.length === 1 && s.push(s[0]);
2506
+ let c = {};
2507
+ for (let [e, t] of [
2508
+ ["indentshiftfirst", r],
2509
+ ["indentshift", i || r],
2510
+ ["indentshiftlast", a],
2511
+ ["indentalignfirst", s[0]],
2512
+ ["indentalign", s[1]],
2513
+ ["indentalignlast", s[2]]
2514
+ ]) t && (c[e] = t);
2515
+ e.Push(e.itemFactory.create("mstyle", c, t.getName()));
2516
+ },
2517
+ Equation(e, t, n, r = !0) {
2518
+ return e.configuration.mathItem.display = r, e.stack.env.display = r, T.checkEqnEnv(e), e.Push(t), e.itemFactory.create("equation", n).setProperty("name", t.getName());
2519
+ },
2520
+ EqnArray(e, t, n, r, i, a, o) {
2521
+ let s = t.getName(), c = s === "gather" || s === "gather*";
2522
+ r && T.checkEqnEnv(e, !c), e.Push(t), i = i.replace(/[^clr]/g, "").split("").join(" "), i = i.replace(/l/g, "left").replace(/r/g, "right").replace(/c/g, "center"), a = X(a);
2523
+ let l = e.itemFactory.create("eqnarray", s, n, r, e.stack.global);
2524
+ return l.arraydef = {
2525
+ displaystyle: !0,
2526
+ columnalign: i,
2527
+ columnspacing: o || "1em",
2528
+ rowspacing: "3pt",
2529
+ "data-break-align": a,
2530
+ side: e.options.tagSide,
2531
+ minlabelspacing: e.options.tagIndent
2532
+ }, c && l.setProperty("nestable", !0), l;
2533
+ },
2534
+ HandleNoTag(e, t) {
2535
+ e.tags.notag();
2536
+ },
2537
+ HandleLabel(e, t) {
2538
+ let n = e.GetArgument(t);
2539
+ if (n !== "" && !e.tags.refUpdate) {
2540
+ if (e.tags.label) throw new y("MultipleCommand", "Multiple %1", e.currentCS);
2541
+ if (e.tags.label = n, (e.tags.allLabels[n] || e.tags.labels[n]) && !e.options.ignoreDuplicateLabels) throw new y("MultipleLabel", "Label '%1' multiply defined", n);
2542
+ e.tags.labels[n] = new E();
2543
+ }
2544
+ },
2545
+ HandleRef(e, t, n) {
2546
+ let r = e.GetArgument(t), i = e.tags.allLabels[r] || e.tags.labels[r];
2547
+ i ||= (e.tags.refUpdate || (e.tags.redo = !0), new E());
2548
+ let a = i.tag;
2549
+ n && (a = e.tags.formatRef(a));
2550
+ let o = e.create("node", "mrow", T.internalMath(e, Array.isArray(a) ? a.join("") : a), {
2551
+ href: e.tags.formatUrl(i.id, e.options.baseURL),
2552
+ class: "MathJax_ref"
2553
+ });
2554
+ e.Push(o);
2555
+ },
2556
+ Macro(e, t, n, r, i) {
2557
+ if (r) {
2558
+ let a = [];
2559
+ if (i != null) {
2560
+ let n = e.GetBrackets(t);
2561
+ a.push(n ?? i);
2562
+ }
2563
+ for (let n = a.length; n < r; n++) a.push(e.GetArgument(t));
2564
+ n = T.substituteArgs(e, a, n);
2565
+ }
2566
+ e.string = T.addArgs(e, n, e.string.slice(e.i)), e.i = 0, T.checkMaxMacros(e);
2567
+ },
2568
+ MathChoice(e, t) {
2569
+ let n = e.ParseArg(t), r = e.ParseArg(t), i = e.ParseArg(t), a = e.ParseArg(t);
2570
+ e.Push(e.create("node", "MathChoice", [
2571
+ n,
2572
+ r,
2573
+ i,
2574
+ a
2575
+ ]));
2576
+ }
2577
+ }, $ = m.Variant, Fe = {
2578
+ variable(e, t) {
2579
+ let n = T.getFontDef(e), r = e.stack.env;
2580
+ if (r.multiLetterIdentifiers && r.font !== "" && (t = e.string.substring(e.i - 1).match(r.multiLetterIdentifiers)?.[0] || t, e.i += t.length - 1, n.mathvariant === $.NORMAL && r.noAutoOP && t.length > 1 && (n.autoOP = !1)), !n.mathvariant && T.isLatinOrGreekChar(t)) {
2581
+ let r = e.configuration.mathStyle(t);
2582
+ r && (n.mathvariant = r);
2583
+ }
2584
+ let i = e.create("token", "mi", n, t);
2585
+ e.Push(i);
2586
+ },
2587
+ digit(e, t) {
2588
+ let n = e.configuration.options.numberPattern, r = e.string.slice(e.i - 1).match(n);
2589
+ if (!r) return !1;
2590
+ let i = T.getFontDef(e), a = e.create("token", "mn", i, r[0].replace(/[{}]/g, ""));
2591
+ return e.i += r[0].length - 1, e.Push(a), !0;
2592
+ },
2593
+ controlSequence(e, t) {
2594
+ let n = e.GetCS();
2595
+ e.parse(g.MACRO, [e, n]);
2596
+ },
2597
+ lcGreek(e, t) {
2598
+ let n = { mathvariant: e.configuration.mathStyle(t.char) || $.ITALIC }, r = e.create("token", "mi", n, t.char);
2599
+ e.Push(r);
2600
+ },
2601
+ ucGreek(e, t) {
2602
+ let n = { mathvariant: e.stack.env.font || e.configuration.mathStyle(t.char, !0) || $.NORMAL }, r = e.create("token", "mi", n, t.char);
2603
+ e.Push(r);
2604
+ },
2605
+ mathchar0mi(e, t) {
2606
+ let n = t.attributes || { mathvariant: $.ITALIC }, r = e.create("token", "mi", n, t.char);
2607
+ e.Push(r);
2608
+ },
2609
+ mathchar0mo(e, t) {
2610
+ let n = t.attributes || {};
2611
+ n.stretchy = !1;
2612
+ let r = e.create("token", "mo", n, t.char);
2613
+ p.setProperty(r, "fixStretchy", !0), e.configuration.addNode("fixStretchy", r), e.Push(r);
2614
+ },
2615
+ mathchar7(e, t) {
2616
+ let n = t.attributes || { mathvariant: $.NORMAL };
2617
+ e.stack.env.font && (n.mathvariant = e.stack.env.font);
2618
+ let r = e.create("token", "mi", n, t.char);
2619
+ e.Push(r);
2620
+ },
2621
+ delimiter(e, t) {
2622
+ let n = t.attributes || {};
2623
+ n = Object.assign({
2624
+ fence: !1,
2625
+ stretchy: !1
2626
+ }, n);
2627
+ let r = e.create("token", "mo", n, t.char);
2628
+ e.Push(r);
2629
+ },
2630
+ environment(e, t, n, r) {
2631
+ let i = e.itemFactory.create("begin").setProperty("name", t);
2632
+ e.Push(n(e, i, ...r.slice(1)));
2633
+ }
2634
+ };
2635
+ //#endregion
2636
+ export { de as A, N as B, we as C, me as D, pe as E, ce as F, x as G, O as H, se as I, v as J, b as K, le as L, B as M, V as N, Ce as O, L as P, p as Q, R, ve as S, be as T, j as U, M as V, T as W, g as X, h as Y, m as Z, Y as _, q as a, ge as b, he as c, je as d, Me as f, Ee as g, ye as h, J as i, fe as j, G as k, Ae as l, K as m, Q as n, xe as o, De as p, y as q, X as r, Te as s, Fe as t, Se as u, ke as v, _e as w, W as x, Oe as y, oe as z };